diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6c588ef26685..c8070620a4d8 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -5166,6 +5166,19 @@ static void fixup_automic_adc(struct hda_codec *codec) | |||
5166 | spec->auto_mic = 0; /* disable auto-mic to be sure */ | 5166 | spec->auto_mic = 0; /* disable auto-mic to be sure */ |
5167 | } | 5167 | } |
5168 | 5168 | ||
5169 | /* select or unmute the given capsrc route */ | ||
5170 | static void select_or_unmute_capsrc(struct hda_codec *codec, hda_nid_t cap, | ||
5171 | int idx) | ||
5172 | { | ||
5173 | if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) { | ||
5174 | snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx, | ||
5175 | HDA_AMP_MUTE, 0); | ||
5176 | } else { | ||
5177 | snd_hda_codec_write_cache(codec, cap, 0, | ||
5178 | AC_VERB_SET_CONNECT_SEL, idx); | ||
5179 | } | ||
5180 | } | ||
5181 | |||
5169 | /* set the default connection to that pin */ | 5182 | /* set the default connection to that pin */ |
5170 | static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin) | 5183 | static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin) |
5171 | { | 5184 | { |
@@ -5180,14 +5193,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin) | |||
5180 | idx = get_connection_index(codec, cap, pin); | 5193 | idx = get_connection_index(codec, cap, pin); |
5181 | if (idx < 0) | 5194 | if (idx < 0) |
5182 | continue; | 5195 | continue; |
5183 | /* select or unmute this route */ | 5196 | select_or_unmute_capsrc(codec, cap, idx); |
5184 | if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) { | ||
5185 | snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx, | ||
5186 | HDA_AMP_MUTE, 0); | ||
5187 | } else { | ||
5188 | snd_hda_codec_write_cache(codec, cap, 0, | ||
5189 | AC_VERB_SET_CONNECT_SEL, idx); | ||
5190 | } | ||
5191 | return i; /* return the found index */ | 5197 | return i; /* return the found index */ |
5192 | } | 5198 | } |
5193 | return -1; /* not found */ | 5199 | return -1; /* not found */ |
@@ -14364,9 +14370,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec) | |||
14364 | 14370 | ||
14365 | /* set default input source */ | 14371 | /* set default input source */ |
14366 | if (!spec->dual_adc_switch) | 14372 | if (!spec->dual_adc_switch) |
14367 | snd_hda_codec_write_cache(codec, spec->capsrc_nids[0], | 14373 | select_or_unmute_capsrc(codec, spec->capsrc_nids[0], |
14368 | 0, AC_VERB_SET_CONNECT_SEL, | 14374 | spec->input_mux->items[0].index); |
14369 | spec->input_mux->items[0].index); | ||
14370 | 14375 | ||
14371 | err = alc_auto_add_mic_boost(codec); | 14376 | err = alc_auto_add_mic_boost(codec); |
14372 | if (err < 0) | 14377 | if (err < 0) |