diff options
author | Mark Brown <broonie@linaro.org> | 2014-06-16 17:05:15 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-16 17:05:15 +0200 |
commit | 1f84acd2dc21b7c3220256b71f7b25d254a3175b (patch) | |
tree | 9312d2212a1e308855cbfe9c2338a47d07fd1e36 /sound | |
parent | Linux 3.16-rc1 (diff) | |
parent | ASoC: dapm: Make sure register value is in sync with DAPM kcontrol state (diff) | |
download | linux-1f84acd2dc21b7c3220256b71f7b25d254a3175b.tar.xz linux-1f84acd2dc21b7c3220256b71f7b25d254a3175b.zip |
Merge remote-tracking branch 'asoc/fix/core' into asoc-linus
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-dapm.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a74b9bf23d9f..cdc837ed144d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2755,7 +2755,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; unsigned int val; - int connect, change; + int connect, change, reg_change = 0; struct snd_soc_dapm_update update; int ret = 0; @@ -2773,20 +2773,23 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); change = dapm_kcontrol_set_value(kcontrol, val); - if (change) { - if (reg != SND_SOC_NOPM) { - mask = mask << shift; - val = val << shift; - - if (snd_soc_test_bits(codec, reg, mask, val)) { - update.kcontrol = kcontrol; - update.reg = reg; - update.mask = mask; - update.val = val; - card->update = &update; - } + if (reg != SND_SOC_NOPM) { + mask = mask << shift; + val = val << shift; + + reg_change = snd_soc_test_bits(codec, reg, mask, val); + } + + if (change || reg_change) { + if (reg_change) { + update.kcontrol = kcontrol; + update.reg = reg; + update.mask = mask; + update.val = val; + card->update = &update; } + change |= reg_change; ret = soc_dapm_mixer_update_power(card, kcontrol, connect); |