]> git.karo-electronics.de Git - karo-tx-linux.git/blob - sound/pci/hda/alc880_quirks.c
Merge branch 'btrfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[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_W810,
14         ALC880_Z71V,
15         ALC880_6ST,
16         ALC880_6ST_DIG,
17         ALC880_F1734,
18         ALC880_ASUS,
19         ALC880_ASUS_DIG,
20         ALC880_ASUS_W1V,
21         ALC880_ASUS_DIG2,
22         ALC880_FUJITSU,
23         ALC880_UNIWILL_DIG,
24         ALC880_UNIWILL,
25         ALC880_UNIWILL_P53,
26         ALC880_CLEVO,
27         ALC880_TCL_S700,
28         ALC880_LG,
29 #ifdef CONFIG_SND_DEBUG
30         ALC880_TEST,
31 #endif
32         ALC880_MODEL_LAST /* last tag */
33 };
34
35 /*
36  * ALC880 3-stack model
37  *
38  * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
39  * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
40  *                 F-Mic = 0x1b, HP = 0x19
41  */
42
43 static const hda_nid_t alc880_dac_nids[4] = {
44         /* front, rear, clfe, rear_surr */
45         0x02, 0x05, 0x04, 0x03
46 };
47
48 static const hda_nid_t alc880_adc_nids[3] = {
49         /* ADC0-2 */
50         0x07, 0x08, 0x09,
51 };
52
53 /* The datasheet says the node 0x07 is connected from inputs,
54  * but it shows zero connection in the real implementation on some devices.
55  * Note: this is a 915GAV bug, fixed on 915GLV
56  */
57 static const hda_nid_t alc880_adc_nids_alt[2] = {
58         /* ADC1-2 */
59         0x08, 0x09,
60 };
61
62 #define ALC880_DIGOUT_NID       0x06
63 #define ALC880_DIGIN_NID        0x0a
64 #define ALC880_PIN_CD_NID       0x1c
65
66 static const struct hda_input_mux alc880_capture_source = {
67         .num_items = 4,
68         .items = {
69                 { "Mic", 0x0 },
70                 { "Front Mic", 0x3 },
71                 { "Line", 0x2 },
72                 { "CD", 0x4 },
73         },
74 };
75
76 /* channel source setting (2/6 channel selection for 3-stack) */
77 /* 2ch mode */
78 static const struct hda_verb alc880_threestack_ch2_init[] = {
79         /* set line-in to input, mute it */
80         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
81         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
82         /* set mic-in to input vref 80%, mute it */
83         { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
84         { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
85         { } /* end */
86 };
87
88 /* 6ch mode */
89 static const struct hda_verb alc880_threestack_ch6_init[] = {
90         /* set line-in to output, unmute it */
91         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
92         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
93         /* set mic-in to output, unmute it */
94         { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
95         { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
96         { } /* end */
97 };
98
99 static const struct hda_channel_mode alc880_threestack_modes[2] = {
100         { 2, alc880_threestack_ch2_init },
101         { 6, alc880_threestack_ch6_init },
102 };
103
104 static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
105         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
106         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
107         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
108         HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
109         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
110         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
111         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
112         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
113         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
114         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
115         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
116         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
117         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
118         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
119         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
120         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
121         HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
122         {
123                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
124                 .name = "Channel Mode",
125                 .info = alc_ch_mode_info,
126                 .get = alc_ch_mode_get,
127                 .put = alc_ch_mode_put,
128         },
129         { } /* end */
130 };
131
132 /*
133  * ALC880 5-stack model
134  *
135  * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
136  *      Side = 0x02 (0xd)
137  * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
138  *                 Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
139  */
140
141 /* additional mixers to alc880_three_stack_mixer */
142 static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
143         HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
144         HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
145         { } /* end */
146 };
147
148 /* channel source setting (6/8 channel selection for 5-stack) */
149 /* 6ch mode */
150 static const struct hda_verb alc880_fivestack_ch6_init[] = {
151         /* set line-in to input, mute it */
152         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
153         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
154         { } /* end */
155 };
156
157 /* 8ch mode */
158 static const struct hda_verb alc880_fivestack_ch8_init[] = {
159         /* set line-in to output, unmute it */
160         { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
161         { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
162         { } /* end */
163 };
164
165 static const struct hda_channel_mode alc880_fivestack_modes[2] = {
166         { 6, alc880_fivestack_ch6_init },
167         { 8, alc880_fivestack_ch8_init },
168 };
169
170
171 /*
172  * ALC880 6-stack model
173  *
174  * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
175  *      Side = 0x05 (0x0f)
176  * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
177  *   Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
178  */
179
180 static const hda_nid_t alc880_6st_dac_nids[4] = {
181         /* front, rear, clfe, rear_surr */
182         0x02, 0x03, 0x04, 0x05
183 };
184
185 static const struct hda_input_mux alc880_6stack_capture_source = {
186         .num_items = 4,
187         .items = {
188                 { "Mic", 0x0 },
189                 { "Front Mic", 0x1 },
190                 { "Line", 0x2 },
191                 { "CD", 0x4 },
192         },
193 };
194
195 /* fixed 8-channels */
196 static const struct hda_channel_mode alc880_sixstack_modes[1] = {
197         { 8, NULL },
198 };
199
200 static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
201         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
202         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
203         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
204         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
205         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
206         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
207         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
208         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
209         HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
210         HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
211         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
212         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
213         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
214         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
215         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
216         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
217         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
218         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
219         {
220                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
221                 .name = "Channel Mode",
222                 .info = alc_ch_mode_info,
223                 .get = alc_ch_mode_get,
224                 .put = alc_ch_mode_put,
225         },
226         { } /* end */
227 };
228
229
230 /*
231  * ALC880 W810 model
232  *
233  * W810 has rear IO for:
234  * Front (DAC 02)
235  * Surround (DAC 03)
236  * Center/LFE (DAC 04)
237  * Digital out (06)
238  *
239  * The system also has a pair of internal speakers, and a headphone jack.
240  * These are both connected to Line2 on the codec, hence to DAC 02.
241  *
242  * There is a variable resistor to control the speaker or headphone
243  * volume. This is a hardware-only device without a software API.
244  *
245  * Plugging headphones in will disable the internal speakers. This is
246  * implemented in hardware, not via the driver using jack sense. In
247  * a similar fashion, plugging into the rear socket marked "front" will
248  * disable both the speakers and headphones.
249  *
250  * For input, there's a microphone jack, and an "audio in" jack.
251  * These may not do anything useful with this driver yet, because I
252  * haven't setup any initialization verbs for these yet...
253  */
254
255 static const hda_nid_t alc880_w810_dac_nids[3] = {
256         /* front, rear/surround, clfe */
257         0x02, 0x03, 0x04
258 };
259
260 /* fixed 6 channels */
261 static const struct hda_channel_mode alc880_w810_modes[1] = {
262         { 6, NULL }
263 };
264
265 /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
266 static const struct snd_kcontrol_new alc880_w810_base_mixer[] = {
267         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
268         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
269         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
270         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
271         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
272         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
273         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
274         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
275         HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
276         { } /* end */
277 };
278
279
280 /*
281  * Z710V model
282  *
283  * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
284  * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
285  *                 Line = 0x1a
286  */
287
288 static const hda_nid_t alc880_z71v_dac_nids[1] = {
289         0x02
290 };
291 #define ALC880_Z71V_HP_DAC      0x03
292
293 /* fixed 2 channels */
294 static const struct hda_channel_mode alc880_2_jack_modes[1] = {
295         { 2, NULL }
296 };
297
298 static const struct snd_kcontrol_new alc880_z71v_mixer[] = {
299         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
300         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
301         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
302         HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
303         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
304         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
305         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
306         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
307         { } /* end */
308 };
309
310
311 /*
312  * ALC880 F1734 model
313  *
314  * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
315  * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
316  */
317
318 static const hda_nid_t alc880_f1734_dac_nids[1] = {
319         0x03
320 };
321 #define ALC880_F1734_HP_DAC     0x02
322
323 static const struct snd_kcontrol_new alc880_f1734_mixer[] = {
324         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
325         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
326         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
327         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
328         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
329         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
330         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
331         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
332         { } /* end */
333 };
334
335 static const struct hda_input_mux alc880_f1734_capture_source = {
336         .num_items = 2,
337         .items = {
338                 { "Mic", 0x1 },
339                 { "CD", 0x4 },
340         },
341 };
342
343
344 /*
345  * ALC880 ASUS model
346  *
347  * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
348  * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
349  *  Mic = 0x18, Line = 0x1a
350  */
351
352 #define alc880_asus_dac_nids    alc880_w810_dac_nids    /* identical with w810 */
353 #define alc880_asus_modes       alc880_threestack_modes /* 2/6 channel mode */
354
355 static const struct snd_kcontrol_new alc880_asus_mixer[] = {
356         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
357         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
358         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
359         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
360         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
361         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
362         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
363         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
364         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
365         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
366         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
367         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
368         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
369         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
370         {
371                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
372                 .name = "Channel Mode",
373                 .info = alc_ch_mode_info,
374                 .get = alc_ch_mode_get,
375                 .put = alc_ch_mode_put,
376         },
377         { } /* end */
378 };
379
380 /*
381  * ALC880 ASUS W1V model
382  *
383  * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
384  * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
385  *  Mic = 0x18, Line = 0x1a, Line2 = 0x1b
386  */
387
388 /* additional mixers to alc880_asus_mixer */
389 static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
390         HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
391         HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
392         { } /* end */
393 };
394
395 /* TCL S700 */
396 static const struct snd_kcontrol_new alc880_tcl_s700_mixer[] = {
397         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
398         HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
399         HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
400         HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT),
401         HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT),
402         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT),
403         HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT),
404         HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
405         HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
406         { } /* end */
407 };
408
409 /* Uniwill */
410 static const struct snd_kcontrol_new alc880_uniwill_mixer[] = {
411         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
412         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
413         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
414         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
415         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
416         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
417         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
418         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
419         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
420         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
421         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
422         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
423         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
424         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
425         HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
426         HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
427         {
428                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
429                 .name = "Channel Mode",
430                 .info = alc_ch_mode_info,
431                 .get = alc_ch_mode_get,
432                 .put = alc_ch_mode_put,
433         },
434         { } /* end */
435 };
436
437 static const struct snd_kcontrol_new alc880_fujitsu_mixer[] = {
438         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
439         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
440         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
441         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
442         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
443         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
444         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
445         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
446         HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
447         HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
448         { } /* end */
449 };
450
451 static const struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
452         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
453         HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
454         HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
455         HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
456         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
457         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
458         { } /* end */
459 };
460
461 /*
462  * initialize the codec volumes, etc
463  */
464
465 /*
466  * generic initialization of ADC, input mixers and output mixers
467  */
468 static const struct hda_verb alc880_volume_init_verbs[] = {
469         /*
470          * Unmute ADC0-2 and set the default input to mic-in
471          */
472         {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
473         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
474         {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
475         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
476         {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
477         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
478
479         /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
480          * mixer widget
481          * Note: PASD motherboards uses the Line In 2 as the input for front
482          * panel mic (mic 2)
483          */
484         /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
485         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
486         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
487         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
488         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
489         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
490         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
491         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
492
493         /*
494          * Set up output mixers (0x0c - 0x0f)
495          */
496         /* set vol=0 to output mixers */
497         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
498         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
499         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
500         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
501         /* set up input amps for analog loopback */
502         /* Amp Indices: DAC = 0, mixer = 1 */
503         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
504         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
505         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
506         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
507         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
508         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
509         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
510         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
511
512         { }
513 };
514
515 /*
516  * 3-stack pin configuration:
517  * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
518  */
519 static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
520         /*
521          * preset connection lists of input pins
522          * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
523          */
524         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
525         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
526         {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
527
528         /*
529          * Set pin mode and muting
530          */
531         /* set front pin widgets 0x14 for output */
532         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
533         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
534         /* Mic1 (rear panel) pin widget for input and vref at 80% */
535         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
536         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
537         /* Mic2 (as headphone out) for HP output */
538         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
539         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
540         /* Line In pin widget for input */
541         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
542         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
543         /* Line2 (as front mic) pin widget for input and vref at 80% */
544         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
545         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
546         /* CD pin widget for input */
547         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
548
549         { }
550 };
551
552 /*
553  * 5-stack pin configuration:
554  * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
555  * line-in/side = 0x1a, f-mic = 0x1b
556  */
557 static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
558         /*
559          * preset connection lists of input pins
560          * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
561          */
562         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
563         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
564
565         /*
566          * Set pin mode and muting
567          */
568         /* set pin widgets 0x14-0x17 for output */
569         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
570         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
571         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
572         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
573         /* unmute pins for output (no gain on this amp) */
574         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
575         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
576         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
577         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
578
579         /* Mic1 (rear panel) pin widget for input and vref at 80% */
580         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
581         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
582         /* Mic2 (as headphone out) for HP output */
583         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
584         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
585         /* Line In pin widget for input */
586         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
587         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
588         /* Line2 (as front mic) pin widget for input and vref at 80% */
589         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
590         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
591         /* CD pin widget for input */
592         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
593
594         { }
595 };
596
597 /*
598  * W810 pin configuration:
599  * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
600  */
601 static const struct hda_verb alc880_pin_w810_init_verbs[] = {
602         /* hphone/speaker input selector: front DAC */
603         {0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
604
605         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
606         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
607         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
608         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
609         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
610         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
611
612         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
613         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
614
615         { }
616 };
617
618 /*
619  * Z71V pin configuration:
620  * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
621  */
622 static const struct hda_verb alc880_pin_z71v_init_verbs[] = {
623         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
624         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
625         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
626         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
627
628         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
629         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
630         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
631         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
632
633         { }
634 };
635
636 /*
637  * 6-stack pin configuration:
638  * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
639  * f-mic = 0x19, line = 0x1a, HP = 0x1b
640  */
641 static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
642         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
643
644         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
645         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
646         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
647         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
648         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
649         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
650         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
651         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
652
653         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
654         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
655         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
656         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
657         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
658         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
659         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
660         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
661         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
662
663         { }
664 };
665
666 /*
667  * Uniwill pin configuration:
668  * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
669  * line = 0x1a
670  */
671 static const struct hda_verb alc880_uniwill_init_verbs[] = {
672         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
673
674         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
675         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
676         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
677         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
678         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
679         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
680         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
681         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
682         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
683         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
684         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
685         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
686         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
687         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
688
689         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
690         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
691         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
692         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
693         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
694         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
695         /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
696         /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
697         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
698
699         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
700         {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
701
702         { }
703 };
704
705 /*
706 * Uniwill P53
707 * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
708  */
709 static const struct hda_verb alc880_uniwill_p53_init_verbs[] = {
710         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
711
712         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
713         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
714         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
715         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
716         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
717         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
718         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
719         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
720         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
721         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
722         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
723         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
724
725         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
726         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
727         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
728         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
729         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
730         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
731
732         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
733         {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_DCVOL_EVENT},
734
735         { }
736 };
737
738 static const struct hda_verb alc880_beep_init_verbs[] = {
739         { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
740         { }
741 };
742
743 static void alc880_uniwill_setup(struct hda_codec *codec)
744 {
745         struct alc_spec *spec = codec->spec;
746
747         spec->autocfg.hp_pins[0] = 0x14;
748         spec->autocfg.speaker_pins[0] = 0x15;
749         spec->autocfg.speaker_pins[0] = 0x16;
750         alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
751 }
752
753 static void alc880_uniwill_init_hook(struct hda_codec *codec)
754 {
755         alc_hp_automute(codec);
756         alc88x_simple_mic_automute(codec);
757 }
758
759 static void alc880_uniwill_unsol_event(struct hda_codec *codec,
760                                        unsigned int res)
761 {
762         /* Looks like the unsol event is incompatible with the standard
763          * definition.  4bit tag is placed at 28 bit!
764          */
765         switch (res >> 28) {
766         case ALC_MIC_EVENT:
767                 alc88x_simple_mic_automute(codec);
768                 break;
769         default:
770                 alc_sku_unsol_event(codec, res);
771                 break;
772         }
773 }
774
775 static void alc880_uniwill_p53_setup(struct hda_codec *codec)
776 {
777         struct alc_spec *spec = codec->spec;
778
779         spec->autocfg.hp_pins[0] = 0x14;
780         spec->autocfg.speaker_pins[0] = 0x15;
781         alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
782 }
783
784 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
785 {
786         unsigned int present;
787
788         present = snd_hda_codec_read(codec, 0x21, 0,
789                                      AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
790         present &= HDA_AMP_VOLMASK;
791         snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
792                                  HDA_AMP_VOLMASK, present);
793         snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
794                                  HDA_AMP_VOLMASK, present);
795 }
796
797 static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
798                                            unsigned int res)
799 {
800         /* Looks like the unsol event is incompatible with the standard
801          * definition.  4bit tag is placed at 28 bit!
802          */
803         if ((res >> 28) == ALC_DCVOL_EVENT)
804                 alc880_uniwill_p53_dcvol_automute(codec);
805         else
806                 alc_sku_unsol_event(codec, res);
807 }
808
809 /*
810  * F1734 pin configuration:
811  * HP = 0x14, speaker-out = 0x15, mic = 0x18
812  */
813 static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
814         {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
815         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
816         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
817         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
818         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
819
820         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
821         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
822         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
823         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
824
825         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
826         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
827         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
828         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
829         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
830         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
831         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
832         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
833         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
834
835         {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
836         {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
837
838         { }
839 };
840
841 /*
842  * ASUS pin configuration:
843  * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
844  */
845 static const struct hda_verb alc880_pin_asus_init_verbs[] = {
846         {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
847         {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
848         {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
849         {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
850
851         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
852         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
853         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
854         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
855         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
856         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
857         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
858         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
859
860         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
861         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
862         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
863         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
864         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
865         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
866         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
867         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
868         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
869
870         { }
871 };
872
873 /* Enable GPIO mask and set output */
874 #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
875 #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
876 #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
877
878 /* Clevo m520g init */
879 static const struct hda_verb alc880_pin_clevo_init_verbs[] = {
880         /* headphone output */
881         {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
882         /* line-out */
883         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
884         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
885         /* Line-in */
886         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
887         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
888         /* CD */
889         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
890         {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
891         /* Mic1 (rear panel) */
892         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
893         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
894         /* Mic2 (front panel) */
895         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
896         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
897         /* headphone */
898         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
899         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
900         /* change to EAPD mode */
901         {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
902         {0x20, AC_VERB_SET_PROC_COEF,  0x3060},
903
904         { }
905 };
906
907 static const struct hda_verb alc880_pin_tcl_S700_init_verbs[] = {
908         /* change to EAPD mode */
909         {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
910         {0x20, AC_VERB_SET_PROC_COEF,  0x3060},
911
912         /* Headphone output */
913         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
914         /* Front output*/
915         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
916         {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
917
918         /* Line In pin widget for input */
919         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
920         /* CD pin widget for input */
921         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
922         /* Mic1 (rear panel) pin widget for input and vref at 80% */
923         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
924
925         /* change to EAPD mode */
926         {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
927         {0x20, AC_VERB_SET_PROC_COEF,  0x3070},
928
929         { }
930 };
931
932 /*
933  * LG m1 express dual
934  *
935  * Pin assignment:
936  *   Rear Line-In/Out (blue): 0x14
937  *   Build-in Mic-In: 0x15
938  *   Speaker-out: 0x17
939  *   HP-Out (green): 0x1b
940  *   Mic-In/Out (red): 0x19
941  *   SPDIF-Out: 0x1e
942  */
943
944 /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
945 static const hda_nid_t alc880_lg_dac_nids[3] = {
946         0x05, 0x02, 0x03
947 };
948
949 /* seems analog CD is not working */
950 static const struct hda_input_mux alc880_lg_capture_source = {
951         .num_items = 3,
952         .items = {
953                 { "Mic", 0x1 },
954                 { "Line", 0x5 },
955                 { "Internal Mic", 0x6 },
956         },
957 };
958
959 /* 2,4,6 channel modes */
960 static const struct hda_verb alc880_lg_ch2_init[] = {
961         /* set line-in and mic-in to input */
962         { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
963         { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
964         { }
965 };
966
967 static const struct hda_verb alc880_lg_ch4_init[] = {
968         /* set line-in to out and mic-in to input */
969         { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
970         { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
971         { }
972 };
973
974 static const struct hda_verb alc880_lg_ch6_init[] = {
975         /* set line-in and mic-in to output */
976         { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
977         { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
978         { }
979 };
980
981 static const struct hda_channel_mode alc880_lg_ch_modes[3] = {
982         { 2, alc880_lg_ch2_init },
983         { 4, alc880_lg_ch4_init },
984         { 6, alc880_lg_ch6_init },
985 };
986
987 static const struct snd_kcontrol_new alc880_lg_mixer[] = {
988         HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
989         HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT),
990         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
991         HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT),
992         HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
993         HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
994         HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
995         HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
996         HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
997         HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
998         HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT),
999         HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT),
1000         HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT),
1001         HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT),
1002         {
1003                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1004                 .name = "Channel Mode",
1005                 .info = alc_ch_mode_info,
1006                 .get = alc_ch_mode_get,
1007                 .put = alc_ch_mode_put,
1008         },
1009         { } /* end */
1010 };
1011
1012 static const struct hda_verb alc880_lg_init_verbs[] = {
1013         /* set capture source to mic-in */
1014         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1015         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1016         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1017         /* mute all amp mixer inputs */
1018         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
1019         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
1020         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
1021         /* line-in to input */
1022         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1023         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1024         /* built-in mic */
1025         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1026         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1027         /* speaker-out */
1028         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1029         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1030         /* mic-in to input */
1031         {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
1032         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1033         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1034         /* HP-out */
1035         {0x13, AC_VERB_SET_CONNECT_SEL, 0x03},
1036         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1037         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1038         /* jack sense */
1039         {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
1040         { }
1041 };
1042
1043 /* toggle speaker-output according to the hp-jack state */
1044 static void alc880_lg_setup(struct hda_codec *codec)
1045 {
1046         struct alc_spec *spec = codec->spec;
1047
1048         spec->autocfg.hp_pins[0] = 0x1b;
1049         spec->autocfg.speaker_pins[0] = 0x17;
1050         alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1051 }
1052
1053 #ifdef CONFIG_SND_HDA_POWER_SAVE
1054 static const struct hda_amp_list alc880_lg_loopbacks[] = {
1055         { 0x0b, HDA_INPUT, 1 },
1056         { 0x0b, HDA_INPUT, 6 },
1057         { 0x0b, HDA_INPUT, 7 },
1058         { } /* end */
1059 };
1060 #endif
1061
1062 /*
1063  * Test configuration for debugging
1064  *
1065  * Almost all inputs/outputs are enabled.  I/O pins can be configured via
1066  * enum controls.
1067  */
1068 #ifdef CONFIG_SND_DEBUG
1069 static const hda_nid_t alc880_test_dac_nids[4] = {
1070         0x02, 0x03, 0x04, 0x05
1071 };
1072
1073 static const struct hda_input_mux alc880_test_capture_source = {
1074         .num_items = 7,
1075         .items = {
1076                 { "In-1", 0x0 },
1077                 { "In-2", 0x1 },
1078                 { "In-3", 0x2 },
1079                 { "In-4", 0x3 },
1080                 { "CD", 0x4 },
1081                 { "Front", 0x5 },
1082                 { "Surround", 0x6 },
1083         },
1084 };
1085
1086 static const struct hda_channel_mode alc880_test_modes[4] = {
1087         { 2, NULL },
1088         { 4, NULL },
1089         { 6, NULL },
1090         { 8, NULL },
1091 };
1092
1093 static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
1094                                  struct snd_ctl_elem_info *uinfo)
1095 {
1096         static const char * const texts[] = {
1097                 "N/A", "Line Out", "HP Out",
1098                 "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
1099         };
1100         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1101         uinfo->count = 1;
1102         uinfo->value.enumerated.items = 8;
1103         if (uinfo->value.enumerated.item >= 8)
1104                 uinfo->value.enumerated.item = 7;
1105         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
1106         return 0;
1107 }
1108
1109 static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
1110                                 struct snd_ctl_elem_value *ucontrol)
1111 {
1112         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1113         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1114         unsigned int pin_ctl, item = 0;
1115
1116         pin_ctl = snd_hda_codec_read(codec, nid, 0,
1117                                      AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1118         if (pin_ctl & AC_PINCTL_OUT_EN) {
1119                 if (pin_ctl & AC_PINCTL_HP_EN)
1120                         item = 2;
1121                 else
1122                         item = 1;
1123         } else if (pin_ctl & AC_PINCTL_IN_EN) {
1124                 switch (pin_ctl & AC_PINCTL_VREFEN) {
1125                 case AC_PINCTL_VREF_HIZ: item = 3; break;
1126                 case AC_PINCTL_VREF_50:  item = 4; break;
1127                 case AC_PINCTL_VREF_GRD: item = 5; break;
1128                 case AC_PINCTL_VREF_80:  item = 6; break;
1129                 case AC_PINCTL_VREF_100: item = 7; break;
1130                 }
1131         }
1132         ucontrol->value.enumerated.item[0] = item;
1133         return 0;
1134 }
1135
1136 static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
1137                                 struct snd_ctl_elem_value *ucontrol)
1138 {
1139         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1140         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1141         static const unsigned int ctls[] = {
1142                 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
1143                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
1144                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
1145                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
1146                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
1147                 AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
1148         };
1149         unsigned int old_ctl, new_ctl;
1150
1151         old_ctl = snd_hda_codec_read(codec, nid, 0,
1152                                      AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1153         new_ctl = ctls[ucontrol->value.enumerated.item[0]];
1154         if (old_ctl != new_ctl) {
1155                 int val;
1156                 snd_hda_codec_write_cache(codec, nid, 0,
1157                                           AC_VERB_SET_PIN_WIDGET_CONTROL,
1158                                           new_ctl);
1159                 val = ucontrol->value.enumerated.item[0] >= 3 ?
1160                         HDA_AMP_MUTE : 0;
1161                 snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
1162                                          HDA_AMP_MUTE, val);
1163                 return 1;
1164         }
1165         return 0;
1166 }
1167
1168 static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
1169                                  struct snd_ctl_elem_info *uinfo)
1170 {
1171         static const char * const texts[] = {
1172                 "Front", "Surround", "CLFE", "Side"
1173         };
1174         uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1175         uinfo->count = 1;
1176         uinfo->value.enumerated.items = 4;
1177         if (uinfo->value.enumerated.item >= 4)
1178                 uinfo->value.enumerated.item = 3;
1179         strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
1180         return 0;
1181 }
1182
1183 static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
1184                                 struct snd_ctl_elem_value *ucontrol)
1185 {
1186         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1187         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1188         unsigned int sel;
1189
1190         sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
1191         ucontrol->value.enumerated.item[0] = sel & 3;
1192         return 0;
1193 }
1194
1195 static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
1196                                 struct snd_ctl_elem_value *ucontrol)
1197 {
1198         struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
1199         hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
1200         unsigned int sel;
1201
1202         sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
1203         if (ucontrol->value.enumerated.item[0] != sel) {
1204                 sel = ucontrol->value.enumerated.item[0] & 3;
1205                 snd_hda_codec_write_cache(codec, nid, 0,
1206                                           AC_VERB_SET_CONNECT_SEL, sel);
1207                 return 1;
1208         }
1209         return 0;
1210 }
1211
1212 #define PIN_CTL_TEST(xname,nid) {                       \
1213                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,    \
1214                         .name = xname,                 \
1215                         .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
1216                         .info = alc_test_pin_ctl_info, \
1217                         .get = alc_test_pin_ctl_get,   \
1218                         .put = alc_test_pin_ctl_put,   \
1219                         .private_value = nid           \
1220                         }
1221
1222 #define PIN_SRC_TEST(xname,nid) {                       \
1223                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,    \
1224                         .name = xname,                 \
1225                         .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
1226                         .info = alc_test_pin_src_info, \
1227                         .get = alc_test_pin_src_get,   \
1228                         .put = alc_test_pin_src_put,   \
1229                         .private_value = nid           \
1230                         }
1231
1232 static const struct snd_kcontrol_new alc880_test_mixer[] = {
1233         HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1234         HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1235         HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
1236         HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1237         HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1238         HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1239         HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
1240         HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1241         PIN_CTL_TEST("Front Pin Mode", 0x14),
1242         PIN_CTL_TEST("Surround Pin Mode", 0x15),
1243         PIN_CTL_TEST("CLFE Pin Mode", 0x16),
1244         PIN_CTL_TEST("Side Pin Mode", 0x17),
1245         PIN_CTL_TEST("In-1 Pin Mode", 0x18),
1246         PIN_CTL_TEST("In-2 Pin Mode", 0x19),
1247         PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
1248         PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
1249         PIN_SRC_TEST("In-1 Pin Source", 0x18),
1250         PIN_SRC_TEST("In-2 Pin Source", 0x19),
1251         PIN_SRC_TEST("In-3 Pin Source", 0x1a),
1252         PIN_SRC_TEST("In-4 Pin Source", 0x1b),
1253         HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
1254         HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
1255         HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
1256         HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
1257         HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
1258         HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
1259         HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
1260         HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
1261         HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
1262         HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
1263         {
1264                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1265                 .name = "Channel Mode",
1266                 .info = alc_ch_mode_info,
1267                 .get = alc_ch_mode_get,
1268                 .put = alc_ch_mode_put,
1269         },
1270         { } /* end */
1271 };
1272
1273 static const struct hda_verb alc880_test_init_verbs[] = {
1274         /* Unmute inputs of 0x0c - 0x0f */
1275         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1276         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1277         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1278         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1279         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1280         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1281         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1282         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1283         /* Vol output for 0x0c-0x0f */
1284         {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1285         {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1286         {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1287         {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1288         /* Set output pins 0x14-0x17 */
1289         {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1290         {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1291         {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1292         {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1293         /* Unmute output pins 0x14-0x17 */
1294         {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1295         {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1296         {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1297         {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1298         /* Set input pins 0x18-0x1c */
1299         {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1300         {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1301         {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1302         {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1303         {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1304         /* Mute input pins 0x18-0x1b */
1305         {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1306         {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1307         {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1308         {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1309         /* ADC set up */
1310         {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1311         {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1312         {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1313         {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1314         {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1315         {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1316         /* Analog input/passthru */
1317         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1318         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1319         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1320         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1321         {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1322         { }
1323 };
1324 #endif
1325
1326 /*
1327  */
1328
1329 static const char * const alc880_models[ALC880_MODEL_LAST] = {
1330         [ALC880_3ST]            = "3stack",
1331         [ALC880_TCL_S700]       = "tcl",
1332         [ALC880_3ST_DIG]        = "3stack-digout",
1333         [ALC880_CLEVO]          = "clevo",
1334         [ALC880_5ST]            = "5stack",
1335         [ALC880_5ST_DIG]        = "5stack-digout",
1336         [ALC880_W810]           = "w810",
1337         [ALC880_Z71V]           = "z71v",
1338         [ALC880_6ST]            = "6stack",
1339         [ALC880_6ST_DIG]        = "6stack-digout",
1340         [ALC880_ASUS]           = "asus",
1341         [ALC880_ASUS_W1V]       = "asus-w1v",
1342         [ALC880_ASUS_DIG]       = "asus-dig",
1343         [ALC880_ASUS_DIG2]      = "asus-dig2",
1344         [ALC880_UNIWILL_DIG]    = "uniwill",
1345         [ALC880_UNIWILL_P53]    = "uniwill-p53",
1346         [ALC880_FUJITSU]        = "fujitsu",
1347         [ALC880_F1734]          = "F1734",
1348         [ALC880_LG]             = "lg",
1349 #ifdef CONFIG_SND_DEBUG
1350         [ALC880_TEST]           = "test",
1351 #endif
1352         [ALC880_AUTO]           = "auto",
1353 };
1354
1355 static const struct snd_pci_quirk alc880_cfg_tbl[] = {
1356         SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810),
1357         SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
1358         SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
1359         SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
1360         SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
1361         SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
1362         SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
1363         SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
1364         SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
1365         SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
1366         SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
1367         SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
1368         SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
1369         SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
1370         SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
1371         SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
1372         SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
1373         /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
1374         SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
1375         SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
1376         SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
1377         SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
1378         SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
1379         SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
1380         SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
1381         SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
1382         SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
1383         SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
1384         SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
1385         SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
1386         SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
1387         SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
1388         SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
1389         SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
1390         SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
1391         SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
1392         SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
1393         SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
1394         SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
1395         SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
1396         SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
1397         SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
1398         SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
1399         SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
1400         SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
1401         SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
1402         SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
1403         SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
1404         SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
1405         SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
1406         SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
1407         SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
1408         SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
1409         SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
1410         SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
1411         SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
1412         SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
1413         SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
1414         SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
1415         SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
1416         SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
1417         SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
1418         SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
1419         SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
1420         SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
1421         /* default Intel */
1422         SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
1423         SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
1424         SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
1425         {}
1426 };
1427
1428 /*
1429  * ALC880 codec presets
1430  */
1431 static const struct alc_config_preset alc880_presets[] = {
1432         [ALC880_3ST] = {
1433                 .mixers = { alc880_three_stack_mixer },
1434                 .init_verbs = { alc880_volume_init_verbs,
1435                                 alc880_pin_3stack_init_verbs },
1436                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1437                 .dac_nids = alc880_dac_nids,
1438                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1439                 .channel_mode = alc880_threestack_modes,
1440                 .need_dac_fix = 1,
1441                 .input_mux = &alc880_capture_source,
1442         },
1443         [ALC880_3ST_DIG] = {
1444                 .mixers = { alc880_three_stack_mixer },
1445                 .init_verbs = { alc880_volume_init_verbs,
1446                                 alc880_pin_3stack_init_verbs },
1447                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1448                 .dac_nids = alc880_dac_nids,
1449                 .dig_out_nid = ALC880_DIGOUT_NID,
1450                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1451                 .channel_mode = alc880_threestack_modes,
1452                 .need_dac_fix = 1,
1453                 .input_mux = &alc880_capture_source,
1454         },
1455         [ALC880_TCL_S700] = {
1456                 .mixers = { alc880_tcl_s700_mixer },
1457                 .init_verbs = { alc880_volume_init_verbs,
1458                                 alc880_pin_tcl_S700_init_verbs,
1459                                 alc880_gpio2_init_verbs },
1460                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1461                 .dac_nids = alc880_dac_nids,
1462                 .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
1463                 .num_adc_nids = 1, /* single ADC */
1464                 .hp_nid = 0x03,
1465                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1466                 .channel_mode = alc880_2_jack_modes,
1467                 .input_mux = &alc880_capture_source,
1468         },
1469         [ALC880_5ST] = {
1470                 .mixers = { alc880_three_stack_mixer,
1471                             alc880_five_stack_mixer},
1472                 .init_verbs = { alc880_volume_init_verbs,
1473                                 alc880_pin_5stack_init_verbs },
1474                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1475                 .dac_nids = alc880_dac_nids,
1476                 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1477                 .channel_mode = alc880_fivestack_modes,
1478                 .input_mux = &alc880_capture_source,
1479         },
1480         [ALC880_5ST_DIG] = {
1481                 .mixers = { alc880_three_stack_mixer,
1482                             alc880_five_stack_mixer },
1483                 .init_verbs = { alc880_volume_init_verbs,
1484                                 alc880_pin_5stack_init_verbs },
1485                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1486                 .dac_nids = alc880_dac_nids,
1487                 .dig_out_nid = ALC880_DIGOUT_NID,
1488                 .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
1489                 .channel_mode = alc880_fivestack_modes,
1490                 .input_mux = &alc880_capture_source,
1491         },
1492         [ALC880_6ST] = {
1493                 .mixers = { alc880_six_stack_mixer },
1494                 .init_verbs = { alc880_volume_init_verbs,
1495                                 alc880_pin_6stack_init_verbs },
1496                 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1497                 .dac_nids = alc880_6st_dac_nids,
1498                 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1499                 .channel_mode = alc880_sixstack_modes,
1500                 .input_mux = &alc880_6stack_capture_source,
1501         },
1502         [ALC880_6ST_DIG] = {
1503                 .mixers = { alc880_six_stack_mixer },
1504                 .init_verbs = { alc880_volume_init_verbs,
1505                                 alc880_pin_6stack_init_verbs },
1506                 .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
1507                 .dac_nids = alc880_6st_dac_nids,
1508                 .dig_out_nid = ALC880_DIGOUT_NID,
1509                 .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
1510                 .channel_mode = alc880_sixstack_modes,
1511                 .input_mux = &alc880_6stack_capture_source,
1512         },
1513         [ALC880_W810] = {
1514                 .mixers = { alc880_w810_base_mixer },
1515                 .init_verbs = { alc880_volume_init_verbs,
1516                                 alc880_pin_w810_init_verbs,
1517                                 alc880_gpio2_init_verbs },
1518                 .num_dacs = ARRAY_SIZE(alc880_w810_dac_nids),
1519                 .dac_nids = alc880_w810_dac_nids,
1520                 .dig_out_nid = ALC880_DIGOUT_NID,
1521                 .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
1522                 .channel_mode = alc880_w810_modes,
1523                 .input_mux = &alc880_capture_source,
1524         },
1525         [ALC880_Z71V] = {
1526                 .mixers = { alc880_z71v_mixer },
1527                 .init_verbs = { alc880_volume_init_verbs,
1528                                 alc880_pin_z71v_init_verbs },
1529                 .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
1530                 .dac_nids = alc880_z71v_dac_nids,
1531                 .dig_out_nid = ALC880_DIGOUT_NID,
1532                 .hp_nid = 0x03,
1533                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1534                 .channel_mode = alc880_2_jack_modes,
1535                 .input_mux = &alc880_capture_source,
1536         },
1537         [ALC880_F1734] = {
1538                 .mixers = { alc880_f1734_mixer },
1539                 .init_verbs = { alc880_volume_init_verbs,
1540                                 alc880_pin_f1734_init_verbs },
1541                 .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
1542                 .dac_nids = alc880_f1734_dac_nids,
1543                 .hp_nid = 0x02,
1544                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1545                 .channel_mode = alc880_2_jack_modes,
1546                 .input_mux = &alc880_f1734_capture_source,
1547                 .unsol_event = alc880_uniwill_p53_unsol_event,
1548                 .setup = alc880_uniwill_p53_setup,
1549                 .init_hook = alc_hp_automute,
1550         },
1551         [ALC880_ASUS] = {
1552                 .mixers = { alc880_asus_mixer },
1553                 .init_verbs = { alc880_volume_init_verbs,
1554                                 alc880_pin_asus_init_verbs,
1555                                 alc880_gpio1_init_verbs },
1556                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1557                 .dac_nids = alc880_asus_dac_nids,
1558                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1559                 .channel_mode = alc880_asus_modes,
1560                 .need_dac_fix = 1,
1561                 .input_mux = &alc880_capture_source,
1562         },
1563         [ALC880_ASUS_DIG] = {
1564                 .mixers = { alc880_asus_mixer },
1565                 .init_verbs = { alc880_volume_init_verbs,
1566                                 alc880_pin_asus_init_verbs,
1567                                 alc880_gpio1_init_verbs },
1568                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1569                 .dac_nids = alc880_asus_dac_nids,
1570                 .dig_out_nid = ALC880_DIGOUT_NID,
1571                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1572                 .channel_mode = alc880_asus_modes,
1573                 .need_dac_fix = 1,
1574                 .input_mux = &alc880_capture_source,
1575         },
1576         [ALC880_ASUS_DIG2] = {
1577                 .mixers = { alc880_asus_mixer },
1578                 .init_verbs = { alc880_volume_init_verbs,
1579                                 alc880_pin_asus_init_verbs,
1580                                 alc880_gpio2_init_verbs }, /* use GPIO2 */
1581                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1582                 .dac_nids = alc880_asus_dac_nids,
1583                 .dig_out_nid = ALC880_DIGOUT_NID,
1584                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1585                 .channel_mode = alc880_asus_modes,
1586                 .need_dac_fix = 1,
1587                 .input_mux = &alc880_capture_source,
1588         },
1589         [ALC880_ASUS_W1V] = {
1590                 .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
1591                 .init_verbs = { alc880_volume_init_verbs,
1592                                 alc880_pin_asus_init_verbs,
1593                                 alc880_gpio1_init_verbs },
1594                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1595                 .dac_nids = alc880_asus_dac_nids,
1596                 .dig_out_nid = ALC880_DIGOUT_NID,
1597                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1598                 .channel_mode = alc880_asus_modes,
1599                 .need_dac_fix = 1,
1600                 .input_mux = &alc880_capture_source,
1601         },
1602         [ALC880_UNIWILL_DIG] = {
1603                 .mixers = { alc880_asus_mixer },
1604                 .init_verbs = { alc880_volume_init_verbs,
1605                                 alc880_pin_asus_init_verbs },
1606                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1607                 .dac_nids = alc880_asus_dac_nids,
1608                 .dig_out_nid = ALC880_DIGOUT_NID,
1609                 .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
1610                 .channel_mode = alc880_asus_modes,
1611                 .need_dac_fix = 1,
1612                 .input_mux = &alc880_capture_source,
1613         },
1614         [ALC880_UNIWILL] = {
1615                 .mixers = { alc880_uniwill_mixer },
1616                 .init_verbs = { alc880_volume_init_verbs,
1617                                 alc880_uniwill_init_verbs },
1618                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1619                 .dac_nids = alc880_asus_dac_nids,
1620                 .dig_out_nid = ALC880_DIGOUT_NID,
1621                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1622                 .channel_mode = alc880_threestack_modes,
1623                 .need_dac_fix = 1,
1624                 .input_mux = &alc880_capture_source,
1625                 .unsol_event = alc880_uniwill_unsol_event,
1626                 .setup = alc880_uniwill_setup,
1627                 .init_hook = alc880_uniwill_init_hook,
1628         },
1629         [ALC880_UNIWILL_P53] = {
1630                 .mixers = { alc880_uniwill_p53_mixer },
1631                 .init_verbs = { alc880_volume_init_verbs,
1632                                 alc880_uniwill_p53_init_verbs },
1633                 .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
1634                 .dac_nids = alc880_asus_dac_nids,
1635                 .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
1636                 .channel_mode = alc880_threestack_modes,
1637                 .input_mux = &alc880_capture_source,
1638                 .unsol_event = alc880_uniwill_p53_unsol_event,
1639                 .setup = alc880_uniwill_p53_setup,
1640                 .init_hook = alc_hp_automute,
1641         },
1642         [ALC880_FUJITSU] = {
1643                 .mixers = { alc880_fujitsu_mixer },
1644                 .init_verbs = { alc880_volume_init_verbs,
1645                                 alc880_uniwill_p53_init_verbs,
1646                                 alc880_beep_init_verbs },
1647                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1648                 .dac_nids = alc880_dac_nids,
1649                 .dig_out_nid = ALC880_DIGOUT_NID,
1650                 .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
1651                 .channel_mode = alc880_2_jack_modes,
1652                 .input_mux = &alc880_capture_source,
1653                 .unsol_event = alc880_uniwill_p53_unsol_event,
1654                 .setup = alc880_uniwill_p53_setup,
1655                 .init_hook = alc_hp_automute,
1656         },
1657         [ALC880_CLEVO] = {
1658                 .mixers = { alc880_three_stack_mixer },
1659                 .init_verbs = { alc880_volume_init_verbs,
1660                                 alc880_pin_clevo_init_verbs },
1661                 .num_dacs = ARRAY_SIZE(alc880_dac_nids),
1662                 .dac_nids = alc880_dac_nids,
1663                 .hp_nid = 0x03,
1664                 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
1665                 .channel_mode = alc880_threestack_modes,
1666                 .need_dac_fix = 1,
1667                 .input_mux = &alc880_capture_source,
1668         },
1669         [ALC880_LG] = {
1670                 .mixers = { alc880_lg_mixer },
1671                 .init_verbs = { alc880_volume_init_verbs,
1672                                 alc880_lg_init_verbs },
1673                 .num_dacs = ARRAY_SIZE(alc880_lg_dac_nids),
1674                 .dac_nids = alc880_lg_dac_nids,
1675                 .dig_out_nid = ALC880_DIGOUT_NID,
1676                 .num_channel_mode = ARRAY_SIZE(alc880_lg_ch_modes),
1677                 .channel_mode = alc880_lg_ch_modes,
1678                 .need_dac_fix = 1,
1679                 .input_mux = &alc880_lg_capture_source,
1680                 .unsol_event = alc_sku_unsol_event,
1681                 .setup = alc880_lg_setup,
1682                 .init_hook = alc_hp_automute,
1683 #ifdef CONFIG_SND_HDA_POWER_SAVE
1684                 .loopbacks = alc880_lg_loopbacks,
1685 #endif
1686         },
1687 #ifdef CONFIG_SND_DEBUG
1688         [ALC880_TEST] = {
1689                 .mixers = { alc880_test_mixer },
1690                 .init_verbs = { alc880_test_init_verbs },
1691                 .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
1692                 .dac_nids = alc880_test_dac_nids,
1693                 .dig_out_nid = ALC880_DIGOUT_NID,
1694                 .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
1695                 .channel_mode = alc880_test_modes,
1696                 .input_mux = &alc880_test_capture_source,
1697         },
1698 #endif
1699 };
1700