aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-05-12 08:31:49 -0400
committerJaroslav Kysela <perex@suse.cz>2005-05-29 04:08:33 -0400
commitdfc0ff62a1d24e987205b41fbf322a4377626481 (patch)
tree9d16b44bed525194d745e8a861a395ed20a8a000 /sound/pci/hda/patch_realtek.c
parentc74db86bcf0897cdd4dc1f85ae0d76ef59aaeb20 (diff)
[ALSA] Add ASUS Z71V support
Documentation,HDA Codec driver Added the ASUS Z71V (or similar) laptop support. 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.c109
1 files changed, 109 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 17c5062423ae..c106e1fe01cf 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -39,6 +39,7 @@ enum {
39 ALC880_5ST, 39 ALC880_5ST,
40 ALC880_5ST_DIG, 40 ALC880_5ST_DIG,
41 ALC880_W810, 41 ALC880_W810,
42 ALC880_Z71V,
42}; 43};
43 44
44struct alc_spec { 45struct alc_spec {
@@ -90,6 +91,11 @@ static hda_nid_t alc880_w810_dac_nids[3] = {
90 0x02, 0x03, 0x04 91 0x02, 0x03, 0x04
91}; 92};
92 93
94static hda_nid_t alc880_z71v_dac_nids[1] = {
95 /* front only? */
96 0x02
97};
98
93static hda_nid_t alc880_adc_nids[3] = { 99static hda_nid_t alc880_adc_nids[3] = {
94 /* ADC0-2 */ 100 /* ADC0-2 */
95 0x07, 0x08, 0x09, 101 0x07, 0x08, 0x09,
@@ -284,6 +290,10 @@ static struct alc_channel_mode alc880_w810_modes[1] = {
284 { 6, NULL } 290 { 6, NULL }
285}; 291};
286 292
293static struct alc_channel_mode alc880_z71v_modes[1] = {
294 { 2, NULL }
295};
296
287/* 297/*
288 */ 298 */
289static int alc880_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 299static int alc880_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
@@ -475,6 +485,35 @@ static snd_kcontrol_new_t alc880_w810_base_mixer[] = {
475 { } /* end */ 485 { } /* end */
476}; 486};
477 487
488static snd_kcontrol_new_t alc880_z71v_mixer[] = {
489 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
490 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
491 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
492 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
493 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
494 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
495 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
496 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
497 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),
498 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
499 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),
500 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT),
501 {
502 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
503 /* The multiple "Capture Source" controls confuse alsamixer
504 * So call somewhat different..
505 * FIXME: the controls appear in the "playback" view!
506 */
507 /* .name = "Capture Source", */
508 .name = "Input Source",
509 .count = 2,
510 .info = alc_mux_enum_info,
511 .get = alc_mux_enum_get,
512 .put = alc_mux_enum_put,
513 },
514 { } /* end */
515};
516
478/* 517/*
479 */ 518 */
480static int alc_build_controls(struct hda_codec *codec) 519static int alc_build_controls(struct hda_codec *codec)
@@ -719,6 +758,58 @@ static struct hda_verb alc880_w810_init_verbs[] = {
719 { } 758 { }
720}; 759};
721 760
761static struct hda_verb alc880_z71v_init_verbs[] = {
762 /* front channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
763 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
764 /* front channel selector/amp: input 1: capture mix: muted, (no volume selection) */
765 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
766 /* front channel selector/amp: output 0: unmuted, max volume */
767 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
768 /* front out pin: muted, (no volume selection) */
769 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
770 /* front out pin: NOT headphone enable, out enable, vref disabled */
771 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
772 /* headphone channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
773 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
774 /* headphone channel selector/amp: input 1: capture mix: muted, (no volume selection) */
775 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
776 /* headphone channel selector/amp: output 0: unmuted, max volume */
777 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
778 /* headphone out pin: muted, (no volume selection) */
779 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
780 /* headpohne out pin: headphone enable, out enable, vref disabled */
781 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
782
783 /* Line In pin widget for input */
784 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
785 /* CD pin widget for input */
786 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
787 /* Mic1 (rear panel) pin widget for input and vref at 80% */
788 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
789 /* Mic2 (front panel) pin widget for input and vref at 80% */
790 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
791 /* unmute amp left and right */
792 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
793 /* set connection select to line in (default select for this ADC) */
794 {0x07, AC_VERB_SET_CONNECT_SEL, 0x02},
795
796 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) for mixer
797 * widget(nid=0x0B) to support the input path of analog loopback
798 */
799 /* Note: PASD motherboards uses the Line In 2 as the input for front panel mic (mic 2) */
800 /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 & Line In 2 = 0x03*/
801 /* unmute CD */
802 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))},
803 /* unmute Line In */
804 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))},
805 /* unmute Mic 1 */
806 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
807 /* unmute Line In 2 (for PASD boards Mic 2) */
808 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))},
809
810 { }
811};
812
722static int alc_init(struct hda_codec *codec) 813static int alc_init(struct hda_codec *codec)
723{ 814{
724 struct alc_spec *spec = codec->spec; 815 struct alc_spec *spec = codec->spec;
@@ -993,6 +1084,9 @@ static struct hda_board_config alc880_cfg_tbl[] = {
993 { .modelname = "w810", .config = ALC880_W810 }, 1084 { .modelname = "w810", .config = ALC880_W810 },
994 { .pci_vendor = 0x161f, .pci_device = 0x203d, .config = ALC880_W810 }, 1085 { .pci_vendor = 0x161f, .pci_device = 0x203d, .config = ALC880_W810 },
995 1086
1087 { .modelname = "z71v", .config = ALC880_Z71V },
1088 { .pci_vendor = 0x1043, .pci_device = 0x1964, .config = ALC880_Z71V },
1089
996 {} 1090 {}
997}; 1091};
998 1092
@@ -1023,6 +1117,10 @@ static int patch_alc880(struct hda_codec *codec)
1023 spec->mixers[spec->num_mixers] = alc880_five_stack_mixer; 1117 spec->mixers[spec->num_mixers] = alc880_five_stack_mixer;
1024 spec->num_mixers++; 1118 spec->num_mixers++;
1025 break; 1119 break;
1120 case ALC880_Z71V:
1121 spec->mixers[spec->num_mixers] = alc880_z71v_mixer;
1122 spec->num_mixers++;
1123 break;
1026 default: 1124 default:
1027 spec->mixers[spec->num_mixers] = alc880_base_mixer; 1125 spec->mixers[spec->num_mixers] = alc880_base_mixer;
1028 spec->num_mixers++; 1126 spec->num_mixers++;
@@ -1033,6 +1131,7 @@ static int patch_alc880(struct hda_codec *codec)
1033 case ALC880_3ST_DIG: 1131 case ALC880_3ST_DIG:
1034 case ALC880_5ST_DIG: 1132 case ALC880_5ST_DIG:
1035 case ALC880_W810: 1133 case ALC880_W810:
1134 case ALC880_Z71V:
1036 spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; 1135 spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
1037 break; 1136 break;
1038 default: 1137 default:
@@ -1063,6 +1162,11 @@ static int patch_alc880(struct hda_codec *codec)
1063 spec->channel_mode = alc880_w810_modes; 1162 spec->channel_mode = alc880_w810_modes;
1064 spec->num_channel_mode = ARRAY_SIZE(alc880_w810_modes); 1163 spec->num_channel_mode = ARRAY_SIZE(alc880_w810_modes);
1065 break; 1164 break;
1165 case ALC880_Z71V:
1166 spec->init_verbs = alc880_z71v_init_verbs;
1167 spec->channel_mode = alc880_z71v_modes;
1168 spec->num_channel_mode = ARRAY_SIZE(alc880_z71v_modes);
1169 break;
1066 default: 1170 default:
1067 spec->init_verbs = alc880_init_verbs_three_stack; 1171 spec->init_verbs = alc880_init_verbs_three_stack;
1068 spec->channel_mode = alc880_threestack_modes; 1172 spec->channel_mode = alc880_threestack_modes;
@@ -1086,6 +1190,11 @@ static int patch_alc880(struct hda_codec *codec)
1086 spec->multiout.dac_nids = alc880_w810_dac_nids; 1190 spec->multiout.dac_nids = alc880_w810_dac_nids;
1087 // No dedicated headphone socket - it's shared with built-in speakers. 1191 // No dedicated headphone socket - it's shared with built-in speakers.
1088 break; 1192 break;
1193 case ALC880_Z71V:
1194 spec->multiout.num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids);
1195 spec->multiout.dac_nids = alc880_z71v_dac_nids;
1196 spec->multiout.hp_nid = 0x03;
1197 break;
1089 default: 1198 default:
1090 spec->multiout.num_dacs = ARRAY_SIZE(alc880_dac_nids); 1199 spec->multiout.num_dacs = ARRAY_SIZE(alc880_dac_nids);
1091 spec->multiout.dac_nids = alc880_dac_nids; 1200 spec->multiout.dac_nids = alc880_dac_nids;