From patchwork Wed Aug 21 02:13:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 821349 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 44010C3DA4A for ; Wed, 21 Aug 2024 02:14:38 +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 264C83E8; Wed, 21 Aug 2024 04:14:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 264C83E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1724206477; bh=421EwowFWCESv7SeL/veGmYK5+K6Q3kb6NTFpXPf9pQ=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ezWP91wb324XNaM51gUhA+JiO3qDlNZCX4MoHmD19OHHC0vYr+UuZESuxJ8tn0cua i1pLxOZtO850Ex/A8KKu+VHjdmb+gBqAivop6Yil7BQA6hOeE28AHs8fBikoFC7PAB YptvDyI8CafPdIWLf3eVDqX7eO6IEy1H2Ps6wufM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A4F38F8025E; Wed, 21 Aug 2024 04:14:18 +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 0CEF7F805D4; Wed, 21 Aug 2024 04:14:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5FD1FF805A1; Wed, 21 Aug 2024 04:14:14 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (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 8C771F80494 for ; Wed, 21 Aug 2024 04:14:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8C771F80494 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=YUNMbWIo ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QiZujAjBVQqEfHZVnWpPQ9djSyYzQ3ifE+ZKMuNaNDgW45tmposeNME2K/9T7U8ezOorHPaH/zZ3efvHmnXo/7gA0fSjVB7M4mu8cCAzJH6iQaxxQZcE363gswBVbyj77GN5jnKwbBrk++YV2drdsdImBx3yX9qTHFP8FGbr0ucm/J07lPccqyVf0CoW5KCx0YGN7ptdfQ60MjLvSc6eTPXv40k6iJnv/S+Tt+f6Y4lADIpW8cRtBiq0Nxjc/9lETkE87KhMnveXPJDDhJ+9bwddqZb6BGz0eG4fd5mNGXGLT1691vwiJsHz2BkFkFoawiJZV5weETTPRVhJrE/CTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+8WCPmBGkF9yuYE69O7efUftlIN6rr/4FN4tu1IBsWU=; b=HRzJxqyCFA4MgSQUuC+qoVrMn9kpVSkE/qDArBjpbH+RcxPwLaysfvi6TjFL6LJgiH837fXAzVQnXqgO5oOmClyuDR3hYqqCguiStQnVWKIy99zDqUHayQnQ7frPAiHw3yxq+oHZDLuV2tsyFR7tcrP6ReHYjhFly5NmWBIJxuOMP/vAcAnUtvEDM547hzuUwiowDDpCgr73FRvNUt2tRH9i6LZppS/kx96hAtJWEav8p9JWKNys7iwffLcDZ6G6YuJ0/ymjKnQdwSUA5MfGa+CPLT4/X58bMaqiyWPttJpGC4RRLY/NNfEaUBwx1OY4VBNDWmxjdycZR2PKCQA45g== 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=+8WCPmBGkF9yuYE69O7efUftlIN6rr/4FN4tu1IBsWU=; b=YUNMbWIoOsrZVxTSQJ61E0Oigoo7y3ZFS4PzPiBQuQtphwm2UL9t0D3ai/TyVIh7FAXnTV9VYnL1b/Nl5M9QjUNiFKGyiSIp3oxYYtZaYAmzoPfqqhH63eoT1I7yu1BAynnO4e6CiIyEoksG4Cdo9/yBZHS15Lq2u/kyjlWILOI= 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 TY3PR01MB11873.jpnprd01.prod.outlook.com (2603:1096:400:404::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug 2024 02:13:57 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7875.016; Wed, 21 Aug 2024 02:13:57 +0000 Message-ID: <87seuyaahn.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 Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org In-Reply-To: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> References: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v8 1/4] ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 21 Aug 2024 02:13:56 +0000 X-ClientProxiedBy: TYCP286CA0041.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::16) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY3PR01MB11873:EE_ X-MS-Office365-Filtering-Correlation-Id: ce083682-d9a0-4d77-b43d-08dcc186e997 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|921020|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DvMrB7+pbGM02ks9n9MT23n042FNUatMJBxwRWoNW6pb5hB5eNYJSMa5yqF6tBbDOI3WoT48p+DZ0WT9qO2iBiFaa2Tl1QHho82dFLjKyJbHom3t0b1cGmja8/3eJVZvWJCergQkSmLjRSQg2sq+Qn37VCOcBkuTZ53k/8Z8Op+Vkx+DA9r1evGyPMDicO08piBOWKz8AtCUNmBfyF1wQ57Md1b1MH6sOy42o5URht8jZOVeb8jPr2FjqbMqf9iPGQ3CddeEpscDFvmWSWZNt93PSX+mfhMATJNKnr+H+i5TNM5W3ZqXuxDpYhiDtgsyHASHHv5GnDSdpy0N0SuyrloabmXFPLTo2otzcXRdrkF14y076haC4AkozEmJB91tViSJdzDeG52belFA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hb16sh5tG7yG594OCm5IygtOMgYlrjBKJXbI6kX5dy4UJMMTT3LfG8NDLSBB3yPIYICVUU38MEI+cLNQfEhKIGMMJPb8N+g4ch5BzitAE9V+7e05TQ7BTCaqmnQt3J3QwG8/PqG8SKazJ8t7fAOmJx8G+N/RXZSDrsuAELtjxwSlFJKBfclereWEHHezo/sy8Yu+Kv5bqwNuTE3znjmgpT2btyMsD3lFIOexV8IY1Gg25GDb6SEsAtmIOZ/x9LXiigHTy4NqFGL7h8rH5DPENWfsqNdfcvtD1485aGlbaB03ffixw+oqdQ6Urj94E4YWZYfFEFoV9cmwxSvutKJQR5iQMyMX6USjJTx0Xkx17WKKOyf8NAWFKEj0Q06WAr40UMC+LFlnZgWtxb5JWsH15prDBlrdkwjcAb4nBoUA2y+/TOdtaxe7YruT/lYHk7SC7NEBhd8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ECjoLzcL4+QYSrKoJaSDW0pewwi/JZONSW6ZXNafN29ikZ+lXh+W80Xa/LRuOi2Lb2kgG9Ttd34cBzuXLlvmT3oGaSlI6K2GdNN1HjOhb08= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce083682-d9a0-4d77-b43d-08dcc186e997 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 02:13:56.9676 (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: oB44KLqjXWuCQdyXo4BUPZ5ptaPJGl2TdD6eJfWHYnop0b+REPqQ4AxJpq8UgcZlCBDyH69hZCqVEzF2j2GFHOVPYpoodf9qpLoBkqUcovLcoP3GTbWU1cCNbIGzUuRk X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11873 Message-ID-Hash: 7WTGV5TLXOPG6FTK36OUGYU2NNTDKEDU X-Message-ID-Hash: 7WTGV5TLXOPG6FTK36OUGYU2NNTDKEDU X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I have been wondering why DPCM needs special flag (= dpcm_playback/capture) to use it. Below is the history why it was added to ASoC. (A) In beginning, there was no dpcm_xxx flag on ASoC. It checks channels_min for DPCM, same as current non-DPCM. Let's name it as "validation check" here. if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { if (cpu_dai->driver->playback.channels_min) playback = 1; if (cpu_dai->driver->capture.channels_min) capture = 1; (B) commit 1e9de42f4324 ("ASoC: dpcm: Explicitly set BE DAI link supported stream directions") force to use dpcm_xxx flag on DPCM. According to this commit log, this is because "Some BE dummy DAI doesn't set channels_min for playback/capture". But we don't know which DAI is it, and not know why it can't/don't have channels_min. Let's name it as "no_chan_DAI" here. According to the code and git-log, it is used as DCPM-BE and is CPU DAI. I think the correct solution was set channels_min on "no_chan_DAI" side, not update ASoC framework side. But everything is under smoke today. if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { playback = rtd->dai_link->dpcm_playback; capture = rtd->dai_link->dpcm_capture; (C) commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") checks channels_min (= validation check) again. Because DPCM availability was handled by dpcm_xxx flag at that time, but some Sound Card set it even though it wasn't available. Clearly there's a contradiction here. I think correct solution was update Sound Card side instead of ASoC framework. Sound Card side will be updated to handle this issue later (commit 25612477d20b ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")) if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { ... playback = rtd->dai_link->dpcm_playback && snd_soc_dai_stream_valid(cpu_dai, ...); capture = rtd->dai_link->dpcm_capture && snd_soc_dai_stream_valid(cpu_dai, ...); This (C) patch should have broken "no_chan_DAI" which doesn't have channels_min, but there was no such report during this 4 years. Possibilities case are as follows - No one is using "no_chan_DAI" - "no_chan_DAI" is no longer exist : was removed ? - "no_chan_DAI" is no longer exist : has channels_min ? Because of these history, this dpcm_xxx is unneeded flag today. But because we have been used it for 10 years since (B), it may have been used differently. For example some DAI available both playback/capture, but it set dpcm_playback flag only, in this case dpcm_xxx flag is used as availability limitation. We can use playback_only flag instead in this case, but it is very difficult to find such DAI today. Let's add grace time to remove dpcm_playback/capture flag. This patch don't use dpcm_xxx flag anymore, and indicates warning to use xxx_only flag if both playback/capture were available but using only one of dpcm_xxx flag, and not using xxx_only flag. Link: https://lore.kernel.org/r/87edaym2cg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Tested-by: Jerome Brunet --- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index e844f6afc5b5..81ef380b2e06 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -815,6 +815,7 @@ struct snd_soc_dai_link { /* This DAI link can route to other DAI links at runtime (Frontend)*/ unsigned int dynamic:1; + /* REMOVE ME */ /* DPCM capture and Playback support */ unsigned int dpcm_capture:1; unsigned int dpcm_playback:1; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index f79abcf36105..f4a012e633b3 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2745,6 +2745,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, { struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai; + struct snd_soc_dai_link_ch_map *ch_maps; int has_playback = 0; int has_capture = 0; int i; @@ -2755,43 +2756,51 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } if (dai_link->dynamic || dai_link->no_pcm) { - int stream; - if (dai_link->dpcm_playback) { - stream = SNDRV_PCM_STREAM_PLAYBACK; + for_each_rtd_ch_maps(rtd, i, ch_maps) { + cpu_dai = snd_soc_rtd_to_cpu(rtd, ch_maps->cpu); - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - has_playback = 1; - break; - } - } - if (!has_playback) { - dev_err(rtd->card->dev, - "No CPU DAIs support playback for stream %s\n", - dai_link->stream_name); - return -EINVAL; - } + if (snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK)) + has_playback = 1; + + if (snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE)) + has_capture = 1; } - if (dai_link->dpcm_capture) { - stream = SNDRV_PCM_STREAM_CAPTURE; - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - has_capture = 1; - break; - } + /* + * REMOVE ME + * + * dpcm_xxx flag will be removed soon, Indicates warning if dpcm_xxx flag was used + * as availability limitation + */ + if (has_playback && has_capture) { + if ( dai_link->dpcm_playback && + !dai_link->dpcm_capture && + !dai_link->playback_only) { + dev_warn(rtd->card->dev, + "both playback/capture are available," + " but not using playback_only flag (%s)\n", + dai_link->stream_name); + dev_warn(rtd->card->dev, + "dpcm_playback/capture are no longer needed," + " please use playback/capture_only instead\n"); + has_capture = 0; } - if (!has_capture) { - dev_err(rtd->card->dev, - "No CPU DAIs support capture for stream %s\n", - dai_link->stream_name); - return -EINVAL; + if (!dai_link->dpcm_playback && + dai_link->dpcm_capture && + !dai_link->capture_only) { + dev_warn(rtd->card->dev, + "both playback/capture are available," + " but not using capture_only flag (%s)\n", + dai_link->stream_name); + dev_warn(rtd->card->dev, + "dpcm_playback/capture are no longer needed," + " please use playback/capture_only instead\n"); + has_playback = 0; } } } else { - struct snd_soc_dai_link_ch_map *ch_maps; struct snd_soc_dai *codec_dai; /* Adapt stream for codec2codec links */ From patchwork Wed Aug 21 02:14:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 821000 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 B674BC531DF for ; Wed, 21 Aug 2024 02:14:58 +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 2A129206; Wed, 21 Aug 2024 04:14:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A129206 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1724206497; bh=AJzKVRt2UnX34iH56jKNejVxDVKrOpkI0665exqjc78=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dca9Qe03aUKbwESUpEsTwcXt148WlcyIZ2IqvnGre0gB265x5wcpcoarb1KIyoSzF bXJBiJuPF5ii2+7DmTCWUsaAPqkl7+faNMsWObnkgES/lbsvdh9lg9hG8RMeUVBWIO HCpayobG5OETxl0V/ZWwmHrCXFGbq8+bVC5lwn4M= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72BCAF805E6; Wed, 21 Aug 2024 04:14:22 +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 46AD6F805E8; Wed, 21 Aug 2024 04:14:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73774F8057A; Wed, 21 Aug 2024 04:14:16 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (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 1EA41F80496 for ; Wed, 21 Aug 2024 04:14:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1EA41F80496 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=in4xWKiZ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=apzt5QODJCBWMW4a/Pihr3I2Fg4NKQhTZvY3s3CMyszgR8uCDmVAgvM316lw8IciS+u/XzjHm8YfQbKHr93EAfDuR//VqkcULG0DOAkpzw0LN/tw4PXNAYxMjZmixR3vCZERitFLKnu2u0CI/eBm1TcWEMnER3lRTE+vCEBI56DYqfWsvUNaIIzCUcGA8WjhpHXmENHpYWStDl227wiK+mT8CmqeN8dWHxv+NXB4/w9d3BpqYYPnqWLzu1kOmVtCO9Illjay/ONPDCk6cfL6skq86vIEJWHsAu1xoqIhj0FCOUtUA60BfTVhMy7u/ziIU5ZUhSG/oZtb2DnrTfAAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Eg8h68kzgIpZiZQATLjsZMVCmIkNSyyxHaaTFvmvEsY=; b=py50g0Dw7lZ1GCJ/UqageQibcvMU+R7XZRYHOrGnhfXsuc2b69ulTZgwTZ+sV7MtD9hM7UCKmlrGEIsoH8t3bQXZbjSiRNy1/1IpXnhNDzrPe9OdKHBB1lXWoFNoD5dEAvMlx3Y1wp62o2r6Rh+AkMpPpSV4Jn/kZ6vHx4QveA/Om8J3ZGrU/rUcDzDpRERWzklswHYSHWe3ceAMsW2NnBPYtBTChCw1HZQKUwgUo1sF7XtnEvvjzdPRwRWMqaesHfGfVtZ+4jG2ECkt5EIylYMvUyC7OyGtCNZxInn5DIbChccAgX47OKqvu7RphIDpmlXwWvaYCv6dBiuyodC7NQ== 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=Eg8h68kzgIpZiZQATLjsZMVCmIkNSyyxHaaTFvmvEsY=; b=in4xWKiZEP+myToYWoYs8Zb1WbHk57g5BnhopdmP5NI1jjtprKSvvhMZvFIQFg7ypghUGdU4laakKUQUNbTHfIXFHe7HTTC6YFTpudI6RLIdT14iXg8Fi663dBm7sG2hmA+wJtmlp7X9FFNfDlCEPVMc3zox+PKsXbc0eUeWVK8= 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 TY3PR01MB11873.jpnprd01.prod.outlook.com (2603:1096:400:404::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug 2024 02:14:03 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7875.016; Wed, 21 Aug 2024 02:14:03 +0000 Message-ID: <87r0aiaahh.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 Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org In-Reply-To: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> References: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v8 2/4] ASoC: remove snd_soc_dai_link_set_capabilities() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 21 Aug 2024 02:14:02 +0000 X-ClientProxiedBy: TYCP286CA0149.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY3PR01MB11873:EE_ X-MS-Office365-Filtering-Correlation-Id: d8c9523f-426f-4912-fa4c-08dcc186ed35 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: ySTX4I8OslBJJ4IcmaU1Qbg8LW6Tzm0TVIVCk5UczE0c9FFcYGs1tR+VBYpnTjXIvWtMbMLurobjUT4FG0hNrU9w5Km1xUEzpc8M318kX4mUFgSVqf2LEHI8A4r/XKW6a+ca1Z3hKjMPTJZk900HKIOZ/vunzd/3Q+RCOtYyCtl0EY3CpLblWN7zW9mudx0zK1L2KP5ofmfb5jptHohTt1IOMiFtUv0IMe4n4+N/V7F9OVblrLJtSocwUOLKFD3SnobrI0b8cQhhQJ7NjbVPUBV8PPg8upGuOJlVtr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N3rPsbzJWnvxKI5nyIxS78YIZVJhS5ePHcUX4nDQaDn7rpQikoR/tiD7ECdNtwWiHGL3AZhUTSyQe02sprmIHsouI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TPy/jMvb+tcm8VJMBm2koJGpeXVWSDFn7JYDFgYVGeM3H82bdQ34DQMUXmR7Fp9OMKUqKELrOIgUv9V07GWqLgRn6njyRVHlqyf8O7vj5wxkxNXbEkYxz1EsNraXBC+wpZwyYeu4DVRxPuG38t6wtzZCIwTl0JXEmOtF12QwGtJ7kvKmu2fIdVJhk4kJmd3zWj0Vx9If+bJ3MSs3i9NXMMFCF6uAy/XPHC80AltL6PiTrQa0FmaxwAlBeVkfXhlbxOqz/+9i5Hybmz5OG0B+ix5+th4FrU1aqtbMw2IuGUiopN1JwBKAEopDc23DcAOEzu0SMDR61zlJ76HH4Bdg/JOENUCZ19oPgBViW5dytcQDQjL2wDcNZqAuxKq3kQbNE2FYCfbSqFXXzMGdvMiuymX+Kle1BcPse5hr0o+BbKbQF5fiNBU2zlMcFish1mB6wmz4GzEomiWy+0G3d6LpXjw0YgtLIMzFIYwkMQFdMJ2Xyq4vl0POe304uC1iBKqle1wZIZ1LRrXYFCb+iZNg25p7Aby58IH5Ip2Z/3sAYHiht3R42YZaKJjbaBa2i4yUHM/qegyXhzQrW5JyBBiytsu4WPMjEZ34afI0bELwRNbvcFizBGe1h1bVnLo8onIDdwnviSPWcBZQ/BWSf53VDxNNwJfGxGiLzhNS91tNwh82U2sFCpdt0vvviRxvFPNp7t2lONNEDuyVe7ZxIG0N6168JYkgGriWTFV9Ji4CRkOnTDDBbfZ/3OgVWi+kQ1CpNl8rQ3fbk1UOC0Jy6bophan8b8NeVklhtERoty04kCkN8cKHNV1HCwcY0gXST9vlcjUG+OT8w4TkbcGUx39iwCw+y1lW7kd34eaE9C7dDW0D4YkaYpaNBtY+acaE6H0tCGbFBlmJqqzK11xpHuzDGOlI1EsUh+9t7XEGTa3TVXa5gWULQZ/R3s0dDU59XGDZi6dOUszHqR76yEdqY+zBVSKUDXd7Q03/ELeH3DYWlRYOH2kuJ4mOS4pX6+BUDu9uI+jTAOVvFNph7WApVj1Buh1oI4fBuHEYHpIZi4yX/cPpKnaYG7KOhg+YHEw4Qn5jzyICfQm/J0q2pPB00K8UWu0Y+dOOxmWzhZswJS5RIQ75GRihJv7Cnytcu0ZhEL7Gm1NZDAuXBjfDoRCi+RtbbwzTRDNReRNbqFKaSdpleG+a71Nq1Pk7/jI+VJKbKnGYlf2j7eZYz2duQiCM7JgK8KYhpCQOz8HkMiQ9MEHMX8HoQ4HONWqEH5kTV3CjiHGQAMj5/d7k+4t6fhsurvNYJj6fvSNs/VktVDXr/hyQHs9NIEAhw4weqYAxfJHiSjchoJWUOMhPrCXVWpnaL+s5ypXdCn3AEfB9UteXbzA5DMSwMgwW23DHtXdqKfeu/yoCM9EbAKK0HZjWlxoaOxXnwkQRGbOnqyO239MSPHo/MtRZoL9QFnDckarumhoLo7aMBeP4PXlTalaN0oiarF2Slcj/PGvWuQ07d/0ADGpXoFyMwdG2ERuEetJe8bsrv9wQopGJPlb5hfPZia1bv6GBMxgXQOJHXxpH5cQ4IKwOAiQxPyiU092Z9a7csaGfcMkYpuSAc48lT9er6hw5a5wyRIoOK3CpukU0nUyKLr5v/fw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8c9523f-426f-4912-fa4c-08dcc186ed35 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 02:14:03.0270 (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: isF1YpTPIvexpMZVoA+b/o0s+J6JiqH20dBUhkWc6DuccahgfCzD05/8ndLInPrO7LUNhG8buzqZ7VjAeGNQV5BwxP2xA3IaMubc10kZsTOoCwKTOHmsgHBNB4ga70fR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB11873 Message-ID-Hash: PCCV344LJG7WUIO557KRBXQ5Q4T7AITF X-Message-ID-Hash: PCCV344LJG7WUIO557KRBXQ5Q4T7AITF X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: dpcm_xxx flags are no longer needed. We need to use xxx_only flags instead if needed, but snd_soc_dai_link_set_capabilities() user adds dpcm_xxx if playback/capture were available. Thus converting dpcm_xxx to xxx_only is not needed. Just remove it. Signed-off-by: Kuninori Morimoto Tested-by: Jerome Brunet --- 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 ab4e109fe71d..0d1b215f24f4 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(const 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 0e18ccabe28c..98b37dd2b901 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 3425fbbcbd7e..1bdcfc4d4222 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -279,8 +279,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 56f7f946882e..051adb567397 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -966,8 +966,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, lnk, cpu_port, codec_port, 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 d2588f1ea54e..42c60b92cca5 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -291,8 +291,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, np, 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 8c5605c1e34e..09aa36e94c85 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -339,7 +339,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 56b4a3654aec..928cf5cb5999 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -155,7 +155,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 302ca753a1f3..4e08892d24c6 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -479,44 +479,6 @@ bool snd_soc_dai_stream_valid(const 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) { From patchwork Wed Aug 21 02:14:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 821348 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 794F8C531DF for ; Wed, 21 Aug 2024 02:15:07 +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 E6DBE208; Wed, 21 Aug 2024 04:14:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E6DBE208 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1724206506; bh=R5m/4n1JoYnPi16p3LCIa2mEuJhAVRlRCjFtk+jPqoc=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=n396msNsAq7P+cSh0SMCaIhDwx9ZrqxGUrRRpgKsp4UhuAH6iUBWi4enkJmgfu4xS PP9FAO7g89+rMB3mpGEhhGKOTrm7bRQMWuvFD2dd6gKTGMAp3W+mEMNqf+cUujXinl Og+N1weXRrJGeManebAji0VW6EpQsynchnqOlZWA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8905CF805C6; Wed, 21 Aug 2024 04:14: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 E58B5F80605; Wed, 21 Aug 2024 04:14:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B4E9F8057A; Wed, 21 Aug 2024 04:14:17 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (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 2B65CF8049C for ; Wed, 21 Aug 2024 04:14:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2B65CF8049C 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=mhP97ZUb ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wb0UKTURAdHCMWBF7DjJ8bUsMWEGfeN/gY4WrQdWKb7XWPlftFHZmNZF6YegvHnKeQ5wHFPbcMBLEEr62V6G1RZ9vt9NW6iR8ZTFxQTAqAzKk9LbuGUYUm28fG9mL9XSzZpwXzbsL9V2zwf1zhXreh6t3OeXArNkNtmvfCFo0SY2TwIVkAFy/z8qu+OMX1rK9HRf/6ZpdD8UBXa/r9YMx2/PGQGCr8LMwYBdVQajdpKOD5/0TMQfOAeivpcGUrz4wCOoS5fvMEaePFIdFNd6gY24VaXi7FbhmnSnuOtXpxDqHJSkeFShHOzRBa758UQs3WmCYFFHYDI5ZSvH1VTqfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w61PALYSiWkhH9o42uXVCAd/pnpT87hto831DJrTNiE=; b=G1k/o0RM/thxOobB9upiWqQ814PoNp2bJaJZOzaUrcG4XkIZUApdqiNVH/TPvvNSirq41c22K1FYPvZNxe44nug4z0I3eUzcJn7uDKJDvDFhWcsAsTGsTztl+jZSciBA3zqHQlcKq7IvOfsbWTMoqyvqEInOJPtMIKy4ryKnjRyMgtzhKMC2+kei/2knoClg2dhJyUZ/rQqPfLi4/7fXMGZzFB3gXjhHOHTgzVLAloHe4/FRzdEcFgD5h2n6Ar8Zh7Cqqw9eOH6v4QdpmmYy3pHE52yZqgFQFHYN9EetqD0iEuyFyfFxBDQrJ46c+BQ6UPUx57O426byNlkPxMixxw== 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=w61PALYSiWkhH9o42uXVCAd/pnpT87hto831DJrTNiE=; b=mhP97ZUbDPKZDb9xvE5N+L6zvR8f/Jq5lk9UTYvZfnyPBdbSkCUBP6rOOhr6H+TZBdgKCHIDmvYAz4WTj8PJN9TTdrSugUpUz2dBi2dHDDc4crbZ2zLiL/IgRW2QGS0eOGg47RDfGEu/lT94u5im7hZhWCtFceodmERG8kGmXlk= 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 OS9PR01MB12133.jpnprd01.prod.outlook.com (2603:1096:604:2e7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Wed, 21 Aug 2024 02:14:09 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7875.016; Wed, 21 Aug 2024 02:14:09 +0000 Message-ID: <87plq2aahb.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 Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org In-Reply-To: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> References: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v8 3/4] ASoC: amlogic: do not use dpcm_playback/capture flags User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 21 Aug 2024 02:14:09 +0000 X-ClientProxiedBy: TYBP286CA0025.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS9PR01MB12133:EE_ X-MS-Office365-Filtering-Correlation-Id: 6013f656-dc19-46dd-16fe-08dcc186f124 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: c7fk3hVyqhq+MLRZGgdjKlEtHF49AXJpkCxLvCouzrj0H0fREj50tKlBFxh6D66oYv60WL9EZ3jBgQkRWWF61DoiPGFkmclf7Kuj/TKbwTt8Of2FtI+4j+s4WbBJpigm9pxZoSDgSvy7WBl5Hp1kz9nmrgM1Rik15OQbm8+ZnVzDshyOZtcSkNVvPpDhUzSMJHrTHAlj0hhg+O64ELXVq67CaHAGRKJNVua/cvPrq8Vjh124HIuhkQpaqwSk1mc2twIfr8litaZfasUIIDaTn0EyhU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MVf4LT/IZldrd2gBMvm4mGMV/pmZBc05Xvlg45aULbm9vcsuqUb7HGh1jVul5RKRfIgzecFyEutUgx/ixRctE+KhmPuOjWnWVse0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376014)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qm3WfzReRAYBOZvUCQw7WKaTagvhF9sI8xUe9R3cswbnFMN+IZi6UqkAiG71zEomUFJpv2fbqRyOtN0nh+yzbJe2bVW8336cDDzW3lCptGl+XFGG5t8iLA7svRA9GJmXr+jEVo8qR+Qs3nxVopp4CHt6kvxT6s+s5/R6e1fM58jL/lT1zMG/3OpNiU/rNPM7lHbiPenNkMFe6YoyTSgYHaMvlutgSoUa15pig4Gh4HPFOnK8fnqXJzX4hbw2pSdLKtDgbzGsY+MHoKGA6GVFjUHXWzYW3oqOO/5HFO3/WHxFJTDUtyNt5M/Z60upxCiuT+LAPztO/rsoigoZ1PdRwgdRR/DGg/bQ8xiCkJX21ZXtuidhX3R2T/qJxuEJ7kJCNxCh+pmWl7xPK46cRSM9AWYy+jH37qL9ed3ASk9FQkHoFpWK/Jj5Z/Vgy08L8Cd+mRANUs8SKZPUdiRD9d3SR9Hz6je9HuY2jcAfSbWcx4fJLjPmZk7djpLyVmC9vY/B9UIsH18Zv4DrcNiZmn71/pj/YCiRS7jP/SU6zBWuZ0qI/5iVGLEsm2MxguSp5IvS88mh33DuGSAc7T7yM7AEC7UK5k7zY9mBCkkkh/3W0rH+QwCQ9kR389e7guBC2jxns81fVSiMRtbwhZrpTWmAT0vV8kU6HPX8AQPZLbICP49s7cwwN5YTLYfkVhrzjGb9Ue8A9NRXppHhtsAsXGdV9O1RAa7TvYaawBeVFX3JL3vtnOkuKSnF1HwWrJjnVKAkxAZ7ZWU29Mql1hWz2LeFazDKaAOhNynlwXhuaBmuTebN0hk0y0tCTjPAQ3UAvlsJMEQYjeM1d/Foq3SLXqLTDTzLg+Ilfr0StfLDizm2Ldn5V4F9iR9x8pEK3DhyWwzZm0eR9NwEiw7GLm8GUbI33x+NK24yUFNDxFZxWM1pGWHvStY20PI7bmNdsw0pMOl4QZo10PuNez8xjn2vD7JVrnBSHFo+o6CpQunEDYR/e8YhJfvQGbb64sC0s64lHZGJVT6KacngUp6paJftJewjcAkdUtJzb4oWU9GWMzGSOYleJpBtDdG/hYfUZ8stI+7+Emn/StMH2shIOB7qoxu6yD4aMekUgH6VmkdN58VDToJmh7JZjquXfnoTbUaBP/GVtz3c89ZukXRX0ILqiGSDiBIOy9V0DN/rRRLaT1HpQ9p0xEXTnWQ2vxUlW/pyIt7p8e1DBaWX62/4TpozEs042vNf5dSnQKVSR06LoTcCizIyZJN+wN1dpLHbdLTRMd/YUmfsmsxvA7AM2JKAvd2hweNJXniJq3Ur+G+jRtSljBNVUk3z2Wr7eWqih0O31zuHWzWhI+GfKt9z2ntMiJaK87R/kW8hmp4GlUri++H375AymvAm1RNH/frcExBYXHVP0puYopN0eDP3tkvhcY6kMpMVjzyCANmGmUX/XMyzz+n8fO/ODiVaCuBueHuD50z+FGF+iJ2iA1fazREE+oi4oVig3djFsYvU5sZiCZUqbDbS/QMkxtZ6LsvrCwE9nwsfnDHB+72M77MLSMoOKKU+ninKPOYfTTIEsyo62FBSmF2GAyx6O/vk5wvlq6EIxbcXQMz9gywWWhKXQqG6jXAoPfd+zANST5W/x6er2+vQHFE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6013f656-dc19-46dd-16fe-08dcc186f124 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 02:14:09.6269 (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: 8CHEvACK72LtMkZeziK0rNN53FCZEiXLfvcyILAMgW0ofE8XEFyzXL0dI0U1K52YkEx/YamOf9VodlvPMOu7pZpbOtCoYUHPSLInbxviGUU846vKrKfOMLihh9hYHaUx X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9PR01MB12133 Message-ID-Hash: OFKCLJEXRFZELQUUHSGHHIUUNRCXNKXZ X-Message-ID-Hash: OFKCLJEXRFZELQUUHSGHHIUUNRCXNKXZ X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jerome Brunet dpcm_playback/capture flags are being deprecated in ASoC. Use playback/capture_only flags instead Suggested-by: Kuninori Morimoto Signed-off-by: Jerome Brunet Signed-off-by: Kuninori Morimoto --- sound/soc/meson/axg-card.c | 10 +++++----- sound/soc/meson/meson-card-utils.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index 09aa36e94c85..646ab87afac2 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -132,7 +132,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card, lb->stream_name = lb->name; lb->cpus->of_node = pad->cpus->of_node; lb->cpus->dai_name = "TDM Loopback"; - lb->dpcm_capture = 1; + lb->capture_only = 1; lb->no_pcm = 1; lb->ops = &axg_card_tdm_be_ops; lb->init = axg_card_tdm_dai_lb_init; @@ -176,7 +176,7 @@ static int axg_card_parse_cpu_tdm_slots(struct snd_soc_card *card, /* Disable playback is the interface has no tx slots */ if (!tx) - link->dpcm_playback = 0; + link->capture_only = 1; for (i = 0, rx = 0; i < AXG_TDM_NUM_LANES; i++) { snprintf(propname, 32, "dai-tdm-slot-rx-mask-%d", i); @@ -186,9 +186,9 @@ static int axg_card_parse_cpu_tdm_slots(struct snd_soc_card *card, /* Disable capture is the interface has no rx slots */ if (!rx) - link->dpcm_capture = 0; + link->playback_only = 1; - /* ... but the interface should at least have one of them */ + /* ... but the interface should at least have one direction */ if (!tx && !rx) { dev_err(card->dev, "tdm link has no cpu slots\n"); return -EINVAL; @@ -275,7 +275,7 @@ static int axg_card_parse_tdm(struct snd_soc_card *card, return ret; /* Add loopback if the pad dai has playback */ - if (link->dpcm_playback) { + if (!link->capture_only) { ret = axg_card_add_tdm_loopback(card, index); if (ret) return ret; diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c index ed6c7e2f609c..1a4ef124e4e2 100644 --- a/sound/soc/meson/meson-card-utils.c +++ b/sound/soc/meson/meson-card-utils.c @@ -186,9 +186,9 @@ int meson_card_set_fe_link(struct snd_soc_card *card, link->dpcm_merged_rate = 1; if (is_playback) - link->dpcm_playback = 1; + link->playback_only = 1; else - link->dpcm_capture = 1; + link->capture_only = 1; return meson_card_set_link_name(card, link, node, "fe"); } From patchwork Wed Aug 21 02:14:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 820999 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 5AEC0C3DA4A for ; Wed, 21 Aug 2024 02:15:28 +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 5B13C829; Wed, 21 Aug 2024 04:15:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5B13C829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1724206525; bh=uXvWewXCu+wRq7FhwUkM+5IzreW+qMkECRunhKuWVmU=; h=To:Cc:In-Reply-To:References:From:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gdZpsogYI6xfOboZLrAYwFyB9On0xdGVnf2/Mi2hnmFCyH1pMezPBj9CuTIbh9e05 pEcIM5vsj2iLAip/RevmZLri3DQVXZ2sk0GgNPfmbCZs/lW0j/4Ax2Wk+KHFOHvA/B rqgMXcmjRyFHk/yBd0JWG/jcLYszbe0oKqjMod5Y= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 066EDF8061F; Wed, 21 Aug 2024 04:14: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 B2952F80613; Wed, 21 Aug 2024 04:14:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D332EF805F1; Wed, 21 Aug 2024 04:14:23 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (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 3B2B5F805C6 for ; Wed, 21 Aug 2024 04:14:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3B2B5F805C6 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=EmX2lSVd ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i56nCMMW9GAMKwsAEtnzWx7aBwkvKNdP/PCtjfEuqzzhId3IdXMrwPY678Bqbm0MB/kY0uEAbJQ2wzjoZeQY6fgApKVHYcOaP2u1+9ZCRM6bH7AdXESYi19SA9SzcCPtwaDKLwUsoDJBeiQTXSgzGHSvSNj9GH/6QYpbv8DU5YRBENGFGyvFIzboskIC4JWYBrqE6AdkdEVxIloDvHZPW3UYkYfhqwZ6nHdsW0UaX8EcYctSCxV4VPXg8lHAB03yM6wBKVxYdYSxSaOWBrEtRooI4OpM/54zeuogThGqfWz//2dKpYIiFCkgBx4Zb+oNZqIB3RV165XoHscITd0lUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+JhwBV456gkTK1RetyWZudKaGui11zsj2j1Tj8MmhvE=; b=DpGtZpyEpH09AErgBqui/497yFPwlqoLF01jDpJqiBn9wWCY6x/fPRTK7W4jCCs2Tf2Xo728QvjaGImL4QIR81R7Is3ABIs7h++mwIJhvYHiOtl71swVujZsVh1dY5yVKzxGMr9ifK7HVowOoJaPbEYSoAfxK3IH+GgoY8sj9ts97OVL8SpltTmkL8CMlhR0bySl2YRm3KF0uwS4PnILY62WsBMs3cvF3LgS50Bb5LtOWtKIaMc3p3XZqoOBHx66TnKwgYK6nS9EWhxyR5xMVimbRvSwhQRpdebh9ypLwAVdlY/kIXE7VuiXmFnLHP/Vn6EPRRuqjQ6Yk1Shsc8QKg== 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=+JhwBV456gkTK1RetyWZudKaGui11zsj2j1Tj8MmhvE=; b=EmX2lSVd7JyyIrcgz710gB2+ZymKteEfuC9uKZViisY2qf+drv8w0KvNDmHvphS/gfurez7AHI4Dk0x0IsPh9zGj5uQtAt2qefWuqNHgfxgZDI6XYDouzzuZyPWA7k62SomEZkPxOVfVeoFRv3Fmxd9bcl3OOSuhq+22OIOqTK4= 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 OS9PR01MB12133.jpnprd01.prod.outlook.com (2603:1096:604:2e7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Wed, 21 Aug 2024 02:14:15 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7875.016; Wed, 21 Aug 2024 02:14:15 +0000 Message-ID: <87o75maah5.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 Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org In-Reply-To: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> References: <87ttfeaaif.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v8 4/4] ASoC: Intel: sof_sdw: use playback/capture_only flags User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 21 Aug 2024 02:14:15 +0000 X-ClientProxiedBy: TYWP286CA0002.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS9PR01MB12133:EE_ X-MS-Office365-Filtering-Correlation-Id: e60a8cfe-627b-449e-4bdb-08dcc186f48f X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 8yM0D8YxAp6sv30bOtGPvww76JcqyG1Lrx4UTcoze0fTrT2yTw3XW/8juPXvoPoSyl6zo6/h6UTfw1TSqKs2VBlA8leMC4mRo/VuqSyWE0hXbhX19yBR4xZp0WOVta/ApACEpMgHccfxFTDl383zny2BOO05+XdzaAz/ab5r+3XI6244P4aeztJGmhfATl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gZP/CNforjjqbD3Sd5VaK12Y3qGWHKPP/kiix48nZLH4VSoOkqrKTRqEl4CTB088U374xQcm1Wzuk0xmAZbRpYYnQ767mt1NrtrBpiDlyH9E9BfB8vml3azoffx5+SNu3gCVtUjR+YbfmOy5EszihU7GwyYCEstbXy3DGS1Rg3PFD0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376014)(38350700014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CPUneJcNb/1HNoJGWnWzTCKOZI6r5POZiWtTUPKHGY0MPvnlBkhM6W4Lfs6HiFDn7SLP0otQ6k5+164PsSxafKnWni8HRKFvfVjawntAQhUQYdPj3smvZzhb6OtptqxmS2jy0JUADdQKwPsfpSgYylDIW4FhxsfydluuA0qoHQ5zhCCNls6CTDYVrFIZ2fqBCZySfEir4JAdFnLTAZVazamwg6SPIMpuwJhi7ZrY8tnJB6Ju3v5f6o7UGvireznPg0BmZLxCVnCa6hihBffOzfwIc8KNk8NX9mrLypJZlH/m0VrcAG7EHRqy+bNPyAkqSlgRgabgBdck9AfCYSJbp5oUZLiiz2IDDxWttWuvS24vzDzC5rYJCAr9ShoN1KnHvFsmEtAAxNGIbk0BMf48DFSUXLAcZn0b6dCX97FFxvQSbyLz0TNSyUMOqtro2rPrvrgpCz0X7t29o621IBjnPMe2O/wn2wPDSuQaIADebGOtDhhuPFMRLZRMPIhFBrjd9zLL7sowy4CRIjJ4cOLTp0hWoR8wpkciaOWBRrjoh2ZF8TDxmYEYNNyhtkBjmF41a3l725ylZz5JoYPRtOsYAbdJAORxPb7ryMCdjeAlzuAss66Lj8Kfb7Ql0K2l4Yr4yjLQ1Pb1l6GR2hP1iG5AxWWW3t4IEF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AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 02:14:15.4024 (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: hzyrXtqL/Snp9bETDR5GVtv9mMLyL8H3OI7Dbv3GcjOgOK75XD77g6y3lH4aPRuNmIqw3dS52WraQ1KW/JFkxjiy1lW6nXzBCFOmKlr6vH83OOUJUvkC6OzTWCQ3ymyC X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9PR01MB12133 Message-ID-Hash: MZ5RJG4N24QTBOWGRNZKMYEKI6SFBN6Q X-Message-ID-Hash: MZ5RJG4N24QTBOWGRNZKMYEKI6SFBN6Q X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Prepare for removal of dpcm_playback and dpcm_capture flags in dailinks. [Kuninori adjusted Pierre-Louis's patch] Signed-off-by: Pierre-Louis Bossart Signed-off-by: Kuninori Morimoto --- sound/soc/sdw_utils/soc_sdw_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index 6183629d1754..e8d0f199155d 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -950,8 +950,8 @@ void asoc_sdw_init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_lin dai_links->num_cpus = cpus_num; dai_links->codecs = codecs; dai_links->num_codecs = codecs_num; - dai_links->dpcm_playback = playback; - dai_links->dpcm_capture = capture; + dai_links->playback_only = playback && !capture; + dai_links->capture_only = !playback && capture; dai_links->init = init; dai_links->ops = ops; }