Skip to content

Commit 0f77c88

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-compress: remove dpcm_xxx flags
dpcm_xxx flags are no longer needed. It converts dpcm_xxx flag to xxx_only if needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87a5ey9vhj.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b6b8caf commit 0f77c88

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

sound/soc/soc-compress.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,19 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
606606
return -ENOMEM;
607607

608608
if (rtd->dai_link->dynamic) {
609+
int playback = 1;
610+
int capture = 1;
611+
612+
if (rtd->dai_link->capture_only)
613+
playback = 0;
614+
if (rtd->dai_link->playback_only)
615+
capture = 0;
616+
609617
snprintf(new_name, sizeof(new_name), "(%s)",
610618
rtd->dai_link->stream_name);
611619

612620
ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
613-
rtd->dai_link->dpcm_playback,
614-
rtd->dai_link->dpcm_capture, &be_pcm);
621+
playback, capture, &be_pcm);
615622
if (ret < 0) {
616623
dev_err(rtd->card->dev,
617624
"Compress ASoC: can't create compressed for %s: %d\n",
@@ -624,9 +631,9 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
624631

625632
rtd->pcm = be_pcm;
626633
rtd->fe_compr = 1;
627-
if (rtd->dai_link->dpcm_playback)
634+
if (playback)
628635
be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
629-
if (rtd->dai_link->dpcm_capture)
636+
if (capture)
630637
be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
631638
memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
632639
} else {

0 commit comments

Comments
 (0)