summaryrefslogtreecommitdiff
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-10-27 22:33:15 +0100
committerMark Brown <broonie@kernel.org>2023-10-27 22:33:15 +0100
commitbdb7e1922052b1e7fcce63e2cfa195958ff97e05 (patch)
treec879f48a63f2680d6d09390e549c3c072be0ed43 /sound/soc/soc-pcm.c
parent0262a8a079896440fab98844124a951d85b63166 (diff)
parent805ce81826c896dd3c351a32814b28557f9edf54 (diff)
ASoC: Merge up workaround for CODECs that play noise on stopped stream
This was sent too late to actually make it for v6.6 but was sent against v6.6 so merge it up here.
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8c168dc553f6..323e4d7b6adf 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -700,10 +700,16 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *rtd,
snd_soc_runtime_deactivate(rtd, substream->stream);
/* Make sure DAI parameters cleared if the DAI becomes inactive */
- for_each_rtd_dais(rtd, i, dai)
+ for_each_rtd_dais(rtd, i, dai) {
if (snd_soc_dai_active(dai) == 0 &&
(dai->rate || dai->channels || dai->sample_bits))
soc_pcm_set_dai_params(dai, NULL);
+
+ if (snd_soc_dai_stream_active(dai, substream->stream) == 0) {
+ if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger)
+ snd_soc_dai_digital_mute(dai, 1, substream->stream);
+ }
+ }
}
for_each_rtd_dais(rtd, i, dai)
@@ -896,8 +902,10 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd,
snd_soc_dapm_stream_event(rtd, substream->stream,
SND_SOC_DAPM_STREAM_START);
- for_each_rtd_dais(rtd, i, dai)
- snd_soc_dai_digital_mute(dai, 0, substream->stream);
+ for_each_rtd_dais(rtd, i, dai) {
+ if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger)
+ snd_soc_dai_digital_mute(dai, 0, substream->stream);
+ }
out:
return soc_pcm_ret(rtd, ret);