From patchwork Thu May 23 02:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13671215 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2067.outbound.protection.outlook.com [40.107.114.67]) (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 816FF187F; Thu, 23 May 2024 02:12:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430355; cv=fail; b=rg79BcBptvj0MYKJ3o9Nl+MSMOPmHdUmJ8myWTioiVxb+JVmiMkjpl1hIUlW1YfGUze3chiznHgAgQnp+RgCouKx/ou3X23xAfpVSjQXNt/dUksC/1Kf9R8H/SRnikODSRDiGqTv8OPcmwUcJP5/KCgAbNieR4mx9iix7LKj2kU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430355; c=relaxed/simple; bh=rQnkDFswRoN5o66laHXECttno1xNd2CNVdiOGb+pCf0=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=OuduoaITe/9QSFg0DCipSU4J/0ZjTlwwxYK/nzZky7G5Bn/mJO2vJ+fq91W19WoJVNG+X2COGTJjFJK87mqJMyVoKYqAkpDTW8V/i7qf7AOs8K69HpDiWMopVmNN+MbKqGvHgdSg+ZJ/PY/uqQbKO72xCeg2AznIILyByhC0y1g= 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=N5gJClLK; arc=fail smtp.client-ip=40.107.114.67 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="N5gJClLK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndXDeOVoeGM9rE++E6ski4D5xWIjdPnWEi+5tI/WEOWFPRhfZ+PzvGDPN1TyTf/AlVQugTGj3QhJNn8jmVvhngyPLEUSc9BFhn6MuStMDuC5EwRXBVFGQzmy5ttf8nuNATEft7kcVY3O96iNlyyn3FZC6E//2wLtFKKxwQBb0mgg6q38OUoX3l1WeK/RPmCzmYqdBPKhzx6L1A7JuGgJ8ZgU49+oHwqBRI7u8RNHxxh7gfG7lwh0vsgtBGNVsCrlfz8O87cZiImy0nRyIOiszX8euxZdREQ09sUxXG5EPtlEuc4KbL9yT/Yy65M/1NgtV4WNSfWN1330uI6f3lzKQw== 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=9n4OOqtWY/dOfH4XIQMvxRy9p95kdhnTeGHHR3tUhnc=; b=Li58Am0ApJyxKPGOhRlbO2IEYVb7E/otYL9L4/88oCMVMd772wOQTxUyyP9/mnxJp2TMU4M4elmZ1Eclz5zrnyWzFtD/GV7gpx5EcE0TUwBFDynOdrZQy0Kz175zRP2jsgbg3jXWyShMy+7/1vdAMbjW2dYFnf6nh/L90OsWacf5VQwVgDygkgvqTrvicpp+Hrw/XQC8ozSAnnehq6MKfmAPzSqfRSkv1zIodqw3atKtkAF2eLyo0wu6HZqTDJj+PSXuuQ7XKNJQOOhzs31jw8BjUtOc5TIorQIj3ligcnERBvvw6kqzxs7yU2bSypdsRO/ndUJHtTdCj0qgABVhng== 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=9n4OOqtWY/dOfH4XIQMvxRy9p95kdhnTeGHHR3tUhnc=; b=N5gJClLKeO1hHEI292o6LInt9Xl6FKpnOMMmQp6Yc4b+8OyfZz0wDJjF30LTdIDDQlw0xadvuekDuoYcwr4twctdqEc53w22xhRYOfmlPhruMkwRbv/aDDG+URJ6KFKTmSRKeHZBwpPYWgmz5gM73ou0s/T2mpmjKjndhlvy5Rw= 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 TYCPR01MB9434.jpnprd01.prod.outlook.com (2603:1096:400:195::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 23 May 2024 02:12:25 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.016; Thu, 23 May 2024 02:12:25 +0000 Message-ID: <87zfshmg3a.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: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> References: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 1/3] ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Thu, 23 May 2024 02:12:25 +0000 X-ClientProxiedBy: TYCP286CA0147.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::10) 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_|TYCPR01MB9434:EE_ X-MS-Office365-Filtering-Correlation-Id: 40197a57-9579-4d02-8292-08dc7acdca12 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:13230031|52116005|7416005|1800799015|376005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: FzFqd5l/pF8wSGHTXRgtgzLxLCSVooOwzNVU2FfxCs5DOpOJZuN0IHs+JltFUz1Zm9Rpgl6HXmzXs0jXinHgPZBxsYxVl8hoAPF6ht5/IW3gED8LMQ0n7pPFp02mslRLXmBr1NXdKxZgcY5OwcPCrbep+yLGF7AggsxAA/yv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giN3T3V/aleB0kchLotgxPcX00tdH3oJzlWClNZSmntYbUfBddHZQMriPYe4OzAjsP5dHe9Erl0k= 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: gYjGZOoRdQicZo/ueeMlUul5KneJjTSjTHXhD5wWI0MbZ1cwdbCQCbIj2wt2zZ0AyoyjkV3NOc+s9KY41+e6IcEwkFqT2CUSWMvuetLQpmVjg8l7ItQQnNDp4zxaudw1nTRixgm/GX5/0/QLaL6lrHW1OYzmklHYb/0w1tTFEKgNvhTMR+mUYNrGKAmIhF+Z9bvg9sWVN0h/HUNj5Ha6W48XZroghgIuCqSg1jzkFqsK2g9rka0sPSktSzibDKfE1dvcEpvvsGeFZPFtHj+WCkbkCWyfOQ//aDTxfIJl+omzhMOQgbmwD1gzjLtljVarOAT5LKstS3bqcu+TJK5IcE3fEcGx3taU1ewSZuNrxpL5wD3vw+TQjCzI1z84m57pcDU71R7zaPxUyancXeW/73Q41W+9dwmY3fDrR8hyEYCT8TWKbud2ba40WZwzyg7om4Cqa16h+HqgRE8GsqXoJdXhqhD1PGkpj2mQp37G4l4CsFz7X8W2ZUxvT30fiVbz7/7R1ufFtOnklc3e6yK3QufafpIdBedHuJ9JirkIJYCNTlDovGITKbHViDfw6ip9xOBAyApCXwffvwq4E2pdbIoE+Ze9K0uqfAlNqjbCEXHehyYArWgvCgQ3h0PH9cqSfBtw+AJ50vn64Tbjo7MMjwSpZNDjtDeJ97Y2VTcJfw3q5PWlXbjMTy+RTyz55nZM8ZyzTwf0CC+DEaNqp8sfxkv/l4oSYpCbE2v5iw6aLwWHNDAdb6pRvO0Dv9YyQdCPJSz4aQPsBtzEGtdRoVlu42LmNdgPuEQLHMafFZ/y6s1VEZMFyk+kvg9Lt3FT/mCW9RzE5tLOFNkshxOz6D89X5Nv8p5HA3THk//pOA/vwG2LQ/AkW5m5M1WNE9R6p0pD/Tm4PvuKlXdxc9zVAXi3v4p9YB9eN09bnd+9b/9SLAe5HwXeacvT64JxQNiClnLLaUwAR+yZC8gWNCZmnLLdFcr/P6uosowlaD/25xerm8etkVIcNZwGXkKQF8eqXzHGzDmoxSD2BzpaECaC1NzSFdGF+kuvGSj0iQOmHK+B10WVlF/45KknFOqGpKVaq6xe6k/AT+D/Dm6LJbnldaoCQpxQGol68Lc/lpsT0iJZ4GHLgvTeTnQF9invd7RpVMlwTLepu1XZOc27qSHCH/AVFP/S3mar/iJZ+EBr8hFYF7tmzi0wZcH2aqHdrpsnV0gKO9qP4+eRnStCy1vKP5F7gxct96OOrzQM+A3U0R1vmZceH6majlIoceq4UunCTVct+IKBgREOe8MlFJzXrYaRbeYlMz6sT0AS0kgjNRuJZx2x8SZnM3Sa6UZluv9avzATcnzsyISny4nr1UwNh5lc8KTNROtUwdmtv2O0glz5Iv9g0OhQxvqaspxD6WWRCLJLbSh8qcYOwLrv6hlr+dugfVyK05THAqPHSeSKFTeOJpH8zEsHeOxSqy/BJN1W9vs9yOBMA+FZ7puNnLgMlKouizAbOAwL3MWPP2TtpOPQTomtyzdrnU2zhaktToL6n43FRGdYpF4MarbzIrZ21q+XT0JD6f39Uv2jJ+DfWG4U5urTyalSMlDuqwBb5b3nFbEm+ElTiZUR1kVfavWjeiZ54jNy+WFf9buByEyhSMx5oV4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40197a57-9579-4d02-8292-08dc7acdca12 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 02:12:25.7942 (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: Ob50cMsaea3VLaNAZ+XEQvrKf0DwhxJe86NwtkeJwxSe9U9cO/9AtXr5HewaLFdfFnw5IfIQUJbI5qxZvFtkQQWYjVZ+5z/zkKN633MiLuXpg0GSsoFdx3YNL/O/N40o X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9434 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 33671437ee89..2a3da1d91377 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 711b2f49ed88..c4d80cad5982 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2795,6 +2795,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; @@ -2805,43 +2806,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 limition + */ + 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 Thu May 23 02:12:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13671216 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2064.outbound.protection.outlook.com [40.107.114.64]) (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 675A07482; Thu, 23 May 2024 02:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430364; cv=fail; b=e3KlD03rVuqv4+XbQJ4+H1aEi/jxnclRbFnZsFcckvs19LuvORlIrb+lwiOAlf6sVmWGnpbYLqjGua+3j4vCd45wWjeYqJUVFVsCwLToTt0BM/Aa7379x5aAh6+8a4icGDh0Gx9J0iVZZftjfOrV+ELNbkEskXGtgOrgQlvsG80= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430364; c=relaxed/simple; bh=V26oq/jEBuHmtmzWmxKXdh/2CooPbdgxGoP/yXr9hJg=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=EYRydel6kDXnx+PTm0DsocOK/vj69bhxt4TOqGafqY3lGkjyAVU4KPRWNA28DWelNnP6NdB6YusWJbaMtQXmXjteyc2JDCVeT5is300MT0DcMEzKarXDVyui7mM6pDQDgXxHAQLQ9Eyi8hlOAKsEcq6g941XydO7HMVzDVOtLW4= 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=g5ldtBhY; arc=fail smtp.client-ip=40.107.114.64 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="g5ldtBhY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrUOxjkQlzWwXY0n1xSnG8Bm2+nh0AExX6GKngnPEAmtkGKJU4F9Mc4Ei4OAGtycqj8tFGcb9s3yBWKhK86DdUiog/bz4cy+xex2wfaZAIGL9gF59Pd2GoicXseEvXXlIUg1Yquh8efLsMB67gFrryjebCACD5bUI6jUE2LbKQkgL6L4u4VPaNlmAKwUYxqFQMJteJof1lt6W5LpWIb5T/4h7d6KHjooz6G/lBRh34+xDql+jD4cCK4w1BpRnX92GtDLMALZ5W1Ccart3KQ1DURJmWcqXi8cJ1WmXJ8zwWvP/Ebyin+gDBiukM9aq9YfKNDUlW8MlTXPJtNBEtTkiw== 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=CRUm0j8HbcTIps1RR/L4MoVoqYV3uliAQYSR4xdus4I=; b=lFY/W9OtxPShwLcTdqzyQVNKbNBoevcuszZAqLQ7k7qtAks87wX94h4T0YR83FyBV3wTbLbz/sMwN8BDf6v92LC9/o0z9VPVyoCLWdtquqsWdQV6ML47HxBEYoNSVhOW5NMUXWLnRKOv62maORn7+Zo9tPn1aWJpJP8hm6Y++75q7ueGP1tO9rgK0FmTJfGXnQ12/k1sGFKz9jvXAzkv2RyP6xKfsJRY/Bml23EENlSW2FTGeo0GCwJy2efwjD/+cjBoEY0YdQqlyaF5zwiqVGGs7guzIsWfhlbUW+0Y3vJDV3oOzLlqM4E+aEGwOLx469FBG+MwFeOSmRlHg9XfUg== 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=CRUm0j8HbcTIps1RR/L4MoVoqYV3uliAQYSR4xdus4I=; b=g5ldtBhYX7s/j5aZXS1itzXLsByx3ZdvUGmG3PQ6XeeMROJm5s4H/MJlNmH8hyNcbijG/+xEsMyUoS6UH1BjNt9afKHDtUBuohMPDcIrQTS8snrvxYaDO20I/qWxGUNzjO2wCqm0OotDtFfzPk6VxJfoxwn9eXFs4j+jUNpyogw= 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 TYCPR01MB9434.jpnprd01.prod.outlook.com (2603:1096:400:195::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 23 May 2024 02:12:39 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.016; Thu, 23 May 2024 02:12:39 +0000 Message-ID: <87y181mg2y.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: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> References: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 2/3] ASoC: remove snd_soc_dai_link_set_capabilities() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Thu, 23 May 2024 02:12:38 +0000 X-ClientProxiedBy: TYCP286CA0100.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::7) 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_|TYCPR01MB9434:EE_ X-MS-Office365-Filtering-Correlation-Id: 478cdb76-d9b7-46ee-f2de-08dc7acdd25e 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:13230031|52116005|7416005|1800799015|376005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: Tt+lw2GvyqSWDpMySd7MGEkibAQ2xqnVJI2PQMdCOvtxKVn/38NukgzWVJFF/Ac1IrzcZ76Zp15Co5BRzqStJMag6C96mKLwKfkZMZ+X2HjeD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HXGusdqIy3e9EWoh6oVl7S/zntFQH4tuDTcOd9aQ3EFVBmW5K89J7vRhIGKgIhzguY0a9Vq4yd+W7Mmfl2Wt4CDT0NGJan7vRmICBNcyJKlpZyiOO1mrdH02WBtBk4SbOwhkrkv1BRfMSSko349FpbBrE3EaUPlTfEtCWadyp/YHXJc4KTw7nsJnmTqoYMiH0Fwfd0upp2e2iorcQS0= 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: wvhbhqIlwW6sV2qFzLdyZ1+Ujo8lURVWAfuPwxGzlUDiNEH4CwsMQqQpmc+yCgfnIrqFAKr5L+HemTHvrWOD/hMcS92HGadBvrFRw5qxw+zy7t+r3xIFBaWZ5yN7AHGmhuUYCdM6Q/lYM/7jw77Ig/f2JwOhHkshW9W8vTOGjse711lpyRJLt1GZ/U+s2DfzPDSK4IlWa/tOWky8I4tLPFt2oPB6pQP9MYkmERSAvy1kMdpIZZCpRXImNrEk+Bz8XTZ1cfP+rx68PaCouo/BfJD3wl1a67+h5QDNe384w2HFGcFZ3bOhKLez10RJ8qvFgA9q9MweL9DTaK70gyxJwHJUrh3+FFLA7SFuX7rKNhi9bG1EWRgl8oAMYX88E5fNNHI5BN3yVYQYcCbhQA+WdH+1EydkboCgPCV+8olnhagh2vDf6b9gswMY9JpTv0yTrp6TJsPu1NxnBwXHyZV9zce2rnbZQSXhV04liQAL3/UtUDEejkArhLRREbBASxelMULSwtt5THYqDtw/gUtpQ2LkqB1SM1pxHL04XOlGSDSrE7+U31PDSwYJzSqwXPdS2Y5u9zf14uo4SArmbfoiezBXWBl525ISHHDjgcc0Ofup755pNWp72UVf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-08dc7acdd25e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 02:12:39.7143 (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: VI4/IhYIrJ4xxMSX4LesWbfDJNK2CL+takLqi/TbkrXM+/OtV+JMhPaaTYubhV1AVS3S78yLxShkEUmNlaJmFgYbMzh6BHIz6SNRxSThlJlw1IgtDSet6nQNwYUPm8Dk X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9434 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/catpure 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 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 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 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 81e84095107e..6aeb578891f6 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 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 3d02aa3844f2..11cbcb588336 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) { From patchwork Thu May 23 02:13:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13671217 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2082.outbound.protection.outlook.com [40.107.114.82]) (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 916167470; Thu, 23 May 2024 02:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430396; cv=fail; b=fzGmisqSX6TFMPdEBOz5xddLZ2KfG3x/9ZKDu8hkUFZFL+Z/VqpywXcDo81asO8/jvG56t2uSoii/Exu1hTAMONWmm1oM9kW0BSuqnn1Y6SiCRtxLkGFB6HK1UoZSdcE6gvf4MvU4+rh37ih6zoMykLO7QSOLzi5FsaoMiDydo0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716430396; c=relaxed/simple; bh=zt1hZwnS8CntM7/tETv3kXf/Tl2a4TlBiJG0KRNTiqE=; h=Date:Message-ID:To:In-Reply-To:References:From:Subject: Content-Type:MIME-Version; b=g0eUCdUEX5YqQhI6OFi653UBXwsjdSOt7LWZulBpJIkYTq3D2VJEB5JW6+M+d/Qk4EdAgUTtsl92O6fwmhokvb0FKq+/H18OyY1Rcl6IWsgjCJZDxHRc1/XAs47jASWMxCg87iCDGH8L6JQ2qDvYsm0RIf2P6otE8X7T7AtrQAo= 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=gWVP+HOe; arc=fail smtp.client-ip=40.107.114.82 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="gWVP+HOe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MKrpEtgJlvhaEW4xbAUr9J1kBENm9qZwvu7nVzEdOpEpwR1jqTXf9M7Upl8H3v4RDPYQmrCFbS0i1ZPw2Rp6AGSq6nQ/q7oBMTvneGDQnQjYoQJIGqSHnLixcR8d1JEV5aEW7VkXuKYfnqtXwy0fOVgq7aX316qDeqtJeJmdlob/kVafepGLOSAMVNad/aNvtah6KR9TO5U3CWXCRhKN4znEpM1YntphXyf18bxQwMurgMIfeP3tVQkEB0qUnLhKW5/Os6Pur6yXLZ2F7r2Ai5H1nKLRDWJR7L4MMUCqv8fUj78qXQmdzARAGtjrfInpciOeOrNzHdi7pxjQFqpL4A== 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=9/RPTnwkzZIAalYTXmYVqbX5Qb8hkDaoZsE6UJxj1FE=; b=TxWY0KyuyK66JrPWFE931RZbC2Lrjo11z3wCp0hmyykSDz4v6IO1z2SGuKY+4WjzHnwgrehPQgl8m+j9sv40bYKIUjxvm8LOXkAjIT6lJcKWF4Zjn2r0QFyjHqzMuF8FoXxFHa7oVebqmhzPybk/iTSOQAZ7b5N12k0Dwph1I+jvZnwnS/ZQ9+8rL71ogL/OgudRl1PEQO2lT4DWvjWyrnCw0bMJUXX+4XEkbG+V5ai07DpyeopCabHH0yJyow42U13xONmgtKsMVK6TVxve8biOUNkjKFku9EURyUKwFG5cUETW62XT+D2cINXlDf+DnL3OWanhe9ZLIp2gChzH2Q== 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=9/RPTnwkzZIAalYTXmYVqbX5Qb8hkDaoZsE6UJxj1FE=; b=gWVP+HOeLLyfQeBmJmfhm9Vcyh704FvbA1pfVzApCCHJWcpGV+yOptli7T83YPsVyqPeGeH/fo2370ONRVIRJAhacwukQzocV1K8X1jDtWuodUXsxunnUse1jD47PtrW+R6sCuIhazvRo9nL4ZueDnJGBa2QpfqlmG19JjefwTs= 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 TYCPR01MB9434.jpnprd01.prod.outlook.com (2603:1096:400:195::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 23 May 2024 02:13:12 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.016; Thu, 23 May 2024 02:13:12 +0000 Date: Thu, 23 May 2024 11:13:11 +0900 Message-ID: <87wmnlmg20.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: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> References: <871q5tnuok.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 3/3] ASoC: amlogic: do not use dpcm_playback/capture flags User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 X-ClientProxiedBy: TYCP286CA0328.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::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_|TYCPR01MB9434:EE_ X-MS-Office365-Filtering-Correlation-Id: d8e14e43-270e-4c3d-2e7a-08dc7acde5a2 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:13230031|52116005|7416005|1800799015|376005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: zOsmQT10YVRL8uzCrVmr5lQrgRxb/V9RCFVFio537aMYfd7kvKPVATg6A3hF+K1f7zEM33VSX6YLTpxk/9wKwhbhD9Ny7VZa0ly61P0xMSYXXoghN8CllvN6KpRhudwVYvz+4HZQopmSC2//CXQwULOJwPviOG5MBtRAsflC760A3H28mDMceQws0T+s9fHJyxNZms8xmg45/+WYqCoRT/yD7e98TH/235Z4yM22r2o4LocQUFjCVp2yH3tMnVuEUa09bK0SOcqoiDfVVedTOIIbbYeIaJiUeBeL0PIS4R9UuCK0JnZWXOek7bJBn8Ekg6V1Yms5mq60rYobJbiB5ZxAOC3v7QL8XV0xoQwH8/SA5Vz/LJChvYO037BgWXD+l3ZC4Z6bRpzbMNy12RZBeoEsfkfzvdCP2t1N3QI6THdI/GYHJdHtWuixxiSAY4Tzxw+3gYjl6uolFyqeazinqIZluzIwxc9ak/u1TFCQzIkLHsiFQsrAT0qF3AJ8ned33db8czeExIFHOixX97xmAymBTwdyTzIG1fPNLshmtURKunsxtyQGkKuOvckd3scfdxHASNpFyeR4O7Jo3X00DZWQ7j+eFlCtYycm0fICu4UuEDSt+yjQcBI3f4eO0zrxio7D1fxj/xiwIR5FRzsVqFW8+K1t67zGLeJd9fForM2iPL1OXa6FbkEgoheM0EkvcLZcWLFJRStG3anuVhKlZF8yPzrQX6Z3CwHqtGxwrr84YXeEE8RU016k+8dneYkfSZPFg/45sSy8I1An7X3zgRh8idRmaQNW6g3dBIeUcF5OS0qz6tX8EraZv2hdLXrllCogeC2sqCCLEDfHCaQxlCZgfR0Q25OxRnVrTbzalCWVABJMgw3rXZ/d/SK9uWtAZuQGTsBTLNEZqCX0/NzFhazaumCVGu0OIOoJlkKHyemXRGii2sHG1tnlS0YrgNPmlqlvlZC63I1rk3kixF7tZGoYjK/yWNPOyeQhrHX39yu+YOKZhZCSPABsXKLLMr5r+jjZy0H1fBqKZj/sK3sm2AlZ4nEOzgVPyZnFk0lBKvPWfdD8Az98i8rVgUeOtdG3UaNCYkeoXesEls0CPX6W6l6EaqL0Pmsk9JEl6NE14CcnGcmX2IVIT7NNOGc3MKQgkA81dQNfKcw+KtqJRNQ1ork4YlM7gH6tmubbh7Q9oB5LlPk1V/gLNxrGExD1XIRAd05+1jWuH9mUVLsKm04XgTX5lpKv5jHZr+HdE07+fYkTbLUL4XaWrXSJIUWWcI2+ERBslppqMbzC6FHEDp4at2S9xKpA8581RUpCQ5GmnkF0+5nqVhZO2DxenqkDJEb/B5WAtfbrqbbXsb/1xJ11aN8ayE+pRsrNC7/GeK542Ko= 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: rILQgsL/cGJcDrnAVVyqcSlLUEL+w/zVb6rLLZmQZ1AUrSpl8Le/1iKEQC9397YrOtt3/ELHwo7NNNERo1WqoALRXGYnU6yCG0iSF4READvt2cG2l3b5jq18OGI+zzUa63wWqR1e30WuIzQcP5kch5z8xMr1dhAyAawEihIPJw6tUHOykf/Q2iQce2zeW+01rxOFTuhSxx4sraJQflZyZIkrvqcOpz9BO2r5ir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uggSDtZlQx04gTMndPbSRYdiW/FldzOvDkwJznFu2/lcN4N/a0cwalUhru5oKvz8M5mAucq31nZ6CCZoBgVB1tsvXNXItXo9+BSzJNAmhFw1Hi35wxyZkgjsqtahpB+XjTrddt1CVywQn0ozuiY+boEqVCOhUUmSSq2zSOXq7HRnvvabkid+dLYdlj93cW8MZ0qyXxr1LRPKZrEHjSdu8KElKnsucPJpeCQdse/p2+CV3b/i5YXaRisxaz09UkRzxVOgFKb4XIgGoNUtLusadq5MPGblKU1m8D3R6oEbI5ra0WyAZ+1WaILb2QB55QTy+kUhaButrWycFzqZUyY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8e14e43-270e-4c3d-2e7a-08dc7acde5a2 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 02:13:12.0354 (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: 2De2uE7xQFUW9bghsnMCMP+qfh+/WXV2jpMPxG0a4XAh+nBmx41rPUa4+S3N/mad/T6q97HNW2Ds88U0OrO9g9XJVXvsLjJOUHNSZ3yZxh/z0nVOL5PM0DXbxcX9UBGi X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9434 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"); }