]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - sound/pci/hda/alc880_quirks.c
ALSA: hda/realtek - Rewrite ALC880 model=z71v with auto-parser
[mirror_ubuntu-bionic-kernel.git] / sound / pci / hda / alc880_quirks.c
CommitLineData
1d045db9
TI
1/*
2 * ALC880 quirk models
3 * included by patch_realtek.c
4 */
5
6/* ALC880 board config type */
7enum {
8 ALC880_AUTO,
9 ALC880_3ST,
10 ALC880_3ST_DIG,
11 ALC880_5ST,
12 ALC880_5ST_DIG,
1d045db9
TI
13 ALC880_6ST,
14 ALC880_6ST_DIG,
1d045db9
TI
15 ALC880_ASUS,
16 ALC880_ASUS_DIG,
17 ALC880_ASUS_W1V,
18 ALC880_ASUS_DIG2,
1d045db9
TI
19#ifdef CONFIG_SND_DEBUG
20 ALC880_TEST,
21#endif
22 ALC880_MODEL_LAST /* last tag */
23};
24
25/*
26 * ALC880 3-stack model
27 *
28 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
29 * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
30 * F-Mic = 0x1b, HP = 0x19
31 */
32
33static const hda_nid_t alc880_dac_nids[4] = {
34 /* front, rear, clfe, rear_surr */
35 0x02, 0x05, 0x04, 0x03
36};
37
38static const hda_nid_t alc880_adc_nids[3] = {
39 /* ADC0-2 */
40 0x07, 0x08, 0x09,
41};
42
43/* The datasheet says the node 0x07 is connected from inputs,
44 * but it shows zero connection in the real implementation on some devices.
45 * Note: this is a 915GAV bug, fixed on 915GLV
46 */
47static const hda_nid_t alc880_adc_nids_alt[2] = {
48 /* ADC1-2 */
49 0x08, 0x09,
50};
51
52#define ALC880_DIGOUT_NID 0x06
53#define ALC880_DIGIN_NID 0x0a
54#define ALC880_PIN_CD_NID 0x1c
55
56static const struct hda_input_mux alc880_capture_source = {
57 .num_items = 4,
58 .items = {
59 { "Mic", 0x0 },
60 { "Front Mic", 0x3 },
61 { "Line", 0x2 },
62 { "CD", 0x4 },
63 },
64};
65
66/* channel source setting (2/6 channel selection for 3-stack) */
67/* 2ch mode */
68static const struct hda_verb alc880_threestack_ch2_init[] = {
69 /* set line-in to input, mute it */
70 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
71 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
72 /* set mic-in to input vref 80%, mute it */
73 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
74 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
75 { } /* end */
76};
77
78/* 6ch mode */
79static const struct hda_verb alc880_threestack_ch6_init[] = {
80 /* set line-in to output, unmute it */
81 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
82 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
83 /* set mic-in to output, unmute it */
84 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
85 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
86 { } /* end */
87};
88
89static const struct hda_channel_mode alc880_threestack_modes[2] = {
90 { 2, alc880_threestack_ch2_init },
91 { 6, alc880_threestack_ch6_init },
92};
93
94static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
95 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
96 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
97 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
98 HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
99 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
100 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
101 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
102 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
103 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
104 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
105 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
106 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
107 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
108 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
109 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
110 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
111 HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
112 {
113 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
114 .name = "Channel Mode",
115 .info = alc_ch_mode_info,
116 .get = alc_ch_mode_get,
117 .put = alc_ch_mode_put,
118 },
119 { } /* end */
120};
121
122/*
123 * ALC880 5-stack model
124 *
125 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
126 * Side = 0x02 (0xd)
127 * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
128 * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
129 */
130
131/* additional mixers to alc880_three_stack_mixer */
132static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
133 HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
134 HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
135 { } /* end */
136};
137
138/* channel source setting (6/8 channel selection for 5-stack) */
139/* 6ch mode */
140static const struct hda_verb alc880_fivestack_ch6_init[] = {
141 /* set line-in to input, mute it */
142 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
143 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
144 { } /* end */
145};
146
147/* 8ch mode */
148static const struct hda_verb alc880_fivestack_ch8_init[] = {
149 /* set line-in to output, unmute it */
150 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
151 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
152 { } /* end */
153};
154
155static const struct hda_channel_mode alc880_fivestack_modes[2] = {
156 { 6, alc880_fivestack_ch6_init },
157 { 8, alc880_fivestack_ch8_init },
158};
159
160
161/*
162 * ALC880 6-stack model
163 *
164 * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
165 * Side = 0x05 (0x0f)
166 * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
167 * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
168 */
169
170static const hda_nid_t alc880_6st_dac_nids[4] = {
171 /* front, rear, clfe, rear_surr */
172 0x02, 0x03, 0x04, 0x05
173};
174
175static const struct hda_input_mux alc880_6stack_capture_source = {
176 .num_items = 4,
177 .items = {
178 { "Mic", 0x0 },
179 { "Front Mic", 0x1 },
180 { "Line", 0x2 },
181 { "CD", 0x4 },
182 },
183};
184
185/* fixed 8-channels */
186static const struct hda_channel_mode alc880_sixstack_modes[1] = {
187 { 8, NULL },
188};
189
190static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
191 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
192 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
193 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
194 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
195 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
196 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
197 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
198 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
199 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
200 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
201 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
202 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
203 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
204 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
205 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
206 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
207 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
208 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
209 {
210 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
211 .name = "Channel Mode",
212 .info = alc_ch_mode_info,
213 .get = alc_ch_mode_get,
214 .put = alc_ch_mode_put,
215 },
216 { } /* end */
217};
218
219
1d045db9
TI
220static const hda_nid_t alc880_w810_dac_nids[3] = {
221 /* front, rear/surround, clfe */
222 0x02, 0x03, 0x04
223};
224
1d045db9
TI
225/* fixed 2 channels */
226static const struct hda_channel_mode alc880_2_jack_modes[1] = {
227 { 2, NULL }
228};
229
1d045db9
TI
230/*
231 * ALC880 ASUS model
232 *
233 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
234 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
235 * Mic = 0x18, Line = 0x1a
236 */
237
238#define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
239#define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
240
241static const struct snd_kcontrol_new alc880_asus_mixer[] = {
242 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
243 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
244 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
245 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
246 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
247 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
248 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
249 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
250 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
251 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
252 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
253 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
254 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
255 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
256 {
257 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
258 .name = "Channel Mode",
259 .info = alc_ch_mode_info,
260 .get = alc_ch_mode_get,
261 .put = alc_ch_mode_put,
262 },
263 { } /* end */
264};
265
266/*
267 * ALC880 ASUS W1V model
268 *
269 * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
270 * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
271 * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
272 */
273
274/* additional mixers to alc880_asus_mixer */
275static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
276 HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
277 HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
278 { } /* end */
279};
280
1d045db9
TI
281/*
282 * initialize the codec volumes, etc
283 */
284
285/*
286 * generic initialization of ADC, input mixers and output mixers
287 */
288static const struct hda_verb alc880_volume_init_verbs[] = {
289 /*
290 * Unmute ADC0-2 and set the default input to mic-in
291 */
292 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
293 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
294 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
295 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
296 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
297 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
298
299 /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
300 * mixer widget
301 * Note: PASD motherboards uses the Line In 2 as the input for front
302 * panel mic (mic 2)
303 */
304 /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
305 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
306 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
307 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
308 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
309 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
310 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
311 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
312
313 /*
314 * Set up output mixers (0x0c - 0x0f)
315 */
316 /* set vol=0 to output mixers */
317 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
318 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
319 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
320 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
321 /* set up input amps for analog loopback */
322 /* Amp Indices: DAC = 0, mixer = 1 */
323 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
324 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
325 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
326 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
327 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
328 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
329 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
330 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
331
332 { }
333};
334
335/*
336 * 3-stack pin configuration:
337 * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
338 */
339static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
340 /*
341 * preset connection lists of input pins
342 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
343 */
344 {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
345 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
346 {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
347
348 /*
349 * Set pin mode and muting
350 */
351 /* set front pin widgets 0x14 for output */
352 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
353 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
354 /* Mic1 (rear panel) pin widget for input and vref at 80% */
355 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
356 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
357 /* Mic2 (as headphone out) for HP output */
358 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
359 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
360 /* Line In pin widget for input */
361 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
362 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
363 /* Line2 (as front mic) pin widget for input and vref at 80% */
364 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
365 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
366 /* CD pin widget for input */
367 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
368
369 { }
370};
371
372/*
373 * 5-stack pin configuration:
374 * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
375 * line-in/side = 0x1a, f-mic = 0x1b
376 */
377static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
378 /*
379 * preset connection lists of input pins
380 * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
381 */
382 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
383 {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
384
385 /*
386 * Set pin mode and muting
387 */
388 /* set pin widgets 0x14-0x17 for output */
389 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
390 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
391 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
392 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
393 /* unmute pins for output (no gain on this amp) */
394 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
395 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
396 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
397 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
398
399 /* Mic1 (rear panel) pin widget for input and vref at 80% */
400 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
401 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
402 /* Mic2 (as headphone out) for HP output */
403 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
404 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
405 /* Line In pin widget for input */
406 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
407 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
408 /* Line2 (as front mic) pin widget for input and vref at 80% */
409 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
410 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
411 /* CD pin widget for input */
412 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
413
414 { }
415};
416
1d045db9
TI
417/*
418 * 6-stack pin configuration:
419 * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
420 * f-mic = 0x19, line = 0x1a, HP = 0x1b
421 */
422static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
423 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
424
425 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
426 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
427 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
428 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
429 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
430 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
431 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
432 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
433
434 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
435 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
436 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
437 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
438 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
439 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
440 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
441 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
442 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
443
444 { }
445};
446
1d045db9
TI
447static const struct hda_verb alc880_beep_init_verbs[] = {
448 { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
449 { }
450};
451
1d045db9
TI
452/*
453 * ASUS pin configuration:
454 * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
455 */
456static const struct hda_verb alc880_pin_asus_init_verbs[] = {
457 {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
458 {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
459 {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
460 {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
461
462 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
463 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
464 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
465 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
466 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
467 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
468 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
469 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
470
471 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
472 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
473 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
474 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
475 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
476 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
477 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
478 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
479 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
480
481 { }
482};
483
484/* Enable GPIO mask and set output */
485#define alc880_gpio1_init_verbs alc_gpio1_init_verbs
486#define alc880_gpio2_init_verbs alc_gpio2_init_verbs
487#define alc880_gpio3_init_verbs alc_gpio3_init_verbs
488
1d045db9
TI
489/*
490 * Test configuration for debugging
491 *
492 * Almost all inputs/outputs are enabled. I/O pins can be configured via
493 * enum controls.
494 */
495#ifdef CONFIG_SND_DEBUG
496static const hda_nid_t alc880_test_dac_nids[4] = {
497 0x02, 0x03, 0x04, 0x05
498};
499
500static const struct hda_input_mux alc880_test_capture_source = {
501 .num_items = 7,
502 .items = {
503 { "In-1", 0x0 },
504 { "In-2", 0x1 },
505 { "In-3", 0x2 },
506 { "In-4", 0x3 },
507 { "CD", 0x4 },
508 { "Front", 0x5 },
509 { "Surround", 0x6 },
510 },
511};
512
513static const struct hda_channel_mode alc880_test_modes[4] = {
514 { 2, NULL },
515 { 4, NULL },
516 { 6, NULL },
517 { 8, NULL },
518};
519
520static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
521 struct snd_ctl_elem_info *uinfo)
522{
523 static const char * const texts[] = {
524 "N/A", "Line Out", "HP Out",
525 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
526 };
527 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
528 uinfo->count = 1;
529 uinfo->value.enumerated.items = 8;
530 if (uinfo->value.enumerated.item >= 8)
531 uinfo->value.enumerated.item = 7;
532 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
533 return 0;
534}
535
536static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
537 struct snd_ctl_elem_value *ucontrol)
538{
539 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
540 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
541 unsigned int pin_ctl, item = 0;
542
543 pin_ctl = snd_hda_codec_read(codec, nid, 0,
544 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
545 if (pin_ctl & AC_PINCTL_OUT_EN) {
546 if (pin_ctl & AC_PINCTL_HP_EN)
547 item = 2;
548 else
549 item = 1;
550 } else if (pin_ctl & AC_PINCTL_IN_EN) {
551 switch (pin_ctl & AC_PINCTL_VREFEN) {
552 case AC_PINCTL_VREF_HIZ: item = 3; break;
553 case AC_PINCTL_VREF_50: item = 4; break;
554 case AC_PINCTL_VREF_GRD: item = 5; break;
555 case AC_PINCTL_VREF_80: item = 6; break;
556 case AC_PINCTL_VREF_100: item = 7; break;
557 }
558 }
559 ucontrol->value.enumerated.item[0] = item;
560 return 0;
561}
562
563static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
564 struct snd_ctl_elem_value *ucontrol)
565{
566 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
567 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
568 static const unsigned int ctls[] = {
569 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
570 AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
571 AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
572 AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
573 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
574 AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
575 };
576 unsigned int old_ctl, new_ctl;
577
578 old_ctl = snd_hda_codec_read(codec, nid, 0,
579 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
580 new_ctl = ctls[ucontrol->value.enumerated.item[0]];
581 if (old_ctl != new_ctl) {
582 int val;
583 snd_hda_codec_write_cache(codec, nid, 0,
584 AC_VERB_SET_PIN_WIDGET_CONTROL,
585 new_ctl);
586 val = ucontrol->value.enumerated.item[0] >= 3 ?
587 HDA_AMP_MUTE : 0;
588 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
589 HDA_AMP_MUTE, val);
590 return 1;
591 }
592 return 0;
593}
594
595static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
596 struct snd_ctl_elem_info *uinfo)
597{
598 static const char * const texts[] = {
599 "Front", "Surround", "CLFE", "Side"
600 };
601 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
602 uinfo->count = 1;
603 uinfo->value.enumerated.items = 4;
604 if (uinfo->value.enumerated.item >= 4)
605 uinfo->value.enumerated.item = 3;
606 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
607 return 0;
608}
609
610static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
611 struct snd_ctl_elem_value *ucontrol)
612{
613 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
614 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
615 unsigned int sel;
616
617 sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
618 ucontrol->value.enumerated.item[0] = sel & 3;
619 return 0;
620}
621
622static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
623 struct snd_ctl_elem_value *ucontrol)
624{
625 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
626 hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
627 unsigned int sel;
628
629 sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
630 if (ucontrol->value.enumerated.item[0] != sel) {
631 sel = ucontrol->value.enumerated.item[0] & 3;
632 snd_hda_codec_write_cache(codec, nid, 0,
633 AC_VERB_SET_CONNECT_SEL, sel);
634 return 1;
635 }
636 return 0;
637}
638
639#define PIN_CTL_TEST(xname,nid) { \
640 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
641 .name = xname, \
642 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
643 .info = alc_test_pin_ctl_info, \
644 .get = alc_test_pin_ctl_get, \
645 .put = alc_test_pin_ctl_put, \
646 .private_value = nid \
647 }
648
649#define PIN_SRC_TEST(xname,nid) { \
650 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
651 .name = xname, \
652 .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
653 .info = alc_test_pin_src_info, \
654 .get = alc_test_pin_src_get, \
655 .put = alc_test_pin_src_put, \
656 .private_value = nid \
657 }
658
659static const struct snd_kcontrol_new alc880_test_mixer[] = {
660 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
661 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
662 HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
663 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
664 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
665 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
666 HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
667 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
668 PIN_CTL_TEST("Front Pin Mode", 0x14),
669 PIN_CTL_TEST("Surround Pin Mode", 0x15),
670 PIN_CTL_TEST("CLFE Pin Mode", 0x16),
671 PIN_CTL_TEST("Side Pin Mode", 0x17),
672 PIN_CTL_TEST("In-1 Pin Mode", 0x18),
673 PIN_CTL_TEST("In-2 Pin Mode", 0x19),
674 PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
675 PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
676 PIN_SRC_TEST("In-1 Pin Source", 0x18),
677 PIN_SRC_TEST("In-2 Pin Source", 0x19),
678 PIN_SRC_TEST("In-3 Pin Source", 0x1a),
679 PIN_SRC_TEST("In-4 Pin Source", 0x1b),
680 HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
681 HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
682 HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
683 HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
684 HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
685 HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
686 HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
687 HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
688 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
689 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
690 {
691 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
692 .name = "Channel Mode",
693 .info = alc_ch_mode_info,
694 .get = alc_ch_mode_get,
695 .put = alc_ch_mode_put,
696 },
697 { } /* end */
698};
699
700static const struct hda_verb alc880_test_init_verbs[] = {
701 /* Unmute inputs of 0x0c - 0x0f */
702 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
703 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
704 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
705 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
706 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
707 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
708 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
709 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
710 /* Vol output for 0x0c-0x0f */
711 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
712 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
713 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
714 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
715 /* Set output pins 0x14-0x17 */
716 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
717 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
718 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
719 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
720 /* Unmute output pins 0x14-0x17 */
721 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
722 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
723 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
724 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
725 /* Set input pins 0x18-0x1c */
726 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
727 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
728 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
729 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
730 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
731 /* Mute input pins 0x18-0x1b */
732 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
733 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
734 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
735 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
736 /* ADC set up */
737 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
738 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
739 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
740 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
741 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
742 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
743 /* Analog input/passthru */
744 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
745 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
746 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
747 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
748 {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
749 { }
750};
751#endif
752
753/*
754 */
755
756static const char * const alc880_models[ALC880_MODEL_LAST] = {
757 [ALC880_3ST] = "3stack",
1d045db9 758 [ALC880_3ST_DIG] = "3stack-digout",
1d045db9
TI
759 [ALC880_5ST] = "5stack",
760 [ALC880_5ST_DIG] = "5stack-digout",
1d045db9
TI
761 [ALC880_6ST] = "6stack",
762 [ALC880_6ST_DIG] = "6stack-digout",
763 [ALC880_ASUS] = "asus",
764 [ALC880_ASUS_W1V] = "asus-w1v",
765 [ALC880_ASUS_DIG] = "asus-dig",
766 [ALC880_ASUS_DIG2] = "asus-dig2",
1d045db9
TI
767#ifdef CONFIG_SND_DEBUG
768 [ALC880_TEST] = "test",
769#endif
770 [ALC880_AUTO] = "auto",
771};
772
773static const struct snd_pci_quirk alc880_cfg_tbl[] = {
1d045db9
TI
774 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
775 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
776 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
777 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
778 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
779 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
780 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
781 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
782 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
783 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
784 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
785 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
786 SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
787 SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
788 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
1d045db9
TI
789 /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
790 SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
791 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
792 SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
793 SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
794 SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
795 SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
796 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
797 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
798 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
799 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
800 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
801 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
802 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
803 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
804 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
805 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
1d045db9
TI
806 SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
807 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
1d045db9
TI
808 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
809 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
1d045db9
TI
810 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
811 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
812 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
813 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
814 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
815 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
816 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
817 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
818 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
819 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
820 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
821 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
822 /* default Intel */
823 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
824 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
825 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
826 {}
827};
828
829/*
830 * ALC880 codec presets
831 */
832static const struct alc_config_preset alc880_presets[] = {
833 [ALC880_3ST] = {
834 .mixers = { alc880_three_stack_mixer },
835 .init_verbs = { alc880_volume_init_verbs,
836 alc880_pin_3stack_init_verbs },
837 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
838 .dac_nids = alc880_dac_nids,
839 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
840 .channel_mode = alc880_threestack_modes,
841 .need_dac_fix = 1,
842 .input_mux = &alc880_capture_source,
843 },
844 [ALC880_3ST_DIG] = {
845 .mixers = { alc880_three_stack_mixer },
846 .init_verbs = { alc880_volume_init_verbs,
847 alc880_pin_3stack_init_verbs },
848 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
849 .dac_nids = alc880_dac_nids,
850 .dig_out_nid = ALC880_DIGOUT_NID,
851 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
852 .channel_mode = alc880_threestack_modes,
853 .need_dac_fix = 1,
854 .input_mux = &alc880_capture_source,
855 },
1d045db9
TI
856 [ALC880_5ST] = {
857 .mixers = { alc880_three_stack_mixer,
858 alc880_five_stack_mixer},
859 .init_verbs = { alc880_volume_init_verbs,
860 alc880_pin_5stack_init_verbs },
861 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
862 .dac_nids = alc880_dac_nids,
863 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
864 .channel_mode = alc880_fivestack_modes,
865 .input_mux = &alc880_capture_source,
866 },
867 [ALC880_5ST_DIG] = {
868 .mixers = { alc880_three_stack_mixer,
869 alc880_five_stack_mixer },
870 .init_verbs = { alc880_volume_init_verbs,
871 alc880_pin_5stack_init_verbs },
872 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
873 .dac_nids = alc880_dac_nids,
874 .dig_out_nid = ALC880_DIGOUT_NID,
875 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
876 .channel_mode = alc880_fivestack_modes,
877 .input_mux = &alc880_capture_source,
878 },
879 [ALC880_6ST] = {
880 .mixers = { alc880_six_stack_mixer },
881 .init_verbs = { alc880_volume_init_verbs,
882 alc880_pin_6stack_init_verbs },
883 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
884 .dac_nids = alc880_6st_dac_nids,
885 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
886 .channel_mode = alc880_sixstack_modes,
887 .input_mux = &alc880_6stack_capture_source,
888 },
889 [ALC880_6ST_DIG] = {
890 .mixers = { alc880_six_stack_mixer },
891 .init_verbs = { alc880_volume_init_verbs,
892 alc880_pin_6stack_init_verbs },
893 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
894 .dac_nids = alc880_6st_dac_nids,
895 .dig_out_nid = ALC880_DIGOUT_NID,
896 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
897 .channel_mode = alc880_sixstack_modes,
898 .input_mux = &alc880_6stack_capture_source,
899 },
1d045db9
TI
900 [ALC880_ASUS] = {
901 .mixers = { alc880_asus_mixer },
902 .init_verbs = { alc880_volume_init_verbs,
903 alc880_pin_asus_init_verbs,
904 alc880_gpio1_init_verbs },
905 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
906 .dac_nids = alc880_asus_dac_nids,
907 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
908 .channel_mode = alc880_asus_modes,
909 .need_dac_fix = 1,
910 .input_mux = &alc880_capture_source,
911 },
912 [ALC880_ASUS_DIG] = {
913 .mixers = { alc880_asus_mixer },
914 .init_verbs = { alc880_volume_init_verbs,
915 alc880_pin_asus_init_verbs,
916 alc880_gpio1_init_verbs },
917 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
918 .dac_nids = alc880_asus_dac_nids,
919 .dig_out_nid = ALC880_DIGOUT_NID,
920 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
921 .channel_mode = alc880_asus_modes,
922 .need_dac_fix = 1,
923 .input_mux = &alc880_capture_source,
924 },
925 [ALC880_ASUS_DIG2] = {
926 .mixers = { alc880_asus_mixer },
927 .init_verbs = { alc880_volume_init_verbs,
928 alc880_pin_asus_init_verbs,
929 alc880_gpio2_init_verbs }, /* use GPIO2 */
930 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
931 .dac_nids = alc880_asus_dac_nids,
932 .dig_out_nid = ALC880_DIGOUT_NID,
933 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
934 .channel_mode = alc880_asus_modes,
935 .need_dac_fix = 1,
936 .input_mux = &alc880_capture_source,
937 },
938 [ALC880_ASUS_W1V] = {
939 .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
940 .init_verbs = { alc880_volume_init_verbs,
941 alc880_pin_asus_init_verbs,
942 alc880_gpio1_init_verbs },
943 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
944 .dac_nids = alc880_asus_dac_nids,
945 .dig_out_nid = ALC880_DIGOUT_NID,
946 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
947 .channel_mode = alc880_asus_modes,
948 .need_dac_fix = 1,
949 .input_mux = &alc880_capture_source,
950 },
1d045db9
TI
951#ifdef CONFIG_SND_DEBUG
952 [ALC880_TEST] = {
953 .mixers = { alc880_test_mixer },
954 .init_verbs = { alc880_test_init_verbs },
955 .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
956 .dac_nids = alc880_test_dac_nids,
957 .dig_out_nid = ALC880_DIGOUT_NID,
958 .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
959 .channel_mode = alc880_test_modes,
960 .input_mux = &alc880_test_capture_source,
961 },
962#endif
963};
964