diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-12-04 11:18:36 +0800 |
---|---|---|
committer | Nicolin Chen <Guangyu.Chen@freescale.com> | 2014-01-16 19:27:47 +0800 |
commit | 1a885fa5391e73fd49da1d343a8dd18fbd7d8591 (patch) | |
tree | 02435de4952ac43d5c0d14d172dd03271aee19a2 /sound | |
parent | d8c49cbc0b7f56c73f5b3923f07ec1c23ed62b0a (diff) |
ASoC: soc-pcm: Use valid condition for snd_soc_dai_digital_mute() in hw_free()
The snd_soc_dai_digital_mute() here will be never executed because we only
decrease codec->active in snd_soc_close(). Thus correct it.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 7f62b6ee767586ee7e5d12787dbaaaf47a91979a)
(cherry picked from commit 7ff4bd4a786d049cd4bc7306920e01f348acdaca)
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-pcm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 037921b0e5d6..36fe8b365c5a 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -650,7 +650,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) struct snd_soc_platform *platform = rtd->platform; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai; - struct snd_soc_codec *codec = rtd->codec; + bool playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); @@ -668,7 +668,8 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) } /* apply codec digital mute */ - if (!codec->active) + if ((playback && codec_dai->playback_active == 1) || + (!playback && codec_dai->capture_active == 1)) snd_soc_dai_digital_mute(codec_dai, 1, substream->stream); /* free any machine hw params */ |