]> git.karo-electronics.de Git - karo-tx-linux.git/blob - sound/pci/hda/alc880_quirks.c
ALSA: hda/realtek - Rewrite ALC880 model=futjisu with auto-parser
[karo-tx-linux.git] / sound / pci / hda / alc880_quirks.c
1 /*
2  * ALC880 quirk models
3  * included by patch_realtek.c
4  */
5
6 /* ALC880 board config type */
7 enum {
8         ALC880_AUTO,
9         ALC880_3ST,
10         ALC880_3ST_DIG,
11         ALC880_5ST,
12         ALC880_5ST_DIG,
13         ALC880_Z71V,
14         ALC880_6ST,
15         ALC880_6ST_DIG,
16         ALC880_F1734,
17         ALC880_ASUS,
18         ALC880_ASUS_DIG,
19         ALC880_ASUS_W1V,
20         ALC880_ASUS_DIG2,
21         ALC880_UNIWILL_DIG,
22         ALC880_UNIWILL,
23         ALC880_UNIWILL_P53,
24 #ifdef CONFIG_SND_DEBUG
25         ALC880_TEST,
26 #endif
27         ALC880_MODEL_LAST /* last tag */
28 };
29
30 /*
31  * ALC880 3-stack model
32  *
33  * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
34  * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
35  *                 F-Mic = 0x1b, HP = 0x19
36  */
37
38 static const hda_nid_t alc880_dac_nids[4] = {
39         /* front, rear, clfe, rear_surr */
40         0x02, 0x05, 0x04, 0x03
41 };
42
43 static const hda_nid_t alc880_adc_nids[3] = {
44         /* ADC0-2 */
45         0x07, 0x08, 0x09,
46 };
47
48 /* The datasheet says the node 0x07 is connected from inputs,
49  * but it shows zero connection in the real implementation on some devices.
50  * Note: this is a 915GAV bug, fixed on 915GLV
51  */
52 static const hda_nid_t alc880_adc_nids_alt[2] = {
53         /* ADC1-2 */
54         0x08, 0x09,
55 };
56
57 #define ALC880_DIGOUT_NID       0x06
58 #define ALC880_DIGIN_NID        0x0a
59 #define ALC880_PIN_CD_NID       0x1c
60
61 static const struct hda_input_mux alc880_capture_source = {
62         .num_items = 4,
63         .items = {
64                 { "Mic", 0x0 },
65                 { "Front Mic", 0x3 },
66                 { "Line", 0x2 },
67                 { "CD", 0x4 },
68         },
69 };
70
71 /* channel source setting (2/6 channel selection for 3-stack) */
72 /* 2ch mode */
73 static const struct hda_verb alc880_threestack_ch2_init[] = {
74         /* set line-in to input, mute it */
75         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
76         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
77         /* set mic-in to input vref 80%, mute it */
78         { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
79         { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
80         { } /* end */
81 };
82
83 /* 6ch mode */
84 static const struct hda_verb alc880_threestack_ch6_init[] = {
85         /* set line-in to output, unmute it */
86         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
87         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
88         /* set mic-in to output, unmute it */
89         { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
90         { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
91         { } /* end */
92 };
93
94 static const struct hda_channel_mode alc880_threestack_modes[2] = {
95         { 2, alc880_threestack_ch2_init },
96         { 6, alc880_threestack_ch6_init },
97 };
98
99 static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
100         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
101         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
102         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
103         HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
104         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
105         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
106         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
107         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
108         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
109         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
110         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
111         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
112         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
113         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
114         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
115         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
116         HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
117         {
118                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
119                 .name = "Channel Mode",
120                 .info = alc_ch_mode_info,
121                 .get = alc_ch_mode_get,
122                 .put = alc_ch_mode_put,
123         },
124         { } /* end */
125 };
126
127 /*
128  * ALC880 5-stack model
129  *
130  * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
131  *      Side = 0x02 (0xd)
132  * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
133  *                 Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
134  */
135
136 /* additional mixers to alc880_three_stack_mixer */
137 static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
138         HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
139         HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
140         { } /* end */
141 };
142
143 /* channel source setting (6/8 channel selection for 5-stack) */
144 /* 6ch mode */
145 static const struct hda_verb alc880_fivestack_ch6_init[] = {
146         /* set line-in to input, mute it */
147         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
148         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
149         { } /* end */
150 };
151
152 /* 8ch mode */
153 static const struct hda_verb alc880_fivestack_ch8_init[] = {
154         /* set line-in to output, unmute it */
155         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
156         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
157         { } /* end */
158 };
159
160 static const struct hda_channel_mode alc880_fivestack_modes[2] = {
161         { 6, alc880_fivestack_ch6_init },
162         { 8, alc880_fivestack_ch8_init },
163 };
164
165
166 /*
167  * ALC880 6-stack model
168  *
169  * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
170  *      Side = 0x05 (0x0f)
171  * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
172  *   Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
173  */
174
175 static const hda_nid_t alc880_6st_dac_nids[4] = {
176         /* front, rear, clfe, rear_surr */
177         0x02, 0x03, 0x04, 0x05
178 };
179
180 static const struct hda_input_mux alc880_6stack_capture_source = {
181         .num_items = 4,
182         .items = {
183                 { "Mic", 0x0 },
184                 { "Front Mic", 0x1 },
185                 { "Line", 0x2 },
186                 { "CD", 0x4 },
187         },
188 };
189
190 /* fixed 8-channels */
191 static const struct hda_channel_mode alc880_sixstack_modes[1] = {
192         { 8, NULL },
193 };
194
195 static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
196         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
197         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
198         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
199         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
200         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
201         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
202         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
203         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
204         HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
205         HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
206         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
207         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
208         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
209         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
210         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
211         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
212         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
213         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
214         {
215                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
216                 .name = "Channel Mode",
217                 .info = alc_ch_mode_info,
218                 .get = alc_ch_mode_get,
219                 .put = alc_ch_mode_put,
220         },
221         { } /* end */
222 };
223
224
225 static const hda_nid_t alc880_w810_dac_nids[3] = {
226         /* front, rear/surround, clfe */
227         0x02, 0x03, 0x04
228 };
229
230 /*
231  * Z710V model
232  *
233  * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
234  * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
235  *                 Line = 0x1a
236  */
237
238 static const hda_nid_t alc880_z71v_dac_nids[1] = {
239         0x02
240 };
241 #define ALC880_Z71V_HP_DAC      0x03
242
243 /* fixed 2 channels */
244 static const struct hda_channel_mode alc880_2_jack_modes[1] = {
245         { 2, NULL }
246 };
247
248 static const struct snd_kcontrol_new alc880_z71v_mixer[] = {
249         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
250         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
251         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
252         HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
253         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
254         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
255         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
256         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
257         { } /* end */
258 };
259
260
261 /*
262  * ALC880 F1734 model
263  *
264  * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
265  * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
266  */
267
268 static const hda_nid_t alc880_f1734_dac_nids[1] = {
269         0x03
270 };
271 #define ALC880_F1734_HP_DAC     0x02
272
273 static const struct snd_kcontrol_new alc880_f1734_mixer[] = {
274         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
275         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
276         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
277         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
278         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
279         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
280         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
281         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
282         { } /* end */
283 };
284
285 static const struct hda_input_mux alc880_f1734_capture_source = {
286         .num_items = 2,
287         .items = {
288                 { "Mic", 0x1 },
289                 { "CD", 0x4 },
290         },
291 };
292
293
294 /*
295  * ALC880 ASUS model
296  *
297  * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
298  * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
299  *  Mic = 0x18, Line = 0x1a
300  */
301
302 #define alc880_asus_dac_nids    alc880_w810_dac_nids    /* identical with w810 */
303 #define alc880_asus_modes       alc880_threestack_modes /* 2/6 channel mode */
304
305 static const struct snd_kcontrol_new alc880_asus_mixer[] = {
306         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
307         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
308         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
309         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
310         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
311         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
312         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
313         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
314         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
315         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
316         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
317         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
318         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
319         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
320         {
321                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
322                 .name = "Channel Mode",
323                 .info = alc_ch_mode_info,
324                 .get = alc_ch_mode_get,
325                 .put = alc_ch_mode_put,
326         },
327         { } /* end */
328 };
329
330 /*
331  * ALC880 ASUS W1V model
332  *
333  * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
334  * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
335  *  Mic = 0x18, Line = 0x1a, Line2 = 0x1b
336  */
337
338 /* additional mixers to alc880_asus_mixer */
339 static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
340         HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
341         HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
342         { } /* end */
343 };
344
345 /* Uniwill */
346 static const struct snd_kcontrol_new alc880_uniwill_mixer[] = {
347         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
348         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
349         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
350         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
351         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
352         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
353         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
354         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
355         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
356         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
357         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
358         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
359         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
360         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
361         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
362         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
363         {
364                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
365                 .name = "Channel Mode",
366                 .info = alc_ch_mode_info,
367                 .get = alc_ch_mode_get,
368                 .put = alc_ch_mode_put,
369         },
370         { } /* end */
371 };
372
373 static const struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
374         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
375         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
376         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
377         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
378         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
379         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
380         { } /* end */
381 };
382
383 /*
384  * initialize the codec volumes, etc
385  */
386
387 /*
388  * generic initialization of ADC, input mixers and output mixers
389  */
390 static const struct hda_verb alc880_volume_init_verbs[] = {
391         /*
392          * Unmute ADC0-2 and set the default input to mic-in
393          */
394         {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
395         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
396         {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
397         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
398         {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
399         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
400
401         /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
402          * mixer widget
403          * Note: PASD motherboards uses the Line In 2 as the input for front
404          * panel mic (mic 2)
405          */
406         /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
407         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
408         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
409         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
410         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
411         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
412         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
413         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
414
415         /*
416          * Set up output mixers (0x0c - 0x0f)
417          */
418         /* set vol=0 to output mixers */
419         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
420         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
421         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
422         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
423         /* set up input amps for analog loopback */
424         /* Amp Indices: DAC = 0, mixer = 1 */
425         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
426         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
427         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
428         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
429         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
430         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
431         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
432         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
433
434         { }
435 };
436
437 /*
438  * 3-stack pin configuration:
439  * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
440  */
441 static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
442         /*
443          * preset connection lists of input pins
444          * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
445          */
446         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
447         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
448         {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
449
450         /*
451          * Set pin mode and muting
452          */
453         /* set front pin widgets 0x14 for output */
454         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
455         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
456         /* Mic1 (rear panel) pin widget for input and vref at 80% */
457         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
458         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
459         /* Mic2 (as headphone out) for HP output */
460         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
461         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
462         /* Line In pin widget for input */
463         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
464         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
465         /* Line2 (as front mic) pin widget for input and vref at 80% */
466         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
467         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
468         /* CD pin widget for input */
469         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
470
471         { }
472 };
473
474 /*
475  * 5-stack pin configuration:
476  * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
477  * line-in/side = 0x1a, f-mic = 0x1b
478  */
479 static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
480         /*
481          * preset connection lists of input pins
482          * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
483          */
484         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
485         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
486
487         /*
488          * Set pin mode and muting
489          */
490         /* set pin widgets 0x14-0x17 for output */
491         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
492         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
493         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
494         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
495         /* unmute pins for output (no gain on this amp) */
496         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
497         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
498         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
499         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
500
501         /* Mic1 (rear panel) pin widget for input and vref at 80% */
502         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
503         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
504         /* Mic2 (as headphone out) for HP output */
505         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
506         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
507         /* Line In pin widget for input */
508         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
509         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
510         /* Line2 (as front mic) pin widget for input and vref at 80% */
511         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
512         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
513         /* CD pin widget for input */
514         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
515
516         { }
517 };
518
519 /*
520  * Z71V pin configuration:
521  * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
522  */
523 static const struct hda_verb alc880_pin_z71v_init_verbs[] = {
524         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
525         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
526         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
527         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
528
529         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
530         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
531         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
532         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
533
534         { }
535 };
536
537 /*
538  * 6-stack pin configuration:
539  * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
540  * f-mic = 0x19, line = 0x1a, HP = 0x1b
541  */
542 static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
543         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
544
545         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
546         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
547         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
548         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
549         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
550         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
551         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
552         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
553
554         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
555         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
556         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
557         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
558         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
559         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
560         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
561         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
562         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
563
564         { }
565 };
566
567 /*
568  * Uniwill pin configuration:
569  * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
570  * line = 0x1a
571  */
572 static const struct hda_verb alc880_uniwill_init_verbs[] = {
573         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
574
575         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
576         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
577         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
578         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
579         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
580         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
581         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
582         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
583         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
584         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
585         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
586         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
587         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
588         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
589
590         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
591         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
592         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
593         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
594         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
595         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
596         /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
597         /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
598         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
599
600         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
601         {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
602
603         { }
604 };
605
606 /*
607 * Uniwill P53
608 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
609  */
610 static const struct hda_verb alc880_uniwill_p53_init_verbs[] = {
611         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
612
613         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
614         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
615         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
616         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
617         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
618         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
619         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
620         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
621         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
622         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
623         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
624         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
625
626         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
627         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
628         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
629         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
630         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
631         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
632
633         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
634         {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_DCVOL_EVENT},
635
636         { }
637 };
638
639 static const struct hda_verb alc880_beep_init_verbs[] = {
640         { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
641         { }
642 };
643
644 static void alc880_uniwill_setup(struct hda_codec *codec)
645 {
646         struct alc_spec *spec = codec->spec;
647
648         spec->autocfg.hp_pins[0] = 0x14;
649         spec->autocfg.speaker_pins[0] = 0x15;
650         spec->autocfg.speaker_pins[0] = 0x16;
651         alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
652 }
653
654 static void alc880_uniwill_init_hook(struct hda_codec *codec)
655 {
656         alc_hp_automute(codec);
657         alc88x_simple_mic_automute(codec);
658 }
659
660 static void alc880_uniwill_unsol_event(struct hda_codec *codec,
661                                        unsigned int res)
662 {
663         /* Looks like the unsol event is incompatible with the standard
664          * definition.  4bit tag is placed at 28 bit!
665          */
666         res >>= 28;
667         switch (res) {
668         case ALC_MIC_EVENT:
669                 alc88x_simple_mic_automute(codec);
670                 break;
671         default:
672                 alc_exec_unsol_event(codec, res);
673                 break;
674         }
675 }
676
677 static void alc880_uniwill_p53_setup(struct hda_codec *codec)
678 {
679         struct alc_spec *spec = codec->spec;
680
681         spec->autocfg.hp_pins[0] = 0x14;
682         spec->autocfg.speaker_pins[0] = 0x15;
683         alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
684 }
685
686 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
687 {
688         unsigned int present;
689
690         present = snd_hda_codec_read(codec, 0x21, 0,
691                                      AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
692         present &= HDA_AMP_VOLMASK;
693         snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
694                                  HDA_AMP_VOLMASK, present);
695         snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
696                                  HDA_AMP_VOLMASK, present);
697 }
698
699 static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
700                                            unsigned int res)
701 {
702         /* Looks like the unsol event is incompatible with the standard
703          * definition.  4bit tag is placed at 28 bit!
704          */
705         res >>= 28;
706         if (res == ALC_DCVOL_EVENT)
707                 alc880_uniwill_p53_dcvol_automute(codec);
708         else
709                 alc_exec_unsol_event(codec, res);
710 }
711
712 /*
713  * F1734 pin configuration:
714  * HP = 0x14, speaker-out = 0x15, mic = 0x18
715  */
716 static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
717         {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
718         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
719         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
720         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
721         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
722
723         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
724         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
725         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
726         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
727
728         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
729         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
730         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
731         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
732         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
733         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
734         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
735         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
736         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
737
738         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
739         {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
740
741         { }
742 };
743
744 /*
745  * ASUS pin configuration:
746  * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
747  */
748 static const struct hda_verb alc880_pin_asus_init_verbs[] = {
749         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
750         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
751         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
752         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
753
754         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
755         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
756         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
757         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
758         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
759         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
760         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
761         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
762
763         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
764         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
765         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
766         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
767         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
768         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
769         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
770         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
771         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
772
773         { }
774 };
775
776 /* Enable GPIO mask and set output */
777 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
778 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
779 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
780
781 /*
782  * Test configuration for debugging
783  *
784  * Almost all inputs/outputs are enabled.  I/O pins can be configured via
785  * enum controls.
786  */
787 #ifdef CONFIG_SND_DEBUG
788 static const hda_nid_t alc880_test_dac_nids[4] = {
789         0x02, 0x03, 0x04, 0x05
790 };
791
792 static const struct hda_input_mux alc880_test_capture_source = {
793         .num_items = 7,
794         .items = {
795                 { "In-1", 0x0 },
796                 { "In-2", 0x1 },
797                 { "In-3", 0x2 },
798                 { "In-4", 0x3 },
799                 { "CD", 0x4 },
800                 { "Front", 0x5 },
801                 { "Surround", 0x6 },
802         },
803 };
804
805 static const struct hda_channel_mode alc880_test_modes[4] = {
806         { 2, NULL },
807         { 4, NULL },
808         { 6, NULL },
809         { 8, NULL },
810 };
811
812 static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
813                                  struct snd_ctl_elem_info *uinfo)
814 {
815         static const char * const texts[] = {
816                 "N/A", "Line Out", "HP Out",
817                 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
818         };
819         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
820         uinfo->count = 1;
821         uinfo->value.enumerated.items = 8;
822         if (uinfo->value.enumerated.item >= 8)
823                 uinfo->value.enumerated.item = 7;
824         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
825         return 0;
826 }
827
828 static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
829                                 struct snd_ctl_elem_value *ucontrol)
830 {
831         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
832         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
833         unsigned int pin_ctl, item = 0;
834
835         pin_ctl = snd_hda_codec_read(codec, nid, 0,
836                                      AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
837         if (pin_ctl & AC_PINCTL_OUT_EN) {
838                 if (pin_ctl & AC_PINCTL_HP_EN)
839                         item = 2;
840                 else
841                         item = 1;
842         } else if (pin_ctl & AC_PINCTL_IN_EN) {
843                 switch (pin_ctl & AC_PINCTL_VREFEN) {
844                 case AC_PINCTL_VREF_HIZ: item = 3; break;
845                 case AC_PINCTL_VREF_50:  item = 4; break;
846                 case AC_PINCTL_VREF_GRD: item = 5; break;
847                 case AC_PINCTL_VREF_80:  item = 6; break;
848                 case AC_PINCTL_VREF_100: item = 7; break;
849                 }
850         }
851         ucontrol->value.enumerated.item[0] = item;
852         return 0;
853 }
854
855 static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
856                                 struct snd_ctl_elem_value *ucontrol)
857 {
858         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
859         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
860         static const unsigned int ctls[] = {
861                 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
862                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
863                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
864                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
865                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
866                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
867         };
868         unsigned int old_ctl, new_ctl;
869
870         old_ctl = snd_hda_codec_read(codec, nid, 0,
871                                      AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
872         new_ctl = ctls[ucontrol->value.enumerated.item[0]];
873         if (old_ctl != new_ctl) {
874                 int val;
875                 snd_hda_codec_write_cache(codec, nid, 0,
876                                           AC_VERB_SET_PIN_WIDGET_CONTROL,
877                                           new_ctl);
878                 val = ucontrol->value.enumerated.item[0] >= 3 ?
879                         HDA_AMP_MUTE : 0;
880                 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
881                                          HDA_AMP_MUTE, val);
882                 return 1;
883         }
884         return 0;
885 }
886
887 static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
888                                  struct snd_ctl_elem_info *uinfo)
889 {
890         static const char * const texts[] = {
891                 "Front", "Surround", "CLFE", "Side"
892         };
893         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
894         uinfo->count = 1;
895         uinfo->value.enumerated.items = 4;
896         if (uinfo->value.enumerated.item >= 4)
897                 uinfo->value.enumerated.item = 3;
898         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
899         return 0;
900 }
901
902 static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
903                                 struct snd_ctl_elem_value *ucontrol)
904 {
905         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
906         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
907         unsigned int sel;
908
909         sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
910         ucontrol->value.enumerated.item[0] = sel & 3;
911         return 0;
912 }
913
914 static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
915                                 struct snd_ctl_elem_value *ucontrol)
916 {
917         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
918         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
919         unsigned int sel;
920
921         sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
922         if (ucontrol->value.enumerated.item[0] != sel) {
923                 sel = ucontrol->value.enumerated.item[0] & 3;
924                 snd_hda_codec_write_cache(codec, nid, 0,
925                                           AC_VERB_SET_CONNECT_SEL, sel);
926                 return 1;
927         }
928         return 0;
929 }
930
931 #define PIN_CTL_TEST(xname,nid) {                       \
932                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,    \
933                         .name = xname,                 \
934                         .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
935                         .info = alc_test_pin_ctl_info, \
936                         .get = alc_test_pin_ctl_get,   \
937                         .put = alc_test_pin_ctl_put,   \
938                         .private_value = nid           \
939                         }
940
941 #define PIN_SRC_TEST(xname,nid) {                       \
942                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,    \
943                         .name = xname,                 \
944                         .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
945                         .info = alc_test_pin_src_info, \
946                         .get = alc_test_pin_src_get,   \
947                         .put = alc_test_pin_src_put,   \
948                         .private_value = nid           \
949                         }
950
951 static const struct snd_kcontrol_new alc880_test_mixer[] = {
952         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
953         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
954         HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
955         HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
956         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
957         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
958         HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
959         HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
960         PIN_CTL_TEST("Front Pin Mode", 0x14),
961         PIN_CTL_TEST("Surround Pin Mode", 0x15),
962         PIN_CTL_TEST("CLFE Pin Mode", 0x16),
963         PIN_CTL_TEST("Side Pin Mode", 0x17),
964         PIN_CTL_TEST("In-1 Pin Mode", 0x18),
965         PIN_CTL_TEST("In-2 Pin Mode", 0x19),
966         PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
967         PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
968         PIN_SRC_TEST("In-1 Pin Source", 0x18),
969         PIN_SRC_TEST("In-2 Pin Source", 0x19),
970         PIN_SRC_TEST("In-3 Pin Source", 0x1a),
971         PIN_SRC_TEST("In-4 Pin Source", 0x1b),
972         HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
973         HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
974         HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
975         HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
976         HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
977         HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
978         HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
979         HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
980         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
981         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
982         {
983                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
984                 .name = "Channel Mode",
985                 .info = alc_ch_mode_info,
986                 .get = alc_ch_mode_get,
987                 .put = alc_ch_mode_put,
988         },
989         { } /* end */
990 };
991
992 static const struct hda_verb alc880_test_init_verbs[] = {
993         /* Unmute inputs of 0x0c - 0x0f */
994         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
995         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
996         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
997         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
998         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
999         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1000         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1001         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1002         /* Vol output for 0x0c-0x0f */
1003         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1004         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1005         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1006         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1007         /* Set output pins 0x14-0x17 */
1008         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1009         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1010         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1011         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1012         /* Unmute output pins 0x14-0x17 */
1013         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1014         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1015         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1016         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1017         /* Set input pins 0x18-0x1c */
1018         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1019         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1020         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1021         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1022         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1023         /* Mute input pins 0x18-0x1b */
1024         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1025         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1026         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1027         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1028         /* ADC set up */
1029         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1030         {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1031         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1032         {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1033         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1034         {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1035         /* Analog input/passthru */
1036         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1037         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1038         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1039         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1040         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1041         { }
1042 };
1043 #endif
1044
1045 /*
1046  */
1047
1048 static const char * const alc880_models[ALC880_MODEL_LAST] = {
1049         [ALC880_3ST]            = "3stack",
1050         [ALC880_3ST_DIG]        = "3stack-digout",
1051         [ALC880_5ST]            = "5stack",
1052         [ALC880_5ST_DIG]        = "5stack-digout",
1053         [ALC880_Z71V]           = "z71v",
1054         [ALC880_6ST]            = "6stack",
1055         [ALC880_6ST_DIG]        = "6stack-digout",
1056         [ALC880_ASUS]           = "asus",
1057         [ALC880_ASUS_W1V]       = "asus-w1v",
1058         [ALC880_ASUS_DIG]       = "asus-dig",
1059         [ALC880_ASUS_DIG2]      = "asus-dig2",
1060         [ALC880_UNIWILL_DIG]    = "uniwill",
1061         [ALC880_UNIWILL_P53]    = "uniwill-p53",
1062         [ALC880_F1734]          = "F1734",
1063 #ifdef CONFIG_SND_DEBUG
1064         [ALC880_TEST]           = "test",
1065 #endif
1066         [ALC880_AUTO]           = "auto",
1067 };
1068
1069 static const struct snd_pci_quirk alc880_cfg_tbl[] = {
1070         SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
1071         SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
1072         SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
1073         SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
1074         SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
1075         SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
1076         SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
1077         SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
1078         SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
1079         SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
1080         SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
1081         SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
1082         SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
1083         SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
1084         SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
1085         SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
1086         /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
1087         SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
1088         SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
1089         SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
1090         SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
1091         SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
1092         SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
1093         SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
1094         SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
1095         SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
1096         SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
1097         SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
1098         SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
1099         SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
1100         SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
1101         SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
1102         SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
1103         SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
1104         SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
1105         SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
1106         SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
1107         SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
1108         SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
1109         SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
1110         SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
1111         SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
1112         SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
1113         SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
1114         SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
1115         SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
1116         SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
1117         SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
1118         SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
1119         SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
1120         SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
1121         SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
1122         SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
1123         SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
1124         SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
1125         /* default Intel */
1126         SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
1127         SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
1128         SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
1129         {}
1130 };
1131
1132 /*
1133  * ALC880 codec presets
1134  */
1135 static const struct alc_config_preset alc880_presets[] = {
1136         [ALC880_3ST] = {
1137                 .mixers = { alc880_three_stack_mixer },
1138                 .init_verbs = { alc880_volume_init_verbs,
1139                                 alc880_pin_3stack_init_verbs },
1140                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1141                 .dac_nids = alc880_dac_nids,
1142                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1143                 .channel_mode = alc880_threestack_modes,
1144                 .need_dac_fix = 1,
1145                 .input_mux = &alc880_capture_source,
1146         },
1147         [ALC880_3ST_DIG] = {
1148                 .mixers = { alc880_three_stack_mixer },
1149                 .init_verbs = { alc880_volume_init_verbs,
1150                                 alc880_pin_3stack_init_verbs },
1151                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1152                 .dac_nids = alc880_dac_nids,
1153                 .dig_out_nid = ALC880_DIGOUT_NID,
1154                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1155                 .channel_mode = alc880_threestack_modes,
1156                 .need_dac_fix = 1,
1157                 .input_mux = &alc880_capture_source,
1158         },
1159         [ALC880_5ST] = {
1160                 .mixers = { alc880_three_stack_mixer,
1161                             alc880_five_stack_mixer},
1162                 .init_verbs = { alc880_volume_init_verbs,
1163                                 alc880_pin_5stack_init_verbs },
1164                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1165                 .dac_nids = alc880_dac_nids,
1166                 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1167                 .channel_mode = alc880_fivestack_modes,
1168                 .input_mux = &alc880_capture_source,
1169         },
1170         [ALC880_5ST_DIG] = {
1171                 .mixers = { alc880_three_stack_mixer,
1172                             alc880_five_stack_mixer },
1173                 .init_verbs = { alc880_volume_init_verbs,
1174                                 alc880_pin_5stack_init_verbs },
1175                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1176                 .dac_nids = alc880_dac_nids,
1177                 .dig_out_nid = ALC880_DIGOUT_NID,
1178                 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1179                 .channel_mode = alc880_fivestack_modes,
1180                 .input_mux = &alc880_capture_source,
1181         },
1182         [ALC880_6ST] = {
1183                 .mixers = { alc880_six_stack_mixer },
1184                 .init_verbs = { alc880_volume_init_verbs,
1185                                 alc880_pin_6stack_init_verbs },
1186                 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1187                 .dac_nids = alc880_6st_dac_nids,
1188                 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1189                 .channel_mode = alc880_sixstack_modes,
1190                 .input_mux = &alc880_6stack_capture_source,
1191         },
1192         [ALC880_6ST_DIG] = {
1193                 .mixers = { alc880_six_stack_mixer },
1194                 .init_verbs = { alc880_volume_init_verbs,
1195                                 alc880_pin_6stack_init_verbs },
1196                 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1197                 .dac_nids = alc880_6st_dac_nids,
1198                 .dig_out_nid = ALC880_DIGOUT_NID,
1199                 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1200                 .channel_mode = alc880_sixstack_modes,
1201                 .input_mux = &alc880_6stack_capture_source,
1202         },
1203         [ALC880_Z71V] = {
1204                 .mixers = { alc880_z71v_mixer },
1205                 .init_verbs = { alc880_volume_init_verbs,
1206                                 alc880_pin_z71v_init_verbs },
1207                 .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
1208                 .dac_nids = alc880_z71v_dac_nids,
1209                 .dig_out_nid = ALC880_DIGOUT_NID,
1210                 .hp_nid = 0x03,
1211                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1212                 .channel_mode = alc880_2_jack_modes,
1213                 .input_mux = &alc880_capture_source,
1214         },
1215         [ALC880_F1734] = {
1216                 .mixers = { alc880_f1734_mixer },
1217                 .init_verbs = { alc880_volume_init_verbs,
1218                                 alc880_pin_f1734_init_verbs },
1219                 .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
1220                 .dac_nids = alc880_f1734_dac_nids,
1221                 .hp_nid = 0x02,
1222                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1223                 .channel_mode = alc880_2_jack_modes,
1224                 .input_mux = &alc880_f1734_capture_source,
1225                 .unsol_event = alc880_uniwill_p53_unsol_event,
1226                 .setup = alc880_uniwill_p53_setup,
1227                 .init_hook = alc_hp_automute,
1228         },
1229         [ALC880_ASUS] = {
1230                 .mixers = { alc880_asus_mixer },
1231                 .init_verbs = { alc880_volume_init_verbs,
1232                                 alc880_pin_asus_init_verbs,
1233                                 alc880_gpio1_init_verbs },
1234                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1235                 .dac_nids = alc880_asus_dac_nids,
1236                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1237                 .channel_mode = alc880_asus_modes,
1238                 .need_dac_fix = 1,
1239                 .input_mux = &alc880_capture_source,
1240         },
1241         [ALC880_ASUS_DIG] = {
1242                 .mixers = { alc880_asus_mixer },
1243                 .init_verbs = { alc880_volume_init_verbs,
1244                                 alc880_pin_asus_init_verbs,
1245                                 alc880_gpio1_init_verbs },
1246                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1247                 .dac_nids = alc880_asus_dac_nids,
1248                 .dig_out_nid = ALC880_DIGOUT_NID,
1249                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1250                 .channel_mode = alc880_asus_modes,
1251                 .need_dac_fix = 1,
1252                 .input_mux = &alc880_capture_source,
1253         },
1254         [ALC880_ASUS_DIG2] = {
1255                 .mixers = { alc880_asus_mixer },
1256                 .init_verbs = { alc880_volume_init_verbs,
1257                                 alc880_pin_asus_init_verbs,
1258                                 alc880_gpio2_init_verbs }, /* use GPIO2 */
1259                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1260                 .dac_nids = alc880_asus_dac_nids,
1261                 .dig_out_nid = ALC880_DIGOUT_NID,
1262                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1263                 .channel_mode = alc880_asus_modes,
1264                 .need_dac_fix = 1,
1265                 .input_mux = &alc880_capture_source,
1266         },
1267         [ALC880_ASUS_W1V] = {
1268                 .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
1269                 .init_verbs = { alc880_volume_init_verbs,
1270                                 alc880_pin_asus_init_verbs,
1271                                 alc880_gpio1_init_verbs },
1272                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1273                 .dac_nids = alc880_asus_dac_nids,
1274                 .dig_out_nid = ALC880_DIGOUT_NID,
1275                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1276                 .channel_mode = alc880_asus_modes,
1277                 .need_dac_fix = 1,
1278                 .input_mux = &alc880_capture_source,
1279         },
1280         [ALC880_UNIWILL_DIG] = {
1281                 .mixers = { alc880_asus_mixer },
1282                 .init_verbs = { alc880_volume_init_verbs,
1283                                 alc880_pin_asus_init_verbs },
1284                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1285                 .dac_nids = alc880_asus_dac_nids,
1286                 .dig_out_nid = ALC880_DIGOUT_NID,
1287                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1288                 .channel_mode = alc880_asus_modes,
1289                 .need_dac_fix = 1,
1290                 .input_mux = &alc880_capture_source,
1291         },
1292         [ALC880_UNIWILL] = {
1293                 .mixers = { alc880_uniwill_mixer },
1294                 .init_verbs = { alc880_volume_init_verbs,
1295                                 alc880_uniwill_init_verbs },
1296                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1297                 .dac_nids = alc880_asus_dac_nids,
1298                 .dig_out_nid = ALC880_DIGOUT_NID,
1299                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1300                 .channel_mode = alc880_threestack_modes,
1301                 .need_dac_fix = 1,
1302                 .input_mux = &alc880_capture_source,
1303                 .unsol_event = alc880_uniwill_unsol_event,
1304                 .setup = alc880_uniwill_setup,
1305                 .init_hook = alc880_uniwill_init_hook,
1306         },
1307         [ALC880_UNIWILL_P53] = {
1308                 .mixers = { alc880_uniwill_p53_mixer },
1309                 .init_verbs = { alc880_volume_init_verbs,
1310                                 alc880_uniwill_p53_init_verbs },
1311                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1312                 .dac_nids = alc880_asus_dac_nids,
1313                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1314                 .channel_mode = alc880_threestack_modes,
1315                 .input_mux = &alc880_capture_source,
1316                 .unsol_event = alc880_uniwill_p53_unsol_event,
1317                 .setup = alc880_uniwill_p53_setup,
1318                 .init_hook = alc_hp_automute,
1319         },
1320 #ifdef CONFIG_SND_DEBUG
1321         [ALC880_TEST] = {
1322                 .mixers = { alc880_test_mixer },
1323                 .init_verbs = { alc880_test_init_verbs },
1324                 .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
1325                 .dac_nids = alc880_test_dac_nids,
1326                 .dig_out_nid = ALC880_DIGOUT_NID,
1327                 .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
1328                 .channel_mode = alc880_test_modes,
1329                 .input_mux = &alc880_test_capture_source,
1330         },
1331 #endif
1332 };
1333