Skip to content

Commit 3841d8a

Browse files
jhovoldbroonie
authored andcommitted
ASoC: soc-pcm: fix up bad merge
A recent change to address pops and clicks with codecs like WSA883X touched the same code paths as a fix for clearing DAI parameters and resulted in a bad merge. Specifically, commit f022057 ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") made mute at stream close conditional, while commit 3efcb47 ("ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive") moved that same mute call back to soc_pcm_hw_clean(). Fix up the bad merge by dropping the second mute call from soc_pcm_clean() and making sure that the call in soc_pcm_hw_clean() is conditional as intended. Fixes: bdb7e19 ("ASoC: Merge up workaround for CODECs that play noise on stopped stream") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20231123091815.21933-1-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cdba430 commit 3841d8a

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

sound/soc/soc-pcm.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,6 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *rtd,
704704
if (snd_soc_dai_active(dai) == 0 &&
705705
(dai->rate || dai->channels || dai->sample_bits))
706706
soc_pcm_set_dai_params(dai, NULL);
707-
708-
if (snd_soc_dai_stream_active(dai, substream->stream) == 0) {
709-
if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger)
710-
snd_soc_dai_digital_mute(dai, 1, substream->stream);
711-
}
712707
}
713708
}
714709

@@ -947,8 +942,10 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime *rtd,
947942
if (snd_soc_dai_active(dai) == 1)
948943
soc_pcm_set_dai_params(dai, NULL);
949944

950-
if (snd_soc_dai_stream_active(dai, substream->stream) == 1)
951-
snd_soc_dai_digital_mute(dai, 1, substream->stream);
945+
if (snd_soc_dai_stream_active(dai, substream->stream) == 1) {
946+
if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger)
947+
snd_soc_dai_digital_mute(dai, 1, substream->stream);
948+
}
952949
}
953950

954951
/* run the stream event */

0 commit comments

Comments
 (0)