diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a24e068a021b..336d14eb72af 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -284,7 +284,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, | |||
284 | struct alc_spec *spec = codec->spec; | 284 | struct alc_spec *spec = codec->spec; |
285 | const struct hda_input_mux *imux; | 285 | const struct hda_input_mux *imux; |
286 | unsigned int mux_idx; | 286 | unsigned int mux_idx; |
287 | int i, type; | 287 | int i, type, num_conns; |
288 | hda_nid_t nid; | 288 | hda_nid_t nid; |
289 | 289 | ||
290 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; | 290 | mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; |
@@ -307,16 +307,17 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx, | |||
307 | spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; | 307 | spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx]; |
308 | 308 | ||
309 | /* no selection? */ | 309 | /* no selection? */ |
310 | if (snd_hda_get_conn_list(codec, nid, NULL) <= 1) | 310 | num_conns = snd_hda_get_conn_list(codec, nid, NULL); |
311 | if (num_conns <= 1) | ||
311 | return 1; | 312 | return 1; |
312 | 313 | ||
313 | type = get_wcaps_type(get_wcaps(codec, nid)); | 314 | type = get_wcaps_type(get_wcaps(codec, nid)); |
314 | if (type == AC_WID_AUD_MIX) { | 315 | if (type == AC_WID_AUD_MIX) { |
315 | /* Matrix-mixer style (e.g. ALC882) */ | 316 | /* Matrix-mixer style (e.g. ALC882) */ |
316 | for (i = 0; i < imux->num_items; i++) { | 317 | int active = imux->items[idx].index; |
317 | unsigned int v = (i == idx) ? 0 : HDA_AMP_MUTE; | 318 | for (i = 0; i < num_conns; i++) { |
318 | snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, | 319 | unsigned int v = (i == active) ? 0 : HDA_AMP_MUTE; |
319 | imux->items[i].index, | 320 | snd_hda_codec_amp_stereo(codec, nid, HDA_INPUT, i, |
320 | HDA_AMP_MUTE, v); | 321 | HDA_AMP_MUTE, v); |
321 | } | 322 | } |
322 | } else { | 323 | } else { |
@@ -1451,7 +1452,7 @@ static void alc_apply_fixup(struct hda_codec *codec, int action) | |||
1451 | switch (fix->type) { | 1452 | switch (fix->type) { |
1452 | case ALC_FIXUP_SKU: | 1453 | case ALC_FIXUP_SKU: |
1453 | if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku) | 1454 | if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku) |
1454 | break;; | 1455 | break; |
1455 | snd_printdd(KERN_INFO "hda_codec: %s: " | 1456 | snd_printdd(KERN_INFO "hda_codec: %s: " |
1456 | "Apply sku override for %s\n", | 1457 | "Apply sku override for %s\n", |
1457 | codec->chip_name, modelname); | 1458 | codec->chip_name, modelname); |