From 321894d403e0a2a99823f5dbe2c1ecd92a936b66 Mon Sep 17 00:00:00 2001 From: Viorel Suman Date: Fri, 22 May 2020 11:15:56 +0300 Subject: [PATCH] MLK-24139-4 ASoC: fsl_xcvr: allow playback for SPDIF only Allow playback for SPDIF only. Signed-off-by: Viorel Suman Reviewed-by: Shengjiu Wang --- sound/soc/fsl/fsl_xcvr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index b4b9d492f86e..2291326e8b24 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -187,6 +187,8 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol, struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; unsigned int *item = ucontrol->value.enumerated.item; + struct snd_soc_card *card = dai->component->card; + struct snd_soc_pcm_runtime *rtd; xcvr->mode = snd_soc_enum_item_to_val(e, item[0]); @@ -194,6 +196,10 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol, (xcvr->mode == FSL_XCVR_MODE_ARC)); fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name, (xcvr->mode == FSL_XCVR_MODE_EARC)); + /* Allow playback for SPDIF only */ + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count = + (xcvr->mode == FSL_XCVR_MODE_SPDIF ? 1 : 0); return 0; }