aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-27 09:53:38 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-27 09:53:38 -0400
commit7ec9c6ccc6007b14a916021d4ba7ffbcc7822ae3 (patch)
treed22b159814380ab5b53aa36715c340ed710010af /sound/pci/hda/patch_realtek.c
parent050ea75317f33e376cc413359c0319ad5cc86e2a (diff)
ALSA: hda - Fix volume-init for ALC259 with invalid widget caps
ALC259 seems to provide an invalid widget capability for the input-src selector widget. The widget shows the input-amp while it's a selector, and this confuses the current ALC882 initialization code that is used for ALC259, too. For fixing this, check the amp capability and handle the connection selection individually. Also, ALC259 has no mute bit in DAC volume, so we need to initialize it as ZERO instead of MUTE. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5293f7f7f425..0fefc656c6e0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11075,6 +11075,7 @@ static void alc882_auto_init_input_src(struct hda_codec *codec)
11075 unsigned int mux_idx; 11075 unsigned int mux_idx;
11076 const struct hda_input_mux *imux; 11076 const struct hda_input_mux *imux;
11077 int conns, mute, idx, item; 11077 int conns, mute, idx, item;
11078 unsigned int wid_type;
11078 11079
11079 /* mute ADC */ 11080 /* mute ADC */
11080 snd_hda_codec_write(codec, spec->adc_nids[c], 0, 11081 snd_hda_codec_write(codec, spec->adc_nids[c], 0,
@@ -11088,6 +11089,7 @@ static void alc882_auto_init_input_src(struct hda_codec *codec)
11088 imux = &spec->input_mux[mux_idx]; 11089 imux = &spec->input_mux[mux_idx];
11089 if (!imux->num_items && mux_idx > 0) 11090 if (!imux->num_items && mux_idx > 0)
11090 imux = &spec->input_mux[0]; 11091 imux = &spec->input_mux[0];
11092 wid_type = get_wcaps_type(get_wcaps(codec, nid));
11091 for (idx = 0; idx < conns; idx++) { 11093 for (idx = 0; idx < conns; idx++) {
11092 /* if the current connection is the selected one, 11094 /* if the current connection is the selected one,
11093 * unmute it as default - otherwise mute it 11095 * unmute it as default - otherwise mute it
@@ -11100,17 +11102,13 @@ static void alc882_auto_init_input_src(struct hda_codec *codec)
11100 break; 11102 break;
11101 } 11103 }
11102 } 11104 }
11103 /* check if we have a selector or mixer 11105 /* initialize the mute status if mute-amp is present */
11104 * we could check for the widget type instead, but 11106 if (query_amp_caps(codec, nid, HDA_INPUT) & AC_AMPCAP_MUTE)
11105 * just check for Amp-In presence (in case of mixer
11106 * without amp-in there is something wrong, this
11107 * function shouldn't be used or capsrc nid is wrong)
11108 */
11109 if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP)
11110 snd_hda_codec_write(codec, nid, 0, 11107 snd_hda_codec_write(codec, nid, 0,
11111 AC_VERB_SET_AMP_GAIN_MUTE, 11108 AC_VERB_SET_AMP_GAIN_MUTE,
11112 mute); 11109 mute);
11113 else if (mute != AMP_IN_MUTE(idx)) 11110 if (wid_type == AC_WID_AUD_SEL &&
11111 mute != AMP_IN_MUTE(idx))
11114 snd_hda_codec_write(codec, nid, 0, 11112 snd_hda_codec_write(codec, nid, 0,
11115 AC_VERB_SET_CONNECT_SEL, 11113 AC_VERB_SET_CONNECT_SEL,
11116 idx); 11114 idx);
@@ -13594,7 +13592,7 @@ static void alc268_auto_init_dac(struct hda_codec *codec, hda_nid_t nid)
13594 if (!nid) 13592 if (!nid)
13595 return; 13593 return;
13596 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, 13594 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
13597 AMP_OUT_MUTE); 13595 AMP_OUT_ZERO);
13598} 13596}
13599 13597
13600static void alc268_auto_init_multi_out(struct hda_codec *codec) 13598static void alc268_auto_init_multi_out(struct hda_codec *codec)