ASoC: core: fix shift used for second item in snd_soc_get_enum_double
authorJaswinder Jassal <jjassal@opensource.wolfsonmicro.com>
Mon, 29 Aug 2016 15:06:58 +0000 (16:06 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 1 Sep 2016 19:58:05 +0000 (20:58 +0100)
Incorrect shift value was being used to extract the second item.

Signed-off-by: Jaswinder Jassal <jjassal@opensource.wolfsonmicro.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c

index a513a34a51d299a8bf7d9ef7799717ceb4a42430..9fc1a7bb8b953a7a2955ea1ca2d31b30fccfee37 100644 (file)
@@ -77,7 +77,7 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
        item = snd_soc_enum_val_to_item(e, val);
        ucontrol->value.enumerated.item[0] = item;
        if (e->shift_l != e->shift_r) {
-               val = (reg_val >> e->shift_l) & e->mask;
+               val = (reg_val >> e->shift_r) & e->mask;
                item = snd_soc_enum_val_to_item(e, val);
                ucontrol->value.enumerated.item[1] = item;
        }