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+kSfIyQLX1DOX24iU9bh593w0VwqPSdckokyQFkzrjbbV3jCkx1cYj8Hy4AGEc/Kd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LSr5pYun2EN0BOZ1av1kL15ATnpItfSIqOHCSebHe6Nyk7N3PN8/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,