diff options
author | Mark Brown <broonie@linaro.org> | 2014-06-21 16:33:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-21 16:33:18 -0400 |
commit | 647d62d9ff499ad3a2f8dc067aae3ed82386cf05 (patch) | |
tree | 6aebf9d7af162debaa3c4802d57c8187574218f6 | |
parent | 7df3788410e674423375b88e2d95c46e4015f5f5 (diff) | |
parent | 18626c7ebc05e6486712cc129d8da83d07da9dc7 (diff) |
Merge remote-tracking branch 'asoc/fix/core' into asoc-component
-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 3ccbf9ba04b2..fab1a8813abf 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2762,7 +2762,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2762 | unsigned int mask = (1 << fls(max)) - 1; | 2762 | unsigned int mask = (1 << fls(max)) - 1; |
2763 | unsigned int invert = mc->invert; | 2763 | unsigned int invert = mc->invert; |
2764 | unsigned int val; | 2764 | unsigned int val; |
2765 | int connect, change; | 2765 | int connect, change, reg_change = 0; |
2766 | struct snd_soc_dapm_update update; | 2766 | struct snd_soc_dapm_update update; |
2767 | int ret = 0; | 2767 | int ret = 0; |
2768 | 2768 | ||
@@ -2780,20 +2780,23 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2780 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); | 2780 | mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); |
2781 | 2781 | ||
2782 | change = dapm_kcontrol_set_value(kcontrol, val); | 2782 | change = dapm_kcontrol_set_value(kcontrol, val); |
2783 | if (change) { | ||
2784 | if (reg != SND_SOC_NOPM) { | ||
2785 | mask = mask << shift; | ||
2786 | val = val << shift; | ||
2787 | |||
2788 | if (snd_soc_test_bits(codec, reg, mask, val)) { | ||
2789 | update.kcontrol = kcontrol; | ||
2790 | update.reg = reg; | ||
2791 | update.mask = mask; | ||
2792 | update.val = val; | ||
2793 | card->update = &update; | ||
2794 | } | ||
2795 | 2783 | ||
2784 | if (reg != SND_SOC_NOPM) { | ||
2785 | mask = mask << shift; | ||
2786 | val = val << shift; | ||
2787 | |||
2788 | reg_change = snd_soc_test_bits(codec, reg, mask, val); | ||
2789 | } | ||
2790 | |||
2791 | if (change || reg_change) { | ||
2792 | if (reg_change) { | ||
2793 | update.kcontrol = kcontrol; | ||
2794 | update.reg = reg; | ||
2795 | update.mask = mask; | ||
2796 | update.val = val; | ||
2797 | card->update = &update; | ||
2796 | } | 2798 | } |
2799 | change |= reg_change; | ||
2797 | 2800 | ||
2798 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); | 2801 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); |
2799 | 2802 | ||