From 273323477e41bdef0cf9b884f9330998b7730999 Mon Sep 17 00:00:00 2001 From: Alan Tull Date: Tue, 24 Nov 2009 16:20:38 -0600 Subject: ENGR00117456: fix dac_get_volsw Fix shift direction. Don't return left channel value for both channels. Signed-off-by: Alan Tull --- sound/soc/codecs/sgtl5000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 9cc8756ccccd..1d5843e94bd0 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -317,8 +317,8 @@ static int dac_get_volsw(struct snd_kcontrol *kcontrol, int reg, l, r; reg = sgtl5000_read(codec, SGTL5000_CHIP_DAC_VOL); - l = (reg & SGTL5000_DAC_VOL_LEFT_MASK) << SGTL5000_DAC_VOL_LEFT_SHIFT; - r = (reg & SGTL5000_DAC_VOL_RIGHT_MASK) << SGTL5000_DAC_VOL_RIGHT_SHIFT; + l = (reg & SGTL5000_DAC_VOL_LEFT_MASK) >> SGTL5000_DAC_VOL_LEFT_SHIFT; + r = (reg & SGTL5000_DAC_VOL_RIGHT_MASK) >> SGTL5000_DAC_VOL_RIGHT_SHIFT; l = l < 0x3c ? 0x3c : l; l = l > 0xfc ? 0xfc : l; r = r < 0x3c ? 0x3c : r; @@ -327,7 +327,7 @@ static int dac_get_volsw(struct snd_kcontrol *kcontrol, r = 0xfc - r; ucontrol->value.integer.value[0] = l; - ucontrol->value.integer.value[1] = l; + ucontrol->value.integer.value[1] = r; return 0; } -- cgit v1.2.3