Skip to contentSkip to conversation

ASoC: Fix for master playback/capture volume range for TWL4030 codec

PATCH In review Peter Ujfalusi 3 participants 3 messages Nov 14, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Fix for master playback/capture volume range for TWL4030 codec

FGAIN for playback is in range of 0-0x3f, while for capture GAIN it is in the range of 0-0x1f.
The original value of 128 (0x7f) would modify the CGAIN also for playback.

---
 sound/soc/codecs/twl4030.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +2 -2
index 90f3b4d..65aeabe 100644
@@ -192,10 +192,10 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
 	SOC_DOUBLE_R("Master Playback Volume",
 		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-		0, 127, 0),
+		0, 0x3f, 0),
 	SOC_DOUBLE_R("Capture Volume",
 		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
-		0, 127, 0),
+		0, 0x1f, 0),
 };
 
 /* add non dapm controls */
Signature · 1 line
1.6.0.3
#1 lore raw
Quoted 6 lines · Peter Ujfalusi

FGAIN for playback is in range of 0-0x3f, while for capture GAIN it is in the range of 0-0x1f.
The original value of 128 (0x7f) would modify the CGAIN also for playback.

CCing in Steve Sakoman who wrote the driver.

Quoted 29 lines
---
 sound/soc/codecs/twl4030.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +2 -2
index 90f3b4d..65aeabe 100644
@@ -192,10 +192,10 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
 	SOC_DOUBLE_R("Master Playback Volume",
 		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-		0, 127, 0),
+		0, 0x3f, 0),
 	SOC_DOUBLE_R("Capture Volume",
 		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
-		0, 127, 0),
+		0, 0x1f, 0),
 };
 
 /* add non dapm controls */
Signature · 6 lines
1.6.0.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Signature · 1 line
"You grabbed my hand and we fell into it, like a daydream - or a fever."
Acked-by
#2 lore raw
Quoted 9 lines · Mark Brown
Quoted 6 lines · Peter Ujfalusi

FGAIN for playback is in range of 0-0x3f, while for capture GAIN it is in the range of 0-0x1f.
The original value of 128 (0x7f) would modify the CGAIN also for playback.

CCing in Steve Sakoman who wrote the driver.

Good catch! Not sure how this slipped in, since I recall fixing this at one point :-(

Thanks!

Steve

Quoted 30 lines
Quoted 29 lines
---
 sound/soc/codecs/twl4030.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +2 -2
index 90f3b4d..65aeabe 100644
@@ -192,10 +192,10 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
 	SOC_DOUBLE_R("Master Playback Volume",
 		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-		0, 127, 0),
+		0, 0x3f, 0),
 	SOC_DOUBLE_R("Capture Volume",
 		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
-		0, 127, 0),
+		0, 0x1f, 0),
 };
 
 /* add non dapm controls */
Signature · 6 lines
1.6.0.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel