diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-02-22 12:45:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-22 17:20:09 -0500 |
commit | cced83b62c61fb39b79e796981065dff474b62aa (patch) | |
tree | 710e3890f45a3edb4abfc28ee91118be0955eea2 /sound | |
parent | 614ca92b51b81eb42d6a3dcf125451632ddca0f5 (diff) |
[ALSA] hda-codec - Fix ALC882 capture source selection
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | 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 2a463c921ae3..777f8c01ca7a 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, | |||
5227 | const struct hda_input_mux *imux = spec->input_mux; | 5227 | const struct hda_input_mux *imux = spec->input_mux; |
5228 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); | 5228 | unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); |
5229 | static hda_nid_t capture_mixers[3] = { 0x24, 0x23, 0x22 }; | 5229 | static hda_nid_t capture_mixers[3] = { 0x24, 0x23, 0x22 }; |
5230 | hda_nid_t nid = capture_mixers[adc_idx]; | 5230 | hda_nid_t nid; |
5231 | unsigned int *cur_val = &spec->cur_mux[adc_idx]; | 5231 | unsigned int *cur_val = &spec->cur_mux[adc_idx]; |
5232 | unsigned int i, idx; | 5232 | unsigned int i, idx; |
5233 | 5233 | ||
5234 | if (spec->num_adc_nids < 3) | ||
5235 | nid = capture_mixers[adc_idx + 1]; | ||
5236 | else | ||
5237 | nid = capture_mixers[adc_idx]; | ||
5234 | idx = ucontrol->value.enumerated.item[0]; | 5238 | idx = ucontrol->value.enumerated.item[0]; |
5235 | if (idx >= imux->num_items) | 5239 | if (idx >= imux->num_items) |
5236 | idx = imux->num_items - 1; | 5240 | idx = imux->num_items - 1; |