Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Jaroslav Kysela <perex@perex.cz>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Takashi Iwai <tiwai@suse.com>, Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shengjiu Wang <shengjiu.wang@nxp.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH 10/20] ASoC: fsl: replace dpcm_playback/capture to playback/capture_only
Date: Thu, 18 May 2023 05:48:08 +0000	[thread overview]
Message-ID: <87o7mip4vc.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87353uqjiu.wl-kuninori.morimoto.gx@renesas.com>

soc_get_playback_capture() is now handling DPCM and normal comprehensively
for playback/capture stream. We can use playback/capture_only flag
instead of using dpcm_playback/capture. This patch replace these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/fsl/fsl-asoc-card.c | 16 ++++++----------
 sound/soc/fsl/imx-audmix.c    |  6 ++----
 sound/soc/fsl/imx-card.c      |  4 ++--
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 40870668ee24..917d9da5c57f 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -311,8 +311,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
 	{
 		.name = "HiFi-ASRC-FE",
 		.stream_name = "HiFi-ASRC-FE",
-		.dpcm_playback = 1,
-		.dpcm_capture = 1,
 		.dynamic = 1,
 		SND_SOC_DAILINK_REG(hifi_fe),
 	},
@@ -321,8 +319,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
 		.stream_name = "HiFi-ASRC-BE",
 		.be_hw_params_fixup = be_hw_params_fixup,
 		.ops = &fsl_asoc_card_ops,
-		.dpcm_playback = 1,
-		.dpcm_capture = 1,
 		.no_pcm = 1,
 		SND_SOC_DAILINK_REG(hifi_be),
 	},
@@ -633,8 +629,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-tlv320aic31xx")) {
 		codec_dai_name = "tlv320dac31xx-hifi";
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
-		priv->dai_link[1].dpcm_capture = 0;
-		priv->dai_link[2].dpcm_capture = 0;
+		priv->dai_link[1].playback_only = 1;
+		priv->dai_link[2].playback_only = 1;
 		priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT;
 		priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
 		priv->card.dapm_routes = audio_map_tx;
@@ -660,15 +656,15 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 		priv->dai_fmt = SND_SOC_DAIFMT_LEFT_J |
 				SND_SOC_DAIFMT_CBC_CFC |
 				SND_SOC_DAIFMT_NB_NF;
-		priv->dai_link[1].dpcm_capture = 0;
-		priv->dai_link[2].dpcm_capture = 0;
+		priv->dai_link[1].playback_only = 1;
+		priv->dai_link[2].playback_only = 1;
 		priv->card.dapm_routes = audio_map_tx;
 		priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx);
 	} else if (of_device_is_compatible(np, "fsl,imx-audio-wm8524")) {
 		codec_dai_name = "wm8524-hifi";
 		priv->dai_fmt |= SND_SOC_DAIFMT_CBC_CFC;
-		priv->dai_link[1].dpcm_capture = 0;
-		priv->dai_link[2].dpcm_capture = 0;
+		priv->dai_link[1].playback_only = 1;
+		priv->dai_link[2].playback_only = 1;
 		priv->cpu_priv.slot_width = 32;
 		priv->card.dapm_routes = audio_map_tx;
 		priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx);
diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c
index efbcd4a65ca8..5cf7bb861698 100644
--- a/sound/soc/fsl/imx-audmix.c
+++ b/sound/soc/fsl/imx-audmix.c
@@ -255,10 +255,10 @@ static int imx_audmix_probe(struct platform_device *pdev)
 		priv->dai[i].cpus->of_node = args.np;
 		priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev);
 		priv->dai[i].dynamic = 1;
-		priv->dai[i].dpcm_playback = 1;
-		priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0);
 		priv->dai[i].ignore_pmdown_time = 1;
 		priv->dai[i].ops = &imx_audmix_fe_ops;
+		if (i)
+			priv->dai[i].playback_only = 1;
 
 		/* Add AUDMIX Backend */
 		be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
@@ -278,8 +278,6 @@ static int imx_audmix_probe(struct platform_device *pdev)
 		priv->dai[num_dai + i].cpus->of_node = audmix_np;
 		priv->dai[num_dai + i].cpus->dai_name = be_name;
 		priv->dai[num_dai + i].no_pcm = 1;
