From patchwork Thu Apr 18 04:12:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13634106 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2060.outbound.protection.outlook.com [40.107.113.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F32E4F1E4; Thu, 18 Apr 2024 04:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713413570; cv=fail; b=resFnqFtuHUjxMPkIlaVxqRyxgulMzp3stf1a979O79yGPtspYnATfgTGdTKY1bRy8y9ZjFxZPn0RiF/Dknw5NatoeRJidzRvUuBxs/mlOvuCjKwi4HIQajeLBjvZ1Vni6bHuADxfQ4LQs63rooxec35Fj5EgJroyY6SwM6mT1o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713413570; c=relaxed/simple; bh=YVxxdhcsHQXh5VL017QkFral1s7wACj+4XyqcnB9fW0=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=d6nKIqTw0GAD+tBMZ7fyI3L3ThpaofkkEjXimgfgXBlzmTyo43OxCFKboenn3BBl/vZwGgmkEtFLbyVxoeT2UvNd1ak9o8FrcWWrFxgC5vgG5+MgpiOSTexWL5fl5z4Js5qEb0rpV+DJ85DPvGInM2+3mv2kWXKzloogZARNfFQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=YejqV/Ys; arc=fail smtp.client-ip=40.107.113.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="YejqV/Ys" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d842Szy3u143wZd/ckgDiwnr7f4IM+/fhM/nSvndHnH+nJ/S4t4vpr9jAYvaXJqS39WcDv5YEDvKJAqTqPwsP2HrRoMmHxCeIkoNhDLFH231J3b3ZaUaeQciv12k3iGjDXdpzT4mEE2r1aFJ/EhqTfGdeMfN2G9amtLTEXk5xqyVCpI1wVBzfSYTp4IR8AtRBLyvlVdv1cHyJQsVyaETi6Aimc0ZgFhR9MgETMdP/eQo0uTkJxu7J7PHn3+SG0MXH6EdH2WBcDYP9s3GC4oA+oz5a8AHZztWHanm0nfZOCHtTYnosNLJFZojvfv+fYmm9Feqm1SblH5OHdO42gYE6A== 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=IBlL+5+aQgORxspXuZ3PMztQjyniD7+zmAzY/t9sA8M=; b=ikK22jzXoeQb39WGRvPwxHuClYbDX39Sw8RkgKBU+vM7TXG9BV3IiTrDNWnz3h/AhgyhK91j+7cBvosUT+QTmo3convZAubYOBUwQ9gPWR5B5qG4VsHpMPCyjlEYZVhUsk9EqOAOSSfIRv0KK9vlKv/8bNtYTxdjZRcmzlHE5vx59atrUDZ1FF7bQ3ruNfhQoqfosGC6QRRjRsoGRHQ/uR/Mbe1yj57wlFHJvoJuDh+GX9PkENRQ+HVjfMVdvLvfhpoUOy7Mox1PMfDe7njhA4dJWp0kXJQsxRJctcTb3P4T2z2gCIFPvLuQs0RgPCt0M3gyvRUfU0QtrsZt7czZlg== 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=IBlL+5+aQgORxspXuZ3PMztQjyniD7+zmAzY/t9sA8M=; b=YejqV/YsHGjOhE6FQp6BKjvrb0X+aNyBKQB1n04tSwffmgKlZrA0iTwJv6vljwEDVQzBaSKqaiY5kArmLzHW++Hn8cWU8dw9rOrcf5Bsr1JsAhUINQcZnHE2xqC3LCuimd2aOS189HHchci+GOqQJDmFp16ChR258b9uWuuXBGs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OSAPR01MB7397.jpnprd01.prod.outlook.com (2603:1096:604:142::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.39; Thu, 18 Apr 2024 04:12:44 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7472.037; Thu, 18 Apr 2024 04:12:44 +0000 Message-ID: <87cyqn8g1v.wl-kuninori.morimoto.gx@renesas.com> To: =?iso-8859-2?q?=22Amadeusz_S=B3awi=F1ski=22?= , Alexandre Belloni , Alper Nebi Yasak , AngeloGioacchino Del Regno , Banajit Goswami , Bard Liao , Brent Lu , Cezary Rojewski , Charles Keepax , Claudiu Beznea , Cristian Ciocaltea , Daniel Baluta , Hans de Goede , Jaroslav Kysela , Jerome Brunet , Jiawei Wang , Jonathan Corbet , Kai Vehmanen , Kevin Hilman , Liam Girdwood , Mark Brown , Maso Huang , Matthias Brugger , Neil Armstrong , Nicolas Ferre , Peter Ujfalusi , Pierre-Louis Bossart , Ranjani Sridharan , Sascha Hauer , Shawn Guo , Shengjiu Wang , Srinivas Kandagatla , Sylwester Nawrocki , Takashi Iwai , Vinod Koul , Xiubo Li , alsa-devel@alsa-project.org, imx@lists.linux.dev, linux-doc@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87h6fz8g3u.wl-kuninori.morimoto.gx@renesas.com> References: <87h6fz8g3u.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 03/23] ASoC: soc-dai: remove snd_soc_dai_link_set_capabilities() Date: Thu, 18 Apr 2024 04:12:44 +0000 X-ClientProxiedBy: TYCP286CA0361.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:79::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSAPR01MB7397:EE_ X-MS-Office365-Filtering-Correlation-Id: 8343c1f4-547a-47e1-b097-08dc5f5dcc6e X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fuYgztyETMSi8xfPt2uLtRU2ZQhvrXU9LX2vdGYMd9kh5g4gaoUHnFAaVoViJK5IFeeaTUDjRD91Ozu5JAkAMbpop5g3tCJGzP7zt7RUgHkB92/Pl3zAV0evZ2yy1o/8cr76ABuLszhQ7mPD6+LiULZVl5oWE4VtqZ264pIOQRzBTdwDzp7PZ8eQUXVNlgZNVO7Mq4dAQbUyTDuA781f9eDtFoXX/G/8KcOLyOY4ocDuLgUzbTJZUOaHjWA0a5bczp7FTPmUilouTOISQq4nAmObOSXZLdBhKbHMNUagRczkVylssOOY0v/xRjLcvxVsT2COXagAIY8gyHovF78uglBTcN4T+BamKz/e+FqpteYawTc6lX6wMA7W042pPovTyjl4VKL/BAcNK2448hGMHr/U5gIv2NQTS8FaBlo+zcFrsCC9Msq7acYucXWqHHodk5FeKW4QzHPUH2ahyG2cIfVmLCk7S6s0KW5I2Q054+YCY1EDS8nwQ1du9GcQ1PoGKmFyZnHg4PnanVif/ux/Z9QmzparWMhttqG067qj9dr5qCgB4s4+t7SEh0a83NCNVNHkzRdRSs9CiBceNzB5cFM78dLkTi6CiGgUux8HqFKQVlKg7bIK9iBObQ8DHysDDFg7ONbm42lVtma+sPXJNRwocGVJ1Ke/BSpY0bJQ8qsEnIzPJ0dXJI0EDkAAY1KzRcW2rpMNKQpVaGr9+yGURshRnC/tFe/Vi7l6vRqpdAk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(7416005)(1800799015)(376005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ngl3BgskdHY5Vl+UG6d28TTr9Q4xThr2JlTVvm2wNa6ItVS0VejOG2ZZ/auj7eQImZaFSPUv/zqXwn+Qqhue/0O+DBOpi9CJC6F4putIvW1LPR7t/0M/YBzcMl9lE3eCYlH9gNA1Xl+fZYZjfa+QoKlsXO1TRj2SuGOsakx/CKwBYC0hg6o+31Tqg/vQvP7q0AQ5mtXutgov2SR25oQ4B0C2b7uxrPjVCC+NOmBdjevfTn32t7iS++NVxEMEO/qlPGPLFvkHr+5u/HsBmWcEJjNS+Qrwb+osTVRjUlX7vkdI1S9GlLoWR4beZCcbc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3Nnb93Z/XLcLv55NBeENek+fMO+Ti1188PnVDSf2SDcx/eFO92aNGRAWLTVEEtWVMerr0EanH11vgkurznCZV/kXkmukeH6lP/3U5OoLYatrqb3HRmIgtnZPSJNIGFYlw22TVxMZnbV6uczPLvIlmfre4nYTKoABJ8L/3F1wsjYhNIVS4V2FvjYoKn9E30ls/nZaLsVFHTn23tDCCRRQ6VzDNf/OXfZ+UalFe+UsOHpiVoqhKWyRgWWq/kC8qi1L+pII= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8343c1f4-547a-47e1-b097-08dc5f5dcc6e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2024 04:12:44.7103 (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: PxPJbOwKJhg1vJS+Sp76oNV164sQpXLd7WxekRe+1MKzXKOD7jLAS7x26YLu2BvdxA55vIAcZp2oyj+uEtO7Af7CXQkaBDY1m+HAkPZmvevwaQKC5bsoVnaq8QSay13R X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB7397 snd_soc_dai_link_set_capabilities() checks all CPU/Codec DAI (Y)(Z) for Playback/Capture (X) and checks its validation (A), and setup dpcm_playback/capture flags (a). void snd_soc_dai_link_set_capabilities(...) { ... (X) for_each_pcm_streams(direction) { ... (Y) for_each_link_cpus(dai_link, i, cpu) { ... (A) if (... snd_soc_dai_stream_valid(...)) { ... } } (Z) for_each_link_codecs(dai_link, i, codec) { ... (A) if (... snd_soc_dai_stream_valid(...)) { ... } } ... } (a) dai_link->dpcm_playback = supported[...]; (a) dai_link->dpcm_capture = supported[...]; } This validation check will be automatically done on new soc_get_playback_capture(). snd_soc_dai_link_set_capabilities() is no longer needed. Let's remove it. Signed-off-by: Kuninori Morimoto --- include/sound/soc-dai.h | 1 - sound/soc/fsl/imx-card.c | 3 --- sound/soc/generic/audio-graph-card.c | 2 -- sound/soc/generic/audio-graph-card2.c | 2 -- sound/soc/generic/simple-card.c | 2 -- sound/soc/meson/axg-card.c | 1 - sound/soc/meson/gx-card.c | 1 - sound/soc/qcom/common.c | 1 - sound/soc/soc-dai.c | 38 --------------------------- 9 files changed, 51 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index adcd8719d343..69ba1a628eab 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -219,7 +219,6 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai); int snd_soc_dai_compress_new(struct snd_soc_dai *dai, struct snd_soc_pcm_runtime *rtd, int num); bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream); -void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link); void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action); static inline void snd_soc_dai_activate(struct snd_soc_dai *dai, diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c index cb8723965f2f..9c7e24cebd7b 100644 --- a/sound/soc/fsl/imx-card.c +++ b/sound/soc/fsl/imx-card.c @@ -650,9 +650,6 @@ static int imx_card_parse_of(struct imx_card_data *data) link->ops = &imx_aif_ops; } - if (link->no_pcm || link->dynamic) - snd_soc_dai_link_set_capabilities(link); - /* Get dai fmt */ ret = simple_util_parse_daifmt(dev, np, codec, NULL, &link->dai_fmt); diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 83e3ba773fbd..714ce1f4a061 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -246,8 +246,6 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, graph_parse_convert(dev, ep, &dai_props->adata); - snd_soc_dai_link_set_capabilities(dai_link); - ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name); li->link++; diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 62606e20be9a..0d2ac4c9ba3d 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -925,8 +925,6 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, graph_parse_convert(ep, dai_props); /* at node of */ graph_parse_convert(rep, dai_props); /* at node of */ - snd_soc_dai_link_set_capabilities(dai_link); - graph_link_init(priv, rport, li, is_cpu); err: of_node_put(ep); diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 9c79ff6a568f..5e66812ffadf 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -276,8 +276,6 @@ static int simple_dai_link_of_dpcm(struct simple_util_priv *priv, simple_parse_convert(dev, np, &dai_props->adata); - snd_soc_dai_link_set_capabilities(dai_link); - ret = simple_link_init(priv, node, codec, li, prefix, dai_name); out_put_node: diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index 3180aa4d3a15..48f14c28f79d 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -338,7 +338,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->num_c2c_params = 1; } else { dai_link->no_pcm = 1; - snd_soc_dai_link_set_capabilities(dai_link); if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node)) ret = axg_card_parse_tdm(card, np, index); } diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c index f1539e542638..7edca3e49c8f 100644 --- a/sound/soc/meson/gx-card.c +++ b/sound/soc/meson/gx-card.c @@ -107,7 +107,6 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->num_c2c_params = 1; } else { dai_link->no_pcm = 1; - snd_soc_dai_link_set_capabilities(dai_link); /* Check if the cpu is the i2s encoder and parse i2s data */ if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder")) ret = gx_card_parse_i2s(card, np, index); diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 747041fa7866..24862002e82b 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -145,7 +145,6 @@ int qcom_snd_parse_of(struct snd_soc_card *card) if (platform || !codec) { /* DPCM */ - snd_soc_dai_link_set_capabilities(link); link->ignore_suspend = 1; link->nonatomic = 1; } diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index fefe394dce72..f8e46bec6f80 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -479,44 +479,6 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) return stream->channels_min; } -/* - * snd_soc_dai_link_set_capabilities() - set dai_link properties based on its DAIs - */ -void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link) -{ - bool supported[SNDRV_PCM_STREAM_LAST + 1]; - int direction; - - for_each_pcm_streams(direction) { - struct snd_soc_dai_link_component *cpu; - struct snd_soc_dai_link_component *codec; - struct snd_soc_dai *dai; - bool supported_cpu = false; - bool supported_codec = false; - int i; - - for_each_link_cpus(dai_link, i, cpu) { - dai = snd_soc_find_dai_with_mutex(cpu); - if (dai && snd_soc_dai_stream_valid(dai, direction)) { - supported_cpu = true; - break; - } - } - for_each_link_codecs(dai_link, i, codec) { - dai = snd_soc_find_dai_with_mutex(codec); - if (dai && snd_soc_dai_stream_valid(dai, direction)) { - supported_codec = true; - break; - } - } - supported[direction] = supported_cpu && supported_codec; - } - - dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK]; - dai_link->dpcm_capture = supported[SNDRV_PCM_STREAM_CAPTURE]; -} -EXPORT_SYMBOL_GPL(snd_soc_dai_link_set_capabilities); - void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) {