ALSA: ASoC: Use codec digital mute when stopping playback
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 6 Sep 2008 17:33:24 +0000 (18:33 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 9 Sep 2008 07:11:59 +0000 (09:11 +0200)
Muting the DAC masks artefacts introduced as the digital stream shuts
down, for example when the input stops being clocked.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/soc-core.c

index 1563ceedf61a09e8f3fdd3a2b6367ad544534fd5..ad381138fc2e482e0bf0110a96cf32c385ba8c04 100644 (file)
@@ -340,6 +340,12 @@ static int soc_codec_close(struct snd_pcm_substream *substream)
        }
        codec->active--;
 
+       /* Muting the DAC suppresses artifacts caused during digital
+        * shutdown, for example from stopping clocks.
+        */
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               snd_soc_dai_digital_mute(codec_dai, 1);
+
        if (cpu_dai->ops.shutdown)
                cpu_dai->ops.shutdown(substream);