aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-02-14 11:27:17 -0500
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:10 -0400
commit88c71a9974693f2b2824b09340269511dd7cbe18 (patch)
tree67aa9eaeb5f263e01b5e31320555e21f282412af /sound/pci/hda/patch_realtek.c
parent814b1a5ce6b35bafd583ae813da97e8254bb1930 (diff)
[ALSA] hda-codec - Fix missing capsrc_nids for ALC262
ALC262 must have capsrc_nids defined as well as in ALC882. Also, add a NULL check in alc882_mux_enum_put to avoid Oops. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 355d88d07ea2..eea18b3336d3 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5253,7 +5253,8 @@ static int alc882_mux_enum_put(struct snd_kcontrol *kcontrol,
5253 struct alc_spec *spec = codec->spec; 5253 struct alc_spec *spec = codec->spec;
5254 const struct hda_input_mux *imux = spec->input_mux; 5254 const struct hda_input_mux *imux = spec->input_mux;
5255 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 5255 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
5256 hda_nid_t nid = spec->capsrc_nids[adc_idx]; 5256 hda_nid_t nid = spec->capsrc_nids ?
5257 spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
5257 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 5258 unsigned int *cur_val = &spec->cur_mux[adc_idx];
5258 unsigned int i, idx; 5259 unsigned int i, idx;
5259 5260
@@ -8053,6 +8054,8 @@ static int patch_alc883(struct hda_codec *codec)
8053#define alc262_dac_nids alc260_dac_nids 8054#define alc262_dac_nids alc260_dac_nids
8054#define alc262_adc_nids alc882_adc_nids 8055#define alc262_adc_nids alc882_adc_nids
8055#define alc262_adc_nids_alt alc882_adc_nids_alt 8056#define alc262_adc_nids_alt alc882_adc_nids_alt
8057#define alc262_capsrc_nids alc882_capsrc_nids
8058#define alc262_capsrc_nids_alt alc882_capsrc_nids_alt
8056 8059
8057#define alc262_modes alc260_modes 8060#define alc262_modes alc260_modes
8058#define alc262_capture_source alc882_capture_source 8061#define alc262_capture_source alc882_capture_source
@@ -9443,12 +9446,14 @@ static int patch_alc262(struct hda_codec *codec)
9443 if (wcap != AC_WID_AUD_IN) { 9446 if (wcap != AC_WID_AUD_IN) {
9444 spec->adc_nids = alc262_adc_nids_alt; 9447 spec->adc_nids = alc262_adc_nids_alt;
9445 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt); 9448 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids_alt);
9449 spec->capsrc_nids = alc262_capsrc_nids_alt;
9446 spec->mixers[spec->num_mixers] = 9450 spec->mixers[spec->num_mixers] =
9447 alc262_capture_alt_mixer; 9451 alc262_capture_alt_mixer;
9448 spec->num_mixers++; 9452 spec->num_mixers++;
9449 } else { 9453 } else {
9450 spec->adc_nids = alc262_adc_nids; 9454 spec->adc_nids = alc262_adc_nids;
9451 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids); 9455 spec->num_adc_nids = ARRAY_SIZE(alc262_adc_nids);
9456 spec->capsrc_nids = alc262_capsrc_nids;
9452 spec->mixers[spec->num_mixers] = alc262_capture_mixer; 9457 spec->mixers[spec->num_mixers] = alc262_capture_mixer;
9453 spec->num_mixers++; 9458 spec->num_mixers++;
9454 } 9459 }