From: Mark Brown Date: Fri, 27 Oct 2023 21:33:15 +0000 (+0100) Subject: ASoC: Merge up workaround for CODECs that play noise on stopped stream X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bdb7e1922052b1e7fcce63e2cfa195958ff97e05;p=linux.git 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. --- bdb7e1922052b1e7fcce63e2cfa195958ff97e05 diff --cc sound/soc/soc-pcm.c index 8c168dc553f65,d3bc545971ccd..323e4d7b6adfe --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@@ -698,12 -698,16 +698,18 @@@ static int soc_pcm_clean(struct snd_soc if (!rollback) { snd_soc_runtime_deactivate(rtd, substream->stream); - /* clear the corresponding DAIs parameters when going to be inactive */ + + /* 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) + 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)