3 * included by patch_realtek.c
6 /* ALC880 board config type */
29 #ifdef CONFIG_SND_DEBUG
32 ALC880_MODEL_LAST /* last tag */
36 * ALC880 3-stack model
38 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
39 * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
40 * F-Mic = 0x1b, HP = 0x19
43 static const hda_nid_t alc880_dac_nids[4] = {
44 /* front, rear, clfe, rear_surr */
45 0x02, 0x05, 0x04, 0x03
48 static const hda_nid_t alc880_adc_nids[3] = {
53 /* The datasheet says the node 0x07 is connected from inputs,
54 * but it shows zero connection in the real implementation on some devices.
55 * Note: this is a 915GAV bug, fixed on 915GLV
57 static const hda_nid_t alc880_adc_nids_alt[2] = {
62 #define ALC880_DIGOUT_NID 0x06
63 #define ALC880_DIGIN_NID 0x0a
64 #define ALC880_PIN_CD_NID 0x1c
66 static const struct hda_input_mux alc880_capture_source = {
76 /* channel source setting (2/6 channel selection for 3-stack) */
78 static const struct hda_verb alc880_threestack_ch2_init[] = {
79 /* set line-in to input, mute it */
80 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
81 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
82 /* set mic-in to input vref 80%, mute it */
83 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
84 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
89 static const struct hda_verb alc880_threestack_ch6_init[] = {
90 /* set line-in to output, unmute it */
91 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
92 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
93 /* set mic-in to output, unmute it */
94 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
95 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
99 static const struct hda_channel_mode alc880_threestack_modes[2] = {
100 { 2, alc880_threestack_ch2_init },
101 { 6, alc880_threestack_ch6_init },
104 static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
105 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
106 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
107 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
108 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
109 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
110 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
111 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
112 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
113 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
114 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
115 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
116 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
117 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
118 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
119 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
120 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
121 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
123 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
124 .name = "Channel Mode",
125 .info = alc_ch_mode_info,
126 .get = alc_ch_mode_get,
127 .put = alc_ch_mode_put,
133 * ALC880 5-stack model
135 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
137 * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
138 * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
141 /* additional mixers to alc880_three_stack_mixer */
142 static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
143 HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
144 HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
148 /* channel source setting (6/8 channel selection for 5-stack) */
150 static const struct hda_verb alc880_fivestack_ch6_init[] = {
151 /* set line-in to input, mute it */
152 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
153 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
158 static const struct hda_verb alc880_fivestack_ch8_init[] = {
159 /* set line-in to output, unmute it */
160 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
161 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
165 static const struct hda_channel_mode alc880_fivestack_modes[2] = {
166 { 6, alc880_fivestack_ch6_init },
167 { 8, alc880_fivestack_ch8_init },
172 * ALC880 6-stack model
174 * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
176 * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
177 * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
180 static const hda_nid_t alc880_6st_dac_nids[4] = {
181 /* front, rear, clfe, rear_surr */
182 0x02, 0x03, 0x04, 0x05
185 static const struct hda_input_mux alc880_6stack_capture_source = {
189 { "Front Mic", 0x1 },
195 /* fixed 8-channels */
196 static const struct hda_channel_mode alc880_sixstack_modes[1] = {
200 static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
201 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
202 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
203 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
204 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
205 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
206 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
207 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
208 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
209 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
210 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
211 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
212 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
213 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
214 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
215 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
216 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
217 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
218 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
220 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
221 .name = "Channel Mode",
222 .info = alc_ch_mode_info,
223 .get = alc_ch_mode_get,
224 .put = alc_ch_mode_put,
233 * W810 has rear IO for:
236 * Center/LFE (DAC 04)
239 * The system also has a pair of internal speakers, and a headphone jack.
240 * These are both connected to Line2 on the codec, hence to DAC 02.
242 * There is a variable resistor to control the speaker or headphone
243 * volume. This is a hardware-only device without a software API.
245 * Plugging headphones in will disable the internal speakers. This is
246 * implemented in hardware, not via the driver using jack sense. In
247 * a similar fashion, plugging into the rear socket marked "front" will
248 * disable both the speakers and headphones.
250 * For input, there's a microphone jack, and an "audio in" jack.
251 * These may not do anything useful with this driver yet, because I
252 * haven't setup any initialization verbs for these yet...
255 static const hda_nid_t alc880_w810_dac_nids[3] = {
256 /* front, rear/surround, clfe */
260 /* fixed 6 channels */
261 static const struct hda_channel_mode alc880_w810_modes[1] = {
265 /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
266 static const struct snd_kcontrol_new alc880_w810_base_mixer[] = {
267 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
268 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
269 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
270 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
271 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
272 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
273 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
274 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
275 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
283 * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
284 * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
288 static const hda_nid_t alc880_z71v_dac_nids[1] = {
291 #define ALC880_Z71V_HP_DAC 0x03
293 /* fixed 2 channels */
294 static const struct hda_channel_mode alc880_2_jack_modes[1] = {
298 static const struct snd_kcontrol_new alc880_z71v_mixer[] = {
299 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
300 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
301 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
302 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
303 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
304 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
305 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
306 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
314 * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
315 * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
318 static const hda_nid_t alc880_f1734_dac_nids[1] = {
321 #define ALC880_F1734_HP_DAC 0x02
323 static const struct snd_kcontrol_new alc880_f1734_mixer[] = {
324 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
325 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
326 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
327 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
328 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
329 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
330 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
331 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
335 static const struct hda_input_mux alc880_f1734_capture_source = {
347 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
348 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
349 * Mic = 0x18, Line = 0x1a
352 #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
353 #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
355 static const struct snd_kcontrol_new alc880_asus_mixer[] = {
356 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
357 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
358 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
359 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
360 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
361 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
362 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
363 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
364 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
365 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
366 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
367 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
368 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
369 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
371 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
372 .name = "Channel Mode",
373 .info = alc_ch_mode_info,
374 .get = alc_ch_mode_get,
375 .put = alc_ch_mode_put,
381 * ALC880 ASUS W1V model
383 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
384 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
385 * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
388 /* additional mixers to alc880_asus_mixer */
389 static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
390 HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
391 HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
396 static const struct snd_kcontrol_new alc880_tcl_s700_mixer[] = {
397 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
398 HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
399 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
400 HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT),
401 HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT),
402 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT),
403 HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT),
404 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
405 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
410 static const struct snd_kcontrol_new alc880_uniwill_mixer[] = {
411 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
412 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
413 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
414 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
415 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
416 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
417 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
418 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
419 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
420 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
421 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
422 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
423 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
424 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
425 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
426 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
428 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
429 .name = "Channel Mode",
430 .info = alc_ch_mode_info,
431 .get = alc_ch_mode_get,
432 .put = alc_ch_mode_put,
437 static const struct snd_kcontrol_new alc880_fujitsu_mixer[] = {
438 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
439 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
440 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
441 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
442 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
443 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
444 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
445 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
446 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
447 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
451 static const struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
452 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
453 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
454 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
455 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
456 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
457 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
462 * initialize the codec volumes, etc
466 * generic initialization of ADC, input mixers and output mixers
468 static const struct hda_verb alc880_volume_init_verbs[] = {
470 * Unmute ADC0-2 and set the default input to mic-in
472 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
473 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
474 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
475 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
476 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
477 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
479 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
481 * Note: PASD motherboards uses the Line In 2 as the input for front
484 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
485 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
486 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
487 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
488 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
489 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
490 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
491 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
494 * Set up output mixers (0x0c - 0x0f)
496 /* set vol=0 to output mixers */
497 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
498 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
499 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
500 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
501 /* set up input amps for analog loopback */
502 /* Amp Indices: DAC = 0, mixer = 1 */
503 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
504 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
505 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
506 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
507 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
508 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
509 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
510 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
516 * 3-stack pin configuration:
517 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
519 static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
521 * preset connection lists of input pins
522 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
524 {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
525 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
526 {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
529 * Set pin mode and muting
531 /* set front pin widgets 0x14 for output */
532 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
533 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
534 /* Mic1 (rear panel) pin widget for input and vref at 80% */
535 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
536 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
537 /* Mic2 (as headphone out) for HP output */
538 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
539 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
540 /* Line In pin widget for input */
541 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
542 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
543 /* Line2 (as front mic) pin widget for input and vref at 80% */
544 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
545 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
546 /* CD pin widget for input */
547 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
553 * 5-stack pin configuration:
554 * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
555 * line-in/side = 0x1a, f-mic = 0x1b
557 static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
559 * preset connection lists of input pins
560 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
562 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
563 {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
566 * Set pin mode and muting
568 /* set pin widgets 0x14-0x17 for output */
569 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
570 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
571 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
572 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
573 /* unmute pins for output (no gain on this amp) */
574 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
575 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
576 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
577 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
579 /* Mic1 (rear panel) pin widget for input and vref at 80% */
580 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
581 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
582 /* Mic2 (as headphone out) for HP output */
583 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
584 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
585 /* Line In pin widget for input */
586 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
587 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
588 /* Line2 (as front mic) pin widget for input and vref at 80% */
589 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
590 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
591 /* CD pin widget for input */
592 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
598 * W810 pin configuration:
599 * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
601 static const struct hda_verb alc880_pin_w810_init_verbs[] = {
602 /* hphone/speaker input selector: front DAC */
603 {0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
605 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
606 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
607 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
608 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
609 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
610 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
612 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
613 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
619 * Z71V pin configuration:
620 * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
622 static const struct hda_verb alc880_pin_z71v_init_verbs[] = {
623 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
624 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
625 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
626 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
628 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
629 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
630 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
631 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
637 * 6-stack pin configuration:
638 * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
639 * f-mic = 0x19, line = 0x1a, HP = 0x1b
641 static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
642 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
644 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
645 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
646 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
647 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
648 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
649 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
650 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
651 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
653 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
654 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
655 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
656 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
657 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
658 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
659 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
660 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
661 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
667 * Uniwill pin configuration:
668 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
671 static const struct hda_verb alc880_uniwill_init_verbs[] = {
672 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
674 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
675 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
676 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
677 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
678 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
679 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
680 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
681 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
682 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
683 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
684 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
685 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
686 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
687 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
689 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
690 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
691 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
692 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
693 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
694 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
695 /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
696 /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
697 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
699 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
700 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
707 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
709 static const struct hda_verb alc880_uniwill_p53_init_verbs[] = {
710 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
712 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
713 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
714 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
715 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
716 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
717 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
718 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
719 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
720 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
721 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
722 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
723 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
725 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
726 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
727 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
728 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
729 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
730 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
732 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
733 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_DCVOL_EVENT},
738 static const struct hda_verb alc880_beep_init_verbs[] = {
739 { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
743 static void alc880_uniwill_setup(struct hda_codec *codec)
745 struct alc_spec *spec = codec->spec;
747 spec->autocfg.hp_pins[0] = 0x14;
748 spec->autocfg.speaker_pins[0] = 0x15;
749 spec->autocfg.speaker_pins[0] = 0x16;
750 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
753 static void alc880_uniwill_init_hook(struct hda_codec *codec)
755 alc_hp_automute(codec);
756 alc88x_simple_mic_automute(codec);
759 static void alc880_uniwill_unsol_event(struct hda_codec *codec,
762 /* Looks like the unsol event is incompatible with the standard
763 * definition. 4bit tag is placed at 28 bit!
767 alc88x_simple_mic_automute(codec);
770 alc_sku_unsol_event(codec, res);
775 static void alc880_uniwill_p53_setup(struct hda_codec *codec)
777 struct alc_spec *spec = codec->spec;
779 spec->autocfg.hp_pins[0] = 0x14;
780 spec->autocfg.speaker_pins[0] = 0x15;
781 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
784 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
786 unsigned int present;
788 present = snd_hda_codec_read(codec, 0x21, 0,
789 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
790 present &= HDA_AMP_VOLMASK;
791 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
792 HDA_AMP_VOLMASK, present);
793 snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
794 HDA_AMP_VOLMASK, present);
797 static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
800 /* Looks like the unsol event is incompatible with the standard
801 * definition. 4bit tag is placed at 28 bit!
803 if ((res >> 28) == ALC_DCVOL_EVENT)
804 alc880_uniwill_p53_dcvol_automute(codec);
806 alc_sku_unsol_event(codec, res);
810 * F1734 pin configuration:
811 * HP = 0x14, speaker-out = 0x15, mic = 0x18
813 static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
814 {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
815 {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
816 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
817 {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
818 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
820 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
821 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
822 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
823 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
825 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
826 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
827 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
828 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
829 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
830 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
831 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
832 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
833 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
835 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
836 {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
842 * ASUS pin configuration:
843 * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
845 static const struct hda_verb alc880_pin_asus_init_verbs[] = {
846 {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
847 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
848 {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
849 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
851 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
852 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
853 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
854 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
855 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
856 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
857 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
858 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
860 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
861 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
862 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
863 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
864 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
865 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
866 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
867 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
868 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
873 /* Enable GPIO mask and set output */
874 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
875 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
876 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
878 /* Clevo m520g init */
879 static const struct hda_verb alc880_pin_clevo_init_verbs[] = {
880 /* headphone output */
881 {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
883 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
884 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
886 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
887 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
889 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
890 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
891 /* Mic1 (rear panel) */
892 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
893 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
894 /* Mic2 (front panel) */
895 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
896 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
898 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
899 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
900 /* change to EAPD mode */
901 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
902 {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
907 static const struct hda_verb alc880_pin_tcl_S700_init_verbs[] = {
908 /* change to EAPD mode */
909 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
910 {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
912 /* Headphone output */
913 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
915 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
916 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
918 /* Line In pin widget for input */
919 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
920 /* CD pin widget for input */
921 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
922 /* Mic1 (rear panel) pin widget for input and vref at 80% */
923 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
925 /* change to EAPD mode */
926 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
927 {0x20, AC_VERB_SET_PROC_COEF, 0x3070},
936 * Rear Line-In/Out (blue): 0x14
937 * Build-in Mic-In: 0x15
939 * HP-Out (green): 0x1b
940 * Mic-In/Out (red): 0x19
944 /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
945 static const hda_nid_t alc880_lg_dac_nids[3] = {
949 /* seems analog CD is not working */
950 static const struct hda_input_mux alc880_lg_capture_source = {
955 { "Internal Mic", 0x6 },
959 /* 2,4,6 channel modes */
960 static const struct hda_verb alc880_lg_ch2_init[] = {
961 /* set line-in and mic-in to input */
962 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
963 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
967 static const struct hda_verb alc880_lg_ch4_init[] = {
968 /* set line-in to out and mic-in to input */
969 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
970 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
974 static const struct hda_verb alc880_lg_ch6_init[] = {
975 /* set line-in and mic-in to output */
976 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
977 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
981 static const struct hda_channel_mode alc880_lg_ch_modes[3] = {
982 { 2, alc880_lg_ch2_init },
983 { 4, alc880_lg_ch4_init },
984 { 6, alc880_lg_ch6_init },
987 static const struct snd_kcontrol_new alc880_lg_mixer[] = {
988 HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
989 HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT),
990 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
991 HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT),
992 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
993 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
994 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
995 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
996 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
997 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
998 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT),
999 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT),
1000 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT),
1001 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT),
1003 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1004 .name = "Channel Mode",
1005 .info = alc_ch_mode_info,
1006 .get = alc_ch_mode_get,
1007 .put = alc_ch_mode_put,
1012 static const struct hda_verb alc880_lg_init_verbs[] = {
1013 /* set capture source to mic-in */
1014 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1015 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1016 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1017 /* mute all amp mixer inputs */
1018 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
1019 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
1020 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
1021 /* line-in to input */
1022 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1023 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1025 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1026 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1028 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1029 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1030 /* mic-in to input */
1031 {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
1032 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1033 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1035 {0x13, AC_VERB_SET_CONNECT_SEL, 0x03},
1036 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1037 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1039 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
1043 /* toggle speaker-output according to the hp-jack state */
1044 static void alc880_lg_setup(struct hda_codec *codec)
1046 struct alc_spec *spec = codec->spec;
1048 spec->autocfg.hp_pins[0] = 0x1b;
1049 spec->autocfg.speaker_pins[0] = 0x17;
1050 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1053 #ifdef CONFIG_SND_HDA_POWER_SAVE
1054 static const struct hda_amp_list alc880_lg_loopbacks[] = {
1055 { 0x0b, HDA_INPUT, 1 },
1056 { 0x0b, HDA_INPUT, 6 },
1057 { 0x0b, HDA_INPUT, 7 },
1063 * Test configuration for debugging
1065 * Almost all inputs/outputs are enabled. I/O pins can be configured via
1068 #ifdef CONFIG_SND_DEBUG
1069 static const hda_nid_t alc880_test_dac_nids[4] = {
1070 0x02, 0x03, 0x04, 0x05
1073 static const struct hda_input_mux alc880_test_capture_source = {
1082 { "Surround", 0x6 },
1086 static const struct hda_channel_mode alc880_test_modes[4] = {
1093 static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
1094 struct snd_ctl_elem_info *uinfo)
1096 static const char * const texts[] = {
1097 "N/A", "Line Out", "HP Out",
1098 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
1100 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1102 uinfo->value.enumerated.items = 8;
1103 if (uinfo->value.enumerated.item >= 8)
1104 uinfo->value.enumerated.item = 7;
1105 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
1109 static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
1110 struct snd_ctl_elem_value *ucontrol)
1112 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1113 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1114 unsigned int pin_ctl, item = 0;
1116 pin_ctl = snd_hda_codec_read(codec, nid, 0,
1117 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1118 if (pin_ctl & AC_PINCTL_OUT_EN) {
1119 if (pin_ctl & AC_PINCTL_HP_EN)
1123 } else if (pin_ctl & AC_PINCTL_IN_EN) {
1124 switch (pin_ctl & AC_PINCTL_VREFEN) {
1125 case AC_PINCTL_VREF_HIZ: item = 3; break;
1126 case AC_PINCTL_VREF_50: item = 4; break;
1127 case AC_PINCTL_VREF_GRD: item = 5; break;
1128 case AC_PINCTL_VREF_80: item = 6; break;
1129 case AC_PINCTL_VREF_100: item = 7; break;
1132 ucontrol->value.enumerated.item[0] = item;
1136 static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
1137 struct snd_ctl_elem_value *ucontrol)
1139 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1140 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1141 static const unsigned int ctls[] = {
1142 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
1143 AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
1144 AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
1145 AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
1146 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
1147 AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
1149 unsigned int old_ctl, new_ctl;
1151 old_ctl = snd_hda_codec_read(codec, nid, 0,
1152 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1153 new_ctl = ctls[ucontrol->value.enumerated.item[0]];
1154 if (old_ctl != new_ctl) {
1156 snd_hda_codec_write_cache(codec, nid, 0,
1157 AC_VERB_SET_PIN_WIDGET_CONTROL,
1159 val = ucontrol->value.enumerated.item[0] >= 3 ?
1161 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
1168 static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
1169 struct snd_ctl_elem_info *uinfo)
1171 static const char * const texts[] = {
1172 "Front", "Surround", "CLFE", "Side"
1174 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1176 uinfo->value.enumerated.items = 4;
1177 if (uinfo->value.enumerated.item >= 4)
1178 uinfo->value.enumerated.item = 3;
1179 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
1183 static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
1184 struct snd_ctl_elem_value *ucontrol)
1186 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1187 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1190 sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
1191 ucontrol->value.enumerated.item[0] = sel & 3;
1195 static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
1196 struct snd_ctl_elem_value *ucontrol)
1198 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1199 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1202 sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
1203 if (ucontrol->value.enumerated.item[0] != sel) {
1204 sel = ucontrol->value.enumerated.item[0] & 3;
1205 snd_hda_codec_write_cache(codec, nid, 0,
1206 AC_VERB_SET_CONNECT_SEL, sel);
1212 #define PIN_CTL_TEST(xname,nid) { \
1213 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1215 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
1216 .info = alc_test_pin_ctl_info, \
1217 .get = alc_test_pin_ctl_get, \
1218 .put = alc_test_pin_ctl_put, \
1219 .private_value = nid \
1222 #define PIN_SRC_TEST(xname,nid) { \
1223 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1225 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
1226 .info = alc_test_pin_src_info, \
1227 .get = alc_test_pin_src_get, \
1228 .put = alc_test_pin_src_put, \
1229 .private_value = nid \
1232 static const struct snd_kcontrol_new alc880_test_mixer[] = {
1233 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1234 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1235 HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
1236 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1237 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1238 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1239 HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
1240 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1241 PIN_CTL_TEST("Front Pin Mode", 0x14),
1242 PIN_CTL_TEST("Surround Pin Mode", 0x15),
1243 PIN_CTL_TEST("CLFE Pin Mode", 0x16),
1244 PIN_CTL_TEST("Side Pin Mode", 0x17),
1245 PIN_CTL_TEST("In-1 Pin Mode", 0x18),
1246 PIN_CTL_TEST("In-2 Pin Mode", 0x19),
1247 PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
1248 PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
1249 PIN_SRC_TEST("In-1 Pin Source", 0x18),
1250 PIN_SRC_TEST("In-2 Pin Source", 0x19),
1251 PIN_SRC_TEST("In-3 Pin Source", 0x1a),
1252 PIN_SRC_TEST("In-4 Pin Source", 0x1b),
1253 HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
1254 HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
1255 HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
1256 HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
1257 HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
1258 HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
1259 HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
1260 HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
1261 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
1262 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
1264 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1265 .name = "Channel Mode",
1266 .info = alc_ch_mode_info,
1267 .get = alc_ch_mode_get,
1268 .put = alc_ch_mode_put,
1273 static const struct hda_verb alc880_test_init_verbs[] = {
1274 /* Unmute inputs of 0x0c - 0x0f */
1275 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1276 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1277 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1278 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1279 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1280 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1281 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1282 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1283 /* Vol output for 0x0c-0x0f */
1284 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1285 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1286 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1287 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1288 /* Set output pins 0x14-0x17 */
1289 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1290 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1291 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1292 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1293 /* Unmute output pins 0x14-0x17 */
1294 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1295 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1296 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1297 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1298 /* Set input pins 0x18-0x1c */
1299 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1300 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1301 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1302 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1303 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1304 /* Mute input pins 0x18-0x1b */
1305 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1306 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1307 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1308 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1310 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1311 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1312 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1313 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1314 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1315 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1316 /* Analog input/passthru */
1317 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1318 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1319 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1320 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1321 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1329 static const char * const alc880_models[ALC880_MODEL_LAST] = {
1330 [ALC880_3ST] = "3stack",
1331 [ALC880_TCL_S700] = "tcl",
1332 [ALC880_3ST_DIG] = "3stack-digout",
1333 [ALC880_CLEVO] = "clevo",
1334 [ALC880_5ST] = "5stack",
1335 [ALC880_5ST_DIG] = "5stack-digout",
1336 [ALC880_W810] = "w810",
1337 [ALC880_Z71V] = "z71v",
1338 [ALC880_6ST] = "6stack",
1339 [ALC880_6ST_DIG] = "6stack-digout",
1340 [ALC880_ASUS] = "asus",
1341 [ALC880_ASUS_W1V] = "asus-w1v",
1342 [ALC880_ASUS_DIG] = "asus-dig",
1343 [ALC880_ASUS_DIG2] = "asus-dig2",
1344 [ALC880_UNIWILL_DIG] = "uniwill",
1345 [ALC880_UNIWILL_P53] = "uniwill-p53",
1346 [ALC880_FUJITSU] = "fujitsu",
1347 [ALC880_F1734] = "F1734",
1349 #ifdef CONFIG_SND_DEBUG
1350 [ALC880_TEST] = "test",
1352 [ALC880_AUTO] = "auto",
1355 static const struct snd_pci_quirk alc880_cfg_tbl[] = {
1356 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810),
1357 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
1358 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
1359 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
1360 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
1361 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
1362 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
1363 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
1364 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
1365 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
1366 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
1367 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
1368 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
1369 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
1370 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
1371 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
1372 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
1373 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
1374 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
1375 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
1376 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
1377 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
1378 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
1379 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
1380 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
1381 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
1382 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
1383 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
1384 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
1385 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
1386 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
1387 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
1388 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
1389 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
1390 SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
1391 SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
1392 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
1393 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
1394 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
1395 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
1396 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
1397 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
1398 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
1399 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
1400 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
1401 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
1402 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
1403 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
1404 SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
1405 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
1406 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
1407 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
1408 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
1409 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
1410 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
1411 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
1412 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
1413 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
1414 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
1415 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
1416 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
1417 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
1418 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
1419 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
1420 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
1422 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
1423 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
1424 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
1429 * ALC880 codec presets
1431 static const struct alc_config_preset alc880_presets[] = {
1433 .mixers = { alc880_three_stack_mixer },
1434 .init_verbs = { alc880_volume_init_verbs,
1435 alc880_pin_3stack_init_verbs },
1436 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1437 .dac_nids = alc880_dac_nids,
1438 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1439 .channel_mode = alc880_threestack_modes,
1441 .input_mux = &alc880_capture_source,
1443 [ALC880_3ST_DIG] = {
1444 .mixers = { alc880_three_stack_mixer },
1445 .init_verbs = { alc880_volume_init_verbs,
1446 alc880_pin_3stack_init_verbs },
1447 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1448 .dac_nids = alc880_dac_nids,
1449 .dig_out_nid = ALC880_DIGOUT_NID,
1450 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1451 .channel_mode = alc880_threestack_modes,
1453 .input_mux = &alc880_capture_source,
1455 [ALC880_TCL_S700] = {
1456 .mixers = { alc880_tcl_s700_mixer },
1457 .init_verbs = { alc880_volume_init_verbs,
1458 alc880_pin_tcl_S700_init_verbs,
1459 alc880_gpio2_init_verbs },
1460 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1461 .dac_nids = alc880_dac_nids,
1462 .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
1463 .num_adc_nids = 1, /* single ADC */
1465 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1466 .channel_mode = alc880_2_jack_modes,
1467 .input_mux = &alc880_capture_source,
1470 .mixers = { alc880_three_stack_mixer,
1471 alc880_five_stack_mixer},
1472 .init_verbs = { alc880_volume_init_verbs,
1473 alc880_pin_5stack_init_verbs },
1474 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1475 .dac_nids = alc880_dac_nids,
1476 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1477 .channel_mode = alc880_fivestack_modes,
1478 .input_mux = &alc880_capture_source,
1480 [ALC880_5ST_DIG] = {
1481 .mixers = { alc880_three_stack_mixer,
1482 alc880_five_stack_mixer },
1483 .init_verbs = { alc880_volume_init_verbs,
1484 alc880_pin_5stack_init_verbs },
1485 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1486 .dac_nids = alc880_dac_nids,
1487 .dig_out_nid = ALC880_DIGOUT_NID,
1488 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1489 .channel_mode = alc880_fivestack_modes,
1490 .input_mux = &alc880_capture_source,
1493 .mixers = { alc880_six_stack_mixer },
1494 .init_verbs = { alc880_volume_init_verbs,
1495 alc880_pin_6stack_init_verbs },
1496 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1497 .dac_nids = alc880_6st_dac_nids,
1498 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1499 .channel_mode = alc880_sixstack_modes,
1500 .input_mux = &alc880_6stack_capture_source,
1502 [ALC880_6ST_DIG] = {
1503 .mixers = { alc880_six_stack_mixer },
1504 .init_verbs = { alc880_volume_init_verbs,
1505 alc880_pin_6stack_init_verbs },
1506 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1507 .dac_nids = alc880_6st_dac_nids,
1508 .dig_out_nid = ALC880_DIGOUT_NID,
1509 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1510 .channel_mode = alc880_sixstack_modes,
1511 .input_mux = &alc880_6stack_capture_source,
1514 .mixers = { alc880_w810_base_mixer },
1515 .init_verbs = { alc880_volume_init_verbs,
1516 alc880_pin_w810_init_verbs,
1517 alc880_gpio2_init_verbs },
1518 .num_dacs = ARRAY_SIZE(alc880_w810_dac_nids),
1519 .dac_nids = alc880_w810_dac_nids,
1520 .dig_out_nid = ALC880_DIGOUT_NID,
1521 .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
1522 .channel_mode = alc880_w810_modes,
1523 .input_mux = &alc880_capture_source,
1526 .mixers = { alc880_z71v_mixer },
1527 .init_verbs = { alc880_volume_init_verbs,
1528 alc880_pin_z71v_init_verbs },
1529 .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
1530 .dac_nids = alc880_z71v_dac_nids,
1531 .dig_out_nid = ALC880_DIGOUT_NID,
1533 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1534 .channel_mode = alc880_2_jack_modes,
1535 .input_mux = &alc880_capture_source,
1538 .mixers = { alc880_f1734_mixer },
1539 .init_verbs = { alc880_volume_init_verbs,
1540 alc880_pin_f1734_init_verbs },
1541 .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
1542 .dac_nids = alc880_f1734_dac_nids,
1544 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1545 .channel_mode = alc880_2_jack_modes,
1546 .input_mux = &alc880_f1734_capture_source,
1547 .unsol_event = alc880_uniwill_p53_unsol_event,
1548 .setup = alc880_uniwill_p53_setup,
1549 .init_hook = alc_hp_automute,
1552 .mixers = { alc880_asus_mixer },
1553 .init_verbs = { alc880_volume_init_verbs,
1554 alc880_pin_asus_init_verbs,
1555 alc880_gpio1_init_verbs },
1556 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1557 .dac_nids = alc880_asus_dac_nids,
1558 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1559 .channel_mode = alc880_asus_modes,
1561 .input_mux = &alc880_capture_source,
1563 [ALC880_ASUS_DIG] = {
1564 .mixers = { alc880_asus_mixer },
1565 .init_verbs = { alc880_volume_init_verbs,
1566 alc880_pin_asus_init_verbs,
1567 alc880_gpio1_init_verbs },
1568 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1569 .dac_nids = alc880_asus_dac_nids,
1570 .dig_out_nid = ALC880_DIGOUT_NID,
1571 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1572 .channel_mode = alc880_asus_modes,
1574 .input_mux = &alc880_capture_source,
1576 [ALC880_ASUS_DIG2] = {
1577 .mixers = { alc880_asus_mixer },
1578 .init_verbs = { alc880_volume_init_verbs,
1579 alc880_pin_asus_init_verbs,
1580 alc880_gpio2_init_verbs }, /* use GPIO2 */
1581 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1582 .dac_nids = alc880_asus_dac_nids,
1583 .dig_out_nid = ALC880_DIGOUT_NID,
1584 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1585 .channel_mode = alc880_asus_modes,
1587 .input_mux = &alc880_capture_source,
1589 [ALC880_ASUS_W1V] = {
1590 .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
1591 .init_verbs = { alc880_volume_init_verbs,
1592 alc880_pin_asus_init_verbs,
1593 alc880_gpio1_init_verbs },
1594 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1595 .dac_nids = alc880_asus_dac_nids,
1596 .dig_out_nid = ALC880_DIGOUT_NID,
1597 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1598 .channel_mode = alc880_asus_modes,
1600 .input_mux = &alc880_capture_source,
1602 [ALC880_UNIWILL_DIG] = {
1603 .mixers = { alc880_asus_mixer },
1604 .init_verbs = { alc880_volume_init_verbs,
1605 alc880_pin_asus_init_verbs },
1606 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1607 .dac_nids = alc880_asus_dac_nids,
1608 .dig_out_nid = ALC880_DIGOUT_NID,
1609 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1610 .channel_mode = alc880_asus_modes,
1612 .input_mux = &alc880_capture_source,
1614 [ALC880_UNIWILL] = {
1615 .mixers = { alc880_uniwill_mixer },
1616 .init_verbs = { alc880_volume_init_verbs,
1617 alc880_uniwill_init_verbs },
1618 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1619 .dac_nids = alc880_asus_dac_nids,
1620 .dig_out_nid = ALC880_DIGOUT_NID,
1621 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1622 .channel_mode = alc880_threestack_modes,
1624 .input_mux = &alc880_capture_source,
1625 .unsol_event = alc880_uniwill_unsol_event,
1626 .setup = alc880_uniwill_setup,
1627 .init_hook = alc880_uniwill_init_hook,
1629 [ALC880_UNIWILL_P53] = {
1630 .mixers = { alc880_uniwill_p53_mixer },
1631 .init_verbs = { alc880_volume_init_verbs,
1632 alc880_uniwill_p53_init_verbs },
1633 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1634 .dac_nids = alc880_asus_dac_nids,
1635 .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
1636 .channel_mode = alc880_threestack_modes,
1637 .input_mux = &alc880_capture_source,
1638 .unsol_event = alc880_uniwill_p53_unsol_event,
1639 .setup = alc880_uniwill_p53_setup,
1640 .init_hook = alc_hp_automute,
1642 [ALC880_FUJITSU] = {
1643 .mixers = { alc880_fujitsu_mixer },
1644 .init_verbs = { alc880_volume_init_verbs,
1645 alc880_uniwill_p53_init_verbs,
1646 alc880_beep_init_verbs },
1647 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1648 .dac_nids = alc880_dac_nids,
1649 .dig_out_nid = ALC880_DIGOUT_NID,
1650 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1651 .channel_mode = alc880_2_jack_modes,
1652 .input_mux = &alc880_capture_source,
1653 .unsol_event = alc880_uniwill_p53_unsol_event,
1654 .setup = alc880_uniwill_p53_setup,
1655 .init_hook = alc_hp_automute,
1658 .mixers = { alc880_three_stack_mixer },
1659 .init_verbs = { alc880_volume_init_verbs,
1660 alc880_pin_clevo_init_verbs },
1661 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1662 .dac_nids = alc880_dac_nids,
1664 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1665 .channel_mode = alc880_threestack_modes,
1667 .input_mux = &alc880_capture_source,
1670 .mixers = { alc880_lg_mixer },
1671 .init_verbs = { alc880_volume_init_verbs,
1672 alc880_lg_init_verbs },
1673 .num_dacs = ARRAY_SIZE(alc880_lg_dac_nids),
1674 .dac_nids = alc880_lg_dac_nids,
1675 .dig_out_nid = ALC880_DIGOUT_NID,
1676 .num_channel_mode = ARRAY_SIZE(alc880_lg_ch_modes),
1677 .channel_mode = alc880_lg_ch_modes,
1679 .input_mux = &alc880_lg_capture_source,
1680 .unsol_event = alc_sku_unsol_event,
1681 .setup = alc880_lg_setup,
1682 .init_hook = alc_hp_automute,
1683 #ifdef CONFIG_SND_HDA_POWER_SAVE
1684 .loopbacks = alc880_lg_loopbacks,
1687 #ifdef CONFIG_SND_DEBUG
1689 .mixers = { alc880_test_mixer },
1690 .init_verbs = { alc880_test_init_verbs },
1691 .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
1692 .dac_nids = alc880_test_dac_nids,
1693 .dig_out_nid = ALC880_DIGOUT_NID,
1694 .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
1695 .channel_mode = alc880_test_modes,
1696 .input_mux = &alc880_test_capture_source,