From patchwork Wed Jun 21 02:18:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286548 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 24BF2EB64D7 for ; Wed, 21 Jun 2023 02:20:05 +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 4CFDD843; Wed, 21 Jun 2023 04:19:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4CFDD843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314002; bh=RuJA7kKwDkl0zfZ8MQE7GU0sQy3ajMYlLqZGCg08kiU=; 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=Cc91xQutaRqpO7l09BLl1uUemja8CtMDs3b1cOwMwrmuHsuTt8A27EIDbr6zSZsD6 AIh2eTH6vt7jmEYCikzm+1g3TgFa8rhgXWGArxlXrDWrVX7lwh3TuRIb7JGwjse0X/ WhmfRTbDl+fmCa6vHXC3P3j9ibIKjAqKHOyYPMQM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 79CC5F80549; Wed, 21 Jun 2023 04:18:25 +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 41ABEF80551; Wed, 21 Jun 2023 04:18:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 34F83F80549; Wed, 21 Jun 2023 04:18:22 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2071e.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::71e]) (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 B715BF80093 for ; Wed, 21 Jun 2023 04:18:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B715BF80093 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=cHnU0GSd ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QuHa3HBcEZM+T6nL4/u6UUqUVmHWOeuGk07EYBFHzbg5ypmSSy6keiRjuRP8sR36MRu8UqQH1sTTs7GWQSfJJeKuGH+48DKUP4UfourvUAmfKyMjd0z1s5RIvNCi8nojcsT2RgDG/dT1cRks72L9M0+65b9s4M5aBbmb7+Uo0z2VU3XmbwmY01zZNqfzUU9HiETONGHVIJTqIJ0Q1gXFEpZs1tQGjejxz0Er/9XqNHHE38ksey0AFgT3acwpUnZOsP2hxs3QSKz+flBNrxv3H+cNpmN1iGQ0ZW+xA+aJZekGn43XepPMjlhoRTT+iaTqgRZrctgcSHueywj1TxqY7A== 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=3Exp5heEThK2Zo+i2NSQLXLOsl3PzDOYjWpqDjrhr1A=; b=iZrALVmc5thZC7cg1W9xWj2jqHm34TCaiaNjbA2rRNfatlPVFCaJonbN+ifKRUNx5wKQSwLZ4WKRs9ooSt/oaRQvJBe6PIf6qSamiE+cK6eD1bjk0YmmtD2Yn3GAgaOW4HQYH7wGPKWwuWASibQBBj9u0Hn/RbOM592EPig0rqpMDrWwfstTwtSLiDm7B9okTa6YFZQHIgOp4T3QWSjg+8Q0rZ6Vl1ruKvdsBt8niXSrVGWEuceCtlbS5x3DPa0o1qkpUcGfQxmxNcNUW66T7b537UzhDk9bFH2mcnt4PUzwh+9Cy6HuUK9Op0h9joqZ/Du72r+No6bWmfE59Srxmw== 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=3Exp5heEThK2Zo+i2NSQLXLOsl3PzDOYjWpqDjrhr1A=; b=cHnU0GSdXNitmKvARe1uBfvE8QaUJ1H9H1uWuMUFzI5FP1ULXVynrKaCnmICN5Xves3SX9ZG+jMLIo6h/g63aHy1SaPilmaIeisj9e6f0/guBziHDogl/Z6hN5PWN8zccW635lBUihNMeNrI42rG/7iDWERrfAL7yVq0UUQG2Sk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYCPR01MB10367.jpnprd01.prod.outlook.com (2603:1096:400:243::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:18:11 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:11 +0000 Message-ID: <87pm5pblst.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 01/14] ASoC: soc-core.c: initialize dlc on snd_soc_get_dai_id() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:10 +0000 X-ClientProxiedBy: TYCP286CA0238.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::11) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYCPR01MB10367:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c659177-f656-46da-6b37-08db71fdc2a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZKYuSeBPiIe/GcTbiCjsp/PqZRbirgHpVxMM/Tht0LvLdjuGd/zr/wTpsV+PWS+RJYdatav+SH9Rvf6W1O4KijfyW6fYfTQkh9ppwJPwr2DCr7L6ggjcvGVsBnaaKDMszkZZ1ETz9wCYKEdD4b9zEyy+dx5Fpm4NCctj+oHk9GbjSz3zcITBDgsIi8AQJrkF/unaK3/1HIy5J/EjX/PtLp3D13b0BaiYQ2xBo+dTsqN8ftXg9beXZCtq4wtd2584HIUfpSl+GOznyv52Dw83de/rV6zfK8BtTE15F5roZYGS1hJgh3p4HAuMbHM+85mPWa3kKoX2+22fsa7iJBQRB9EIbumX06mE+YmQaUjuAZurmFTqyGjN/zQsSv56NjcTDESxaDbKSClh6luIK5p8/N0R0enhuD4xR9yNY38ymCFjuS1gmerHJ1TSXpLAN25aBFyVcKHgw2yCBFjWpgQhXuAfgk/nH0UIzDv83d06p3UZ/vJoiPRU3ddrna7fjQcRo5ica/Nom6rSbvCkwHObL1eGfC0C89kS23GStJSk7AhUI5kTvk4vp4vS9lCYcdRUadcKMptZi0rx1OisX6D21TeH/V2T4NVlOVVKuTadvSZsXqfLkDUokurBMGwhebHv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(366004)(451199021)(66946007)(66476007)(66556008)(4326008)(6916009)(186003)(2616005)(38100700002)(38350700002)(86362001)(6506007)(26005)(6512007)(83380400001)(36756003)(478600001)(6486002)(52116002)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WFmnyBuQ/Tdx8L9gskcuEE+e0HV7tOKvB89/GQPGYpeVuXOVTLYuIiNjb8fE4wtx/6CMitk0/6iarU7BxyHDeeBvPIqdTU1kunJESwyEop/c/9CkR1m4vRRYbuiTG/E6RZS+ToOVnaI3JUP704o56gGhvvS8W3pBpLi0e/6nkmwcENo9F+EZTHlDkGCCw1ZdZT755xt3hcplqCbMctCNK4QTerJHQMLe9RtkSAnSWPARxHzDQq0oBqeSIvjuvmCsKfbPp5G1bfnl1fglymtDz3StO9Q7P1ixfBrTkzbErOzuD5N6HN3XW+1k2erwKO4ex2udVad4wqdvNOpe8BWFFhPRDfgEUOBodjRnVqdmp3nn2xuz5AL8CTCLNtzqATDC8wBZH+YXmlJ5lfo+6Vy8Z8F3kLYCTAMv6PCH/qScCkbCvTusTFmmOqQMstj0bBKJdPuw+/wSIVjZybAkWoBhlaOgCe5RI3m+CZ0+1pQMR52ySNiL+SOLvcLpNNP+qlW7sMtTRtZ1c26a7EBZ/kS7muXg4lFq5rYPFdFJmBAgjiZ7ocIbeJfIDxt0vtHNdBDewY2C9GIHz4zzWpCk0sANKj0rmmrPhtpTXEGew9FQdgFK9qq1q92+8p+c7RCx5FMA7lcpBGcuntyJ4ql6THWOFCWn00h+leQaOFTOAYGB4/SQUrcRWJ5S38gverDamyWdgTiGz1+/kShlZ3HTM0ROPjPPEpKpGui5DLRp7ebxeanQ3jRnNLhfY/KxSz+8VC2lNQjaG1K8tcaAzfVobzFtmCjQi9qRnsf2zVY8HM3PMjP7/ggxvGmR8J2QQple4cjEgKle4SPTkKEyyAJ7EramwpcbcJQuB4q0+aRyaDh4zAVuWb3os20LOqmhecLdNa8MfUArHI5vp1NYRljqW0vTuv3Cjr5euB0E2RS3PNuChDbhOY/KCpPFtGad/AlAhboa5kWfVoGOjxkqCf0hp2E486HAtrTF1Yc51Z+fQm13PYTRL0+aYx8uhAxnQLUMeMLQfMUmw2MSkXgUVrki3dYmMShlb5OsK7EqoNdhWXSh04Q5O3iZ7mVVbpkNcEZdAVYzANmOlar8DmCUlKw6zlyvcR1ra8weGr3NEXbKj5EnrEbwdvdahG4rB8laGS8o3E8D7MKhjE0WCpsrdTmcos46Q/Uxgh6qG2PX3+G9H5j53cjT8x9Q4a/xi2F6MYtlAh9lJia1h3UIZX8+jjnS0P8KhTycjplgBHG8Thsh08b2qwBZ28xRp1ds1VREJGUgDc+P1l2Oix4KUGkRm01/2DwSbtEFQQ7DojskL05S3+mSDFFLix1xiFM1Qt370/tpm+zM4ZFuSYJU8XKenQb12UagEkxBLavkrniVUTXmiqbYiEfSS+u/2UWm8iWgJI9vBMoJPrBO1eW1NN+fNwj+x+4+yhRX12vRUvdOP4l1086fLyxro/YTT9OeiM2UEHILP4V56i63ftTEWUcgM52BR2tJiHu+GgWwrvMV7xN1CQsrucieg1uvP37p5Icdv39XCQn2Pa/e61Yv2d7jFqZSVn4G6sXc/O3PrdYj6z6vsbraLz1Q6K/DSZDWhKv/uj1lbqx2zgbkNLCcgUxb7lb+7eECzfGb3mvVuceH1/csVqnoPQA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c659177-f656-46da-6b37-08db71fdc2a1 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:11.0636 (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: ySUuuSOyBwUtDVwgNfzWhBuPpAlVSjZhPg8v98HJs4vO45DSM8K7vQcvY7cz387/42NwmbFoww7UTmndqqfoPC5kxKMZp48wwVayydag5Qo9vLZNFk6X1JRXmylEDCAb X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10367 Message-ID-Hash: RSAHPRCTFKR3ZAVKAWPQYOBZBN7P5UKQ X-Message-ID-Hash: RSAHPRCTFKR3ZAVKAWPQYOBZBN7P5UKQ 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.8 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 snd_soc_get_dai_id() is initializing dlc *manually*, but it will might be a problem if dlc had new extra parameter. This patch uses default initialization, otherwise, non initialized part will be strange value. This is prepare for multi Component support. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f06a20773a34..b25c26deef63 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3233,11 +3233,12 @@ EXPORT_SYMBOL_GPL(snd_soc_get_stream_cpu); int snd_soc_get_dai_id(struct device_node *ep) { struct snd_soc_component *component; - struct snd_soc_dai_link_component dlc; + struct snd_soc_dai_link_component dlc = { + .of_node = of_graph_get_port_parent(ep), + }; int ret; - dlc.of_node = of_graph_get_port_parent(ep); - dlc.name = NULL; + /* * For example HDMI case, HDMI has video/sound port, * but ALSA SoC needs sound port number only. From patchwork Wed Jun 21 02:18:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286549 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 55E9CEB64D7 for ; Wed, 21 Jun 2023 02:20:11 +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 C38AD82C; Wed, 21 Jun 2023 04:19:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C38AD82C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314008; bh=Z3WijGFAvwNgm1Y0EstQMZOsBjwUC7XW0CTEUft40Jg=; 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=Mjc6474T+d8wKTMACpcJRkVceJSgoN3O/UF2OSurhVbvinvZP6++GaBnTmzVWW7/q MKBkMIzZ/tY1lCJ4FFdqzF5li2thKiHKmcMEMZcqrh74bXHA61jNTktMaT8iEiSCbb O0TNyT3Ee3tWuIl5HCm2uU6w6lCdcSpZVO7Cw1xY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E51C2F80578; Wed, 21 Jun 2023 04:18:29 +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 B42C0F80551; Wed, 21 Jun 2023 04:18:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1846BF80551; Wed, 21 Jun 2023 04:18:25 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2071e.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::71e]) (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 B2E75F80544 for ; Wed, 21 Jun 2023 04:18:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B2E75F80544 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=DATRyRrk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DMqnaugx/vc0GHcnEBZeHWrYHLPwPp6S3OMworCDEpw4xXkv04tOCc/xxNK6C6OspIXoSm5aI6OnQwxqlnr/fffOeUY0qRc/vGOgn9K6x8bnW4Uz9jtYn+4PPaQPZ8FqQ8hAYxJDWoAAuytD50yYTRKth7O9qFR+Z+yRwbIVW4rcUOp3jC+UW7wHWOAfJ+wybmVGqTvanOM/vV+o8EJA/WRDZRcUOzsZQjxglKl80WGm034aMlswcEqEUuf6iOvZo0ZiK/vknayc37JUg8fDx4Fxm2YAWITmOczQP1uu8hKHgi2b5IrgTmNDejMsdt4oyOqAakvVSE8ZN67v1iVKIA== 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=btHEnIHXndrIs9guMF9LczyS7LGl7/9l9eokYTP0A00=; b=kFGUpZIv2GJ7HoWZZY31zXY1DYGMX3JqAJMl1E23gC0vHCRP2qN/Nw1bhfWG569t49XRspxiFjBbiifsys6fPQWg5BGeDLy+Y//m16AqC77HXMISZC8E09ahqGdWVFDI3AmqmurSpNCKar9qXo0f/w+8TvKzrHnucy6qXmRyNFmEXyHfrzz7BlJ76n0Nhyq0AIBDxYR5vcJ5c+PbgHYT/T3uYX3gzUp1sPFS1BbG7ID3Upn+jbwmTgINX2129Jb2GbdZhTifTHbxsJgqkmuJpVgH/MUjAx1evPLxFSKrfdmh6HFxJTUiRM0ufkpqqlEP3SokxZtkx8kuAVF5SJlTpw== 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=btHEnIHXndrIs9guMF9LczyS7LGl7/9l9eokYTP0A00=; b=DATRyRrkp1uq3d2BWV88HlbAyFvm3SMMQsNgwTOFmJAydTLrLqzNe2qCYuHVV03j5ro3axHv0zG0PYR/M+y6oWVZGT0Ypb+/p61fWLD+ja++jiRafeCqfxxrLmv7FMw3l72+nbY/hs8gwvzwHBzBRk91wXXstnDSsbBI4N/i7Fc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYCPR01MB10367.jpnprd01.prod.outlook.com (2603:1096:400:243::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:18:17 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:17 +0000 Message-ID: <87o7l9blsn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 02/14] ASoC: soc-core.c: cleanup soc_dai_link_sanity_check() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:17 +0000 X-ClientProxiedBy: TYCP301CA0019.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::6) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYCPR01MB10367:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e6e96a7-d9da-44e5-0fcb-08db71fdc681 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TY1/AeCa7/NZ1UY6LLoLi+OXxsodkpFbZG1U0rgHzqMvIJ9/1z+6U932f0ow2JY2tsjWGIEWTcPcB2PrlZKG+RHRLYugpLdWZkisaWq3YAj+tXKexRtdBbhE6BrMKS9+y91cQw99Egb9tF6h+kuQCtIew4vHgjURvnXPASPOzszHBMEQtpAgt8gLs0v2WVfUKyy3ing+OJPirZq0Jl0lLb1DnMp/FjtvqR++MAH2rEM8ku0Nnet4PpVW5gJZgkTg6zPwVtdP1l0fD9khGV9cuT6LX0UUVFahKgUq3+wiX9m69lEhXrm9FTq4AE8Ae9rbUEa5TCHP/sWn4ZgLxXj64UASfMioI8kRu9JEZ1PBbtV7QmNpe1RM9+1Yrv8cWJIHLNpsKBybj9gM5NywXw66drfm8Yz3/DDMWGEKDybsORz0uDmxANi+yCZkXoiMGLMlYKu+zvDo2Q6kknIkSHxRCmTzg9Y/TE0OMKkZWjrroXO/fwyoOcBfWlEbWfgUkWbCFXSaLUQmLPuXv6iOoFAyrH7DQK88WxMKzZFxGUW5+imkBG+/UaaXSQKsYNfQK7Rn/MgWorUehNqkAG6iEBBRxbU9AW7QpT1eYDkht6tNdrD1HuypVxhmMCBfEr8PCv8DemTLhc44vqBURJ+ytbtcBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(366004)(451199021)(66946007)(66476007)(66556008)(4326008)(6916009)(186003)(2616005)(38100700002)(38350700002)(86362001)(6506007)(26005)(6512007)(83380400001)(36756003)(478600001)(6486002)(52116002)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001)(309714004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hsCPAa9Zl9WX/4OgjkznE92h2Fy0c5HWRUg/eQqX4UF517MvIAlRgxDEdRg+g9qc8j0ozDU6GXQszzjhDiFbXwWMFbZztEBHBX/SpT1FvJQBO4GQpxixvvn56j5sB42f1vSo8Vvpg+m7d3aNibJzMTSHUotCFfEsFuTtJCmbS72Zxq6kLXH1K1CcgWebSTE3rdub4gejfVaz01yU09GpVtVikQMDC/usZNGjiqva6tV/yKzf8HQaD/Nbu3iszzsVn08AyKUsKvFN2l9FIr1Tv5pm7Q0OjeRjmIgvEM77QSufH/CaSiwi51PFfiNjKwnJu6AnYAWw0DMseX9701sAF2F+6+pbdg2Bme8Djos3U+SJ5cWrTQQeOQ5qN51ELUjynMDx+EMgo82vwxpxmiZjxr+0zAhfwW+PPuiYT7ABZ25bsSViXR0ljaY29nDAjm9Z3zFAL0ZeAooA7bA6AG/cxsCqj2BAT9bqr2mybls3dShqQI0FvdSk467QSx8Th9+nguOwT/o4dr35D6mBNfvcyfFWD+T5SG4lRcsmeNJwaI/IkEpKpyOa6+VJOlIqaTHrEViY39WMaOkvB5oBGqTsWWsxxcN8v9hpsKuYqAjYvIvgHnICGeieh5Ilz6fw9KQMO1wpLVbkdVTN5bPUdT6z3WZMx9Qct/najKiQqB98/3UzGK9NbbEeZZHwUxRVIUM683pOz7E2qDlpqZ0rbh2anLSN43QBcidaYEkC09AgNSTWpSLYJjIz8OPrSypYc1WgRsJLfNeiOVXf0S4qtKCJyVD2k6HdwzfyFTOCn7PG1IpaqlJuB29ZNvhlHWl7/qg56LhG+tvslBrIddKNSD1eZflbTionGcNFYVEx1CnrYgustSEPhZG6F+DSLgvqFH6w2g3oS0TQ0NgomPql0qntHUrytZxFftvk3Dug9nY7J2dwgoOlyAOtgAkAbyenxfWKO9DZ14vE+QA06DqbmBtSQM2XvLVVwhoi2BL/4UMXHXeEAq2llgzKd1AIBDuEKZ9fHxW4VJ74cGW5HC0pdI7DZunEHmR+bFyhwzKkgEB6V7iGiQB93wEHQ23yFA5KSR4peIz7Z2a106g5XilDJxyDtj2EQ2culBOcTIuZYIi3mw8cZLPrVA3tcAWIjM8Wo6c7PoxsKR+EtvM1W5qEkjVB3hVs5dzHYiMIY9L3lJBaLgkXlmj4RAbzwRrGPjP/+V5FklR5TSTawI1KE8uxC96H7+3GbS6W0Auh/2D44bLcvoSnrpNt9QjwKUy1w/E/kC5/e2EawAbSYuvEURWoJvlW1uwHf7gdixyqf7jLIyABbQfzsp4ZbqwbSd+EHlYOTohqPmFLWevBbsO9CzFrTKwXMWM6yuAQnr/Ft2Y3SPyt9OxDLxhcVMhM3R+5m2kQosQDDLI0EE/uVudNBdTgD19+H+5LJMdoAUIMsHVmsL04Me08/iiSfJ7/7yibzli4663AziktjVXIpFVE4znzVDuDlm0NBIv2T5h5dS+ISQ3OLEQgRJBKVTxToq8uP87fFCZKt5fc8X3AlgYIfARFKdBcDIBRB8B8R2DgI3u8dxt82DRQTqoOzm3BoH2TuxHFo63oXHiO8mHPSwc54wZkoOdx7Brkg3qynC0qhohsRQix8/U= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e6e96a7-d9da-44e5-0fcb-08db71fdc681 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:17.5202 (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: j4LWDN2vP2fph5v+3H9q89OHpd80eQ98ZQS+JqJdj3xv2eJ84zt15QI4hSalLietp5U2PMv5+OOqDLiChntvmrXfbTNp31FcIqP3NQ+Ou3yKBm47Cl45aFZCZRw/HnTc X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10367 Message-ID-Hash: RFCBWKPJDDH5ILG5EFOORDLNGXVVAPDF X-Message-ID-Hash: RFCBWKPJDDH5ILG5EFOORDLNGXVVAPDF 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.8 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: Required CPU/Codec/Platform dlc (snd_soc_dai_link_component) are similar but not same, and very complex. Current implementation is very confusable and it will be more complex if multi Component was supported. This patch cleanup it. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 131 ++++++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 59 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b25c26deef63..4b66c6d87fa2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -238,6 +238,21 @@ static inline void snd_soc_debugfs_exit(void) { } #endif +static inline int snd_soc_dlc_component_is_empty(struct snd_soc_dai_link_component *dlc) +{ + return !(dlc->name || dlc->of_node); +} + +static inline int snd_soc_dlc_component_is_invalid(struct snd_soc_dai_link_component *dlc) +{ + return (dlc->name && dlc->of_node); +} + +static inline int snd_soc_dlc_dai_is_empty(struct snd_soc_dai_link_component *dlc) +{ + return !dlc->dai_name; +} + static int snd_soc_rtd_add_component(struct snd_soc_pcm_runtime *rtd, struct snd_soc_component *component) { @@ -829,102 +844,100 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card, struct snd_soc_dai_link *link) { int i; - struct snd_soc_dai_link_component *cpu, *codec, *platform; + struct snd_soc_dai_link_component *dlc; - for_each_link_codecs(link, i, codec) { + /* Codec check */ + for_each_link_codecs(link, i, dlc) { /* * Codec must be specified by 1 of name or OF node, * not both or neither. */ - if (!!codec->name == !!codec->of_node) { - dev_err(card->dev, "ASoC: Neither/both codec name/of_node are set for %s\n", - link->name); - return -EINVAL; - } + if (snd_soc_dlc_component_is_invalid(dlc)) + goto component_invalid; + + if (snd_soc_dlc_component_is_empty(dlc)) + goto component_empty; /* Codec DAI name must be specified */ - if (!codec->dai_name) { - dev_err(card->dev, "ASoC: codec_dai_name not set for %s\n", - link->name); - return -EINVAL; - } + if (snd_soc_dlc_dai_is_empty(dlc)) + goto dai_empty; /* * Defer card registration if codec component is not added to * component list. */ - if (!soc_find_component(codec)) { - dev_dbg(card->dev, - "ASoC: codec component %s not found for link %s\n", - codec->name, link->name); - return -EPROBE_DEFER; - } + if (!soc_find_component(dlc)) + goto component_not_find; } - for_each_link_platforms(link, i, platform) { + /* Platform check */ + for_each_link_platforms(link, i, dlc) { /* * Platform may be specified by either name or OF node, but it * can be left unspecified, then no components will be inserted * in the rtdcom list */ - if (!!platform->name == !!platform->of_node) { - dev_err(card->dev, - "ASoC: Neither/both platform name/of_node are set for %s\n", - link->name); - return -EINVAL; - } + if (snd_soc_dlc_component_is_invalid(dlc)) + goto component_invalid; + + if (snd_soc_dlc_component_is_empty(dlc)) + goto component_empty; /* * Defer card registration if platform component is not added to * component list. */ - if (!soc_find_component(platform)) { - dev_dbg(card->dev, - "ASoC: platform component %s not found for link %s\n", - platform->name, link->name); - return -EPROBE_DEFER; - } + if (!soc_find_component(dlc)) + goto component_not_find; } - for_each_link_cpus(link, i, cpu) { + /* CPU check */ + for_each_link_cpus(link, i, dlc) { /* * CPU device may be specified by either name or OF node, but * can be left unspecified, and will be matched based on DAI * name alone.. */ - if (cpu->name && cpu->of_node) { - dev_err(card->dev, - "ASoC: Neither/both cpu name/of_node are set for %s\n", - link->name); - return -EINVAL; - } + if (snd_soc_dlc_component_is_invalid(dlc)) + goto component_invalid; - /* - * Defer card registration if cpu dai component is not added to - * component list. - */ - if ((cpu->of_node || cpu->name) && - !soc_find_component(cpu)) { - dev_dbg(card->dev, - "ASoC: cpu component %s not found for link %s\n", - cpu->name, link->name); - return -EPROBE_DEFER; - } - /* - * At least one of CPU DAI name or CPU device name/node must be - * specified - */ - if (!cpu->dai_name && - !(cpu->name || cpu->of_node)) { - dev_err(card->dev, - "ASoC: Neither cpu_dai_name nor cpu_name/of_node are set for %s\n", - link->name); - return -EINVAL; + if (snd_soc_dlc_component_is_empty(dlc)) { + /* + * At least one of CPU DAI name or CPU device name/node must be specified + */ + if (snd_soc_dlc_dai_is_empty(dlc)) + goto component_dai_empty; + } else { + /* + * Defer card registration if Component is not added + */ + if (!soc_find_component(dlc)) + goto component_not_find; } } return 0; + +component_invalid: + dev_err(card->dev, "ASoC: Both Component name/of_node are set for %s\n", link->name); + return -EINVAL; + +component_empty: + dev_err(card->dev, "ASoC: Neither Component name/of_node are set for %s\n", link->name); + return -EINVAL; + +component_not_find: + dev_err(card->dev, "ASoC: Component %s not found for link %s\n", dlc->name, link->name); + return -EPROBE_DEFER; + +dai_empty: + dev_err(card->dev, "ASoC: DAI name is not set for %s\n", link->name); + return -EINVAL; + +component_dai_empty: + dev_err(card->dev, "ASoC: Neither DAI/Component name/of_node are set for %s\n", link->name); + return -EINVAL; } /** From patchwork Wed Jun 21 02:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286550 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 4EC75EB64D8 for ; Wed, 21 Jun 2023 02:20:29 +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 74CB286F; Wed, 21 Jun 2023 04:19:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 74CB286F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314027; bh=59JwKT+uxxPMWEDoXn+yhk0Tr7grUPlrfP/Gz55k8Og=; 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=NTtc8n8lLMDLLplLVuPWkw/FMTD2co0tK/9pOBhsRADj45twg3GiTlGTiboKyjTsO Huf+5TNQxehmO52mTl9BCj/hARBbei8I/AKRNeWMIg4WVQleDf1Hb0JTEFlkG9rw0D shTswgSbJTX9TvG/fU/z6HdAcgolAWU8xKi31Kq0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE088F8057F; Wed, 21 Jun 2023 04:18:40 +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 3B057F8057B; Wed, 21 Jun 2023 04:18:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8D522F8057A; Wed, 21 Jun 2023 04:18:36 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::700]) (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 9DE03F8055C for ; Wed, 21 Jun 2023 04:18:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9DE03F8055C 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=mhCA6mBr ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jk/uju1NlFEfq9kWy+PK90N89rfR06LcdPPRSyxh0TlqVP58a/jZrf9H9Bd5fPiegq9K3/Y9rs6M76+P1K411PltQdOcnEauKHqOvetv/E4GhYRbL3YFac8xtz74NJKKf6Tsbp36cRTNHoxf8KsgDK0DhKOAeXjau08StFlX76GHz8/GPKEhjPEYcorkqm1MHip7+BWkru/QpAL9M4a0o1ss5bA/BtProUewt/+hcBVUOSHCaqiTCqj6JXIIalqyP7TZgzuiYqd84bmZfGdfdG90Gry8bG/LogJAFqMdhCL0zMNdOEzOKJl1uL67LLaohrkV4INNFjJj7wguA3YplQ== 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=p3bu54FfF1UkFL2NKVAoo12gBgoLh+yZcS4BaoU/9FE=; b=eYXwuWz3+iPd0aI1uIkicK/yQRniNAM5YoSF9msNXg45XVYGE+orkg4rWbFiVj7PF5zomJiFgvO9lwlj3fQDMRabm5ES2HSjjV2BmKTmOFhcgBGZZlN5+sbaa1Ox+X8dTG2/btWwT/oRqSGahtS+K0Pm9xX0s7ddDnbtzQ10xL7Ci/MBEaYil3uvQcj/BBbRZfaV8oIcFxgCqh6q2t9Qq9mTeG1WcBr82OPjTmjuNevx6oufLNIurJd1C4OW0+z9+Dxs4HOirwWvc8WlhJm3cjiUDRFu0Enw07fTAuA692fbzXm0EQLX7KU2I2oVTktE1ApjFzFCQdGO+FBIeMq8gg== 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=p3bu54FfF1UkFL2NKVAoo12gBgoLh+yZcS4BaoU/9FE=; b=mhCA6mBrQXcZ7FBzcjHP+GTZJrnhJkAhyhVCjvXDBUxu0MI4Nc78PgnU1QrWnJopa1aVaGzhN/J3s7FfdqZfWG5K8GuEB3LRUtKN8eN22KGKY8R7Rof1MnSHW91EdsNg2jjJbJPzZhrmgKrkI1DtHR5NJ8F2J2DmthWiIMNsvfo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYCPR01MB10367.jpnprd01.prod.outlook.com (2603:1096:400:243::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:18:25 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:25 +0000 Message-ID: <87mt0tblsf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 03/14] ASoC: soc-dai.c: add DAI get/match functions User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:25 +0000 X-ClientProxiedBy: TYAPR01CA0202.jpnprd01.prod.outlook.com (2603:1096:404:29::22) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYCPR01MB10367:EE_ X-MS-Office365-Filtering-Correlation-Id: 74bbb0ff-2e52-4d93-52ff-08db71fdcb2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6IMjOcoAccvD54SvbTYupFsYcp+GbKlSQNfLK6SduMy2toIASLCAOWh/7a5KCFxanLjsahck7z3679Y7LiIS/QEUPN2+pJ1XhKqky6RLRn8K6hWqobG/pIEo1j69FdyV471hHAulFFve7+ww+PJn3AbrPhJC/iss/rVr353FEKmdCjdM/xwfZrtOVS/iYWFZXglcUFBvisqE4Cmg0+GtFiEcKfzFA5UOxr/7kKUiyoY0Xbjs4PVFYuknAEGFYhqHJ4kBOHrgCHNta3L3xgm0A2YuA2vRcrP9gxMNnY9N/JFcRgoL9XW6Zty3s1a/G2UsqmYiOLn1T+YU2wRlzQhJhtauPGHZb8t60BVXRRJ+Dh5L58fUAiD8qq6j0Nw4ZfMjdtokfwvtlt5S9/i3aCgbIcbWmEzp/kWUkjbZOJ5h4JUSjfXnOvI/qta2IMckZWLTHP2h64Yalp1fqXxgZjOiuyzkvM09svsmFoh69GG72da5a5pjGzrQ+/gp0CiiqCSUEZ6VJf0pFNOIsaIaTWgelaQnwj51g8b1qMgu7qC8qMPfc9zKXumRzYn0y2weToR1j+MnznobxU7N6v2osryhSbc4PuegLQzLk6t2/d2LEku8Brx1r6w+xjlikn01r2Gz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(366004)(451199021)(66946007)(66476007)(66556008)(4326008)(6916009)(186003)(2616005)(38100700002)(38350700002)(86362001)(6506007)(26005)(6512007)(83380400001)(36756003)(478600001)(6486002)(52116002)(8936002)(8676002)(5660300002)(2906002)(316002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xm0f9QmlfrL/FQLJR1u3UD6mwb4dw1k4pxxWZWiy/YHy7+C1N6voltSvRdtE8PXU3G6XhBtAKTjVoPrcg2d+P9kHVL1SUx4OLdu2CnvTVK4/bZmJ+9QXu6AAduEMMbbyCQIfwIsJ7b0Gqoqt2xaHIvaOpK3On84wQ/BGLj0SD8pZsLPQ6kHpn4tf3IoiZxnWKZ+D/GNJT7SsjD9Zbi0dM4KVv7E8PUMNovko4WDd1N6Y8wsekrupircQhgAu+/WJtu/FqbMD64KLs/bpyjGH02LmEaubVsv6tCtk0AT6Naaw2FileSOcjb6/TBejnPllec7xEnTqSAyecKJ2jWCEyB7c2LPtP0+CrDjRrm3V4ZcrMdydyFCPAvSHZYAU7/NgCDdHxxa8QYcRw7+3eayDsPbnpdndUO4uhl1YeLpSYJWO9uW9vUisIQcUMjejlpshHoJYvcuIk1rMkF7TTmKbO6gTy9mVsNWkLorjKaBMQpIOWk0y5nsWGnt55KEsk8aYa01bOO5Ywj9FKYNFHRuffhBAGgRr06gRBl2wvuMhjT6DA6iaYAGSsVdN1D3GFtc4czdETDGhL9EDCgv+dKBPdOxHmCdbojIUQrnGFu2z2nf/63uAUz+mMqP4HlSdpd669GWfUIC9OXr1/55GjdVHSp1pfcVs0Ple0aHB2N1oGM8TPpsv3aiqvX9lJ0zn9mEn5meRGOMVCZBFofBlYo6rvKko0FP7Nw/7KDQya8DdWBjZ+VCzdnjFs2Wcg0HZjwsfk2hHoqv/DcxytpP5Le+c5y0S4AmbMySn9oOgXi1iySeIwkczluIXoDkgwQO9S8LwGkf8zpJEs0Kma01d3S2PGWBiqpWc59TVbwAPdO/oXaE0YHXh5ys2pKtCq2rH5mLCNuXnhkGm1Jj+WfCD7GwjHiYp+AwY+YWRf2dYwfCFmKkM0eGaylscQJIEBBuQhiOz+J4fuvBrnteRgwGnp61nXZNmIydyoxKieb4YJ/fo8uUAF1E5yypuhqntQqayeJKPgunI7YtISqRs0GrfVZe5EG44JcJ2vn77eqIVuxPFVUphGBFsJkQSjbA/T/tN0p5Z8lPCqi4IYofMq24DNfdwlbbATE17NlG7bZ2SsebPN+/oBnRMckq6xKPfySiERHcSTgcazZhIWuodcHKS+z8HmvmqGSROir5iTQWR1Vc70Ia/OwPfnckHSFHXfbytR1dbRlStwp+Z4pQECanElPkrsme5RnO48vsZCo/mXE9n7bx++N3F0kYRqC+B5eoES/6i7HVaVYTXXOAdbaqf8jVsvqPcgzxTglHkgHoLlC+SB7i6121kKBwQW2PTzOR3DnA8NVE2AO7qitCZioystKqUvjyHfZ7RaPvcgzBgAgg4LyMDRVwInRvn/5QI44gEP9Bh5KnW6UiXmgp7gFnGD2B4yDO1vyO/WchNS4VfzGI8+KZmc9HwwQXmQTO1omvK3VHf1eQOEE0Uwqu81mpXcQCo6SjFP/gAYX7++YRAlD125Nbcc47WzrGTGogJzkJpSL7OseLfoc//GpHoeMk+w770740+fFRMGcedP6vsO40sDpr87YWHjvWBlQBzUvrKCzr4neHTWqQeqIglkSY5zgKxUjP7SwFUTKeZD9XvHQryLTk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74bbb0ff-2e52-4d93-52ff-08db71fdcb2b X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:25.3998 (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: s683M8HnSKDWjOCR3s3p0UdrUTDPwSaSLit1ICQaQV8wO6BJghRbUh7vnZaLBaT/VL9Gow+5kFV5cche59rrr+NAPzcqWgdsi8bRX47mSccpH1WZct0/J5bPKYqUUM74 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10367 Message-ID-Hash: UEBBWT6U7MVH77CEZYBRENEH352ATO2J X-Message-ID-Hash: UEBBWT6U7MVH77CEZYBRENEH352ATO2J 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.8 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 ASoC is specifying and checking DAI name. But where it came from and how to check was ambiguous. This patch adds snd_soc_dai_name_get() / snd_soc_dlc_dai_is_match() and makes it clear. Signed-off-by: Kuninori Morimoto --- include/sound/soc-dai.h | 2 ++ sound/soc/soc-core.c | 62 +++++++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index e3906ecda740..a4538040e88d 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -271,6 +271,8 @@ int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai, struct snd_compr_stream *cstream, struct snd_compr_metadata *metadata); +const char *snd_soc_dai_name_get(struct snd_soc_dai *dai); + struct snd_soc_dai_ops { /* * DAI clocking configuration, all optional. diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4b66c6d87fa2..bd811d10b792 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -253,6 +253,47 @@ static inline int snd_soc_dlc_dai_is_empty(struct snd_soc_dai_link_component *dl return !dlc->dai_name; } +static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc, + struct snd_soc_dai *dai) +{ + if (!dlc) + return 0; + + if (!dlc->dai_name) + return 1; + + /* see snd_soc_dai_name_get() */ + + if (strcmp(dlc->dai_name, dai->name) == 0) + return 1; + + if (dai->driver->name && + strcmp(dai->driver->name, dlc->dai_name) == 0) + return 1; + + if (dai->component->name && + strcmp(dlc->dai_name, dai->component->name) == 0) + return 1; + + return 0; +} + +const char *snd_soc_dai_name_get(struct snd_soc_dai *dai) +{ + /* see snd_soc_is_matching_dai() */ + if (dai->name) + return dai->name; + + if (dai->driver->name) + return dai->driver->name; + + if (dai->component->name) + return dai->component->name; + + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_dai_name_get); + static int snd_soc_rtd_add_component(struct snd_soc_pcm_runtime *rtd, struct snd_soc_component *component) { @@ -810,18 +851,11 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex); /* Find CPU DAI from registered DAIs */ - for_each_component(component) { - if (!snd_soc_is_matching_component(dlc, component)) - continue; - for_each_component_dais(component, dai) { - if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) - && (!dai->driver->name - || strcmp(dai->driver->name, dlc->dai_name))) - continue; - - return dai; - } - } + for_each_component(component) + if (snd_soc_is_matching_component(dlc, component)) + for_each_component_dais(component, dai) + if (snd_soc_is_matching_dai(dlc, dai)) + return dai; return NULL; } @@ -3315,9 +3349,7 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ } dlc->of_node = args->np; - dlc->dai_name = dai->driver->name; - if (!dlc->dai_name) - dlc->dai_name = pos->name; + dlc->dai_name = snd_soc_dai_name_get(dai); } else if (ret) { /* * if another error than ENOTSUPP is returned go on and From patchwork Wed Jun 21 02:18:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286551 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 8915FEB64D7 for ; Wed, 21 Jun 2023 02:20:53 +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 75675886; Wed, 21 Jun 2023 04:20:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 75675886 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314051; bh=8PTbWBm/OK0CVS10aKIjid/zX1Arg2imtjVDR9bvePI=; 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=dqiGaf0Yj4Pd1QGAT04BpTOU2jwAI0hhKsUWBOARVTq3Ko4AqWVuKs0mXNRFEH2ND MP+dSdCctXNVUHDTPRKO3hvGOKUV3lt5F+g2l31ZkOqXakOL0UWsPuYO+b0x6kLTEa UBgZb/0U3VwB08xYjHiCm8F8cvOches1GLsVS2og= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 08E49F8058C; Wed, 21 Jun 2023 04:18: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 95185F8059F; Wed, 21 Jun 2023 04:18:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C369EF80587; Wed, 21 Jun 2023 04:18:53 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20712.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::712]) (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 F372CF8051E for ; Wed, 21 Jun 2023 04:18:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F372CF8051E 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=XHdG/GYJ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGrBPjmBMRslR0GWcASB//eQamY4Vxxsotc+LXlkf0mz/q6h+t//5kl3qdXuaflmj2oFWeyxP43YNB+1YnA4e6C3uxNfWZb5DyQZEtQ/MSO+7QpfirT7WS6AbNwYZNFoC+wu4GLuPpjsrwogD5qmhkBjtZSRPq/guKhbYGSRnuuKbqoyu/ePfk9TAc0GqPaKyppwOHdwT8VYsvcw/TFCz/X8As7B2UhIVOvklUac5kQXyGco+wZw5ekoarzBZboPsFf0grvx/oRK3MHrARYV+tzXUDJXtxO6WWfqgdUoLcP028Yj1E0hB1i1XQobh8sfWc+bDktyWjivcbzFKLCNLQ== 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=aj979P6MSjyxNKkbL4QcTcS4VRF8C9rmkUEg/YupMr0=; b=Q4DFziyVNnsY7/Smg/yDj5W92fDZe3sBk+dkAWfutA+uEpV/lB1Ypzo2pXGm96vEXTTZXTCyi2B9VByIU1OW4WZZTTGiv3W5sN7yaVjYr+VTrhOCxmqKIIfKQF1oEwDTWxVi7bgpthblLTj5vTN2DP+mP5vcxBazjmyorMB1dUyLdrKPe7YMkrAE3zKJdZyrli20sAtIfAIBl8pKbRhIpRhnk+Z/DUjZA9qYD7hiElaxIxjxTXqLYB7QMsufE7bcybO4Hl5r8MkD9Vlad+P+KAjLmV2Ve26TaFqYzU2G3Cl3wxjVneZqQX1rYqbUtiMXo6WLTLvMwO+Dtig/mPwiAg== 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=aj979P6MSjyxNKkbL4QcTcS4VRF8C9rmkUEg/YupMr0=; b=XHdG/GYJ879eqzkqzFBk2yioTzta0exMb+Jrk9DBXw7XWd/tnEGGJjXSmLzdDc76q0m4pF25XxwE/sf6/nUGqCDK6ttfv2POUziqRyQt59eT4haKKyVeF+ykiMfd6iWdKDyyVJcZM0yWkDuH9yakQgSJwmOa809ncZn3SIJCQnk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8528.jpnprd01.prod.outlook.com (2603:1096:400:13f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Wed, 21 Jun 2023 02:18:36 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:36 +0000 Message-ID: <87legdbls4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 04/14] ASoC: soc-core.c: enable multi Component User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:36 +0000 X-ClientProxiedBy: TYCP286CA0112.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::7) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8528:EE_ X-MS-Office365-Filtering-Correlation-Id: e53fd248-e79e-46d9-6b28-08db71fdd1a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 23wx/79WfLBJ+f8P++Jr0dCkHgWfMekbxo40lM2VkBsXYvGvFFGQB3pvsLM8ItcLQ/zsIZIJJWN1bEXo5nO0TrWiVSqJaCO6heZ3UOM87e/eL2kB09U05Zfxqq9zSYxQR67gikR0pUlGb8DpkMzMCXBUbUhiLWSlNEUFlTR/e3EYAfKwNSfvRqQ9bWVK/ciIZA45mqF/Do3/49kh7rElntFA8fdlZ6N7xE0A/LGoEbc6tObd/14p0aGl741RMBhMy7jaPW7BvO5D6byPmH8xG92/0IPzsqfUTBlSGwxtpZiQsKfTH7hBtUbUsVQSZlfkXc7HyJ9mpxEgStNLEqgj8AOhSn7neTdbVUO1qGnkeG6lr+074j/UpeeqE7Rm2zZKIH0evds3G2Tl7xAUx/IbO6G5XWb0q+Io02r+UPFofK0waeZzgdfdECjz890itXT5lpU9mKGcDhhSG1WpcsPRdOgWbiqgJ0bCmKhVo053p9AtNtv6sxpNOphZu+zTrEvpSqZ4E5eYGcOYeTV4qMwkBGpUggpifUUD9tdY/VAa+SOKKTLaBqCQjFPOjaw2CWA7phtmaQPigroTPZfO41CrP3yinJuqN1nT0IS1M1V80PaTBvo9z8duYQAao4uTsW2igfU+5QWGD7p0SBnHgFxNR4ZDVEEdkUt3gtd7ySpdf50= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(66556008)(66476007)(6916009)(6486002)(66946007)(4326008)(966005)(186003)(5660300002)(2906002)(6512007)(36756003)(83380400001)(26005)(30864003)(2616005)(66899021)(316002)(38350700002)(38100700002)(41300700001)(6506007)(52116002)(8676002)(478600001)(8936002)(175924003)(21314003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 00s2Al9VHvOmbepgjYELVQymRW/oYwDvkOO+kOGeOtYZQNfMzZsv+Z5R8Z+zcgrgYvmWdEiZhqjAJcxkB+6RUtBF1Z5g9qChgF3XhGjtZA805m6yRLRwm7edPQZz+ERiCdPBLKvFnOCkDdrXM8wk1BXPT3ZW11qlCQhQVjPcS3bmfIcJ8o/bPRNIneNLNhDbHvTThzTrvQdI6puRYVJUTMCQ1U96LcJPEIuIWxpUN+g6ryzYTdNGnpw35fWXRrmfuKOKJLKTT8DN0GspJO+zycbyu96PR2I60U4R0S/uIpHwGut0gSZUhP2WTXV7KvKp+jinsVDtnhomHgNOhtTkK5QTx95G58pKNxTyvNJf5xgncdXtNbGPaEbNNJ/k+2zFsftRv78WTTSsY5G1KaHiy8IUrDuWn3EWYa0ET64bJ32hj2BjVhUwHRYw3yBVssdD6Lpw49XYALHyOeG26sTBMxg+U5kUWlNoCA6JSUIzin1vu/8mHvuw4PIDc92yOMw0QRIc2XM0CC/qcNXTGJcCa5x14F5pem0xhoCcB+INoqaGR3YkSzS0tOssLF6kFriMKgM9G3trAg0No85X+DEjGfxYmCc1abRQlzix43L1S0XgZPEE6fKU5FV4R7p0n8Q/xg+bF6/y3/TCHbqj05BFjPdMIYSEB/XLSy+/LEXWsnTIJmGsxNU/WPIfvzG7ju4b5xk+9TSKnv6upijbzNeylvlrZFKm1DqvX3hf3D/RvhJ4BERSdHqTBAL7qdZe64RLLR6wdF+0N5bnX2HlPs9SRAT243n2cMld8bi3OaZnm5CJE+HuiCEJ/DCMwPFkpw6ZP5kjKcLs2QPW+i9gFAN/fU1yc4ODzVaSxIGWV0INgqmqNHRCKxG+kHADqdogwTc3lVYi1n7F2GNzqhujvh0TqppJnqLRtSwKrFCTnLdZdT2H/hN4H2+bKww9S17qwReUddToAd8h2ssNsevOljgVmkCv9TP6IUtb7EXWmxmXcG3Nqo29pJKgT8dVoInHwvm0PQSrg33wpHm2Z3SanxbD914aN40YmlLTcImwqjCvf8J8umqTH3qC/we/SeSnK1g+MD/tY+0tS6jUyz4uReu0hrvd3tNoeVZ7rfBGaLzB78UVLp1d6JMBekARdY5YpmgcMxGQLJ3UwARAwcCMm9cq0ukWCufXkqXqxshQBg2YFyOXc0vqaLufx5pVdI2XEbNTS05/gSeKx/e3Cwfk3e2f7GLPrHFjUVRg2qunNOEycOPOSf9H+SAzXHI/zCqlRmcDcUpzoiRCV4GzAy9Wgps3P3kcigkSObU9qT8R4YqpzM0UOLXkw+JXtRqdmxJZ244cygpY8PL2IgPvsz3Xm9kQ03HcAT4QyIUpzMT4MbpNNXNEB84qRFjuc5XIU5FtpubDgbDUzGzDkwNXOebwP9AjKriGVATXakIPM+H21ON4uHBVrbjuyngnZr6+kpVmn2L/zWYdnRZm78dSgeSs/9t4YsiaDPWca4IkNuBLoRZ71+Na/M71wVkjb5Dg1OV2rB6H7itP1dp0xTMLWaBuTkmj4zfi4roXploRr/s3AP3lX1gsF+c6zZDSEXoyEuCmrV96ihIwLU6slvHmuh1ir4R4L/aCy2AWzhTuWRPeNSFreTo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e53fd248-e79e-46d9-6b28-08db71fdd1a6 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:36.2232 (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: YNFmpO0E0jMO9Ym0MTUu1dIf6fo8smy1pdxyu4hMP+YjIrOuvDSl5oPCW5sNOvSqjYzcheIymkLtBdU6X8ibASm3llmlnZLMXC1eKEC7X+0XzfEdGEBndvhKWYsDdYLL X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8528 Message-ID-Hash: JMGI2WRPVMT74CARYLV6HH2NZC3GPQSA X-Message-ID-Hash: JMGI2WRPVMT74CARYLV6HH2NZC3GPQSA 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.8 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 ASoC Card is using dlc (snd_soc_dai_link_component) to find target DAI / Component to be used. Current dlc has below 3 items to identify DAI / Component (a) name for Component (b) of_node for Component (c) dai_name for DAI (a) or (b) is used to identify target Component, and (c) is used to identify DAI. One of the biggest issue on it today is dlc needs "name matching" for "dai_name" (c). It was not a big deal when we were using platform_device, because we could specify nessesary "dai_name" via its platform_data. But we need to find DAI name pointer from whole registered datas and/or each related driver somehow in case of DT, because we can't specify it. Therefore, Card driver parses DT and assumes the DAI, and find its name pointer. How to assume is based on each Component and/or Card. Next biggest issue is Component node (a)/(b). Basically, Component is registered when CPU/Codec driver was probed() (X). Here, 1 Component is possible to have some DAIs. int xxx_probe(struct platform_device *pdev) { ... (X) ret = devm_snd_soc_register_component(pdev->dev, &component_driver, &dai_driver, dai_driver_num); ... } The image of each data will be like below. One note here is "driver" is included for later explanation. +-driver------+ |+-component-+| || dai0|| || dai1|| || ...|| |+-----------+| +-------------+ The point here is 1 driver has 1 Component, because basically driver calles snd_soc_register_component() (= X) once. Here is the very basic CPU/Codec connection image. HW image SW image +-- Board ------------+ +-card--------------------------+ |+-----+ +------+| |+-driver------+ +-driver------+| || CPU | <--> |CodecA|| ||+-component-+| |+-component-+|| |+-----+ +------+| ||| dai|<=>|dai ||| +---------------------+ ||+-----------+| |+-----------+|| |+-------------+ +-------------+| +-------------------------------+ It will be very complex if it has multi DAIs. Here is intuitive easy to understandable HW / SW example. HW image SW image +-- Board ---------------+ +-card--------------------------+ |+--------+ +------+| |+-driver------+ +-driver------+| || CPU ch0| <--> |CodecA|| ||+-component-+| |+-component-+|| || | +------+| ||| ch0 dai|<=>|dai ||| || | +------+| ||| || |+-----------+|| || ch1| <--> |CodecB|| ||| || +-------------+| |+--------+ +------+| ||| || +-driver------+| +------------------------+ ||| || |+-component-+|| ||| ch1 dai|<=>|dai ||| ||+-----------+| |+-----------+|| |+-------------+ +-------------+| +-------------------------------+ It will be handled as multi interface as "one Card". card0,0: CPU-ch0 - CodecA card0,1: CPU-ch1 - CodecB ^ But, here is the HW image example which will be more complex +-- Basic Board ---------+ |+--------+ +------+| || CPU ch0| <--> |CodecA|| || ch1| <-+ +------+| |+--------+ | | +-------------|----------+ +-- expansion board -----+ | | +------+| | +->|CodecB|| | +------+| +------------------------+ We intuitively think we want to handle these as "2 Sound Cards". card0,0: CPU-ch0 - CodecA card1,0: CPU-ch1 - CodecB ^ But below image which we can register today doesn't allow it, because the same Component will be connected to both Card0/1, but it will be rejected by (Z). +-driver------+ |+-component-+| +-card0-------------------------+ ||| || +-driver------+| ||| || |+-component-+|| ||| ch0 dai|<=>|dai ||| ||| || |+-----------+|| ||| || +-------------+| +-------------------------------+ || || +-card1-------------------------+ ||| || +-driver------+| ||| || |+-component-+|| ||| ch1 dai|<=>|dai ||| ||| || |+-----------+|| ||| || +-------------+| +-------------------------------+ |+-----------+| +-------------+ static int soc_probe_component() { ... if (component->card) { (Z) if (component->card != card) { dev_err(component->dev, ...); return -ENODEV; } return 0; } ... } So, how about to call snd_soc_register_component() (= X) multiple times on probe() to avoid buplicated component->card limitation, to be like below ? +-driver------+ +-card0-------------------------+ || | +-driver------+| ||+-component-+| |+-component-+|| ||| ch0 dai|<=>|dai ||| ||+-----------+| |+-----------+|| || | +-------------+| +-------------------------------+ | | +-card1-------------------------+ || | +-driver------+| ||+-component-+| |+-component-+|| ||| ch1 dai|<=>|dai ||| ||+-----------+| |+-----------+|| || | +-------------+| +-------------------------------+ +-------------+ Yes, looks good. But unfortunately it doesn't help us for now. Let's see soc_component_to_node() and snd_soc_is_matching_component() static struct device_node *soc_component_to_node(struct snd_soc_component *component) { ... (A) of_node = component->dev->of_node; ... } static int snd_soc_is_matching_component(...) { ... (B) if (dlc->of_node && component_of_node != dlc->of_node) ... } dlc checkes "of_node" to identify target component (B), but this "of_node" came from component->dev (A) which is added by snd_soc_register_component() (X) on probe(). This means we can have different "component->card", but have same "component->dev" in this case. Even though we calls snd_soc_register_component() (= X) multiple times, all Components have same driver's dev, thus it is impossible to identified the Component. And if it was impossible to identify Component, it is impossible to identify DAI on current implementation. So, how to handle above complex HW image today is 2 patterns. One is handles it as "1 big sound card". The SW image is like below. SW image +-card--------------------------+ |+-driver------+ +-driver------+| ||+-component-+| |+-component-+|| ||| ch0 dai|<=>|dai ||| ||| || |+-----------+|| ||| || +-------------+| ||| || +-driver------+| ||| || |+-component-+|| ||| ch1 dai|<->|dai ||| ||+-----------+| |+-----------+|| |+-------------+ +-------------+| +-------------------------------+ But the problem is not intuitive. We want to handle it as "2 Cards". 2nd pattern is like below. SW image +-card0-------------------------+ |+-driver------+ +-driver------+| ||+-component-+| |+-component-+|| ||| ch0 dai|<=>|dai ||| ||+-----------+| |+-----------+|| |+-------------+ +-------------+| +-------------------------------+ +-card1-------------------------+ |+-driver------+ +-driver------+| ||+-component-+| |+-component-+|| ||| ch1 dai|<=>|dai ||| ||+-----------+| |+-----------+|| |+-------------+ +-------------+| +-------------------------------+ It handles as "2 Cards", but CPU part needs to be probed as 2 drivers. It is also not intuitive. To solve this issue, we need to have multi Component support. In current implementation, we need to identify Component first to identify DAI, and it is using name matching to identify DAI. But how about to be enable to directly identify DAI by unique way instead of name matching ? In such case, we can directly identify DAI, then it can identify Component from DAI. For example Simple-Card / Audio-Graph-Card case, it is specifying DAI via its node. Simple-Card sound-dai = <&cpu-sound>; Audio-Graph-Card dais = <&cpu-sound>; If each CPU/Codec driver keeps this property when probing, we can identify DAI directly from Card. Being able to identify DAI directly means being able to identify its Component as well even though Component has same dev (= B). This patch adds new "dai_node" for it. To keeping compatibility, it checks "dai_node" first if it has, otherwise, use existing method (name matching). Link: https://lore.kernel.org/r/87fskz5yrr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto --- include/sound/soc-dai.h | 1 + include/sound/soc.h | 1 + sound/soc/soc-core.c | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index a4538040e88d..a33d803fe548 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -399,6 +399,7 @@ struct snd_soc_dai_driver { unsigned int id; unsigned int base; struct snd_soc_dobj dobj; + struct of_phandle_args *dai_args; /* DAI driver callbacks */ int (*probe)(struct snd_soc_dai *dai); diff --git a/include/sound/soc.h b/include/sound/soc.h index b27f84580c5b..dda731795bd4 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -651,6 +651,7 @@ struct snd_soc_dai_link_component { const char *name; struct device_node *of_node; const char *dai_name; + struct of_phandle_args *dai_args; }; struct snd_soc_dai_link_codec_ch_map { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bd811d10b792..fc6922ecc3fd 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -238,9 +238,25 @@ static inline void snd_soc_debugfs_exit(void) { } #endif +static int snd_soc_is_match_dai_args(struct of_phandle_args *args1, + struct of_phandle_args *args2) +{ + if (!args1 || !args2) + return 0; + + if (args1->np != args2->np) + return 0; + + for (int i = 0; i < args1->args_count; i++) + if (args1->args[i] != args2->args[i]) + return 0; + + return 1; +} + static inline int snd_soc_dlc_component_is_empty(struct snd_soc_dai_link_component *dlc) { - return !(dlc->name || dlc->of_node); + return !(dlc->dai_args || dlc->name || dlc->of_node); } static inline int snd_soc_dlc_component_is_invalid(struct snd_soc_dai_link_component *dlc) @@ -250,7 +266,7 @@ static inline int snd_soc_dlc_component_is_invalid(struct snd_soc_dai_link_compo static inline int snd_soc_dlc_dai_is_empty(struct snd_soc_dai_link_component *dlc) { - return !dlc->dai_name; + return !(dlc->dai_args || dlc->dai_name); } static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc, @@ -259,6 +275,9 @@ static int snd_soc_is_matching_dai(const struct snd_soc_dai_link_component *dlc, if (!dlc) return 0; + if (dlc->dai_args) + return snd_soc_is_match_dai_args(dai->driver->dai_args, dlc->dai_args); + if (!dlc->dai_name) return 1; @@ -799,6 +818,15 @@ static int snd_soc_is_matching_component( if (!dlc) return 0; + if (dlc->dai_args) { + struct snd_soc_dai *dai; + + for_each_component_dais(component, dai) + if (snd_soc_is_matching_dai(dlc, dai)) + return 1; + return 0; + } + component_of_node = soc_component_to_node(component); if (dlc->of_node && component_of_node != dlc->of_node) From patchwork Wed Jun 21 02:18:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286557 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 1B9FBEB64D8 for ; Wed, 21 Jun 2023 02:21:54 +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 292DBA4C; Wed, 21 Jun 2023 04:21:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 292DBA4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314112; bh=hoKZ/llP316Y21IB5X5r9D8C+bbSPriwhHi3HzChWrs=; 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=sggRmqAR4zEfiNjDjRv3JZ1S/igpZnjv/sMDQy7TDx0ak7UjkUzEzqlZyYgE74OG/ wArWD2neQiWJQlSq2n2F1Ve5z5XXNvPMqHI6IoZ9dwjeyORuRBRCv6lzOmr7jbMwp9 3nGQxv16sTLpg6qGMIPGr4mw9+XlfESdXz5OZ4Vw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DEC54F805C9; Wed, 21 Jun 2023 04:19:31 +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 8BED3F805CA; Wed, 21 Jun 2023 04:19:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2DC8FF805C5; Wed, 21 Jun 2023 04:19:27 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20712.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::712]) (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 D9F54F8057A for ; Wed, 21 Jun 2023 04:18:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9F54F8057A 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=fWIV18Yi ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QqgAOhHNBZpklIGLD3K4ubNN73NcH09z87M9FgV68qx5YG1gaMtOZIMeFYr/Z0y9Km2/tMddp2IVAeGdEZznjffT89N+9HoeVvwZ1Ge+FSd1vbJQg1CugaIiAD6A7afl3BV48/8kriht4w87NxjC/oYNSM0q6TFAu16gSBeK+5BtBJIQifftvwj2gJa/YfQctRD5a7Q/0L62bAzsqYEf+utu/grU61TG4OLnVANfidGd/fUBtYt69xAg75wrluf0qYYnEv/JeYXMJ7PvNsvG8jIEL6gfL7XWut8LVlg94y6RHPBMiYIW0A2fjdb/e/hf5ZbiXPVhYDLNBTef4GdSmQ== 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=IXuPSbgD4AV5CBKMf3RtZkl/GtuISZ6d1SIYnzulRy8=; b=M4Eu11OWvAhUrNVeVABKnpCgzn6Xgu0zZX1/GaPkUGOHr9BM0DX1Y72RzmQBvhQUJl/1t4YCT8MOIujudtEBppuI4ZtaM7PIvBWZOwXAySRleqA2wQkc5XdwM5B7MLxWGv92N3N0y9KqCkfuSFJKMXOfVqI3aWLnQJRqYbkTwEi0B/kKTqOQkMj62Z0QhgVQT8Dgj0w7Hi8aNQhqCsRGFv9qPM5DVacQNDXZx257k+53gyMub2zuoOw5egB6vdgqn/ZPUdB3KFiZ6a3MeMKKlFhl57OHoOl9bPzDaNfKJr8f+DZ7TomrL3NRAUTOev5PK9KK4avLIlYSGxXW2Y4WKg== 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=IXuPSbgD4AV5CBKMf3RtZkl/GtuISZ6d1SIYnzulRy8=; b=fWIV18YiP7dxS/aCLK6MPyetqRfflWScpk+RSHna37IEohfDm1HO/YooCh05xHpIoKzCw6MWzL6wW0luyH23QaImbwapkTHSCGFBnnVUFSoQd3soV/pGRwGFZZYiJEz+4/8lse5w2KlDrvgg1Z5uhFkksvgp1FNNigC/NP1xmsc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8528.jpnprd01.prod.outlook.com (2603:1096:400:13f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Wed, 21 Jun 2023 02:18:44 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:44 +0000 Message-ID: <87jzvxblrw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 05/14] ASoC: soc-core.c: add snd_soc_get_dai_via_args() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:43 +0000 X-ClientProxiedBy: TYCP286CA0206.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:385::14) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8528:EE_ X-MS-Office365-Filtering-Correlation-Id: 2aeb5f02-c082-4e2d-c343-08db71fdd644 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pWZbBQRJDgrPB/DNPsscoZS+Wdg+Xn1RWHo/NlOjjkOzVZoYbLVuKU0kqF7unAgH19z+N4KglZlQyiTJM7eIle6lIocnaDooTC9i80POt8T+ZkfzyCd/2xVZIUTe5QE7SE3hHbMehpU5BjqM/WJ9vW+ILgx0I9c4McAUVw4BK7Y6Q4T5cWrBiht1ojj53j2qgPEO8fLbAlUXVocKQLXQmu15qsqqKy2m/4qNXyczwbGNn+1laYb11XdGk1x5SUHwMByClnY4szygZjPh08dHVYTgYiqh30FmOVlcT/qGxMbOMk6t2LlweTsZu+jIUX2QUUxQQ+rQ1Jxms++CwvAhbjA9EVzT0ML0WmSBwW9WpmkEhJ0OWqdGxJ1jSGBqQuIU2X8iQ7CXGxcYrgfBtldW1GXh58G9FXTsZgSpwsnaDmTK+C8ABABhgU62/fQLvhzDPlYyH31GuC/6BEMql5E+c2XZYZ3bSwLIbCYhM/WzwWFolITQvtVqGi1vghafZ4en1tYWNveMQ0buipRSfgAit6JXbrknhQ+LHIdajHtbhtGpkm8PLM3sde/QpUS0Nsk6d2fDszmV1mhYwpDmgOMNK2y+oNV7Eukr+QhPZDXjvHX5kq6W+QVczVH/XyrXOpKL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(66556008)(66476007)(6916009)(6486002)(66946007)(4326008)(186003)(5660300002)(2906002)(6512007)(36756003)(83380400001)(26005)(2616005)(316002)(38350700002)(38100700002)(41300700001)(6506007)(52116002)(8676002)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ONbUdHWfzd9WT7mmBKF7QFV6wW1zZ13/HNwVfMqFLuNkUQdNDkJtybam45lTL1ToyCt0iLoikkIjUDy6wIuT4pZAlOo+2tzXFBAW+aLvMRcyjCYumgZ7SzU/ayRt3G2+Tl+5+ZSkYiUxRH20NLLCF82+KrtG+50QVJl2jMk7XSAbEFEEAhdAFc4ECn3XCNkjzQHSILNNbhU+UwBAzNN+wKyM7izMmniaANQS4TZgd7L4sUJJLB1ji0fOjWVtWwmimZTh76f+ZOjsO/7HrqZYNQsI4QK5DJGzGiMrFhx8qhhVG39kO6/WxmJ402nKvvfa3jCAZMGNGUBn+4SW/J8xLKqGVF7SB/grtVe4fVYPUgKdMw9H+slUJxHJuVtdaM4AQPk3qzPKNgMeJcPo75oMhEPZkhfJc4sECit0rZagBoWjjCpULs5bZsHbhkjWrTjaGL/2m4a2Kx2+hyPu5yC2ncG9UGUdbU/pMAFDDjLs2fzn0S+QO/lPqLS8hNwKdXi12Jms5+++z/6tYrn4978AGRxf036uy+pUdN8zibuVZJFZxSRQ4Zil5dwzeZPGxjFNGBf7ei7O1lcmJhrLVDtCzITq6KXl1htMVFDFoXxh0e8vD//0lYTkbV9pN+QaockEbuU4foFH4a1CLAj3NjWAG9mt+9jRj9mUD/Nq8MrCRPVMx+MZSWazqtKadktnfClmmyYlhYrNln1ojOoZ22XxTNW+4lV8HFvJZVJDJwykSAzb2MhvUlbkJyn6XRAXK/l/WY5PdHvOL3vNGUKFxT2g+GRorzSg49Mao8J/EhYYsu/24KTb873wFBvddYZ8aWVSiNE+stpkmnZXw3MvVuxjN7b7rDhxs2Rh/voxwWmuTaaXF2nmKV7nsDm/NKEvMSxlO+7pne3oxSA/zy8Jq8mIsALl9Q5hkl46qJFedjjDmpZj08qypta4KsNFekV3uW5X4u8JBDTXMbroSOS7wpSBmSRsfbJeooLkE2f/cb5bf5ur6USP3+9bOO23TLskXjQdLw4Q18m3bck4r51XzJgIHKNkJNioZnIUddCn6iPDi2wJcAK5Asm4OIBfwZmnmXAgySqV1QRjZ93XRVstQbeIZjwabXHKQdHs8RA961gaWeKsx3/SSag7pXR1Mye8gfmoexiOxjKhKEtlLormPX8fx/1hrH/rTOri1coNszli/Pfv39PmRWCzZNSdFfk4buZTtc95YC8QXHozkAipCOGiMaVyxMzQewLZaiAFd1OOwskp/TUfRnrYlx4l9y9afy5uBWs9Jew/nGRCY/XGAcZ5K1UvMWj14uwjVpFwMwa6DsMQtNhkBV4fVT0QcQu8L6SvycNGZmuDHaTaX8N2CTNYBVnjX7pgxqSMTwy0Cld8FW80X+SLsof0QqZMltGKWpsr4crMYZCr8wAspVgmMX/eaz5Imh+3wmFYcUQctL2HFPu2kccYlxYBSSQvp3hfd4s5EW3df72rRkyww8NkkcLHBnEh8GkJwnkljmpnxMVzXYXc5Z/iTwo73dcueTcAYPseDt26dAVGp67K5rlcEdKwoWmQyzUnAMSYsg/xo/LdP0nNErwLy0Kt2BSjHNDDz54u9ns3pB+s7LB6OFpj3wnvYc0ksE6hRQ6dQuScFjmqR58= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aeb5f02-c082-4e2d-c343-08db71fdd644 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:43.9899 (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: 8GN7Op35RXgKJiJACheKryAXhVLvQ7CQK9RMgd+fKWVuapZ6YiMNUcNUVEQhFzJHRN/O+prZ31eD00SVJ866XIyxdaigVkdwQiOEU7t5Y0x4mFroqWNDdbzUvNteCGmq X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8528 Message-ID-Hash: O62TKRBOWT3A3P75YMTSYZLLACNKVJHK X-Message-ID-Hash: O62TKRBOWT3A3P75YMTSYZLLACNKVJHK 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.8 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: To enable multi Component, Card driver need to get DAI via dai_args to identify it. This patch adds snd_soc_get_dai_via_args() for it. This is helper function for multi Component support. Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 1 + sound/soc/soc-core.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index dda731795bd4..1b3c58fe14c4 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1336,6 +1336,7 @@ int snd_soc_add_pcm_runtimes(struct snd_soc_card *card, void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd); +struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args); struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, bool legacy_dai_naming); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index fc6922ecc3fd..f22a09f74ee7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3441,6 +3441,24 @@ int snd_soc_of_get_dai_name(struct device_node *of_node, } EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_name); +struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args) +{ + struct snd_soc_dai *dai; + struct snd_soc_component *component; + + mutex_lock(&client_mutex); + for_each_component(component) { + for_each_component_dais(component, dai) + if (snd_soc_is_match_dai_args(dai->driver->dai_args, dai_args)) + goto found; + } + dai = NULL; +found: + mutex_unlock(&client_mutex); + return dai; +} +EXPORT_SYMBOL_GPL(snd_soc_get_dai_via_args); + static void __snd_soc_of_put_component(struct snd_soc_dai_link_component *component) { if (component->of_node) { From patchwork Wed Jun 21 02:18:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286552 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 DA709EB64D8 for ; Wed, 21 Jun 2023 02:21:01 +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 AABB8AE9; Wed, 21 Jun 2023 04:20:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AABB8AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314059; bh=MJGAv139ulQqQxgUaEzSxXWGbFrBD4dYquHuP8e6MTE=; 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=UJpaYT/J6fk2VKKjDmXTlXxsd5b5CW2AUAbt2fGN88f6uHKbxhOrS3m4yOdkc+yB2 S9xTNuiIK0Uv1XOKl9db8bgtIKL1YZcELjy5AT9vQYGWlaAA6qw8zdvWEDXsMkbbOo XiiwDJ8EbCJ5MIkDxwhsT0bNrYOWf3R3USD8rgEo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50BF2F805AB; Wed, 21 Jun 2023 04:19:08 +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 06753F805AB; Wed, 21 Jun 2023 04:19:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24547F805AB; Wed, 21 Jun 2023 04:19:05 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20723.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::723]) (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 AEF17F8051E for ; Wed, 21 Jun 2023 04:19:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AEF17F8051E 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=bHeoeGjz ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kDRfo4ghFhpUbnyp7VDd/ppHXSqJPioSgDfUwKfpECeylfhQY6loHjcvCy/IBxz5FF2d5AAGoZKnebJ05UBjWu+eOx7UceOkUgDebRi8SBl4D5jo9hXA6UIk7fB6fSbGQJnUBc0JxEd25toHVaEGD5JZJiGk6nu4g+qSZesYLEPSpg3Qlv6JKRjXDrRak+D3v35A8ulPHnGs4lJs7R3gvxe8dU59ORiTHaTTS/y6K6BYVtHqBisLqZtHSOkhT4V4vZMV2sDBcF7uk0wMHJan7NTymSfhbKIaWUA7zgYfTRgHVJjxUPJCiqT25nxucIg69RY1sPisPnGRYxUYRukZVg== 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=jo4iX3AAHmHVSR5ZgQHLYW/stIWxa0zDuhdeQKN385g=; b=FxX77nYAKjb8dsnplfR1PPV/iOAwn1IbpdQwqGWfCaDPwjj72LKQlQPr7xLav/cU5g8G9VOQ150T4y7zajmKQw0OOMQ+3ryu1b3/lSgBI+ow0KhqWFD3Ptcewbj7I7SZVEQA7CiOHWDKbau1eidOQibzsVf3pxrVWGDoSKhXM+OOCcGR97JKITT6F1kuJtUXKLPaDdkl5d3/HxWVSnbqx+E2AZOeWqmVQVLUEBjiH6GihZyTs6KWEFWPRrGav9Rztffiu+0Ifg6/KU3gYTX7f99cgPU0TmmbCrl5sYk/FpWltSlPBh9siJpiiutO80T2FiRHDf7Lt6ExrX6OLlNVyQ== 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=jo4iX3AAHmHVSR5ZgQHLYW/stIWxa0zDuhdeQKN385g=; b=bHeoeGjzEIclIZv03vmGyNR3Wnt9m/nXQql616mvcIWmPBlFMcRskWvYBRxEw7yX7lh4SUXD/3XnBaAfDvYVd23IQrNJ3th5xUvYiZbSwwaHqCxG8EQvWnFzwX320PjGy/7jtbXTSdHPQfYvnwYhRbBz0wheZ5NRwcEMVNa55sA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8528.jpnprd01.prod.outlook.com (2603:1096:400:13f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Wed, 21 Jun 2023 02:18:54 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:53 +0000 Message-ID: <87ilbhblrm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 06/14] ASoC: soc-core.c: add snd_soc_dlc_use_cpu_as_platform() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:53 +0000 X-ClientProxiedBy: TYCP286CA0076.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::13) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8528:EE_ X-MS-Office365-Filtering-Correlation-Id: f6821375-89a0-49d0-2520-08db71fddc20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RMlcajSqWcrQKHuwu02MO2u4yXvZ7pmHaRl8CMkaV4vpWK8IxJI1A5phpwAFRB89SfroE/oMX/By7uUSSBFzq5qNp7J3oTO/VHisxNdNfw2XAqa/AODxZVhLEalpgMFPcGiLsmOstgC+NaFO3Augm+UMmc5y/n7me/uYrHliwVEsebakB4YRc1grEI52EA1EU2b/fS3p8/peglzF/MtqT2NDW45WRoGb4CX0cbqgkMxFN6a05oTZFCrYmT5YV1ZrnceDWFcLn8A2JrIcqmeoA80rpO8lmgfv9FqAeRdcLzY+o+s3FUH/Rhg5p/pXpD+P4WgwG/Bh6i4W0Nvwq59kn/5vSiM5ECWADrp0mFHRP61iMdyUOOx5OZGHzLQPq5RmXI5SWvPmzNvzHW1nJ9j5D4vUIp9Yueb41R28JDsKRDqg+6gcm+gqRutyhTajhepzZ74wbrDfkX7Q/B/f5Lm1RU73wI+g69u5cXm3gnkb/4rkHKEY1ZyVBhz5Rz4TEL2Sv9Vtav/UVYcuoQ2X63rV9EExdnA2JpAJ0GpPtWYzpPumq/2tY+tpfQCeS95cb6Us9MtApD+T705glg5gOe/D1oranMRIU6+6qngeMaLqQTYWBkwUzvAAh84GPOsXqLoe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(66556008)(66476007)(6916009)(6486002)(66946007)(4326008)(186003)(5660300002)(2906002)(6512007)(36756003)(83380400001)(26005)(2616005)(316002)(38350700002)(38100700002)(41300700001)(6506007)(52116002)(8676002)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OhpMFDfwyZDQ0/976ZyxTUAHbv7KiB/f5eSBvB6Sy8ZpNvHelmfndQdEX1kyHAkLtMHg2TiLCK93Wwfx4GPBWAw4W5ftg9fwhxZQ+md6YsNODfVs6z0u2RPDtZmTsUct3lyN9G8r7AMDziCCEtjbB2jDHmVaqQjtF4mjgXe7g5Cv3jHPYuIQ1EqN/nKoPkB0ZTuLJzMN8E292q+N/Kf73TgZhEi5tUeAqAIGYY/ZGdvfcQlWIWCFCUV8pq3f3F9PGsWUoL5A8DV9tS6Z0A84o2hxjkaUZzC0/ZWR+MKfuUSPAlAJ3PXSaWMfFp81+eiHgnYwlnRQkSPFGTEQvdZNuO5eN+UVRPWluBZ3T/Ui0CZb3AVQUY0TpaPkzbQ04G1FM+JTBZ70gFF98/mnz2LwVKubdntpYa8+ARQjFqDU+A3YbCmjHHcyU0UJi6DwQl4N1duTQR/HNwKYNQOohk/Ui7IryNigt8q9/+yyLazF6vCngpHuKs4f3Al7OiVcC72Hgp3T+OV96VcB0yO8BnPH8Xx0+2k1AwgUJYIQOTl00U35EcJfG5IbL1NkcH8wI2fXk1brltsf7IN8SPzOFs8S9mtHqEO18p1HvR5nl4fAbqxUslmo0Bjg+azKCXszLlcg+c5QYq6sVS8lZdfK5oV+w1vxLQmzT24u9JVj1gYadv+OIbq+KS1BhkZdYBZFnm3Ep//gmdj/9RNUBaRpMGPxGpN5JDIlg8R+ARQolJhw0nGiZShyRU38GLtVNsv3jHXazdsBITLHFsy+NvVxKJdP0ZWCjUHCl6vY3hpkW9DpXBJkjNdOZzERpXNQQEh6hn/hqZIT2Pnbq905NejnFNHrYt2wcILAkio65wseoAw6uNVK3Crg7hFxY2LOPMma7yWhJLt9dzkEpT6BNPUgF30Lks0qKBeeQK7pvDqC3hmVdtbWT6vmVsY3UE2qIeWCmC4kLMZNpKNpah4COIz7az2y6UpnQI90gjnLtGn5L4r2FtZZFJP7A0ASY6dgDVVipG3aG8ISrQKQ8xTV20eWGrM2uttCHlTlaPwxKirSxlPTuJ0nZMR/aOm8ReL8XcuXZHoAwEcWzhROecFUhjwazMsFummIyx80y2R3AkvtOEwd/5xODHmiAkwvm+q4A4OUB1ur57Hyp6jlPvas+qpeGZoYefS0G7v7UG0jdDYq1nCc+6TtEbaGX2Ygnevo1DGP4OG9ohNO3gruJRwrwZUBkVsUGwuYZXCnplfGxyRSiRI3zk/wBKSzx4YibSE8QJVng9AmP6Nh6yw9UzIpIhWpJrx4BfVYDXLHmwwFppZOWIu04wrfTgoA9mEOqgDeq3zty/rfd4gpJYUPFYMRNPsNjHwi0IZEmVBiGNCAs4M0R3iXu9SCFWcjkif3oi43KSPf2ZnMjdZDGt6G6NYiTR3EL3CKw4//8+4hsF9Q+EVS528G+phsrN6bKMcihdtx8eqe+PHaZMZSdNClto2OoVA2Ea7GKNTjPlfw4HjublTW5Cdc56lJVtbuwT2QuoeGaNnEq5U0vDIn6P961bpgVahvFa60JWQeyAOXEQSjpOp0qDrkgcPl40XBl9sj4/npeB8JrX6sftykshCnwp+HdrVpfErWoIKo0acqIxpZGnR/cFyRttI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6821375-89a0-49d0-2520-08db71fddc20 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:53.8083 (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: mdF8N8+gBUxft30gxYMFPBzdeiZgsT9tDXIYbTTF/cWA4HrMGGW/ey81VpMMPakxdhkZkL+jrziCjhNLctSZdKaSARAUE520qnTGYU+z3ilZ1ANsBvlG6nF+MAWJiAFR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8528 Message-ID-Hash: AG6UJANQLHA7AC6RA53TLH4SK4GOXRXK X-Message-ID-Hash: AG6UJANQLHA7AC6RA53TLH4SK4GOXRXK 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.8 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 snd_soc_is_matching_component() checks "of_node" or "dai_args". Thus coping "of_node" only is not enough to use CPU as Platform. This patch adds snd_soc_dlc_use_cpu_as_platform() and help it. This is helper function for multi Component support. Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 2 ++ sound/soc/generic/simple-card-utils.c | 2 +- sound/soc/soc-core.c | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 1b3c58fe14c4..94fca10f01ad 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1336,6 +1336,8 @@ int snd_soc_add_pcm_runtimes(struct snd_soc_card *card, void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd); +void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms, + struct snd_soc_dai_link_component *cpus); struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args); struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 3019626b0592..c142571992a1 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -649,7 +649,7 @@ void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platfo * simple-card.c :: simple_count_noml() */ if (!platforms->of_node) - platforms->of_node = cpus->of_node; + snd_soc_dlc_use_cpu_as_platform(platforms, cpus); } EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f22a09f74ee7..6e61f500cc2a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3003,6 +3003,14 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, } EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); +void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms, + struct snd_soc_dai_link_component *cpus) +{ + platforms->of_node = cpus->of_node; + platforms->dai_args = cpus->dai_args; +} +EXPORT_SYMBOL_GPL(snd_soc_dlc_use_cpu_as_platform); + void snd_soc_of_parse_node_prefix(struct device_node *np, struct snd_soc_codec_conf *codec_conf, struct device_node *of_node, From patchwork Wed Jun 21 02:18:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286554 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 B59E1EB64D7 for ; Wed, 21 Jun 2023 02:21:19 +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 DD4AD1E8; Wed, 21 Jun 2023 04:20:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DD4AD1E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314077; bh=aE17kMc+DojcwzR0AlZZ2PBxjYL82awsNrK3pLBEfXs=; 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=XFrhos80lKTOWDuvpSzP9WT3x+kSXRZIduSUq2Siz5OlfRNSDf/ionX2SuucIqKDt PSLBXdyMyZM33OxSJo3z/wG52Lqbz648rC5sQv6pkKjwhK6xCnwXcq4xfQMQiElVM3 IVna9K5mQsbdLboIJQE0u+uotCxDCinl79s/4Otg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB026F805B3; Wed, 21 Jun 2023 04:19:11 +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 68152F805B2; Wed, 21 Jun 2023 04:19:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 415C7F805AE; Wed, 21 Jun 2023 04:19:08 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20723.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::723]) (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 A4923F805A1 for ; Wed, 21 Jun 2023 04:19:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A4923F805A1 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=Mv1XM+7G ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOllI4824GTxC2801ozHvWE22z4zvqhTNNi2J7KALmvyHqU5JVSU5Ts0EpGXOy6GQseHkacePdauQOsSj0F40f5jCb8NEHAwIezMIcZpEKNr/t5gEQuqKEadLt/qpbJzsR1QF+ef/0iajdWv5+p/AvMfcKqo8yBE9xtmDAlP00KCkj8IDey5t7wDHdAlKYYeF++ypzHEA7BAkC/zIAR68ylorjmfbGxxFGrIvAvSTmiQ7weTuYOmWRvHo5Ju6Z+FNpFV05Xo94qDijFFru7kOeomtp6Bo6uxUWyNzugExpYYVWCrS3/POttZrYpQYajaNoM818uvOPUnvCL03PCwhw== 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=hWpSxcIzRSlu3lVpeLJS88lL5s9HdEN6xEamDbffcZg=; b=KNhuutj+pzd2nKBftoM7uvr7/7k8e3UnEA8crYMki+S7D6mK/ldypX6EeOvvXJYwuJV5T3MSgBF+hHcV4pm/cD1DnEjT4pig4FyW2Hv1rP4S0f49bFijVHBi8RH11x4jtqh7AwTBYN/jKZjBN6d1CHOTSqnB/fjyV7g7AErpD3MPr245kGxIKgPID6l4Q760PJarMUYfSiPceFEz+j+lb76dHQFopZIGL4bfC52iB0Uon5xQ5XV/kbfydersGrx4u8nmoUVnkRQZMIZZ6lHa56hT1r4GT8OrIrAvext6cTm5sBAnJSypmh77ElgDht0LTsvYHJ5VnGUCvGGFpVO0Rg== 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=hWpSxcIzRSlu3lVpeLJS88lL5s9HdEN6xEamDbffcZg=; b=Mv1XM+7Gy39GKTwCLiX889uuJYMGKlFwzTv9nJU21k8w5dCOmDUeIAR6nkQRJN7J9jBjM/GDjwFwxfWqXTI3CrkPWroZjWUCJ5pXMx0KSyMU0G4Fvm9paLaUytlKE3sQ49y7zp/+9SStzWYRnfDLC0TU9ZkoTdQKeDoepEdzj6k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8528.jpnprd01.prod.outlook.com (2603:1096:400:13f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Wed, 21 Jun 2023 02:18:59 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:18:59 +0000 Message-ID: <87h6r1blrh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/14] ASoC: soc-core.c: add snd_soc_copy_dai_args() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:18:58 +0000 X-ClientProxiedBy: TYCP286CA0077.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::9) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8528:EE_ X-MS-Office365-Filtering-Correlation-Id: f74aef4e-4f80-4e58-0730-08db71fddf0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2MJ6l0+XL6cmvGDFKPt70d/CTNvZT4dZgvWY33NObnW6NAgCpnGXSNuf2E8/ZrOXSYiqVjZmaji0XEW7Uf8N7sqaCto7w6TGw4N4GA2KUvnLnFl50YOLN7KJVDvVD81vINYVh5We9WDQOrp070VdJ6eCJScPPFu4DNEPtZx81v0DV2IAVOZK8J9fER+LMdfc/AUJLn+6wrkw/to1/Jln5OB8SbA2Wzsf9VrrSeSs/gWaJONWfkTD3OnffRx+X33jlbzS9ntVKtVFAhQPYmwcz3CKcfwNxmjvkgjJOH/WRaEYw0x3sn5cRz+ogGxfAr8SIF+EDJKndQvAo3Zz/PzXN90RkhuTMPcTc2uXMA3r+lbXeavxkNUiiVaIorXxH76XwVVguauBDGb+oWnVUO30MgnjDo50EA2yc3UDd9xz2cU05VXHoStDy7t8FlZbwMj1I1YEJbuUpNkPSGp1iPp0jCBKVCZ544S5IbGoBD+b5SsoLf6HLZon8lkat2OcWbTKpMQvTzQLXQBL/WDiiNf3mwztdKuapXhea3myBtAPWOOt7IK1gdrL3MvNfhL49S3QoTSCb1vuLX9KXbaRUgU1AwwY0554VZ2Z0AbciGGDh0EiYFApn0l3MvbC45XfqcYS X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(66556008)(66476007)(6916009)(6486002)(66946007)(4326008)(186003)(5660300002)(2906002)(6512007)(36756003)(26005)(2616005)(316002)(38350700002)(38100700002)(41300700001)(6506007)(52116002)(8676002)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sGPM9TJNzoNFs5B5dg1utrVmsJNw+Ovx3XYmiEeUM0829daygubymYgIein5aVoRluP4WxVtkTYvGnlGRMvJeMsR25T30pQjNl9JJjoCiphzDq42HrNzTq+u2FF7+K/uIq1L1qrOl2MjZfDbtiJprR0vBds4r6hyvMf2uiYAYeQQHUXVKCCnvABP5c/nh4jPU/H2o/5m3oe/UV53iDAQ2u06Yp/NFNrP8bl9bu4VQL3Ja9ldQYyxrXLGOevgw9aW68T/Lqk1jaaUfLClOzxMyEfxHvq5zMVhoAjkfCYUZyUfkSh8LQdgCoQHwSPnrrBTz2IbUdiUmNd5duj0SMJY0vukvjS3QDPbcgAc1UUuRsh5fOUR+sOHPhPUqRFDf6uwFoG1KPgz3cfrJxv9JtxqJdfH9Nseh1QjuFR5gV/vOoHygwEAIy5ka+2pop4t0ECdr5/JKG0eLFU4CF5Hbr4KG0pE35TLl6sWFGKTUmS9va3S1NlIJEiza0w/OgN1uTWqpCaFtZ3OjwVOCojiwj7T0hOl0qY06e48B9moaJ4ykiys2k+u9lil4QgiIhv3QIe8baMe2i4DHUl57nfWUPiP+Zf/LxJuATdnBxnv8ltuSWd1ypAng14Av+pChyTdKMBPLiu7qXB9ZJ8dUPPyE+UkRNc5IdUYCpuTB1ugbN+5hJvEyj9u9bo8JRrV25cat19hqPnX8ClwHL5tl/381AF+qo+oPuLCtLuIgAsHTRIo1iAfWFt/FCrVpWabHyQI9SQIQi6LskpmJHddpixs3OsWRxXrRZLhBVqQzHoNslfHPJwKyOK76JU9YkfpwWguiHarVDZ3J/fpOUoGTeJI1nHKFcJO0vDgmhsUJb43ylsp7RO7vKchHNXoiZWl6A2yQDhXvUEi2rUajaTU8uGgEuh2bA5Qgz6gDvN1+zJQTZkdcMCLCZiWDzkIsEi6f8wbDx25+buiJ9b1fyWYbOb/gx29rfVu5I42zNEbZaW1VItPumoHO7/P871SvyMl3Yzou7ecPO5qrqDeEglpM/Vqxnfv76LuH4toPGGoI9JTt7qKBJ9IUCbHvyMQjr1+h486TaNKOSHozLKBjs4d8llTDBtwHHdIofPVEHrZNc56vSY6PIlJAHupVsBwexy4w0+7cryU1Y3lr9x81kkV558EOs0tC33rD4IPfaHHB9MhWDDrXw2thHuviJY80xpZJOw9wh44j2RTOfVe3iBhfFTijNjQxvA3zStrpyHqEEfcF46nb2aRLffQiHPq0jQWoJ6M/0cBR6cWx4JzOSYc8q7eUsYMIesjaebwIKMsx7823NpJ5o26/Z8wffbj2HL3W+JgZP4LAvnS6ZksfFMo8JGtWMvS+s8riDjHBfuFY/cUju+kaGhTzuCdZPuzEvjOSp8TAXoRujTSzPIjC390zG29nLlsytrdN2+IE8KBXHNcJS1Bzo9irwecVh59hmd9vM+ODbG0LlTr4tpM9KDgz/aWlb0CvCq1Aef+iWqYqa95wWKtKQMrCwU0tBcwyylYVOhYTocCqolvo9G2yUT2CR0pEOphPSmXIs98N6OSuV/2Iw7puIt/hytaoj5eMe5GWcn5fqXfQD4oP1vyYKGQuL4Debbp0VnFax3nA3OZl4uDAOVHvwM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f74aef4e-4f80-4e58-0730-08db71fddf0f X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:18:59.1961 (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: Xe7+tjKn70zIUv5ifI4XIXx9yAo9FaqtyamI8gZESsRRtNATNUB+amd9bouW5HrgrjA811zwL6pAHWinxleHOrsA2A30kwWFZox8UDRQ603CnOJxaTuMvGdV8cwyqN1c X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8528 Message-ID-Hash: SIS5MFL4WJQ5T36TYOUOBEEQ3P6P7LOV X-Message-ID-Hash: SIS5MFL4WJQ5T36TYOUOBEEQ3P6P7LOV 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.8 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: To use multi Component support, we need to check dai_args whether Card could get DAI from args (CPU/Codec needs set dai_args on DAI driver). If it could, we need to allocate dai_args for dlc. This patch adds snd_soc_copy_dai_args() for it. This is helper function for multi Component support. Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 2 ++ sound/soc/soc-core.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index 94fca10f01ad..fa2337a3cf4c 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1338,6 +1338,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms, struct snd_soc_dai_link_component *cpus); +struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, + struct of_phandle_args *args); struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args); struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6e61f500cc2a..d7713f550fe4 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -809,6 +809,19 @@ static struct device_node return of_node; } +struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, struct of_phandle_args *args) +{ + struct of_phandle_args *ret = devm_kzalloc(dev, sizeof(*ret), GFP_KERNEL); + + if (!ret) + return NULL; + + *ret = *args; + + return ret; +} +EXPORT_SYMBOL_GPL(snd_soc_copy_dai_args); + static int snd_soc_is_matching_component( const struct snd_soc_dai_link_component *dlc, struct snd_soc_component *component) From patchwork Wed Jun 21 02:19:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286555 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 451AFEB64D8 for ; Wed, 21 Jun 2023 02:21:34 +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 58422850; Wed, 21 Jun 2023 04:20:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 58422850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314092; bh=xoAgHozFrR0HGhXz8E6fIPRZR0WTIDZmcZWgQQbBx60=; 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=BPlltugMs3JZpeCWwiYoJ7Wa0UYu4PikqsmVZVUCFeMEMgk1YH/7Jco/Kz9zwG72s 9NcI8cE2eUWmDCUc72SkLQPvy2eEv8Xa4PcPar+9sE1XTyySrDaxABbOhoKEY9uy38 HqTaW2XfBzN3HciuQYhY8jbTriaFA67YLfq7B7To= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A8B2F805C1; Wed, 21 Jun 2023 04:19:21 +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 BF5EEF8055B; Wed, 21 Jun 2023 04:19:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F31AAF8055B; Wed, 21 Jun 2023 04:19:16 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20709.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::709]) (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 834A7F80022 for ; Wed, 21 Jun 2023 04:19:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 834A7F80022 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=RyG7eq3C ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PbT/pQIxP4VZcfej5IRUWmpKHb2iH/tuUwri9adY5wmjSp6hTELxxx8GvYZzjo5TaV4M5o5WgA0ULuN492Xgp1W0uoRRllGma9XIjOVaqvmVt/R10f/gqGgBOFlj4uVQDa84CJ2wNDm9Phjvzu+nrhpe1nT6fgVCl81ka+9oDqe3dpEW0BZiraRvw42vViNduBsVEUhwHeMh/sUTd2KGCVbf5sD2DMmvnYe3+R4U9Gf6YvGbxt34aPDVHIJ27YbHWsq56cxFodfdj7XZYGoaelqhB0NqYxQGopXyf6FdGFcOMLWPztqsseA6gneRESfrpx9JM9Hvk1JBsiS6L4ZpdA== 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=H+z96GYYGa7qPF1z8yFQHXha/8a3v1mDxhTgodkxhYM=; b=N5QzN8fSE6utIxd8tVEmRneqBbxing/WpenR+DMwS8FCdXNrwnzQWkJ9v7Kt9hzSGSCqdG1oY4LLomiKY3ghc7Vz97IKoj2i77EpFTFJBWkMeWXoBlJyS5yEhZkvnQVTw6CQCJw5Bt5MnkdH1MmUmPW1yuKwtpLguNO8myt+/0Hzw0/y2e9/U/qGX+BylxmEsvNExAAwtVIBq/o/VYGEGpdUnzELBAbPlBC2uPRzgwDndjguPMRBV6rOgzmEfQgwkL8WHvMjRSil5uX97tUd8kvvMX1LGXNTrADU0An1wcNT/II1cXmhnRemsAV2ZzkI4Vyk4DjC3yR9+Km1BRLFeg== 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=H+z96GYYGa7qPF1z8yFQHXha/8a3v1mDxhTgodkxhYM=; b=RyG7eq3Ct9EMZkgKXKT02yzgwuDyNqDEGajymhIl/SD3nGps/hM7rAcICXd4D4vvcnrwBy6q3gl7UKX97B0ofEAUfXt4WKCWDTMnCHu4UYTJV+IwsGCgdTQVR8aryJmk1UN6nRRF+WP8IPJCsfB8aD37Q/ifMKsuqmqZKSWrMOE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:07 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:07 +0000 Message-ID: <87fs6lblr9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/14] ASoC: simple-card-utils.c: enable multi Component support User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:06 +0000 X-ClientProxiedBy: TYAPR01CA0150.jpnprd01.prod.outlook.com (2603:1096:404:7e::18) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: 44c73586-e4bb-4c4d-d059-08db71fde3e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H9SBD0uL+JATgyardNQ1daB3n8J0/Y05flWwXtvzLFTz+0zFnD/nL7KtcQbKNR9JCevRWgQWm3ip5LzlYdGWDdXtrz2kMs0G986j0uRestf4pcx/iKdV9zI60BGljChGwDjZJO2ubbjLI/NVVqsUgZawrtOBedTFVJqQ00mORjEg6tMhLgdywe3hq3eUGo+zRIpvQ+JUcEko3TJelkrsrevPiBj2wVjNB+ieVPAI+xiFAlEix3IEeNDXTDGkhy3/PmbihysEpdlvff55HR/dqblsxqL2+tE454C64LCggwzHZC2tB03wpNnAQ6H5azc80eLSzzu2fV50orZpd5/HyvWoKZkaAXjolrewzg5Gu7cPgLyA6ZVRud9VCGP2zd1yVH3mKTkut7be0Hlz5WomM9wCCpFk0vIi7leWPzc5G5szaMGYyCfX3700+DdnRSfC4V3nv4ZIG44KAP3ywPvNS5U4g4KCBiHEvIZxo2p7arnoJWWsD+67mHCSBYS0KM2/A2ImPAF2/IMrGM4/IG6+oTH2ZruOPRwayGQPlJOlKGAnKYcWbbtpSlC3RldJ3m3yTb/nOSsGeMU6d6sANd4SkRjdqlCN5li7Zld2sfE4MoELgD72cw621UWsakTlbaT4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(83380400001)(52116002)(6486002)(5660300002)(86362001)(66556008)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BModlJGOLv1MuIs5yztFvpCpof8uD2RKhNd34qhtfLeBPAtvxMxW7Z7TC7iTft1ITThSaeJPwEd3q0o5LHY2+psIQEvwCJtfOgVizImGHkMP73WQ8okMROqHadASSeugBFUbhSSUTYdBL/YjC2Mw25XQqN6Aenp77UXXdgu3lO9Wmm1qgQU681gSYmPObYm6nTi4DG1MNf74DUIWSnxOvlqM4smalbTY5tM8zSwprcNSPjac6pb7V+wGOMW8Y1E6GIgSG143clNHn1Xr+UaM2S1/tbKe46Jj+rNCGPzEbvtZ0ztthWDKfKAUm+4U3vFGQlVOBTpwledFABLizyoiT9ueQHQM16oxBKh3JckRviNyiknbBwcCzj9ACjtq5ZD/BcrygJ5hmuLNj/zA/K/m92uDN057xON5Sj+WEspqn1V6OM2SpAJyRJA22HJ72FDbq/5NPknS8h9lMxDgzeq8n0FPJ0ZqM2uX35PmwUSoEHjlsRRHNZrT9P4RZta1k5haZoS0egvnwXoWP3tzTCoUCwNuyvyOLU7VnO61SoJANFYfG5ZPas6OYAQsT7Qy//NXB9wxpw/2mXiEvG7X0iIS2789+McfuSpt69ulC/wrcFBnsW/6T8gF/imhs2hNToFN1ya0I+LQ2ekNb5KHjOwkbEwXqRFHcyW7X4GlvQ2yj4K2S5zGnwskmxvnKHOxDh5Ffhiu1LpFZSg1fnut+ATBZGkNKyP27IDrrxj2m7seDtA+yWKhiCakBd03ANBdXkDy4T2hfdY1cuwzF/4oo2UKX3SjuVjYTbA31ToJt6Fx6/qekE6fHTiOvu+Jo0crkUZQ8C4N8dMIS6u6BK86Mc45KTHKUX5IPWdv02rWdq4MH+6pgm0lcLZARH64/EWAJWc10j7Nq5OWlKw++H9jq+Gu4EwKhtHcPDiyE/XscgkXqSHaynovUu3fyobm69XYtnAwjh0Bh8aiNzrYrj49B6bfWeIryzSV/5zzCVbBQ+7FNbFiiHPVus0N2AoqJdBV9YKyKhLOnxMSu5QKUauiCEl01gT7JLXmnIozce2cHR2ZRCre6IwWjIuBWMy4x7XYAN8TYf5CgRs1ZOQwsQFoHOY9SHv0j8EXa3ahn5In5NGf+3YUJJqwcHAuPpoGVlgXgiSk9dQmNnrE/GUnkp80GQrAWVj7Fov6pWzKPQMOALGkVXzayuKMHT3EZNYyV4ei0cEho/CykQ0Gd3XXCBOur6Q6GqlpP5ewrDLO9KeR9LWtA8uLiFloxZ8tajWp614O41zISGyEkYEgeAApQa7VZG3DrVksgFbeSYSk/iAGi8UVhGhQBmh0/g1ccQbZe0kTx7YEONv5x5is36k9njiR/QO4EpVNwst2Lj2PcWsmWck3duodRzfhTqrHaeNVBW4P1Z+jIuSMyeo3bKt5Eu06OOygT2MX6ZUQiBah4UQZQtm2mViQQpo5lfhBMhqjo7dH7aiiSEehGeTNOmsXD0d1GO2hQnXPYnYKLyeKnK/SNdAr8ndh+RRBEaL/jt4bbfLC4fRZq7s7V0po2OzVbv5iGfeu7JJPpqhuNj37fZtd8otg1fJb+rvxQM+pqe8HNorKOzA2E1PqvvENoc1BpXbtgUGhFMA8OAfJbEUrfbqnNEMxdH4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44c73586-e4bb-4c4d-d059-08db71fde3e1 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:07.5730 (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: HIB/lC2uOQuMW2d4Q5YBxwGHoZOV+iZwRAFN9lJn0gKPcr5SIic8Wrm4Y3fAHdtnOcyGl7RmOUp9ZD7rGJc6YrEyv+ag5QNCD1q2MIzvrTBzNOTIHEEXmyzdh4fU5YNa X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: O2NG3NNZXWTHH33ASLSRGH3W4I6ZYXMQ X-Message-ID-Hash: O2NG3NNZXWTHH33ASLSRGH3W4I6ZYXMQ 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.8 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: If CPU/Codec driver keeps its DAI node, we can directly identify actual DAI by using snd_soc_get_dai_via_args(). This means we can use multi Component. This patch enables multi Component support on Audio Graph Card/Card2. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 5 ++--- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/audio-graph-card2.c | 2 +- sound/soc/generic/simple-card-utils.c | 21 ++++++++++++++++++--- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index b450d5873227..d1a95bc33c56 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -192,9 +192,8 @@ int asoc_simple_remove(struct platform_device *pdev); int asoc_graph_card_probe(struct snd_soc_card *card); int asoc_graph_is_ports0(struct device_node *port); -int asoc_graph_parse_dai(struct device_node *ep, - struct snd_soc_dai_link_component *dlc, - int *is_single_link); +int asoc_graph_parse_dai(struct device *dev, struct device_node *ep, + struct snd_soc_dai_link_component *dlc, int *is_single_link); #ifdef DEBUG static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv, diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index c6e0f9132193..0b8258b6bd8e 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -126,7 +126,7 @@ static int graph_parse_node(struct asoc_simple_priv *priv, graph_parse_mclk_fs(top, ep, dai_props); - ret = asoc_graph_parse_dai(ep, dlc, cpu); + ret = asoc_graph_parse_dai(dev, ep, dlc, cpu); if (ret < 0) return ret; diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 542c4a114940..98732468a992 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -407,7 +407,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv, graph_parse_mclk_fs(ep, dai_props); - ret = asoc_graph_parse_dai(ep, dlc, &is_single_links); + ret = asoc_graph_parse_dai(dev, ep, dlc, &is_single_links); if (ret < 0) return ret; diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index c142571992a1..5b18a4af022f 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1066,12 +1066,12 @@ static int graph_get_dai_id(struct device_node *ep) return id; } -int asoc_graph_parse_dai(struct device_node *ep, - struct snd_soc_dai_link_component *dlc, - int *is_single_link) +int asoc_graph_parse_dai(struct device *dev, struct device_node *ep, + struct snd_soc_dai_link_component *dlc, int *is_single_link) { struct device_node *node; struct of_phandle_args args = {}; + struct snd_soc_dai *dai; int ret; if (!ep) @@ -1079,6 +1079,20 @@ int asoc_graph_parse_dai(struct device_node *ep, node = of_graph_get_port_parent(ep); + /* + * Try to find from DAI node + */ + args.np = ep; + dai = snd_soc_get_dai_via_args(&args); + if (dai) { + dlc->dai_name = snd_soc_dai_name_get(dai); + dlc->dai_args = snd_soc_copy_dai_args(dev, &args); + if (!dlc->dai_args) + return -ENOMEM; + + goto parse_dai_end; + } + /* Get dai->name */ args.np = node; args.args[0] = graph_get_dai_id(ep); @@ -1109,6 +1123,7 @@ int asoc_graph_parse_dai(struct device_node *ep, return ret; } +parse_dai_end: if (is_single_link) *is_single_link = of_graph_get_endpoint_count(node) == 1; From patchwork Wed Jun 21 02:19:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286556 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 0503DEB64D7 for ; Wed, 21 Jun 2023 02:21: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 2DDAA84C; Wed, 21 Jun 2023 04:20:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2DDAA84C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314105; bh=ZvzEJLobR9oDwP+hTPdAaBeeLWsXG5emKgAs7ggy5j0=; 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=EBNhtUgF0D53BpHssT6F2JjWFj4mvC5qOw9XzwYdaAGx8Cf3DdhuHvUl8z7Tn9/Ki gKh4IV87dwct6vXUuz1TQT/h0dRSDGlaiAuGg4ptgK0gSI60EwmVwlBjd2CPYv+E2M DNl0jwEGg7VwRljNgWI3duU0DOgzHuh3PHynHdOY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04E31F805C5; Wed, 21 Jun 2023 04:19:27 +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 2D3B9F805C4; Wed, 21 Jun 2023 04:19:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DB714F80552; Wed, 21 Jun 2023 04:19:24 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20714.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::714]) (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 B4F61F80552 for ; Wed, 21 Jun 2023 04:19:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4F61F80552 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=NXTXQALt ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VoUVzcfk0cKWngq5IW57Y0dZwXVAd6FvGxzH3xnWhqZO9aqp2caQuY4kyu6CoAylRUIT4HR7scJFRt731FBFGpqNxXyQE6rI/5cLxtW8uos/mBdQHeguEINWFix5aRhrMX6Lp6+aVIQlb6QgludakAtTnPWtFOGVOHRivYtKl8NuDyVBJSObwUBduC/qwPaigW44ugKgzGlfftc3qeU9ujMuY3hy0nA75kRTAD/5fYl2sWjrl8P8FYyx3AQWplXD2F2cafyX5FoAXSGN0qq0h3tQUyS6uz3mAnW7T0EQT4dqYksh1ho0KEvzw/rsCck/1HQJC2sH3Y4Y5Zx54V0/OQ== 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=z7Nz3ovcO9NzCr9cuHSAciV97qMj4QaTT1NBStXRn+4=; b=ImWid2tl4b3osMPeVc/6NWkyo+V8PnPn4DWaIA8/kF+w+y3ccA3NDovtCYjXKBU0E/zP5gxSZlDItIASrkOC5zc/cddsBSjewvoMppWoKo6w+8C75Jio+9Q3z1WQPtNUbpVBNcjIjxea8PO+I1fYGrYNMDks29ByYClAau5aNKNpuO3MZVe/A5DUfOapjH/ijkC4mSbxeixjcADfsHMliYfQbyRXBXjQZpezwRBnzKnO1pSBAtCTzDdkNJ3o0LpDDpakyFhImsC1YAuGaLvTg5PnjnGKR+EKmxtWsmxI84KoyYI+1Ds3JsJdqTM/88ixBTlD0nkf9n8w1rgu6e8OXg== 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=z7Nz3ovcO9NzCr9cuHSAciV97qMj4QaTT1NBStXRn+4=; b=NXTXQALtOjPIYshNs++ewB1DP0W+GxucWlE689CO6QW0e6SkYxwxfys7GRJKGqRo9o/kGMTnIP0DZqY3rV5JeESkszc4qlm71h80t4scogP96WO3euk5BQ1V4pj/7HNP33Kv+etUZQlkHGcKak6LxDMzUdK8Z1MuxyLEz/8Bvmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:14 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:14 +0000 Message-ID: <87edm5blr2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 09/14] ASoC: simple-card.c: enable multi Component support User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:13 +0000 X-ClientProxiedBy: TYAPR01CA0042.jpnprd01.prod.outlook.com (2603:1096:404:28::30) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: 30946eb9-74ed-46da-4599-08db71fde817 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4eD769D7z89I6/e/trW7P/HNcrJu2bW1hXthRnsefJ/DklmkCDrLU7LpbK1tsHWnoNawcjhuLP16/rL+fb173o83z2Q6ZnC9fwMvGciLlJIsqhx/hdrP94M5Wd6RC0DY+dTmBaRyzxtQABlJh8Y73Q1kZEKNR24pZaM9zvH3ScF1Y7/gt54pd3uGq5WEOtb7jpUH/dYbyleTRFFNEqllSXQdS40ZpaVHiRsvgo0EtjuED3ienAPEBxQGdnQQLRWbQFR66xei2u7v+/oZXV/9Xhh1lQQbhsQKq28CjLMI+UHn8TZh5Wdomrfetg6gPZ+Bi2XHTzj4UYK2s7GYY50RUHIbFZUOEAe+akesQ5lj/1mKfBt2A9/zTuh4LmP+ydi1SxCzlibB1ChVe/+Ic36xuIPaCFr8neXO4Q+5jsooCdLLzMaKgBCq2xbBaZWU0zlqPc72lfs5HSThED3YgG4wqQg7wVuoiB2mqeNcbmKay4p7f8rQE5MQ+ORGHVl2WmYE+mAjTCzv30sSJ5kk6qUAkHKnHINdlg5KNYYMBqRPsmS6WX6fq7pKGtbaS5m4evrNbS9/fiOkVzswpN+asYk6/l2ozi9rgl0MtGclV1EOjAtaS9uOzcXbwggtCICxbuoo X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(83380400001)(52116002)(6486002)(5660300002)(86362001)(66556008)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UAiz09fX4RcQbOxvCPSYHGthgefbAyWZvelbR/RKPdNsUT9329rslQsYOVocSpkIbAs0FraWttugEr7WcPQOJEq4rocdowrvKdb1+mkailyFwbClGp8JLtD5oPxQ67SSzRpwlPH9ZQZrUkHnxvWly/vpqNiVYJDkoJW4QR6aO795GcgOCH9axgTke0M/K5m3d/CvIWcKPPKNjf+TlDCpafM77Neq2ojKSBleybxh542r9HovyxtQcuerCen68K6L47qqm5cCZnSrpQ5S2TSjVJpRZuVbkyJQ42PK3aFVYzyhxZACYxCEoCI/fFVSFTB+izeRH9RG7OsVlhvdkTrn1/VFPsHK/1Rw8SEy2Y9KPFdjDbBD+V1glUX32yk/4rRIOsIa4SmwmlGDzrnuvFa43wsdegW9xc6F3u6XcYQZgur1L+LPvZSHPmoZGj2K/jv50FvAVc+jGtDNmWTZ7vq2B+aQzbAkJjSDCF8g39NOOUt2Rt7oALwujTwqqadKMnbmgRBMEA+krvrRB7EkvysQhmgu6+MV8sMWeZjbNH3OWDlqgUCSene59NRALY3XdQ59Li7jpNzbQBIpJnfI7TFkRtkvcd4PgJBA7dFEvZqkEFWWLa0ChhA0TtPi/KWeo+Y6m6ltmpgvQcffq8bUY2I2xKw5UqXH03WvEF3L8KLGbOnLlrPM1lzLCD27J/zOVuebFWLfj6ATZX6qIXYrmo4dl+Y4jb4NLLaxWalF6Xp+7iT11kbH2UfGZMr5KPCOodYsSMa1PYHQ2UW1PKlL79ic0c2kFm2zw9NSWLCwO5CxTUB6XhKtgMcwNa5ITAYWmI/QzRko0G9uGU7r40K/tF67a6/VJ660s9VeCxKqdD1scTumv/3RH6HN8laAyf/snXndEIlzS1UGGEnviQXPCp392GAcHsbjfD2ZfFmc6+wEF7ag2EZ7ztDTY95y89CG5Vx25QUXYJTjNl1FFq3GTsMKiPS3DCNpgr0b6RCyBF9B4UUlnhY8bdhBILZtSbzEH6xKHIDO1HUyEisgNYjturr78aCoyWZqy3fNzXwmJkvfbPc3kZlFMRdIqVG2p874AjngOek3BBzs4RLgYNC2Xw+Iv7lQqCfooECyC5H2H9YfYALoL6xMBj/cviiGmP9heWTh0yRk0t1ZJJUN73ZkOZzwhhCG2FMNnNNh7irvp5vd+K6dLd7Zzzx1IN9D3d2k63ujnAcXsZH9QHWzcuLDzc920e76vXNk+M2d0JzajLNk1M9DUI4IuwMgCvtTXT4Mcsm7hLig/3IeL8ap+j+hyXeEoAW/lF0MDUmjk8b+muhN8W6mT5QwU262NvMnk40/0XshaiHNcfyMG3i4uUDhpf3pNfb7o5nZbwiPQTY1OJfpRMDrHYMvsTBbQOu33SXQcozwsFuZckpumfPLYSKFtsrg8nC6DKH5DvHZcHrHsMxbfjJ2S+1ldY8Lit3gNScMNKkPwDHVFOVjc25EBh61xFqxEJOD3kOC5DuYeo5uRRViHmb5KQGD61Co5DHWD5dnfXrmCseflfKEk8jbe/cpEuHsanyGK7BkKenG4CZkyuK+Fwy6QUThR1ZNEzqg9tEeQ0gXezKXkfh7jzcN+UzUqrmo5fBRl3zJ5Ogd6qLJkmrKphQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30946eb9-74ed-46da-4599-08db71fde817 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:14.6598 (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: YI9bXQiTF0q3ik0qxxtg8Xn5NvZX1WQyBHDwahyLRXx/1n1HX3zJyvLGbCt92WXaI+D8hBtPOXln+9EqZiK/xO8caPSLVieiAI812KUuhQNoZAUAbHF+og9C+SBdLw67 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: 6BTM55O22YTR4U54SWHBWE6GXMUSL6HQ X-Message-ID-Hash: 6BTM55O22YTR4U54SWHBWE6GXMUSL6HQ 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.8 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: If CPU/Codec driver keeps its DAI node, we can directly identify actual DAI by using snd_soc_get_dai_via_args(). This means we can use multi Component. This patch enables multi Component support for Simple Card Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 0745bf6a09aa..9470b1e67f9e 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -52,11 +52,13 @@ static int asoc_simple_parse_platform(struct device_node *node, return 0; } -static int asoc_simple_parse_dai(struct device_node *node, +static int asoc_simple_parse_dai(struct device *dev, + struct device_node *node, struct snd_soc_dai_link_component *dlc, int *is_single_link) { struct of_phandle_args args; + struct snd_soc_dai *dai; int ret; if (!node) @@ -70,6 +72,19 @@ static int asoc_simple_parse_dai(struct device_node *node, if (ret) return ret; + /* + * Try to find from DAI args + */ + dai = snd_soc_get_dai_via_args(&args); + if (dai) { + dlc->dai_name = snd_soc_dai_name_get(dai); + dlc->dai_args = snd_soc_copy_dai_args(dev, &args); + if (!dlc->dai_args) + return -ENOMEM; + + goto parse_dai_end; + } + /* * FIXME * @@ -93,6 +108,7 @@ static int asoc_simple_parse_dai(struct device_node *node, if (ret < 0) return ret; +parse_dai_end: if (is_single_link) *is_single_link = !args.args_count; @@ -156,7 +172,7 @@ static int simple_parse_node(struct asoc_simple_priv *priv, simple_parse_mclk_fs(top, np, dai_props, prefix); - ret = asoc_simple_parse_dai(np, dlc, cpu); + ret = asoc_simple_parse_dai(dev, np, dlc, cpu); if (ret) return ret; From patchwork Wed Jun 21 02:19:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286558 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 ED946EB64D7 for ; Wed, 21 Jun 2023 02:22: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 E0A671F9; Wed, 21 Jun 2023 04:21:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E0A671F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314135; bh=uHfGZsWQlIaWPXIOISjEx33qMR61fUrzglPCK8bC7AY=; 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=trBdfi30PFA49P5T1ZsyKnvAXB83dEmCJVF5mA7dsWrUgI9GzhHceAAQNDJuxskah KkfORfe7WCBJF1r9ZpplylmXYMdvQ6dOxvu5ChxNPen9QM22ewMvUT4BfKeFg0Cj35 FRUey1MGJplyd2uu8TazPBmmq4gVCCx0RLHEZpBQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A437F805DA; Wed, 21 Jun 2023 04:19:35 +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 07396F805D8; Wed, 21 Jun 2023 04:19:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27DB1F805CA; Wed, 21 Jun 2023 04:19:31 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20703.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::703]) (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 65478F80552 for ; Wed, 21 Jun 2023 04:19:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 65478F80552 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=kkTh1BPT ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PyypSyGpfnj/xtjJ68kLNx0wzxZF4uUPc7begCqGpMl0HkQTKkUr78Pokw9kajCVzGRhQAMaa/f+AmBGWMGZgs1NTR+JQGdY57K0+NJ1x6WJVqj0dmOkcOZo2Lz0lidqA48Chu0tUVvofocx2WC0B71m20YoRR9mPuq0mPY1tfukadoB50mECabLQSF6IKAOT9MOB8rn1f/lm6qFp9skoca29yyURefOGOXF/TkuwDVH7CXcfcCG2cIkQaysOP3W0LJsjL7RQXu+94POOt9L8v6Nnbs+M674tPotuZycl/jDVhdtcVnpcReDZ/MFEVQJJ5eBXpG0QVtbrn258yKL4A== 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=HPQjkV/yUGqOnlH0brfqHlDsVtEbqQhTz6n3QSPRYAE=; b=bUGSHWLH6ceul26+17wV1PVsZ6BkWVh7LFpJSw/5C+38hvkObHxnBSM/Okpk7GvJoVPWbo/5pYZRGDhgV0xwUoWeYHbI33db+KouAIRvHaOR6X/bW2tp6Flpca1ohEsbfEAjDvvfKJXg7UKLYgwOlkEjRPwmDbQAQ2774bYCo2Gti4l9gM8tH7eqiI0YNeVNQoCxQ2G4CQ9QWWJgWq7uFV+8gQ+iDQWX4DjJ4J4801A8YYPHQMdbRemLtWID6CFSffwVBgKCxx+Gk6mIJupgCs2g8htd0qEbYNuJMfMURb/i22U36nTXWXFNRmYnHOgpeoi9oztW6BWTdTGUmr4L4Q== 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=HPQjkV/yUGqOnlH0brfqHlDsVtEbqQhTz6n3QSPRYAE=; b=kkTh1BPTvZ6zk3Uuu7OhEte3Pfwz2iZNEZK5z38yCE6W92EwUbkxOxUB4ffFb8cH4xlBhM/wp/vqIM4gZv/SlONfJXVOeGJLYgOHOCfFIZchIZo5mOxqLqy/EqVQvowdBX7FoZW8wuQglfU5OtiWVq5PLEfQr1+G5tLVKTaoNAs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:21 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:21 +0000 Message-ID: <87cz1pblqv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 10/14] ASoC: rsnd: use DAI driver ID instead of DAI ID User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:20 +0000 X-ClientProxiedBy: TYWPR01CA0045.jpnprd01.prod.outlook.com (2603:1096:400:17f::15) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: 42a456d3-f440-445a-f652-08db71fdec47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qrFSvOHRWwvHE/O9BjF4JvTyehdpltQeCCUg3vBWuNAsOp/SJLOqIbzx575KuNqiGjoGJqwdXxVAiR+CCXpi7/U6yysXwP13d/rZEx+HvKT7S3vIOIHz+/TT3HOqgEPuKplCHRTU6wwwTrG4oN7uPqNhffWwhIyriuz9MJ4xb6Loe8hVDHDQ12DJ8jF2Nd9JeieYTRIqiaTr7dgUYDtxa7YtdQLY1ko6HtqfrYI/trS2xmCcOSrqrwPNQng/qZ/YFLS96q19+/I4qswtEi2f7iuayQUilbyt4n4VeNrjSHx5W1omFQOyRuJQAyn0SLM7t7yqyqQTK2BrNqB6iAdZ52uuqJQ6FyjYWagOxVjv2Kj5ga5lSG0ncuLR7klGGngc8BiRv6s3VK5Kvx7pFjiWlX++NAWUU92UZ5WafKIIJAGWQhtWRTiajYEd0a7Qyyv2Qy+NH5/aNeXjz+qFOla71R18t/HZW4e7yR14GZzDYBN8tN+oGnX67+gfZNqRFktccF6V6rAjPVNCiPhJA53XarbBwnnrI+rhAIYgGOQoquHm9uqnuc9Ow032Cvx4umhAc0md1p/MArf2AlPv7cWSy3RRtQXDkimz6Zkxw+RUW+447EsBJJMvKzg2YRUhlt+l X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(52116002)(6486002)(5660300002)(86362001)(66556008)(4744005)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yNV3avVaS27O3HtCYJ2mVEgFN4hwQUzrSGQTcUDF4c3nYQBQjZVmVVcMMsJrlmBH9yL9yXz2wHMr3KOVXOCq8nyVKUQj8i6mG0DePe58GgMBmcMJx1Fw7ADCQBrtuNdDWojFAVjxQDxvh7jeoryRZHhMrtRWDfgQTWqLsWOqh1vcvgepnPr9kBj+7bezFmR01zVwetrye6ezeqTNVW5HA/RuraNpCvGGXYnwZr7VWyBp1PpGTuXxfaa0HttuSLi126fksLRSSdh2ergB0W9U6G8E900LsQcnf2KC8/i0oyts+oPfIWDikjH3LH2mPMyFgxv1AIOc/UHRKUSWQ6pRVSa5UpO4cBGtj57b30REwyf6lvRWysCb/Yp3fycJZqN221P981Wp+GjD807CVqXqMLINs9iRpHokwOmfBNmYNUWxRcT1Tp3Ie9T2ffJgD86/IGtGa0eDEtkENoQKRrnNs9rGc8MBsDNKJT2gokDdZR2mrprDZYHbpX6fdDwEC3F+oVU1orO1EUZ1JoASIQLSXrIcjVActtgNlDMA0M+j1IkASoBXH5zYBemLuuis3ul8832t+5UmNSxkjpRADC6VtP6ivnu0IC89T3JVYb817JzWz0hj1RdgSwTvBnqiFIBaICs7L/E3RkrdEzGMADBgx08xdYuL5urHt0ckmdFGOSr+Tu0M4Pspt5DEAir/HHtDNvIb4+xG/WfLXBbrGblkyAwG2+dvw36nLyCGA5CjKzvejMrWoNbckaDy1yr8xEHjf737fEjYB6FK/tvjTahWj8O7kC4M9609C3NOSGykaMKYgwDRhZ2iQnbgHPeczSgK4DpTPrJXnyU8GQIm0gSD2qZPFaiu4FKmcIkW0puStpn/ScAiCllGWhsoQ3F802E6BevurMM2k2DfsPmUYwFTX6nh42tdUHql92Boz+N1x4gulWGlRnWdL+PEPFA/RwDrGVTdFRaFrnYNiDcxMe2kYc8DFxGZOTFZnV9g0FTOU8nVMds4TiZClvGwPJ6zReyNcdEWFPmZqC08M3HijJipiUBLPSb2UMVFoY3xfwCBUrU82Z0brrgYlw+WQRc2TVJGAEe1Ir3/sCqpqm2Afuc93geEqEfxLqss9bW85qZDmh449ZHgNU4s5xGCpGFasYp0AS+9L0r8hqoc3N/RftlkzMAn9SGvfriBK8Okk21IWzJ2gZvO4UCUWchun6a5TQtDBd/lA39UDrik10OaVno7vYyAiLkbriMMT6eeeOqKODK25VpRF3CWit1bT/w8LMxIhnketVCPgTngsbbl4VAYrStPF+8eOqtGU8xwhRIfE+K6qdAhGH54on/G1joQfPFFwosb1jjhO8OnXVSboUhrkvduq4Byd/QsFy9Ge+HmYIVyxQC3eVNJ/vejHQUv+Vm+oeYmi/pP6i5jxQBiT1krueJHfo1bZtPTywfb8XThC1q/df4I6WRl92Drw7kSw1P5KRCwaB8ehEzC9xGwhc1/jxZn/D+eH7Sl3XvP8eIYWZ5AA5G0scwARPDimyEm7YQdYgjfsAhKknlsh6ouUaNCburm5pRnhI4B/Sg0KHpUl73r1CFNg6TAvYK6i45epdvei5gcdbBdS3AdK8f9kc2xSWlil2LMMLYuSpymhH2Vcrc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42a456d3-f440-445a-f652-08db71fdec47 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:21.3340 (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: 2Qeg8SxU+5JlCkQrzUVKMUMkgFoHfJ9v3ya9b8ZnEEm1TnGJH7jW6yIgCWed/795NK0xkNnQ/vIgE0HQeb0M2wGPlzF2WL8TtzZdKHV4CA3Oh2YI0zpLkfpRGnwQ35V1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: N3E6LXJECK6S64ZGXP2OFCUJZ7I35EVQ X-Message-ID-Hash: N3E6LXJECK6S64ZGXP2OFCUJZ7I35EVQ 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.8 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 rsnd is using DAI ID to get own priv data without setting driver->id. It was no problem for Single Component, but will be problem in case of Multi Component, because it is not a DAI serial number. struct snd_soc_dai *snd_soc_register_dai(...) { ... if (dai_drv->id) dai->id = dai_drv->id; else dai->id = component->num_dai; ... } This patch sets driver->id, and get serial number. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 6a522e6dd85a..f3f17b784025 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1378,6 +1378,7 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv, drv->name = rdai->name; drv->ops = &rsnd_soc_dai_ops; drv->pcm_new = rsnd_pcm_new; + drv->id = dai_i; io_playback->rdai = rdai; io_capture->rdai = rdai; From patchwork Wed Jun 21 02:19:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286559 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 0B502EB64D7 for ; Wed, 21 Jun 2023 02:22:32 +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 8F3AC84A; Wed, 21 Jun 2023 04:21:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8F3AC84A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314149; bh=8Su+tqEeeYpVjM3Jc3N/Qb4bDgW4DFXePuZm6cHq+ts=; 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=LxTgf+TfrGKs51dQToLgvvL7mSHsnNAT3xDnA7zLUZyaQkM2zFoAnEPp9i/VhJBqS 4pbdvzWZIXOMe3rpM+Adv/whRyhYe9WknpOACyxf/QLA6L9VMkGF8h7DTqQCrkulE2 B9h0t0nFdPm4VhpgFCNSrAQIWx+u8B9CGuUauAVA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2ECAFF805F2; Wed, 21 Jun 2023 04:19: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 CE75BF805E5; Wed, 21 Jun 2023 04:19:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86DB2F805E0; Wed, 21 Jun 2023 04:19:38 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2072a.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::72a]) (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 D40D1F80551 for ; Wed, 21 Jun 2023 04:19:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D40D1F80551 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=C7S2UYpx ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hiGP2mU2WqUCczgO72iVF7vH1HKFHiqAbgU73neJ1mZDOB4vHk4us/rNNvJEfSpyWLOrHWFma81iC8QX02kX80CKxK+RSmJFBOy6zIgiPqhRCRTBtWHx3l+/kdSNQN0X8nvNzhnFLi7QGPuKiMeN9cTEE5ab1bnRwMu2ZQiUw/TZXEfkTfM5A0bjpfLJBru+pzffadjDWNf/MwbL2tKC/kdAJATOSX/51YoatfcorJgeqNqd7DsDzD8Ip8Ko91CrgLbFq5nZAFupctYSRtyp7AVENn6t9OU41MmPKPCfzqI8zXyJqf5r35aGKPjsogYh3LTipbo5qar5yk7btFNmkQ== 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=WhEl3GMfXoWSN/+Hu5gK7wW3vMPVDfdRQW/p01UWKFA=; b=PwTz49AAHYq9bOCjod8MdF6sGk4w3C84kYd96nrNG/kAgNl4ceQZWBSSVlVu5zFe0a5P9OvKQzDI2xakCUA/OnJyf/D1xGhD+ZsH8dHEgbCxhiD8aEJ1mVDvSPlBIJxw4Ws5iI589pYU8a1FTzuuzxeuETaMV6RCPIhQuwMtqodhl+LL+Tar/hglHn33HJ4b9zm/EccvEMLNwdCnFmTJ5qxJhUyXUP5Xi25H7o3SobShdH14Fl+BlCVeAmNiEn8VnrGHupjhG2p5W2sHFws0z1Hcq3lhq31i1l3575rCMeak672A1EFjWc2MA9oQCqnNUVybwIUjH+27qP1ffzd9Dw== 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=WhEl3GMfXoWSN/+Hu5gK7wW3vMPVDfdRQW/p01UWKFA=; b=C7S2UYpxL7IrFkB+5RKYKJWnr99vI67WJ+AxkrFVPuL420VEeX/ubFoPj/9E2cqrsiTGmmdSq4UW7VihzehijeROJBKSlcirJ02jES0m2vyra6pI37i1bFWEajCDfdWKzAqjalQM2uO6iVIQ+xkIU+CDmfBQ63TF50OLd78MDuE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:30 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:30 +0000 Message-ID: <87bkh9blqm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 11/14] ASoC: rsnd: cleanup rsnd_dai_of_node() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:30 +0000 X-ClientProxiedBy: TYCP286CA0057.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::20) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: d60efca8-0331-4d9f-1092-08db71fdf1d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I37Zas7FaxVDxlHwASGgBnSiRqwUoSQYDPGjcY/OXC0Afg/zN63PLNxNjs1AjGMlFWrFXzwAimlhdugR2/gIbaKhFkvEGCq8pKjTNmVmX4GvsOQn+KbG7AgeNM5uTWCHYM5EsjG1PBAiKIAK6PNNjdpfHP/xIoHFwmW/H8IrSkq8DwrhpTBnkrFWI1F3AB3xC1r2eZs0yfggADxVs5GZE2a1sDYE4CcOhJc9dk85qs7/028q9Ne8bB/++nrKcZYPBia2wmLXJRR71sxRjLCm0o1b4aAwXialTbMkGvL0jcx6UUVyDK+x8CzLzyrGmbxi64pu5/6CbS94VZiBe9XHZHK7OWbAhhNkXstaMWCF8l6nivLEvcyC++MfytObAvh8Jcj9CLrgrw1kRpG53J6WG/Aeqf0rOWInzuZyo3zootliF8Td+WrfO3lt6SCjdFQCQ+wI8u6XmO/oI/3vR99I+LoKA1op7wCu36zWgm3mqNsrM2m4bZfdZuvEWH14SalHlG3eUP67sxXrVlIbp4P2X749lO+pQ8BBfdY7sqM6hagnMvB2sFjRpiqPBW9X2WQz+jpvYsOyNfHfB4ofLiPAfM89Vgw8yYUdZfcxwFrA8yGQ7Bq2yIb3q2IfUjXIb2Eg X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(83380400001)(52116002)(6486002)(5660300002)(86362001)(66556008)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WS/sffWCfnNqQ4eGHWyQZUuV9it/T3zRsGdJXfhwuRZ8QMkxC1giqCTC72t7pw3XSQiyJ08P1fBhcMIJitvYHRYOr2L+dspe8YwI4fcZMI8U5MgzISWLtCKCxsUpO/qfjzTB0hsj4VNJ6Icyid4DGRcUzVwRqpMcha5lKE8KuzqdC36dh9+x58K1Cs6yLeuosI1Wf5P9OVqyJbhLZGAEb8KlH/krYmgyjOKoa0HBwVxW2x0zwuNL64HHsif+M5/ZG8M8qJ2zKcpBdiU/bicWVOh4nhA5oa1CMxuyuhu3eqsmU4zHIES0u67M4Q0WQ1IVAQw++MNVaD7nJVUbeVa8RxQzBT6JsQlOOxlfCFS/IcwSGftAkfFdRvO28JZHPhfNyyVoENtIbtKeu7Gq2exQlxyKSyq4Dy06g4OJ3mfAqCTox7e5sxQL9VNkSowisshkEuFpxRKBkB0d++uyNdpqC3TEIFsjvzyF3KSDn9pcTxV/f4lVPQ7xNH15ZrnvBwkKdCrbxQy42Q2tgkEuisqYaginhgPoSNuREj+pPAYjzGmVZlU3RZq6nXheF+cmT7pfPhI7UZg/cPlblZt3YzGJ4q6neQ59OeWF2XGUeWvHBDHjSeEraQHmc+3P0p+bEl/y5GufdWivha85jC0JfJq/euoK1uL/Yy2IOglf1aN6WkVH/1lp2umBoV523Xq8XddWgIDOQ633nroSL/eem9C4XV+1x4hwaJ+yPgvY1JS4vrDjcLeZ0ie4EzcDUV5D7sQXggI2O0vTKV7pRUElaWkojcs2rbgnjauxbajVckm40cwOFgp7OAegYvHEu3RejBaTtkfNgNLHZgfz4fc1bJr26EpAQgBOxdAFPPHh56jlamLc3GYy7RBuUFdpG36Abo0bD8oN9bi8nQUfMz8F7E1hV6GC4o5la6CELk30a17dOpBR14sk/6fP29n4QeqKhVCiKpwh/m7mB4cS7E7UvAYNfey73Gp7vZI9s0VrwujGok1K5M1ZO9SILRi0JczhmXgtYoObl6D27SzBxlHT31OxSKTnHkY9DPz7IKQAICxTjWNo6gZhq4yCcZhK0rgBYVtkp4srQHl1dhCFExhEcvbCCi1H1jAW91gC5GEjSubrgxv6YaEQa+BEn10PodqFioGQimtGpvxvNcV6w3cjK/E6LXchZq6kbYa2sz+paIgf8z8s7lphNNnaKZSuRqfjCBId7sIak/BwqGUXsVftMpq1MO1FxgX410ApD/FZXBgiKbboVyw9FZR8wGZzEVS3C1EtayR2s+rgQDSP5ytL7+bQSmah8w+hYTjab5DJHimtD6hJDAnys4OzyR41w4qnMAQw51NzkYxC8AH3qH+OUSL0IQAv444VNC3eW3V0jpdAIHCdvEBtHsFQaOtHe/qZjiEhsle4HBDurxeir+38XmzLk2oXkc5qPK+5++WOcSNfjOovoN/tn18m7BxDenzSY17kKAA+Li/UBH0cDobPN/xaZm+at/n0KuKtu6QJ2EmtjL1Zq8Tt/GS6Y+PnXjnkGKEx4pBTZVI4I+aQVDkm97tJ6ZxQuL40CMGVBhUk8dr778N3PxCIH+Z9z75LbwvTCX6oCllzKjm2dXH9ORNFj1eMx/PYyzNvFk/POf9x3vWcMFw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d60efca8-0331-4d9f-1092-08db71fdf1d7 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:30.2540 (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: FTLAX6hElHymwouYJwp0wNkDuGBeffmUtfxaTbrZrau9YiLK4iGExHe5SrWp8QOLjTILsZ51JE98+gSCm0QGSWua4gVS+ws5zT7jRijj8WD4ra4bhBJS9dtMEcLJ9B5B X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: AX6RZOG53HRLHFTSRNA5G2VUU6YF6KXW X-Message-ID-Hash: AX6RZOG53HRLHFTSRNA5G2VUU6YF6KXW 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.8 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: It calls rsnd_dai_of_node() to know it was called from Audio Graph Card/Card2, or from Simple Audio Card. And after that, it gets number of related DAIs. To be more simple code, this patch merges these. This is prepare for multi Component support. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index f3f17b784025..a87d7fa55f7b 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1261,7 +1261,7 @@ int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name } static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv, - int *is_graph) + int *nr, int *is_graph) { struct device *dev = rsnd_priv_to_dev(priv); struct device_node *np = dev->of_node; @@ -1274,22 +1274,30 @@ static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv, * parse both previous dai (= rcar_sound,dai), and * graph dai (= ports/port) */ + + /* + * Simple-Card + */ dai_node = of_get_child_by_name(np, RSND_NODE_DAI); if (dai_node) { + *nr = of_get_child_count(dai_node); ret = dai_node; goto of_node_compatible; } - ret = np; - + /* + * Audio-Graph-Card + */ dai_node = of_graph_get_next_endpoint(np, NULL); - if (dai_node) - goto of_node_graph; + if (dai_node) { + *nr = of_graph_get_endpoint_count(np); + *is_graph = 1; + ret = np; + goto of_node_compatible; + } return NULL; -of_node_graph: - *is_graph = 1; of_node_compatible: of_node_put(dai_node); @@ -1447,16 +1455,11 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) struct snd_soc_dai_driver *rdrv; struct device *dev = rsnd_priv_to_dev(priv); struct rsnd_dai *rdai; - int nr; + int nr = 0; int is_graph; int dai_i; - dai_node = rsnd_dai_of_node(priv, &is_graph); - if (is_graph) - nr = of_graph_get_endpoint_count(dai_node); - else - nr = of_get_child_count(dai_node); - + dai_node = rsnd_dai_of_node(priv, &nr, &is_graph); if (!nr) return -EINVAL; From patchwork Wed Jun 21 02:19:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286560 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 55864EB64D7 for ; Wed, 21 Jun 2023 02:23: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 5167283E; Wed, 21 Jun 2023 04:22:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5167283E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314181; bh=JjE34Jd2But6De2FMN0iOxyj89atp8EwfCke625edjo=; 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=J4NpbACRUoe3JpwRv3tgPvCtPYHsYmKR94HxJyuRiqJb0luqGW8pTGtq2TMGWVvXy rfq3Wi4L9jGKNZi8XTA9F9y1ZryI/4CHBnNHVBNZP2aL+4jZjWW8z6IbbtBAhrSabe GfMFDMguiHoq6rJ0hIYyTw3A6bXTwwV9Ywl3T0H4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DBCDFF805FF; Wed, 21 Jun 2023 04:19:58 +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 7E0A9F80602; Wed, 21 Jun 2023 04:19:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47CCDF80603; Wed, 21 Jun 2023 04:19:54 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20724.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::724]) (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 82949F805E4 for ; Wed, 21 Jun 2023 04:19:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82949F805E4 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=o8dS807y ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqAUngZXpNCPH7mXYCuXGs6nAhrQDzUVKC5oNcDZbecRkwNfEWHoMgaOCUBB/Ke3zUvY7SKBK8MApG7mFxYrwgl3h6eKpLNN1HooAfZYKqV+MY2MtJfd3b2f2n+6+z9pjPlGp6ZGcxNvUjvBqJiCvGgeJsGJ6oqervudoHih7c3ZK6/eBBGNhwKfbgs+WS2AiZ+2w1XkEOWz51dl0vc+IaVuo/omXSRkYIHCmzYcpbDvC7oNLOvdlybuGrtMG3kT2LwNp495w5X5vH8SwIYXGvbGsx9zQskXMs/Bq/FPbboi1Ws8RM5gEtAaryVH7R4GAppboJ1d/1RGY9yVFRkT9g== 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=5XTRKCPjGgjyDxCAyPvubwyCywfxoXn/giWNhRXQ+/E=; b=BkXAUAl1yYDUIomrXKD6czLmuwkt8Y14gOxkmzln2LzR+ypUVyovU/WMEGXKAiD+QONO0VcVEEL3xPu8JNJSYcf3genS7/GAYsD4QsY/867eHxbmmHqeK2VNbw+HOyQvaMkvurJbTGBqBQz3TMLvQpzL9ub5KbKemVdkOR9roo8oGGbv9h3YxtgiB65w3MUv7do/0tZga/W0Bt51uK24inaUBm8pQwnZTfCnias/HqAh2VFdNdPU+W2rP1k7db1XAJOC9jk/OoqrZ1vGN79hpxMjTinlUcQ4b2T3XnEtGvBFhIkZCzokBZmNlGvSlaVfqiK8iD8J4js5pPPCaVodPg== 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=5XTRKCPjGgjyDxCAyPvubwyCywfxoXn/giWNhRXQ+/E=; b=o8dS807yC/vElj/AbI81XogMqG6nD4d4O3GL+YgmQcUNqbLnV3Zxs9IEISsLhMU/k0PpJiUS4M0kBQaYoTBUbUEipzC5r7YjeTwAwYNg09m36C/8K09t9jZdDTQOtyrRd2R/+olY7EevC84yf0EEQk1fBzAqF6nw8FotXDKY8lg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:36 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:36 +0000 Message-ID: <87a5wtblqf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 12/14] ASoC: rsnd: enable multi Component support for Audio Graph Card/Card2 User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:36 +0000 X-ClientProxiedBy: TYCP286CA0049.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::7) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: 82f74e58-f700-4c68-f08f-08db71fdf5b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2E97hQyvJ3CI93Smv7xWgr+kj8WyTZeRk5OVNQeaip2oYgbsOChNR6aZZOQLHeYu9+pBEX0KfSbA7RJmkwwAzFbxuGHfdhzOlqGoHjtzN73Lbae9EQavOBS15f7SrRqPv8M6k3nSoVlJ8O1tAPpgm4YkV2MvW08daaBav9T7/Gd1Kxx50mU+BoMYeZDQsWIPUUmwgVjVmYEDO7mYCnA/B5VrGQv7jVvaMFmWIMnHl618y1ye5b8RlZHULkHxv7T1d/bWhCr6ZHuuGjTPX6mhYwIBSQ6O83y9rVP+qFMVP2MMJR5oFMwMdvytyK6WfoBzMzviLr0Qx6U7rKDldPQ+ahSZCAdzpdpHy6T+aGXC1DdrKq5P4GCdibRjKSpK818iFF4n9YKU7bUm8yOR6yg5LXjAm5faGNumgJXOgyXQuTm7v9grfEabKDXoqVOCRJGXa8QcunhEB2WN9dHP23IhO1un+R/j1N5jKFb+CaxQomq6BpveeYFnzCiJh2zBnctWdCzrna7LtuHOGiNDrBC9HE+JKFlToKMrtkZGN0bmQcQSZN8JmXviin8L0JToMoAM7VzhR9rd4dzvOeriju2dEyU6RtoFu0JflwzmebL2VMsoAG2CrHoRxFl8yYdSPryA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(83380400001)(52116002)(6486002)(5660300002)(86362001)(66556008)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mjvzryi3NoTl1IWVE9C0ghURq6+RJLe4BJCJEBLaU0sEmmtZogFllcWSKjAl2A0aEj2s4IsSoks3Dw52rKs/C6VQyjsBgulDYlw2hZY1kGhdfMBSTLW3HpnlUBWor1FJDGQwGBjLoAssdWHqMCzQhF+75qSAVZojq5HFaEqJBjCgaOVRFUN6K4Efyud0w9xA+m1QjoYdYx51ZGkGN2QLTi2q3mnBvZlpZttE/1oUYMZuJsPJyfSr/qFC/7QlgeJRzyuC4jpDSqwPizB6idQKVHz8s+NZ5Q9OT+tfaluV/4gXRXdzkmvdBYT2g0J04DTn9zo1S+855AeEOWj4RcFTALZy52Aijo+XOn9f0Q1uReYsyIbm8BPld6SD1fV/iaq1xj4uZe2T4DA5rvdnBFvXFB7vv76ZUdj1qH/By6BEje20o1/8FoeYbClUIS1Nxs0mBJCMCP8jpIOhF0MOL6lT2pJBWFndcFIh4MDlc7XervzwJjxi0KseXu2AYOjNNuWyfX2TwYcEqqdu/RK03/ABja4eTgJbFoDWkRI055BrYqZenKIdvAUPsegZ055iv8gAKJ0NaDWRXPxW9kyZ6s6GAZCyQ0dV6y+OSI+u77WpqRsEQ0mBddGdkZVHJJvAqe0RIl1wcSfnCnRPDP+EopqBCnTQhg21xjT+VwX36HNugh0m7OWQ0rfeO7tsWhfp77sk2vkdTTdlsT+iFXMcVw1Ez78yvXjy9F2J9WXQ/17iOwc8vyiZQO1rtwiAVtYOz+bFEfbrUNxcIy/UcciKal+AhofgXGKNk8iVk5qw/8BK3cJuV3pNRriSGsl8mwadTo28H05rKEoQNGIKms0SYvhRtVuuoupl/ilwrWn0OH+VEg1VBjuHYwV2xAAZernCO0M1YzGCpEb8u6IbJFljRo2rYual4s/3Sk6j4iq7yGFywhbc20FDJHcSu5X940nkgnlEUY3+tJG6YRMPu6FIIF8Q9mFTXm9ExVkdd2IgFUJJuXrfbxkuoR/XaAmxqGAYB77g3nxYIK3w5HW9cOkVnl1r/ixg3Fc1u9Te+4zwZ/fHJEdKK1Hq8sy3ZOkvZOoXcLpDLg8yKSqUP5tHYmTi0k9nFF60amWyDtHUMskWk6x0uy2s5wFrQWDbI0UYlhGxsA6kKbrAzeUiEp5zgc5BnPWLUt3z3m4wThk1InCRyfcFP5LdVmkQ/zDKvzaV8y161gqHFkORHoRrMuvcsvpB73FK7Ruy7eGm3BIBnQ1YpuZ+U2g0DvwCm6uez4dXLLNLCyJvxaL/rCCdlyNNzmCL1qfivxYvtJOhTYnT9NCyyWBagmMJXSjzGvLxR26+r2tgYXOnsXVwX0bm+2H6a4VcA6GsHQQX6/xWULSBk5NEtk5IKi/Ji2VO1ypDXlGmoHh9jqsyXpVmecHRKNU8Vu5lhUduzaEc7cjYBr9uVWll5FQ5n+h+qiFLaTN0c0Psei5hYpMyfqzwetjGIDyp38CDQardHo0GQhxcz+5tqA6boGFj9Askhu9ipXMTn0yjsw/Jx1eVq2jQft0GYI8QFFL1EMZIE+s9Td/dhPBhDabLZaZc4tuCQtMhkE3erPBMducR3twRXd66oKjBESJ3cR9GZbo0jGGoLqsgeECV9Vjve8R0tfA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82f74e58-f700-4c68-f08f-08db71fdf5b1 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:36.6727 (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: pVxsCh0YjJt+GaVUwKKIa+IJcK57ecGRw+iA/5SjBD62eUN60nW2vv2bYStQPbrwNRDoVfCR6OCh5frv7qIY70sKWOGNcC0emTVLB0NbyQKzlA/bIlUanzjbu8b2XUN5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: YGR2BHSZSBZ4TQYQ33CSWOE5AT7XBPRT X-Message-ID-Hash: YGR2BHSZSBZ4TQYQ33CSWOE5AT7XBPRT 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.8 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: +-- Basic Board ---------+ |+--------+ +------+| || CPU ch0| <--> |CodecA|| || ch1| <-+ +------+| |+--------+ | | +-------------|----------+ +-- expansion board -----+ | | +------+| | +->|CodecB|| | +------+| +------------------------+ In above HW connection case, we intuitively think we want to handle these as "2 Sound Cards". card0,0: CPU-ch0 - CodecA card1,0: CPU-ch1 - CodecB But, we needed to handle it as "1 big Sound Card", because of Component vs Card limitation. card0,0: CPU-ch0 - CodecA card0,1: CPU-ch1 - CodecB This patch enables multi Component to handle multi Cards. To support it, it needs - Fill dai_args for each DAI on snd_soc_dai_driver - Parse DT for each Component (Simple Card/Audio Graph Card) Ex) Simple Card rcar_sound { ... /* Component0 */ rcar_sound,dai@0 { ... }; /* Component1 */ rcar_sound,dai@1 { ... }; }; Ex) Audio Graph Card/Card2 rcar_sound { /* Component0 */ ports@0 { ... }; /* Component1 */ ports@1 { ... }; }; Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 134 ++++++++++++++++++++++++++------------- sound/soc/sh/rcar/rsnd.h | 4 ++ 2 files changed, 95 insertions(+), 43 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index a87d7fa55f7b..9f3d97bc177a 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1260,13 +1260,13 @@ int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name return i; } -static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv, - int *nr, int *is_graph) +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 *dai_node; - struct device_node *ret; + struct device_node *ports, *node; + int nr = 0; + int i = 0; *is_graph = 0; @@ -1278,30 +1278,47 @@ static struct device_node *rsnd_dai_of_node(struct rsnd_priv *priv, /* * Simple-Card */ - dai_node = of_get_child_by_name(np, RSND_NODE_DAI); - if (dai_node) { - *nr = of_get_child_count(dai_node); - ret = dai_node; - goto of_node_compatible; + node = of_get_child_by_name(np, RSND_NODE_DAI); + if (!node) + goto audio_graph; + + of_node_put(node); + + for_each_child_of_node(np, node) { + if (!of_node_name_eq(node, RSND_NODE_DAI)) + continue; + + priv->component_dais[i] = of_get_child_count(node); + nr += priv->component_dais[i]; + i++; + if (i >= RSND_MAX_COMPONENT) { + dev_info(dev, "reach to max component\n"); + break; + } } + return nr; + +audio_graph: /* * Audio-Graph-Card */ - dai_node = of_graph_get_next_endpoint(np, NULL); - if (dai_node) { - *nr = of_graph_get_endpoint_count(np); - *is_graph = 1; - ret = np; - goto of_node_compatible; + 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); + nr += priv->component_dais[i]; + i++; + if (i >= RSND_MAX_COMPONENT) { + dev_info(dev, "reach to max component\n"); + break; + } } - return NULL; - -of_node_compatible: - of_node_put(dai_node); + *is_graph = 1; - return ret; + return nr; } @@ -1365,6 +1382,8 @@ static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd, static void __rsnd_dai_probe(struct rsnd_priv *priv, struct device_node *dai_np, + struct device_node *node_np, + uint32_t node_arg, int dai_i) { struct rsnd_dai_stream *io_playback; @@ -1382,11 +1401,17 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv, snprintf(rdai->name, RSND_DAI_NAME_SIZE, "rsnd-dai.%d", dai_i); + /* for multi Component */ + rdai->dai_args.np = node_np; + rdai->dai_args.args_count = 1; + rdai->dai_args.args[0] = node_arg; + rdai->priv = priv; drv->name = rdai->name; drv->ops = &rsnd_soc_dai_ops; drv->pcm_new = rsnd_pcm_new; drv->id = dai_i; + drv->dai_args = &rdai->dai_args; io_playback->rdai = rdai; io_capture->rdai = rdai; @@ -1450,16 +1475,15 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv, static int rsnd_dai_probe(struct rsnd_priv *priv) { - struct device_node *dai_node; - struct device_node *dai_np; struct snd_soc_dai_driver *rdrv; struct device *dev = rsnd_priv_to_dev(priv); + struct device_node *np = dev->of_node; struct rsnd_dai *rdai; int nr = 0; int is_graph; int dai_i; - dai_node = rsnd_dai_of_node(priv, &nr, &is_graph); + nr = rsnd_dai_of_node(priv, &is_graph); if (!nr) return -EINVAL; @@ -1477,26 +1501,42 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) */ dai_i = 0; if (is_graph) { - for_each_endpoint_of_node(dai_node, dai_np) { - __rsnd_dai_probe(priv, dai_np, dai_i); - if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { - rdai = rsnd_rdai_get(priv, dai_i); - - rsnd_parse_connect_graph(priv, &rdai->playback, dai_np); - rsnd_parse_connect_graph(priv, &rdai->capture, dai_np); + struct device_node *ports; + struct device_node *dai_np; + + 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_gen3(priv) || rsnd_is_gen4(priv)) { + rdai = rsnd_rdai_get(priv, dai_i); + + rsnd_parse_connect_graph(priv, &rdai->playback, dai_np); + rsnd_parse_connect_graph(priv, &rdai->capture, dai_np); + } + dai_i++; } - dai_i++; } } else { - for_each_child_of_node(dai_node, dai_np) { - __rsnd_dai_probe(priv, dai_np, dai_i); - if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { - rdai = rsnd_rdai_get(priv, dai_i); + struct device_node *node; + struct device_node *dai_np; + + for_each_child_of_node(np, node) { + if (!of_node_name_eq(node, RSND_NODE_DAI)) + continue; - rsnd_parse_connect_simple(priv, &rdai->playback, dai_np); - rsnd_parse_connect_simple(priv, &rdai->capture, dai_np); + for_each_child_of_node(node, dai_np) { + __rsnd_dai_probe(priv, dai_np, np, dai_i, dai_i); + if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) { + rdai = rsnd_rdai_get(priv, dai_i); + + rsnd_parse_connect_simple(priv, &rdai->playback, dai_np); + rsnd_parse_connect_simple(priv, &rdai->capture, dai_np); + } + dai_i++; } - dai_i++; } } @@ -1926,6 +1966,7 @@ static int rsnd_probe(struct platform_device *pdev) rsnd_dai_probe, }; int ret, i; + int ci; /* * init priv data @@ -1962,11 +2003,18 @@ static int rsnd_probe(struct platform_device *pdev) /* * asoc register */ - ret = devm_snd_soc_register_component(dev, &rsnd_soc_component, - priv->daidrv, rsnd_rdai_nr(priv)); - if (ret < 0) { - dev_err(dev, "cannot snd dai register\n"); - goto exit_snd_probe; + ci = 0; + for (i = 0; priv->component_dais[i] > 0; i++) { + int nr = priv->component_dais[i]; + + ret = devm_snd_soc_register_component(dev, &rsnd_soc_component, + priv->daidrv + ci, nr); + if (ret < 0) { + dev_err(dev, "cannot snd component register\n"); + goto exit_snd_probe; + } + + ci += nr; } pm_runtime_enable(dev); diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 239705d52517..43c0d675cc34 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -545,6 +545,7 @@ struct rsnd_dai { struct rsnd_dai_stream capture; struct rsnd_priv *priv; struct snd_pcm_hw_constraint_list constraint; + struct of_phandle_args dai_args; int max_channels; /* 2ch - 16ch */ int ssi_lane; /* 1lane - 4lane */ @@ -702,6 +703,9 @@ struct rsnd_priv { struct snd_soc_dai_driver *daidrv; struct rsnd_dai *rdai; int rdai_nr; + +#define RSND_MAX_COMPONENT 3 + int component_dais[RSND_MAX_COMPONENT]; }; #define rsnd_priv_to_pdev(priv) ((priv)->pdev) From patchwork Wed Jun 21 02:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286561 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 98548EB64DC for ; Wed, 21 Jun 2023 02:23:25 +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 4CFF7868; Wed, 21 Jun 2023 04:22:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4CFF7868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314203; bh=fgIV9kTbkxCGTsMs/ElRg2JMf6gq7+7Pk0+9qbKqqW8=; 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=JpYBNN0um2v+PomJ/N1K9tf9BW7dhmlOclOiksvIvHA/lYyTFuNgaStdyuMHAWqnN /u5i5iQxA3V1RP8snFwycudVjWfSqHKKsuiZBPEXNM/ai63EgAb4qL73p5vNbkwP96 QjCeMIEOs5nFwlOgI1NvYJJAoLN1Nr8q4MAcFquY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F886F8060E; Wed, 21 Jun 2023 04:20:03 +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 C5704F80558; Wed, 21 Jun 2023 04:20:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF834F80602; Wed, 21 Jun 2023 04:19:57 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20718.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::718]) (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 04CFDF805E6 for ; Wed, 21 Jun 2023 04:19:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 04CFDF805E6 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=SScTIoQQ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSoYAnJk5bdbLl6exwba5TIGUbw8bgRs0EzEiE1FWcrr5Yz4weCLRUkbNmuwm8YBzxfceyKeQtS0ndGI59kEE+PECRV5MMJhcCX1xN7bagvOXGMYOsh7YIW55/Y3bwzmsqhPvXpV1W6r273s62O7QwVlCcxSEdD7Q+Qi+8fWS7FNvywAoIW6O23rPyankUB3PWJdoInRpVVhziZ2bbkEoVq7Ywsxx7BU9B2CjNiZDC7LJK2k3D9Xpk1gvj4c15g+thmdvTsp5N1Dd+v8j9w+Fv7UORsRmA9AquOe4fZ+DOxeBNVE71nBNRFlJIQdorDWL+MYePbur1VYuD3w91bchQ== 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=osE7+rHcFpL8iDZlKbNPdvvxY/980NiUFS0BABMvcuw=; b=Ha7/g1JyBI/oYdelmtJb0yj4sc8QZh8+6Vjh5AdflBhlsLeZpApQjBCtwI6/I1WPucYTb3j+hePPaBYMuxDp2NebI2iOt2OYCDAVFHKP7Mu1JMp7TfLwQqkzq0egmxzMglXxhM+mqxW05q7eeUtlJtXtMZtZyFKOWrZkBhpV7nlCnAv8swWEEoUGmOwR4AzmfUFeSmHApFGgGStoy9VExO58b9sx7qu6Pm4HSOE1go1uE7k9CuhFC3ZvzrOUY7H+pfkIitvD4+wt5nlFG0yZ742NeIr3aShEwoPDa1uRxA4PkxZqxZPiBf01c5F7marBWyU9UB8tNQ22WAKDlbLtBw== 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=osE7+rHcFpL8iDZlKbNPdvvxY/980NiUFS0BABMvcuw=; b=SScTIoQQTy0VjXcDcV4tMVaQW8AHXu9OLLGUs79ntsmFlKZmmBWIeHuTrb73kCZ/bSimojJO9cEJuywuVjVfnukS4Bk+i/lwkjM46doQGIpGiYIsjMkxPioIGEytKS/OWqojWp10LAkJTg6DgxvSAxvAqAj5rdQOgwr9udtgJJM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8528.jpnprd01.prod.outlook.com (2603:1096:400:13f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Wed, 21 Jun 2023 02:19:42 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:42 +0000 Message-ID: <878rcdblq9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 13/14] ASoC: dt-bindings: renesas,rsnd.yaml: add common port-def User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:42 +0000 X-ClientProxiedBy: TYCP286CA0198.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:385::13) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8528:EE_ X-MS-Office365-Filtering-Correlation-Id: 02063968-d133-429b-23d9-08db71fdf95d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZWK9coJfN2h4FqMcNBLp0jeDeNJqmn9H4pzK/ZzH13kYvpo9VK3V5Rd5phSkLBuHneOEd49YkpAtuzKvc8SSjYTaRwcHFvlpfQLryI75nkJJz57N0C2qcI63UO+Zd0yjLIfJ2F15VoNQCGaDr467wQ/wT7rGPXDuLELGEa1mU4Fx2RR1lHSZz/tbcxg3BNDNZou+FgdoMC0VEO3ySbWF6jeH3s8UrXipao//r4/sHRT2gw5MrfrBx5TpuIp8VfqW9eLnCTHRvzaqTDfyEwimtVxQhxd23RxIdLNi2sTUxRNVLj6wmY1LBDzzlcBLLqki1DOf+CbgJf/uOQa/PIUqkKGFGyBya/RaXtEo6swcXfPQ6KCmTMdQB2u8TyTyBaXG0PKjxa6PCLA2mO/pn+RM+vTfZMbb043IBGFBtmxssiq61s0US1bdmr/Xm/Q+7x7zZY6htKRNzlEwKwuwrLYtU7u6iFtuCbsrH5Onaw2H7HuZ0s3zzOzSKSbD8zqHJjXUNuK+rzCo/Ntk7/XiRcxeuzmzEERLXYkUG9AQn/Vpopie6xpIsUsa84FmZ4HO6+eimhMotJ0EzPdE6s2UboZ0JgFFmoFsbr9gEHyol9DornDxMrA4g7lOfIclMbnK6Gfe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199021)(86362001)(66556008)(66476007)(6916009)(6486002)(66946007)(4326008)(186003)(5660300002)(2906002)(6512007)(36756003)(83380400001)(26005)(2616005)(316002)(38350700002)(38100700002)(41300700001)(6506007)(52116002)(8676002)(478600001)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: csxrqJHaSTZ8tMFv5huHPTgAbQcokp79JAGAWmKhaVt3aH0vHw/PFgpUCVOzTCujvPHIDpKEgpSF8qic87hjCSY6OGc4yBJQxgXWrumbhFOrp7exQODqSpq+CQJBxT4N3UCf/R07eohRCs2iTRGuA2At4IxJPU+y9xikTx/Q5wudoYeQV0X0nTdJsisABQGWL2CEKlzs0ibpKaMv8TUuVG9mYJx/vapVhia5l7rFk8z5p/Gq8GPs0mEGlSgstccKMUPNJkLlfAMOaEnwWdqddkhaxaBcljukauPYqYVNn9ISdcw8L4uHCTKlKa56xjdSMyEQ1149Ylh0NhUUpCZgGPIxuA2gk7zgF4h09nTs9b12fYykVEtpNQg/neHs9O8Hx9OeZGZ6nL062s3dTK+Dc4IB/y10NO725smuKoMUL56q1YXO6utLmaXwuBG/dn9Hg7LHfqRq8tAtrMW3V/flTmbBVFgphSqUfNoLzX82F13vrOnMl8aVMVFBg66/YGZbVVvtbgjfcnZLfe4Ezb14jJbx6U8NzA2f6W5m5d0WuWsN0MAOl1BAF7ptykiPakCkpxYudmnUpw39Yo5ruEqPLQjo7zdWPhMYzTPz7FKxhBNLSiMs4bjqQhk3gTHHEcIUWDQI6YygdrcuqQ4MtOGetA5y6whfsiSor0h3hBP5WL3guQgFaP3guCOVoXeyz9JKHG6M2Z3f3jDz6mHRSgeiG+6jy2o18XEZJ6SyuVBDZYjDTKFakJiChCpAmHoHxCDFXO/uB1VztumJuOv33JVF+zUuwZDHIuJSMN0HHgQUy4Nv1pJoG1sj1jc6HO7T+mYL5gl4Thr+ssVkfGgJjLoolRrRq7r4KYXrbn4PuyddVv8AM+PKo60KUxFZrNVx2b67Yg0OpTsimgUQIdmXJVqVPCMxamXXLzdx4snCe6Knw/Ki5I6rlNly3UU08H43JYuTgD6zEUdcuF00EbX+Azp5qODRbac3e65S1yyChZ1YIIDzM6JSVXbPd0yJC3+/SyvITT7t6NsN6A8JWuLKHVgNGnYfHYWDARAtTG7wwAKOiKqhF20JipuWqdLpzcJ5tzQ2Yijw9X9PAoOrN/9K6tDW5lBPPkQ9Bd6BSsrmvDwdDkDd1eAZXFMqmBTdldHCpCqwFFH3wwTfYs+suHD5QnMFLL6PePIPhs44UTsBQnufQqY8DcsJXHWUD0dzGH2E1oZJsBG/ABlBwyG6CsyvFSSthFM9NrvVkSbXhCpbfkuJlHCPslaKY+a9ioFkkw3cVagd1KGdNClsNHe3X0/mgycnwexUv7gVP20kppJa3OZZzoVJwY4NpGsiew3Jn+FpmhewVDu0FVJCcL1iY7ej3i0zcYte4EPkyKu+Hj0JIl4GACPbqFu4tvdhsIaoymsIkVMEI1TNFVo9TxDZ4fOOwcz5mximE+Y6nzo0l3IRBJ/NWELYL70vQX9FzbcX12nM09swxg6gENzWXxjZOLdG5bM0rk/PWIitWDZuhEZc0FaVz7R+R9IQLZn+e6hS5lvpQuKo8rTX/GGpLTyaaY3dCiCrq4XrrSNn9kskTt6FesFlK3kgSEjv414MCFsWi25Q4Kdf4vADMop6dWqr0O87V5Stv/aIiWqSrs6C2pHrTWRliPs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02063968-d133-429b-23d9-08db71fdf95d X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:42.8490 (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: VRAVRWtizAeH7orQiV4jB/XRLRB4P1MDkbqESPBW6HXG2ozbQlMDgD0waiauJhVkJhb7Q2YVRVOUBrII8bDbOGz0f/DR4LMjBh1UqdXLMUBTxW1QT7600QSiQ1fO1/vZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8528 Message-ID-Hash: ZVVVECH7VL4BMDCXHXEFYNV2ZGDLZK2M X-Message-ID-Hash: ZVVVECH7VL4BMDCXHXEFYNV2ZGDLZK2M 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.8 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: renesas,rsnd uses both "ports" has "port", and these are very similar. To avoid duplicated definitions, this patch adds common port-def. Signed-off-by: Kuninori Morimoto --- .../bindings/sound/renesas,rsnd.yaml | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index 8a821dec9526..d9808b130e8d 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -9,6 +9,20 @@ title: Renesas R-Car Sound Driver maintainers: - Kuninori Morimoto +definitions: + port-def: + $ref: audio-graph-port.yaml#/definitions/port-base + unevaluatedProperties: false + patternProperties: + "^endpoint(@[0-9a-f]+)?": + $ref: audio-graph-port.yaml#/definitions/endpoint-base + properties: + playback: + $ref: /schemas/types.yaml#/definitions/phandle-array + capture: + $ref: /schemas/types.yaml#/definitions/phandle-array + unevaluatedProperties: false + properties: compatible: @@ -108,30 +122,10 @@ properties: unevaluatedProperties: false patternProperties: '^port(@[0-9a-f]+)?$': - $ref: audio-graph-port.yaml#/definitions/port-base - unevaluatedProperties: false - patternProperties: - "^endpoint(@[0-9a-f]+)?": - $ref: audio-graph-port.yaml#/definitions/endpoint-base - properties: - playback: - $ref: /schemas/types.yaml#/definitions/phandle-array - capture: - $ref: /schemas/types.yaml#/definitions/phandle-array - unevaluatedProperties: false + $ref: "#/definitions/port-def" port: - $ref: audio-graph-port.yaml#/definitions/port-base - unevaluatedProperties: false - patternProperties: - "^endpoint(@[0-9a-f]+)?": - $ref: audio-graph-port.yaml#/definitions/endpoint-base - properties: - playback: - $ref: /schemas/types.yaml#/definitions/phandle-array - capture: - $ref: /schemas/types.yaml#/definitions/phandle-array - unevaluatedProperties: false + $ref: "#/definitions/port-def" rcar_sound,dvc: description: DVC subnode. From patchwork Wed Jun 21 02:19:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13286562 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 6BDA9EB64D8 for ; Wed, 21 Jun 2023 02:23:39 +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 73F36852; Wed, 21 Jun 2023 04:22:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 73F36852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1687314217; bh=YzG/uj/R5kKrrc69kFQIJUHb5ImlIgAcxbmPlmw/r2w=; 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=Mnap7lf/0bF4EMHHcllWq6ng8MKhM/FJJq3kJoVmYP6munW745i6UlDBS/DYTVXD2 CaITrT8aJEX75uH88c02ocNckrtoukwwYfGldFmdu2YNlxjQa95DOKOJsMipG3gqWl ozYHnRs3DCzaZGlIL12mrj8xF4ez4E1tKwDqUJlw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EFD61F80588; Wed, 21 Jun 2023 04:20:04 +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 4B63CF8057D; Wed, 21 Jun 2023 04:20:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DE1AEF80608; Wed, 21 Jun 2023 04:19:59 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20720.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::720]) (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 8D252F805E4 for ; Wed, 21 Jun 2023 04:19:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D252F805E4 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=RwgN+lsx ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c9/xEQKCImMdkMvgfiUcw0S+KJ3QDi0ZcBwRIgWWlInWfKsn9zbF3S+uvASJ3bqo1ytIEK7GENij8d37D/wGx8YZwfVNQn8I/VHobJtB+1DfRnm40ZnhmIF9x9qHlEmKrYYjAc93Ze5JEFu726rV3AlJLPoZ70E5hRyQSaISJ0Ws6A4b4CC3gLiYJglrjq2eyiJyRdr0TkQqX/OoBZeyE2tCM1VW92a8TnoKTsXBmg/da8t6wiFfw4knK4pxhXZzLoM7ipw7MJ3KeL3/iDChbqPbel22Janug0hbGrvpHY5VIhQl4894tMjGElLzGQgJf9L8I3ts4DkWQDg7+Bc4Uw== 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=DIX0MxRtmvnMBXmS+gIcOCZAHHIxK90sAl7uauE02b0=; b=SHIZd4ik9kgj+r3LG30YTGkjYApKbPnfqj8qa1I6pPqRmh5Fw4E+YGnTA1nrNsgkd5f6mBGrNaMErW0BkGjgQLRquG0xCG64D4zgnXQfn701n5FJMaI/H2dqXQJAabn6FbQAY6Lm2myxNfUx2JMi9DDg9s1sVHzRHu9ee085eqsl4fl3hHUYL9DQ/QcRR+BJJwGBGIskrxZimOzjwKFA0enuelBMxnQnlpQCzsxnzg2OotKDZdSdOPDwjbz/VMAl2DRKr/laKID9+TfY/hid7raB0GrLCEyxcLCiiE3Y2swWP9wqWA5tBdG1jW8tHDoYmwDiBaEy7c5leTmcfx9s6w== 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=DIX0MxRtmvnMBXmS+gIcOCZAHHIxK90sAl7uauE02b0=; b=RwgN+lsxvI0iXkWYrvFVmUZxo01qyqMPOPPd2qPjR6UerJhRWbZNAGdgal80VXc7Dp8ovvuzIs+ruj59HyqQGOpnSIaZghmeCToPqIIINW5ye8YqSi5EfeNcFkLxEAXRhabiu0jfinRQYcT9/OAt8mWY3ZFRSLkaJ4BfUSfkGAw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9694.jpnprd01.prod.outlook.com (2603:1096:400:230::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 02:19:47 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::3ac7:b366:51f:3e26%6]) with mapi id 15.20.6521.023; Wed, 21 Jun 2023 02:19:47 +0000 Message-ID: <877crxblq4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 14/14] ASoC: dt-bindings: renesas,rsnd.yaml: enable multi ports for multi Component support User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> References: <87r0q5blta.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 21 Jun 2023 02:19:47 +0000 X-ClientProxiedBy: TYCP286CA0150.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::17) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9694:EE_ X-MS-Office365-Filtering-Correlation-Id: 2564537b-9691-4763-1abc-08db71fdfc40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OTa2JbGYQFQicab6/jlyTQBKKgUlVmmLkN/UAWetfIt6ZxIII3vcSVciOPRvxRycZ1SDW2zGuh7YNy3E3cl2OBcSFNqhg4D5gJ9oXwOV92jyOo/j9naUrnXFyPQHb/FiRepmGTQK88fnHEVJ0OmeI6tUsEPSB8HA5WmwTM2H6ISRLcBb0ivFBeuw8qEMEzpwegXmsSqj0flCwQdPOGSUX5A56sXhVCZQPrBzt+XWzN1XPAITSHxVidPF6YPBdhcxExmPBKbOBtO0BsAWh8Z+BX0a4OKNaQBX27NZqa16aqw7hyYMtFr8wJsA7I/qTMUGkutrLdQlcjQLZZih5Y4H2ebUuWFr9RRHK6bpREOrMMcSb3QO3Stlh4SQO694i8ly+h85fOu0JWdCpnOdo8C/PpUZtxJrEhOYrmDGX/3nIsptJSKnRhQvQLsHJTVpY3wwgxcDmzoO4HritOqbkKVax1IQjyxmSZU6QVsE3UkYucyNqmFxQcNxpmDMyRwnXx05YG65xsQlDtzTu9PcqG5ijH1+LAAxqmBR1Na4dfbj3Acol7A8t1b9DqKPrlZg7dtmlx0iPrQ9UVI1UXifdBwEgaVOS/4sHO+rplHv8tWc8pDCTZ/JXPSZi4TEV8EwZ9Lw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(451199021)(36756003)(66946007)(66476007)(478600001)(83380400001)(52116002)(6486002)(5660300002)(86362001)(66556008)(2906002)(41300700001)(8936002)(316002)(4326008)(6916009)(8676002)(186003)(6512007)(38100700002)(38350700002)(6506007)(2616005)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rqHKUZP26svawlgDxdLVX6pJkMLXR4GzWDpKulPeC8OVugMq20N+O72jO132J6S+/lmR0PrECNhggT7JhfAFhfEzktoTB/MPjz66eHVGo88Kl+l2jeLmf8BJbp9XuehCDEcncVTmHh3VeTEHc8Vlw05QNvXJ2mpo1w9vG2oPhEIwc20p+d03IKsemcfQD7GQeYmu6xcEtpQqTqok0pLRB47PheHxRN//ZSji+GDexUu4Pdf1m5O+6XDubm24QqXkB9tuPrfB1efiMRb+zXkgOjuoBhEFDbz9BXmLCx2F0L97vsrkg3OTzRhMZt26uuxVLaYLvk4ZHczsXTuaijbW2CiOjZv+xzJYDGWw6FvA20SeTRDKQnkb96XTOTV6S1bXm60gXu1GpN4LM5ph2/x4Vd8m6lo2rAkZ0gh5BwpGr/Dbk15Gfdu92/v01uArA3nSnM1qHMH8DiqNfJvO3otvyI416i2xf4L+jfnMaXjhZkH+GqsiVJW4fcUJSOKlZL3f4ynf/YTrm7wVk2DOMj/2S0S/OYUdaQmYd7jsk5w8aiPfcYJk3srgG0jnNk5Snp3toUSpaXsSeEUyue0aky7CtiMhbpA2/Af8K1ygd3dp4eFcorpeHxWG8fTBQqDZ11bpa67Eih+S164LHvGVeTaRt99kri52163H2+zcV68vDAaSsHCpNKz8y0mSIXKIWic0tK2JKXihjYtMNfze+w1It4j9D9LcvMlj3MtFb3N6KgcnK5tzF1LE4ZlZNtJ20YcCrDs4MbE9v/IdaLtxfYGEznjvm3ApJGujwDVBiruYZvKuZLX4sgfAGydNTd67wkcQiR3wu9gTzT2PaG5cwQDC2otM3/75tpW64HUS2QjKlgt6w12vwEKX5tlYRLMwllBE/VkpvvzOvA4SXKDZb8Y07qKbyry6tjOSzfdqHy0vGn5NzrT591c+1Rtr36zljYpz2VfcLxC45kIh0FeTKK7zx8A/qF2JeYJI8FKVSq+jvT1dYPIi7nEMuXtWAhC+Rd1SmQx9CMlh764bQm3AJGVySd07/jrIoHI3U5ibH5C7s0becNLZ2+GkFTvV6dMPJXF5md0xouivK4ctQpmVqoJ5cm1aV06x6uis6aLIW3regD1RXNzxH8Jf1AEJ4OfyTFKQuklSZd55tgeSLZDYeuGyJWOoODFg+pHRShNmkoAb7L9nUHb0gIptnIeJuJMCA4hay6KUzOMFEjCWRmQsk8b7VjKzZazLMM6lAWQP6PCpq40tgYrTOOGkdZalq44yzFjII+YAuLAdkn9qaAbioNKZ5h45NhA9iE1TwxoETRBVUdkzuP22ebehX1zRz9f9JUnxAAfkKPgy12jOa+OZVetU9FoZDvmczrH5GAToZJ8SuSqgLsCuOXrKPlnsJQfcHenMVtep3ljEf47FUiG8dJOiqLfcq+hGHhL3x05i+6dzWFzD9VgiEdnDhyEghLgk56PVOt+ZQiav8L6DdFegli8BkaFhKbkKc5wzw5UpSCmme+zeCEfE8p4tRy+grqOcowNDSnRfH1crJ7TN0WOslV2YlMHsG3zhhoR15V2ZQQmqGubNCBegQJqOdSi3y12rjhAX4aXKtm1jBelOyQeZRq6Fx6OwYpmCbxKKt45dl1sbgUE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2564537b-9691-4763-1abc-08db71fdfc40 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 02:19:47.6977 (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: C7LwkkNV/TVJwDbhd3XEJkc9cAAteCLjzZ701qfDUDKk9SyrVxht0agflVwekZhtWeiUzWQ3I6dzd+nnKSLlunmTsAuelDAzFvADhEL7pb24kKUb9Z5HX47iUUL6ovpk X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9694 Message-ID-Hash: BZQMGRFEHNXKDBG62SLBANJVWI5FFB5D X-Message-ID-Hash: BZQMGRFEHNXKDBG62SLBANJVWI5FFB5D 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.8 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: To enable multi Component support, "multi ports" is needed for Audio Graph Card/Card2, and "multi rcar_sound,dai" is needed for Simple Audio Card. This patch enable these. Signed-off-by: Kuninori Morimoto --- .../bindings/sound/renesas,rsnd.yaml | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index d9808b130e8d..13a5a0a10fe6 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -91,6 +91,12 @@ properties: it must be 1 if your system has audio_clkout0/1/2/3 enum: [0, 1] + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + clock-frequency: description: for audio_clkout0/1/2/3 @@ -117,13 +123,7 @@ properties: description: List of necessary clock names. # details are defined below - ports: - $ref: audio-graph-port.yaml#/definitions/port-base - unevaluatedProperties: false - patternProperties: - '^port(@[0-9a-f]+)?$': - $ref: "#/definitions/port-def" - + # ports is below port: $ref: "#/definitions/port-def" @@ -242,8 +242,9 @@ properties: - interrupts additionalProperties: false +patternProperties: # For DAI base - rcar_sound,dai: + 'rcar_sound,dai(@[0-9a-f]+)?$': description: DAI subnode. type: object patternProperties: @@ -263,6 +264,13 @@ properties: - capture additionalProperties: false + 'ports(@[0-9a-f]+)?$': + $ref: audio-graph-port.yaml#/definitions/port-base + unevaluatedProperties: false + patternProperties: + '^port(@[0-9a-f]+)?$': + $ref: "#/definitions/port-def" + required: - compatible - reg