aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com.tw>2009-12-17 06:23:00 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-17 06:23:00 -0500
commitebb83eeb6469bedda83b4dc6f23ddf93eb32b347 (patch)
tree9803c390358f5bdfb536b44666ed357116829346 /sound/pci
parent6dd7dc767e35cfbb38f8c63a50b1c27acad25920 (diff)
ALSA: hda - More ALC663 fixes and support of compatible chips
1. Add more ASUS NB model. 2. Fixed alc663_m51va_setup M51VA has Digital Mic that NID is 0x12. The record source index is 0x9 for ALC663. So, to modify the alc663_m51va_setup function to index 0x9 and add analog Mic aupport function alc663_mode1_setup. 3. Add ASUS mode7 and mode8 modules for ALC663 Signed-off-by: Kailang Yang <kailang@realtek.com.tw> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c306
1 files changed, 282 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c9e860709747..287bb6019df9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -131,8 +131,8 @@ enum {
131enum { 131enum {
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,
@@ -13232,10 +13234,12 @@ static struct hda_verb alc269_eeepc_amic_init_verbs[] = {
13232/* toggle speaker-output according to the hp-jack state */ 13234/* toggle speaker-output according to the hp-jack state */
13233static void alc269_speaker_automute(struct hda_codec *codec) 13235static void alc269_speaker_automute(struct hda_codec *codec)
13234{ 13236{
13237 struct alc_spec *spec = codec->spec;
13238 unsigned int nid = spec->autocfg.hp_pins[0];
13235 unsigned int present; 13239 unsigned int present;
13236 unsigned char bits; 13240 unsigned char bits;
13237 13241
13238 present = snd_hda_jack_detect(codec, 0x15); 13242 present = snd_hda_jack_detect(codec, nid);
13239 bits = present ? AMP_IN_MUTE(0) : 0; 13243 bits = present ? AMP_IN_MUTE(0) : 0;
13240 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 13244 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13241 AMP_IN_MUTE(0), bits); 13245 AMP_IN_MUTE(0), bits);
@@ -13460,8 +13464,8 @@ static void alc269_auto_init(struct hda_codec *codec)
13460static const char *alc269_models[ALC269_MODEL_LAST] = { 13464static const char *alc269_models[ALC269_MODEL_LAST] = {
13461 [ALC269_BASIC] = "basic", 13465 [ALC269_BASIC] = "basic",
13462 [ALC269_QUANTA_FL1] = "quanta", 13466 [ALC269_QUANTA_FL1] = "quanta",
13463 [ALC269_ASUS_EEEPC_P703] = "eeepc-p703", 13467 [ALC269_ASUS_AMIC] = "asus-amic",
13464 [ALC269_ASUS_EEEPC_P901] = "eeepc-p901", 13468 [ALC269_ASUS_DMIC] = "asus-dmic",
13465 [ALC269_FUJITSU] = "fujitsu", 13469 [ALC269_FUJITSU] = "fujitsu",
13466 [ALC269_LIFEBOOK] = "lifebook", 13470 [ALC269_LIFEBOOK] = "lifebook",
13467 [ALC269_AUTO] = "auto", 13471 [ALC269_AUTO] = "auto",
@@ -13470,18 +13474,41 @@ static const char *alc269_models[ALC269_MODEL_LAST] = {
13470static struct snd_pci_quirk alc269_cfg_tbl[] = { 13474static struct snd_pci_quirk alc269_cfg_tbl[] = {
13471 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13475 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1),
13472 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 13476 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
13473 ALC269_ASUS_EEEPC_P703), 13477 ALC269_ASUS_AMIC),
13474 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_EEEPC_P703), 13478 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC),
13475 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_EEEPC_P703), 13479 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC),
13476 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_EEEPC_P703), 13480 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC),
13477 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_EEEPC_P703), 13481 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC),
13478 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_EEEPC_P703), 13482 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC),
13479 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_EEEPC_P703), 13483 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC),
13484 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC),
13485 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC),
13486 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC),
13487 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC),
13488 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC),
13489 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC),
13490 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC),
13491 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC),
13492 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC),
13493 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC),
13494 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC),
13495 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC),
13496 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC),
13497 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC),
13498 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC),
13499 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC),
13500 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC),
13501 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC),
13502 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC),
13503 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC),
13504 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC),
13505 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC),
13480 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13506 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901",
13481 ALC269_ASUS_EEEPC_P901), 13507 ALC269_ASUS_DMIC),
13482 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 13508 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101",
13483 ALC269_ASUS_EEEPC_P901), 13509 ALC269_ASUS_DMIC),
13484 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_EEEPC_P901), 13510 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC),
13511 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC),
13485 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 13512 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
13486 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 13513 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
13487 {} 13514 {}
@@ -13511,7 +13538,7 @@ static struct alc_config_preset alc269_presets[] = {
13511 .setup = alc269_quanta_fl1_setup, 13538 .setup = alc269_quanta_fl1_setup,
13512 .init_hook = alc269_quanta_fl1_init_hook, 13539 .init_hook = alc269_quanta_fl1_init_hook,
13513 }, 13540 },
13514 [ALC269_ASUS_EEEPC_P703] = { 13541 [ALC269_ASUS_AMIC] = {
13515 .mixers = { alc269_eeepc_mixer }, 13542 .mixers = { alc269_eeepc_mixer },
13516 .cap_mixer = alc269_epc_capture_mixer, 13543 .cap_mixer = alc269_epc_capture_mixer,
13517 .init_verbs = { alc269_init_verbs, 13544 .init_verbs = { alc269_init_verbs,
@@ -13525,7 +13552,7 @@ static struct alc_config_preset alc269_presets[] = {
13525 .setup = alc269_eeepc_amic_setup, 13552 .setup = alc269_eeepc_amic_setup,
13526 .init_hook = alc269_eeepc_inithook, 13553 .init_hook = alc269_eeepc_inithook,
13527 }, 13554 },
13528 [ALC269_ASUS_EEEPC_P901] = { 13555 [ALC269_ASUS_DMIC] = {
13529 .mixers = { alc269_eeepc_mixer }, 13556 .mixers = { alc269_eeepc_mixer },
13530 .cap_mixer = alc269_epc_capture_mixer, 13557 .cap_mixer = alc269_epc_capture_mixer,
13531 .init_verbs = { alc269_init_verbs, 13558 .init_verbs = { alc269_init_verbs,
@@ -16160,6 +16187,52 @@ static struct snd_kcontrol_new alc663_g50v_mixer[] = {
16160 { } /* end */ 16187 { } /* end */
16161}; 16188};
16162 16189
16190static struct hda_bind_ctls alc663_asus_mode7_8_all_bind_switch = {
16191 .ops = &snd_hda_bind_sw,
16192 .values = {
16193 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16194 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
16195 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
16196 HDA_COMPOSE_AMP_VAL(0x1b, 3, 0, HDA_OUTPUT),
16197 HDA_COMPOSE_AMP_VAL(0x21, 3, 0, HDA_OUTPUT),
16198 0
16199 },
16200};
16201
16202static struct hda_bind_ctls alc663_asus_mode7_8_sp_bind_switch = {
16203 .ops = &snd_hda_bind_sw,
16204 .values = {
16205 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
16206 HDA_COMPOSE_AMP_VAL(0x17, 3, 0, HDA_OUTPUT),
16207 0
16208 },
16209};
16210
16211static struct snd_kcontrol_new alc663_mode7_mixer[] = {
16212 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
16213 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
16214 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
16215 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
16216 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
16217 HDA_CODEC_VOLUME("IntMic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16218 HDA_CODEC_MUTE("IntMic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16219 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
16220 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
16221 { } /* end */
16222};
16223
16224static struct snd_kcontrol_new alc663_mode8_mixer[] = {
16225 HDA_BIND_SW("Master Playback Switch", &alc663_asus_mode7_8_all_bind_switch),
16226 HDA_BIND_VOL("Speaker Playback Volume", &alc663_asus_bind_master_vol),
16227 HDA_BIND_SW("Speaker Playback Switch", &alc663_asus_mode7_8_sp_bind_switch),
16228 HDA_CODEC_MUTE("Headphone1 Playback Switch", 0x15, 0x0, HDA_OUTPUT),
16229 HDA_CODEC_MUTE("Headphone2 Playback Switch", 0x21, 0x0, HDA_OUTPUT),
16230 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
16231 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
16232 { } /* end */
16233};
16234
16235
16163static struct snd_kcontrol_new alc662_chmode_mixer[] = { 16236static struct snd_kcontrol_new alc662_chmode_mixer[] = {
16164 { 16237 {
16165 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 16238 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -16447,6 +16520,45 @@ static struct hda_verb alc272_dell_init_verbs[] = {
16447 {} 16520 {}
16448}; 16521};
16449 16522
16523static struct hda_verb alc663_mode7_init_verbs[] = {
16524 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16525 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16526 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16527 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16528 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16529 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16530 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
16531 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16532 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16533 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
16534 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16535 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
16536 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
16537 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16538 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16539 {}
16540};
16541
16542static struct hda_verb alc663_mode8_init_verbs[] = {
16543 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16544 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16545 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16546 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
16547 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16548 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16549 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16550 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16551 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
16552 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16553 {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Headphone */
16554 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16555 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(9)},
16556 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16557 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
16558 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
16559 {}
16560};
16561
16450static struct snd_kcontrol_new alc662_auto_capture_mixer[] = { 16562static struct snd_kcontrol_new alc662_auto_capture_mixer[] = {
16451 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 16563 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
16452 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 16564 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
@@ -16626,6 +16738,54 @@ static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec)
16626 } 16738 }
16627} 16739}
16628 16740
16741static void alc663_two_hp_m7_speaker_automute(struct hda_codec *codec)
16742{
16743 unsigned int present1, present2;
16744
16745 present1 = snd_hda_codec_read(codec, 0x1b, 0,
16746 AC_VERB_GET_PIN_SENSE, 0)
16747 & AC_PINSENSE_PRESENCE;
16748 present2 = snd_hda_codec_read(codec, 0x21, 0,
16749 AC_VERB_GET_PIN_SENSE, 0)
16750 & AC_PINSENSE_PRESENCE;
16751
16752 if (present1 || present2) {
16753 snd_hda_codec_write_cache(codec, 0x14, 0,
16754 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16755 snd_hda_codec_write_cache(codec, 0x17, 0,
16756 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16757 } else {
16758 snd_hda_codec_write_cache(codec, 0x14, 0,
16759 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16760 snd_hda_codec_write_cache(codec, 0x17, 0,
16761 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16762 }
16763}
16764
16765static void alc663_two_hp_m8_speaker_automute(struct hda_codec *codec)
16766{
16767 unsigned int present1, present2;
16768
16769 present1 = snd_hda_codec_read(codec, 0x21, 0,
16770 AC_VERB_GET_PIN_SENSE, 0)
16771 & AC_PINSENSE_PRESENCE;
16772 present2 = snd_hda_codec_read(codec, 0x15, 0,
16773 AC_VERB_GET_PIN_SENSE, 0)
16774 & AC_PINSENSE_PRESENCE;
16775
16776 if (present1 || present2) {
16777 snd_hda_codec_write_cache(codec, 0x14, 0,
16778 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16779 snd_hda_codec_write_cache(codec, 0x17, 0,
16780 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
16781 } else {
16782 snd_hda_codec_write_cache(codec, 0x14, 0,
16783 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16784 snd_hda_codec_write_cache(codec, 0x17, 0,
16785 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
16786 }
16787}
16788
16629static void alc663_m51va_unsol_event(struct hda_codec *codec, 16789static void alc663_m51va_unsol_event(struct hda_codec *codec,
16630 unsigned int res) 16790 unsigned int res)
16631{ 16791{
@@ -16645,7 +16805,7 @@ static void alc663_m51va_setup(struct hda_codec *codec)
16645 spec->ext_mic.pin = 0x18; 16805 spec->ext_mic.pin = 0x18;
16646 spec->ext_mic.mux_idx = 0; 16806 spec->ext_mic.mux_idx = 0;
16647 spec->int_mic.pin = 0x12; 16807 spec->int_mic.pin = 0x12;
16648 spec->int_mic.mux_idx = 1; 16808 spec->int_mic.mux_idx = 9;
16649 spec->auto_mic = 1; 16809 spec->auto_mic = 1;
16650} 16810}
16651 16811
@@ -16657,7 +16817,17 @@ static void alc663_m51va_inithook(struct hda_codec *codec)
16657 16817
16658/* ***************** Mode1 ******************************/ 16818/* ***************** Mode1 ******************************/
16659#define alc663_mode1_unsol_event alc663_m51va_unsol_event 16819#define alc663_mode1_unsol_event alc663_m51va_unsol_event
16660#define alc663_mode1_setup alc663_m51va_setup 16820
16821static void alc663_mode1_setup(struct hda_codec *codec)
16822{
16823 struct alc_spec *spec = codec->spec;
16824 spec->ext_mic.pin = 0x18;
16825 spec->ext_mic.mux_idx = 0;
16826 spec->int_mic.pin = 0x19;
16827 spec->int_mic.mux_idx = 1;
16828 spec->auto_mic = 1;
16829}
16830
16661#define alc663_mode1_inithook alc663_m51va_inithook 16831#define alc663_mode1_inithook alc663_m51va_inithook
16662 16832
16663/* ***************** Mode2 ******************************/ 16833/* ***************** Mode2 ******************************/
@@ -16674,7 +16844,7 @@ static void alc662_mode2_unsol_event(struct hda_codec *codec,
16674 } 16844 }
16675} 16845}
16676 16846
16677#define alc662_mode2_setup alc663_m51va_setup 16847#define alc662_mode2_setup alc663_mode1_setup
16678 16848
16679static void alc662_mode2_inithook(struct hda_codec *codec) 16849static void alc662_mode2_inithook(struct hda_codec *codec)
16680{ 16850{
@@ -16695,7 +16865,7 @@ static void alc663_mode3_unsol_event(struct hda_codec *codec,
16695 } 16865 }
16696} 16866}
16697 16867
16698#define alc663_mode3_setup alc663_m51va_setup 16868#define alc663_mode3_setup alc663_mode1_setup
16699 16869
16700static void alc663_mode3_inithook(struct hda_codec *codec) 16870static void alc663_mode3_inithook(struct hda_codec *codec)
16701{ 16871{
@@ -16716,7 +16886,7 @@ static void alc663_mode4_unsol_event(struct hda_codec *codec,
16716 } 16886 }
16717} 16887}
16718 16888
16719#define alc663_mode4_setup alc663_m51va_setup 16889#define alc663_mode4_setup alc663_mode1_setup
16720 16890
16721static void alc663_mode4_inithook(struct hda_codec *codec) 16891static void alc663_mode4_inithook(struct hda_codec *codec)
16722{ 16892{
@@ -16737,7 +16907,7 @@ static void alc663_mode5_unsol_event(struct hda_codec *codec,
16737 } 16907 }
16738} 16908}
16739 16909
16740#define alc663_mode5_setup alc663_m51va_setup 16910#define alc663_mode5_setup alc663_mode1_setup
16741 16911
16742static void alc663_mode5_inithook(struct hda_codec *codec) 16912static void alc663_mode5_inithook(struct hda_codec *codec)
16743{ 16913{
@@ -16758,7 +16928,7 @@ static void alc663_mode6_unsol_event(struct hda_codec *codec,
16758 } 16928 }
16759} 16929}
16760 16930
16761#define alc663_mode6_setup alc663_m51va_setup 16931#define alc663_mode6_setup alc663_mode1_setup
16762 16932
16763static void alc663_mode6_inithook(struct hda_codec *codec) 16933static void alc663_mode6_inithook(struct hda_codec *codec)
16764{ 16934{
@@ -16766,6 +16936,50 @@ static void alc663_mode6_inithook(struct hda_codec *codec)
16766 alc_mic_automute(codec); 16936 alc_mic_automute(codec);
16767} 16937}
16768 16938
16939/* ***************** Mode7 ******************************/
16940static void alc663_mode7_unsol_event(struct hda_codec *codec,
16941 unsigned int res)
16942{
16943 switch (res >> 26) {
16944 case ALC880_HP_EVENT:
16945 alc663_two_hp_m7_speaker_automute(codec);
16946 break;
16947 case ALC880_MIC_EVENT:
16948 alc_mic_automute(codec);
16949 break;
16950 }
16951}
16952
16953#define alc663_mode7_setup alc663_mode1_setup
16954
16955static void alc663_mode7_inithook(struct hda_codec *codec)
16956{
16957 alc663_two_hp_m7_speaker_automute(codec);
16958 alc_mic_automute(codec);
16959}
16960
16961/* ***************** Mode8 ******************************/
16962static void alc663_mode8_unsol_event(struct hda_codec *codec,
16963 unsigned int res)
16964{
16965 switch (res >> 26) {
16966 case ALC880_HP_EVENT:
16967 alc663_two_hp_m8_speaker_automute(codec);
16968 break;
16969 case ALC880_MIC_EVENT:
16970 alc_mic_automute(codec);
16971 break;
16972 }
16973}
16974
16975#define alc663_mode8_setup alc663_m51va_setup
16976
16977static void alc663_mode8_inithook(struct hda_codec *codec)
16978{
16979 alc663_two_hp_m8_speaker_automute(codec);
16980 alc_mic_automute(codec);
16981}
16982
16769static void alc663_g71v_hp_automute(struct hda_codec *codec) 16983static void alc663_g71v_hp_automute(struct hda_codec *codec)
16770{ 16984{
16771 unsigned int present; 16985 unsigned int present;
@@ -16900,6 +17114,8 @@ static const char *alc662_models[ALC662_MODEL_LAST] = {
16900 [ALC663_ASUS_MODE4] = "asus-mode4", 17114 [ALC663_ASUS_MODE4] = "asus-mode4",
16901 [ALC663_ASUS_MODE5] = "asus-mode5", 17115 [ALC663_ASUS_MODE5] = "asus-mode5",
16902 [ALC663_ASUS_MODE6] = "asus-mode6", 17116 [ALC663_ASUS_MODE6] = "asus-mode6",
17117 [ALC663_ASUS_MODE7] = "asus-mode7",
17118 [ALC663_ASUS_MODE8] = "asus-mode8",
16903 [ALC272_DELL] = "dell", 17119 [ALC272_DELL] = "dell",
16904 [ALC272_DELL_ZM1] = "dell-zm1", 17120 [ALC272_DELL_ZM1] = "dell-zm1",
16905 [ALC272_SAMSUNG_NC10] = "samsung-nc10", 17121 [ALC272_SAMSUNG_NC10] = "samsung-nc10",
@@ -16916,12 +17132,22 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
16916 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17132 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1),
16917 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), 17133 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2),
16918 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1), 17134 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC663_ASUS_MODE1),
17135 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC663_ASUS_MODE1),
17136 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC663_ASUS_MODE1),
16919 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2), 17137 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_ASUS_MODE2),
17138 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC663_ASUS_MODE7),
17139 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC663_ASUS_MODE7),
17140 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC663_ASUS_MODE8),
17141 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC663_ASUS_MODE3),
17142 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC663_ASUS_MODE1),
16920 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2), 17143 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_ASUS_MODE2),
17144 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_ASUS_MODE2),
17145 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC663_ASUS_MODE1),
16921 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2), 17146 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_ASUS_MODE2),
16922 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6), 17147 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC663_ASUS_MODE6),
16923 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6), 17148 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC663_ASUS_MODE6),
16924 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2), 17149 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_ASUS_MODE2),
17150 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC663_ASUS_MODE1),
16925 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3), 17151 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC663_ASUS_MODE3),
16926 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA), 17152 SND_PCI_QUIRK(0x1043, 0x17c3, "ASUS UX20", ALC663_ASUS_M51VA),
16927 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2), 17153 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_ASUS_MODE2),
@@ -17205,6 +17431,36 @@ static struct alc_config_preset alc662_presets[] = {
17205 .setup = alc663_mode6_setup, 17431 .setup = alc663_mode6_setup,
17206 .init_hook = alc663_mode6_inithook, 17432 .init_hook = alc663_mode6_inithook,
17207 }, 17433 },
17434 [ALC663_ASUS_MODE7] = {
17435 .mixers = { alc663_mode7_mixer },
17436 .cap_mixer = alc662_auto_capture_mixer,
17437 .init_verbs = { alc662_init_verbs,
17438 alc663_mode7_init_verbs },
17439 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
17440 .hp_nid = 0x03,
17441 .dac_nids = alc662_dac_nids,
17442 .dig_out_nid = ALC662_DIGOUT_NID,
17443 .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
17444 .channel_mode = alc662_3ST_2ch_modes,
17445 .unsol_event = alc663_mode7_unsol_event,
17446 .setup = alc663_mode7_setup,
17447 .init_hook = alc663_mode7_inithook,
17448 },
17449 [ALC663_ASUS_MODE8] = {
17450 .mixers = { alc663_mode8_mixer },
17451 .cap_mixer = alc662_auto_capture_mixer,
17452 .init_verbs = { alc662_init_verbs,
17453 alc663_mode8_init_verbs },
17454 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
17455 .hp_nid = 0x03,
17456 .dac_nids = alc662_dac_nids,
17457 .dig_out_nid = ALC662_DIGOUT_NID,
17458 .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
17459 .channel_mode = alc662_3ST_2ch_modes,
17460 .unsol_event = alc663_mode8_unsol_event,
17461 .setup = alc663_mode8_setup,
17462 .init_hook = alc663_mode8_inithook,
17463 },
17208 [ALC272_DELL] = { 17464 [ALC272_DELL] = {
17209 .mixers = { alc663_m51va_mixer }, 17465 .mixers = { alc663_m51va_mixer },
17210 .cap_mixer = alc272_auto_capture_mixer, 17466 .cap_mixer = alc272_auto_capture_mixer,
@@ -17688,7 +17944,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
17688 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, 17944 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
17689 { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 }, 17945 { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
17690 { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 }, 17946 { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
17947 { .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 },
17691 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, 17948 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
17949 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
17692 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 17950 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
17693 .patch = patch_alc861 }, 17951 .patch = patch_alc861 },
17694 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, 17952 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },