diff options
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8e7948f5610..427da45d790 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -10830,7 +10830,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
| 10830 | { | 10830 | { |
| 10831 | struct alc_spec *spec = codec->spec; | 10831 | struct alc_spec *spec = codec->spec; |
| 10832 | struct auto_pin_cfg *cfg = &spec->autocfg; | 10832 | struct auto_pin_cfg *cfg = &spec->autocfg; |
| 10833 | int i, err; | 10833 | int i, err, type; |
| 10834 | int type_idx = 0; | ||
| 10834 | hda_nid_t nid; | 10835 | hda_nid_t nid; |
| 10835 | 10836 | ||
| 10836 | for (i = 0; i < cfg->num_inputs; i++) { | 10837 | for (i = 0; i < cfg->num_inputs; i++) { |
| @@ -10839,9 +10840,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
| 10839 | nid = cfg->inputs[i].pin; | 10840 | nid = cfg->inputs[i].pin; |
| 10840 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { | 10841 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { |
| 10841 | char label[32]; | 10842 | char label[32]; |
| 10843 | type = cfg->inputs[i].type; | ||
| 10844 | if (i > 0 && type == cfg->inputs[i - 1].type) | ||
| 10845 | type_idx++; | ||
| 10846 | else | ||
| 10847 | type_idx = 0; | ||
| 10842 | snprintf(label, sizeof(label), "%s Boost", | 10848 | snprintf(label, sizeof(label), "%s Boost", |
| 10843 | hda_get_autocfg_input_label(codec, cfg, i)); | 10849 | hda_get_autocfg_input_label(codec, cfg, i)); |
| 10844 | err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0, | 10850 | err = add_control(spec, ALC_CTL_WIDGET_VOL, label, |
| 10851 | type_idx, | ||
| 10845 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); | 10852 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); |
| 10846 | if (err < 0) | 10853 | if (err < 0) |
| 10847 | return err; | 10854 | return err; |
