aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-12-17 09:23:41 -0500
committerTakashi Iwai <tiwai@suse.de>2010-12-17 09:23:41 -0500
commit53e8c3239bcc7b89c76179fd33fb6faa3413c00d (patch)
tree6d0d83c659624c84173274161251edcfb4cccd2a /sound
parentac612407932be18697b5ae9da0a80f138b8bea8e (diff)
ALSA: hda - Fix conflict of Mic Boot controls
Due to the recent change for multiple mics assignment, we need to handle the index of each Mic Boost control respectively. Otherwise the driver gets the control element conflicts, and gives the unsable state. Reference: kernel bug 25002 https://bugzilla.kernel.org/show_bug.cgi?id=25002 Reported-and-tested-by: Adam Williamson <awilliam@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c11
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;