aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2010-02-04 08:18:18 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-04 08:18:18 -0500
commitcec27c891b805b2ab2302f9fcbdacb6f179ac0d4 (patch)
treea99d7b055dbfd048448b1e63fd51bf329ecd3aa2 /sound/pci/hda/patch_realtek.c
parent84898e87cc0fff976202d5b91656f2db949fc2dd (diff)
ALSA: hda - Add support of ALC665
- Add support for ALC665 - Add more ASUS model - Modify common patch for ALC272 ALC273 ALC661 ALC662 ALC663 ALC665 Signed-off-by: Kailang Yang <kailang@realtek.com> 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.c112
1 files changed, 44 insertions, 68 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 826ecdbdd2b..82772f0ab3e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -16597,13 +16597,6 @@ static struct hda_verb alc662_init_verbs[] = {
16597 /* ADC: mute amp left and right */ 16597 /* ADC: mute amp left and right */
16598 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16598 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16599 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 16599 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
16600 /* Front mixer: unmute input/output amp left and right (volume = 0) */
16601
16602 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16603 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
16604 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
16605 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
16606 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
16607 16600
16608 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16601 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16609 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16602 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -16653,6 +16646,28 @@ static struct hda_verb alc662_init_verbs[] = {
16653 { } 16646 { }
16654}; 16647};
16655 16648
16649static struct hda_verb alc663_init_verbs[] = {
16650 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16651 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16652 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16653 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16654 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16655 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16656 { }
16657};
16658
16659static struct hda_verb alc272_init_verbs[] = {
16660 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16661 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
16662 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16663 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16664 {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
16665 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
16666 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16667 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16668 { }
16669};
16670
16656static struct hda_verb alc662_sue_init_verbs[] = { 16671static struct hda_verb alc662_sue_init_verbs[] = {
16657 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT}, 16672 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT},
16658 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT}, 16673 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT},
@@ -16672,61 +16687,6 @@ static struct hda_verb alc662_eeepc_ep20_sue_init_verbs[] = {
16672 {} 16687 {}
16673}; 16688};
16674 16689
16675/*
16676 * generic initialization of ADC, input mixers and output mixers
16677 */
16678static struct hda_verb alc662_auto_init_verbs[] = {
16679 /*
16680 * Unmute ADC and set the default input to mic-in
16681 */
16682 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
16683 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16684
16685 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
16686 * mixer widget
16687 * Note: PASD motherboards uses the Line In 2 as the input for front
16688 * panel mic (mic 2)
16689 */
16690 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
16691 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
16692 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
16693 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
16694 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
16695 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
16696
16697 /*
16698 * Set up output mixers (0x0c - 0x0f)
16699 */
16700 /* set vol=0 to output mixers */
16701 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16702 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16703 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
16704
16705 /* set up input amps for analog loopback */
16706 /* Amp Indices: DAC = 0, mixer = 1 */
16707 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16708 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16709 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16710 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16711 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16712 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16713
16714
16715 /* FIXME: use matrix-type input source selection */
16716 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
16717 /* Input mixer */
16718 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16719 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16720 { }
16721};
16722
16723/* additional verbs for ALC663 */
16724static struct hda_verb alc663_auto_init_verbs[] = {
16725 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
16726 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
16727 { }
16728};
16729
16730static struct hda_verb alc663_m51va_init_verbs[] = { 16690static struct hda_verb alc663_m51va_init_verbs[] = {
16731 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 16691 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
16732 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 16692 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
@@ -17477,6 +17437,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
17477 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1), 17437 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1),
17478 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1), 17438 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1),
17479 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3), 17439 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3),
17440 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC663_ASUS_MODE1),
17480 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3), 17441 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3),
17481 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17442 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1),
17482 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), 17443 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2),
@@ -17512,6 +17473,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
17512 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3), 17473 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3),
17513 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3), 17474 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3),
17514 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1), 17475 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1),
17476 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC663_ASUS_MODE1),
17515 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1), 17477 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1),
17516 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1), 17478 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1),
17517 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1), 17479 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1),
@@ -18157,9 +18119,13 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
18157 spec->num_mux_defs = 1; 18119 spec->num_mux_defs = 1;
18158 spec->input_mux = &spec->private_imux[0]; 18120 spec->input_mux = &spec->private_imux[0];
18159 18121
18160 add_verb(spec, alc662_auto_init_verbs); 18122 add_verb(spec, alc662_init_verbs);
18161 if (codec->vendor_id == 0x10ec0663) 18123 if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 ||
18162 add_verb(spec, alc663_auto_init_verbs); 18124 codec->vendor_id == 0x10ec0665)
18125 add_verb(spec, alc663_init_verbs);
18126
18127 if (codec->vendor_id == 0x10ec0272)
18128 add_verb(spec, alc272_init_verbs);
18163 18129
18164 err = alc_auto_add_mic_boost(codec); 18130 err = alc_auto_add_mic_boost(codec);
18165 if (err < 0) 18131 if (err < 0)
@@ -18251,11 +18217,20 @@ static int patch_alc662(struct hda_codec *codec)
18251 18217
18252 if (!spec->cap_mixer) 18218 if (!spec->cap_mixer)
18253 set_capture_mixer(codec); 18219 set_capture_mixer(codec);
18254 if (codec->vendor_id == 0x10ec0662) 18220
18221 switch (codec->vendor_id) {
18222 case 0x10ec0662:
18255 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 18223 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
18256 else 18224 break;
18225 case 0x10ec0272:
18226 case 0x10ec0663:
18227 case 0x10ec0665:
18257 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 18228 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
18258 18229 break;
18230 case 0x10ec0273:
18231 set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
18232 break;
18233 }
18259 spec->vmaster_nid = 0x02; 18234 spec->vmaster_nid = 0x02;
18260 18235
18261 codec->patch_ops = alc_patch_ops; 18236 codec->patch_ops = alc_patch_ops;
@@ -18305,6 +18280,7 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
18305 { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", 18280 { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1",
18306 .patch = patch_alc662 }, 18281 .patch = patch_alc662 },
18307 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, 18282 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 },
18283 { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 },
18308 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, 18284 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 },
18309 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, 18285 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
18310 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 }, 18286 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },