[PATCH 35/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00111296: sgtl5000: fix Playback Volume min not 0

Brad Figg brad.figg at canonical.com
Thu Jul 9 16:48:25 UTC 2009


From: Richard Zhao <b20223 at freescale.com>

correct the offset of volume value and reg value.

Signed-off-by: Richard Zhao <b20223 at freescale.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 sound/soc/codecs/sgtl5000.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 6b9dfe8..954784a 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -321,10 +321,10 @@ static int dac_put_volsw(struct snd_kcontrol *kcontrol,
 	l = ucontrol->value.integer.value[0];
 	r = ucontrol->value.integer.value[1];
 
-	l = l < 0x3c ? 0x3c : l;
-	l = l > 0xfc ? 0xfc : l;
-	r = r < 0x3c ? 0x3c : r;
-	r = r > 0xfc ? 0xfc : r;
+	l = l < 0 ? 0 : l;
+	l = l > 0xfc - 0x3c ? 0xfc - 0x3c : l;
+	r = r < 0 ? 0 : r;
+	r = r > 0xfc - 0x3c ? 0xfc - 0x3c : r;
 	l = 0xfc - l;
 	r = 0xfc - r;
 
-- 
1.6.0.4





More information about the kernel-team mailing list