-		priv->dai[num_dai + i].dpcm_playback = 1;
-		priv->dai[num_dai + i].dpcm_capture  = 1;
 		priv->dai[num_dai + i].ignore_pmdown_time = 1;
 		priv->dai[num_dai + i].ops = &imx_audmix_be_ops;
 
diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index 78e2e3932ba5..6e3ce0817478 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -826,8 +826,8 @@ static int imx_card_probe(struct platform_device *pdev)
 		}
 		for_each_card_prelinks(&data->card, i, link) {
 			if (link->dynamic == 1 && link_be) {
-				link->dpcm_playback = link_be->dpcm_playback;
-				link->dpcm_capture = link_be->dpcm_capture;
+				link->playback_only = link_be->playback_only;
+				link->capture_only  = link_be->capture_only;
 			}
 		}
 	}
-- 
2.25.1


  parent reply	other threads:[~2023-05-18  5:50 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  5:46 [PATCH 00/20] ASoC: replace dpcm_playback/capture to playback/capture_only Kuninori Morimoto
2023-05-18  5:46 ` [PATCH 01/20] ASoC: soc-pcm.c: indicate error if stream has no playback no capture Kuninori Morimoto
2023-05-18 10:37   ` Amadeusz Sławiński
2023-05-18  5:46 ` [PATCH 02/20] ASoC: soc-pcm.c: use dai_link on soc_get_playback_capture() Kuninori Morimoto
2023-05-18 10:37   ` Amadeusz Sławiński
2023-05-18  5:46 ` [PATCH 03/20] ASoC: soc-pcm.c: cleanup soc_get_playback_capture() error Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-18  5:47 ` [PATCH 04/20] ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture() Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-18 23:12     ` Kuninori Morimoto
2023-05-18  5:47 ` [PATCH 05/20] ASoC: soc-pcm.c: tidyup playback/capture_only " Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-18  5:47 ` [PATCH 06/20] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part1 Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-18  5:47 ` [PATCH 07/20] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part2 Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-18  5:47 ` [PATCH 08/20] ASoC: soc-pcm.c: cleanup soc_get_playback_capture() Kuninori Morimoto
2023-05-18 10:38   ` Amadeusz Sławiński
2023-05-19  9:57   ` Amadeusz Sławiński
2023-05-22  4:35     ` Kuninori Morimoto
2023-05-22  9:14       ` Amadeusz Sławiński
2023-05-22 23:49         ` Kuninori Morimoto
2023-05-24 11:21           ` Amadeusz Sławiński
2023-05-24 23:48             ` Kuninori Morimoto
2023-05-18  5:47 ` [PATCH 09/20] ASoC: amd: replace dpcm_playback/capture to playback/capture_only Kuninori Morimoto
2023-05-18  5:48 ` Kuninori Morimoto [this message]
2023-05-18  5:48 ` [PATCH 11/20] ASoC: sof: " Kuninori Morimoto
2023-05-18  5:48 ` [PATCH 12/20] ASoC: meson: " Kuninori Morimoto
2023-05-18  5:48 ` [PATCH 13/20] ASoC: Intel: " Kuninori Morimoto
2023-05-18 10:39   ` Amadeusz Sławiński
2023-05-18 23:15     ` Kuninori Morimoto
2023-05-18  5:49 ` [PATCH 14/20] ASoC: samsung: " Kuninori Morimoto
2023-05-18  5:49 ` [PATCH 15/20] ASoC: mediatek: " Kuninori Morimoto
2023-05-18  5:49 ` [PATCH 16/20] ASoC: soc-dai.c: " Kuninori Morimoto
2023-05-18 10:39   ` Amadeusz Sławiński
2023-05-18 23:18     ` Kuninori Morimoto
2023-05-18  5:49 ` [PATCH 17/20] ASoC: soc-core.c: " Kuninori Morimoto
2023-05-18 10:39   ` Amadeusz Sławiński
2023-05-18  5:49 ` [PATCH 18/20] ASoC: soc-topology.c: " Kuninori Morimoto
2023-05-18 10:40   ` Amadeusz Sławiński
2023-05-18  5:49 ` [PATCH 19/20] ASoC: soc-compress.c: " Kuninori Morimoto
2023-05-18 10:40   ` Amadeusz Sławiński
2023-05-18  5:49 ` [PATCH 20/20] ASoC: soc-pcm.c: remove dpcm_playback/capture Kuninori Morimoto
2023-05-18 10:40   ` Amadeusz Sławiński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7mip4vc.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox