[PATCH 12/16] [ALSA] hda-codec - Fix ALC882 capture source selection

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Takashi Iwai
Date: Friday, February 22, 2008 - 10:45 am

The capture source selection for ADC list with two elements is buggy
becaues of a wrong capture mux list.  This patch fixes the starting
index based on spec->num_adc_nids.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_realtek.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2a463c9..777f8c0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5227,10 +5227,14 @@ static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol,
 	const struct hda_input_mux *imux = spec->input_mux;
 	unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
 	static hda_nid_t capture_mixers[3] = { 0x24, 0x23, 0x22 };
-	hda_nid_t nid = capture_mixers[adc_idx];
+	hda_nid_t nid;
 	unsigned int *cur_val = &spec->cur_mux[adc_idx];
 	unsigned int i, idx;
 
+	if (spec->num_adc_nids < 3)
+		nid = capture_mixers[adc_idx + 1];
+	else
+		nid = capture_mixers[adc_idx];
 	idx = ucontrol->value.enumerated.item[0];
 	if (idx >= imux->num_items)
 		idx = imux->num_items - 1;
-- 
1.5.3.8

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/16] ALSA fixes for 2.6.25-rc2, Takashi Iwai, (Fri Feb 22, 10:33 am)
[PATCH 03/16] [ALSA] oxygen - Fix section mismatch, Takashi Iwai, (Fri Feb 22, 10:35 am)
[PATCH 04/16] [ALSA] hdsp - Fix section mismatch, Takashi Iwai, (Fri Feb 22, 10:35 am)
[PATCH 05/16] [ALSA] HDA - enable snoop on SCH, Takashi Iwai, (Fri Feb 22, 10:36 am)
[PATCH 12/16] [ALSA] hda-codec - Fix ALC882 capture source ..., Takashi Iwai, (Fri Feb 22, 10:45 am)
[PATCH 14/16] [ALSA] caiaq - fix section mismatch warning, Takashi Iwai, (Fri Feb 22, 10:46 am)