From patchwork Tue May 28 05:05:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11C6AC25B7A for ; Tue, 28 May 2024 05:06:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6A98793A; Tue, 28 May 2024 07:06:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6A98793A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872773; bh=+fLML46oFBz2Z+U6q1KOeGG3IMo/VjOsh/XY9dY0lFY=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gTk3w3xgbJ+zcfuX/isyZMQIhjAVYOVt/CCFSJAE04yS/0kwWiWNqbYJrbUgtLdiX EDcuJbjIbhZJ4vqtxyRwCTCwbg997hYX6rHW9JQEPI5dD+FcsFexrjjH0A838E7DA8 iH/o4JTv5siG35s1BsZOipqkQDqId67aAUzMgAZw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7FFFF805C2; Tue, 28 May 2024 07:05:28 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 1FA55F805CA; Tue, 28 May 2024 07:05:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41641F805B0; Tue, 28 May 2024 07:05:24 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2BADFF8059F for ; Tue, 28 May 2024 07:05:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2BADFF8059F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=AeeaSL5d ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BBL3TbXiq8IM2FAq93I34ssHKNdtjxQaeILvzk8wV9IVC0Wbxx5HZB8y+HbJnaDPMEqXTpd3GRmgpRvUW/Soo3YtbwX8AzJYVqECo/IPvpJIveACnWT3W7+3917J4OUnWjOA9d2Isn0C05k5fTsbk7MXQBwCuDpe6y0zwJ/XNZMUnBfZ0sa28lprxAD/nZr7t12dVQq/ikzIof7tfKKQ1Lt18bxZBDgjIzEgR2bhlNpJXeqE4cbJSvehYSb3YaeoVtK2aT6HdUGnrFNLf8dm1+tKWn6A3k5AFAmyNFgBjADtEjil5klt+MAmEpE9zMPlSKX/OeEX/EGaGHaJRFzoeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OHDLeyHqoRSF/I1MFOJNd2Y3nxbWsOW6A061/JI9SuE=; b=cBRmPCQjEHRbVxM6lIWNys2eTiX4S1A1bGFtwTpLSkwbWEeD2meIIutwaG03S4EAV1n+PYC+tEMpBlfztASycVAw7teT+bEYKD0NQiN6FElaSKn4k/a2wIW08EcTH+BYw3+J46ossmEkPyd4aHJdvW5fS0473db/rH8dfijfcq5lEHMrN09dYiNKmD4iU0jUoaeQNHf7yAl5IVklAAd/EW4DpUDBw9sNDSW7OTKKCY6MoFn40LntYvJc0izE0NlsB6NDqkm8qj8d/xUOWZU+Fl1V8NhOVfi2KieV8Zxac6NvrWWQPAMjNwu6WGL7Pi4IlsFclNNC0ZCA48+G73FX9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OHDLeyHqoRSF/I1MFOJNd2Y3nxbWsOW6A061/JI9SuE=; b=AeeaSL5diMcXDIhTXIOObBG8mbdvqaT4PKcVA1C0ONuT83fU13MtrVxY9dHeklpiHrjtZMMByZuVC40i6wUHLAZurjIPSWJYazt2um0hA3nYpsPY1LeRWiENLWgRc6A0DnqHIL9aWWzIRhs3tqhn/fixQWQl75wdgKMFhA5BhZs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:14 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:14 +0000 Message-ID: <87a5kah6gm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 01/11] ASoC: simple-card-utils: remove both playback/capture_only check User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:14 +0000 X-ClientProxiedBy: TYAPR01CA0102.jpnprd01.prod.outlook.com (2603:1096:404:2a::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 58e36699-6fd9-4995-d42e-08dc7ed3c241 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: 0dLypkDoDpspmldvfmi74O+I2LNSOzRwjcw6nlB/hzP3+QP03+mttRYFGVSpdU/ZKLS91C8mk2Kz/QiKguMIuWLx7055S5l7DM3WpDbCudENhdSdJtJX7630qTvfvNqVXrXGyKO2DXKvltdEEr6TCOFxzdoJsOq4Rhn49NNqI/9UZyMAcBTQ1QKftVXYCSNhoPQUPVCCg3YNbZ989jFz8ZQsUIR6rnFGaWPxw9/066447KJvPx1m6nBYKp8nNyA+PuIfcHmLY1jJvyXUbma8VjLxLw4dxu37hVvnXnlDPC41uutp077nBofkKPUtxsGZUqSVtsEq76ZSjNt1yvGEMLDAfIHqvwoBu0MBlW5yOk6hj/poN5OJRiO6FxrpaSJ+rbj6tFXK6GXX6Zy/RizITFE6U3OCehZPuwu2RkIGDLq5rIVZCwL+Chc3MuJcIB43DE2ICcC7+7kwvIDFm5dV1mxxB82JMMTRjFl2gvh6jJXMq8eCwJjL2ivJ6L8F/iH770k8fKoufXFcrnFEmJWj5fPs5sGrUvPPAoov1wHnMytgvgB2tN27QSBdBfvFGWq9/Npib+52kahfIejgINgoOTbHhpFRAeeQyWDg4MdF2FxJITo07BfL7t6RahIQ6IunXIvAmBnecOoqnHK8OPh5Q+ooboyv+CvfsiHzfA0fIPkbNr8CzNz95aP6Exayw1QA4m47qWdSA6StMqv/6QcENdUTV8qYyk0orBbNd3GML912aF1rM9spElSwCpyAnnop3RVgUJWATJIN0KHxmENRjAg2wyFfhITJ0KtpVIWhfrWGEhykAVuOKwwcNMbDqK9aeeOEHvhbYA1AzPIug7s5aihm6aTjcl71d1KKXsB9DJO+WvwV36rSPlBcK2Bh6ljr4q9DsTcqyBMI4GACIO+xkoA+3G5LS7Ok22SBJazQE+ll+w15fzyqwuwY+R0Ey9QCU540wYPl7ChUFwnmmEOfW7fDIKzajafgCzE4hRxWc660hxuCbdpfzdlS6UGYHJZcTCEXLJMwODRFoVy/5WIZP2GRV1REMQqzilyKg3Ffj2RNyrfMY0/dhNtB7WQCrePw5bldunEMfA0rg9iYSZmonQRV0fZ0gbCXz2fAjDKi1yvRDeM+jydR1QclAvSc6RRz/3Dc4POCGD8mC7MMMkhrL63u5c3n24S0Ghf+MQFIPT0UMvPMmj/N1KmcFEohLmdgX9X1VwlCDJnVRGcjI6IVrLUXZl6v0NM5DbudPlkLRvUAjRVkjeGcLPKnLkj0+Nf0QjdYGjhsLuFYJThDUhMh4c+EQYvw221X63dvvp7f/Rvi3KreLAFXk1lNvYrlQGrY35xuEFr4PxRtJaqulNxe1g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-Message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+Po5RKAoOuNUhcc3XQElzGnZRLBZk/aPYTZAbAfihferiRc2G9ZuNYUHlP8o4CPN99k0gQCfqCjesLTLbhNIoJebhT7nlW0Crs30A8ibzkffgFcbsdaSB+rA7orAZkjd9LqqhccmxED6FD0YHq0kMhU2/idw8yZmLiHjhJSpBLwT2YhXFLJJ2vs7vLXzpjQDQ7yznpH8tDoc+UyCVXUf9qhJgJoIfYWKCEqeIaqc7a3OCdqvqPGAMJn7OUIaWrgHibcvOBkYAz7g2TG3+mlAV3mVm6ZE4A6+bMjfFXLXFwDTCBRSxc6m3BUNe+RDmWZJ7Gcds2jQURY8Bn7m2UmP9MSc4D6x0A2gtg2f4g4QA8Pma2nc+z6qorG/nLEi4KItjaFeEGJkFL+tFUyFe2Q9pSqrx/rA+7o0ry4tGYwF6ERawSZR0mBzr51hXKOTORhWoWdCCsvDGsfwrRJET8n+n2kPfENVGevR5HVfmjhxMQwo4s4ANA0Jh1sR4hFNFDHPU8fIF1s7vtCS+j7oVFLsCtdXuRfdBxpUcamYvlhP5eUyouUywVennQ0uRpCpJXsLFfD0Vo5o/LMNuvtHZ5OP8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e36699-6fd9-4995-d42e-08dc7ed3c241 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:14.3101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u7n+mGzRNKn4rCNYglDLcZ1mMVfnLh/PYUAH/Nr1xhoJni8s3PBUQo3o3POuzr+4nNCKjCjy4bVkTOdCpN44BMVyS7F4y7lYuf9hpSqo61feQeNN4wdjekjzYQb1cRSL X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: K6TYCRUFNYOXYKVKFH54SX5X7ZSSAJSS X-Message-ID-Hash: K6TYCRUFNYOXYKVKFH54SX5X7ZSSAJSS X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: soc-pcm.c :: soc_get_playback_capture() will indicate error if both playback_only / capture_only were true. Thus, graph_util_parse_link_direction() which setup playback_only / capture_only don't need to check it. And, its return value is not used on existing driver. Let's remove it. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 2 +- sound/soc/generic/simple-card-utils.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index ad67957b7b48c..1a96e177158c8 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -195,7 +195,7 @@ int graph_util_is_ports0(struct device_node *port); int graph_util_parse_dai(struct device *dev, struct device_node *ep, struct snd_soc_dai_link_component *dlc, int *is_single_link); -int graph_util_parse_link_direction(struct device_node *np, +void graph_util_parse_link_direction(struct device_node *np, bool *is_playback_only, bool *is_capture_only); #ifdef DEBUG diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index b4876b4f259dd..17718c58793d2 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1126,7 +1126,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep, } EXPORT_SYMBOL_GPL(graph_util_parse_dai); -int graph_util_parse_link_direction(struct device_node *np, +void graph_util_parse_link_direction(struct device_node *np, bool *playback_only, bool *capture_only) { bool is_playback_only = false; @@ -1135,13 +1135,8 @@ int graph_util_parse_link_direction(struct device_node *np, is_playback_only = of_property_read_bool(np, "playback-only"); is_capture_only = of_property_read_bool(np, "capture-only"); - if (is_playback_only && is_capture_only) - return -EINVAL; - *playback_only = is_playback_only; *capture_only = is_capture_only; - - return 0; } EXPORT_SYMBOL_GPL(graph_util_parse_link_direction); From patchwork Tue May 28 05:05:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDAA8C25B7A for ; Tue, 28 May 2024 05:06:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DF9DEDF9; Tue, 28 May 2024 07:06:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DF9DEDF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872784; bh=LqZ9LPai6D3tBWVmoXuklff54MKyld018/fdKZ6snpQ=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dyIRTbOyyx37NGfA4Zer5Kw+U3ZtxfRl76tU6/jeZ+3J11fJluSAVF7lMUBpD26HI itRX1W0q0c4tkGIVsTYjA6mLXOYmj0LpsXFIZddtgiThL23WPl1vPqNyj0Bf/Hm5DD eI40/1phKbXxc6l/rTJXk1iGe278uLfvW99DxKgY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99998F805EE; Tue, 28 May 2024 07:05:33 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9BB20F805F0; Tue, 28 May 2024 07:05:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B3051F805C7; Tue, 28 May 2024 07:05:28 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 03996F805AC for ; Tue, 28 May 2024 07:05:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 03996F805AC Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=UF3kQq0S ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATWvc+oNWeS0uF+m4Q1WyThZONjOxoUoMiTaRsoT1OfxROiE/2Wb6HTK2cTR0xB2JqaVktETpU33kWEOKTevNt6oxnSRevl0JOdCSUay5bYZGNEOrFa6AFX2Ks19W3R6tEkyvoTW/phkr1hEBtRCXoMqo9sTLxfE95ytYQ02ye271Vn7kDRrlZfSVZeBF8tHlKafdnBSlDLI/+Nv6e3JCOUEhaxwSRx6UOaiA5gMwzPHKKwZiO/PkSJCeaZTXlBBKAJQ2NL+ztqs2uUvJ5tH44ukksCq3IEw8OT37EfafFeYiMTUc3FyxqRcf8InwYiR4jHkWRXgsJ3SbXRBDI+E4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cV8QtdZqUOfVwW9JsViij6jjGVtib6oUgOQlWZMjWrQ=; b=ZyquGU1FLCNUvYTl5QgdKJe9rb59SOS19ZZdxcm36xq3a6FaP70GjfmsRaZyNlWIRMSRDWJYj16SPcklblt/sikgmLVtXaQ+uxo8k09a6T0Er92BLWY2LODidNeLee1QqrnGaXFRtqcENVuL1cpSlEkbRdMVnt5+IJRnQP2hOapHlnJRYtQXDWkJeQOh0e0fyH5hw1S0anIkemj39ZPg54/fzz7fvXP0mXf3fDeZjHNU1PPHHMislpwh//2KUI5hYppNQ25xcQXjegkIVdnrqtxEXFrNhHck6ThluCNl2Ev9Btn/D4kWrQrbf6IABITc+g6qpCRzYo7M8TNMh0vXjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cV8QtdZqUOfVwW9JsViij6jjGVtib6oUgOQlWZMjWrQ=; b=UF3kQq0SQX4//DajNN0e4pwol8mRQkZ8mxqXk3zlPyR8OOYo2IzPARQAM2ns/HCcB9WmecKseC/HIveL1GtfLwwxC9RSn+HVT/l3Z0fKBsQACvQ36ZC+VU/dzjI5BTVKJMUl4spwVeWvx67j9Om2jI9yh8zxMrcRMuh5OWQpUeE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:20 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:20 +0000 Message-ID: <878qzuh6gf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 02/11] ASoC: audio-graph-card2: add ep_to_port() / port_to_ports() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:20 +0000 X-ClientProxiedBy: TYXPR01CA0043.jpnprd01.prod.outlook.com (2603:1096:403:a::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b9b5e7f-6204-4d9f-7732-08dc7ed3c5e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: 15pvUqGttBNnM+S0EXDzzIO0ID5YK78oxCMEoyvSGbWNzb92va18j1OLAigRqehM65moN5DuymjIXND587QxEhBwzAPWeU7IGuojoNVYxx/cDUPLx1Zrs1NjhWlMEFmecJdIa49+O/YlqrCbAK1Ybb0rfePGVJKbIcLGems+FwfKnZU3y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Oy7OYPlkVwB5xcq7emVB+IRmB61H3wrqCg+eg1eRehckXQX0WjLH0AJj4F7PCgwhfjon75WISn7bKoHE2cLe8e+TuePvUTFpVCE/IInzRiw7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +QnbR3JLw7xMBhIq08Jzfs8lVYi079oSetjDjNLTdzexXHXBv4qBKu8BghxaCv35/q2QOfpspacPX5pjS8CTGImUm7UcIrzKct+Baw8UueASxIBNH+iqnjsQOvAtfP1X4oRUuj45Hnv345UvZ3JUhozBUy1zR83YisLjRLP3hr9ctdNXwbN/fxDtBPn0rC9LWrx2/a2+IsaXjvypzGlVv08fxyi9Lk3KhjyWLVwsLWYkLAb7RZSkXzWQX8bjR/rGRSQEOTq/H6qvHXNxQ5mNh6I92/y24a58nm2H6yioAiU769st3IDYEM1kyArnCCwcQ2E4yVssIbUcG9geETFih3FttcVWh0d3BHyTXKrAqeiHr5LN7IZpIFv+5MnhDQ9315LK6Fddfxmb3FR72iJM5b34DvPGcjkCUSkEKSPN2y8O1kR1t+3d1Mg87VqCVWrXcScX1ITH+yMBCN2ydYlb8F3whiLeboHN/5VmxlzP8TRKWPUmZvcfq7zVp6E0inB8+0aXm/JIdFzdbD0VjFBLAlB3MzGRKv3oIb6r68D+bxFqojfhUmsiYUjt8pz5fEviAlAczfFBOCavEaqmszKHGHsvGvaSCnSNp+5qdj5dZmb4wU17WKU0DlXMMcdBfTOa6JULRAV8lYb1X74GFyWE7yWfX4tePO8lf16ho7JLAbCiZjh95Gp906SDfIow+xk6KFNsTBNHC7Bfly1nGizyJrxEs8Z1Y/KeKArqLEJcmsTFjNzlmXGYaSyfSGPW1bjNnIBWkY0j1Ku8Xah6BrEAC/ezHr6ZKFuRTZ2Xnv1Y3RKc1iJ/0pJ8kVaxWUeqCBFQ5JQWJP2cQbeSZcdMzty1NEdUvtrl0QXTu8LGfRE01+pHf0KfC4Iz/0+QezaWjqMc9r68PQBO/vamIX7KmmpA5A+OXG3DL4UxXwe3mwyXWsswuhGC4c3RqZpU9miCZK1daghb7O+Vxf+gJ+08XI9OFYdJBpcRfq/PXhI8pAaE7CLUmtWN0mKD/kNtH7mEnRPIgjDUUIs73Xu+N9MhsT1hE7Y355fezhXjjk9Nk/BftTZTgpTVKMoltnOi5aJyACMyxwgdr0aKD9ObM29YHiZvDVfs63KCW06kPSyL4SxPvIHKxe9meIGJ4Rh5vZkYrcgYAQJkn8bhlZreeyR3DCll2EcjTP/+W7iHQq9uzsDktp+ZbQmgj18zm/Kb2lS+vp8zXm2I2HMVQwOhfmkWhsPORL6JgZoqxXnzTnDXOVZWgsx6G6m4p6KnjwqCksJKb2QtNo3Weus+PNtaQxh8HQ1QPKsybUpmfVM+IyRtMylFkstLnVjWgiiDXhms7/GoqIX1jVoiIx+VK1caU2dtoG7eywFfBHk4elNmgmL0LY9kubMjP/fgX82h9umdsSjdBrLbTiopHGserZLBN8z8JVhvciT7RaTSqom1GGK+ytpL7xWmjZwyvaVY5U5j0dbYamWNGFZh5fbORBwGZsIfGHSGtl8FPIrec1gGRj+uUy7uSFMYJDukXpTNH1pbiDg5aqOUln5xNVGhL3LCDIxEykBTd9EWHxV8qwXNqrGiKLx195jM1aVhJYbTdPCYvQ+JRB3dUo/kUlPyGQg1bmDRleGiMt1I2jF7+WVA2SABgEzlhiU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9b5e7f-6204-4d9f-7732-08dc7ed3c5e1 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:20.3492 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SvpRQeONQEokTM5D4mYRUkLWq8duSENOEc5OHpOIMj08hBiL6IA1qwlBIX0YgwpJ6FKM1xeH/zc5Ln7Txp2hj8AYHgzTcS4nr23j42z0AIyzhaPeojwaSsAQiyGLphih X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: 7D6VGGYLKX5445MQFARGQJ25PP4HZ34P X-Message-ID-Hash: 7D6VGGYLKX5445MQFARGQJ25PP4HZ34P X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current audio-graph-card2 is using of_get_parent() to get "port" from "ep", or get "ports" from "port". But it is difficlut to understand, and "ports" might not exist. This patch adds ep_to_port() to get "port" from "ep", and port_to_ports() to get "ports" from "port". "ports" will be NULL if not exist. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 46 +++++++++++++++++---------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 81e84095107ed..58123fbc29046 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -236,6 +236,18 @@ enum graph_type { #define port_to_endpoint(port) of_get_child_by_name(port, "endpoint") +#define ep_to_port(ep) of_get_parent(ep) +static struct device_node *port_to_ports(struct device_node *port) +{ + struct device_node *ports = of_get_parent(port); + + if (!of_node_name_eq(ports, "ports")) { + of_node_put(ports); + return NULL; + } + return ports; +} + static enum graph_type __graph_get_type(struct device_node *lnk) { struct device_node *np, *parent_np; @@ -320,7 +332,7 @@ static int graph_lnk_is_multi(struct device_node *lnk) static struct device_node *graph_get_next_multi_ep(struct device_node **port) { - struct device_node *ports = of_get_parent(*port); + struct device_node *ports = port_to_ports(*port); struct device_node *ep = NULL; struct device_node *rep = NULL; @@ -365,8 +377,8 @@ static const struct snd_soc_ops graph_ops = { static void graph_parse_convert(struct device_node *ep, struct simple_dai_props *props) { - struct device_node *port = of_get_parent(ep); - struct device_node *ports = of_get_parent(port); + struct device_node *port = ep_to_port(ep); + struct device_node *ports = port_to_ports(port); struct simple_util_data *adata = &props->adata; if (of_node_name_eq(ports, "ports")) @@ -381,8 +393,8 @@ static void graph_parse_convert(struct device_node *ep, static void graph_parse_mclk_fs(struct device_node *ep, struct simple_dai_props *props) { - struct device_node *port = of_get_parent(ep); - struct device_node *ports = of_get_parent(port); + struct device_node *port = ep_to_port(ep); + struct device_node *ports = port_to_ports(port); if (of_node_name_eq(ports, "ports")) of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); @@ -481,8 +493,8 @@ static int __graph_parse_node(struct simple_util_priv *priv, if (!is_cpu && gtype == GRAPH_DPCM) { struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, idx); struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, idx); - struct device_node *rport = of_get_parent(ep); - struct device_node *rports = of_get_parent(rport); + struct device_node *rport = ep_to_port(ep); + struct device_node *rports = port_to_ports(rport); if (of_node_name_eq(rports, "ports")) snd_soc_of_parse_node_prefix(rports, cconf, codecs->of_node, "prefix"); @@ -539,11 +551,11 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link, */ struct device_node *mcpu_ep = port_to_endpoint(mcpu_port); struct device_node *mcpu_ep_n = mcpu_ep; - struct device_node *mcpu_port_top = of_get_next_child(of_get_parent(mcpu_port), NULL); + struct device_node *mcpu_port_top = of_get_next_child(port_to_ports(mcpu_port), NULL); struct device_node *mcpu_ep_top = port_to_endpoint(mcpu_port_top); struct device_node *mcodec_ep_top = of_graph_get_remote_endpoint(mcpu_ep_top); - struct device_node *mcodec_port_top = of_get_parent(mcodec_ep_top); - struct device_node *mcodec_ports = of_get_parent(mcodec_port_top); + struct device_node *mcodec_port_top = ep_to_port(mcodec_ep_top); + struct device_node *mcodec_ports = port_to_ports(mcodec_port_top); int nm_max = max(dai_link->num_cpus, dai_link->num_codecs); int ret = -EINVAL; @@ -566,9 +578,9 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link, } mcodec_ep_n = of_graph_get_remote_endpoint(mcpu_ep_n); - mcodec_port = of_get_parent(mcodec_ep_n); + mcodec_port = ep_to_port(mcodec_ep_n); - if (mcodec_ports != of_get_parent(mcodec_port)) + if (mcodec_ports != port_to_ports(mcodec_port)) goto mcpu_err; codec_idx = 0; @@ -765,12 +777,12 @@ static void graph_link_init(struct simple_util_priv *priv, if (graph_lnk_is_multi(port)) { of_node_get(port); ep = graph_get_next_multi_ep(&port); - port = of_get_parent(ep); + port = ep_to_port(ep); } else { ep = port_to_endpoint(port); } - ports = of_get_parent(port); + ports = port_to_ports(port); /* * ports { @@ -966,7 +978,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, */ of_node_get(lnk); port0 = lnk; - ports = of_get_parent(port0); + ports = port_to_ports(port0); port1 = of_get_next_child(ports, lnk); /* @@ -1098,7 +1110,7 @@ static int graph_counter(struct device_node *lnk) * ignore first lnk part */ if (graph_lnk_is_multi(lnk)) { - struct device_node *ports = of_get_parent(lnk); + struct device_node *ports = port_to_ports(lnk); struct device_node *port = NULL; int cnt = 0; @@ -1195,7 +1207,7 @@ static int graph_count_c2c(struct simple_util_priv *priv, struct device_node *lnk, struct link_info *li) { - struct device_node *ports = of_get_parent(lnk); + struct device_node *ports = port_to_ports(lnk); struct device_node *port0 = lnk; struct device_node *port1 = of_get_next_child(ports, of_node_get(lnk)); struct device_node *ep0 = port_to_endpoint(port0); From patchwork Tue May 28 05:05:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 421C6C25B78 for ; Tue, 28 May 2024 05:06:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 312D3DFA; Tue, 28 May 2024 07:06:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 312D3DFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872807; bh=RAj+toQ4SADLBgedd/PKIfprcwUVfMEMfxpH2eBRK94=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jnXjjwYvOyFBd0f3xoGOVQpHkc0xvp/HTvg+/YWZslmlKC1ZSdakKnMdoJv8+Tfne 7qxPNS5d+p4MKsyRUfr0juRuxOctwz50ENF6YjieKrN4BF716fvRk1vcGbv6FVfXp0 QaadZtOGryeeS6k+a/ggPF/9tTf7vrUeiupFy9OM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E5CBF8061A; Tue, 28 May 2024 07:05:39 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CA02CF80610; Tue, 28 May 2024 07:05:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A21EF805F7; Tue, 28 May 2024 07:05:34 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C985DF800E9 for ; Tue, 28 May 2024 07:05:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C985DF800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=IB1uZ2Ao ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c46nvD76dI7ssn0dsGeThKeqnyHU5Ug127FnCVyJasR0wmLrjMuRHRrG79PEeW3/8qbt4aAyz7VSe3mk0vXnVs9egWk19CBILj01oseLR/Ddv7iUmalww+mjfPRDHJbiQZzBmwx1O3iiYnF7BTY2zlEjeewxvtMdjWHFLSQpaNPl9QsClB0tlNUrltwlDTiPMDbIZGOZjwnZvS876OmyyvSIta2MJG+J0ZG3F9Ljv29xUMdZ3+t+RzmZD8GG+s76oljCU1xypIrWVxgwC9M4YrPv/LlYfF5fiLhUTkr40RNV1M+A1gAfO3+xS8//N/lzfJ2CWuNuRp8oEPQZgvK5BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eYDPWN70id/pqSZTV4B1QGwYc76mIj8P3Zxk5otIMjY=; b=WfVeziMdaeuwkBgrkSn1qTN/w+I4aI0s4SI7lBtbY6CW5UohKoO6vkNwRmvHTkeiNk8cR780bylWKw9kqtvwC9aproEyVvGbIGRTjIMVF+e3j1I3ajNqQm9KDXJkkdv9EqJjcT+CtW/AgN0Rqqv2YMbBGQH5GtExgyg5xFru01wPKuB6JXNYtkmuU64JjwXBUgggFOeJxMiPN0kznS94QIW3D6vH5z8MI8/stNj2nn8q7kwUL5pC5IPxwopdenqP0sjJYxA8Jgnig0fdNwJ4q/Bd1LeF3pa5vYcvuBDI1TOpQ9Lj052G61+1UyPgoUm8tfNQNHBrdAFGwoLfCoaxFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eYDPWN70id/pqSZTV4B1QGwYc76mIj8P3Zxk5otIMjY=; b=IB1uZ2AoZArReyVBifcrMQU2FbgzWh0woq/WhWwypuqTAkiOV5jbJjME0SvPtwa7o+yIfxpzGBVG3qOjqSzqeeg5vXCgvrCpT/3OyIfNSeFhZYwDJb5l5Gw4hJL4Ou61V8s/ZRXtYWhyMhDKOnKUgRLxh5T20tfobVw3bunw3PY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:24 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:24 +0000 Message-ID: <877cfeh6gb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 03/11] ASoC: audio-graph-card2: remove ports node name check User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:24 +0000 X-ClientProxiedBy: TYWPR01CA0049.jpnprd01.prod.outlook.com (2603:1096:400:17f::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: ae2d678c-cd60-40d0-7e81-08dc7ed3c849 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: hX8mj8EIX3IlRb9bdTdQsqqGhUnFcGVlqVww8mA1s6WhPCTuKplClYrclTJZe/q64aipjJYJHewISpn/yOHHEsJeWK1ZqMm07XS4KmM4CV1H2AkEgzh5Im6uRATmHYQ6dVGYE4lKqh02aaNAlQwgb0ijy908oXefUuXxdX0Ssofgd8Kjt+ymX++jkYoQpswkdUSGu9g5V11z5NoDEEsBC34Wp+evE8gBpZIlVQ09sqxBwY6544zeCKxHlNMTrAeEzMdbHF/0Cgc5cXlZhuihHn9kb+kaCz+2Qy/UN6NNZCMZrv6QLG34NTQa9QfIUT3lUhb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ANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i6J/2KK0znUli36f8rjF/A+Wcv0ZUn6xPij7MhDkbWCYuTz0xv02cW56It2r3m+s280W97FQySmyCfOmSir2rS+020NpgCJKbd+ie3QaoFjcsGSZ0dwzuT5In91bV/d/8dcmbpO6dVswW5FOtP4D6c/hSzdf1BA1eaud4qrSd6cGBDh9J0jdP5Dt2oZ31Hd7YtdsthVAGuWpAAtWEGzAiD6BuH9nlX7re85KzkmgY9AYx2t1XF9fUPGkgln12eq3zH75jPkxfZQCHHHRe/orvYhcMWQms1sbUxrrYerv29YGuorzX3ZEbqVP4Dw+Mz3FJSFerlLaIyL2YEEGfU3bin2EFNANczesRcDtg3+4UKc00ZXtOsKi9/pfqflWRnrEQYInpdlp5A1hLJ6m2u1l0x6hqKSfCxwjHyPC0oXTDU8KG2Q9Gy4jkzHHuFKgImpLARm6Vi68LnQoFQSrbkqzR1/YW5ux/hQ5AbRHQvHC5ba4Sdxr2s+QDqMAcjZtIZCZEhCYB5/B8hNbdpQmfnGk9G/IuEce8bxzsbctGRGTTlJB0W3KwRl8DI5Tc5/5JJ50DFDKq2YmyPIMGnUSYnD/wtstFVS1nb9tKI/NGI8Qqd60k+ojMsyroQY4oFZG5pQyd7JdmWcuXuuEspubX0wx3FOfoDJaFoB9zff7Z9c20KFn8nLDe/qgLrW5rm6loZOWw+sDL95oiKac3JhsmVqcSzI/l/vxCf1mP9up0VSPNMfAIq3Z9P59h+fQ7NxBhXHtVyMelk0BCWgzb03rWOdaFbKZo4AZW6pI+v7+N4AyC6fBkubR1tsQ4vXClRzPSgx9qGancbpc3L6NAubUwYZPCKdIiI+p5+30CjbqPHGSdaLpi6eDPht09qD+vLTMvLhl2Jwye3yV0v7gJubNO7V/U4HFthGPRGZrKVu+reTDYHA4Y0Qxi0TBtd2kU/dAqo81j90xsXCO4rm75871pnsl01IJjU0XE0nwCsxbx0gmelbi5e6RIX/Qwa0Am26wCaud3lox9N7D33t9qXxRwPvsNxZPqYgz1On2IlcV5PtZq2X9AdI119aPShCpPywrxsMRcczNoNyPrUaDc7TfAwTyZHWeG/zBlXUzicLarNUfqMCJbXWLOg/U/QA2sIZQowi83CWSEO31y54ib8aCgFoW3jdE9p926khTqg6582B7RdK4C10I85p+aeBkw9jPKXnfIh+VRP1jA85PVqfXcr4OcVUso5WRfuyZTMAAek1FcB/gTZy7Qj95Rh1q+KV8sdxOJpe/t+6KnW5EwCPjONUyZDttfrEA91swsyh43bUgsVl3lqx5zCIhxQmMfWk6mLqbb9FTaGwYEFhkM4tEYTEhWZQPmcSZgpn8XgNfjTuecFi9u+uktVJo2tjMNO6lIhoBJZwbPkCsIJVoiLlpGo6C7+dSVHTbgk/HVHvFXDCs2TYdKf+YQ4yHLt+mJ/AcRGgCUh1TYGUkJcUY0KhMbGIuIrh/eXs6XItTjNQKZV078iAgvyee8ylxnGxphxPzHj/zHSntVPAcWCxxExg0eerGuFRaH+dmWnTHABi9ZdwHz6hhb5C/BVsAsq8BRuFh6A3tlx5r3PZ+LThIi8Wxje8OB7bKHW8GncfOBjbl1vFb+iw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae2d678c-cd60-40d0-7e81-08dc7ed3c849 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:24.4091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Cl6Tyxu2U8ERpWuIuj5t9RIbMd+RyZi9S8tmWIkeiLtAS6TdfQizLSO/6PrDwAX5CxTO8l6SdR54BhVcYp0Dn6evaYpeyB1//tuSPbCsrutdFw0vvjTpoC+OKaiMPouR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: JL27J4YSR26GVDMB6FIDHERQ6ANV7AUH X-Message-ID-Hash: JL27J4YSR26GVDMB6FIDHERQ6ANV7AUH X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current audio-graph-card2 is checking if the node name was "ports" or not when parsing the property. if (of_node_name_eq(ports, "ports")) of_xxx(ports, ...); Now, it is using new port_to_ports() which will be NULL if the node doesn't have "ports", and each of_xxx functions will do nothing if node was NULL. Now we don't need to check ports node name. Let's remove and cleanup it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 15 +++++++-------- sound/soc/generic/simple-card-utils.c | 3 +++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 58123fbc29046..3029e8ebfa222 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -381,8 +381,7 @@ static void graph_parse_convert(struct device_node *ep, struct device_node *ports = port_to_ports(port); struct simple_util_data *adata = &props->adata; - if (of_node_name_eq(ports, "ports")) - simple_util_parse_convert(ports, NULL, adata); + simple_util_parse_convert(ports, NULL, adata); simple_util_parse_convert(port, NULL, adata); simple_util_parse_convert(ep, NULL, adata); @@ -396,8 +395,7 @@ static void graph_parse_mclk_fs(struct device_node *ep, struct device_node *port = ep_to_port(ep); struct device_node *ports = port_to_ports(port); - if (of_node_name_eq(ports, "ports")) - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); + of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); of_property_read_u32(port, "mclk-fs", &props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); @@ -496,8 +494,7 @@ static int __graph_parse_node(struct simple_util_priv *priv, struct device_node *rport = ep_to_port(ep); struct device_node *rports = port_to_ports(rport); - if (of_node_name_eq(rports, "ports")) - snd_soc_of_parse_node_prefix(rports, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(rports, cconf, codecs->of_node, "prefix"); snd_soc_of_parse_node_prefix(rport, cconf, codecs->of_node, "prefix"); of_node_put(rport); @@ -717,6 +714,9 @@ static void graph_parse_daifmt(struct device_node *node, { unsigned int fmt; + if (!node) + return; + /* * see also above "daifmt" explanation * and samples. @@ -798,8 +798,7 @@ static void graph_link_init(struct simple_util_priv *priv, */ graph_parse_daifmt(ep, &daifmt, &bit_frame); /* (C) */ graph_parse_daifmt(port, &daifmt, &bit_frame); /* (B) */ - if (of_node_name_eq(ports, "ports")) - graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */ + graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */ /* * convert bit_frame diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 17718c58793d2..7ebf59a03e698 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -46,6 +46,9 @@ void simple_util_parse_convert(struct device_node *np, { char prop[128]; + if (!np) + return; + if (!prefix) prefix = ""; From patchwork Tue May 28 05:05:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62DC1C25B7A for ; Tue, 28 May 2024 05:07:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CF77E93A; Tue, 28 May 2024 07:06:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF77E93A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872821; bh=gVxCSNNWanWDEHbZ1oQA3Tz502dkOPb9WIpb3ZbBI/Q=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XPdjjzeBYwM0RN1kF3ldbUypIhwctUi03sF+5dyW3veDu3WLAsNmTyANWHYom/6Nh 9/OT16sON+K6sbAGTFWnLS83oTVuL7qSdu5nrHVuSD4ubpwbFtQkN4DJ8zDh7jMSZP TMdxoJ3xaPjsUfiHiRaz0bjJRTlgwGN/ZT65czWQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0F8B2F80636; Tue, 28 May 2024 07:05:44 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 18E4BF80637; Tue, 28 May 2024 07:05:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7C34F80615; Tue, 28 May 2024 07:05:38 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B2B12F805F2 for ; Tue, 28 May 2024 07:05:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B2B12F805F2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=RYJ6cdUF ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RVFrrnpoaKFvKK3wz4OVOxCwxD7Cy9HAXVa2ygTIo0+0CVrHA99ho4YuX8CxiWXN2fQ/syLMYi3HukR3WaJb/lJ+NCfFpvwqQm25oud0o5VAV1tOQ4q+ggxpYxCYc9MURrT4sD+JN20wNEfY/+BYQrNCOpVv4+btKYmOL2CnBz/a1v/nL/34WciO89MEm8K9SJTec8tzoaFB6EBX7xpAksMkwyudUHCAjKu5LtyvHcxpRxhPukaT3lSGzykwVeT6a0J1yi3QotM4MCZtIvnbGZCAWurhtA0m2FjKT4UY2PyJRKLTkyg3+n/V+IWwIlwxaSooCb5cpfMC6lzFL7QdgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SGmTkOHjssSgQt1f+aWvM6PYhtluDT9PBlSTSx+gjag=; b=JvvBVX/bbGdij1ZGh8TaMoZ7DCgD+toYIEYs2ukqLCHN3SMYL3nlvLDPR0pkfWULyzNXLIwjt6IOuJW/t9G0pMon9K3LWbzDsK5tA/AJpnqTbX+vWQRgX6ykxLoKQpOgwdC0fNKCAOHVA4WwPzpbQMZHD3EivsoMuEYZWPnWkOl/UteIGTWJpTTywUUi3sMYvIh547rOazvPxSTic0B1YioYu+IpgxN5sGf+9Ty0QPMHRcvn36D5IsVLAbo8/HOdHADkZ7RKH41BUct+sjObsyWrHmzjfL9Cp169Og/xdj2pqch99GlfKzesQGV0OYL7nGZRz9XosIcUL+mHxS7zjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SGmTkOHjssSgQt1f+aWvM6PYhtluDT9PBlSTSx+gjag=; b=RYJ6cdUFlp8aNqINL2hzOu2B6evRnBrfmkFX++dRHX8Ftyxeb1YvlGYSCAQ32xsCU0ji6zz4QkCVbkOx/GWRLhvHNB1qBRoDsBM/Ug6KESIguxI3XWblnw4nLVZovT4z/h8zapWLDm5jh2TZTAN9UoK4ndk0AtjGB4pj9GWgUBY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:28 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:28 +0000 Message-ID: <875xuyh6g7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 04/11] ASoC: audio-graph-card2: expand dai_link property part User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:28 +0000 X-ClientProxiedBy: TYAPR01CA0088.jpnprd01.prod.outlook.com (2603:1096:404:2c::28) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f34102e-257e-4d77-b1ff-08dc7ed3cab3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: wULRKkdvjMNkhhE35o+5KIjdewyn+GFw5BuPwWcZWqXZFDrhkN6Dnsieoiw/vD5kIgMRMTWf+MkvWi1JcEZo6VfrXh00UcebOIsn/ONJZjQi13RTW9ZrjrHSncDyR4lDxxQp6cXwOl/VvZvTSPSPeYn4z/1kf6tlC4RHB3esZn9Z2A9LsM5N5IOpdhh5M6uyQzuVJgOoityGPNsCdXrAiuXmw2WIPh2zWE/Z9g3rRaZ0Z/5UCR5YYaV9PUpsGWz/etQEUlaeu4x8GjoSiUCLDIM+jkFl7NFkYXDYJWX9oZF51jZ4CLRsoUoZTG6PnSBHgziMqdjAX/j1VOPaJvJn8KtcWQQxatBN4k3UzzwcGT+PLcY1FsuzLDlXAHZkL+fV+wamN/5KpQVqOIBxY+9eHH0hs3Xw3R91v8O2ZIGPFqHPcofhM8uDf05KB5QkDooDOvFl1F8yLe6VYuxspLJ2RXVirY4wOZF7Dz3fPD2snNN1wncJhWY5mlRgsYhrRYjkfuOAI5a+BtQGQU8hh8wWCOC8alBalR28UoKxk2ABzWxPlL1oAL6YKXlmukqfyE7ig9TTerqoTinAmC9lVS1wcT9dtbNUOQhogazq/NwjDQch7UsL3DrZ9zBHZ0WNvdIUW9u7rAFfP+RADYu/F5VxGM5/cjoVIQD/z3GMhtDegVpVZM/4tZMDHTCPjYVxKX3DdjJKoluAII2fKFB4CHYF8g86ZciwK0KyxsO6C9bmBKGLwJSslG8azSLvFny31J5tUl+FAACZCMahIXOicpCmxE3IjLKAYt+T80LO5rpvKvYcPtdcnFsbHTcZ6hTf4wLQp0inRR+wsC6mnZnb0+LboHXEYo5/Lwmf2l0QdvHktNjHAEaEQWH3iRxcYm2Wvxxm5hmyDTtzBx4nY3PagQROvOjb8xwr9FPVlU3QreVobyPkKpvTd6DUQeiLV3CWcDcFwXXFv24mzTInQ1IM5qRrlrb6/+edkl5+O4ORVRH/s7Ho6wXFc8N094yCQbKMleCccc7skf7ZjpIXPewopsRpm1lfkACRC4c/G+ZlAMfM9x3eFmsM0srLFEH7GJCnU6D3xjny+OTTZ6BozUzPYoMYkaDeCgL9Xy8VZkc5aWYjN/k0c1nwT4PY3HqvJ3PD1asb8p57l1eBoAf42a/JSvLcBNgWwR66kEl4CLYzXAam+a6fBUeDbZ6yYrebvJBkr07aOwFAknrmSu9EObE8sdYxbIdbdNGnDqg/joqiGayScB/YZtsaE660gUdn4D3VBlV2p1oD7zLkiuXZqfE/enIBCC1HFvVzLI94SLRLCfBQGGQTp3uhZN+uZfKJXySdNVsUX7ILk2+45ifmmvHnQNjyRA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2JFZzR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pVq/fFlvIOgijGgd+pO7HvzECMb+nFs2gceSV/xPVw3dhG+udd/j4Jz4xAnVOfrL5pW6Dytf4RH0k8c2s584WRc68xzKjPh2PgNLMy65RAl8qLeUekLxWVRtVYQHdnW+2gM666wHwBxvc8lUc6TTU5ZBghrMivMlqu+Ml9Qw59AGw8HEaJGk7QOFv7jZtnwT5qcpskGoKvujEsSPkVCePA+t66HgJAsz03DmEsVepolmtRldK3VowZiZtZDM9qDlONV8EddOL6/q2uW4fmjc6ZA6wnZsCP4lqc8l8+HQMpCAEuKN7THWVkn+nEwQeRlkYdznbzyYJqZTqAVSimcEl044QsrzXqkBJGpeqI6BhplAYkeem2KN6wwwXZEBskQ3VNV1OpjfvYMaHW0fMD/ZYVcfZ3mlmq1JARVZtR9qECflpx2S7yvY65KleKCRgmja2tilhghKZBgkP7sr6XXfrgYB0K62NPtFf8mnsJqovpScBo298zgEQchzolsyY7rO/dV92b8CwPUomANeeUp65/byqeclr3u//zOLZre9+P4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f34102e-257e-4d77-b1ff-08dc7ed3cab3 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:28.4407 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RuzYgAHbO5Xq3PLU+LqswfhhseUiU79anFwfZ4Yb4xM9GJTJ+mgMrWbS5zYJT7oZ7e9oVj8pGPzRag8H+kfbw3rI+tYmEAGzt4vQwUGeZH23nQr/atA/ALQhuO0Dakpd X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: FHJ6K6VSQU5YLN6J7ZLX4RNPS7LBWKZI X-Message-ID-Hash: FHJ6K6VSQU5YLN6J7ZLX4RNPS7LBWKZI X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current dai_link related property are parsed and enabled only on CPU port node (A)(b)(c). OTOH, Audio Graph Card2 supports many connections like Multi-CPU, DPCM, Codec2Codec today. For example in Multi-CPU case, it will be checked via (X) -> (B) -> (b) process, but (X) / (B) part property is not parsed. >From dai_link related settings point of view, (B) (C) part and Codec port also enabled is more viscerally understandable, and useful. card2 { (X) links = <&snd-cpu (A) &snd-multi (B) &snd-dpcm (C) ...> multi { ports { (B) snd-multi: port { ... }; ... }; }; dpcm { ports { (C) snd-dpcm: port { ... }; ... }; }; codec2codec { ... }; }; cpu_device { ports { (A) snd-cpu: port { ... }; (b) mcpu: port { ... }; (c) dcpu: port { ... }; } }; One note here is that if it was Multi-CPU/Codec case, 1st port only enabled to have property it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 95 +++++++++++++++++---------- sound/soc/generic/simple-card-utils.c | 13 ++-- 2 files changed, 66 insertions(+), 42 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 3029e8ebfa222..bd714a6f74e61 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -763,42 +763,55 @@ static void graph_parse_daifmt(struct device_node *node, } static void graph_link_init(struct simple_util_priv *priv, - struct device_node *port, + struct device_node *lnk, + struct device_node *port_cpu, + struct device_node *port_codec, struct link_info *li, int is_cpu_node) { struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); - struct device_node *ep; - struct device_node *ports; + struct device_node *ep_cpu, *ep_codec; + struct device_node *ports_cpu, *ports_codec; unsigned int daifmt = 0, daiclk = 0; bool playback_only = 0, capture_only = 0; unsigned int bit_frame = 0; - if (graph_lnk_is_multi(port)) { - of_node_get(port); - ep = graph_get_next_multi_ep(&port); - port = ep_to_port(ep); + of_node_get(port_cpu); + if (graph_lnk_is_multi(port_cpu)) { + ep_cpu = graph_get_next_multi_ep(&port_cpu); + of_node_put(port_cpu); + port_cpu = ep_to_port(ep_cpu); } else { - ep = port_to_endpoint(port); + ep_cpu = port_to_endpoint(port_cpu); } + ports_cpu = port_to_ports(port_cpu); - ports = port_to_ports(port); + of_node_get(port_codec); + if (graph_lnk_is_multi(port_codec)) { + ep_codec = graph_get_next_multi_ep(&port_codec); + of_node_put(port_cpu); + port_codec = ep_to_port(ep_codec); + } else { + ep_codec = port_to_endpoint(port_codec); + } + ports_codec = port_to_ports(port_codec); - /* - * ports { - * (A) - * port { - * (B) - * endpoint { - * (C) - * }; - * }; - * }; - * }; - */ - graph_parse_daifmt(ep, &daifmt, &bit_frame); /* (C) */ - graph_parse_daifmt(port, &daifmt, &bit_frame); /* (B) */ - graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */ + + graph_parse_daifmt(ep_cpu, &daifmt, &bit_frame); + graph_parse_daifmt(ep_codec, &daifmt, &bit_frame); + graph_parse_daifmt(port_cpu, &daifmt, &bit_frame); + graph_parse_daifmt(port_codec, &daifmt, &bit_frame); + graph_parse_daifmt(ports_cpu, &daifmt, &bit_frame); + graph_parse_daifmt(ports_codec, &daifmt, &bit_frame); + graph_parse_daifmt(lnk, &daifmt, &bit_frame); + + graph_util_parse_link_direction(lnk, &playback_only, &capture_only); + graph_util_parse_link_direction(ports_cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(ports_codec, &playback_only, &capture_only); + graph_util_parse_link_direction(port_cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(port_codec, &playback_only, &capture_only); + graph_util_parse_link_direction(ep_cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(ep_codec, &playback_only, &capture_only); /* * convert bit_frame @@ -809,16 +822,21 @@ static void graph_link_init(struct simple_util_priv *priv, if (is_cpu_node) daiclk = snd_soc_daifmt_clock_provider_flipped(daiclk); - graph_util_parse_link_direction(port, &playback_only, &capture_only); - - dai_link->playback_only = playback_only; - dai_link->capture_only = capture_only; + dai_link->playback_only = playback_only; + dai_link->capture_only = capture_only; dai_link->dai_fmt = daifmt | daiclk; dai_link->init = simple_util_dai_init; dai_link->ops = &graph_ops; if (priv->ops) dai_link->ops = priv->ops; + + of_node_put(ports_cpu); + of_node_put(ports_codec); + of_node_put(port_cpu); + of_node_put(port_codec); + of_node_put(ep_cpu); + of_node_put(ep_codec); } int audio_graph2_link_normal(struct simple_util_priv *priv, @@ -846,7 +864,7 @@ int audio_graph2_link_normal(struct simple_util_priv *priv, if (ret < 0) goto err; - graph_link_init(priv, cpu_port, li, 1); + graph_link_init(priv, lnk, cpu_port, codec_port, li, 1); err: of_node_put(codec_port); of_node_put(cpu_ep); @@ -861,13 +879,16 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, { struct device_node *ep = port_to_endpoint(lnk); struct device_node *rep = of_graph_get_remote_endpoint(ep); - struct device_node *rport = of_graph_get_remote_port(ep); + struct device_node *cpu_port = NULL; + struct device_node *codec_port = NULL; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); int is_cpu = graph_util_is_ports0(lnk); int ret; if (is_cpu) { + cpu_port = of_graph_get_remote_port(ep); /* rport */ + /* * dpcm { * // Front-End @@ -895,10 +916,13 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, dai_link->dynamic = 1; dai_link->dpcm_merged_format = 1; - ret = graph_parse_node(priv, GRAPH_DPCM, rport, li, 1); + ret = graph_parse_node(priv, GRAPH_DPCM, cpu_port, li, 1); if (ret) goto err; + } else { + codec_port = of_graph_get_remote_port(ep); /* rport */ + /* * dpcm { * // Front-End @@ -928,7 +952,7 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, dai_link->no_pcm = 1; dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup; - ret = graph_parse_node(priv, GRAPH_DPCM, rport, li, 0); + ret = graph_parse_node(priv, GRAPH_DPCM, codec_port, li, 0); if (ret < 0) goto err; } @@ -938,11 +962,12 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, snd_soc_dai_link_set_capabilities(dai_link); - graph_link_init(priv, rport, li, is_cpu); + graph_link_init(priv, lnk, cpu_port, codec_port, li, is_cpu); err: of_node_put(ep); of_node_put(rep); - of_node_put(rport); + of_node_put(cpu_port); + of_node_put(codec_port); return ret; } @@ -1030,7 +1055,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, if (ret < 0) goto err2; - graph_link_init(priv, codec0_port, li, 1); + graph_link_init(priv, lnk, codec0_port, codec1_port, li, 1); err2: of_node_put(ep0); of_node_put(ep1); diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 7ebf59a03e698..d0f8258a4790a 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1132,14 +1132,13 @@ EXPORT_SYMBOL_GPL(graph_util_parse_dai); void graph_util_parse_link_direction(struct device_node *np, bool *playback_only, bool *capture_only) { - bool is_playback_only = false; - bool is_capture_only = false; + bool is_playback_only = of_property_read_bool(np, "playback-only"); + bool is_capture_only = of_property_read_bool(np, "capture-only"); - is_playback_only = of_property_read_bool(np, "playback-only"); - is_capture_only = of_property_read_bool(np, "capture-only"); - - *playback_only = is_playback_only; - *capture_only = is_capture_only; + if (is_playback_only) + *playback_only = is_playback_only; + if (is_capture_only) + *capture_only = is_capture_only; } EXPORT_SYMBOL_GPL(graph_util_parse_link_direction); From patchwork Tue May 28 05:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2D9CC25B78 for ; Tue, 28 May 2024 05:07:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 29B0A950; Tue, 28 May 2024 07:07:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 29B0A950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872835; bh=mRGFQ92bWDw7BtQxOhSHlq8t02y6W0x5JTs0P3qpmpw=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Zzd6EyXKT2j/Ak+T7Fdz726J5AA2Y7XY+YQJdlGSeNN5zV1iYnDQEIpL8F3Afnyak dA9rPWlnyplMYt00V6aS5+aUJmecJ2iivB4w09eV9NUriem94eCEYdozeR91MTKsMj MKR6t72FTgLu/njGpxYQdXZKrBiJMIajSq7urdrY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5EA33F80587; Tue, 28 May 2024 07:05:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9132AF80659; Tue, 28 May 2024 07:05:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C899F8061F; Tue, 28 May 2024 07:05:39 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8F18FF800E9 for ; Tue, 28 May 2024 07:05:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F18FF800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=oDfnk2MU ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N2jD6PWi2Nc9CIfJUunR4KcLKjwc0GARAC+gWsPRTsUjEpH2do/0v6UNdtA6/Ct0chZqbrgk4o9xt1wd8EuDftyJSCjd75sZ5vTSLZodlPoQqU48U0ccZQDq/r0qFvDPxY4vA3qgF53AYD2uORiya8vad2eYIVpi024a0N9sGjRiEoOtWCOsG/DDTbidoFH6B11AuYwd2xRCG3HaqBgvOutLTtULYNMhIS/AIoyvMdKNudGG/V5ZOZ3M/6/X4F+L/ymVBSgl2mFYEte82clGKqcmF01d2zAElS7ftTsQN8FA4nngXtdG+tmadhOfzWRA+1YkFux1ndH+JrGHQTbq0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Nb4T1OEllQlGDr+vfIfANlHStClk/qhMX5dhsmUgjoY=; b=hfhdxbBjvktQVD1O40c/g4IXXtZ8uOoFFIHTpl7hxz6ky1KMaY0w1zndY8rLCpxx77bDJzquP7MAt9wQuEEN1UCPoVs6b2ETKbWN5U4rS5p+EiHrw/FcZjUwy1tbn+uAwIH8cGFava8+8EZfI7IgfbPvXn5JMbNP+wdhCTIQLWkQBdqKEqxH8WRz6xkoXX4djc2HUaSj9ynNjbipcJuTWmwcvbgnmdfmQn5O7BCFL53Qc/UQ6spTIAvwdcqbac1kf8ilmWf9xCVXPXfbiaLr5r3kmUgxaxqWBI45WMM9XDlnTOJU0EEnSEQb14Cb4Yct53iYixcnKj2rF/T/JEa/DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nb4T1OEllQlGDr+vfIfANlHStClk/qhMX5dhsmUgjoY=; b=oDfnk2MUmkHJm2AdN6ubFmBJDd/ze7eD4aVMQEfLWPxjzy8XNhH2nobe2f36Owg15i6TETDBslJ7a3Tn0+6hKbdBjznYqrjkh/ujmRAolttELJ13+FVl4PfcY0dgZmQwELmiy0HLWlh3NxB86Vy0p/Ol6Ki53iq/9oRrY3kV0WU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:32 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:32 +0000 Message-ID: <874jaih6g3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 05/11] ASoC: audio-graph-card2: merge graph_parse_mclk_fs() into graph_link_init() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:32 +0000 X-ClientProxiedBy: TYAPR01CA0073.jpnprd01.prod.outlook.com (2603:1096:404:2c::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: ca06f90b-a0e6-485f-863e-08dc7ed3cd23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: rUBHiCE5QzLeiSZW2WTYWUF7Dah0amD2ymRZc+5cRNF52jqtqBJfp+9zSQ/QIsygfQfH5cxngRS2xakjGbDSFdgWOnQlrER+cRp7IY8/Q6NQ6c0mB9aNLlriBRm6/Ry26T+O7S224+XfdiUxEu29rIRC2mMa4c1tw3DkV6RDtyZHDbbZI1mICbn0U64Nlm9pmUJM2M2dEg38kfpQtKA9f8BFADFvtOnTUltmZzckFCN4ocaNcvcP38WaW9ikxFvXB1EJaQEvn5RcR3mVjAgAbBVrJnx7ar0FMKe6yyDxuGXVuHuzefdrPLbYVlw+29Ux7w2Kh7tGQrapa6DXeMXBfqrk3jtfYQrcPwxUx3YnoSqYsJXhOG8+KueXwGd+kSfIyQLX1DOX24iU9bh593w0VwqPSdckokyQFkzrjbbV3jCkx1cYj8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(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZzwjKx55FBCNejpSPYUggM49nArsGVSGF1c6ftrjuwz3ABnyS4uh5chnJpDVBcmtuuLF24LZpX7toLwgKB1g3NE7DC/CwAoLdYBtdqLi+tkYrgaukwe7NdNcqXvXjHJepWXo4k5DYJ64eax7834JmPLTV4Hhg3DPHpcvgbJc4qYJEoDQkOxk0o8CyQ8bo7Ta7b39zcjqTr/BMa7Pg+b9mAMBOEWm35wJp+RxnW9XMIa17zqcskKTtrfKunEB29IgUGttptOFHimFydsdLIp8ZhxOKlFbUnhd2dTc8HhYK7cIIzjYP+8HPPAPrQ57ijftMPrnUMoNmHaQPAtzawlWojGNuJ2ggBLZZmeS0CksgUS8SBHYMBzWCAfR59V4qVMQeUzMrG6H1CEl82LlmWOlsfNpsLlfmN2IGzup9dYTPs+1Zxr1MTN9A4rU74EWgCnhsljvRpjlnP5H+3g00C+ftr6V5PdDsipky7K2bSIsdbpLX7pT/StSInYA1Pa7UlkN3xy1J8jSoHEwzMqMBbZxH7RNY/cfFqp3B9hCq7zCgtjZ2UvGvUZdoas0tNwEt9vxMXVWadLMirUrmR+VXK8iyQH2R7QD0ymug6vioRiFTAYJsJ5sS/AHHSW6fHI1q/tUEf7CEtKcSQcxOy79T73m4UD7rwqJ7Q7+3PENwON1731kvsA+v0ce9w15Sb9YJuN7mG50VlD5OUnKbnUIhHzI/4VZKG+hXZ0iXpVEZLz4uMl6syttPIgatv1bHnVLn2aZMA42WSbi29qq56kCXM3jqqv/2noeEfhKk9q+SiT5A1rxr2sy0manAADYoDOUkEBRZjHKfdkENrfBOMOgxrbnDrdNzi4h7sZOH87QdiiZrhZcJBJLWoypIKAUXi0DZDf1CAtbzATVQBGqB0iI+2/tF9DOjqAnow7DSB6c6vDw322Kqx3V0qrrLw3Smul9OdxFFQ8yCT6N7ipid0qC9GAK8bA40MA4JJCM2ZLSr5pYun2EN0BOZ1av1kL15ATnpItfSIqOHCSebHe6Nyk7N3PN8/y4F0WXPYjuCjWWEJIE8EhITI7IhM2MmkQXTYo2F4wq9JmHFadVUnN0RTQAJogcZ6iPME+iNMOVtf47In2yZcI14TFyZTrJLhrw7n08iagAQ8YyCZM7WdVmXNW8YH5YZJDtQAe5XAdMJmDWX9ct2162TPXWCVk9z/1+b+/7vkEahPp8rvK8Urmgy1d0c3H6xSbby/9WFISKdcALcSdmvslNhESM2HI1x5ISQZ6YX0rHrO6J3zHS6kOUuhszHGVK9+Ss95C/aj85u4om8jd+0C1zqJRVAuX0yPm+JQt6V6oI0yWYKpLndRwdBZG7/2WX/nB9KO91EuEmWdjCCu6I0YX+nHbL8d7II2aaUl4zL2nI0Of0vCQx/A9MAFwlBdTlvhA49eKHeWADriJAeN+OSeadDzRKCmq+ljE5BbKIkne3tC6l82e/k/W2EMB7mNnJ6XSCq8C6wjxdoKCbYGUhgvL8YrxhV2m76SZqLKPy01r6sjrt4a2tOg6LN0a/6aGZ53s0e6bDLdRyuZrn97ZX2AqufDxkzu3d71uFeaYucR0Z0gj6yWpSALwIHIJ0ojz9gF3J2QCDwQjwPbppV0C88ww= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca06f90b-a0e6-485f-863e-08dc7ed3cd23 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:32.5417 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gHjkt6Ie/xCgxHVyRaUOi31ICPrRtAm6qlNTzdNJZ3WtGEUnBfiAKpe1FaBWaALk/jBloWLDtlETF8cl169+IiSZLRl9UlCckIRKZXjw4YUNldq3xZ7KisCPF7eJn609 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: HAEVT5U7HT7SRYZYLUXVPI2ZYVG46X2P X-Message-ID-Hash: HAEVT5U7HT7SRYZYLUXVPI2ZYVG46X2P X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index bd714a6f74e61..8eea818887580 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -389,20 +389,6 @@ static void graph_parse_convert(struct device_node *ep, of_node_put(ports); } -static void graph_parse_mclk_fs(struct device_node *ep, - struct simple_dai_props *props) -{ - struct device_node *port = ep_to_port(ep); - struct device_node *ports = port_to_ports(port); - - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); - of_property_read_u32(port, "mclk-fs", &props->mclk_fs); - of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); - - of_node_put(port); - of_node_put(ports); -} - static int __graph_parse_node(struct simple_util_priv *priv, enum graph_type gtype, struct device_node *ep, @@ -424,8 +410,6 @@ static int __graph_parse_node(struct simple_util_priv *priv, dai = simple_props_to_dai_codec(dai_props, idx); } - graph_parse_mclk_fs(ep, dai_props); - ret = graph_util_parse_dai(dev, ep, dlc, &is_single_links); if (ret < 0) return ret; @@ -770,6 +754,7 @@ static void graph_link_init(struct simple_util_priv *priv, int is_cpu_node) { struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *ep_cpu, *ep_codec; struct device_node *ports_cpu, *ports_codec; unsigned int daifmt = 0, daiclk = 0; @@ -813,6 +798,14 @@ static void graph_link_init(struct simple_util_priv *priv, graph_util_parse_link_direction(ep_cpu, &playback_only, &capture_only); graph_util_parse_link_direction(ep_codec, &playback_only, &capture_only); + of_property_read_u32(lnk, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ports_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ports_codec, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(port_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(port_codec, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs); + /* * convert bit_frame * We need to flip clock_provider if it was CPU node, From patchwork Tue May 28 05:05:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F1D5C25B78 for ; Tue, 28 May 2024 05:07:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8A71986F; Tue, 28 May 2024 07:07:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A71986F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872858; bh=WYetgctdWBF+MonuetBJ98RHX2voXcw8m6pYRS/135o=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RQ0T0G/F3TaVJr/kskkzinrdh12yr0LWe1Sxi6wDYmqsS1Oy14sG1AWZSaaIbfrMT DvKSwxgZftwvSHP3ppwDOI/psbSazavLgD3PVDmUK2QqvjUWBxhSXW/0urlbLjt8sj RFYQcy/Rck6+boNSdB37wgIwu9oKt/IMaoW1ryKM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9FD7CF804B2; Tue, 28 May 2024 07:05:52 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A3CECF80698; Tue, 28 May 2024 07:05:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8E7EEF8063D; Tue, 28 May 2024 07:05:46 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 79F1EF8060F for ; Tue, 28 May 2024 07:05:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 79F1EF8060F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=oBrH9uBH ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=arDD9NFXGvZSO+1zHK4QsaA19gdgIrBR6hxR2gPsrMbCrJa9IGdiorIIGBWkiamdDEtSVDBB8KILyDC2y8Gz1kRFCuc+yrnFDpAOZfr29JQqq0xDXM2fJkbTPw4wx+RlH/DEeyryfaDij59UHswQATNA+PJ5l9sMjigwTA+IrLKig7qi6029KScXyyJY0Jk8hEp1zZ9XLmwmUejhBgMKx6XiKHR6SGKXWDGRjua2PL2savoN40X7r+4H1r1Mz3W5jEa8taiK36uDKzIsahhGHcvppXOg+JOu35nCbOdEOvC0x+J+FVJbPGetNxBv8bvXiENxwOLlpK8LgSVzmeUJkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0VMDQ5xlUDr8K/0ewxS9dq7J5ZcjZwEjCViONSdXYOE=; b=Ge2eXFaiO3ZayQwjEvAvMpTRv/HwkHWTaiYs8fkcpusap7i+/+j+Egl95Y1zwg9ifE2w/dQDoEQy7x7aVNrkc0TLmJ+4C9XKDiJgx68CWCvx9bEZ6pUBTIseGtxzBMBEcRxnzQ3L0+0dm02U/TQ5J/1Ltx+wAMSRZeMVgzjn17hWSzhHdwggIWMgzu1FJ04IaP3rbxh63dWhhxkNOhx07h8dMem0bx1k4iiUoGAcY7+fMtPqJuea8fj9AerkVMdcNyJxgejyRyuKsZyGEIOsGIapyc9NU0JYt5/jvW0hugWXT7Q0DUMB5zDL4dWd0K2y6nrseD9NGZHH7rzE/JA+GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0VMDQ5xlUDr8K/0ewxS9dq7J5ZcjZwEjCViONSdXYOE=; b=oBrH9uBHc8EWvJc0eKvlXj9Ove+qVJsWvce0cxZNtiN8KGkUc4FFEfm738C0P+cDqifiAFIz6RbyDcZYu5ocbftFPpIkzkttWGPS+kb5FHfArBzuRWOGlEKbvIySuuN369pPaFJ3ExRGcRaap3AQimjPFQqKmxOryjf1ynAm8rA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:36 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:36 +0000 Message-ID: <8734q2h6fz.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 06/11] ASoC: audio-graph-card: add ep_to_port() / port_to_ports() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:36 +0000 X-ClientProxiedBy: TYAPR01CA0075.jpnprd01.prod.outlook.com (2603:1096:404:2c::15) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 42dcd7fb-1fd1-447f-5aa6-08dc7ed3cf6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: exY9sVU/3sxKZm3seHQL62P5XMwYcNr/2ecPC+/9CSNHGsWmrFpXNWWFsSO2O4IRPtlcNekl1yzZqfFfY3FDsSTul7tt+0+Y1tQzrYVIGIi7deyZwo8Iwm1VEH2EMuiumN3QkpKkrfsFl7M5euowpjOUtFMLGJbPLuXbRmmzhs/o16tgcSQxbMGqhMhxjC2AZn9odL/SfxKXS3TL7ITBs/tjyP+n9VQp+vV3daSDJYeDdAICtJeyVE/CGgFmcbH0mUN/wuloqw/120vvhvAzWqX11E/wXsczHfpe9KL9zsLXV3XtD/zLN4TO19xzvekDrWSYPNLGxQK4RMV4CEkBeOQEs6fIEAV5SReftUzA1psOjLU0/aArDZIS2Dqe3j0+p3HlHuGZRgqN1yi4mdJKHxOTvo39SfH3Ot93XReiBqvsVueErK/IiaLZlhQGjAe+4qJmQh/MbsClH8X9ntk9MqNV0PMxeU1Kk3T7ZS5qirX+HBRwPmiTKbOaFMmGzIcqAOBqD7K5oK1L/oSwKxPkTTfirL3sF25BAmqk93yXnGPyBTV3n5GG4lwTgkTK75QhKpnlq/EBBBuez52oF2rcyXMrT99fLyWnelRs1rU+5LNS4qZLH+pNbNMKgwT+V5MYK/hmeG+bUlDdT4g924iXL48gbbFTPzprnwGh4JogUzWQHwCf0OzkwUsePINFjBDg/xoS7nU0532gogAT9fkI29Jfvchg7jIwNHDddtOGyJ8cJGsPsiDEDqzRjTch1idRCCTDtu9Zzp46X5G1uFwLY5vDnDUPuHdInZ+3svBUEkspNv7l7qw47Add/oHo1k2B2QP1WTdrLVnvq5tEDvRtJlwt/LlIgwsnm+wkwcnV8stezFZv4/USiA2gdPC2rh3NbtlpJpU4DNymxxkLdy9LRk4KozM5hWX6MhjaLSxI6qgZu9SBcxk47tJf0bujxy4GRa9noZpqQeE8f+1PxePht6mFUn6IytiqQxtWy4mLCn7+P2PCX/55e0DcCKwgRHhUHiWq7AUZywFj380uIGL5w4v3IAkI1222sFNwpoTeMuBv4po3QLdKTk1XP/ggR37KXdx39TekAfYprpcHWidH8cjC5FvWJ1jjkwW+rmn+XBGLnN1kMmMt3ZrObRcSszqDNUGrGr9fpGrXnrT69hmEgAAZYPn1+/AusqLB8F6Lc1XSFao2rjchzC8AcgvdZerA4/0RkSiPjlwYGRbmwmkUtcm9V2Q3CLkt4k850E3LhLJQlGAzCop91suWfrid8RFaFNYJlzS7fNSNr59NW8Sj1sQf4fjkQMpiLC/J2ePdHxrCPhWfhivaE+Uqb4f+3K5p6YRE+qrE6zF7jPWBJKScgQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LVqgmwzd9B5F72MRrsUZwUJHtZ01fg0Volrkk7VkhBlsOk1ZzdUMZEWdXmuWxCct3DefkWH3hXEUO6Q6jOt/81FA8uyO309hhBu4YXX1wJXShfq7WEWqeNG8hUi1rOgGHEp6zvqmiAfLpi3b3fykIf5OCAZsCeIyEZojTrn7qgoyu7gBwNIvhNcA5KPxJS8SaS6pL2fZQLq7Gmbuv+/kn4Jy1XDOcUpEWfgDPko/DX7J8gYaiC9oFgUQIzwShffzbN/vNPyDvKnP/v4cIHbRjMrfd+SQbuAv5rxAi+sHH0BZPKYtMiVbz4VGxQMQl1FbQt74VFPLdVMLkXY0akJ5F7+T8XR22P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KdCTYbec3gkxCxSL/zHHiwRyR8BDWEPchZP+2fAlt/U7JixeOO/0H1Jhnav1eYD/Os9XTup1/kNXxLma6/PrVc2Yo/u8fMmgU+1+Myj9PK/O0wYszYUSQDLuLLmWFqiQn6yhma7/K82xTXK49H6vcRek3q84SAOk6/hQUgt26FuMo8gtVcdiXmaZJw5PE5dQ0/ml4XrQuv2+6jSRGbo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42dcd7fb-1fd1-447f-5aa6-08dc7ed3cf6f X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:36.3814 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pa74cp8LBCQ92RS7ju0m6ZWUfCfI6SvwQudO/uz5oT3VmReYPXEiEDi4unDweCIqMVWh1tamQe4lezGnLUcIn7QQnOtearfFf6W2WBqspBlu6R6XLVHnT0XhX69tIIXJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: FZKGZEBS4KUN25ANVF3ERSPIYMEWOD6M X-Message-ID-Hash: FZKGZEBS4KUN25ANVF3ERSPIYMEWOD6M X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current audio-graph-card is using of_get_parent() to get "port" from "ep", or get "ports" from "port". But it is difficlut to understand, and "ports" might not exist. This patch adds ep_to_port() to get "port" from "ep", and port_to_ports() to get "ports" from "port". "ports" will be NULL if not exist. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 83e3ba773fbd6..552b94908cf7c 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -19,6 +19,18 @@ #define DPCM_SELECTABLE 1 +#define ep_to_port(ep) of_get_parent(ep) +static struct device_node *port_to_ports(struct device_node *port) +{ + struct device_node *ports = of_get_parent(port); + + if (!of_node_name_eq(ports, "ports")) { + of_node_put(ports); + return NULL; + } + return ports; +} + static int graph_outdrv_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) @@ -68,8 +80,8 @@ static void graph_parse_convert(struct device *dev, struct simple_util_data *adata) { struct device_node *top = dev->of_node; - struct device_node *port = of_get_parent(ep); - struct device_node *ports = of_get_parent(port); + struct device_node *port = ep_to_port(ep); + struct device_node *ports = port_to_ports(port); struct device_node *node = of_graph_get_port_parent(ep); simple_util_parse_convert(top, NULL, adata); @@ -87,8 +99,8 @@ static void graph_parse_mclk_fs(struct device_node *top, struct device_node *ep, struct simple_dai_props *props) { - struct device_node *port = of_get_parent(ep); - struct device_node *ports = of_get_parent(port); + struct device_node *port = ep_to_port(ep); + struct device_node *ports = port_to_ports(port); of_property_read_u32(top, "mclk-fs", &props->mclk_fs); if (of_node_name_eq(ports, "ports")) @@ -231,8 +243,8 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, "be.%pOFP.%s", codecs->of_node, codecs->dai_name); /* check "prefix" from top node */ - port = of_get_parent(ep); - ports = of_get_parent(port); + port = ep_to_port(ep); + ports = port_to_ports(port); snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, "prefix"); if (of_node_name_eq(ports, "ports")) @@ -350,7 +362,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv, /* get codec */ codec_ep = of_graph_get_remote_endpoint(cpu_ep); - codec_port = of_get_parent(codec_ep); + codec_port = ep_to_port(codec_ep); /* get convert-xxx property */ memset(&adata, 0, sizeof(adata)); From patchwork Tue May 28 05:05:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BADECC25B78 for ; Tue, 28 May 2024 05:07:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 073A3B65; Tue, 28 May 2024 07:07:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 073A3B65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872874; bh=hMnHc2+T6ZG2QQNRc5URHQ9RccWTIk3bNSVwOUT/9tc=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=EEE4o15CZy1HvqvatiC44aIouGhacvEA6j0X46ohZKULe823bwbzxg1xXkmiWjRjt aKaAQBoC1uhBVyMv6pHhytVTW/XyrLJdONE/Q/XqluZTngwUXnPDk8eOnLPWfO5Jh5 4aUgrGRjcB/RcFF9oMD1T92hAMnMotrILTlpuh68= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 69820F806AC; Tue, 28 May 2024 07:05:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 89B17F806B2; Tue, 28 May 2024 07:05:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2D49F8065A; Tue, 28 May 2024 07:05:47 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C4166F8062F for ; Tue, 28 May 2024 07:05:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C4166F8062F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=mUY0BMZv ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SXYWnK1j/d5saHjcSrwplYairmPXbMTyH3TpMNP+EgF8q/5S/wfP1vQ0Pi1ATl5QsFtZBLq6eBUD/c0aFwJn2GIkbDi+VFd+iq9hDopL5sZdZip7J3gq6rEjc3Lc2Q5pxOV5lOV3d8lHa+GRswvX769vgh4oJTg2tM+/Kbf278bHsG0Agela5sFgvd5Ies1ih8wDX5J4WhmbY1rHjyAUaWLe73Di0DmkdCZ6QyMW3s79Fy9Mcpsc/MUBRVtUDUhrhl3RYvWemtqM69sqmYcPW7882nj0n6o1/D7rPOi285o+QZPuCovfGxUROVRLlMj2R6fy/qKJfgj1/oyt/bfs0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YkXNiz/yOvSLYLfwiTDYiYo5tD5IN8kTEOF76BmRE8Y=; b=EgwO7BOc9DtVmtSJbAeHA4zDAljmrrz592WlRj6+ZP+dmgvajwJa+iWUUrtr46vWPH2GAXQLosK8ThHmKNCgQ0v9BExomcbBWSJ8ukqbNIwd9yjY8U0xPHpvUZZmmbtiVqnOJuUKl31xwken7axHoPnvU8Ow0GHLPEtgqKVqLfLfMv50TR5cgYE1ayAbwWsJRX7AZsPBjVJ5BXx098VSY4V+df2uWB7F0HtCLI5Fm2bnyMTAyiv26qv8hsCn13DbnQT96ILOLNG4LoKrKpgA/Fe0d/u3qyhRUOK70xcZxy/h88szUSXcSwFTVfdsxqVW5lZqdsX90l+ALuaUWB2jCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YkXNiz/yOvSLYLfwiTDYiYo5tD5IN8kTEOF76BmRE8Y=; b=mUY0BMZvTL8ugDMJGXAltrxUUJ/p8NHhUEnefyb6LbBnxW9dA55jbdkqe8cgAWvnewbLCGa8gYS1vL0Vxv/tGOAH5CmiP0tFWb+DTJyIe6jmu//xo67A5/qhvavY1f9pinKtAVCEweMCEHgP/jE8Fs4ICDmGGF04XFUHK8ou/sI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:40 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:40 +0000 Message-ID: <871q5mh6fv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/11] ASoC: audio-graph-card: remove ports node name check User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:40 +0000 X-ClientProxiedBy: TYAPR01CA0240.jpnprd01.prod.outlook.com (2603:1096:404:11e::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ef10c49-46b7-4815-97f3-08dc7ed3d1fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: GPpchoIHFatVkyPS7s9T9gSDv3e5mba9NBWGGVh+O8TAeg42TSL6ZtdEMdbS1L7xB88ueCraTNVjXYtwmvojR70hqoqhwOxRL18jL5Y5HvvyiJo7Kcg7joQxdh+BMYhVysvR0uC/BIA/Dv5o9I5aOwyNYXBzaJkJ/P3tnkHApnnAkhqtq7dPrMF4ce78wKfRmBgKrEAY2fqd6aMCviyVfi+t2c1UuZJijJoSKZlI80/FuI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OhIMnZdn6pTRDO6CcL4uqTzMW/0lfmTRURLcqh/QFYWIGtW5m+D6Hw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6CZwmbqOKW/mbZQii1T5wneAbj5ER2KzkMcaMiBTuAV4hQnE2VtxTTBn12U2tnTUSUKc8MdORoLamgFKMC2G8Yw3oj6adhpNJpqN4H4LL0B1F5HgMAN2VrNjG0KcSf0TD7DgLeh4muCbo8FbBUwYr+EoAt2wvD2coXKc2zNKXzL9hsU8BS6lU3jK09p/Oe39T2m/VAm+vpUI6ZsCs/a2n8JJJ6avAsg+4Knc2LuRluwd2yrcXjizE3MmJ0XOYpQc9gTUYANgXV2cLjwJzl9igDtVhnObgoDp0uRSy0fQoQFltQ8xmWs1hXW7UYBijso9Uwa+R/eXHnXHH6XPZ9mrQId3UB/0CNKVypWjD/wqbw0LMoq0IisP2J/cXf6eQnuRN16F9bIucuYPZsuIKs+gihLqgkW17N1USQ4nqcJuJBwEdLnDhl8n7tLoSS0H1/z9iDeZ8lkmmkaNYCfmCq6bwsIvvHtx2nsubtcbYgaxcmSa48mbXxOSAeWIZHRUZKHLdMHmbIJMhrtjExZuwRerxbt789A81g9AFDgWLDzjEW5tu1EjX9pcL0tlm3Q4BvWMsLwUHlBZ12gT0DZ2LSXz6H0mFb8rmmDCQiBU5chwniYb9bqFLfxNQmBJDp3NrIIG9zfHY6Dbdtq/ekJdRb0WmtMhQblrigQ9OaCr7OWEWBijM+iPnXxk+j6eglqOsLFwQ4bgoEyZOoonm4b1EUFGwt5yDMjmzywncGkH5UdX+i7gOUl9s/aSM5XtcWm0wRXJRsJcscnE2xygzpHUyYDP7EiiIpeAHzi5ugQhOg0kULXWVri3urgkIykCUi0JgpMnV2zlRM6j+noHe5kcXX/E/akNbQgG/T4Qm7vTj6VNDVYy51fBNaCLz6pxzQtfFhMYYZpqDQnO+EmpNL+hklcuxB2DM6VEp+nPchFh5ZMS338CXAnIuf22JA72x4zPta1HzCm7X9vwttVEJ5GTkqRi+KT29zy1XeFWt6n/c72u+EA/OLXBP/4QVhFRPsCosfX34AGggWvA2nkj3p7Y6aF8JWIJaW3zayaf6OxcrIbx2fG/rF8SKwEhi1dHupBG7jgdTQU3la3sz6p+gC7RRaDNwNAl8TDTzcU54KzaKTu/cEuKlJ7hdo2maqXMBsVo2iIZSkboNuJFHH5ik9cBIc9GHuh3QAbmaa+0WTsDu/m5o0A0ptsSvta/p7qrwxhJ8hUyMF/F2uY+fjJ/cF6DtN+KREDllrxTZBk+MPC7dNKURlJOD+MxhcFd8siYRoo9wHfVWZ8Gd3nw49fU59Pd+NVJ0PrErpKUIL14QC0IDUIp/X8aKeIolm4mJL/wQMBQbmUubYi46w+RcY3Kpcw27eP77//H2/dUxkGsYN/7wB9VpYcQYiL3azcQBY/Eb+L+DfHpOCZKXd/I5K/tbuLiWkzhajKla+lJ8Sm+qKxOc/3iafqVcCDAQIZ21lG/wxKLPqmPlgyKWkP4j1XUDd7dA0iQu56VqhaQdji6byFx851byXOiO6bHQ64SW3tshDFF0xkw2AQvOTGRsWTBiIZ0sjMxr4MQeM7HGEOz7tS9+rbn7MtNhwwyfTCeQJR/KxsegdYV/FCdGggrNRbcU5wPJCWQVNMZ3Y2seeXKT31jXNyBqp8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ef10c49-46b7-4815-97f3-08dc7ed3d1fa X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:40.6906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AWndcVQK9kXcuzB6m68xqXwC1FDlmQalCP/scWo+t3DR86azPbVStc/FlEoTssDKbbM6xfxY+MnBN41FZIiqi34x8s8ScHVRxhF/uDu8k91dFPG+eP/b1Za1XNsseYKh X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: WAUO3HONECGVCHQ5IKA277HRNANQVH47 X-Message-ID-Hash: WAUO3HONECGVCHQ5IKA277HRNANQVH47 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current audio-graph-card is checking if the node name was "ports" or not when parsing the property. if (of_node_name_eq(ports, "ports")) of_xxx(ports, ...); Now, it is using new port_to_ports() which will be NULL if the node doesn't have "ports", and each of_xxx functions will do nothing if node was NULL. Now we don't need to check ports node name. Let's remove and cleanup it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 552b94908cf7c..c60f001468591 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -85,8 +85,7 @@ static void graph_parse_convert(struct device *dev, struct device_node *node = of_graph_get_port_parent(ep); simple_util_parse_convert(top, NULL, adata); - if (of_node_name_eq(ports, "ports")) - simple_util_parse_convert(ports, NULL, adata); + simple_util_parse_convert(ports, NULL, adata); simple_util_parse_convert(port, NULL, adata); simple_util_parse_convert(ep, NULL, adata); @@ -103,8 +102,7 @@ static void graph_parse_mclk_fs(struct device_node *top, struct device_node *ports = port_to_ports(port); of_property_read_u32(top, "mclk-fs", &props->mclk_fs); - if (of_node_name_eq(ports, "ports")) - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); + of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); of_property_read_u32(port, "mclk-fs", &props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); @@ -245,12 +243,9 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, /* check "prefix" from top node */ port = ep_to_port(ep); ports = port_to_ports(port); - snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, - "prefix"); - if (of_node_name_eq(ports, "ports")) - snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); - snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, - "prefix"); + snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, "prefix"); of_node_put(ports); of_node_put(port); From patchwork Tue May 28 05:05:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37614C25B7A for ; Tue, 28 May 2024 05:08:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7D3BB845; Tue, 28 May 2024 07:08:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7D3BB845 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872890; bh=lgI2FIKXvgT5jvT4bKdGCZd2zAbRWI+HgqfJs1r9JWI=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sw9DuA2J3E4awj/h2unINtAoARTyNQH4IjRiRaEeN2bwKrIzirtT+M0v+PJj6E55q PnzU9YCuXYi5Ulef7UpI4nsQIfjAogvuwm3e2lT1+2Ew5ait85OoBGCIZ5GEwY0F7m u8tq9MNN9HY6SnyqnFuDxGMJgrUDFrO4nu2Da5jQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7882F806D8; Tue, 28 May 2024 07:05:59 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 98F4EF806BF; Tue, 28 May 2024 07:05:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60978F80685; Tue, 28 May 2024 07:05:50 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 905D8F80687 for ; Tue, 28 May 2024 07:05:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 905D8F80687 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=offchQG0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KNr5oj/ollwsAdpzUQqBX57mdopxOl6iwnsBxf/XoPUp7ks0xu7m4Vli7ter29wvkI9mwDfun5wnsaHOqaUdItqMt/BBd2e5iXWSVtXxTMgg1/uyM9s7aS7AcATctAfQs+YwxAuZWC0H+rQF8+TIk/vJjdBX6gf/GbcB3RXlMOQ+68yaVhXw5xk8F2iYCI+b5xfK3fuPYfCcXHLbw6d/i0N8pF5/pYL3sNwLfwxSwBtyBZ/itPtkjkj30nNjn5sAlKg7RWwyGMcoJndextzCK/Spg9Ppq2oll2HZMNYBpWUQGqLJ/5scHPRiZMl8xRWfcX5YqJY96Mt7d9cGznyw2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YjkBk4J6OiqTGMYfdTJ8ysuAAV6mFTe8DR0z2rMzuMw=; b=hnqq0wAuJ1vrYx9UCv2ZthRAa/ryHjhZVKmu2prxkQpBe38eldRvjhJPZ+702lmF9RWvKZVzLF5F7+hOxcKMLtgzDC4Q+Y461ZNXFJadFXL0S99CDV8OZyXyYy0N8FSGcnbJZJJqNXYkhAGLy52a0nQY49xQgzZOTuAshKYFSjiBUDMxG1GRCO2CYzf/4LuWeKdDXco0iwIeVLbqsmS/JzxXfkbnZaqzfB6QienKkQcKQoSExkBI9znXMo5nhw3RPprPZ6pQpUPctfNfeVDGcE+YMP5y/NDqP+ddSwpjborpuPcEvqlayFyNc2N93YCNIfnoNSxlVrwvatSgRegrfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YjkBk4J6OiqTGMYfdTJ8ysuAAV6mFTe8DR0z2rMzuMw=; b=offchQG0+6m0WQaZ1hj2U8uegavTSlXdjZsn01AhvAdndfyewdi/o64xx+AaBamhHy7imrd1ONYDc15zw+cay59dZAbSCdJmSYOgsyj6cJ1oj4fGgS/DIbpmXo1pDDRI2qXpLSZ7KPucVj/NUAFBrbauLmLXPFgKYpSAjTVwb0k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:44 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:44 +0000 Message-ID: <87zfsafrvb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/11] ASoC: audio-graph-card: enable playback/capture_only property User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:44 +0000 X-ClientProxiedBy: TY2PR01CA0019.jpnprd01.prod.outlook.com (2603:1096:404:a::31) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b2ee7c0-962b-4486-fa31-08dc7ed3d448 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: v1zLmmN7i90RQunLdDkCnUg17eLwnf1ysBezwV54FX9enPWQPfWKqkiqCKZ/7vzpdk/Wjrd6fGRDmzaLLBHZlrYT4kV/uJ0tJtq0Ob/nedIi78W0rScEb+ZKt8g6VaXSNCVZJnMptnZfifJJ2le4+xWWLJXkmYtzbmZiwmphRUkbG1vjtFx8CRvhoWYdJycVpQAkwbydu/n6cflSgyH0UZ5UNG/gM6HlWzGRXxCJa2Au7wLim+4g8kvvSobya/GgKL9wkku1GSqiiw+/qttNO3DzRI0Fhoi8kJ225W6Mf+feqA673vSPKljXSj9S9QTJwSc7qg/8trhF96uYdGLv/lJy636A4fP7hnAFHJctA1wIJMQTMhguqhJpFZ59Ao4OBMhQXNGJeUBg0d7ybe58d0GyyNbz5Zh3bkPjv+CTqjVM1bAVphi/goQcH8jhS82pdruQPDKdW83oeslFsaIrGxA5H3erWgaaFTbtZSlERWTB8vDoSIC6WfN+ddWkyhzlzpKXnC7B0+5AOm0PsiYPDzbkFgkvsc8Xc0lcUoqfK0mI8SFN60Nw/QKcOZaqLI6zAbBe9kJf7nZWUhlCtJBGAlyyrcIQ/4D68uDVLg7gWvbzgnM7OWz/N12pOJQLUw0a6e1pdSjBfXHi4SgsX+draUW/NtMSXaoULgyaLgkXXDpSrEqKV7PpHhsan8Pl9NDgcA7ZHJkLNdOQHlSN29BCDhDplv0c4HwOdkcEVFU57ygaIXg7MhEY0uCYxY780dgXxiP0wsayRZFYCd0tnTFxsoBxDJyZkHNvR/fyw9UlptOBL8s43RHYW8977bm8CuSWXWXzvWAFB/7+jzvwamGKDaw6eRsn7bgVs7h9pRN713y5xQeC5aD1EgjuS+Kq3VjhExi57EwtLhqAxjNixCtP7tekdDl9sXtQplYwbwrUri0ScrJy+Q7RkRqIQeh4DN5GHX09tKwT3QRIsAIsDYtba4vJGV/R2M2MjxShOB9iHtRvDOkbOnqRCSw76FmVSGScXMWJF/El7PKQCNpdpfOVMNMdNJ56dYr9G2myB6JOmH1X49I57IAEgraoRAoRK66WZl3kQ+IzzA55DGyc90k6VVvIg+R/HVAx0+wWngwCYpUzJAUr4eEYyDG1j8n5k7hv+mxKTy6ZmumB9C7+nV3/zATIBCHm+Lcac1k9Vm7sFB5RjXMQNsoo+VoASfyfUex9D81EtKNCsuCl74aDxu7CQ9fUgYdSTrwwz0Mi6E8P8JZqDpSX3PW/eC3NyOJS6BPG+bdL2aJNmHQYuZZy/d2e+CWMGjSDUT8eUZ2dKZIkLLpp5aaciZch/6C5l3o/Cpr8XeoF54n3ICCEEnVqA3883A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FBTMxrvM9Z2fTl5uTtF7Tg3QVF+7mmhq+T/A7KA7LSjjBIfU3jtSQVnBl7u87cKUA3DYlHHS30zrErzFoPyYEH2CJioMqFkDdFDcpKd2FEqhnjVqO4VvNS+rRoclhV9aqM8AezbRBL60CXJvAtg4uOclJgqxpzexiYzbxMQL2unY/DeNT0e9WSU3QUTlcn7vyXGOVg74d2UXzzWDmeYQ6hIpAVnzXDIkgHaaNld0GeUppEDuLf6hxulMiIGJJH4iodbl43lxOswnNxydVY+zxLVl4k0wrUFHD43N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CC/BMlDYqQgzaKvSg1uXRe4jhPHulRzDHXSiVrntpKgeZ1RFmTNKz1hEiUJk4x3KnF17T5mXDOb3FrZdriMCELtUkZQ2ZFXpBiNruRUYDNEfDWVDZSs/5HwNde45hK5HsLUrui+TP+dAnAjEB5zMrk/eHK312zemyI1fEUHFdF94mFG5njOXxhHr1np9Nd5dczZMlc7lhuY2j2NqWnmntzqB593bzI6zX1QtDIQ9AQxZH9iMdSUnGZ7qW3Kfx/AGMJCfRcr55JUqMvQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b2ee7c0-962b-4486-fa31-08dc7ed3d448 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:44.5323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: se3cExhAbIziXOf4v0+TI3S64PNxUWoJ/g8VCAulW6QAW6naBTRYj2aty+I/XINcoIZ9pQoR3g6CxiiWbV//e2dbLvqEImAIGMhOByTFkJErF1axgkIs4dIkammHOJga X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: 342B5BQKID2IWVP2JYOJ2INGPULXDI24 X-Message-ID-Hash: 342B5BQKID2IWVP2JYOJ2INGPULXDI24 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Audio Graph Card2 is supporting playback/capture_only property, let's follow Audio Graph Card, too. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index c60f001468591..6a19e40d2c4aa 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -149,26 +149,44 @@ static int graph_parse_node(struct simple_util_priv *priv, } static int graph_link_init(struct simple_util_priv *priv, - struct device_node *cpu_ep, - struct device_node *codec_ep, + struct device_node *ep_cpu, + struct device_node *ep_codec, struct link_info *li, char *name) { struct device *dev = simple_priv_to_dev(priv); + struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct device_node *port_cpu = ep_to_port(ep_cpu); + struct device_node *port_codec = ep_to_port(ep_codec); + bool playback_only = 0, capture_only = 0; int ret; - ret = simple_util_parse_daifmt(dev, cpu_ep, codec_ep, + ret = simple_util_parse_daifmt(dev, ep_cpu, ep_codec, NULL, &dai_link->dai_fmt); if (ret < 0) - return ret; + goto init_end; + + graph_util_parse_link_direction(top, &playback_only, &capture_only); + graph_util_parse_link_direction(port_cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(port_codec, &playback_only, &capture_only); + graph_util_parse_link_direction(ep_cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(ep_codec, &playback_only, &capture_only); + + dai_link->playback_only = playback_only; + dai_link->capture_only = capture_only; dai_link->init = simple_util_dai_init; dai_link->ops = &graph_ops; if (priv->ops) dai_link->ops = priv->ops; - return simple_util_set_dailink_name(dev, dai_link, name); + ret = simple_util_set_dailink_name(dev, dai_link, name); +init_end: + of_node_put(port_cpu); + of_node_put(port_codec); + + return ret; } static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, From patchwork Tue May 28 05:05:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65C86C25B7A for ; Tue, 28 May 2024 05:08:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 717F4846; Tue, 28 May 2024 07:08:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 717F4846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872905; bh=25InoeQZCQShXtxXew9EC80oPB1bzBPU+cNrkvUXL40=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=s6QB6b3KDAYneWIsaJjZdlQqEYqJORKiTwtFCGDbC/l2huXLGt9RUWQ+Gaj1MU9pP U44LxHkdMHgjvfJpSJRqzLEj8iE4KQhsW6v+Cq90q5uZpXqODlAR0Yu7Pj8hS+rur6 5+eADZsNGL7AYgky4x4fVaOPG6vlsuGyABNPvcBU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E35CF806FC; Tue, 28 May 2024 07:06:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6C99DF8070B; Tue, 28 May 2024 07:06:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DAF63F805A8; Tue, 28 May 2024 07:05:53 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EC5D8F8067C for ; Tue, 28 May 2024 07:05:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EC5D8F8067C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Pq9yYKzf ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MOUx6xG4kt9Ob+sdpY/QN/mL7UhshDYFOiMZAsNpddGxaorVvdW8Enh9/uriQZ816zOFdEu7ykHfvArhhqrVPHKgoD+qVJSWkwL2CCWvgtZNB50PmKiUFKoNAL9UFgWj3vHBX7Z16YaQHPmsH1JB4mefFqBfkEBole0qhdTdXAXBb3X/sNfrIe/vnDF/akbEUxKH5R1qM0wdAkplvA5Pm9YaYRAPPNAe+AAWW+AGbOWxvqpKprjJeSCgO4baFyOeThcwJMdhaTzB1IvXkKFUgdW/vB/FkIpGzIzPVVzhTXHaFsVvqWs8WpTEdOwDfUGapY8nIFPrL+i7bs2UMnlNdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=joBcpE/N6y4ZBlB9XeUFH0ECYeUhLnw6Upvk8stfclI=; b=JzX3t6vSeaeeYiWpLCTL54zegA4CLw/h3uD7ilfSq4+P+NCfB9tFEZZpw4OIHKjpoWM0Qdswgnm0ueR+pyG/+JMIbWZXiOhR/R1zx45qE5F/82aJoT1NK5Jw4A3a1d45DogfzKomRnG36YRA5w91FHCkcd/HRMzlK0chawdafcbo5SF1AFil/tmSgvwtU/ddmkw2OvgQZAdN49Ok9NZu/g4omGuA+5YP8demlOKP+34v5/oEClw3NSG57FhMh9JdmE3OT+5k0MjbBL7PWzF+my/MeSzY7JU9fn7qKhm56fSdKp7S/7kEMQhwxCqsFTbYei0vQuoxSblil3nl+g+kzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=joBcpE/N6y4ZBlB9XeUFH0ECYeUhLnw6Upvk8stfclI=; b=Pq9yYKzfyW+0gREmbj6SW4XfTPMOGJGVZexek+gVOnO5zyntAAFEU2kZ+5sGzBnbvE58/98QkzAmg2jNaxXVx+SpC/2SyfxH3Qdt+wKAhpWlTSTX1nB+hjq+/+cwRXfCb+hHvQVvpBdcT7IZsSOVAPdPW+M6XDVUMufyc6QOgIM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:48 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:48 +0000 Message-ID: <87y17ufrv8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 09/11] ASoC: audio-graph-card: merge graph_parse_mclk_fs() into graph_link_init() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:48 +0000 X-ClientProxiedBy: TYCPR01CA0058.jpnprd01.prod.outlook.com (2603:1096:405:2::22) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 46a3d0ab-5f31-4990-7c06-08dc7ed3d678 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: vc6XVuS5d1nu8lGKyKoPnr689DD2xNvhnJiFQkBz5gNHVwCUM/r9nEmygbNRa9tuuHLhLBNBl9Zaxs70kUAAVv0NpmaPNNLWdYNxg/D/SHrbE+fqdl7i2QX/cEP3/je+KiCNZLkAKVgQxz3wcDHjZ1QaaT/t2Cy3TG40bhZmh1u/bx2XdSEMgqrInWN+Q3i2JX4f5J0PX1McBFw+A3rlPMQSaLjHac3fuOCUwaD1xKg7RK/1QHgEMTTYwt3HsIkQODhP3XepdqBwhl3ZUd0LjfqUo/ZEFbDdkhS121Mr3z9TfX3p6ik4kMSkh87emEfLLKFo7eMS+RqaLKVy2dq4uGpI8aosPfgc4BydT+4L2zqb7Mwp800/BNS4id7MbqzNQvyJZGUGN/KjWBUKH8o0SaMouI4PNL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005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kqsPCBCuIyc3ACz38CwXuB89AICDF+V5KrDGRyBJliZb6DuiuCH5nO5FdBbjfGYnCyezVPj8VY47kFMyoNlpEXieFRhG1NAU4mJVI+xmqS4u+H4IbOw3AZ8+cw2QFMxvd23LsiPQfPKcjsYJR80jkFteXlZMdc+j+/uqknYD66r7NAVX7hsI3IBd7Bvc5wNTtBlgZ8Nhgu3w/qFLQV3zkUHDfPo/QPxUL8/G4mvYLldfwdLR1/iwhIIP70I+WG/vCpWI4UI/QrkPl9+AIT3trxLTBhuCXAV3K33/hUvkX2SsF2bTe9dld/aY78F3KD2NQg+ZJJD2qBUzQpeYHJ7c0UfF95LVKJQotxp6MeTQ6Ah8Yy6UiwSRqXtyZh1OMZEBiJ9vnZSLlBqitJyfaRh0sN2GFqikUGowT3aAS+WqLJojRoMGQrLsIrxQkqR1HM+GqGhE6lTWm5PUVLWU+tCj0Dv/53byeEmvzt0vEI8Og3Oc65GP7EFP6hjcWWMz/Cd/opL4sLDrCu9rmAP0yT+nx8zDwHLOyRPQxHuFCq8XZniNbn2gH29nKukZ5+0UToKQq0xBGsX6sy8Q/Neen6iAcGHHTT6vjvXZRVBK/sOQzdXfEgrm8qiOysWR35aPhOCtEzYbLEHSsAv+ViHlOsf00g5S+zzu2bLjnVjNal73bWNG8C2EtnWZX6mIO8h88uEmKLNOCMAS0j7zr8plklPtM/0F1j5bCPf2Bwb/qcqLetc1IZDTC5/SnsxtMJbv2CiErA1OC3M1PfVBflXMumZjjcLpgC9S5LJBbQh51xel8OthqGCSirzVC5gZBBByCYM7EItYoMXytqNT4v3QLEl76F9oSJ1oQCI4EBonasx134dxN29vYhDgh5+UYAIyjMcNN03QpBrwlvXM7Jt+9dZIveRo43/aThRMy6R9sols5r5/ByBtN4zbAxyZJREx5M74lrANp7rWPdC3zEWX3+qQ677XSu3zP2aTtJ1Nhzk0nj2lEIiAKxPzwkKCbToLMwZhoAm+An9QW4divh6WG0sSrIGiqePu2gjiExU9fojNm1mFezEGeLYzQPj4fRYGtRVt1PqHxULz0qUPfyTT+HxV3WLUml80aVteA8J3MfE89T322ZbAuQfOw+XibwlZGC75BuqBTA6II7oRcREnFmowrWOZbUfayGA62sDbaAqLnXVOg8HR/ROxdh+7kYBR/BR3MQhlgWrSYfNuDP3MieIJk7e8vUJMHkV1ncbi8UOta9xPhFA7N492sW5C5M3lEGQb7DQazF81xaLVZfzbhXH+V69/iZophopLsOw7SLfUNkSxLCqSsKaQGZXAJExbYYfOxdC3uvOyTC5UBSZiIvuo53KEBXU05rMSrJDY7piFJIlybO9SV6j/EC+23OoUNajAeNJ1PxgO7ZsJFhtvgrsVTub8GuZZcJZ8BJTppF7VvC8R5StyxLHTS/6Q6uk78sr8CmG+Nowq+TVwD/WIzIasZNkeA32iHkAf/G8Vr69V12b7nyWrW1EeoaqhLhYdALxwuH9RW28Ls/Njli++G2xMPcQ+RtmNQ/sc56W9mB9BNR38EZ6jrlw8iii5mDEJMnepC41I/Dm/lAiO9aXuP9q9LCxpJUzHuIocEkoQVLzBHzQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46a3d0ab-5f31-4990-7c06-08dc7ed3d678 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:48.2071 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9QnFSpeXywkqk1DEShc6xfVfuSZMIZYDFTsHe4qv98WPqID6OprxPoEKzc6YdWrVpMFcRi4WQEZvs1H4f1lx+aHeqjy0eTFal7IbNeI5dEhBkBQR8njK8RUkq2E2XC73 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: KZ3ZHYQIQZ2AK2M3IWHHA4FIYKYKVYST X-Message-ID-Hash: KZ3ZHYQIQZ2AK2M3IWHHA4FIYKYKVYST X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 32 +++++++++++----------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 6a19e40d2c4aa..7b981aa8690ac 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -94,29 +94,12 @@ static void graph_parse_convert(struct device *dev, of_node_put(node); } -static void graph_parse_mclk_fs(struct device_node *top, - struct device_node *ep, - struct simple_dai_props *props) -{ - struct device_node *port = ep_to_port(ep); - struct device_node *ports = port_to_ports(port); - - of_property_read_u32(top, "mclk-fs", &props->mclk_fs); - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); - of_property_read_u32(port, "mclk-fs", &props->mclk_fs); - of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); - - of_node_put(port); - of_node_put(ports); -} - static int graph_parse_node(struct simple_util_priv *priv, struct device_node *ep, struct link_info *li, int *cpu) { struct device *dev = simple_priv_to_dev(priv); - struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct snd_soc_dai_link_component *dlc; @@ -131,8 +114,6 @@ static int graph_parse_node(struct simple_util_priv *priv, dai = simple_props_to_dai_codec(dai_props, 0); } - graph_parse_mclk_fs(top, ep, dai_props); - ret = graph_util_parse_dai(dev, ep, dlc, cpu); if (ret < 0) return ret; @@ -157,8 +138,11 @@ static int graph_link_init(struct simple_util_priv *priv, struct device *dev = simple_priv_to_dev(priv); struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *port_cpu = ep_to_port(ep_cpu); struct device_node *port_codec = ep_to_port(ep_codec); + struct device_node *ports_cpu = port_to_ports(port_cpu); + struct device_node *ports_codec = port_to_ports(port_codec); bool playback_only = 0, capture_only = 0; int ret; @@ -173,6 +157,14 @@ static int graph_link_init(struct simple_util_priv *priv, graph_util_parse_link_direction(ep_cpu, &playback_only, &capture_only); graph_util_parse_link_direction(ep_codec, &playback_only, &capture_only); + of_property_read_u32(top, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ports_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ports_codec, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(port_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(port_codec, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ep_cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(ep_codec, "mclk-fs", &dai_props->mclk_fs); + dai_link->playback_only = playback_only; dai_link->capture_only = capture_only; @@ -183,6 +175,8 @@ static int graph_link_init(struct simple_util_priv *priv, ret = simple_util_set_dailink_name(dev, dai_link, name); init_end: + of_node_put(ports_cpu); + of_node_put(ports_codec); of_node_put(port_cpu); of_node_put(port_codec); From patchwork Tue May 28 05:05:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FEB1C25B7A for ; Tue, 28 May 2024 05:08:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 750F2A4D; Tue, 28 May 2024 07:08:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 750F2A4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872925; bh=Kxs3MQM9tMF6AmkgPh9kQK8vqkgFVRAEEfKiaunbNQM=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DpdpXMawSXaLYEyH2yPkGkkAfA3ldY9D/YwhN7XLxHiDOiWTSCcLbT0o0BIoiXBqN HlUr3JcIdzamczsLbqje+S48aWj1p0mJwluBZ9PAdkX9gJjK0RaV54j9nTpfc1p2DM 0qhDY6e6CG8Al9732VXGWi45k8M6Lg0H5ZZQ8Gyw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1B19CF806D7; Tue, 28 May 2024 07:06:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 650FDF805BB; Tue, 28 May 2024 07:06:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3141AF806E9; Tue, 28 May 2024 07:06:00 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ECC75F806B6 for ; Tue, 28 May 2024 07:05:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ECC75F806B6 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=lPYYLn1h ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l72TEX3vQDxEANHSWDofdcUUDZ4cPznQOlf5RYcn4gC3uQBIp25vnM2waiByZIEAjIFo4tMxV6x5MNZN6k/2iWM7JJP91LANcFWuZo3kswDYuaOpDyBQjJfU8SbP+SQ8d3Ohi/5zHMwsijw15eBek9liic0LOr7D+Cq1cgm2bk+C0fPUAlJ8Uuyvn8jaec2j/qJMdC2eBc0jsWzh+MLQndrw8xuOwVtSa69izeqhnKsBAbi1VUISYxst7+vj4KDSN7dKElA3DDoiZ5tdHyaDsKQvgW8YXK+08d325DHJ3c7DaJ2Y832EE2VoXCKRTEE2suZ4t62AnZ44czR0eS0h0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O1z/NSHbAdkWBE6TnyfeicDPrjm4pqVUHQhuwnYBkVM=; b=BrXhr/dvVSW1wcWBHH+xs6QnKGMA14gb29/lLCl6E5JxzqCJSKnaDo/AL8I/Irt5vjSOhvoKwVZVztRYK/fFm5wUaajmqbY2TzJGtoYwjX20x2vdWDU5fz2l3LaTcv/H+tywiGrBFrEDsxzhhwtG+7dTGpdE7CAxXOYnWzrq2f43LY7eoWJLPiTKpj7vfYFHspupUroqNOa0CtubNrJr7i0/LV3LDx8an7tmTJhJTFXQWQhmiQvE4ccFQPd0Jb1cOhzB3ElI2HYW3T7tIDSoSmzMzckU02b0Log8IKJ7xMnkv+0pVn3ygiukyM+WEV/uRQxwECxFYIoHeLbMf7sGPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O1z/NSHbAdkWBE6TnyfeicDPrjm4pqVUHQhuwnYBkVM=; b=lPYYLn1hPbhW3w50eGg2ItLrPU7fRGHqTjE8Ev7ksMx9L824CQahCf1Hyf6JDCGj+chr9bn2qdsQXjrM6ZPNyw5EcAt6FvdSYHpi33iLNRL+KYh2sXxl0On3KpRPSaKjUn7GlQo8zkCrK3GyRRLS+4lJ0eoigcszp8VWVUhzmHY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:51 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:51 +0000 Message-ID: <87wmnefrv4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 10/11] ASoC: simple-audio-card: enable playback/capture_only property User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:51 +0000 X-ClientProxiedBy: TYCP301CA0074.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::14) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: d1a71641-a3d7-49a9-740d-08dc7ed3d8b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: XoH54Sj28jlf+4JvTWKg1crca9WsrY0gic4NZYvetAwgxqmvhj4yjUkxpIeC8LZyCfX+XU8J/hMWaI3SLfGwp66c7/ayoKJuBGBxQCbUH3zUuL4udmBqjYhm4xa46b9B83xFilIJziLGZsDFa5YcBbVHLYiJekFPQaKuNdQIKVCkXq+nk1bEwkAC0bkqvQ5gxkAh/gvKDkgWnIo7DVUEDpJVW30xC0i+0z6zW8ahU88boAlXNtJSKuz2k8blIobhdeVffDWDj1kEZxkIAWmqsILqxrmUP38oa5KTR1hGAOFuiCkn7du0NBH/SJzSny/yfqZNtH4M1YzLzM772U52g2RVAwoKvPdWexGzi8RYyOA7OGVucUZCGxQWoCdI//lrkAdjiALNAMj/MBusYjQraalulcQAQrT1r8TwpEpNtuoChokz0SaPwd/4gD2qNcPJI6gMtdevpVOuMWpQKqa/fcubqqQpQW59OLEvAEfbX/wL1SIGo7EX2+gTV97GyrW3yqgx5r5p/qILe7lGtx9NYw1kX45ljz5IuicMEWTCXlWyz+xmpFaol+aE2ItRV/N/M6Tg1cR7gQ88RfM6B533ecEL/CHGVN8UEtxeavp+Y1l/Tb4NJuf2PbKyM6FSA2sv5/vh1d6bLQ/N6/DRTCCSRpnSj+1MdXkbMnVwEZEC4P9GoISBgrdM05+SfDXLQIKLQPd7SY/a90RCXDZlxHMtwRzhTWPPA5ypAZlLHgAa0nMlWIfCt0/2hLyL/eP6TinAzcp7BQR0SM7ZQQF2XurNbUfgkuAN0dXUTX5UUbx5KJpseRi15E+aM51wZ1/vI+Wt6HWlBJH1Ag7MWIttvajepezlgD2Ap2hdJgk97KYa/DYUwi9kDEQVSFYBHnGY7a5KQIsHHS7PKPrGea2y1jEfDiQ42cvM1JktHNhDNdOX9pOmAXmt9hfXwvIAqGznyciqPVX3CNtt7FBmFCzh+mUoa53Us9tpP1huCWspGUYRZz2FGiXS3GZ3RiHSdKC4hI0tP8m3+zTIYyNbIOYhj30R84td8nblcjJjZWb8zdMOBNu7145qYHcvHTlaF7/hGJ34IbT//ZfTps1RqQtUY/1ywENdFV+08heDBn6AJtUhHjm2B+JipihktVNLOm/4sBic1Tg4OBNVINv9C1w4YQ4UL4JDcBRLjMK4kTgF2Bc0tVm7kEx4L3vdEVki0CuVXGXD+CUF/zTgszOmXjvrnymWhbxOyOiUDH63ezmo1MrfGFptwkb4ImkNnJYkc0nJ+5r2lZBul5dUDM1cGq/o9qVz5azalwLJcqC22hdzYDxausutTiltAfoX+2rvq6z5XIh2C6CJptZIayZp2NLxnCRXww== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-M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kObKGFnwqP4FookIsCfa//d1sOpxtaXr20Z8Kbr6SxUcZfvBWSztazBDzObvAGzgeF9LCguElvKc8gYq/sdHNe20S06LDZSONJjfbhVzls7jNMyhNdGpcNtMLC5/LMCpcYtFTR+NvQWoOpbJCqe4iv+Xe26prT7V2wa4q/bir5R8YYbGBVcVNzMjrspROKVbtOkNd0S6852qWj+9OIp4Sw4Lc3bWgNI/BL3q7fo6IKGidoz59sxEb2eNeiR+FP6Yuh5HokeyNr1ABfmBAsQCUzTPsQzQjWnPA+9e1Wdal8T0F9ZGkggbqZsyeWfPaPZwgq4TuhCueLweI8Tg7CIf1IYGumAzg0to/cb+rw+shg/7jCm3Cdj4fjeTfgZIOquwGWguOn9HdD88c6ug1f/qIHf193WRKyeW7XuaFfqARpWk5lt0N44rf6W7jGuPoCRIBn1HwJ3e4sdh961z21sYU4xWflZ6omO7zAJgq08bjqysllNcef3T1yaxubrvsA+jaV27pEwjlh6+6x4+b4iTTHfCHFcWoonwzF/XksR+YiYAKArPA9ibpEPQr7q/LV76SsFfxunfnpyENzTNlFXHgiFLTLxo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1a71641-a3d7-49a9-740d-08dc7ed3d8b3 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:51.9293 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6CAuEhekDY6ZTvJmiHmQxRCLJx+DMcVt9bwIv8IIY5mEXf1TWrHwp4YmlaeuIzYYPyT1VDP8QNrIB1KgUYzESGfVeAD5gbSHPOdrW0puBFfMYgUxoAdlBkQqo8mhTCpf X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: PS2TSFGFEYTKW4HIZXIQ7YOXZHCUX7GX X-Message-ID-Hash: PS2TSFGFEYTKW4HIZXIQ7YOXZHCUX7GX X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Audio Graph Card2 is supporting playback/capture_only property, let's follow Simple Audio Card, too. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 9c79ff6a568f0..e436e8fcfa0f2 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -187,24 +187,39 @@ static int simple_parse_node(struct simple_util_priv *priv, } static int simple_link_init(struct simple_util_priv *priv, - struct device_node *node, + struct device_node *cpu, struct device_node *codec, struct link_info *li, char *prefix, char *name) { struct device *dev = simple_priv_to_dev(priv); + struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct device_node *node = of_get_parent(cpu); + bool playback_only = 0, capture_only = 0; int ret; ret = simple_util_parse_daifmt(dev, node, codec, prefix, &dai_link->dai_fmt); if (ret < 0) - return 0; + goto init_end; + + graph_util_parse_link_direction(top, &playback_only, &capture_only); + graph_util_parse_link_direction(node, &playback_only, &capture_only); + graph_util_parse_link_direction(cpu, &playback_only, &capture_only); + graph_util_parse_link_direction(codec, &playback_only, &capture_only); + + dai_link->playback_only = playback_only; + dai_link->capture_only = capture_only; dai_link->init = simple_util_dai_init; dai_link->ops = &simple_ops; - return simple_util_set_dailink_name(dev, dai_link, name); + ret = simple_util_set_dailink_name(dev, dai_link, name); +init_end: + of_node_put(node); + + return ret; } static int simple_dai_link_of_dpcm(struct simple_util_priv *priv, @@ -278,7 +293,7 @@ static int simple_dai_link_of_dpcm(struct simple_util_priv *priv, snd_soc_dai_link_set_capabilities(dai_link); - ret = simple_link_init(priv, node, codec, li, prefix, dai_name); + ret = simple_link_init(priv, np, codec, li, prefix, dai_name); out_put_node: li->link++; @@ -336,7 +351,7 @@ static int simple_dai_link_of(struct simple_util_priv *priv, simple_util_canonicalize_cpu(cpus, single_cpu); simple_util_canonicalize_platform(platforms, cpus); - ret = simple_link_init(priv, node, codec, li, prefix, dai_name); + ret = simple_link_init(priv, cpu, codec, li, prefix, dai_name); dai_link_of_err: of_node_put(plat); From patchwork Tue May 28 05:05:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98FB8C25B78 for ; Tue, 28 May 2024 05:08:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EBEA11F1; Tue, 28 May 2024 07:08:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EBEA11F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872931; bh=BqR1rgdVZRZBTDS++jKQhMd99CKEKoOBkSZlJQabgzM=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=FgLOANP4FK1cGdFlvWxaKOrog9hlUZcBJV0xtCBDvDn1lQ/9OnLRQBNG0m1CjvXal MW/HvU7SodYi87kyu+ovKwPYykKA+KymvGqXP9nph/RkoAelndci56YFlc4F8DVSwR FAplPimakD597LskOHhdIRZPT8888/wzacohGEbc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7433F80766; Tue, 28 May 2024 07:06:09 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 41FEAF80736; Tue, 28 May 2024 07:06:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C6509F806E9; Tue, 28 May 2024 07:06:02 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 41503F806CC for ; Tue, 28 May 2024 07:05:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 41503F806CC Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=aerAnvRL ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+2scd2dMpnjytUqwwwxQW2+p5eDCIpC0tk0IBYxw7J/QMculldNygScmMUSkdZmehKA1s+I7gecizKeucitvNUIIPR0kN9tqeiu5imWCrbmY7PBMyV78Kk151W2Elq8nRLWti3UnSFmlDFt6OLcq4Djh/h2msDP0jI9wJVDqrnyqfX/dKzzv57aDJS0djW28KCnRv6JhJB3qC4NLD3TsIGr5GNYkXFEtDf0IO9MzdvRjOMen81F7crF97R4SDilesDSdWocGb4/XisxccVZP6Tt8CEDmK0ei4oeiZeG4Yxw3qGfMd/Ahj5FmcvatwERLqIQtRurVbJlNFVUY+GObQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wBc2/CbftIoy+7h4Wq+8swAi3O5Uz2KBfJxABk5G5sc=; b=L3s7NwRzHNRmbHWJrrwubK3IFv0Wzout7d0+E7bFZd+VBIa3bsDU3eMrvaKCFyxZyI6pkto69sIqqSTWSyXH7p85tabKkkfAPBZgro8G7RjgxH6tMi5ymnGcxHMD/Lw7/KgSlzzj1r0hDppv393sve2Zm8BBom5G9w0zIj9sPd91KPUN/6ghcSxcq04XdlI2ePQyEMUSi2pFsmsN5Vmvz2esmmGndEq0GG6uFtYuZOL072TVstBzajkOT9rmCd5g2Y1lzRKDXdWgeBwE447xrs7u1wP38h6qJtNoIG0GxsachhEbnU6c7onXeCboRxSaolLy54fYNPozumPpua9/5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wBc2/CbftIoy+7h4Wq+8swAi3O5Uz2KBfJxABk5G5sc=; b=aerAnvRLcWQOtHn5cAGRmTsF4xg8cr+9a8GhZvuOcrLQsohmUVlIbv/oQ+yKcX98vDI43vkJKw8X75ILgun7Xc7hH01gsbb1Y0EicerFpiRSSk1bh9qAxLaRpdm/AHNY8o5fzJGTR/yn+PcPbadkG5t60As+C/DkrmACOIHdapg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:56 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 05:05:56 +0000 Message-ID: <87v82yfrv0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 11/11] ASoC: simple-audio-card: merge simple_parse_mclk_fs() into simple_link_init() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:55 +0000 X-ClientProxiedBy: TYCP286CA0086.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: db75e5fc-6ceb-4781-f09f-08dc7ed3db22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam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z4bqSDf3wx2Orzn79yGKBBIyOt7vSXDY7ZDE71suiXWyhFH857XWJvFKeLWPGKnat8OItJqDYB/Iwn37ncs3Okhemd+fV/wmU1yKKczxwuwSXPpfKlEnLlJXtfuNCDVwxQywYfUXQxSX4aBucK2CpP89D1h0FwLVC1V1FfiDhdLcRUWhl6tHb2mwWicZml+Kv3hutVGtZnBQYW/2Mp8oiWGws8igi4QAlyasGD9f7t//Ssnpp5eMKckYcKcrcWJwlGkrA1X/fIFsD9t/rZ8dzw49TTTHVCGL0S78yC/SGGRA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QfkEji81Mi3kkzDoYg8L6X7yx2NInpmaBFecl6+xj3VuLSxaC6OmgtKX5sc/rjWidM3O0UCFYtLshEVERFz9m37y0VyHTbBB85ECtGnXDqIu0oxb0aO5y0Y94ai7ydLA7IGxx0+268br5Uas20aioraFNKCeRRwlSKay7MRbgaa8V5XRk2f2jS3t7bxBCruJZFnCmAMWxGEhuAC0BkurtVtNSShsNITzymSGc6KRNZouobPkWNhi/s+NTNHz698C7Yf7BkXe+wa4j0dCP0BxJhSF+QZsyesns401XoLcQ2Kf4tFUrCNB1nIzPgGvUsYhWnIzxnwPyyukQ8BEtqLTqpSjiI4h/ZwZdD234s0Q8ICVV9koja+/nMDwyFsATkYbncDRrR1xUoJ6dKLgvQkgzZnqMCCAozNEsNHo581gmQbul6TlGba8Ic+3wNj65r9rToMX2aoj687vUQSQMRAzhlOxiy/HIjDg9/KWgGFl5xbExPY8QJTURDT3p3yZhY5Ol7gejLL0XCwZxF6/vog4SaFRRBp80XCBKH6QUGJ6OqTxAH3DKvY+B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ftJrDc1yk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: db75e5fc-6ceb-4781-f09f-08dc7ed3db22 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:56.0188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BuT2p5sPO86Cdxtkta64Y9DtZkfe+C8jrAPwjy2mNLF+csubAyBfcMHWzXe2Gy/99hK2ywqJhmUTAw5yJVNwEZemhAh/2epwCCLFWWI3Qnu5sRzEV09cBUKnrxHdipsZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: 7E6KRGJORHMEQPRBUSZDKCRVOZ27CLRR X-Message-ID-Hash: 7E6KRGJORHMEQPRBUSZDKCRVOZ27CLRR X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index e436e8fcfa0f2..2de5e6efe947f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -129,24 +129,6 @@ static void simple_parse_convert(struct device *dev, of_node_put(node); } -static void simple_parse_mclk_fs(struct device_node *top, - struct device_node *np, - struct simple_dai_props *props, - char *prefix) -{ - struct device_node *node = of_get_parent(np); - char prop[128]; - - snprintf(prop, sizeof(prop), "%smclk-fs", PREFIX); - of_property_read_u32(top, prop, &props->mclk_fs); - - snprintf(prop, sizeof(prop), "%smclk-fs", prefix); - of_property_read_u32(node, prop, &props->mclk_fs); - of_property_read_u32(np, prop, &props->mclk_fs); - - of_node_put(node); -} - static int simple_parse_node(struct simple_util_priv *priv, struct device_node *np, struct link_info *li, @@ -154,7 +136,6 @@ static int simple_parse_node(struct simple_util_priv *priv, int *cpu) { struct device *dev = simple_priv_to_dev(priv); - struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct snd_soc_dai_link_component *dlc; @@ -169,8 +150,6 @@ static int simple_parse_node(struct simple_util_priv *priv, dai = simple_props_to_dai_codec(dai_props, 0); } - simple_parse_mclk_fs(top, np, dai_props, prefix); - ret = simple_parse_dai(dev, np, dlc, cpu); if (ret) return ret; @@ -195,6 +174,7 @@ static int simple_link_init(struct simple_util_priv *priv, struct device *dev = simple_priv_to_dev(priv); struct device_node *top = dev->of_node; struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *node = of_get_parent(cpu); bool playback_only = 0, capture_only = 0; int ret; @@ -209,6 +189,15 @@ static int simple_link_init(struct simple_util_priv *priv, graph_util_parse_link_direction(cpu, &playback_only, &capture_only); graph_util_parse_link_direction(codec, &playback_only, &capture_only); + of_property_read_u32(top, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(top, PREFIX "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(node, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(node, PREFIX "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(cpu, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(cpu, PREFIX "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(codec, "mclk-fs", &dai_props->mclk_fs); + of_property_read_u32(codec, PREFIX "mclk-fs", &dai_props->mclk_fs); + dai_link->playback_only = playback_only; dai_link->capture_only = capture_only;