summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-09-29 15:22:35 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-30 13:55:08 +0100
commit93eebc6982161f317c4a99118a4423bc3933fdfa (patch)
tree69390218fd89c1cd478a98606ce69a8d06e11819 /sound
parenta46737aee59e4e001106e1d3777e0801843361db (diff)
downloadblackbird-obmc-linux-93eebc6982161f317c4a99118a4423bc3933fdfa.tar.gz
blackbird-obmc-linux-93eebc6982161f317c4a99118a4423bc3933fdfa.zip
ASoC: twl6040: correct loop counters for HS/HF ramp code
The Headset gain range is 0 - 0xf (4 bit resolution) The Handsfree gain range is 0 - 0x1d (5 bit resolution, 0x1e, and 0x1f values are invalid) Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl6040.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 1afc5966cbdb..d706bd00d613 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -495,8 +495,8 @@ static void twl6040_pga_hs_work(struct work_struct *work)
if (headset->ramp == TWL6040_RAMP_NONE)
return;
- /* HS PGA volumes have 4 bits of resolution to ramp */
- for (i = 0; i <= 16; i++) {
+ /* HS PGA gain range: 0x0 - 0xf (0 - 15) */
+ for (i = 0; i < 16; i++) {
headset_complete = twl6040_hs_ramp_step(codec,
headset->left_step,
headset->right_step);
@@ -530,8 +530,9 @@ static void twl6040_pga_hf_work(struct work_struct *work)
if (handsfree->ramp == TWL6040_RAMP_NONE)
return;
- /* HF PGA volumes have 5 bits of resolution to ramp */
- for (i = 0; i <= 32; i++) {
+ /*
+ * HF PGA gain range: 0x00 - 0x1d (0 - 29) */
+ for (i = 0; i < 30; i++) {
handsfree_complete = twl6040_hf_ramp_step(codec,
handsfree->left_step,
handsfree->right_step);
OpenPOWER on IntegriCloud