From patchwork Thu Sep 26 00:00:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13812665 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 4C34CCCFA0A for ; Thu, 26 Sep 2024 00:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=koVj8ffD+8N6zaVVjRYsPwOdg2G8Pn8Jmxpzw7JecKU=; b=vPa1dQX4vE5hEjygyv33gYUJOW DCvA/E5YzKjD8IAeUj+z9gOg4JM4LE1I8tGwpIXjxDNUNu4JazynOVk0SwR6hh2kvYNeEAHY++iaq TzNE45hyb3Eq06APFv5aHGGPPVQ6gK8z23asjH+7b1h0tbnMd5p+H56sshecJiB5NQ5xoRxoQUxE5 G6k9QdrAb28/159gKxxkDtgUi1rb49IS+llxlVsacBgxrLVVlVuuWx4f3o3TO4kuZ76UAop3qDtOi NKShdSEh4ddzO6yQUkr6UDdzSbrkNt9Rb06c/NkhLb0nihUQ7Wjk7Rni8G2hfchK0CIC5w9ixMwEz VzIqvwSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stc1O-00000006pbp-2Gwd; Thu, 26 Sep 2024 00:06:14 +0000 Received: from mail-japanwestazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c407::1] helo=OS0P286CU010.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stbvu-00000006ojv-2JEX for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 00:00:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kBE0MfhDbQGM6K9rrZL2dUuUzuaa7tIN0A1evLcnSwFKfwNQSGK5vMq5kXlXsyoeEPZte0NS8tqpClJas81DwDcdwkZOKN5EinfBX2d3MLBD9u9FgjvuyEp/ZoONaYSUXTCwTubdq/2Cz8LMMZQcnssSc29jZ6+PL9zEC2LEKvz09JJ0NlJVT+bUgjmQseEfwAqNogoVuzV2JeVUYbjjqgJzdm4j2Un74CCJEWHAxnnQbLXcOuHCcVRfnz1tN/EaITuQ19mommHsoauujK1lUwWvh0pksldMxgbDCeLsHsbvLHlIPTn6mor+3U48XVVzZveDWRxpH3Z6GGMJMU9QQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=koVj8ffD+8N6zaVVjRYsPwOdg2G8Pn8Jmxpzw7JecKU=; b=zFeUY5lfetFm6E86a4cmcL6QncVWRLr5efRmDKmNbQWP4tCtFRINqpKCGG8/6LF9ZCrhk0s1RlGpVduv/OE2j7SnJeiX0VFVDbEyoPPZClqdC1w11rmGSVik15VhroZuzCdGTUkU3qx0SX7H5t8D20bb6hGymLWTgXfFlf5BXLOkBDoFCCDAS8ueHGsPx5xa6ofPAzV/SFx7/MmXQgwTtBKtErXUlVCc5MYkaMvaWbMXc2viCJLGW1dHpW1QfRsabqxvcS2fcwGReCBJkA0OFM7prsNpUFUrEERs7Ir+Trc0BqjpNm6Yy4EW5QfzYaHpiR52kILlHjemwuIgbY62Aw== 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=koVj8ffD+8N6zaVVjRYsPwOdg2G8Pn8Jmxpzw7JecKU=; b=Ri2NY8r2UqtShR3PWwhF/2TpUgA/qOyDHvJzt/wEpJ8POhHaX62aXtI87E5JU1N2dCslVeYUZf7UFuQ2u41AdWXM+Y1k6tJ8lgFD0xy3Tyg16rTe9IJaVJIxqCnkpgaN+nv/mQeqDr6USJ4g8mZJB43O1TxYB6mn6M6eQmZyclo= 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 TYWPR01MB7353.jpnprd01.prod.outlook.com (2603:1096:400:c6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.20; Thu, 26 Sep 2024 00:00:31 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.8005.017; Thu, 26 Sep 2024 00:00:31 +0000 Message-ID: <871q179tcx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v6 4/9] ASoC: rcar_snd: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org, Sakari Ailus In-Reply-To: <877caz9tdw.wl-kuninori.morimoto.gx@renesas.com> References: <877caz9tdw.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 26 Sep 2024 00:00:30 +0000 X-ClientProxiedBy: TYCP301CA0089.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7b::11) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB7353:EE_ X-MS-Office365-Filtering-Correlation-Id: d9b3d3d0-0c40-46fe-9e32-08dcddbe3c9b X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|52116014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: ZSJ3lUff9gN7uceio5zBIjRtqFdJUw6RKv7qkv7Wi7HoKEN26O0khECLAZcAGDSA/rUFCGwkjkUGjU1W+d1hQEJhu0sHNiYSW1a+3UNUfPgiXuIbQrF/jrvETXs031FkIqSJ9G5ydmJNAk5BZQheVsaaFJXps6z2CC+xnTi9CympRjZQQa1DhK4ur0Ptcz/rQNXenyXZhVFwyruZIeESAYOqvSzuaJ/rVMkJ6GGjuoK+hxVsYRb3HeT2mZGNSo+a5/vxGF2YrsxkjjgItVvka3PHGZuunNfYeHjo5oWRc5zWJjqF13FrAjGq2XrXOLJBTaw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M6xKXTZ3Az7bkyaaKg/zmSaWLw9LcUQu8E/vj82WIMe0J9k33lOPmSs= 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:(13230040)(1800799024)(7416014)(52116014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +6+1ulBT/dI8Lm/6ZAkxYSRvfk74xQWPdmFVh8Peoblz7APHmtsRUXsgISrCG7vZ++yTFWbfU7VJRDqsyOgSBas8Nn0gd8QHWeDjZePkamko3jzD/MHFmKC189KmpeX1JKXz21ZR71XkdDXM02L/7y0Uuv3XxYhRy/OcScNok8ZHOwtqtAX3zKkv1I3BI17cKfkpmUNfv7O1CgItZ1kMaCN7/+WnqfzGBg6Y+qU26jX/je2a9jGED4zcc/n3oTvqJEff9/qKmH+88xNk8FSwm0pslilZVG8q3N0kvW2W71f2BNLJ6pl6lFWLHbybo3LqpaDZl95P4pNyojugJYJKchl7BWeg19VW7LXSHXfjcz/SB0esMyPkF2VRQ86xeAnchDN9s4hf1W0kQ6xTkN1F+8TbCqA3DSSVOAoZshOPlQM9w/XIwGb6GEBvfKs+9mn9UgLxY4Z6Ffr8QzPGUZLXlME8+yLQfT2w8LJ0gciZkFF6eTMTQ7iFSOjoCU/SFO2SwC/1Poz1v9dTg/TF2SEEdLeZBHhWeA9HFKLosXO+wtFAKt8HngjO75UGkBvQ1IcYPrHBlu3JvbIfC/tF51XAuAFfgUwqyRpLwLMygRi3Nnu0T6iP02P5e6jZ4FGq+9KIytS0FAyYGC2YLG7Zc8+sbT0giXRkHke3mbVRd8YvvNZPbeHeAW0rlHs0HwbDNoep/7idq/kPNI1CBszVtLSL792B47iTWC+SDIgfYrUKyHXrtyIq8zLNv9f4Rh9cVYjARM4DKKVIy795J4J+70J7HQc1epHvZTW3slDFsWDxWKe50OlR34CWhIpcx8iNoRjl5HaMnzZQISPLvvaP7o0CUzRQI4N+E6CNnddL4IaE89Nh/v3Z716AzjrLniYFCEMspaI4YiNhIq1iPEXcorUT/6m6gkCF7izzp1PnR2WwjhDrtrLVhEvd5TLnYYSx9WglGttVz+TncbH/4fDTSYnTr3oAUt+16XhxxprXImA9zAWEIk7gxrYUR4oMcqdOdgVAMUfZ1ALGVjt3pPV8loGY/2oBX3E4DdDt+/iEWRKgYgKLHirUxCguhpPyII6e/MXzJhyI7zgsf3sfYzhHzj5GTbnyWeGR3pJR18+g1eMqca141HyvnObu2XpD7g1/Xopokuh8OH+08swecAj1hDN09LZEtO/rClqEHR34Uv72FOy8tBRVFk3Oo+RtpcHksgXkelrR2Vyqp1epf71AoEyw5r0+TZSuW5LG23AKCM09+TXEFrn28coeaAC9PsBW7yZwsX9f7wjAUba4diKnifOa/k5lzohKRlbWIh3OwpmikHfnj/0cCnFs6TkTYX8llr3/EBy9uKzEhTUp0wxqXNEVedqAEhc8qhvQZGcXzTletkKCbaTpbBLYeALPHzM1dUKmvfl9PRv8Ay89OmBvOv9ny+sY9uJxb2y5Nwdu9nfRG8iVAA/wSNXcEIHQ9jWTFXpRfTvgU1kMXspEHRpU4rLRkQboHkhXCSe3KPiXYtM4mNnwWqYWCx6HerLEOiE5e/GKYfg98N1g+yZ1YLzHtWrIcfBxUUTaEFCT+pXINpM0FK2mufB+B/GO7nmuGyBRIKwfesbAG5AMC+QOH9lHdsSd0DKQBEU40gjtjRDE/J/RMwc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9b3d3d0-0c40-46fe-9e32-08dcddbe3c9b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2024 00:00:31.2250 (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: ig8VZ/yeawlEm9DAmhkisyHvTyf85/O+JLb2hKdUnHI7Mm8PI2JWZ5uBl9ZMtQwgfcLEF9D2xsbA0QAT21UPX/QzUGkdW+1IaiqstcBbA/ONnx7xlvoozbUSb3MuUuMC X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB7353 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_170034_614741_97893AB1 X-CRM114-Status: GOOD ( 14.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/sh/rcar/core.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 9784718a2b6f5..a263e50cccd4d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1237,7 +1237,7 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph) { struct device *dev = rsnd_priv_to_dev(priv); struct device_node *np = dev->of_node; - struct device_node *ports, *node; + struct device_node *node; int nr = 0; int i = 0; @@ -1277,16 +1277,12 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph) /* * Audio-Graph-Card */ - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; - priv->component_dais[i] = of_graph_get_endpoint_count(ports); + for_each_of_graph_ports(np, ports) { + priv->component_dais[i] = of_graph_get_port_count(ports); nr += priv->component_dais[i]; i++; if (i >= RSND_MAX_COMPONENT) { dev_info(dev, "reach to max component\n"); - of_node_put(ports); break; } } @@ -1486,14 +1482,10 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) */ dai_i = 0; if (is_graph) { - struct device_node *ports; - struct device_node *dai_np; + for_each_of_graph_ports(np, ports) { + for_each_of_graph_port(ports, port) { + struct device_node *dai_np = of_graph_get_next_port_endpoint(port, NULL); - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; - for_each_endpoint_of_node(ports, dai_np) { __rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i); if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) { rdai = rsnd_rdai_get(priv, dai_i); @@ -1502,6 +1494,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) rsnd_parse_connect_graph(priv, &rdai->capture, dai_np); } dai_i++; + of_node_put(dai_np); } } } else {