diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2013-07-31 10:44:29 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-01 09:48:17 -0400 |
commit | f091f3f07328f75d20a2a5970d1f8b58d95fc990 (patch) | |
tree | 1927daf3cf5962c30d94b865d9c27e5cd59d7d36 /sound/soc | |
parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) |
ASoC: sgtl5000: prevent playback to be muted when terminating concurrent capture
When a sound capture/playback is terminated while a playback/capture
is running, power_vag_event() will clear SGTL5000_CHIP_ANA_POWER in
the SND_SOC_DAPM_PRE_PMD event, thus muting the respective other
channel.
Don't clear SGTL5000_CHIP_ANA_POWER when both DAC and ADC are active
to prevent this.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 6c8a9e7bee25..9303c7d011b2 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -153,6 +153,8 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w, | |||
153 | static int power_vag_event(struct snd_soc_dapm_widget *w, | 153 | static int power_vag_event(struct snd_soc_dapm_widget *w, |
154 | struct snd_kcontrol *kcontrol, int event) | 154 | struct snd_kcontrol *kcontrol, int event) |
155 | { | 155 | { |
156 | const u32 mask = SGTL5000_DAC_POWERUP | SGTL5000_ADC_POWERUP; | ||
157 | |||
156 | switch (event) { | 158 | switch (event) { |
157 | case SND_SOC_DAPM_POST_PMU: | 159 | case SND_SOC_DAPM_POST_PMU: |
158 | snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, | 160 | snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, |
@@ -160,9 +162,17 @@ static int power_vag_event(struct snd_soc_dapm_widget *w, | |||
160 | break; | 162 | break; |
161 | 163 | ||
162 | case SND_SOC_DAPM_PRE_PMD: | 164 | case SND_SOC_DAPM_PRE_PMD: |
163 | snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, | 165 | /* |
164 | SGTL5000_VAG_POWERUP, 0); | 166 | * Don't clear VAG_POWERUP, when both DAC and ADC are |
165 | msleep(400); | 167 | * operational to prevent inadvertently starving the |
168 | * other one of them. | ||
169 | */ | ||
170 | if ((snd_soc_read(w->codec, SGTL5000_CHIP_ANA_POWER) & | ||
171 | mask) != mask) { | ||
172 | snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, | ||
173 | SGTL5000_VAG_POWERUP, 0); | ||
174 | msleep(400); | ||
175 | } | ||
166 | break; | 176 | break; |
167 | default: | 177 | default: |
168 | break; | 178 | break; |