diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-01-27 16:54:05 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-28 08:19:19 -0500 |
commit | e9cf7049330cd44c8af43b0c5c7bef25a086c5b7 (patch) | |
tree | 4ab14e007ccdf79efd7dba846566750f0583d6c2 /sound/soc/soc-dapm.c | |
parent | 0fa63b69284c9bbedf876c677a9e650243cc40be (diff) |
ASoC: Fix mask/val_mask confusion snd_soc_dapm_put_volsw()
snd_soc_dapm_put_volsw() has variables for both the unshifted and
shifted mask for updates commit 97404f (ASoC: Do DAPM control updates in
the middle of DAPM sequences) got confused between the two of these.
Since there's no need to keep a copy of the unshifted mask fix this and
simplify the code by using only one mask variable.
[Completely rewrote the changelog to describe the issue -- broonie.]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 499730ab5638..8194f150bab7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1742 | int max = mc->max; | 1742 | int max = mc->max; |
1743 | unsigned int mask = (1 << fls(max)) - 1; | 1743 | unsigned int mask = (1 << fls(max)) - 1; |
1744 | unsigned int invert = mc->invert; | 1744 | unsigned int invert = mc->invert; |
1745 | unsigned int val, val_mask; | 1745 | unsigned int val; |
1746 | int connect, change; | 1746 | int connect, change; |
1747 | struct snd_soc_dapm_update update; | 1747 | struct snd_soc_dapm_update update; |
1748 | 1748 | ||
@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1750 | 1750 | ||
1751 | if (invert) | 1751 | if (invert) |
1752 | val = max - val; | 1752 | val = max - val; |
1753 | val_mask = mask << shift; | 1753 | mask = mask << shift; |
1754 | val = val << shift; | 1754 | val = val << shift; |
1755 | 1755 | ||
1756 | mutex_lock(&widget->codec->mutex); | 1756 | mutex_lock(&widget->codec->mutex); |
1757 | widget->value = val; | 1757 | widget->value = val; |
1758 | 1758 | ||
1759 | change = snd_soc_test_bits(widget->codec, reg, val_mask, val); | 1759 | change = snd_soc_test_bits(widget->codec, reg, mask, val); |
1760 | if (change) { | 1760 | if (change) { |
1761 | if (val) | 1761 | if (val) |
1762 | /* new connection */ | 1762 | /* new connection */ |