All of 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>, Takashi Iwai <tiwai@suse.com>,
	Vinod Koul <vkoul@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH v2 20/21] ASoC: soc-compress.c: replace dpcm_playback/capture to playback/capture_only
Date: Thu, 25 May 2023 01:21:55 +0000	[thread overview]
Message-ID: <871qj5gq8c.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87ttw1gqgn.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>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/soc/soc-compress.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index d8715db5e415..cf3cab7a648f 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -602,12 +602,15 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
 		return -ENOMEM;
 
 	if (rtd->dai_link->dynamic) {
+		int playback = !rtd->dai_link->capture_only;
+		int capture  = !rtd->dai_link->playback_only;
+
 		snprintf(new_name, sizeof(new_name), "(%s)",
 			rtd->dai_link->stream_name);
 
+
 		ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
-				rtd->dai_link->dpcm_playback,
-				rtd->dai_link->dpcm_capture, &be_pcm);
+				playback, capture, &be_pcm);
 		if (ret < 0) {
 			dev_err(rtd->card->dev,
 				"Compress ASoC: can't create compressed for %s: %d\n",
@@ -620,9 +623,9 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
 
 		rtd->pcm = be_pcm;
 		rtd->fe_compr = 1;
-		if (rtd->dai_link->dpcm_playback)
+		if (playback)
 			be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
-		if (rtd->dai_link->dpcm_capture)
+		if (capture)
 			be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
 		memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
 	} else {
-- 
2.25.1


  parent reply	other threads:[~2023-05-25  5:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25  1:16 [PATCH v2 00/21] ASoC: replace dpcm_playback/capture to playback/capture_only Kuninori Morimoto
2023-05-25  1:17 ` [PATCH v2 01/21] ASoC: soc-pcm.c: indicate error if stream has no playback no capture Kuninori Morimoto
2023-05-25  1:17 ` [PATCH v2 02/21] ASoC: soc-pcm.c: use dai_link on soc_get_playback_capture() Kuninori Morimoto
2023-05-25  1:18 ` [PATCH v2 03/21] ASoC: soc-pcm.c: cleanup soc_get_playback_capture() error Kuninori Morimoto
2023-05-25  1:18 ` [PATCH v2 04/21] ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture() Kuninori Morimoto
2023-05-25  1:18 ` [PATCH v2 05/21] ASoC: soc-pcm.c: tidyup playback/capture_only " Kuninori Morimoto
2023-05-25  1:18 ` [PATCH v2 06/21] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part1 Kuninori Morimoto
2023-05-25  1:18 ` [PATCH v2 07/21] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part2 Kuninori Morimoto
2023-05-25  1:19 ` [PATCH v2 08/21] ASoC: soc-pcm.c: cleanup soc_get_playback_capture() Kuninori Morimoto
2023-05-25  1:19 ` [PATCH v2 09/21] ASoC: amd: replace dpcm_playback/capture to playback/capture_only Kuninori Morimoto
2023-05-25  1:19 ` [PATCH v2 10/21] ASoC: fsl: " Kuninori Morimoto
2023-05-25  1:20 ` [PATCH v2 11/21] ASoC: sof: " Kuninori Morimoto
2023-05-25  1:20 ` [PATCH v2 12/21] ASoC: meson: " Kuninori Morimoto
2023-05-25  1:20 ` [PATCH v2 13/21] ASoC: Intel: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 14/21] ASoC: samsung: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 15/21] ASoC: mediatek: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 16/21] ASoC: soc-dai.c: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 17/21] ASoC: Intel/avs: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 18/21] ASoC: soc-core.c: " Kuninori Morimoto
2023-05-25  1:21 ` [PATCH v2 19/21] ASoC: soc-topology.c: " Kuninori Morimoto
2023-05-25  1:21 ` Kuninori Morimoto [this message]
2023-05-25  1:22 ` [PATCH v2 21/21] ASoC: soc-pcm.c: remove dpcm_playback/capture Kuninori Morimoto
2023-05-25 23:47 ` [PATCH v2 00/21] ASoC: replace dpcm_playback/capture to playback/capture_only Pierre-Louis Bossart
2023-05-26  1:11   ` Kuninori Morimoto
2023-06-01 23:45     ` Kuninori Morimoto
2023-06-02 14:53       ` Pierre-Louis Bossart
2023-06-04 23:49         ` Kuninori Morimoto
2023-06-02 15:31       ` Mark Brown
2023-06-04 23:31         ` Kuninori Morimoto

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=871qj5gq8c.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.