[PATCH] ALSA: hda - Fix max amp cap calculation for IDT/STAC codecs

From: Takashi Iwai
Date: Mon Jul 26 2010 - 11:00:15 EST


The commit afbd9b8448f4b7d15673c6858012f384f18d28b8
ALSA: hda - Limit the amp value to write
introduced a regression for codec setups with amp offsets like IDT/STAC
codecs. The limit value should be a raw value without offset calculation.

Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
sound/pci/hda/hda_codec.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 501cbc4..e5c3484 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1629,7 +1629,8 @@ update_amp_value(struct hda_codec *codec, hda_nid_t nid,

if (val > 0)
val += ofs;
- maxval = get_amp_max_value(codec, nid, dir, ofs);
+ /* ofs = 0: raw max value */
+ maxval = get_amp_max_value(codec, nid, dir, 0);
if (val > maxval)
val = maxval;
return snd_hda_codec_amp_update(codec, nid, ch, dir, idx,
--
1.7.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/