2 * ALC662/ALC663/ALC665/ALC670 quirk models
3 * included by patch_realtek.c
16 #define ALC662_DIGOUT_NID 0x06
17 #define ALC662_DIGIN_NID 0x0a
19 static const hda_nid_t alc662_dac_nids[3] = {
20 /* front, rear, clfe */
24 static const hda_nid_t alc272_dac_nids[2] = {
28 static const hda_nid_t alc662_adc_nids[2] = {
33 static const hda_nid_t alc272_adc_nids[1] = {
38 static const hda_nid_t alc662_capsrc_nids[2] = { 0x22, 0x23 };
39 static const hda_nid_t alc272_capsrc_nids[1] = { 0x23 };
43 /* FIXME: should be a matrix-type input source selection */
44 static const struct hda_input_mux alc662_capture_source = {
54 static const struct hda_input_mux alc662_lenovo_101e_capture_source = {
62 static const struct hda_input_mux alc663_capture_source = {
74 static const struct hda_channel_mode alc662_3ST_2ch_modes[1] = {
81 static const struct hda_verb alc662_3ST_ch2_init[] = {
82 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
83 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
84 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
85 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
92 static const struct hda_verb alc662_3ST_ch6_init[] = {
93 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
94 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
95 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
96 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
97 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
98 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
102 static const struct hda_channel_mode alc662_3ST_6ch_modes[2] = {
103 { 2, alc662_3ST_ch2_init },
104 { 6, alc662_3ST_ch6_init },
110 static const struct hda_verb alc662_sixstack_ch6_init[] = {
111 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
112 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
113 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
120 static const struct hda_verb alc662_sixstack_ch8_init[] = {
121 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
122 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
123 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
127 static const struct hda_channel_mode alc662_5stack_modes[2] = {
128 { 2, alc662_sixstack_ch6_init },
129 { 6, alc662_sixstack_ch8_init },
132 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
133 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
136 static const struct snd_kcontrol_new alc662_base_mixer[] = {
137 /* output mixer control */
138 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
139 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
140 HDA_CODEC_VOLUME("Surround Playback Volume", 0x3, 0x0, HDA_OUTPUT),
141 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT),
142 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT),
143 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT),
144 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT),
145 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT),
146 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
148 /*Input mixer control */
149 HDA_CODEC_VOLUME("CD Playback Volume", 0xb, 0x4, HDA_INPUT),
150 HDA_CODEC_MUTE("CD Playback Switch", 0xb, 0x4, HDA_INPUT),
151 HDA_CODEC_VOLUME("Line Playback Volume", 0xb, 0x02, HDA_INPUT),
152 HDA_CODEC_MUTE("Line Playback Switch", 0xb, 0x02, HDA_INPUT),
153 HDA_CODEC_VOLUME("Mic Playback Volume", 0xb, 0x0, HDA_INPUT),
154 HDA_CODEC_MUTE("Mic Playback Switch", 0xb, 0x0, HDA_INPUT),
155 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0xb, 0x01, HDA_INPUT),
156 HDA_CODEC_MUTE("Front Mic Playback Switch", 0xb, 0x01, HDA_INPUT),
160 static const struct snd_kcontrol_new alc662_3ST_2ch_mixer[] = {
161 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
162 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
163 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
164 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
165 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
166 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
167 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
168 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
169 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
170 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
171 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
175 static const struct snd_kcontrol_new alc662_3ST_6ch_mixer[] = {
176 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
177 HDA_CODEC_MUTE("Front Playback Switch", 0x0c, 0x0, HDA_INPUT),
178 HDA_CODEC_VOLUME("Surround Playback Volume", 0x03, 0x0, HDA_OUTPUT),
179 HDA_CODEC_MUTE("Surround Playback Switch", 0x0d, 0x0, HDA_INPUT),
180 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x04, 1, 0x0, HDA_OUTPUT),
181 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x04, 2, 0x0, HDA_OUTPUT),
182 HDA_CODEC_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x0, HDA_INPUT),
183 HDA_CODEC_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x0, HDA_INPUT),
184 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
185 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
186 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
187 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
188 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
189 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
190 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
191 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
192 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
196 static const struct snd_kcontrol_new alc662_chmode_mixer[] = {
198 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
199 .name = "Channel Mode",
200 .info = alc_ch_mode_info,
201 .get = alc_ch_mode_get,
202 .put = alc_ch_mode_put,
207 static const struct hda_verb alc662_init_verbs[] = {
208 /* ADC: mute amp left and right */
209 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
210 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
212 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
213 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
214 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
215 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
216 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
217 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
219 /* Front Pin: output 0 (0x0c) */
220 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
221 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
223 /* Rear Pin: output 1 (0x0d) */
224 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
225 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
227 /* CLFE Pin: output 2 (0x0e) */
228 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
229 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
231 /* Mic (rear) pin: input vref at 80% */
232 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
233 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
234 /* Front Mic pin: input vref at 80% */
235 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
236 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
237 /* Line In pin: input */
238 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
239 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
240 /* Line-2 In: Headphone output (output 0 - 0x0c) */
241 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
242 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
243 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
244 /* CD pin widget for input */
245 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
247 /* FIXME: use matrix-type input source selection */
248 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
250 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
251 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
256 static const struct hda_verb alc662_eapd_init_verbs[] = {
257 /* always trun on EAPD */
258 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
259 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
264 * configuration and preset
266 static const char * const alc662_models[ALC662_MODEL_LAST] = {
267 [ALC662_3ST_2ch_DIG] = "3stack-dig",
268 [ALC662_3ST_6ch_DIG] = "3stack-6ch-dig",
269 [ALC662_3ST_6ch] = "3stack-6ch",
270 [ALC662_5ST_DIG] = "5stack-dig",
271 [ALC662_AUTO] = "auto",
274 static const struct snd_pci_quirk alc662_cfg_tbl[] = {
275 SND_PCI_QUIRK(0x1043, 0x8290, "ASUS P5GC-MX", ALC662_3ST_6ch_DIG),
276 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",
278 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
280 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
281 SND_PCI_QUIRK(0x1849, 0x3662, "ASROCK K10N78FullHD-hSLI R3.0",
286 static const struct alc_config_preset alc662_presets[] = {
287 [ALC662_3ST_2ch_DIG] = {
288 .mixers = { alc662_3ST_2ch_mixer },
289 .init_verbs = { alc662_init_verbs, alc662_eapd_init_verbs },
290 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
291 .dac_nids = alc662_dac_nids,
292 .dig_out_nid = ALC662_DIGOUT_NID,
293 .dig_in_nid = ALC662_DIGIN_NID,
294 .num_channel_mode = ARRAY_SIZE(alc662_3ST_2ch_modes),
295 .channel_mode = alc662_3ST_2ch_modes,
296 .input_mux = &alc662_capture_source,
298 [ALC662_3ST_6ch_DIG] = {
299 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
300 .init_verbs = { alc662_init_verbs, alc662_eapd_init_verbs },
301 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
302 .dac_nids = alc662_dac_nids,
303 .dig_out_nid = ALC662_DIGOUT_NID,
304 .dig_in_nid = ALC662_DIGIN_NID,
305 .num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
306 .channel_mode = alc662_3ST_6ch_modes,
308 .input_mux = &alc662_capture_source,
311 .mixers = { alc662_3ST_6ch_mixer, alc662_chmode_mixer },
312 .init_verbs = { alc662_init_verbs, alc662_eapd_init_verbs },
313 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
314 .dac_nids = alc662_dac_nids,
315 .num_channel_mode = ARRAY_SIZE(alc662_3ST_6ch_modes),
316 .channel_mode = alc662_3ST_6ch_modes,
318 .input_mux = &alc662_capture_source,
321 .mixers = { alc662_base_mixer, alc662_chmode_mixer },
322 .init_verbs = { alc662_init_verbs, alc662_eapd_init_verbs },
323 .num_dacs = ARRAY_SIZE(alc662_dac_nids),
324 .dac_nids = alc662_dac_nids,
325 .dig_out_nid = ALC662_DIGOUT_NID,
326 .dig_in_nid = ALC662_DIGIN_NID,
327 .num_channel_mode = ARRAY_SIZE(alc662_5stack_modes),
328 .channel_mode = alc662_5stack_modes,
329 .input_mux = &alc662_capture_source,