aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2009-03-04 12:22:51 -0500
committerTakashi Iwai <tiwai@suse.de>2009-03-04 15:05:25 -0500
commit8718b700ccbcc3c6016d38a75e005293c3660f1c (patch)
tree167e1f0e5d65fc59642207fc7d812aef01503725 /sound/pci
parent3ea0d7cf472c6118bb8c0842d606f5436251e179 (diff)
ALSA: hda - Add headphone automute support for 3stack-hp model (ALC888)
Mute speaker outputs on headphone insertion for machines that use 3stack-hp model. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 3696ff31838f..251647d8b5b9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8056,16 +8056,42 @@ static struct hda_verb alc888_lenovo_sky_verbs[] = {
8056 { } /* end */ 8056 { } /* end */
8057}; 8057};
8058 8058
8059static struct hda_verb alc888_6st_dell_verbs[] = {
8060 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8061 { }
8062};
8063
8064static void alc888_3st_hp_front_automute(struct hda_codec *codec)
8065{
8066 unsigned int present, bits;
8067
8068 present = snd_hda_codec_read(codec, 0x1b, 0,
8069 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
8070 bits = present ? HDA_AMP_MUTE : 0;
8071 snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
8072 HDA_AMP_MUTE, bits);
8073 snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
8074 HDA_AMP_MUTE, bits);
8075 snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0,
8076 HDA_AMP_MUTE, bits);
8077}
8078
8079static void alc888_3st_hp_unsol_event(struct hda_codec *codec,
8080 unsigned int res)
8081{
8082 switch (res >> 26) {
8083 case ALC880_HP_EVENT:
8084 alc888_3st_hp_front_automute(codec);
8085 break;
8086 }
8087}
8088
8059static struct hda_verb alc888_3st_hp_verbs[] = { 8089static struct hda_verb alc888_3st_hp_verbs[] = {
8060 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */ 8090 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
8061 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */ 8091 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
8062 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */ 8092 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
8063 { }
8064};
8065
8066static struct hda_verb alc888_6st_dell_verbs[] = {
8067 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 8093 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8068 { } 8094 { } /* end */
8069}; 8095};
8070 8096
8071/* 8097/*
@@ -8950,6 +8976,8 @@ static struct alc_config_preset alc883_presets[] = {
8950 .channel_mode = alc888_3st_hp_modes, 8976 .channel_mode = alc888_3st_hp_modes,
8951 .need_dac_fix = 1, 8977 .need_dac_fix = 1,
8952 .input_mux = &alc883_capture_source, 8978 .input_mux = &alc883_capture_source,
8979 .unsol_event = alc888_3st_hp_unsol_event,
8980 .init_hook = alc888_3st_hp_front_automute,
8953 }, 8981 },
8954 [ALC888_6ST_DELL] = { 8982 [ALC888_6ST_DELL] = {
8955 .mixers = { alc883_base_mixer, alc883_chmode_mixer }, 8983 .mixers = { alc883_base_mixer, alc883_chmode_mixer },