From patchwork Mon Oct 16 01:37:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13422376 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 479F4CDB47E for ; Mon, 16 Oct 2023 01:39: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 4F82FDEB; Mon, 16 Oct 2023 03:38:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4F82FDEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697420363; bh=ifNCtF3ql/QikeiDvr91Flp2w6TiNIsMJd3bcafZFSE=; 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=fkGmEdJsvpP0eoSzUlAxhQ9lYNHWtuTG2+vYTNAfSdg6wtsAqsBW9kTpMfwI1wBEJ bvFdp7td/9RhHSGxAjOJaKLyfF3LFEcsBehRS8BFUJuHQFlUWilPH7nYiLH0WCsv75 1KOcw/b5/B3YrAvd+bDECATDyxCDuLCkN1cBSzHw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id CD1B3F8024E; Mon, 16 Oct 2023 03:38:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 23713F80571; Mon, 16 Oct 2023 03:38:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 077FFF8056F; Mon, 16 Oct 2023 03:38:01 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (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 EAA8EF8024E for ; Mon, 16 Oct 2023 03:37:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EAA8EF8024E 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=mWsK7pSv ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h95LdVcj7LqjKuLZhvzF5cZ+khxCJZeDanBXJ/q5rgwNLbJpcrzRRtZY9MaM0/GjUA3PFbCS8kptAJzRG0kauKwIpZvsb2xg93bYHtFq1l3mJRUOjh0XSwbbAVG4H5ZsW+Spo3InleGSgTP2In2XhDtSIieTMKKQ8Cf8/m77LPWd/s4pQmOvVTgb7MDy/QNbvdREWEpExN62LKKuy+r2CCnpfshrGHq78750TtgmJcQ+/yx4jZB2jTEZhMUta46u7NgiLIKOGn5rvSc8XkhwEz5RcdQgR0bGfBKIvmH2Im4eH8OD2K4RpKZ9/jYANJ5anP2iR0+CbxU5rmjJb0aSDQ== 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=W4AYtG+keeIPKxYqNKHZTQiSO/VnWhfY9wa6gnssUMs=; b=Ruu/KOoB2AaEZoxWX8JiWHJFLu8D2Ok1uyy/LTfTJUSMMxMG638aaDgBEkzRcEpJJyHp9AkFjQA0Pok/uc6xpvRVX709BRxLFNSoypu+77nOJDDuZu4kwDBDHNMLPvDGFWcnOsYErMmlIKMNljFXKCqOOGzfjR5EaT70SX7TgQbiy1/soon4Z7+SolQlkVx1oyZKTuKuCgtmxdBmhK/kbkcbGtn5RVDKCPga8765yFWdqtt1J0/lrKMG2U3ZuvqHJ6bhuS0TAIB0FggqKqC8JDsFXxbpEXQP5e6uWnkglpNLXTyPC/Riqgx9OHvC2oS9UBPcvWByyfPzfpSw/blggw== 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=W4AYtG+keeIPKxYqNKHZTQiSO/VnWhfY9wa6gnssUMs=; b=mWsK7pSvv0UF5WE3R97ZYJSjlldMgI+kq4Gxc0+Z8QkaVRhspbeP/K9oJildCF4oNT7OBCcdxv68QXVMYk3PJu2RUFp8q0co0+mjITc/bEMT3YDt6Q7f+xupWsQKOuoOFoqKu+d9x3aLiOg1pIDKP7ytdRU3+wpVRIUzfCfQpOI= 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 TY3PR01MB11744.jpnprd01.prod.outlook.com (2603:1096:400:407::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Mon, 16 Oct 2023 01:37:40 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c%6]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 01:37:40 +0000 Message-ID: <87y1g3wdng.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 1/4] ASoC: makes CPU/Codec channel connection map more generic User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Pierre-Louis Bossart , Mark Brown , Bard Liao , bard.liao@intel.com, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Jerome Brunet Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org In-Reply-To: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> References: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 16 Oct 2023 01:37:39 +0000 X-ClientProxiedBy: TY2PR02CA0036.apcprd02.prod.outlook.com (2603:1096:404:a6::24) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB11744:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c6a7de1-fc4a-4311-e7bb-08dbcde87bda X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uXu3PhC0fRmj5G6/LGMIVAnWOiSaQBLBlSSWscmcRcRb8h4aQcEIt2b5efJIN84q1Hv1Srjtv8nx0au3+ThqDM6RqGkn6j89FLmfQBj1wqXMj02i6JbEikzAJ8QY5s+CY29/SBECtTG0hNASRH8fcgFgmbkmE2t+Ei2F0cRbEJ0KrD8gzh55CuF5GcwhU9EbcZ979/DhI+nyUc1KsvvF0EHCBSBsK+WEZUzFXiYyLaucwB/A3Pk9F5D3CYiYGzZYi56e1o0WkcMvIHUysrso6vR0yBskkm5/jp8rvBAxYYvPhcPPjWqQzGBkVYNrN88nWykbV1dP4qQaY5F8SRcuy2y7NmnbcHp05PkXI4i3QE/bJGfUva678TZhZF1lsJoHbI+5RSRbAL1kkJYUoAgE54OmzqK+j/5Wm0mrH7tyNGa7pO2IawqO8wyAyEtpkvXH5C0iDmMB1GWJYibrDwxqNzPdVkcZLWgVGKAB+Esb1oa9WXQIdo+HwP3dixZNdvdcbyV94oxsWYTsnDvLRlPSevDxoDOaVGdHoATtyySBqacL3iF55qjAT1/NGK9LVQ6f1VaXsGcVs3Ik3MXHmTD9doZQoKSfmKhD0wfLbOfl/MWmHtPI9QpE3zokiNI4eW0k 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:(13230031)(39860400002)(346002)(366004)(396003)(376002)(136003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(966005)(478600001)(66556008)(6486002)(110136005)(66946007)(66476007)(2616005)(52116002)(316002)(6512007)(6506007)(26005)(8936002)(8676002)(5660300002)(7416002)(41300700001)(2906002)(38100700002)(4326008)(30864003)(36756003)(86362001)(83380400001)(38350700005)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I6td28MOuFnmLbqY4Nk/mhXkOl+EmNhJhmF1UX6vDcv1JrqxWNNFz5+wXhVjKVNB5r8MH5T6B8b0cPlAbug2XoXeSTufL8H0BVT/aeJvuz1pvUMZ/l6a4wJ+HO+k7VCs2Dq4H3wWbZ2fFkMoAX8fJmb3bW29mdyRXyQSC0oC1FqYopLw+5ACppFeabsQmkvCisp/71vi8IA4SpiXTJpF1XfwNWpHGVdIq+Vd1myLMKYd/MLBG62HTjE8CxKmvY6Wul6FYNkvWGl41q7JpRqxWgowZRrII/pOc5nSYki/UbeDKoxkjxdcWDAVgK1fRqKlnhGiJl7mUr29lyHKsm6Jb1SROPRvdQel44Ty5cQZMnIyxng2v27+ERRaOdXwZln/FMUlJ/9I88yq0rs7UoF5ZkrKhBv+4FzPlbAaYKsFR31ayvX1sSb3vBG8gqpiChwb9FTbmw/sAzR6pu/YTd8V444Nlo6nm0SI2LZYtqE6uD50+nnf/WzjdrEXwLSyzo+koGVgJwVi7A6yTfhExMfajpMSB9zC8uXOmqUaSiEHg+bwIbzEMUJyO3aKqNPX2/jLdtHElaOQh11Y691uGAORkyaSvd5uAS7IpqfIzRqYU8MVz11ZhrnMjsWex+gaprrFei0X5KOsRDusVfEQSRKtqIoLnPbGcbdKFG1AW8XYPpqd4mevHsy73bF0E3YxpL+EJ5SIkfl/yZh5nImGlwkWap8B8xsEFhTIHjutOmt3Ovhg2BDnVI3rZH+rHi3xeLuOpG3Me/orfAt8BPCffJpPTTbWXvBhxFiWmAydInQcNzMZJc5TfCO0PPHB0Vvvf8kTqDDr7wzTQ38FxVN12fZKlTl77oWKDFUrIQa4+X2RKSULbAUtq19rThyyDFRHrkM5Z8wcLYIz+uqC+OXgAiqIZVCVEKPALMgPqZYf8jhpSLUuFPNV6AtRcXEb4eNddONxBwyN7NFSXgSOrFMRmF+0B4IRL97CYATEnLccnePiunsyp9zlUPsX6ZFjR5WRiH7EaeSp68WNx0i58b3dCBRJpdlcclCiY8wsVL5xWbnAZ9pNL7GjZkisYhc/4nYtR91nZOb/5eGJ8VaXilzPpnEDQm2Y9ph9R9+9PrtzHmZFBCrVaZlLKv/6T3KN4FLU9DfBG7rTzagupwGKHb1f0nMP/aVseU8zsj0uL+lSLG6+a641LoRlXuBrccw4Ndcc01/AzvGtEVksBZECsyWoQKiniRk8x21MhZOrQ1DNrS2xUNh14apXz2kZ8qQviFQtA6HmhUFW6b3hfsQKQsOIeVIQRxh+qdK2oFlEE3sLYo86CQJoy5Uk9U0pVzXLvZkzkQ4Ehc7ov20w7jntUaE1CoN1yLNJ2X9mQXENmbgY5nBz18T4cjemjwtWWXets9SV8YDZ0Z57JGGkz+qBN+O/TE4qOPLu/2tGf+YlcKMwBdmJzJ6aO09p642OJq1NBW7jFbWdWFMDWo3hJGQCrKxzkSVVHFilMhkgSLr5xMvmuP1/npihrVEd9pNQKJjq/0dRFbYrGF92VOwt7cqaFsn7N0dx1GNRPMeB/5CEIjXim3XvmhmdeF68hOe9nul9SoTgKjvzy0relgdi7NV6U7lM48+tovphk4radcIEVdBcXhLhHO0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c6a7de1-fc4a-4311-e7bb-08dbcde87bda X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 01:37:39.9986 (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: Lgm0TNsk46ONFg83DAuziZn68OAVmQFcNbu1QnB0uYnpvbeh6x6QdcDReXKoEraB4JiHIkwNvTnQd1WxIFIRpED3JFVeBLU6sQfWib0HU9tQdjwPNbnTSnKM+R67qomi X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11744 Message-ID-Hash: DDXEBE3G4BTKWA4FIKGFFPPXSFX4S6ND X-Message-ID-Hash: DDXEBE3G4BTKWA4FIKGFFPPXSFX4S6ND 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 CPU:Codec = N:M connection is using connection mapping idea, but it is used for CPU < Codec case only. We want to use it for any case. By this patch, not only N:M connection, but all existing connection (1:1, 1:N, N:N) will use same connection mapping. Because it will use default mapping, no conversion patch is needed to exising CPU/Codec drivers. More over, CPU:Codec = M:N (M > N) also supported in the same time. Link: https://lore.kernel.org/r/87fs6wuszr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 66 +++++++++++++++++++++++-- sound/soc/intel/boards/sof_sdw.c | 14 +++--- sound/soc/soc-core.c | 85 ++++++++++++++++++++++++++++++++ sound/soc/soc-dapm.c | 47 +++++++----------- sound/soc/soc-pcm.c | 73 ++++++++++++++------------- 5 files changed, 211 insertions(+), 74 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 63b57f58cc56..ff04ed312009 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -655,8 +655,68 @@ struct snd_soc_dai_link_component { struct of_phandle_args *dai_args; }; -struct snd_soc_dai_link_codec_ch_map { - unsigned int connected_cpu_id; +/* + * [dai_link->ch_maps Image sample] + * + * if (num_cpus >= num_codecs) + * .ch_maps is [CPU] base + * else + * .ch_maps is [Codec] base + * + *------------------------- + * CPU0 <---> CodecX + * + * Because [num_cpus >= num_codecs] + * .ch_maps is [CPU] base + * + * .num_cpus = 1; + * .num_codecs = 1; + * .ch_maps[] = {{.connected_node = X; }}; CPU0 <-> CodecX + * + *------------------------- + * CPU0 <---> CodecX + * CPU1 <---> CodecY + * CPU2 <---> CodecZ + * + * Because [num_cpus >= num_codecs] + * .ch_maps is [CPU] base + * + * .num_cpus = 3; + * .num_codecs = 3; + * .ch_maps[] = {{.connected_node = X; }, CPU0 <-> CodecX + * {.connected_node = Y; }, CPU1 <-> CodecY + * {.connected_node = Z; }}; CPU2 <-> CodecZ + * + *------------------------- + * CPU0 <---> CodecX + * CPU1 <-+-> CodecY + * CPU2 <-/ + * + * Because [num_cpus >= num_codecs] + * .ch_maps is [CPU] base + * + * .num_cpus = 3; + * .num_codecs = 2; + * .ch_maps[] = {{.connected_node = X; }, CPU0 <-> CodecX + * {.connected_node = Y; }, CPU1 <-> CodecY + * {.connected_node = Y; }}; CPU2 <-> CodecY + * + *------------------------- + * CPU_X <---> Codec0 + * CPU_Y <-+-> Codec1 + * \-> Codec2 + * + * Because [num_cpus < num_codecs] + * .ch_maps is [Codec] base + * + * .num_cpus = 2; + * .num_codecs = 3; + * .ch_maps[] = {{.connected_node = X; }, Codec0 <-> CPU_X + * {.connected_node = Y; }, Codec1 <-> CPU_Y + * {.connected_node = Y; }}; Codec2 <-> CPU_Y + */ +struct snd_soc_dai_link_ch_map { + unsigned int connected_node; unsigned int ch_mask; }; @@ -688,7 +748,7 @@ struct snd_soc_dai_link { struct snd_soc_dai_link_component *codecs; unsigned int num_codecs; - struct snd_soc_dai_link_codec_ch_map *codec_ch_maps; + struct snd_soc_dai_link_ch_map *ch_maps; /* * You MAY specify the link's platform/PCM/DMA driver, either by * device name, or by DT/OF node, but not both. Some forms of link diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 226a74a4c340..7927b729866d 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -579,7 +579,7 @@ int sdw_hw_params(struct snd_pcm_substream *substream, int i; int j; - if (!rtd->dai_link->codec_ch_maps) + if (!rtd->dai_link->ch_maps) return 0; /* Identical data will be sent to all codecs in playback */ @@ -607,9 +607,9 @@ int sdw_hw_params(struct snd_pcm_substream *substream, */ for_each_rtd_cpu_dais(rtd, i, cpu_dai) { for_each_rtd_codec_dais(rtd, j, codec_dai) { - if (rtd->dai_link->codec_ch_maps[j].connected_cpu_id != i) + if (rtd->dai_link->ch_maps[j].connected_node != i) continue; - rtd->dai_link->codec_ch_maps[j].ch_mask = ch_mask << (j * step); + rtd->dai_link->ch_maps[j].ch_mask = ch_mask << (j * step); } } return 0; @@ -1350,7 +1350,7 @@ static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link, return 0; } -static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps, +static void set_dailink_map(struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps, int codec_num, int cpu_num) { int step; @@ -1358,7 +1358,7 @@ static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_m step = codec_num / cpu_num; for (i = 0; i < codec_num; i++) - sdw_codec_ch_maps[i].connected_cpu_id = i / step; + sdw_codec_ch_maps[i].connected_node = i / step; } static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"}; @@ -1453,7 +1453,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, *ignore_pch_dmic = true; for_each_pcm_streams(stream) { - struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps; + struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps; char *name, *cpu_name; int playback, capture; static const char * const sdw_stream_name[] = { @@ -1530,7 +1530,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, dai_links[*link_index].nonatomic = true; set_dailink_map(sdw_codec_ch_maps, codec_num, cpu_dai_num); - dai_links[*link_index].codec_ch_maps = sdw_codec_ch_maps; + dai_links[*link_index].ch_maps = sdw_codec_ch_maps; ret = set_codec_init_func(card, adr_link, dai_links + (*link_index)++, playback, group_id, adr_index, dai_index); if (ret < 0) { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c305e94762c3..07fdcb997ab4 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1824,6 +1824,86 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) EXPORT_SYMBOL_GPL(snd_soc_set_dmi_name); #endif /* CONFIG_DMI */ +#define MAX_DEFAULT_CONNECTION_MAP_SIZE 7 +static struct snd_soc_dai_link_ch_map default_connection_map1[MAX_DEFAULT_CONNECTION_MAP_SIZE] = { + { .connected_node = 0 }, + { .connected_node = 1 }, + { .connected_node = 2 }, + { .connected_node = 3 }, + { .connected_node = 4 }, + { .connected_node = 5 }, + { .connected_node = 6 }, +}; +static struct snd_soc_dai_link_ch_map default_connection_map2[MAX_DEFAULT_CONNECTION_MAP_SIZE] = { + { .connected_node = 0 }, + { .connected_node = 0 }, + { .connected_node = 0 }, + { .connected_node = 0 }, + { .connected_node = 0 }, + { .connected_node = 0 }, + { .connected_node = 0 }, +}; + +static int snd_soc_compensate_connection_map(struct snd_soc_card *card) +{ + struct snd_soc_dai_link *dai_link; + int i, j, n, max; + + /* + * dai_link->ch_maps indicates how CPU/Codec are connected. + * It will be a map seen from a larger number of DAI. + * see + * soc.h :: [dai_link->ch_maps Image sample] + */ + for_each_card_prelinks(card, i, dai_link) { + + /* it should have ch_maps if connection was N:M */ + if (dai_link->num_cpus > 1 && dai_link->num_codecs > 1 && + dai_link->num_cpus != dai_link->num_codecs && !dai_link->ch_maps) { + dev_err(card->dev, "need to have ch_maps when N:M connction (%s)", + dai_link->name); + return -EINVAL; + } + + /* do nothing if it has own maps */ + if (dai_link->ch_maps) + goto sanity_check; + + /* check default map size */ + if (dai_link->num_cpus > MAX_DEFAULT_CONNECTION_MAP_SIZE || + dai_link->num_codecs > MAX_DEFAULT_CONNECTION_MAP_SIZE) { + dev_err(card->dev, "soc-core.c needs update default_connection_maps"); + return -EINVAL; + } + + /* Compensate missing map for ... */ + if (dai_link->num_cpus == dai_link->num_codecs) + dai_link->ch_maps = default_connection_map1; /* for 1:1 or N:N */ + else + dai_link->ch_maps = default_connection_map2; /* for 1:N or N:1 */ + +sanity_check: + if (dai_link->num_cpus >= dai_link->num_codecs) { + n = dai_link->num_cpus; + max = dai_link->num_codecs; + } else { + n = dai_link->num_codecs; + max = dai_link->num_cpus; + } + + for (j = 0; j < n; j++) + if (dai_link->ch_maps[j].connected_node >= max) { + dev_err(card->dev, + "dai_link->ch_maps[%d].connected_node (= %d) is " + "larger than max (= %d)", + j, dai_link->ch_maps[j].connected_node, max); + return -EINVAL; + } + } + + return 0; +} + static void soc_check_tplg_fes(struct snd_soc_card *card) { struct snd_soc_component *component; @@ -2030,6 +2110,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card) snd_soc_dapm_init(&card->dapm, card, NULL); + /* for keeping compatibility */ + ret = snd_soc_compensate_connection_map(card); + if (ret < 0) + goto probe_end; + /* check whether any platform is ignore machine FE and using topology */ soc_check_tplg_fes(card); diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 2512aadf95f7..3c7c2b16bd64 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -4426,6 +4426,7 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd; + struct snd_soc_dai *cpu_dai; struct snd_soc_dai *codec_dai; int i; @@ -4438,39 +4439,25 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) if (rtd->dai_link->dynamic) continue; - if (rtd->dai_link->num_cpus == 1) { - for_each_rtd_codec_dais(rtd, i, codec_dai) - dapm_connect_dai_pair(card, rtd, codec_dai, - snd_soc_rtd_to_cpu(rtd, 0)); - } else if (rtd->dai_link->num_codecs == rtd->dai_link->num_cpus) { - for_each_rtd_codec_dais(rtd, i, codec_dai) - dapm_connect_dai_pair(card, rtd, codec_dai, - snd_soc_rtd_to_cpu(rtd, i)); - } else if (rtd->dai_link->num_codecs > rtd->dai_link->num_cpus) { - int cpu_id; - - if (!rtd->dai_link->codec_ch_maps) { - dev_err(card->dev, "%s: no codec channel mapping table provided\n", - __func__); - continue; - } + /* + * see + * soc.h :: [dai_link->ch_maps Image sample] + */ + /* .ch_map is from CPU */ + if (rtd->dai_link->num_cpus >= rtd->dai_link->num_codecs) { + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { + codec_dai = snd_soc_rtd_to_codec(rtd, rtd->dai_link->ch_maps[i].connected_node); + dapm_connect_dai_pair(card, rtd, codec_dai, cpu_dai); + } + } + /* .ch_map is from Codec */ + else { for_each_rtd_codec_dais(rtd, i, codec_dai) { - cpu_id = rtd->dai_link->codec_ch_maps[i].connected_cpu_id; - if (cpu_id >= rtd->dai_link->num_cpus) { - dev_err(card->dev, - "%s: dai_link %s cpu_id %d too large, num_cpus is %d\n", - __func__, rtd->dai_link->name, cpu_id, - rtd->dai_link->num_cpus); - continue; - } - dapm_connect_dai_pair(card, rtd, codec_dai, - snd_soc_rtd_to_cpu(rtd, cpu_id)); + cpu_dai = snd_soc_rtd_to_cpu(rtd, rtd->dai_link->ch_maps[i].connected_node); + + dapm_connect_dai_pair(card, rtd, codec_dai, cpu_dai); } - } else { - dev_err(card->dev, - "%s: codec number %d < cpu number %d is not supported\n", - __func__, rtd->dai_link->num_codecs, rtd->dai_link->num_cpus); } } } diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 8c168dc553f6..0bfff2ea111d 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1043,7 +1043,6 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, for_each_rtd_cpu_dais(rtd, i, cpu_dai) { unsigned int ch_mask = 0; - int j; /* * Skip CPUs which don't support the current stream @@ -1055,22 +1054,28 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, /* copy params for each cpu */ tmp_params = *params; - if (!rtd->dai_link->codec_ch_maps) - goto hw_params; /* * construct cpu channel mask by combining ch_mask of each * codec which maps to the cpu. + * see + * soc.h :: [dai_link->ch_maps Image sample] */ - for_each_rtd_codec_dais(rtd, j, codec_dai) { - if (rtd->dai_link->codec_ch_maps[j].connected_cpu_id == i) - ch_mask |= rtd->dai_link->codec_ch_maps[j].ch_mask; + if (rtd->dai_link->num_cpus >= rtd->dai_link->num_codecs) { + /* .ch_map is from CPU */ + ch_mask = rtd->dai_link->ch_maps[i].ch_mask; + } else { + int j; + + /* .ch_map is from Codec */ + for_each_rtd_codec_dais(rtd, j, codec_dai) + if (rtd->dai_link->ch_maps[j].connected_node == i) + ch_mask |= rtd->dai_link->ch_maps[j].ch_mask; } /* fixup cpu channel number */ if (ch_mask) soc_pcm_codec_params_fixup(&tmp_params, ch_mask); -hw_params: ret = snd_soc_dai_hw_params(cpu_dai, substream, &tmp_params); if (ret < 0) goto out; @@ -2824,36 +2829,36 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, int cpu_capture = snd_soc_get_stream_cpu(dai_link, SNDRV_PCM_STREAM_CAPTURE); int cpu_playback = snd_soc_get_stream_cpu(dai_link, SNDRV_PCM_STREAM_PLAYBACK); - for_each_rtd_codec_dais(rtd, i, codec_dai) { - if (dai_link->num_cpus == 1) { - cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); - } else if (dai_link->num_cpus == dai_link->num_codecs) { - cpu_dai = snd_soc_rtd_to_cpu(rtd, i); - } else if (rtd->dai_link->num_codecs > rtd->dai_link->num_cpus) { - int cpu_id; - - if (!rtd->dai_link->codec_ch_maps) { - dev_err(rtd->card->dev, "%s: no codec channel mapping table provided\n", - __func__); - return -EINVAL; - } + /* + * see + * soc.h :: [dai_link->ch_maps Image sample] + */ + /* .ch_map is from CPU */ + if (dai_link->num_cpus >= dai_link->num_codecs) { + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { + codec_dai = snd_soc_rtd_to_codec(rtd, dai_link->ch_maps[i].connected_node); - cpu_id = rtd->dai_link->codec_ch_maps[i].connected_cpu_id; - cpu_dai = snd_soc_rtd_to_cpu(rtd, cpu_id); - } else { - dev_err(rtd->card->dev, - "%s codec number %d < cpu number %d is not supported\n", - __func__, rtd->dai_link->num_codecs, - rtd->dai_link->num_cpus); - return -EINVAL; + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && + snd_soc_dai_stream_valid(cpu_dai, cpu_playback)) + has_playback = 1; + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) && + snd_soc_dai_stream_valid(cpu_dai, cpu_capture)) + has_capture = 1; } + } + /* .ch_map is from Codec */ + else { + for_each_rtd_codec_dais(rtd, i, codec_dai) { + cpu_dai = snd_soc_rtd_to_cpu(rtd, dai_link->ch_maps[i].connected_node); + + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && + snd_soc_dai_stream_valid(cpu_dai, cpu_playback)) + has_playback = 1; + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) && + snd_soc_dai_stream_valid(cpu_dai, cpu_capture)) + has_capture = 1; - if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && - snd_soc_dai_stream_valid(cpu_dai, cpu_playback)) - has_playback = 1; - if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) && - snd_soc_dai_stream_valid(cpu_dai, cpu_capture)) - has_capture = 1; + } } } From patchwork Mon Oct 16 01:37:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13422377 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 AA192CDB47E for ; Mon, 16 Oct 2023 01:39: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 D2039DF9; Mon, 16 Oct 2023 03:38:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D2039DF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697420367; bh=3JEF2BQlIHYf6495H6nkM/THEIDLwX1T5p0ClWa49u8=; 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=BaH9IkBWKEw+zObEaXzJvIbOpc12DrKHIC1OgJeGU+4e12C1j8PcbKjqwZOzDGx7U eYheXdZd5GBu4T+IvCpM6Kkuu/QTKGF1q43rnhZyJRIUqSZsT/Z4paCqE9ZqaRm5BI FElTqWz9ItwAJTRyG0RJQTVRW+J/iiNtaiqB9oaw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 89406F8058C; Mon, 16 Oct 2023 03:38:10 +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 19B6FF8057F; Mon, 16 Oct 2023 03:38:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 713EBF80570; Mon, 16 Oct 2023 03:38:04 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20721.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::721]) (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 8273FF80563 for ; Mon, 16 Oct 2023 03:37:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8273FF80563 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=fG/My538 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGTHZ6dCMmuBUAXBOseJ/b+9fbMM7+6YLd0fZXz5pvL+ISwFgOutOAfULr2e++NJYEDHNG9fgzrmZi6HMb30QUSjk7KDei11of7er/USpZD2AXiV5UIUYAjY9XWjsxvNfzrSYCTsOHmf+31MCTj6TYYQmuF/zdGnhQoO6NOQd9hmadU+7Ce3K6F2RKziT44uNQXaP/An+BDB4Hi0d+9tGVbGIUHUz/9c7JxJVwIhp+qkJUNTPs8qNhzBX5eECOOPX4sPcBouX1tBbtxl7unYuvSO26G2la96bvc+6GfM63Z3vlIK+UoGfPyF3Lp0RrmsIlSL/PNPzT8ZMLD/ertB+g== 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=SV40rYPgD+X79RHIP1LMFV+4ANzbM28sKQBKFTpL4f8=; b=bvlUWSFN1a9gxnTi3IaxtYCR0xsDiKPx18bFcJk7s2w7gGHV0GxEmHHeuXf3VbdkHhhbQm7Bg5dXYdfIfvMZ5TZwrrWQf8NGCHr37BLBy4AiNh2ZbzeKgHQjO36S5KGZ8Q4UEEaj+tIfkkk25o/NeUTB1HxklavwbxNEUkWp1sZfIob/3YA+EiNQWaGgK2yioqdkrpb8LzLu9gT1ZYZjExYf6P/ouAZNWV0nmnRF39qnsl6Jt1kJkD1emTM5azbtdtlMmDmdzbk49iCjszrjytc6fVfC0//b+FOBd3ivUg3V2If+WgXb42rIZY8TktifQwMyKQkcqCcOsRuiNh1xpg== 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=SV40rYPgD+X79RHIP1LMFV+4ANzbM28sKQBKFTpL4f8=; b=fG/My538BoQjfU8UxJsETpWA4OGGa0ENFmbXRuuqR0iUyIDzXfDneBK4oR0dSCIGYL7F6wrr7Xqkg0ao1g59GlLFlR3GixfeM6Ira2fQzjIqD0BjqJHri22vGs0LrV/MTNI5XqyG8gmCDjPcnAJwHsH5o7RGYou6JrfhAi8A1cs= 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 OS3PR01MB5656.jpnprd01.prod.outlook.com (2603:1096:604:c6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Mon, 16 Oct 2023 01:37:48 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c%6]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 01:37:48 +0000 Message-ID: <87wmvnwdn8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 2/4] ASoC: audio-graph-card2: add CPU:Codec = N:M support User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Pierre-Louis Bossart , Mark Brown , Bard Liao , bard.liao@intel.com, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Jerome Brunet Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org In-Reply-To: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> References: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 16 Oct 2023 01:37:48 +0000 X-ClientProxiedBy: TYAPR01CA0078.jpnprd01.prod.outlook.com (2603:1096:404:2c::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_|OS3PR01MB5656:EE_ X-MS-Office365-Filtering-Correlation-Id: bccf219f-f39e-4df8-b08b-08dbcde880f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4B7jaxob9WE6EMdk/REnqBjOzk0ZuSbx7FuPzfNU816aksPrIHleWQVsKMjlMKnjrnZeMRD/bu+XSXd5JPlxWczN52lQLPHBzEwoo2FF+1cEc1/zNyQxvrBqVv7C4LshajXsfvuikHNvgenr6K/vnOWrKxVOP2tm5l9e1yUZfXTqGKunhZ/MRjALrN3Ak0EYbSMWql8JsuQq9CxihmTO+KUfpBXqoZXFJw0rtBKQBMWzE2KFLd37fkCdGnvIOHQbF1S0cKPRvBanFgOhZ3kMzfYmOynE1AtTjrGjt0FQOWgbUFL3O4/l/70GoMRZwSQkTb2FdhzprVqOXzosnMZsjEEo3pOsSCaqMN+sdzdpbvkMC/Xz7KSiDhV/X0BA/Nnpwx+paEg6ikfIqVtjexOHsgyyhaK3nlvoPHa8nnXLAiXJ4wxRWae6mcvh5iG1suLp1IZuq6m8DR1Sgl6AcAbNBD2xt2NNL9rqQoepOAzahBwupSJR5KieVbNIG8l8ewYEzQMBZr1UOUVy6junaORAqZ/V1LOIpqc1FQ9WeZBw7sOtJkDmfmJ4FF2sctdy7nRXa5cuN9p5PNBwNlqlRcvYDgOdBOZ3GT5Hwe9vDZLxbgbD3YA7s5cSmObXfD9l4LkXYxYd5ZDHfjGz3l3JlkSExw== 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:(13230031)(136003)(376002)(366004)(346002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(110136005)(316002)(66946007)(66556008)(66476007)(26005)(36756003)(38350700005)(52116002)(38100700002)(6512007)(2616005)(86362001)(6486002)(478600001)(2013699003)(6506007)(41300700001)(5660300002)(7416002)(2906002)(4326008)(8676002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O5BjMxaFsn0uHPclFAemdPnk7OLjpt4Dk01LXw1+yPwlAwfp+gu8JA03F1f0brQhTTSEgClmkEMeCYY/f05Jxp/XAFMz5o3hhLE3WN8m52d6Mxr4r1Mp4Bi7B8hvkS1hodlHLLSK7QXp4DlUH8quqR3JMeEUBZ5Enu/aNeqgWJMh00shWaRXg62wudDeaH+SO0ZrVpwMHCPDdMrqcq2iDl+4IhyvtZ8gPdBwHCiDyQyUfxV4WhBgyOFMyBeWWMOAbXsslS2s9kYU/eUvKADH0uL+QqCfn8owiIqggwCMU/xWamkMpJGQR/bR6eDJcovbg/HWLse8iv0c89Nlr2U0zp1wiD9UN8neaRAisjMJbPD50Ora7tN2Ni3bIxOpMyfwLvFwtgNzDGjMrbHCkH9dhm6AsS0cGH+h5kurCJxrjPNQtOTxSAwsj5sITcQDH0lRL/3wN6gh6ri27oCNJEBMJRP2sg2YjStb9x6115E1sKoVnTRIDHEer/LpbeFAXcCcSI8RMK/fZPZpSFIDcYHrBa+EeM8z9LGkTwpdoEw9uKoRZcjMGrTSTxV9kJOfH9wrg4GhahAEp0vppOfjyugFoc66V4W0YCDScg65TzijRsl/XoJyDbShD3eVMUOFLR1UhfzoHvxB9hQBs/bDaZqBUojIoTSd9DpA2wlLCinEIVMyrWHlvZ4dPeWSbclq3/Ult/li7d/9PrP+3PmWbBz3j1WFgtQbUUSI95UEy4aeFaEqItKkv4grFtp/BmU5/D8E/e6RJ0v01H9ZhYj8V7nHckFL9j+CmR7iviLjsImUlrDH3f1bVSu9gHvUUjji+gZQLG0+So0fG6I3UZolCMDgUhcoe8nl8qVzFbnUcXfKbS6xQCs8FCGfQVPJROR24UMJUAQrhv6FE6z/vwwTIh1Vl09KXuMKr3lFKX7Ygv4SsZ5jjeENgSy2rifvxhNHKMXASg4NY1r2SppzGqdD1wEJd+hmKeXpMrIWlC/GzJ1TSEL4bbOpi/A3COEkpGkG0zNHA6oTDmqykN7V1gFDWgyQZLPYL+8zJA+Ec8JRoF9O6y7X0OAXwT/r9UHPRCYB4bI7n9hOiYKPhAOJfxaoumgY4yLDmeioyGtsdmDl7ydoxtjgA25ybAahBNLugO7CqE+PAii+BYzxhnWItQkJt/q3swwDrOeeXVXmsGfgxmkO6J38AeyN1eIEpKo25HUDU1vtbJUc36639Gc7v+PmjHd6aq+0lGGqjhph+1sKCz0lWiYpxmexwqBpMEH/now46O6BA1FFqcwmyyCvW7ITVydkIxe4s6OIyBYYWNknfLBMyVo8vYDp8wQYDvpHnM8Of9oB+6z/CMkkkmw4MEi9+kVlqUlEC83JSShpSzLVa182aO0F+gIWHyqR2ZLq1OBbeyS5vEhTurEMy8Ble1CnCjMMULebB3xzfhnV1sqVS8X0A38aqRPAPkmUebG0gHqlqTIWxIjhloaSp5M4f6cawL4LZc5xzESlfQm6kuRTZZa/iqsu3D7RO4Ok4spePZ25qCDIW6U1SzsucvaYOkzeNQZBWndcpovyE1KlAA9zxN8eyYHAVb2DkZNqfA/rdo/BfFTT4yWjuiobN0EBwHjueaEXBLz8uHp8IWo0G91mLD0+Rbk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bccf219f-f39e-4df8-b08b-08dbcde880f0 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 01:37:48.4263 (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: j1kPiYN6JypCBl9JiwadpdFgADrMwMyHqSgdaRXbmHACuIqlwbvt00gmGioOXM3rtibvFivHJTYwhOvermVimMaiaO9tbQ6gDy61NeymbUfUFxjMJZqaZWoY7lJeISfG X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5656 Message-ID-Hash: 3BJ7SL2AF6CEU3GDGYFGVYYFYNHFPACH X-Message-ID-Hash: 3BJ7SL2AF6CEU3GDGYFGVYYFYNHFPACH 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: Now ASoC is supporting CPU:Codec = N:M support. This patch enables it on Audio Graph Card2. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 5d856942bcae..bd65e7a19350 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -515,7 +515,10 @@ static int graph_parse_node(struct simple_util_priv *priv, int ret = 0; if (graph_lnk_is_multi(port)) { + struct device_node *ports = of_get_parent(port); int idx; + int num; + char *props = "ch-maps"; of_node_get(port); @@ -530,6 +533,32 @@ static int graph_parse_node(struct simple_util_priv *priv, if (ret < 0) break; } + + /* read "ch-maps" property if exist */ + num = of_property_count_elems_of_size(ports, props, sizeof(u32)); + if (num > 0) { + struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); + struct device *dev = simple_priv_to_dev(priv); + struct snd_soc_dai_link_ch_map *ch_maps = devm_kcalloc(dev, num, sizeof(*ch_maps), GFP_KERNEL); + int *temp = devm_kcalloc(dev, num, sizeof(int), GFP_KERNEL); + int i; + + if (!ch_maps || !temp) { + ret = -ENOMEM; + goto multi_end; + } + + ret = of_property_read_u32_array(ports, props, temp, num); + if (ret < 0) + goto multi_end; + + dai_link->ch_maps = ch_maps; + for (i = 0; i < num; i++) + dai_link->ch_maps[i].connected_node = temp[i]; +multi_end: + devm_kfree(dev, temp); + } + of_node_put(ports); } else { /* Single CPU / Codec */ ep = port_to_endpoint(port); From patchwork Mon Oct 16 01:37: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: 13422379 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 4E61ECDB47E for ; Mon, 16 Oct 2023 01:40:10 +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 4FD9BE72; Mon, 16 Oct 2023 03:39:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4FD9BE72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697420408; bh=Wx4jcGMtPMzzFRvK9ibgwQXr3O3yEnRG1ZtKxyYVDKA=; 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=BnK29pD8nlmXzzPrY6gudVJH+EagUp/bZWdBrkkHhtF/MDeZnna7OQF/uaLR97MTX Av5c2/ITU923QAbPine+wY4J3iZA5yAHlgstDIkac+A6Cgc7JIAblWBqdL+JE+jqgM dM5m/sJJZ5EolpIdE7w822qyuPQSgv1QxsMxOx1M= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7FBB9F80564; Mon, 16 Oct 2023 03:38:17 +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 551F6F805B6; Mon, 16 Oct 2023 03:38:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44DD3F805B4; Mon, 16 Oct 2023 03:38:13 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20721.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::721]) (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 5F477F80564 for ; Mon, 16 Oct 2023 03:38:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5F477F80564 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=NeUaJgFy ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4ZRKbFnNjMs7XvA5ENUSgqN6avtVg8iEY1hFgfRjVGZmRft894BLR5qtEoq/gg9a7Z5zAGz3hN8R9tZGZNRuZ6DaljdY+IgvgMYecIP69EvXsi/OE4QNB/2BNkddVMy3QTERMJrJiEL8I63TwD5bzc+tjXvNtmG3fTZC7QZgJiuY9Kwai8JR9t1kdSZWPatX3PmSkb+t9ghB7zQ8JiOQunwwQfb42elBbNaTy2kqYNRaq82Ggs+BQhpibRpHS18fXgc121LEsc5PL2r0uhXOwRI22Ny2RS17ZJXgBnX0+qGLoWCNXPrL/m25AR3Bn3rKEsVGkyNtzkhCJvXIZU+BQ== 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=tT512XT52jyir/q0l5HhNTVHyna6Pz+ZH9H/R2a2fIw=; b=AoTHq+cxd4t3ZeXXRqIe9eGCxDOrf/NvMhGoW7Hollm30f+WB6wRGKv/OlL8f1pfoAWWCIsb93PhMxaH6cX3DeD8h0TME5K8m2qOpfWz+v39SrZFfv73H1tfniTdmVQMlFDDQOh8QLTKJmQ9NGLQAKTxat3tGZRR3mA7Y9nC8zOCZT/x7UW2J8oUmIV+2x85oxTwOUq3233z5dHQ8KAvv/ks/vQlMraepbf4ol+ePdTguX+DvSnI0rhbkOH7M5zcIi4lTrJIFO4aQBKT/MfqO0kyEvyQ/sndcnemKyVkK8o/+Ith3uiPfiP5BNcJEFbTP8DZ9caRYoNjrbOgv2oy3g== 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=tT512XT52jyir/q0l5HhNTVHyna6Pz+ZH9H/R2a2fIw=; b=NeUaJgFyTS1vfbrSww2HeAMyJuS3OaR0lc21cbl5nuqwCb630d1ZpX8ppXMdHmpwR6ow35j+7pGpFbxA+cOe7eic69MwBCjCiwooMXcgFHr3CQUp9gslADQbLdQWBxw7mRoxiGjxKH+fugU8AwKt6+00yTnZdCUVo4HpwIeXFfI= 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 OS3PR01MB5656.jpnprd01.prod.outlook.com (2603:1096:604:c6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Mon, 16 Oct 2023 01:37:53 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c%6]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 01:37:53 +0000 Message-ID: <87v8b7wdn3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 3/4] ASoC: audio-graph-card2-custom-sample: add CPU/Codec = N:M sample User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Pierre-Louis Bossart , Mark Brown , Bard Liao , bard.liao@intel.com, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Jerome Brunet Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org In-Reply-To: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> References: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 16 Oct 2023 01:37:53 +0000 X-ClientProxiedBy: TYCP286CA0012.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::16) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB5656:EE_ X-MS-Office365-Filtering-Correlation-Id: bdc49c8e-eefa-4fc0-b80b-08dbcde883df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: meHZvToCK/RJmyp3bIbeoeIivsU3jggTkicEMitfAw8GB/FQE/cyyGLQEKP6r2x05znI6CY9H33xe6AI568D+hFI/RDnvY+PUhqC8b5ICh1utMyqn8bU4ZX4Wh49WYfaRinN2l7WvbV4+eGPDPQjYAk0zebmo99PQuEOnWBo5ZYZjjHmOvUs61MGkBy1Eeskz2y84ZseUYMnDi08y8v+akKcbN59PF1YObto7KbNawdRRr3oHOUIii7P/drIuaP1lgGOvcgiOU5ORr0K2af5ZuosHDfQcC7jtZCM2FRVXM8lDiphWinMLxvA9mYAGEs3N9XUSE396/vXmx0GDVrI/vX7hf3Oo1mGUkcn7SmxPOWMb2Wvi29Lc3NTNcgoDnyxHMQR4nPvewB0dUQCC7UYIFACoAzLwGvbSkyQC3et5h1eJHGyGxZ3bpgdnh0CSUOkOLvXZU4KKPk2DQRWfzR0ukHmqWsHHdZAXxmkBGToZ9BidysWu9pW8kHEVIMYyYhnjSEQu/+1oHhE44KWolosUoYWrbfPOnWfuIDYA1XYjSYCoz0iV8Hygs1c1jcZRwwfkFsef8xG3I3fW0pF0EuoTpE6VHxsbk1mGQ6cEdBH3nx+UjIUj4jkNCAXLIXM564lqBywGR8hGy260aRsdvlFTA== 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:(13230031)(136003)(376002)(366004)(346002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(110136005)(316002)(66946007)(66556008)(66476007)(26005)(83380400001)(36756003)(38350700005)(52116002)(38100700002)(6512007)(2616005)(86362001)(6486002)(478600001)(2013699003)(6506007)(41300700001)(5660300002)(7416002)(2906002)(4326008)(8676002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gdVDQ18F7ODZEuPr+l/Au6g4f3+kWYdAvK3+KBq4rou6YIeWcXChOKIpHNS2OyU2dsXJL7wm20i0gF8S+N9Pw5PVm8+A0AR4KuMEVKEZf5Q1mZIL03Vv789DTaJSzSryHSBFjqwJG10owY7EOubX/LMKBvhX/qEHPT69moavYu6eQUiNzh90dmKvXhIg9KC6ZVcwNER8tjDXExl2DAHRSJ3lQrWDLzIJ/QunNHuwQ2evl6fqGv4rp0VE5WcJDlPH/M4h7fIfrvs7dUUIRYTUXVjhOmfJyApwJy6r5x/imnwl8ywNGpYxeTAa66O6RTXVovMa4NspKZTPbnDi/5hxkBg+eQCLRxxP3Vz9xU22wPOUnfQEIxX8BTROY9qnTui1VuDQ/y9vU62hSyZAn5OhceLoyRyQ5H2RykGI6V8PPaPx4pV3fLvK2yEzorqlAtiUzBQxcUcRvbEzcINSiYPJc76B4DwFbh8CKjLV9sliNN7nh5gwxIde29WG05cl4gYhCAR/RAyOaKtSQPLkRrt6+yBbdtzoeH7DBSDqB1vnzv3DIcZ7P/wFaw3loA5YBYeoagP1ses8RuBsPbanY9owm256AGdTQc54QqQDKS654EfC4Vry24KrRWwJF2SkwC0eL85gKIFBX9zX/wgouz20TRkpbQV1bxcWC6Cb6leOx4sK9EnCxhwuVB/a7LaKb6quDnnQ9Nr51pmXEe7UNDGYassQmYsPc24hMK7qllbVBAF64Xvy+EXGKtJw8L1kMQVCOr960tq4aaXQ8e2l0wBA5QJ7qras0sfBxjrz7Snbd27XZCa9U8LVG8y4bCuvoGH6QIcXuzqAjGmwsAYZO7kykI23O9ZMH8d23wnAMZngeZ0XWv1H7LWJnOCgRCJSFPmX6uixS54OcrlhB+upr6nUJ92LeWug4igrrUIGARuAbr2xntWGZT0f9KnDTtoUFOQeUDv5qaIpVu4oX4LQ3YLgwAJ6VfAJEwTVzQkvtZWSz/tNnwF9AoYxga3m8TGNcY9AiPXMZpuEtIO4P6lhg7BqwM1RwWxcp/+Dlp4hHTPBbhtC0Zle31GbspFN7QiPg5ptcIbl8+ytZN2nmZZB7mLPsHuoNzB4eCCTAAZ0gM+TZ6YnvOlzYfJYrbfnDpYggQaPQmpwsiGbv77unNDW7rbSnWTtx5TBMn5Zs35itOovKGprgwY2bPKzAmb4hzrcvVj/LzBnSv+0nqdrQHNdv6EUJkXLSgWgAvMT/ptjoxxAEruH99Gs6sshCC5bXp8ZfQ23SCWgGpBqlzQwvKcTTUNWe4EyMMq2aGiOOICfpvpHi5QiMyh8656Bj61+0opyeIiI+5czNrWljQzxKzooRapZGDzdKcZss2zl/et69m6iPwK4fTJlEyTPOLbxpMMeWocNxfgQIpPotFeztEV/TVjk4V1Idmz7xMExNy7Pz/Xa00usaL8TrpSI+hpgePhI19Y0ohlE2ksuagFVUTSBVvvgoWwaFhDu82tZNr7YIX6SlTKNvy9zbb4WqNAtbveJF5iY1g/JP5wKUBM8PuOzWO4lHtmi2FmRT61/CjY/+3ekNPOEKXKAz5e71cT4JKBLAmN7Mz2ZU3eJifnuyJ1K3hUFy3FeKBGdH9E+58HxaxQkO7M= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdc49c8e-eefa-4fc0-b80b-08dbcde883df X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 01:37:53.3305 (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: p60n+iAe/X8wf9mNAJGJv0Xq4s8ysfi3ZLFfM0BkHdqtnE0w+GDRiJsSObF+ifJJNo2NBM8iNzLY0wD1rbOCEqjv9cB1li4G3hI5wuRqif361e7GkwNVEX9kP9NAmsMj X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5656 Message-ID-Hash: 7WSHZOYMFKHA4DZUZBIQ3STSLYHA2VIG X-Message-ID-Hash: 7WSHZOYMFKHA4DZUZBIQ3STSLYHA2VIG 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: Now ASoC is supporting CPU/Codec = N:M connection. This patch adds its sample settings. But One note here is that it has many type of samples, it reached to maximum of sound minor number. Therefore, new sample is disabled so far. If you want to try it, you need to disable some other one instead. Signed-off-by: Kuninori Morimoto --- .../audio-graph-card2-custom-sample.dtsi | 138 +++++++++++++++--- 1 file changed, 121 insertions(+), 17 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi index 8acaa2ddb335..14d638de120a 100644 --- a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi +++ b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi @@ -58,12 +58,32 @@ / { * | |-> codec13 * +-+ * - * [Multi-CPU/Codec] + * [Multi-CPU/Codec-0] * +-+ +-+ * cpu1 <--| |<-@--------->| |-> codec1 * cpu2 <--| | | |-> codec2 * +-+ +-+ * + * [Multi-CPU/Codec-1] + * About ch-map (*), see + * soc-core.c :: [dai_link->ch_maps Image sample] + * + * +-+ +-+ + * cpu8 <--| |<-@--------->| |-> codec14 [0]codec14 <---> [0]cpu8 + * cpu9 <--| | | |-> codec15 [1]codec15 <-+-> [1]cpu9 + * +-+ | |-> codec16 [2]codec16 <-/ + * +-+ (*) ch-map = [0, 1, 1] + * + * [Multi-CPU/Codec-2] + * About ch-map (*), see + * soc-core.c :: [dai_link->ch_maps Image sample] + * + * +-+ +-+ + * cpu10 <-| |<-@--------->| |-> codec17 [1]cpu11 <---> [0]codec17 + * cpu11 <-| | | |-> codec18 [0]cpu10 <-+-> [1]codec18 + * cpu12 <-| | +-+ [2]cpu12 <-/ + * +-+ (*) ch-map = [1, 0, 1] + * * [DPCM] * * CPU3/CPU4 are converting rate to 44100 @@ -144,15 +164,38 @@ audio-graph-card2-custom-sample { */ &cpu0 - /* [Semi-Multi] */ + /* + * [Semi-Multi] + * cpu7/codec12/codec13 + */ &sm0 /* - * [Multi-CPU/Codec]: cpu side only + * [Multi-CPU/Codec-0]: cpu side only * cpu1/cpu2/codec1/codec2 */ &mcpu0 + /* + * [Multi-CPU/Codec-1]: cpu side only + * cpu8/cpu9/codec14/codec15/codec16 + * + * Because it will reach to the maximum of sound minor number, + * disable it so far. + * If you want to try it, please disable some other one instead. + */ + //&mcpu1 + + /* + * [Multi-CPU/Codec-2]: cpu side only + * cpu10/cpu11/cpu12/codec17/codec18 + * + * Because it will reach to the maximum of sound minor number, + * disable it so far. + * If you want to try it, please disable some other one instead. + */ + //&mcpu2 + /* * [DPCM]: both FE / BE * cpu3/cpu4/codec3 @@ -182,24 +225,24 @@ multi { #address-cells = <1>; #size-cells = <0>; + /* [Multi-CPU-0] */ ports@0 { reg = <0>; #address-cells = <1>; #size-cells = <0>; - /* [Multi-CPU] */ - mcpu0: port@0 { reg = <0>; mcpu0_ep: endpoint { remote-endpoint = <&mcodec0_ep>; }; }; - port@1 { reg = <1>; mcpu1_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; }; - port@2 { reg = <2>; mcpu2_ep: endpoint { remote-endpoint = <&cpu2_ep>; }; }; + mcpu0: port@0 { reg = <0>; mcpu00_ep: endpoint { remote-endpoint = <&mcodec00_ep>; }; }; + port@1 { reg = <1>; mcpu01_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; }; + port@2 { reg = <2>; mcpu02_ep: endpoint { remote-endpoint = <&cpu2_ep>; }; }; }; - /* [Multi-Codec] */ + /* [Multi-Codec-0] */ ports@1 { reg = <1>; #address-cells = <1>; #size-cells = <0>; - port@0 { reg = <0>; mcodec0_ep: endpoint { remote-endpoint = <&mcpu0_ep>; }; }; - port@1 { reg = <1>; mcodec1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; }; - port@2 { reg = <2>; mcodec2_ep: endpoint { remote-endpoint = <&codec2_ep>; }; }; + port@0 { reg = <0>; mcodec00_ep: endpoint { remote-endpoint = <&mcpu00_ep>; }; }; + port@1 { reg = <1>; mcodec01_ep: endpoint { remote-endpoint = <&codec1_ep>; }; }; + port@2 { reg = <2>; mcodec02_ep: endpoint { remote-endpoint = <&codec2_ep>; }; }; }; /* [DPCM-Multi]::BE */ @@ -241,6 +284,50 @@ ports@5 { port@1 { reg = <1>; smcodec1_ep: endpoint { remote-endpoint = <&codec12_ep>; }; }; port@2 { reg = <2>; smcodec2_ep: endpoint { remote-endpoint = <&codec13_ep>; }; }; }; + + /* [Multi-CPU-1] */ + ports@6 { + reg = <6>; + #address-cells = <1>; + #size-cells = <0>; + mcpu1: port@0 { reg = <0>; mcpu10_ep: endpoint { remote-endpoint = <&mcodec10_ep>; }; }; + port@1 { reg = <1>; mcpu11_ep: endpoint { remote-endpoint = <&cpu8_ep>; }; }; + port@2 { reg = <2>; mcpu12_ep: endpoint { remote-endpoint = <&cpu9_ep>; }; }; + }; + + /* [Multi-Codec-1] */ + ports@7 { + reg = <7>; + ch-maps = <0 1 1>; /* see [Multi-CPU/Codec-1] */ + #address-cells = <1>; + #size-cells = <0>; + port@0 { reg = <0>; mcodec10_ep: endpoint { remote-endpoint = <&mcpu10_ep>; }; }; + port@1 { reg = <1>; mcodec11_ep: endpoint { remote-endpoint = <&codec14_ep>; }; }; + port@2 { reg = <2>; mcodec12_ep: endpoint { remote-endpoint = <&codec15_ep>; }; }; + port@3 { reg = <3>; mcodec13_ep: endpoint { remote-endpoint = <&codec16_ep>; }; }; + }; + + /* [Multi-CPU-2] */ + ports@8 { + reg = <8>; + ch-maps = <1 0 1>; /* see [Multi-CPU/Codec-2] */ + #address-cells = <1>; + #size-cells = <0>; + mcpu2: port@0 { reg = <0>; mcpu20_ep: endpoint { remote-endpoint = <&mcodec20_ep>; }; }; + port@1 { reg = <1>; mcpu21_ep: endpoint { remote-endpoint = <&cpu10_ep>; }; }; + port@2 { reg = <2>; mcpu22_ep: endpoint { remote-endpoint = <&cpu11_ep>; }; }; + port@3 { reg = <3>; mcpu23_ep: endpoint { remote-endpoint = <&cpu12_ep>; }; }; + }; + + /* [Multi-Codec-2] */ + ports@9 { + reg = <9>; + #address-cells = <1>; + #size-cells = <0>; + port@0 { reg = <0>; mcodec20_ep: endpoint { remote-endpoint = <&mcpu20_ep>; }; }; + port@1 { reg = <1>; mcodec21_ep: endpoint { remote-endpoint = <&codec17_ep>; }; }; + port@2 { reg = <2>; mcodec22_ep: endpoint { remote-endpoint = <&codec18_ep>; }; }; + }; }; dpcm { @@ -323,9 +410,9 @@ ports { /* [Normal] */ cpu0: port@0 { reg = <0>; cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; }; - /* [Multi-CPU] */ - port@1 { reg = <1>; cpu1_ep: endpoint { remote-endpoint = <&mcpu1_ep>; }; }; - port@2 { reg = <2>; cpu2_ep: endpoint { remote-endpoint = <&mcpu2_ep>; }; }; + /* [Multi-CPU-0] */ + port@1 { reg = <1>; cpu1_ep: endpoint { remote-endpoint = <&mcpu01_ep>; }; }; + port@2 { reg = <2>; cpu2_ep: endpoint { remote-endpoint = <&mcpu02_ep>; }; }; /* [DPCM]::FE */ port@3 { reg = <3>; cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; }; @@ -337,6 +424,15 @@ ports { /* [Semi-Multi] */ sm0: port@7 { reg = <7>; cpu7_ep: endpoint { remote-endpoint = <&smcodec0_ep>; }; }; + + /* [Multi-CPU-1] */ + port@8 { reg = <8>; cpu8_ep: endpoint { remote-endpoint = <&mcpu11_ep>; }; }; + port@9 { reg = <9>; cpu9_ep: endpoint { remote-endpoint = <&mcpu12_ep>; }; }; + + /* [Multi-CPU-2] */ + port@a { reg = <10>; cpu10_ep: endpoint { remote-endpoint = <&mcpu21_ep>; }; }; + port@b { reg = <11>; cpu11_ep: endpoint { remote-endpoint = <&mcpu22_ep>; }; }; + port@c { reg = <12>; cpu12_ep: endpoint { remote-endpoint = <&mcpu23_ep>; }; }; }; }; @@ -363,9 +459,9 @@ ports { /* [Normal] */ port@0 { reg = <0>; codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; }; - /* [Multi-Codec] */ - port@1 { reg = <1>; codec1_ep: endpoint { remote-endpoint = <&mcodec1_ep>; }; }; - port@2 { reg = <2>; codec2_ep: endpoint { remote-endpoint = <&mcodec2_ep>; }; }; + /* [Multi-Codec-0] */ + port@1 { reg = <1>; codec1_ep: endpoint { remote-endpoint = <&mcodec01_ep>; }; }; + port@2 { reg = <2>; codec2_ep: endpoint { remote-endpoint = <&mcodec02_ep>; }; }; /* [DPCM]::BE */ port@3 { @@ -395,6 +491,14 @@ port@3 { port@c { reg = <12>; codec12_ep: endpoint { remote-endpoint = <&smcodec1_ep>; }; }; port@d { reg = <13>; codec13_ep: endpoint { remote-endpoint = <&smcodec2_ep>; }; }; + /* [Multi-Codec-1] */ + port@e { reg = <14>; codec14_ep: endpoint { remote-endpoint = <&mcodec11_ep>; }; }; + port@f { reg = <15>; codec15_ep: endpoint { remote-endpoint = <&mcodec12_ep>; }; }; + port@10 { reg = <16>; codec16_ep: endpoint { remote-endpoint = <&mcodec13_ep>; }; }; + + /* [Multi-Codec-2] */ + port@11 { reg = <17>; codec17_ep: endpoint { remote-endpoint = <&mcodec21_ep>; }; }; + port@12 { reg = <18>; codec18_ep: endpoint { remote-endpoint = <&mcodec22_ep>; }; }; }; }; }; From patchwork Mon Oct 16 01:37:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13422378 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 C61D6CDB47E for ; Mon, 16 Oct 2023 01:39:50 +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 E4CE8E0F; Mon, 16 Oct 2023 03:38:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E4CE8E0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1697420389; bh=bR57EnMuGEM/YDvdvfC/IdXVhUjttjJshGIr6LKwcv0=; 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=NY9PGwLgGItGYfd+8py3bwnnp76qHDapa/N5kgvWIi26L12GiVy4ZDpQPQwGsSfdW q8O88HQm5c9dlx/bLbuKamoxxRvSL3cKAR6yTGwDcmA1ZugeUvsEhWVZZrsxO95vNE Xe0paK5jDsMytN4d/+oGyISFN8/L1XM7eUWqDbyY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30523F805A0; Mon, 16 Oct 2023 03:38:12 +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 C6646F805A1; Mon, 16 Oct 2023 03:38:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5908EF8056F; Mon, 16 Oct 2023 03:38:06 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20721.outbound.protection.outlook.com [IPv6:2a01:111:f403:700c::721]) (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 3800CF8024E for ; Mon, 16 Oct 2023 03:38:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3800CF8024E 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=p2eFOfcU ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XRnfK0rPP0sIj3gOZyljHhyox6jpIJnkOkAkC1Jk/wQeb4kL7VAJmdbe3bFgdSNhyIWK57ikmWp2Ye8QOAqVoRmRswgpQwUpFuExhiPdlNirUGgSleQT6cDs2PR3FdaOYl/KSl+cs+QhoLT94xb9Tk5leS63CGNrP7u5GQjyIhiwz9kZZxgB+8cDjfaGTpZlEv6qi6zchgGbViLTxiZj25n7oZKiTXOl3/fZqMSsVT7OAhEtcJ9E/MrN6vmgyw+2W/2JhU/R6wqIK1xSGad3FJ5BnsGpw+IrkB3xfXF3fTKOWbUXfOqQqOH6S/I5rZBONzA2VFc5Ll0qcaQlvryPzA== 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=VYmXm9T2vC4fO/F5co+2dN94BAsJPw/XSFjbixCUtUo=; b=YtM3zO5Id1FMv8AvRCIKntlncozb4cGTznOO/xM0KXdFL+k1ZUvPiYAhX+2xGtDjmw7AGuJc+nIgQSMErD2mX+u6C5XBKxH8XrPdAPfg3T7+8RaiYVkV2dylmhpYmjqYs0VXwkxvjnGEwL4JcQm3RkCOa7DD+4qVDc0Oip1o8aN7o1k9RZ8MapWpFgJjL5+Z3ppHQsennc63NkBg5vAUde9l0sUh/OwZYgFr4rT+xAEF+VX1HUiI8+TjNar5zMCuoPVAEBJBoEZti0/yXcz2zBW/4nN28dp4pc84RtAIVy5DVyBAHVoTrstv1nSmzN9i2OM+58y79AN3tI6PA1gRMw== 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=VYmXm9T2vC4fO/F5co+2dN94BAsJPw/XSFjbixCUtUo=; b=p2eFOfcUUpVMiTLU60oxGGfHxzkZQfHmpeqd1ga6zOJTgL4J52HJlzW1Decfjpevct6lVf/ohZMfNOK3Aqm0YGkaMRchL0mgAlalCvQmZ/wqTzu/OC3qsGb4rDAr2icNX238sZunBrlOznhEf42yOqLTHFozVIC9jdFbMi+ivCs= 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 OS3PR01MB5656.jpnprd01.prod.outlook.com (2603:1096:604:c6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.34; Mon, 16 Oct 2023 01:37:59 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::d2a3:45df:a180:595c%6]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 01:37:59 +0000 Message-ID: <87ttqrwdmw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 4/4] dt-bindings: audio-graph-port: add ch-maps property User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: Pierre-Louis Bossart , Mark Brown , Bard Liao , bard.liao@intel.com, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Jerome Brunet Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org In-Reply-To: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> References: <87zg0jwdnz.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 16 Oct 2023 01:37:59 +0000 X-ClientProxiedBy: TYCP286CA0115.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::19) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB5656:EE_ X-MS-Office365-Filtering-Correlation-Id: 3320983e-0489-41cb-f1d6-08dbcde887a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aO2DadeAn85IdtfziHIZqeCPHgAt9iwZQsBH1keFx+H2ZScQ9bU7kNMXEiGk7c7EbkRieg28N6w1FZ+mogQKSWoDRo7PgbuGbBqpRBbV5Uo0Rgau+ru+Y7J4IhFJONne30yLSVNrcIaLvsosSeXVQM4xNFs8KamY6Cyahs6PPLl1hsAfl+6VE31vwIwtihTSM07GhfF1FQ6cbfyc7eyUxX3uGAi8fNM1Hgu9qHS/aa6NgonWgmnM13NHJNkyWPhmPPyB0NIaRzBg37vOBa3VsIlmALomI1oee30JTngx4fJFV2LA9mimB4dkJZXMpb7f7RP1pXS9MuTAWR/2XHeWHTPS3Qm52JFT9ytvk1XVBBn9gK2sSBvecYHMsKIm5USiM0uPGddXro9Ip1ibcBIHTtkc8k5Z1n0hW0d+uNJuUtPJWQZiWA5x+haIQgCoOM0cXaKTqdAufJf2z3k5Dmhj5CqhnNIWxLRokhhpq4sZcO8gfBldNiDJlsn3vM8ZTmgO948Pv39McnZJWiOXcX76XGixcS07lyDw51bhDDGUCkyNafEPBNOUkvdG107q7IIz6/oxtjDE/JcgBeWEVWDNIXR+dMtDetyTrx5dqgIl9VHli5jMcmc9u96Maa/22ZBI4sYbJUN4Lr/iybUaVRhqmg== 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:(13230031)(136003)(376002)(366004)(346002)(396003)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(110136005)(316002)(66946007)(66556008)(66476007)(26005)(83380400001)(36756003)(38350700005)(52116002)(38100700002)(6512007)(2616005)(86362001)(6486002)(478600001)(2013699003)(6506007)(41300700001)(5660300002)(7416002)(2906002)(4326008)(8676002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uv3S19bpzbCrQOFy1LN33zHTlp4u2iDOzthwVaZP/Q9IpZ5AysUYktmMyCNK5Dw6sfVt+vJIy0sJvrZ3X6v1bvxKgemPsTAj/KUxMCrehwCYZYn7rBSqsSIII51f0HTRvBJxEDijQQ9PujvVY0oOv5yjrcB9xreFa6UOqjczltEEYlDz2URs8xs5YeEEMNEY61T8iHcJN3ViK4UfgyzQCHOev2bgRDK0khlpeofXgck3YIF4X5g82b8QStO2XDzRQW9Gufv0b/SsZH9BImERTZCmKXlSSZl0OHlihvmf31ISvJodZDs6Yb+ciFtjnNRLt2xombTtwXjD7BSHu3kQWAfgXu+ziToUMS7qGbKKJKMKIHUu+t0h+lk2E5/Ylzfmyx2t/HWotlgm9TRrDK9Yc7iX3R6z3Eu26llXCR3RN13EeBHYrP1JSMUvsVhzfStzbv+FGCryxEcHvALcaft17U9AY66wNJ/3lNnwlCEUqKLuBJ6osXsns6bretaGxP7qozUq7gQT822uNNGxU0ePIckxE4b9dYyzVYxtyelzsQ7hQ1XTVEnNKwVDx8eluBOecLC3IuyBdobbCLBOt9DQBZytpjkrKmtf0ABhGvPHo4NpKVYBpPmIltIUZGupB2W5xFQe75n//g1+NWAq9EbGjFLuqTZoKBQ/YZzffB3fLYmaeUvx5f4R9GvHNGvxGTc74wX+2cXjr5D97MqVCvsOOhmHdR1XC42TR1wGF5s8PjdFgg08FaAKC8UJCDifgzFegeVnDklLP1zQMCOJtSYpQfNaAi9Y1XMAREX5F6UzURrzSlSCL6+TGVYzxKa4rISflCtW426U2xjuV0XrMhD+cUFTwNKq15SOrWNh18mwKp/32UJPh0+mr7m5tr2QEBLDotOYfOJk2OzXMSXk4d/5bHWmn8A/1BacuKgi9IJLqTxDVhrrq0eowGYtrYFi+N41vd8leUEk5bSgORpj3Mx3d1AYhG/65QRmcrxPfU5cbzp13kot+7sFA9o+d2scNnQWnQbHazAsS2+AtjN50UNQ6c5CyxZ93RT8oPsWHdC9jR9wyEUGwh1igp/LGlOr2y8j48Rt4QswV9pegqZOU+qgytqgTwYdyt7sVYwPwuZkui+iM1541C/oXXHZ+k17qxPjFz3XwJ9LHnt36nc2fxle/xSCUpOlOBlVIp787RSbyVq2cc/m0FGCImpsit9pwXDwLFZAcd+gK1/alyDT3UO1z9dAF95+ciILrHimR7AZM8CZlZc7DUuyzpfE9wOuhfku7gbeieBfYhNpuaqBwuTTrR0fKu0rQsEckXGcYQYf/qBS1Rjha6v0szZW5QolIg/4f/JQRrWLA54nuEsOgy8pyITIZl/P8S2PsV9N+ItuPJnUBVh7Ce5a4piIkjeHDogBd38DCPhvqiSxbesgyb5BihhEEZAD0XQ01Y/McWEkji5mACIXqxc4sIvMGxuljgi0Y5dn8Q4LXQz/stnLNcPdGPxCk9gKBhgxwUiCOVKa+Qu8jpxRY3h5dQSMYkvmehLhXPwPC6viOPGSTfpK0f6HCszWXBxOF2oV+YLyvMRA9aUJn1pv45bxRDTPhWKhUZTnbnnXDc/Mnnl+ShMxV0wnFjydxzyDqTsYaomihLrCcFE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3320983e-0489-41cb-f1d6-08dbcde887a2 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 01:37:59.5833 (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: N1ammdu1IGnfk/cNSzyl0UJWoQC0FAKux4Z4mWRuL2kKPeyQdjtWsywVELT7ZQx1Dzqa36/EKlGFnR78plglLcqdUZs3EUZv/ZxnxJoCWtn/m+ZsdXdBcpRcn2K0Iasm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5656 Message-ID-Hash: YRWG6H66VIBL3WSP2GW5MCBR7ZTTNA3M X-Message-ID-Hash: YRWG6H66VIBL3WSP2GW5MCBR7ZTTNA3M 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: This patch adds ch-maps property to enable handling CPU:Codec = N:M connection. Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/sound/audio-graph-port.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 60b5e3fd1115..1f7005356efb 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -19,7 +19,13 @@ definitions: properties: mclk-fs: $ref: simple-card.yaml#/definitions/mclk-fs - + ch-maps: + description: It indicates how CPU / Codec DAIs are related if number of CPU(N) / Codec(M) + DAIs were not same in one dai-link. ch-maps is not needed if the numbers were 1:M or N:1 + or N=M. If N <= M case, ch-maps indicates connection from CPU, if N > M case,ch-maps + indicates connection from Codec. + ${LINUX}/sound/soc/generic/audio-graph-card2-custom-sample.dtsi is good sample. + $ref: /schemas/types.yaml#/definitions/uint32-array endpoint-base: allOf: - $ref: /schemas/graph.yaml#/$defs/endpoint-base