diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-12-17 06:27:39 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-17 06:27:39 -0500 |
commit | 9e671deb8547638f6504c5f20126b14f5563690d (patch) | |
tree | 33863b92bbcafe324bc189db1c556a177b41a379 | |
parent | 709350506567029021b8a38ee7e65bc246fceabc (diff) | |
parent | ebb83eeb6469bedda83b4dc6f23ddf93eb32b347 (diff) |
Merge branch 'fix/hda' into topic/hda
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 306 |
1 files changed, 282 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f88577897e46..36556b10357a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -131,8 +131,8 @@ enum { | |||
131 | enum { | 131 | enum { |
132 | ALC269_BASIC, | 132 | ALC269_BASIC, |
133 | ALC269_QUANTA_FL1, | 133 | ALC269_QUANTA_FL1, |
134 | ALC269_ASUS_EEEPC_P703, | 134 | ALC269_ASUS_AMIC, |
135 | ALC269_ASUS_EEEPC_P901, | 135 | ALC269_ASUS_DMIC, |
136 | ALC269_FUJITSU, | 136 | ALC269_FUJITSU, |
137 | ALC269_LIFEBOOK, | 137 | ALC269_LIFEBOOK, |
138 | ALC269_AUTO, | 138 | ALC269_AUTO, |
@@ -188,6 +188,8 @@ enum { | |||
188 | ALC663_ASUS_MODE4, | 188 | ALC663_ASUS_MODE4, |
189 | ALC663_ASUS_MODE5, | 189 | ALC663_ASUS_MODE5, |
190 | ALC663_ASUS_MODE6, | 190 | ALC663_ASUS_MODE6, |
191 | ALC663_ASUS_MODE7, | ||
192 | ALC663_ASUS_MODE8, | ||
191 | ALC272_DELL, | 193 | ALC272_DELL, |
192 | ALC272_DELL_ZM1, | 194 | ALC272_DELL_ZM1, |
193 | ALC272_SAMSUNG_NC10, | 195 | ALC272_SAMSUNG_NC10, |
@@ -13347,10 +13349,12 @@ static struct hda_verb alc269_eeepc_amic_init_verbs[] = { | |||
13347 | /* toggle speaker-output according to the hp-jack state */ | 13349 | /* toggle speaker-output according to the hp-jack state */ |
13348 | static void alc269_speaker_automute(struct hda_codec *codec) | 13350 | static void alc269_speaker_automute(struct hda_codec *codec) |
13349 | { | 13351 | { |
13352 | struct alc_spec *spec = codec->spec; | ||
13353 | unsigned int nid = spec->autocfg.hp_pins[0]; | ||
13350 | unsigned int present; | 13354 | unsigned int present; |
13351 | unsigned char bits; | 13355 | unsigned char bits; |
13352 | 13356 | ||
13353 | present = snd_hda_jack_detect(codec, 0x15); | 13357 | present = snd_hda_jack_detect(codec, nid); |
13354 | bits = present ? AMP_IN_MUTE(0) : 0; | 13358 | bits = present ? AMP_IN_MUTE(0) : 0; |
13355 | snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, | 13359 | snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, |
13356 | AMP_IN_MUTE(0), bits); | 13360 | AMP_IN_MUTE(0), bits); |
@@ -13575,8 +13579,8 @@ static void alc269_auto_init(struct hda_codec *codec) | |||
13575 | static const char *alc269_models[ALC269_MODEL_LAST] = { | 13579 | static const char *alc269_models[ALC269_MODEL_LAST] = { |
13576 | [ALC269_BASIC] = "basic", | 13580 | [ALC269_BASIC] = "basic", |
13577 | [ALC269_QUANTA_FL1] = "quanta", | 13581 | [ALC269_QUANTA_FL1] = "quanta", |
13578 | [ALC269_ASUS_EEEPC_P703] = "eeepc-p703", | 13582 | [ALC269_ASUS_AMIC] = "asus-amic", |
13579 | [ALC269_ASUS_EEEPC_P901] = "eeepc-p901", | 13583 | [ALC269_ASUS_DMIC] = "asus-dmic", |
13580 | [ALC269_FUJITSU] = "fujitsu", | 13584 | [ALC269_FUJITSU] = "fujitsu", |
13581 | [ALC269_LIFEBOOK] = "lifebook", | 13585 | [ALC269_LIFEBOOK] = "lifebook", |
13582 | [ALC269_AUTO] = "auto", | 13586 | [ALC269_AUTO] = "auto", |
@@ -13585,18 +13589,41 @@ static const char *alc269_models[ALC269_MODEL_LAST] = { | |||
13585 | static struct snd_pci_quirk alc269_cfg_tbl[] = { | 13589 | static struct snd_pci_quirk alc269_cfg_tbl[] = { |
13586 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), | 13590 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), |
13587 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", | 13591 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
13588 | ALC269_ASUS_EEEPC_P703), | 13592 | ALC269_ASUS_AMIC), |
13589 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703), | 13593 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC), |
13590 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703), | 13594 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC), |
13591 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703), | 13595 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC), |
13592 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703), | 13596 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC), |
13593 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703), | 13597 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC), |
13594 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703), | 13598 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC), |
13599 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC), | ||
13600 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC), | ||
13601 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC), | ||
13602 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC), | ||
13603 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC), | ||
13604 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC), | ||
13605 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC), | ||
13606 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC), | ||
13607 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC), | ||
13608 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC), | ||
13609 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC), | ||
13610 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC), | ||
13611 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC), | ||
13612 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC), | ||
13613 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC), | ||
13614 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC), | ||
13615 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC), | ||
13616 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC), | ||
13617 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC), | ||
13618 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC), | ||
13619 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC), | ||
13620 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC), | ||
13595 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", | 13621 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", |
13596 | ALC269_ASUS_EEEPC_P901), | 13622 | ALC269_ASUS_DMIC), |
13597 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", | 13623 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", |
13598 | ALC269_ASUS_EEEPC_P901), | 13624 | ALC269_ASUS_DMIC), |
13599 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901), | 13625 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC), |
13626 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC), | ||
13600 | SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), | 13627 | SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), |
13601 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), | 13628 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), |
13602 | {} | 13629 | {} |
@@ -13626,7 +13653,7 @@ static struct alc_config_preset alc269_presets[] = { | |||
13626 | .setup = alc269_quanta_fl1_setup, | 13653 | .setup = alc269_quanta_fl1_setup, |
13627 | .init_hook = alc269_quanta_fl1_init_hook, | 13654 | .init_hook = alc269_quanta_fl1_init_hook, |
13628 | }, | 13655 | }, |
13629 | [ALC269_ASUS_EEEPC_P703] = { | 13656 | [ALC269_ASUS_AMIC] = { |
13630 | .mixers = { alc269_eeepc_mixer }, | 13657 | .mixers = { alc269_eeepc_mixer }, |
13631 | .cap_mixer = alc269_epc_capture_mixer, | 13658 | .cap_mixer = alc269_epc_capture_mixer, |
13632 | .init_verbs = { alc269_init_verbs, | 13659 | .init_verbs = { alc269_init_verbs, |
@@ -13640,7 +13667,7 @@ static struct alc_config_preset alc269_presets[] = { | |||
13640 | .setup = alc269_eeepc_amic_setup, | 13667 | .setup = alc269_eeepc_amic_setup, |
13641 | .init_hook = alc269_eeepc_inithook, | 13668 | .init_hook = alc269_eeepc_inithook, |
13642 | }, | 13669 | }, |
13643 | [ALC269_ASUS_EEEPC_P901] = { | 13670 | [ALC269_ASUS_DMIC] = { |
13644 | .mixers = { alc269_eeepc_mixer }, | 13671 | .mixers = { alc269_eeepc_mixer }, |
13645 | .cap_mixer = alc269_epc_capture_mixer, | 13672 | .cap_mixer = alc269_epc_capture_mixer, |
13646 | .init_verbs = { alc269_init_verbs, | 13673 | .init_verbs = { alc269_init_verbs, |
@@ -16275,6 +16302,52 @@ static struct snd_kcontrol_new alc663_g50v_mixer[] = { | |||
16275 | { } /* end */ | 16302 | { } /* end */ |
16276 | }; | 16303 | }; |
16277 | 16304 | ||
16305 | static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch = { | ||
16306 | .ops = &snd_hda_bind_sw, | ||
16307 | .values = { | ||
16308 | HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), | ||
16309 | HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT), | ||
16310 | HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), | ||
16311 | HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT), | ||
16312 | HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT), | ||
16313 | 0 | ||
16314 | }, | ||
16315 | }; | ||
16316 | |||
16317 | static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch = { | ||
16318 | .ops = &snd_hda_bind_sw, | ||
16319 | .values = { | ||
16320 | HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT), | ||
16321 | HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT), | ||
16322 | 0 | ||
16323 | }, | ||
16324 | }; | ||
16325 | |||
16326 | static struct snd_kcontrol_new alc663_mode7_mixer[] = { | ||
16327 | HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch), | ||
16328 | HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol), | ||
16329 | HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch), | ||
16330 | HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT), | ||
16331 | HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT), | ||
16332 | HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
16333 | HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
16334 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), | ||
16335 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), | ||
16336 | { } /* end */ | ||
16337 | }; | ||
16338 | |||
16339 | static struct snd_kcontrol_new alc663_mode8_mixer[] = { | ||
16340 | HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch), | ||
16341 | HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol), | ||
16342 | HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch), | ||
16343 | HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
16344 | HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT), | ||
16345 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
16346 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
16347 | { } /* end */ | ||
16348 | }; | ||
16349 | |||
16350 | |||
16278 | static struct snd_kcontrol_new alc662_chmode_mixer[] = { | 16351 | static struct snd_kcontrol_new alc662_chmode_mixer[] = { |
16279 | { | 16352 | { |
16280 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 16353 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
@@ -16562,6 +16635,45 @@ static struct hda_verb alc272_dell_init_verbs[] = { | |||
16562 | {} | 16635 | {} |
16563 | }; | 16636 | }; |
16564 | 16637 | ||
16638 | static struct hda_verb alc663_mode7_init_verbs[] = { | ||
16639 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
16640 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
16641 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
16642 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16643 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
16644 | {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16645 | {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
16646 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
16647 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16648 | {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */ | ||
16649 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
16650 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)}, | ||
16651 | {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, | ||
16652 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
16653 | {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
16654 | {} | ||
16655 | }; | ||
16656 | |||
16657 | static struct hda_verb alc663_mode8_init_verbs[] = { | ||
16658 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
16659 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
16660 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16661 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
16662 | {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
16663 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
16664 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16665 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
16666 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
16667 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
16668 | {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */ | ||
16669 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
16670 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)}, | ||
16671 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
16672 | {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, | ||
16673 | {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
16674 | {} | ||
16675 | }; | ||
16676 | |||
16565 | static struct snd_kcontrol_new alc662_auto_capture_mixer[] = { | 16677 | static struct snd_kcontrol_new alc662_auto_capture_mixer[] = { |
16566 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), | 16678 | HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), |
16567 | HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), | 16679 | HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), |
@@ -16741,6 +16853,54 @@ static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec) | |||
16741 | } | 16853 | } |
16742 | } | 16854 | } |
16743 | 16855 | ||
16856 | static void alc663_two_hp_m7_speaker_automute(struct hda_codec *codec) | ||
16857 | { | ||
16858 | unsigned int present1, present2; | ||
16859 | |||
16860 | present1 = snd_hda_codec_read(codec, 0x1b, 0, | ||
16861 | AC_VERB_GET_PIN_SENSE, 0) | ||
16862 | & AC_PINSENSE_PRESENCE; | ||
16863 | present2 = snd_hda_codec_read(codec, 0x21, 0, | ||
16864 | AC_VERB_GET_PIN_SENSE, 0) | ||
16865 | & AC_PINSENSE_PRESENCE; | ||
16866 | |||
16867 | if (present1 || present2) { | ||
16868 | snd_hda_codec_write_cache(codec, 0x14, 0, | ||
16869 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | ||
16870 | snd_hda_codec_write_cache(codec, 0x17, 0, | ||
16871 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | ||
16872 | } else { | ||
16873 | snd_hda_codec_write_cache(codec, 0x14, 0, | ||
16874 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | ||
16875 | snd_hda_codec_write_cache(codec, 0x17, 0, | ||
16876 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | ||
16877 | } | ||
16878 | } | ||
16879 | |||
16880 | static void alc663_two_hp_m8_speaker_automute(struct hda_codec *codec) | ||
16881 | { | ||
16882 | unsigned int present1, present2; | ||
16883 | |||
16884 | present1 = snd_hda_codec_read(codec, 0x21, 0, | ||
16885 | AC_VERB_GET_PIN_SENSE, 0) | ||
16886 | & AC_PINSENSE_PRESENCE; | ||
16887 | present2 = snd_hda_codec_read(codec, 0x15, 0, | ||
16888 | AC_VERB_GET_PIN_SENSE, 0) | ||
16889 | & AC_PINSENSE_PRESENCE; | ||
16890 | |||
16891 | if (present1 || present2) { | ||
16892 | snd_hda_codec_write_cache(codec, 0x14, 0, | ||
16893 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | ||
16894 | snd_hda_codec_write_cache(codec, 0x17, 0, | ||
16895 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | ||
16896 | } else { | ||
16897 | snd_hda_codec_write_cache(codec, 0x14, 0, | ||
16898 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | ||
16899 | snd_hda_codec_write_cache(codec, 0x17, 0, | ||
16900 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | ||
16901 | } | ||
16902 | } | ||
16903 | |||
16744 | static void alc663_m51va_unsol_event(struct hda_codec *codec, | 16904 | static void alc663_m51va_unsol_event(struct hda_codec *codec, |
16745 | unsigned int res) | 16905 | unsigned int res) |
16746 | { | 16906 | { |
@@ -16760,7 +16920,7 @@ static void alc663_m51va_setup(struct hda_codec *codec) | |||
16760 | spec->ext_mic.pin = 0x18; | 16920 | spec->ext_mic.pin = 0x18; |
16761 | spec->ext_mic.mux_idx = 0; | 16921 | spec->ext_mic.mux_idx = 0; |
16762 | spec->int_mic.pin = 0x12; | 16922 | spec->int_mic.pin = 0x12; |
16763 | spec->int_mic.mux_idx = 1; | 16923 | spec->int_mic.mux_idx = 9; |
16764 | spec->auto_mic = 1; | 16924 | spec->auto_mic = 1; |
16765 | } | 16925 | } |
16766 | 16926 | ||
@@ -16772,7 +16932,17 @@ static void alc663_m51va_inithook(struct hda_codec *codec) | |||
16772 | 16932 | ||
16773 | /* ***************** Mode1 ******************************/ | 16933 | /* ***************** Mode1 ******************************/ |
16774 | #define alc663_mode1_unsol_event alc663_m51va_unsol_event | 16934 | #define alc663_mode1_unsol_event alc663_m51va_unsol_event |
16775 | #define alc663_mode1_setup alc663_m51va_setup | 16935 | |
16936 | static void alc663_mode1_setup(struct hda_codec *codec) | ||
16937 | { | ||
16938 | struct alc_spec *spec = codec->spec; | ||
16939 | spec->ext_mic.pin = 0x18; | ||
16940 | spec->ext_mic.mux_idx = 0; | ||
16941 | spec->int_mic.pin = 0x19; | ||
16942 | spec->int_mic.mux_idx = 1; | ||
16943 | spec->auto_mic = 1; | ||
16944 | } | ||
16945 | |||
16776 | #define alc663_mode1_inithook alc663_m51va_inithook | 16946 | #define alc663_mode1_inithook alc663_m51va_inithook |
16777 | 16947 | ||
16778 | /* ***************** Mode2 ******************************/ | 16948 | /* ***************** Mode2 ******************************/ |
@@ -16789,7 +16959,7 @@ static void alc662_mode2_unsol_event(struct hda_codec *codec, | |||
16789 | } | 16959 | } |
16790 | } | 16960 | } |
16791 | 16961 | ||
16792 | #define alc662_mode2_setup alc663_m51va_setup | 16962 | #define alc662_mode2_setup alc663_mode1_setup |
16793 | 16963 | ||
16794 | static void alc662_mode2_inithook(struct hda_codec *codec) | 16964 | static void alc662_mode2_inithook(struct hda_codec *codec) |
16795 | { | 16965 | { |
@@ -16810,7 +16980,7 @@ static void alc663_mode3_unsol_event(struct hda_codec *codec, | |||
16810 | } | 16980 | } |
16811 | } | 16981 | } |
16812 | 16982 | ||
16813 | #define alc663_mode3_setup alc663_m51va_setup | 16983 | #define alc663_mode3_setup alc663_mode1_setup |
16814 | 16984 | ||
16815 | static void alc663_mode3_inithook(struct hda_codec *codec) | 16985 | static void alc663_mode3_inithook(struct hda_codec *codec) |
16816 | { | 16986 | { |
@@ -16831,7 +17001,7 @@ static void alc663_mode4_unsol_event(struct hda_codec *codec, | |||
16831 | } | 17001 | } |
16832 | } | 17002 | } |
16833 | 17003 | ||
16834 | #define alc663_mode4_setup alc663_m51va_setup | 17004 | #define alc663_mode4_setup alc663_mode1_setup |
16835 | 17005 | ||
16836 | static void alc663_mode4_inithook(struct hda_codec *codec) | 17006 | static void alc663_mode4_inithook(struct hda_codec *codec) |
16837 | { | 17007 | { |
@@ -16852,7 +17022,7 @@ static void alc663_mode5_unsol_event(struct hda_codec *codec, | |||
16852 | } | 17022 | } |
16853 | } | 17023 | } |
16854 | 17024 | ||
16855 | #define alc663_mode5_setup alc663_m51va_setup | 17025 | #define alc663_mode5_setup alc663_mode1_setup |
16856 | 17026 | ||
16857 | static void alc663_mode5_inithook(struct hda_codec *codec) | 17027 | static void alc663_mode5_inithook(struct hda_codec *codec) |
16858 | { | 17028 | { |
@@ -16873,7 +17043,7 @@ static void alc663_mode6_unsol_event(struct hda_codec *codec, | |||
16873 | } | 17043 | } |
16874 | } | 17044 | } |
16875 | 17045 | ||
16876 | #define alc663_mode6_setup alc663_m51va_setup | 17046 | #define alc663_mode6_setup alc663_mode1_setup |
16877 | 17047 | ||
16878 | static void alc663_mode6_inithook(struct hda_codec *codec) | 17048 | static void alc663_mode6_inithook(struct hda_codec *codec) |
16879 | { | 17049 | { |
@@ -16881,6 +17051,50 @@ static void alc663_mode6_inithook(struct hda_codec *codec) | |||
16881 | alc_mic_automute(codec); | 17051 | alc_mic_automute(codec); |
16882 | } | 17052 | } |
16883 | 17053 | ||
17054 | /* ***************** Mode7 ******************************/ | ||
17055 | static void alc663_mode7_unsol_event(struct hda_codec *codec, | ||
17056 | unsigned int res) | ||
17057 | { | ||
17058 | switch (res >> 26) { | ||
17059 | case ALC880_HP_EVENT: | ||
17060 | alc663_two_hp_m7_speaker_automute(codec); | ||
17061 | break; | ||
17062 | case ALC880_MIC_EVENT: | ||
17063 | alc_mic_automute(codec); | ||
17064 | break; | ||
17065 | } | ||
17066 | } | ||
17067 | |||
17068 | #define alc663_mode7_setup alc663_mode1_setup | ||
17069 | |||
17070 | static void alc663_mode7_inithook(struct hda_codec *codec) | ||
17071 | { | ||
17072 | alc663_two_hp_m7_speaker_automute(codec); | ||
17073 | alc_mic_automute(codec); | ||
17074 | } | ||
17075 | |||
17076 | /* ***************** Mode8 ******************************/ | ||
17077 | static void alc663_mode8_unsol_event(struct hda_codec *codec, | ||
17078 | unsigned int res) | ||
17079 | { | ||
17080 | switch (res >> 26) { | ||
17081 | case ALC880_HP_EVENT: | ||
17082 | alc663_two_hp_m8_speaker_automute(codec); | ||
17083 | break; | ||
17084 | case ALC880_MIC_EVENT: | ||
17085 | alc_mic_automute(codec); | ||
17086 | break; | ||
17087 | } | ||
17088 | } | ||
17089 | |||
17090 | #define alc663_mode8_setup alc663_m51va_setup | ||
17091 | |||
17092 | static void alc663_mode8_inithook(struct hda_codec *codec) | ||
17093 | { | ||
17094 | alc663_two_hp_m8_speaker_automute(codec); | ||
17095 | alc_mic_automute(codec); | ||
17096 | } | ||
17097 | |||
16884 | static void alc663_g71v_hp_automute(struct hda_codec *codec) | 17098 | static void alc663_g71v_hp_automute(struct hda_codec *codec) |
16885 | { | 17099 | { |
16886 | unsigned int present; | 17100 | unsigned int present; |
@@ -17015,6 +17229,8 @@ static const char *alc662_models[ALC662_MODEL_LAST] = { | |||
17015 | [ALC663_ASUS_MODE4] = "asus-mode4", | 17229 | [ALC663_ASUS_MODE4] = "asus-mode4", |
17016 | [ALC663_ASUS_MODE5] = "asus-mode5", | 17230 | [ALC663_ASUS_MODE5] = "asus-mode5", |
17017 | [ALC663_ASUS_MODE6] = "asus-mode6", | 17231 | [ALC663_ASUS_MODE6] = "asus-mode6", |
17232 | [ALC663_ASUS_MODE7] = "asus-mode7", | ||
17233 | [ALC663_ASUS_MODE8] = "asus-mode8", | ||
17018 | [ALC272_DELL] = "dell", | 17234 | [ALC272_DELL] = "dell", |
17019 | [ALC272_DELL_ZM1] = "dell-zm1", | 17235 | [ALC272_DELL_ZM1] = "dell-zm1", |
17020 | [ALC272_SAMSUNG_NC10] = "samsung-nc10", | 17236 | [ALC272_SAMSUNG_NC10] = "samsung-nc10", |
@@ -17031,12 +17247,22 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { | |||
17031 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), | 17247 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), |
17032 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), | 17248 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), |
17033 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1), | 17249 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1), |
17250 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1), | ||
17251 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1), | ||
17034 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2), | 17252 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2), |
17253 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7), | ||
17254 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7), | ||
17255 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8), | ||
17256 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3), | ||
17257 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1), | ||
17035 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2), | 17258 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2), |
17259 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2), | ||
17260 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1), | ||
17036 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2), | 17261 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2), |
17037 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6), | 17262 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6), |
17038 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6), | 17263 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6), |
17039 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2), | 17264 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2), |
17265 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1), | ||
17040 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3), | 17266 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3), |
17041 | SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA), | 17267 | SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA), |
17042 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2), | 17268 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2), |
@@ -17320,6 +17546,36 @@ static struct alc_config_preset alc662_presets[] = { | |||
17320 | .setup = alc663_mode6_setup, | 17546 | .setup = alc663_mode6_setup, |
17321 | .init_hook = alc663_mode6_inithook, | 17547 | .init_hook = alc663_mode6_inithook, |
17322 | }, | 17548 | }, |
17549 | [ALC663_ASUS_MODE7] = { | ||
17550 | .mixers = { alc663_mode7_mixer }, | ||
17551 | .cap_mixer = alc662_auto_capture_mixer, | ||
17552 | .init_verbs = { alc662_init_verbs, | ||
17553 | alc663_mode7_init_verbs }, | ||
17554 | .num_dacs = ARRAY_SIZE(alc662_dac_nids), | ||
17555 | .hp_nid = 0x03, | ||
17556 | .dac_nids = alc662_dac_nids, | ||
17557 | .dig_out_nid = ALC662_DIGOUT_NID, | ||
17558 | .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes), | ||
17559 | .channel_mode = alc662_3ST_2ch_modes, | ||
17560 | .unsol_event = alc663_mode7_unsol_event, | ||
17561 | .setup = alc663_mode7_setup, | ||
17562 | .init_hook = alc663_mode7_inithook, | ||
17563 | }, | ||
17564 | [ALC663_ASUS_MODE8] = { | ||
17565 | .mixers = { alc663_mode8_mixer }, | ||
17566 | .cap_mixer = alc662_auto_capture_mixer, | ||
17567 | .init_verbs = { alc662_init_verbs, | ||
17568 | alc663_mode8_init_verbs }, | ||
17569 | .num_dacs = ARRAY_SIZE(alc662_dac_nids), | ||
17570 | .hp_nid = 0x03, | ||
17571 | .dac_nids = alc662_dac_nids, | ||
17572 | .dig_out_nid = ALC662_DIGOUT_NID, | ||
17573 | .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes), | ||
17574 | .channel_mode = alc662_3ST_2ch_modes, | ||
17575 | .unsol_event = alc663_mode8_unsol_event, | ||
17576 | .setup = alc663_mode8_setup, | ||
17577 | .init_hook = alc663_mode8_inithook, | ||
17578 | }, | ||
17323 | [ALC272_DELL] = { | 17579 | [ALC272_DELL] = { |
17324 | .mixers = { alc663_m51va_mixer }, | 17580 | .mixers = { alc663_m51va_mixer }, |
17325 | .cap_mixer = alc272_auto_capture_mixer, | 17581 | .cap_mixer = alc272_auto_capture_mixer, |
@@ -17803,7 +18059,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = { | |||
17803 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, | 18059 | { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, |
17804 | { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, | 18060 | { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, |
17805 | { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, | 18061 | { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, |
18062 | { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 }, | ||
17806 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, | 18063 | { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, |
18064 | { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, | ||
17807 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", | 18065 | { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", |
17808 | .patch = patch_alc861 }, | 18066 | .patch = patch_alc861 }, |
17809 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, | 18067 | { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, |