diff options
author | Misael Lopez Cruz <misael.lopez@ti.com> | 2011-08-15 00:03:40 -0500 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-08-30 11:34:22 -0700 |
commit | c57e6dd1bb0a41bc3d9a5f9f676f88d7b9e49f2c (patch) | |
tree | 8de19045f68278afafc2413f54accb8f86bc3b32 /sound/soc/codecs/twl6040.c | |
parent | c1646d60f66cfbf70f11e550ab9513cee80771ce (diff) | |
download | kernel_samsung_tuna-c57e6dd1bb0a41bc3d9a5f9f676f88d7b9e49f2c.zip kernel_samsung_tuna-c57e6dd1bb0a41bc3d9a5f9f676f88d7b9e49f2c.tar.gz kernel_samsung_tuna-c57e6dd1bb0a41bc3d9a5f9f676f88d7b9e49f2c.tar.bz2 |
ASoC: twl6040: Add digital mute
TWL6040 shutdown sequence requires turning analog components off
before PDM interface is disabled. This sequence cannot be achieved
with current ASoC pcm operations.
ASoC enables CODEC's digital mute before shutting down a PCM stream,
this can be used to disable the analog side by sending a DAPM stop
event to DAPM core.
Change-Id: Ice7548164076937f43b703f3c6d464070d1a0ab9
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'sound/soc/codecs/twl6040.c')
-rw-r--r-- | sound/soc/codecs/twl6040.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index d10f988..8b7a80f 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1535,11 +1535,26 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, return 0; } +static int twl6040_digital_mute(struct snd_soc_dai *dai, int mute) +{ + /* + * pop-noise reduction sequence requires to shutdown + * analog side before CPU DAI + */ + if (mute) + snd_soc_dapm_codec_stream_event(dai->codec, + dai->driver->playback.stream_name, + SND_SOC_DAPM_STREAM_STOP); + + return 0; +} + static struct snd_soc_dai_ops twl6040_dai_ops = { .startup = twl6040_startup, .hw_params = twl6040_hw_params, .prepare = twl6040_prepare, .set_sysclk = twl6040_set_dai_sysclk, + .digital_mute = twl6040_digital_mute, }; static struct snd_soc_dai_driver twl6040_dai[] = { |