diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-05-04 13:17:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-05 15:31:14 -0400 |
commit | c9e065c27fe9b81e5d6e7681d77a24f7b9616675 (patch) | |
tree | d2a53c4808664f3cb35bc6c5db5ed52b4a557176 | |
parent | 00a41d9fe276766c6b3109801cfcac93fa640a05 (diff) |
ASoC: dapm: Make sure to always update the DAPM graph in _put_volsw()
When using auto-muted controls it may happen that the register value will not
change when changing a control from enabled to disabled (since the control might
be physically disabled due to the auto-muting). We have to make sure to still
update the DAPM graph and disconnect the mixer input.
Fixes: commit 5729507 ("ASoC: dapm: Implement mixer input auto-disable")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/soc-dapm.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1e171bd31f2a..fb6c7b793459 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2792,22 +2792,19 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2792 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | 2792 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); |
2793 | 2793 | ||
2794 | change = dapm_kcontrol_set_value(kcontrol, val); | 2794 | change = dapm_kcontrol_set_value(kcontrol, val); |
2795 | |||
2796 | if (reg != SND_SOC_NOPM) { | ||
2797 | mask = mask << shift; | ||
2798 | val = val << shift; | ||
2799 | |||
2800 | change = snd_soc_test_bits(codec, reg, mask, val); | ||
2801 | } | ||
2802 | |||
2803 | if (change) { | 2795 | if (change) { |
2804 | if (reg != SND_SOC_NOPM) { | 2796 | if (reg != SND_SOC_NOPM) { |
2805 | update.kcontrol = kcontrol; | 2797 | mask = mask << shift; |
2806 | update.reg = reg; | 2798 | val = val << shift; |
2807 | update.mask = mask; | 2799 | |
2808 | update.val = val; | 2800 | if (snd_soc_test_bits(codec, reg, mask, val)) { |
2801 | update.kcontrol = kcontrol; | ||
2802 | update.reg = reg; | ||
2803 | update.mask = mask; | ||
2804 | update.val = val; | ||
2805 | card->update = &update; | ||
2806 | } | ||
2809 | 2807 | ||
2810 | card->update = &update; | ||
2811 | } | 2808 | } |
2812 | 2809 | ||
2813 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); | 2810 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); |