From f80ab06cfb4c936b04e476cc1928bbd8c76b2ab7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Dec 2010 15:23:41 +0100 Subject: [PATCH] --- yaml --- r: 223369 b: refs/heads/master c: 53e8c3239bcc7b89c76179fd33fb6faa3413c00d h: refs/heads/master i: 223367: 8a1f413d8bfb60516d7667358bcb7d380c86b000 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/patch_realtek.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 5c13aedc3eb7..4263010a1a99 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac612407932be18697b5ae9da0a80f138b8bea8e +refs/heads/master: 53e8c3239bcc7b89c76179fd33fb6faa3413c00d diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 8e7948f56106..427da45d7906 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -10830,7 +10830,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; struct auto_pin_cfg *cfg = &spec->autocfg; - int i, err; + int i, err, type; + int type_idx = 0; hda_nid_t nid; for (i = 0; i < cfg->num_inputs; i++) { @@ -10839,9 +10840,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) nid = cfg->inputs[i].pin; if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { char label[32]; + type = cfg->inputs[i].type; + if (i > 0 && type == cfg->inputs[i - 1].type) + type_idx++; + else + type_idx = 0; snprintf(label, sizeof(label), "%s Boost", hda_get_autocfg_input_label(codec, cfg, i)); - err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0, + err = add_control(spec, ALC_CTL_WIDGET_VOL, label, + type_idx, HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); if (err < 0) return err;