]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - sound/pci/hda/alc882_quirks.c
ALSA: hda/realtek - Move ALC888 ASUS EEE1601 config to auto-parser
[mirror_ubuntu-bionic-kernel.git] / sound / pci / hda / alc882_quirks.c
1 /*
2 * ALC882/ALC883/ALC888/ALC889 quirk models
3 * included by patch_realtek.c
4 */
5
6 /* ALC882 models */
7 enum {
8 ALC882_AUTO,
9 ALC882_3ST_DIG,
10 ALC882_6ST_DIG,
11 ALC882_ARIMA,
12 ALC882_W2JC,
13 ALC882_TARGA,
14 ALC882_ASUS_A7J,
15 ALC882_ASUS_A7M,
16 ALC885_MACPRO,
17 ALC885_MBA21,
18 ALC885_MBP3,
19 ALC885_MB5,
20 ALC885_MACMINI3,
21 ALC885_IMAC24,
22 ALC885_IMAC91,
23 ALC883_3ST_2ch_DIG,
24 ALC883_3ST_6ch_DIG,
25 ALC883_3ST_6ch,
26 ALC883_6ST_DIG,
27 ALC883_TARGA_DIG,
28 ALC883_TARGA_2ch_DIG,
29 ALC883_TARGA_8ch_DIG,
30 ALC883_ACER,
31 ALC883_ACER_ASPIRE,
32 ALC888_ACER_ASPIRE_4930G,
33 ALC888_ACER_ASPIRE_6530G,
34 ALC888_ACER_ASPIRE_8930G,
35 ALC888_ACER_ASPIRE_7730G,
36 ALC883_MEDION,
37 ALC883_MEDION_WIM2160,
38 ALC883_LAPTOP_EAPD,
39 ALC883_LENOVO_101E_2ch,
40 ALC883_LENOVO_NB0763,
41 ALC888_LENOVO_MS7195_DIG,
42 ALC888_LENOVO_SKY,
43 ALC883_HAIER_W66,
44 ALC888_3ST_HP,
45 ALC888_6ST_DELL,
46 ALC883_MITAC,
47 ALC883_CLEVO_M540R,
48 ALC883_CLEVO_M720,
49 ALC883_FUJITSU_PI2515,
50 ALC888_FUJITSU_XA3530,
51 ALC883_3ST_6ch_INTEL,
52 ALC889A_INTEL,
53 ALC889_INTEL,
54 ALC888_ASUS_M90V,
55 ALC889A_MB31,
56 ALC882_MODEL_LAST,
57 };
58
59 /*
60 * 2ch mode
61 */
62 static const struct hda_verb alc888_4ST_ch2_intel_init[] = {
63 /* Mic-in jack as mic in */
64 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
65 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
66 /* Line-in jack as Line in */
67 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
68 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
69 /* Line-Out as Front */
70 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
71 { } /* end */
72 };
73
74 /*
75 * 4ch mode
76 */
77 static const struct hda_verb alc888_4ST_ch4_intel_init[] = {
78 /* Mic-in jack as mic in */
79 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
80 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
81 /* Line-in jack as Surround */
82 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
83 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
84 /* Line-Out as Front */
85 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
86 { } /* end */
87 };
88
89 /*
90 * 6ch mode
91 */
92 static const struct hda_verb alc888_4ST_ch6_intel_init[] = {
93 /* Mic-in jack as CLFE */
94 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
95 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
96 /* Line-in jack as Surround */
97 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
98 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
99 /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
100 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
101 { } /* end */
102 };
103
104 /*
105 * 8ch mode
106 */
107 static const struct hda_verb alc888_4ST_ch8_intel_init[] = {
108 /* Mic-in jack as CLFE */
109 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
110 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
111 /* Line-in jack as Surround */
112 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
113 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
114 /* Line-Out as Side */
115 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
116 { } /* end */
117 };
118
119 static const struct hda_channel_mode alc888_4ST_8ch_intel_modes[4] = {
120 { 2, alc888_4ST_ch2_intel_init },
121 { 4, alc888_4ST_ch4_intel_init },
122 { 6, alc888_4ST_ch6_intel_init },
123 { 8, alc888_4ST_ch8_intel_init },
124 };
125
126 /*
127 * ALC888 Fujitsu Siemens Amillo xa3530
128 */
129
130 static const struct hda_verb alc888_fujitsu_xa3530_verbs[] = {
131 /* Front Mic: set to PIN_IN (empty by default) */
132 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
133 /* Connect Internal HP to Front */
134 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
135 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
136 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
137 /* Connect Bass HP to Front */
138 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
139 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
140 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
141 /* Connect Line-Out side jack (SPDIF) to Side */
142 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
143 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
144 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
145 /* Connect Mic jack to CLFE */
146 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
147 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
148 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
149 /* Connect Line-in jack to Surround */
150 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
151 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
152 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
153 /* Connect HP out jack to Front */
154 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
155 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
156 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
157 /* Enable unsolicited event for HP jack and Line-out jack */
158 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
159 {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
160 {}
161 };
162
163 static void alc889_automute_setup(struct hda_codec *codec)
164 {
165 struct alc_spec *spec = codec->spec;
166
167 spec->autocfg.hp_pins[0] = 0x15;
168 spec->autocfg.speaker_pins[0] = 0x14;
169 spec->autocfg.speaker_pins[1] = 0x16;
170 spec->autocfg.speaker_pins[2] = 0x17;
171 spec->autocfg.speaker_pins[3] = 0x19;
172 spec->autocfg.speaker_pins[4] = 0x1a;
173 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
174 }
175
176 static void alc889_intel_init_hook(struct hda_codec *codec)
177 {
178 alc889_coef_init(codec);
179 alc_hp_automute(codec);
180 }
181
182 static void alc888_fujitsu_xa3530_setup(struct hda_codec *codec)
183 {
184 struct alc_spec *spec = codec->spec;
185
186 spec->autocfg.hp_pins[0] = 0x17; /* line-out */
187 spec->autocfg.hp_pins[1] = 0x1b; /* hp */
188 spec->autocfg.speaker_pins[0] = 0x14; /* speaker */
189 spec->autocfg.speaker_pins[1] = 0x15; /* bass */
190 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
191 }
192
193 /*
194 * ALC888 Acer Aspire 4930G model
195 */
196
197 static const struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
198 /* Front Mic: set to PIN_IN (empty by default) */
199 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
200 /* Unselect Front Mic by default in input mixer 3 */
201 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
202 /* Enable unsolicited event for HP jack */
203 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
204 /* Connect Internal HP to front */
205 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
206 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
207 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
208 /* Connect HP out to front */
209 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
210 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
211 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
212 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
213 { }
214 };
215
216 /*
217 * ALC888 Acer Aspire 6530G model
218 */
219
220 static const struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
221 /* Route to built-in subwoofer as well as speakers */
222 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
223 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
224 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
225 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
226 /* Bias voltage on for external mic port */
227 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
228 /* Front Mic: set to PIN_IN (empty by default) */
229 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
230 /* Unselect Front Mic by default in input mixer 3 */
231 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
232 /* Enable unsolicited event for HP jack */
233 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
234 /* Enable speaker output */
235 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
236 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
237 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
238 /* Enable headphone output */
239 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
240 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
241 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
242 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
243 { }
244 };
245
246 /*
247 *ALC888 Acer Aspire 7730G model
248 */
249
250 static const struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
251 /* Bias voltage on for external mic port */
252 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
253 /* Front Mic: set to PIN_IN (empty by default) */
254 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
255 /* Unselect Front Mic by default in input mixer 3 */
256 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
257 /* Enable unsolicited event for HP jack */
258 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
259 /* Enable speaker output */
260 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
261 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
262 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
263 /* Enable headphone output */
264 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
265 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
266 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
267 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
268 /*Enable internal subwoofer */
269 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
270 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
271 {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
272 {0x17, AC_VERB_SET_EAPD_BTLENABLE, 2},
273 { }
274 };
275
276 /*
277 * ALC889 Acer Aspire 8930G model
278 */
279
280 static const struct hda_verb alc889_acer_aspire_8930g_verbs[] = {
281 /* Front Mic: set to PIN_IN (empty by default) */
282 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
283 /* Unselect Front Mic by default in input mixer 3 */
284 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
285 /* Enable unsolicited event for HP jack */
286 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
287 /* Connect Internal Front to Front */
288 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
289 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
290 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
291 /* Connect Internal Rear to Rear */
292 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
293 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
294 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
295 /* Connect Internal CLFE to CLFE */
296 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
297 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
298 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
299 /* Connect HP out to Front */
300 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
301 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
302 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
303 /* Enable all DACs */
304 /* DAC DISABLE/MUTE 1? */
305 /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
306 {0x20, AC_VERB_SET_COEF_INDEX, 0x03},
307 {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
308 /* DAC DISABLE/MUTE 2? */
309 /* some bit here disables the other DACs. Init=0x4900 */
310 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
311 {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
312 /* DMIC fix
313 * This laptop has a stereo digital microphone. The mics are only 1cm apart
314 * which makes the stereo useless. However, either the mic or the ALC889
315 * makes the signal become a difference/sum signal instead of standard
316 * stereo, which is annoying. So instead we flip this bit which makes the
317 * codec replicate the sum signal to both channels, turning it into a
318 * normal mono mic.
319 */
320 /* DMIC_CONTROL? Init value = 0x0001 */
321 {0x20, AC_VERB_SET_COEF_INDEX, 0x0b},
322 {0x20, AC_VERB_SET_PROC_COEF, 0x0003},
323 { }
324 };
325
326 static const struct hda_input_mux alc888_2_capture_sources[2] = {
327 /* Front mic only available on one ADC */
328 {
329 .num_items = 4,
330 .items = {
331 { "Mic", 0x0 },
332 { "Line", 0x2 },
333 { "CD", 0x4 },
334 { "Front Mic", 0xb },
335 },
336 },
337 {
338 .num_items = 3,
339 .items = {
340 { "Mic", 0x0 },
341 { "Line", 0x2 },
342 { "CD", 0x4 },
343 },
344 }
345 };
346
347 static const struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
348 /* Interal mic only available on one ADC */
349 {
350 .num_items = 5,
351 .items = {
352 { "Mic", 0x0 },
353 { "Line In", 0x2 },
354 { "CD", 0x4 },
355 { "Input Mix", 0xa },
356 { "Internal Mic", 0xb },
357 },
358 },
359 {
360 .num_items = 4,
361 .items = {
362 { "Mic", 0x0 },
363 { "Line In", 0x2 },
364 { "CD", 0x4 },
365 { "Input Mix", 0xa },
366 },
367 }
368 };
369
370 static const struct hda_input_mux alc889_capture_sources[3] = {
371 /* Digital mic only available on first "ADC" */
372 {
373 .num_items = 5,
374 .items = {
375 { "Mic", 0x0 },
376 { "Line", 0x2 },
377 { "CD", 0x4 },
378 { "Front Mic", 0xb },
379 { "Input Mix", 0xa },
380 },
381 },
382 {
383 .num_items = 4,
384 .items = {
385 { "Mic", 0x0 },
386 { "Line", 0x2 },
387 { "CD", 0x4 },
388 { "Input Mix", 0xa },
389 },
390 },
391 {
392 .num_items = 4,
393 .items = {
394 { "Mic", 0x0 },
395 { "Line", 0x2 },
396 { "CD", 0x4 },
397 { "Input Mix", 0xa },
398 },
399 }
400 };
401
402 static const struct snd_kcontrol_new alc888_base_mixer[] = {
403 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
404 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
405 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
406 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
407 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
408 HDA_OUTPUT),
409 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
410 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
411 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
412 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
413 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
414 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
415 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
416 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
417 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
418 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
419 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
420 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
421 { } /* end */
422 };
423
424 static const struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
425 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
426 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
427 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
428 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
429 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
430 HDA_OUTPUT),
431 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
432 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
433 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
434 HDA_CODEC_VOLUME_MONO("Internal LFE Playback Volume", 0x0f, 1, 0x0, HDA_OUTPUT),
435 HDA_BIND_MUTE_MONO("Internal LFE Playback Switch", 0x0f, 1, 2, HDA_INPUT),
436 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
437 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
438 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
439 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
440 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
441 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
442 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
443 { } /* end */
444 };
445
446 static const struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = {
447 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
448 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
449 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
450 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
451 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
452 HDA_OUTPUT),
453 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
454 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
455 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
456 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
457 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
458 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
459 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
460 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
461 { } /* end */
462 };
463
464
465 static void alc888_acer_aspire_4930g_setup(struct hda_codec *codec)
466 {
467 struct alc_spec *spec = codec->spec;
468
469 spec->autocfg.hp_pins[0] = 0x15;
470 spec->autocfg.speaker_pins[0] = 0x14;
471 spec->autocfg.speaker_pins[1] = 0x16;
472 spec->autocfg.speaker_pins[2] = 0x17;
473 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
474 }
475
476 static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
477 {
478 struct alc_spec *spec = codec->spec;
479
480 spec->autocfg.hp_pins[0] = 0x15;
481 spec->autocfg.speaker_pins[0] = 0x14;
482 spec->autocfg.speaker_pins[1] = 0x16;
483 spec->autocfg.speaker_pins[2] = 0x17;
484 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
485 }
486
487 static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec)
488 {
489 struct alc_spec *spec = codec->spec;
490
491 spec->autocfg.hp_pins[0] = 0x15;
492 spec->autocfg.speaker_pins[0] = 0x14;
493 spec->autocfg.speaker_pins[1] = 0x16;
494 spec->autocfg.speaker_pins[2] = 0x17;
495 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
496 }
497
498 static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
499 {
500 struct alc_spec *spec = codec->spec;
501
502 spec->autocfg.hp_pins[0] = 0x15;
503 spec->autocfg.speaker_pins[0] = 0x14;
504 spec->autocfg.speaker_pins[1] = 0x16;
505 spec->autocfg.speaker_pins[2] = 0x1b;
506 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
507 }
508
509 #define ALC882_DIGOUT_NID 0x06
510 #define ALC882_DIGIN_NID 0x0a
511 #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
512 #define ALC883_DIGIN_NID ALC882_DIGIN_NID
513 #define ALC1200_DIGOUT_NID 0x10
514
515
516 static const struct hda_channel_mode alc882_ch_modes[1] = {
517 { 8, NULL }
518 };
519
520 /* DACs */
521 static const hda_nid_t alc882_dac_nids[4] = {
522 /* front, rear, clfe, rear_surr */
523 0x02, 0x03, 0x04, 0x05
524 };
525 #define alc883_dac_nids alc882_dac_nids
526
527 /* ADCs */
528 #define alc882_adc_nids alc880_adc_nids
529 #define alc882_adc_nids_alt alc880_adc_nids_alt
530 #define alc883_adc_nids alc882_adc_nids_alt
531 static const hda_nid_t alc883_adc_nids_alt[1] = { 0x08 };
532 static const hda_nid_t alc883_adc_nids_rev[2] = { 0x09, 0x08 };
533 #define alc889_adc_nids alc880_adc_nids
534
535 static const hda_nid_t alc882_capsrc_nids[3] = { 0x24, 0x23, 0x22 };
536 static const hda_nid_t alc882_capsrc_nids_alt[2] = { 0x23, 0x22 };
537 #define alc883_capsrc_nids alc882_capsrc_nids_alt
538 static const hda_nid_t alc883_capsrc_nids_rev[2] = { 0x22, 0x23 };
539 #define alc889_capsrc_nids alc882_capsrc_nids
540
541 /* input MUX */
542 /* FIXME: should be a matrix-type input source selection */
543
544 static const struct hda_input_mux alc882_capture_source = {
545 .num_items = 4,
546 .items = {
547 { "Mic", 0x0 },
548 { "Front Mic", 0x1 },
549 { "Line", 0x2 },
550 { "CD", 0x4 },
551 },
552 };
553
554 #define alc883_capture_source alc882_capture_source
555
556 static const struct hda_input_mux alc889_capture_source = {
557 .num_items = 3,
558 .items = {
559 { "Front Mic", 0x0 },
560 { "Mic", 0x3 },
561 { "Line", 0x2 },
562 },
563 };
564
565 static const struct hda_input_mux mb5_capture_source = {
566 .num_items = 3,
567 .items = {
568 { "Mic", 0x1 },
569 { "Line", 0x7 },
570 { "CD", 0x4 },
571 },
572 };
573
574 static const struct hda_input_mux macmini3_capture_source = {
575 .num_items = 2,
576 .items = {
577 { "Line", 0x2 },
578 { "CD", 0x4 },
579 },
580 };
581
582 static const struct hda_input_mux alc883_3stack_6ch_intel = {
583 .num_items = 4,
584 .items = {
585 { "Mic", 0x1 },
586 { "Front Mic", 0x0 },
587 { "Line", 0x2 },
588 { "CD", 0x4 },
589 },
590 };
591
592 static const struct hda_input_mux alc883_lenovo_101e_capture_source = {
593 .num_items = 2,
594 .items = {
595 { "Mic", 0x1 },
596 { "Line", 0x2 },
597 },
598 };
599
600 static const struct hda_input_mux alc883_lenovo_nb0763_capture_source = {
601 .num_items = 4,
602 .items = {
603 { "Mic", 0x0 },
604 { "Internal Mic", 0x1 },
605 { "Line", 0x2 },
606 { "CD", 0x4 },
607 },
608 };
609
610 static const struct hda_input_mux alc883_fujitsu_pi2515_capture_source = {
611 .num_items = 2,
612 .items = {
613 { "Mic", 0x0 },
614 { "Internal Mic", 0x1 },
615 },
616 };
617
618 static const struct hda_input_mux alc883_lenovo_sky_capture_source = {
619 .num_items = 3,
620 .items = {
621 { "Mic", 0x0 },
622 { "Front Mic", 0x1 },
623 { "Line", 0x4 },
624 },
625 };
626
627 static const struct hda_input_mux alc889A_mb31_capture_source = {
628 .num_items = 2,
629 .items = {
630 { "Mic", 0x0 },
631 /* Front Mic (0x01) unused */
632 { "Line", 0x2 },
633 /* Line 2 (0x03) unused */
634 /* CD (0x04) unused? */
635 },
636 };
637
638 static const struct hda_input_mux alc889A_imac91_capture_source = {
639 .num_items = 2,
640 .items = {
641 { "Mic", 0x01 },
642 { "Line", 0x2 }, /* Not sure! */
643 },
644 };
645
646 /*
647 * 2ch mode
648 */
649 static const struct hda_channel_mode alc883_3ST_2ch_modes[1] = {
650 { 2, NULL }
651 };
652
653 /*
654 * 2ch mode
655 */
656 static const struct hda_verb alc882_3ST_ch2_init[] = {
657 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
658 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
659 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
660 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
661 { } /* end */
662 };
663
664 /*
665 * 4ch mode
666 */
667 static const struct hda_verb alc882_3ST_ch4_init[] = {
668 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
669 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
670 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
671 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
672 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
673 { } /* end */
674 };
675
676 /*
677 * 6ch mode
678 */
679 static const struct hda_verb alc882_3ST_ch6_init[] = {
680 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
681 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
682 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
683 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
684 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
685 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
686 { } /* end */
687 };
688
689 static const struct hda_channel_mode alc882_3ST_6ch_modes[3] = {
690 { 2, alc882_3ST_ch2_init },
691 { 4, alc882_3ST_ch4_init },
692 { 6, alc882_3ST_ch6_init },
693 };
694
695 #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
696
697 /*
698 * 2ch mode
699 */
700 static const struct hda_verb alc883_3ST_ch2_clevo_init[] = {
701 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
702 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
703 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
704 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
705 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
706 { } /* end */
707 };
708
709 /*
710 * 4ch mode
711 */
712 static const struct hda_verb alc883_3ST_ch4_clevo_init[] = {
713 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
714 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
715 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
716 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
717 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
718 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
719 { } /* end */
720 };
721
722 /*
723 * 6ch mode
724 */
725 static const struct hda_verb alc883_3ST_ch6_clevo_init[] = {
726 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
727 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
728 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
729 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
730 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
731 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
732 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
733 { } /* end */
734 };
735
736 static const struct hda_channel_mode alc883_3ST_6ch_clevo_modes[3] = {
737 { 2, alc883_3ST_ch2_clevo_init },
738 { 4, alc883_3ST_ch4_clevo_init },
739 { 6, alc883_3ST_ch6_clevo_init },
740 };
741
742
743 /*
744 * 6ch mode
745 */
746 static const struct hda_verb alc882_sixstack_ch6_init[] = {
747 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
748 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
749 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
750 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
751 { } /* end */
752 };
753
754 /*
755 * 8ch mode
756 */
757 static const struct hda_verb alc882_sixstack_ch8_init[] = {
758 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
759 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
760 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
761 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
762 { } /* end */
763 };
764
765 static const struct hda_channel_mode alc882_sixstack_modes[2] = {
766 { 6, alc882_sixstack_ch6_init },
767 { 8, alc882_sixstack_ch8_init },
768 };
769
770
771 /* Macbook Air 2,1 */
772
773 static const struct hda_channel_mode alc885_mba21_ch_modes[1] = {
774 { 2, NULL },
775 };
776
777 /*
778 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
779 */
780
781 /*
782 * 2ch mode
783 */
784 static const struct hda_verb alc885_mbp_ch2_init[] = {
785 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
786 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
787 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
788 { } /* end */
789 };
790
791 /*
792 * 4ch mode
793 */
794 static const struct hda_verb alc885_mbp_ch4_init[] = {
795 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
796 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
797 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
798 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
799 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
800 { } /* end */
801 };
802
803 static const struct hda_channel_mode alc885_mbp_4ch_modes[2] = {
804 { 2, alc885_mbp_ch2_init },
805 { 4, alc885_mbp_ch4_init },
806 };
807
808 /*
809 * 2ch
810 * Speakers/Woofer/HP = Front
811 * LineIn = Input
812 */
813 static const struct hda_verb alc885_mb5_ch2_init[] = {
814 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
815 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
816 { } /* end */
817 };
818
819 /*
820 * 6ch mode
821 * Speakers/HP = Front
822 * Woofer = LFE
823 * LineIn = Surround
824 */
825 static const struct hda_verb alc885_mb5_ch6_init[] = {
826 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
827 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
828 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
829 { } /* end */
830 };
831
832 static const struct hda_channel_mode alc885_mb5_6ch_modes[2] = {
833 { 2, alc885_mb5_ch2_init },
834 { 6, alc885_mb5_ch6_init },
835 };
836
837 #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes
838
839 /*
840 * 2ch mode
841 */
842 static const struct hda_verb alc883_4ST_ch2_init[] = {
843 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
844 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
845 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
846 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
847 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
848 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
849 { } /* end */
850 };
851
852 /*
853 * 4ch mode
854 */
855 static const struct hda_verb alc883_4ST_ch4_init[] = {
856 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
857 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
858 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
859 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
860 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
861 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
862 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
863 { } /* end */
864 };
865
866 /*
867 * 6ch mode
868 */
869 static const struct hda_verb alc883_4ST_ch6_init[] = {
870 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
871 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
872 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
873 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
874 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
875 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
876 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
877 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
878 { } /* end */
879 };
880
881 /*
882 * 8ch mode
883 */
884 static const struct hda_verb alc883_4ST_ch8_init[] = {
885 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
886 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
887 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
888 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
889 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
890 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
891 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
892 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
893 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
894 { } /* end */
895 };
896
897 static const struct hda_channel_mode alc883_4ST_8ch_modes[4] = {
898 { 2, alc883_4ST_ch2_init },
899 { 4, alc883_4ST_ch4_init },
900 { 6, alc883_4ST_ch6_init },
901 { 8, alc883_4ST_ch8_init },
902 };
903
904
905 /*
906 * 2ch mode
907 */
908 static const struct hda_verb alc883_3ST_ch2_intel_init[] = {
909 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
910 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
911 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
912 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
913 { } /* end */
914 };
915
916 /*
917 * 4ch mode
918 */
919 static const struct hda_verb alc883_3ST_ch4_intel_init[] = {
920 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
921 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
922 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
923 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
924 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
925 { } /* end */
926 };
927
928 /*
929 * 6ch mode
930 */
931 static const struct hda_verb alc883_3ST_ch6_intel_init[] = {
932 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
933 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
934 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x02 },
935 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
936 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
937 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
938 { } /* end */
939 };
940
941 static const struct hda_channel_mode alc883_3ST_6ch_intel_modes[3] = {
942 { 2, alc883_3ST_ch2_intel_init },
943 { 4, alc883_3ST_ch4_intel_init },
944 { 6, alc883_3ST_ch6_intel_init },
945 };
946
947 /*
948 * 2ch mode
949 */
950 static const struct hda_verb alc889_ch2_intel_init[] = {
951 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
952 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x00 },
953 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x00 },
954 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00 },
955 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
956 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
957 { } /* end */
958 };
959
960 /*
961 * 6ch mode
962 */
963 static const struct hda_verb alc889_ch6_intel_init[] = {
964 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
965 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
966 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
967 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
968 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
969 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
970 { } /* end */
971 };
972
973 /*
974 * 8ch mode
975 */
976 static const struct hda_verb alc889_ch8_intel_init[] = {
977 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
978 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
979 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
980 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
981 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x03 },
982 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
983 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
984 { } /* end */
985 };
986
987 static const struct hda_channel_mode alc889_8ch_intel_modes[3] = {
988 { 2, alc889_ch2_intel_init },
989 { 6, alc889_ch6_intel_init },
990 { 8, alc889_ch8_intel_init },
991 };
992
993 /*
994 * 6ch mode
995 */
996 static const struct hda_verb alc883_sixstack_ch6_init[] = {
997 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
998 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
999 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1000 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1001 { } /* end */
1002 };
1003
1004 /*
1005 * 8ch mode
1006 */
1007 static const struct hda_verb alc883_sixstack_ch8_init[] = {
1008 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1009 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1010 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1011 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
1012 { } /* end */
1013 };
1014
1015 static const struct hda_channel_mode alc883_sixstack_modes[2] = {
1016 { 6, alc883_sixstack_ch6_init },
1017 { 8, alc883_sixstack_ch8_init },
1018 };
1019
1020
1021 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
1022 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
1023 */
1024 static const struct snd_kcontrol_new alc882_base_mixer[] = {
1025 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1026 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1027 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1028 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1029 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1030 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1031 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1032 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1033 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1034 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1035 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1036 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1037 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1038 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1039 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1040 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1041 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1042 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1043 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1044 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1045 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1046 { } /* end */
1047 };
1048
1049 /* Macbook Air 2,1 same control for HP and internal Speaker */
1050
1051 static const struct snd_kcontrol_new alc885_mba21_mixer[] = {
1052 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1053 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
1054 { }
1055 };
1056
1057
1058 static const struct snd_kcontrol_new alc885_mbp3_mixer[] = {
1059 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1060 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
1061 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
1062 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT),
1063 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
1064 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1065 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1066 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
1067 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
1068 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
1069 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
1070 { } /* end */
1071 };
1072
1073 static const struct snd_kcontrol_new alc885_mb5_mixer[] = {
1074 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1075 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
1076 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
1077 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
1078 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
1079 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
1080 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
1081 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
1082 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
1083 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
1084 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
1085 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
1086 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
1087 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0x00, HDA_INPUT),
1088 { } /* end */
1089 };
1090
1091 static const struct snd_kcontrol_new alc885_macmini3_mixer[] = {
1092 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1093 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
1094 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
1095 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
1096 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
1097 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
1098 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
1099 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
1100 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
1101 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
1102 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
1103 { } /* end */
1104 };
1105
1106 static const struct snd_kcontrol_new alc885_imac91_mixer[] = {
1107 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1108 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
1109 { } /* end */
1110 };
1111
1112
1113 static const struct snd_kcontrol_new alc882_w2jc_mixer[] = {
1114 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1115 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1116 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1117 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1118 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1119 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1120 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1121 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1122 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1123 { } /* end */
1124 };
1125
1126 static const struct snd_kcontrol_new alc882_targa_mixer[] = {
1127 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1128 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1129 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1130 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1131 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1132 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1133 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1134 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1135 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1136 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1137 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1138 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1139 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1140 { } /* end */
1141 };
1142
1143 /* Pin assignment: Front=0x14, HP = 0x15, Front = 0x16, ???
1144 * Front Mic=0x18, Line In = 0x1a, Line In = 0x1b, CD = 0x1c
1145 */
1146 static const struct snd_kcontrol_new alc882_asus_a7j_mixer[] = {
1147 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1148 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
1149 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1150 HDA_CODEC_MUTE("Mobile Front Playback Switch", 0x16, 0x0, HDA_OUTPUT),
1151 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1152 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1153 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1154 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1155 HDA_CODEC_VOLUME("Mobile Line Playback Volume", 0x0b, 0x03, HDA_INPUT),
1156 HDA_CODEC_MUTE("Mobile Line Playback Switch", 0x0b, 0x03, HDA_INPUT),
1157 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1158 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1159 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1160 { } /* end */
1161 };
1162
1163 static const struct snd_kcontrol_new alc882_asus_a7m_mixer[] = {
1164 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1165 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1166 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1167 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1168 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1169 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1170 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1171 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1172 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1173 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1174 { } /* end */
1175 };
1176
1177 static const struct snd_kcontrol_new alc882_chmode_mixer[] = {
1178 {
1179 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1180 .name = "Channel Mode",
1181 .info = alc_ch_mode_info,
1182 .get = alc_ch_mode_get,
1183 .put = alc_ch_mode_put,
1184 },
1185 { } /* end */
1186 };
1187
1188 static const struct hda_verb alc882_base_init_verbs[] = {
1189 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1190 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1191 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1192 /* Rear mixer */
1193 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1194 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1195 /* CLFE mixer */
1196 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1197 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1198 /* Side mixer */
1199 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1200 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1201
1202 /* Front Pin: output 0 (0x0c) */
1203 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1204 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1205 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1206 /* Rear Pin: output 1 (0x0d) */
1207 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1208 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1209 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
1210 /* CLFE Pin: output 2 (0x0e) */
1211 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1212 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1213 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
1214 /* Side Pin: output 3 (0x0f) */
1215 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1216 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1217 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1218 /* Mic (rear) pin: input vref at 80% */
1219 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1220 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1221 /* Front Mic pin: input vref at 80% */
1222 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1223 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1224 /* Line In pin: input */
1225 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1226 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1227 /* Line-2 In: Headphone output (output 0 - 0x0c) */
1228 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1229 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1230 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
1231 /* CD pin widget for input */
1232 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1233
1234 /* FIXME: use matrix-type input source selection */
1235 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1236 /* Input mixer2 */
1237 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1238 /* Input mixer3 */
1239 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1240 /* ADC2: mute amp left and right */
1241 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1242 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1243 /* ADC3: mute amp left and right */
1244 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1245 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1246
1247 { }
1248 };
1249
1250 static const struct hda_verb alc882_adc1_init_verbs[] = {
1251 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1252 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1253 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1254 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1255 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1256 /* ADC1: mute amp left and right */
1257 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1258 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1259 { }
1260 };
1261
1262 static const struct hda_verb alc882_eapd_verbs[] = {
1263 /* change to EAPD mode */
1264 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
1265 {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
1266 { }
1267 };
1268
1269 static const struct hda_verb alc889_eapd_verbs[] = {
1270 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
1271 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
1272 { }
1273 };
1274
1275 static const struct hda_verb alc_hp15_unsol_verbs[] = {
1276 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
1277 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1278 {}
1279 };
1280
1281 static const struct hda_verb alc885_init_verbs[] = {
1282 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1283 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1284 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1285 /* Rear mixer */
1286 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1287 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1288 /* CLFE mixer */
1289 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1290 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1291 /* Side mixer */
1292 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1293 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1294
1295 /* Front HP Pin: output 0 (0x0c) */
1296 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1297 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1298 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1299 /* Front Pin: output 0 (0x0c) */
1300 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1301 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1302 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1303 /* Rear Pin: output 1 (0x0d) */
1304 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1305 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1306 {0x19, AC_VERB_SET_CONNECT_SEL, 0x01},
1307 /* CLFE Pin: output 2 (0x0e) */
1308 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1309 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1310 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
1311 /* Side Pin: output 3 (0x0f) */
1312 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1313 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1314 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1315 /* Mic (rear) pin: input vref at 80% */
1316 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1317 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1318 /* Front Mic pin: input vref at 80% */
1319 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1320 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1321 /* Line In pin: input */
1322 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1323 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1324
1325 /* Mixer elements: 0x18, , 0x1a, 0x1b */
1326 /* Input mixer1 */
1327 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1328 /* Input mixer2 */
1329 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1330 /* Input mixer3 */
1331 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1332 /* ADC2: mute amp left and right */
1333 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1334 /* ADC3: mute amp left and right */
1335 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1336
1337 { }
1338 };
1339
1340 static const struct hda_verb alc885_init_input_verbs[] = {
1341 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1342 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
1343 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
1344 { }
1345 };
1346
1347
1348 /* Unmute Selector 24h and set the default input to front mic */
1349 static const struct hda_verb alc889_init_input_verbs[] = {
1350 {0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
1351 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1352 { }
1353 };
1354
1355
1356 #define alc883_init_verbs alc882_base_init_verbs
1357
1358 /* Mac Pro test */
1359 static const struct snd_kcontrol_new alc882_macpro_mixer[] = {
1360 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1361 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1362 HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT),
1363 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
1364 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
1365 /* FIXME: this looks suspicious...
1366 HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
1367 HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
1368 */
1369 { } /* end */
1370 };
1371
1372 static const struct hda_verb alc882_macpro_init_verbs[] = {
1373 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1374 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1375 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1376 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1377 /* Front Pin: output 0 (0x0c) */
1378 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1379 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1380 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1381 /* Front Mic pin: input vref at 80% */
1382 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1383 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1384 /* Speaker: output */
1385 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1386 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1387 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x04},
1388 /* Headphone output (output 0 - 0x0c) */
1389 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1390 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1391 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1392
1393 /* FIXME: use matrix-type input source selection */
1394 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1395 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1396 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1397 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1398 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1399 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1400 /* Input mixer2 */
1401 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1402 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1403 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1404 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1405 /* Input mixer3 */
1406 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1407 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1408 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1409 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1410 /* ADC1: mute amp left and right */
1411 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1412 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1413 /* ADC2: mute amp left and right */
1414 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1415 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1416 /* ADC3: mute amp left and right */
1417 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1418 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1419
1420 { }
1421 };
1422
1423 /* Macbook 5,1 */
1424 static const struct hda_verb alc885_mb5_init_verbs[] = {
1425 /* DACs */
1426 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1427 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1428 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1429 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1430 /* Front mixer */
1431 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1432 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1433 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1434 /* Surround mixer */
1435 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1436 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1437 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1438 /* LFE mixer */
1439 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1440 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1441 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1442 /* HP mixer */
1443 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1444 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1445 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1446 /* Front Pin (0x0c) */
1447 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1448 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1449 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1450 /* LFE Pin (0x0e) */
1451 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1452 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1453 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
1454 /* HP Pin (0x0f) */
1455 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1456 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1457 {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
1458 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1459 /* Front Mic pin: input vref at 80% */
1460 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1461 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1462 /* Line In pin */
1463 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1464 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1465
1466 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0x1)},
1467 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x7)},
1468 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x4)},
1469 { }
1470 };
1471
1472 /* Macmini 3,1 */
1473 static const struct hda_verb alc885_macmini3_init_verbs[] = {
1474 /* DACs */
1475 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1476 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1477 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1478 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1479 /* Front mixer */
1480 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1481 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1482 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1483 /* Surround mixer */
1484 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1485 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1486 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1487 /* LFE mixer */
1488 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1489 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1490 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1491 /* HP mixer */
1492 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1493 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1494 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1495 /* Front Pin (0x0c) */
1496 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1497 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1498 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1499 /* LFE Pin (0x0e) */
1500 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1501 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1502 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
1503 /* HP Pin (0x0f) */
1504 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1505 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1506 {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
1507 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1508 /* Line In pin */
1509 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1510 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1511
1512 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1513 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1514 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1515 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1516 { }
1517 };
1518
1519
1520 static const struct hda_verb alc885_mba21_init_verbs[] = {
1521 /*Internal and HP Speaker Mixer*/
1522 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1523 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1524 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1525 /*Internal Speaker Pin (0x0c)*/
1526 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1527 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1528 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1529 /* HP Pin: output 0 (0x0e) */
1530 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
1531 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1532 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1533 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
1534 /* Line in (is hp when jack connected)*/
1535 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
1536 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1537
1538 { }
1539 };
1540
1541
1542 /* Macbook Pro rev3 */
1543 static const struct hda_verb alc885_mbp3_init_verbs[] = {
1544 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1545 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1546 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1547 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1548 /* Rear mixer */
1549 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1550 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1551 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1552 /* HP mixer */
1553 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1554 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1555 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1556 /* Front Pin: output 0 (0x0c) */
1557 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1558 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1559 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1560 /* HP Pin: output 0 (0x0e) */
1561 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
1562 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1563 {0x15, AC_VERB_SET_CONNECT_SEL, 0x02},
1564 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1565 /* Mic (rear) pin: input vref at 80% */
1566 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1567 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1568 /* Front Mic pin: input vref at 80% */
1569 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1570 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1571 /* Line In pin: use output 1 when in LineOut mode */
1572 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1573 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1574 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
1575
1576 /* FIXME: use matrix-type input source selection */
1577 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1578 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1579 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1580 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1581 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1582 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1583 /* Input mixer2 */
1584 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1585 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1586 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1587 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1588 /* Input mixer3 */
1589 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1590 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1591 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1592 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1593 /* ADC1: mute amp left and right */
1594 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1595 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1596 /* ADC2: mute amp left and right */
1597 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1598 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1599 /* ADC3: mute amp left and right */
1600 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1601 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1602
1603 { }
1604 };
1605
1606 /* iMac 9,1 */
1607 static const struct hda_verb alc885_imac91_init_verbs[] = {
1608 /* Internal Speaker Pin (0x0c) */
1609 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1610 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1611 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1612 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1613 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1614 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
1615 /* HP Pin: Rear */
1616 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1617 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1618 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1619 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
1620 /* Line in Rear */
1621 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
1622 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1623 /* Front Mic pin: input vref at 80% */
1624 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1625 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1626 /* Rear mixer */
1627 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1628 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1629 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1630 /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
1631 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1632 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1633 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1634 /* 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1635 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1636 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1637 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1638 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1639 /* 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1640 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1641 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1642 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1643 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1644 /* 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1645 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1646 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1647 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1648 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1649 /* 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1650 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1651 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1652 /* 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1653 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1654 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1655 /* 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1656 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1657 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1658 { }
1659 };
1660
1661 /* iMac 24 mixer. */
1662 static const struct snd_kcontrol_new alc885_imac24_mixer[] = {
1663 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1664 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT),
1665 { } /* end */
1666 };
1667
1668 /* iMac 24 init verbs. */
1669 static const struct hda_verb alc885_imac24_init_verbs[] = {
1670 /* Internal speakers: output 0 (0x0c) */
1671 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1672 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1673 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1674 /* Internal speakers: output 0 (0x0c) */
1675 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1676 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1677 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
1678 /* Headphone: output 0 (0x0c) */
1679 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1680 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1681 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1682 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1683 /* Front Mic: input vref at 80% */
1684 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1685 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1686 { }
1687 };
1688
1689 /* Toggle speaker-output according to the hp-jack state */
1690 static void alc885_imac24_setup(struct hda_codec *codec)
1691 {
1692 struct alc_spec *spec = codec->spec;
1693
1694 spec->autocfg.hp_pins[0] = 0x14;
1695 spec->autocfg.speaker_pins[0] = 0x18;
1696 spec->autocfg.speaker_pins[1] = 0x1a;
1697 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1698 }
1699
1700 #define alc885_mb5_setup alc885_imac24_setup
1701 #define alc885_macmini3_setup alc885_imac24_setup
1702
1703 /* Macbook Air 2,1 */
1704 static void alc885_mba21_setup(struct hda_codec *codec)
1705 {
1706 struct alc_spec *spec = codec->spec;
1707
1708 spec->autocfg.hp_pins[0] = 0x14;
1709 spec->autocfg.speaker_pins[0] = 0x18;
1710 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1711 }
1712
1713
1714
1715 static void alc885_mbp3_setup(struct hda_codec *codec)
1716 {
1717 struct alc_spec *spec = codec->spec;
1718
1719 spec->autocfg.hp_pins[0] = 0x15;
1720 spec->autocfg.speaker_pins[0] = 0x14;
1721 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1722 }
1723
1724 static void alc885_imac91_setup(struct hda_codec *codec)
1725 {
1726 struct alc_spec *spec = codec->spec;
1727
1728 spec->autocfg.hp_pins[0] = 0x14;
1729 spec->autocfg.speaker_pins[0] = 0x18;
1730 spec->autocfg.speaker_pins[1] = 0x1a;
1731 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1732 }
1733
1734 static const struct hda_verb alc882_targa_verbs[] = {
1735 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1736 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1737
1738 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1739 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1740
1741 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
1742 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
1743 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1744
1745 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1746 { } /* end */
1747 };
1748
1749 /* toggle speaker-output according to the hp-jack state */
1750 static void alc882_targa_automute(struct hda_codec *codec)
1751 {
1752 struct alc_spec *spec = codec->spec;
1753 alc_hp_automute(codec);
1754 snd_hda_codec_write_cache(codec, 1, 0, AC_VERB_SET_GPIO_DATA,
1755 spec->hp_jack_present ? 1 : 3);
1756 }
1757
1758 static void alc882_targa_setup(struct hda_codec *codec)
1759 {
1760 struct alc_spec *spec = codec->spec;
1761
1762 spec->autocfg.hp_pins[0] = 0x14;
1763 spec->autocfg.speaker_pins[0] = 0x1b;
1764 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1765 }
1766
1767 static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res)
1768 {
1769 if ((res >> 26) == ALC_HP_EVENT)
1770 alc882_targa_automute(codec);
1771 }
1772
1773 static const struct hda_verb alc882_asus_a7j_verbs[] = {
1774 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1775 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1776
1777 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1778 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1779 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1780
1781 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
1782 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1783 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
1784
1785 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
1786 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
1787 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1788 { } /* end */
1789 };
1790
1791 static const struct hda_verb alc882_asus_a7m_verbs[] = {
1792 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1793 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1794
1795 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1796 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1797 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1798
1799 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
1800 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1801 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front */
1802
1803 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
1804 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
1805 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1806 { } /* end */
1807 };
1808
1809 static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
1810 {
1811 unsigned int gpiostate, gpiomask, gpiodir;
1812
1813 gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
1814 AC_VERB_GET_GPIO_DATA, 0);
1815
1816 if (!muted)
1817 gpiostate |= (1 << pin);
1818 else
1819 gpiostate &= ~(1 << pin);
1820
1821 gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
1822 AC_VERB_GET_GPIO_MASK, 0);
1823 gpiomask |= (1 << pin);
1824
1825 gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
1826 AC_VERB_GET_GPIO_DIRECTION, 0);
1827 gpiodir |= (1 << pin);
1828
1829
1830 snd_hda_codec_write(codec, codec->afg, 0,
1831 AC_VERB_SET_GPIO_MASK, gpiomask);
1832 snd_hda_codec_write(codec, codec->afg, 0,
1833 AC_VERB_SET_GPIO_DIRECTION, gpiodir);
1834
1835 msleep(1);
1836
1837 snd_hda_codec_write(codec, codec->afg, 0,
1838 AC_VERB_SET_GPIO_DATA, gpiostate);
1839 }
1840
1841 /* set up GPIO at initialization */
1842 static void alc885_macpro_init_hook(struct hda_codec *codec)
1843 {
1844 alc882_gpio_mute(codec, 0, 0);
1845 alc882_gpio_mute(codec, 1, 0);
1846 }
1847
1848 /* set up GPIO and update auto-muting at initialization */
1849 static void alc885_imac24_init_hook(struct hda_codec *codec)
1850 {
1851 alc885_macpro_init_hook(codec);
1852 alc_hp_automute(codec);
1853 }
1854
1855 /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
1856 static const struct hda_verb alc889A_mb31_ch2_init[] = {
1857 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
1858 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
1859 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
1860 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
1861 { } /* end */
1862 };
1863
1864 /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
1865 static const struct hda_verb alc889A_mb31_ch4_init[] = {
1866 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
1867 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
1868 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
1869 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
1870 { } /* end */
1871 };
1872
1873 /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
1874 static const struct hda_verb alc889A_mb31_ch5_init[] = {
1875 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as rear */
1876 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
1877 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
1878 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
1879 { } /* end */
1880 };
1881
1882 /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
1883 static const struct hda_verb alc889A_mb31_ch6_init[] = {
1884 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as front */
1885 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Subwoofer off */
1886 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
1887 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
1888 { } /* end */
1889 };
1890
1891 static const struct hda_channel_mode alc889A_mb31_6ch_modes[4] = {
1892 { 2, alc889A_mb31_ch2_init },
1893 { 4, alc889A_mb31_ch4_init },
1894 { 5, alc889A_mb31_ch5_init },
1895 { 6, alc889A_mb31_ch6_init },
1896 };
1897
1898 static const struct hda_verb alc883_medion_eapd_verbs[] = {
1899 /* eanable EAPD on medion laptop */
1900 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
1901 {0x20, AC_VERB_SET_PROC_COEF, 0x3070},
1902 { }
1903 };
1904
1905 #define alc883_base_mixer alc882_base_mixer
1906
1907 static const struct snd_kcontrol_new alc883_mitac_mixer[] = {
1908 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1909 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1910 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1911 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1912 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1913 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1914 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1915 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1916 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1917 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1918 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1919 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1920 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1921 { } /* end */
1922 };
1923
1924 static const struct snd_kcontrol_new alc883_clevo_m720_mixer[] = {
1925 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1926 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
1927 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1928 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
1929 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1930 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1931 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1932 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1933 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
1934 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1935 { } /* end */
1936 };
1937
1938 static const struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer[] = {
1939 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1940 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
1941 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1942 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
1943 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1944 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1945 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1946 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1947 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
1948 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1949 { } /* end */
1950 };
1951
1952 static const struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
1953 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1954 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1955 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1956 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1957 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1958 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1959 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1960 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1961 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1962 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1963 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1964 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1965 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1966 { } /* end */
1967 };
1968
1969 static const struct snd_kcontrol_new alc883_3ST_6ch_mixer[] = {
1970 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1971 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1972 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1973 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1974 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1975 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1976 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1977 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1978 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1979 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1980 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1981 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1982 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1983 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1984 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1985 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1986 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1987 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1988 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1989 { } /* end */
1990 };
1991
1992 static const struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer[] = {
1993 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1994 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1995 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1996 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1997 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1998 HDA_OUTPUT),
1999 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2000 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2001 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2002 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
2003 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2004 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2005 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2006 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2007 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2008 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT),
2009 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2010 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2011 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
2012 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2013 { } /* end */
2014 };
2015
2016 static const struct snd_kcontrol_new alc885_8ch_intel_mixer[] = {
2017 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2018 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2019 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2020 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2021 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
2022 HDA_OUTPUT),
2023 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2024 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2025 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2026 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2027 HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT),
2028 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
2029 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2030 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2031 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
2032 HDA_CODEC_VOLUME("Mic Boost Volume", 0x1b, 0, HDA_INPUT),
2033 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
2034 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2035 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
2036 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2037 { } /* end */
2038 };
2039
2040 static const struct snd_kcontrol_new alc883_fivestack_mixer[] = {
2041 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2042 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2043 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2044 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2045 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2046 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2047 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2048 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2049 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2050 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2051 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2052 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2053 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2054 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2055 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2056 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2057 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2058 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
2059 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2060 { } /* end */
2061 };
2062
2063 static const struct snd_kcontrol_new alc883_targa_mixer[] = {
2064 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2065 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2066 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
2067 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2068 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2069 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
2070 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2071 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
2072 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
2073 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
2074 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2075 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2076 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2077 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2078 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2079 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2080 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2081 { } /* end */
2082 };
2083
2084 static const struct snd_kcontrol_new alc883_targa_2ch_mixer[] = {
2085 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2086 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2087 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
2088 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2089 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2090 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2091 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2092 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2093 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2094 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2095 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
2096 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2097 { } /* end */
2098 };
2099
2100 static const struct snd_kcontrol_new alc883_targa_8ch_mixer[] = {
2101 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2102 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
2103 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2104 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
2105 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2106 { } /* end */
2107 };
2108
2109 static const struct snd_kcontrol_new alc883_lenovo_101e_2ch_mixer[] = {
2110 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2111 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2112 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2113 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
2114 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
2115 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2116 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2117 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2118 { } /* end */
2119 };
2120
2121 static const struct snd_kcontrol_new alc883_lenovo_nb0763_mixer[] = {
2122 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2123 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 2, HDA_INPUT),
2124 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
2125 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2126 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2127 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2128 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2129 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2130 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2131 { } /* end */
2132 };
2133
2134 static const struct snd_kcontrol_new alc883_medion_wim2160_mixer[] = {
2135 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2136 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2137 HDA_CODEC_MUTE("Speaker Playback Switch", 0x15, 0x0, HDA_OUTPUT),
2138 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT),
2139 HDA_CODEC_VOLUME("Line Playback Volume", 0x08, 0x0, HDA_INPUT),
2140 HDA_CODEC_MUTE("Line Playback Switch", 0x08, 0x0, HDA_INPUT),
2141 { } /* end */
2142 };
2143
2144 static const struct hda_verb alc883_medion_wim2160_verbs[] = {
2145 /* Unmute front mixer */
2146 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2147 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2148
2149 /* Set speaker pin to front mixer */
2150 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2151
2152 /* Init headphone pin */
2153 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2154 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2155 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
2156 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2157
2158 { } /* end */
2159 };
2160
2161 /* toggle speaker-output according to the hp-jack state */
2162 static void alc883_medion_wim2160_setup(struct hda_codec *codec)
2163 {
2164 struct alc_spec *spec = codec->spec;
2165
2166 spec->autocfg.hp_pins[0] = 0x1a;
2167 spec->autocfg.speaker_pins[0] = 0x15;
2168 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2169 }
2170
2171 static const struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
2172 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2173 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2174 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
2175 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2176 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2177 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2178 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2179 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2180 { } /* end */
2181 };
2182
2183 static const struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
2184 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2185 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2186 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2187 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2188 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2189 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2190 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2191 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2192 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2193 { } /* end */
2194 };
2195
2196 static const struct snd_kcontrol_new alc888_lenovo_sky_mixer[] = {
2197 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
2198 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
2199 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
2200 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT),
2201 HDA_CODEC_VOLUME_MONO("Center Playback Volume",
2202 0x0d, 1, 0x0, HDA_OUTPUT),
2203 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
2204 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
2205 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
2206 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
2207 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
2208 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
2209 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
2210 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2211 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2212 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2213 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
2214 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2215 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
2216 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
2217 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
2218 { } /* end */
2219 };
2220
2221 static const struct snd_kcontrol_new alc889A_mb31_mixer[] = {
2222 /* Output mixers */
2223 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
2224 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
2225 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
2226 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
2227 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
2228 HDA_OUTPUT),
2229 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT),
2230 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT),
2231 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT),
2232 /* Output switches */
2233 HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT),
2234 HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT),
2235 HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT),
2236 /* Boost mixers */
2237 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
2238 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
2239 /* Input mixers */
2240 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
2241 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
2242 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
2243 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
2244 { } /* end */
2245 };
2246
2247 static const struct hda_bind_ctls alc883_bind_cap_vol = {
2248 .ops = &snd_hda_bind_vol,
2249 .values = {
2250 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
2251 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
2252 0
2253 },
2254 };
2255
2256 static const struct hda_bind_ctls alc883_bind_cap_switch = {
2257 .ops = &snd_hda_bind_sw,
2258 .values = {
2259 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
2260 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
2261 0
2262 },
2263 };
2264
2265 static const struct snd_kcontrol_new alc883_chmode_mixer[] = {
2266 {
2267 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2268 .name = "Channel Mode",
2269 .info = alc_ch_mode_info,
2270 .get = alc_ch_mode_get,
2271 .put = alc_ch_mode_put,
2272 },
2273 { } /* end */
2274 };
2275
2276 /* toggle speaker-output according to the hp-jack state */
2277 static void alc883_mitac_setup(struct hda_codec *codec)
2278 {
2279 struct alc_spec *spec = codec->spec;
2280
2281 spec->autocfg.hp_pins[0] = 0x15;
2282 spec->autocfg.speaker_pins[0] = 0x14;
2283 spec->autocfg.speaker_pins[1] = 0x17;
2284 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2285 }
2286
2287 static const struct hda_verb alc883_mitac_verbs[] = {
2288 /* HP */
2289 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2290 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2291 /* Subwoofer */
2292 {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
2293 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2294
2295 /* enable unsolicited event */
2296 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2297 /* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN}, */
2298
2299 { } /* end */
2300 };
2301
2302 static const struct hda_verb alc883_clevo_m540r_verbs[] = {
2303 /* HP */
2304 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2305 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2306 /* Int speaker */
2307 /*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
2308
2309 /* enable unsolicited event */
2310 /*
2311 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2312 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
2313 */
2314
2315 { } /* end */
2316 };
2317
2318 static const struct hda_verb alc883_clevo_m720_verbs[] = {
2319 /* HP */
2320 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2321 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2322 /* Int speaker */
2323 {0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
2324 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2325
2326 /* enable unsolicited event */
2327 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2328 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
2329
2330 { } /* end */
2331 };
2332
2333 static const struct hda_verb alc883_2ch_fujitsu_pi2515_verbs[] = {
2334 /* HP */
2335 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
2336 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2337 /* Subwoofer */
2338 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
2339 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2340
2341 /* enable unsolicited event */
2342 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2343
2344 { } /* end */
2345 };
2346
2347 static const struct hda_verb alc883_targa_verbs[] = {
2348 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2349 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2350
2351 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2352 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2353
2354 /* Connect Line-Out side jack (SPDIF) to Side */
2355 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2356 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2357 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
2358 /* Connect Mic jack to CLFE */
2359 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2360 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2361 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
2362 /* Connect Line-in jack to Surround */
2363 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2364 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2365 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
2366 /* Connect HP out jack to Front */
2367 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2368 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2369 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
2370
2371 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2372
2373 { } /* end */
2374 };
2375
2376 static const struct hda_verb alc883_lenovo_101e_verbs[] = {
2377 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2378 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_FRONT_EVENT|AC_USRSP_EN},
2379 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT|AC_USRSP_EN},
2380 { } /* end */
2381 };
2382
2383 static const struct hda_verb alc883_lenovo_nb0763_verbs[] = {
2384 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2385 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2386 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2387 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2388 { } /* end */
2389 };
2390
2391 static const struct hda_verb alc888_lenovo_ms7195_verbs[] = {
2392 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2393 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2394 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2395 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_FRONT_EVENT | AC_USRSP_EN},
2396 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2397 { } /* end */
2398 };
2399
2400 static const struct hda_verb alc883_haier_w66_verbs[] = {
2401 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2402 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2403
2404 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2405
2406 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
2407 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2408 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2409 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2410 { } /* end */
2411 };
2412
2413 static const struct hda_verb alc888_lenovo_sky_verbs[] = {
2414 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2415 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2416 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2417 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2418 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2419 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2420 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
2421 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2422 { } /* end */
2423 };
2424
2425 static const struct hda_verb alc888_6st_dell_verbs[] = {
2426 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2427 { }
2428 };
2429
2430 static void alc888_3st_hp_setup(struct hda_codec *codec)
2431 {
2432 struct alc_spec *spec = codec->spec;
2433
2434 spec->autocfg.hp_pins[0] = 0x1b;
2435 spec->autocfg.speaker_pins[0] = 0x14;
2436 spec->autocfg.speaker_pins[1] = 0x16;
2437 spec->autocfg.speaker_pins[2] = 0x18;
2438 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2439 }
2440
2441 static const struct hda_verb alc888_3st_hp_verbs[] = {
2442 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
2443 {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
2444 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
2445 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2446 { } /* end */
2447 };
2448
2449 /*
2450 * 2ch mode
2451 */
2452 static const struct hda_verb alc888_3st_hp_2ch_init[] = {
2453 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
2454 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2455 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
2456 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2457 { } /* end */
2458 };
2459
2460 /*
2461 * 4ch mode
2462 */
2463 static const struct hda_verb alc888_3st_hp_4ch_init[] = {
2464 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
2465 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
2466 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2467 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
2468 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
2469 { } /* end */
2470 };
2471
2472 /*
2473 * 6ch mode
2474 */
2475 static const struct hda_verb alc888_3st_hp_6ch_init[] = {
2476 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2477 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
2478 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
2479 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2480 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
2481 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
2482 { } /* end */
2483 };
2484
2485 static const struct hda_channel_mode alc888_3st_hp_modes[3] = {
2486 { 2, alc888_3st_hp_2ch_init },
2487 { 4, alc888_3st_hp_4ch_init },
2488 { 6, alc888_3st_hp_6ch_init },
2489 };
2490
2491 static void alc888_lenovo_ms7195_setup(struct hda_codec *codec)
2492 {
2493 struct alc_spec *spec = codec->spec;
2494
2495 spec->autocfg.hp_pins[0] = 0x1b;
2496 spec->autocfg.line_out_pins[0] = 0x14;
2497 spec->autocfg.speaker_pins[0] = 0x15;
2498 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2499 }
2500
2501 /* toggle speaker-output according to the hp-jack state */
2502 static void alc883_lenovo_nb0763_setup(struct hda_codec *codec)
2503 {
2504 struct alc_spec *spec = codec->spec;
2505
2506 spec->autocfg.hp_pins[0] = 0x14;
2507 spec->autocfg.speaker_pins[0] = 0x15;
2508 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2509 }
2510
2511 /* toggle speaker-output according to the hp-jack state */
2512 #define alc883_targa_init_hook alc882_targa_init_hook
2513 #define alc883_targa_unsol_event alc882_targa_unsol_event
2514
2515 static void alc883_clevo_m720_setup(struct hda_codec *codec)
2516 {
2517 struct alc_spec *spec = codec->spec;
2518
2519 spec->autocfg.hp_pins[0] = 0x15;
2520 spec->autocfg.speaker_pins[0] = 0x14;
2521 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2522 }
2523
2524 static void alc883_clevo_m720_init_hook(struct hda_codec *codec)
2525 {
2526 alc_hp_automute(codec);
2527 alc88x_simple_mic_automute(codec);
2528 }
2529
2530 static void alc883_clevo_m720_unsol_event(struct hda_codec *codec,
2531 unsigned int res)
2532 {
2533 switch (res >> 26) {
2534 case ALC_MIC_EVENT:
2535 alc88x_simple_mic_automute(codec);
2536 break;
2537 default:
2538 alc_sku_unsol_event(codec, res);
2539 break;
2540 }
2541 }
2542
2543 /* toggle speaker-output according to the hp-jack state */
2544 static void alc883_2ch_fujitsu_pi2515_setup(struct hda_codec *codec)
2545 {
2546 struct alc_spec *spec = codec->spec;
2547
2548 spec->autocfg.hp_pins[0] = 0x14;
2549 spec->autocfg.speaker_pins[0] = 0x15;
2550 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2551 }
2552
2553 static void alc883_haier_w66_setup(struct hda_codec *codec)
2554 {
2555 struct alc_spec *spec = codec->spec;
2556
2557 spec->autocfg.hp_pins[0] = 0x1b;
2558 spec->autocfg.speaker_pins[0] = 0x14;
2559 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2560 }
2561
2562 static void alc883_lenovo_101e_setup(struct hda_codec *codec)
2563 {
2564 struct alc_spec *spec = codec->spec;
2565
2566 spec->autocfg.hp_pins[0] = 0x1b;
2567 spec->autocfg.line_out_pins[0] = 0x14;
2568 spec->autocfg.speaker_pins[0] = 0x15;
2569 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2570 }
2571
2572 /* toggle speaker-output according to the hp-jack state */
2573 static void alc883_acer_aspire_setup(struct hda_codec *codec)
2574 {
2575 struct alc_spec *spec = codec->spec;
2576
2577 spec->autocfg.hp_pins[0] = 0x14;
2578 spec->autocfg.speaker_pins[0] = 0x15;
2579 spec->autocfg.speaker_pins[1] = 0x16;
2580 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2581 }
2582
2583 static const struct hda_verb alc883_acer_eapd_verbs[] = {
2584 /* HP Pin: output 0 (0x0c) */
2585 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2586 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2587 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
2588 /* Front Pin: output 0 (0x0c) */
2589 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2590 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2591 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2592 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
2593 /* eanable EAPD on medion laptop */
2594 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
2595 {0x20, AC_VERB_SET_PROC_COEF, 0x3050},
2596 /* enable unsolicited event */
2597 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2598 { }
2599 };
2600
2601 static void alc888_6st_dell_setup(struct hda_codec *codec)
2602 {
2603 struct alc_spec *spec = codec->spec;
2604
2605 spec->autocfg.hp_pins[0] = 0x1b;
2606 spec->autocfg.speaker_pins[0] = 0x14;
2607 spec->autocfg.speaker_pins[1] = 0x15;
2608 spec->autocfg.speaker_pins[2] = 0x16;
2609 spec->autocfg.speaker_pins[3] = 0x17;
2610 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2611 }
2612
2613 static void alc888_lenovo_sky_setup(struct hda_codec *codec)
2614 {
2615 struct alc_spec *spec = codec->spec;
2616
2617 spec->autocfg.hp_pins[0] = 0x1b;
2618 spec->autocfg.speaker_pins[0] = 0x14;
2619 spec->autocfg.speaker_pins[1] = 0x15;
2620 spec->autocfg.speaker_pins[2] = 0x16;
2621 spec->autocfg.speaker_pins[3] = 0x17;
2622 spec->autocfg.speaker_pins[4] = 0x1a;
2623 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2624 }
2625
2626 static const struct hda_verb alc888_asus_m90v_verbs[] = {
2627 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2628 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
2629 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2630 /* enable unsolicited event */
2631 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2632 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
2633 { } /* end */
2634 };
2635
2636 static void alc883_mode2_setup(struct hda_codec *codec)
2637 {
2638 struct alc_spec *spec = codec->spec;
2639
2640 spec->autocfg.hp_pins[0] = 0x1b;
2641 spec->autocfg.speaker_pins[0] = 0x14;
2642 spec->autocfg.speaker_pins[1] = 0x15;
2643 spec->autocfg.speaker_pins[2] = 0x16;
2644 spec->ext_mic_pin = 0x18;
2645 spec->int_mic_pin = 0x19;
2646 spec->auto_mic = 1;
2647 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2648 }
2649
2650 static const struct hda_verb alc889A_mb31_verbs[] = {
2651 /* Init rear pin (used as headphone output) */
2652 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, /* Apple Headphones */
2653 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Connect to front */
2654 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2655 /* Init line pin (used as output in 4ch and 6ch mode) */
2656 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Connect to CLFE */
2657 /* Init line 2 pin (used as headphone out by default) */
2658 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Use as input */
2659 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Mute output */
2660 { } /* end */
2661 };
2662
2663 /* Mute speakers according to the headphone jack state */
2664 static void alc889A_mb31_automute(struct hda_codec *codec)
2665 {
2666 unsigned int present;
2667
2668 /* Mute only in 2ch or 4ch mode */
2669 if (snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_CONNECT_SEL, 0)
2670 == 0x00) {
2671 present = snd_hda_jack_detect(codec, 0x15);
2672 snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
2673 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
2674 snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
2675 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
2676 }
2677 }
2678
2679 static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
2680 {
2681 if ((res >> 26) == ALC_HP_EVENT)
2682 alc889A_mb31_automute(codec);
2683 }
2684
2685 static const hda_nid_t alc883_slave_dig_outs[] = {
2686 ALC1200_DIGOUT_NID, 0,
2687 };
2688
2689 static const hda_nid_t alc1200_slave_dig_outs[] = {
2690 ALC883_DIGOUT_NID, 0,
2691 };
2692
2693 /*
2694 * configuration and preset
2695 */
2696 static const char * const alc882_models[ALC882_MODEL_LAST] = {
2697 [ALC882_3ST_DIG] = "3stack-dig",
2698 [ALC882_6ST_DIG] = "6stack-dig",
2699 [ALC882_ARIMA] = "arima",
2700 [ALC882_W2JC] = "w2jc",
2701 [ALC882_TARGA] = "targa",
2702 [ALC882_ASUS_A7J] = "asus-a7j",
2703 [ALC882_ASUS_A7M] = "asus-a7m",
2704 [ALC885_MACPRO] = "macpro",
2705 [ALC885_MB5] = "mb5",
2706 [ALC885_MACMINI3] = "macmini3",
2707 [ALC885_MBA21] = "mba21",
2708 [ALC885_MBP3] = "mbp3",
2709 [ALC885_IMAC24] = "imac24",
2710 [ALC885_IMAC91] = "imac91",
2711 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
2712 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
2713 [ALC883_3ST_6ch] = "3stack-6ch",
2714 [ALC883_6ST_DIG] = "alc883-6stack-dig",
2715 [ALC883_TARGA_DIG] = "targa-dig",
2716 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
2717 [ALC883_TARGA_8ch_DIG] = "targa-8ch-dig",
2718 [ALC883_ACER] = "acer",
2719 [ALC883_ACER_ASPIRE] = "acer-aspire",
2720 [ALC888_ACER_ASPIRE_4930G] = "acer-aspire-4930g",
2721 [ALC888_ACER_ASPIRE_6530G] = "acer-aspire-6530g",
2722 [ALC888_ACER_ASPIRE_8930G] = "acer-aspire-8930g",
2723 [ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g",
2724 [ALC883_MEDION] = "medion",
2725 [ALC883_MEDION_WIM2160] = "medion-wim2160",
2726 [ALC883_LAPTOP_EAPD] = "laptop-eapd",
2727 [ALC883_LENOVO_101E_2ch] = "lenovo-101e",
2728 [ALC883_LENOVO_NB0763] = "lenovo-nb0763",
2729 [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig",
2730 [ALC888_LENOVO_SKY] = "lenovo-sky",
2731 [ALC883_HAIER_W66] = "haier-w66",
2732 [ALC888_3ST_HP] = "3stack-hp",
2733 [ALC888_6ST_DELL] = "6stack-dell",
2734 [ALC883_MITAC] = "mitac",
2735 [ALC883_CLEVO_M540R] = "clevo-m540r",
2736 [ALC883_CLEVO_M720] = "clevo-m720",
2737 [ALC883_FUJITSU_PI2515] = "fujitsu-pi2515",
2738 [ALC888_FUJITSU_XA3530] = "fujitsu-xa3530",
2739 [ALC883_3ST_6ch_INTEL] = "3stack-6ch-intel",
2740 [ALC889A_INTEL] = "intel-alc889a",
2741 [ALC889_INTEL] = "intel-x58",
2742 [ALC889A_MB31] = "mb31",
2743 [ALC882_AUTO] = "auto",
2744 };
2745
2746 static const struct snd_pci_quirk alc882_cfg_tbl[] = {
2747 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
2748
2749 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
2750 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
2751 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE),
2752 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
2753 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
2754 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
2755 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2756 ALC888_ACER_ASPIRE_4930G),
2757 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2758 ALC888_ACER_ASPIRE_4930G),
2759 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2760 ALC888_ACER_ASPIRE_8930G),
2761 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2762 ALC888_ACER_ASPIRE_8930G),
2763 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO),
2764 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO),
2765 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2766 ALC888_ACER_ASPIRE_6530G),
2767 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2768 ALC888_ACER_ASPIRE_6530G),
2769 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2770 ALC888_ACER_ASPIRE_7730G),
2771 /* default Acer -- disabled as it causes more problems.
2772 * model=auto should work fine now
2773 */
2774 /* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
2775
2776 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
2777
2778 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavilion", ALC883_6ST_DIG),
2779 SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP),
2780 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
2781 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
2782 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP),
2783 SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP),
2784
2785 SND_PCI_QUIRK(0x1043, 0x060d, "Asus A7J", ALC882_ASUS_A7J),
2786 SND_PCI_QUIRK(0x1043, 0x1243, "Asus A7J", ALC882_ASUS_A7J),
2787 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_ASUS_A7M),
2788 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V),
2789 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
2790 SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
2791 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
2792 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
2793 SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG),
2794
2795 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
2796 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
2797 SND_PCI_QUIRK(0x1071, 0x8227, "Mitac 82801H", ALC883_MITAC),
2798 SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC),
2799 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
2800 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
2801 SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
2802 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
2803
2804 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
2805 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
2806 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
2807 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
2808 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
2809 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
2810 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
2811 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
2812 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
2813 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
2814 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
2815 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
2816 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
2817 SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG),
2818 SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG),
2819 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
2820 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
2821 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
2822 SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG),
2823 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG),
2824 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
2825 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
2826 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG),
2827 SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG),
2828 SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG),
2829 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
2830 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
2831 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
2832 SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG),
2833 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
2834 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
2835
2836 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
2837 SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG),
2838 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720),
2839 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720),
2840 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R),
2841 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC883_LAPTOP_EAPD),
2842 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
2843 /* SND_PCI_QUIRK(0x161f, 0x2054, "Arima W820", ALC882_ARIMA), */
2844 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
2845 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1100, "FSC AMILO Xi/Pi25xx",
2846 ALC883_FUJITSU_PI2515),
2847 SND_PCI_QUIRK_MASK(0x1734, 0xfff0, 0x1130, "Fujitsu AMILO Xa35xx",
2848 ALC888_FUJITSU_XA3530),
2849 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
2850 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2851 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2852 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2853 SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY),
2854 SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG),
2855 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
2856 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
2857
2858 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
2859 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
2860 SND_PCI_QUIRK(0x8086, 0x2503, "82801H", ALC883_MITAC),
2861 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL),
2862 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL),
2863 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL),
2864 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG),
2865
2866 {}
2867 };
2868
2869 /* codec SSID table for Intel Mac */
2870 static const struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
2871 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3),
2872 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3),
2873 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3),
2874 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO),
2875 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
2876 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
2877 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
2878 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
2879 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_ASUS_A7M),
2880 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC885_MBP3),
2881 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC885_MBA21),
2882 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
2883 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
2884 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
2885 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
2886 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
2887 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
2888 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
2889 * so apparently no perfect solution yet
2890 */
2891 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
2892 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
2893 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3),
2894 {} /* terminator */
2895 };
2896
2897 static const struct alc_config_preset alc882_presets[] = {
2898 [ALC882_3ST_DIG] = {
2899 .mixers = { alc882_base_mixer },
2900 .init_verbs = { alc882_base_init_verbs,
2901 alc882_adc1_init_verbs },
2902 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2903 .dac_nids = alc882_dac_nids,
2904 .dig_out_nid = ALC882_DIGOUT_NID,
2905 .dig_in_nid = ALC882_DIGIN_NID,
2906 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
2907 .channel_mode = alc882_ch_modes,
2908 .need_dac_fix = 1,
2909 .input_mux = &alc882_capture_source,
2910 },
2911 [ALC882_6ST_DIG] = {
2912 .mixers = { alc882_base_mixer, alc882_chmode_mixer },
2913 .init_verbs = { alc882_base_init_verbs,
2914 alc882_adc1_init_verbs },
2915 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2916 .dac_nids = alc882_dac_nids,
2917 .dig_out_nid = ALC882_DIGOUT_NID,
2918 .dig_in_nid = ALC882_DIGIN_NID,
2919 .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
2920 .channel_mode = alc882_sixstack_modes,
2921 .input_mux = &alc882_capture_source,
2922 },
2923 [ALC882_ARIMA] = {
2924 .mixers = { alc882_base_mixer, alc882_chmode_mixer },
2925 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
2926 alc882_eapd_verbs },
2927 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2928 .dac_nids = alc882_dac_nids,
2929 .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
2930 .channel_mode = alc882_sixstack_modes,
2931 .input_mux = &alc882_capture_source,
2932 },
2933 [ALC882_W2JC] = {
2934 .mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
2935 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
2936 alc882_eapd_verbs, alc880_gpio1_init_verbs },
2937 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2938 .dac_nids = alc882_dac_nids,
2939 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
2940 .channel_mode = alc880_threestack_modes,
2941 .need_dac_fix = 1,
2942 .input_mux = &alc882_capture_source,
2943 .dig_out_nid = ALC882_DIGOUT_NID,
2944 },
2945 [ALC885_MBA21] = {
2946 .mixers = { alc885_mba21_mixer },
2947 .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
2948 .num_dacs = 2,
2949 .dac_nids = alc882_dac_nids,
2950 .channel_mode = alc885_mba21_ch_modes,
2951 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
2952 .input_mux = &alc882_capture_source,
2953 .unsol_event = alc_sku_unsol_event,
2954 .setup = alc885_mba21_setup,
2955 .init_hook = alc_hp_automute,
2956 },
2957 [ALC885_MBP3] = {
2958 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
2959 .init_verbs = { alc885_mbp3_init_verbs,
2960 alc880_gpio1_init_verbs },
2961 .num_dacs = 2,
2962 .dac_nids = alc882_dac_nids,
2963 .hp_nid = 0x04,
2964 .channel_mode = alc885_mbp_4ch_modes,
2965 .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
2966 .input_mux = &alc882_capture_source,
2967 .dig_out_nid = ALC882_DIGOUT_NID,
2968 .dig_in_nid = ALC882_DIGIN_NID,
2969 .unsol_event = alc_sku_unsol_event,
2970 .setup = alc885_mbp3_setup,
2971 .init_hook = alc_hp_automute,
2972 },
2973 [ALC885_MB5] = {
2974 .mixers = { alc885_mb5_mixer, alc882_chmode_mixer },
2975 .init_verbs = { alc885_mb5_init_verbs,
2976 alc880_gpio1_init_verbs },
2977 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2978 .dac_nids = alc882_dac_nids,
2979 .channel_mode = alc885_mb5_6ch_modes,
2980 .num_channel_mode = ARRAY_SIZE(alc885_mb5_6ch_modes),
2981 .input_mux = &mb5_capture_source,
2982 .dig_out_nid = ALC882_DIGOUT_NID,
2983 .dig_in_nid = ALC882_DIGIN_NID,
2984 .unsol_event = alc_sku_unsol_event,
2985 .setup = alc885_mb5_setup,
2986 .init_hook = alc_hp_automute,
2987 },
2988 [ALC885_MACMINI3] = {
2989 .mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
2990 .init_verbs = { alc885_macmini3_init_verbs,
2991 alc880_gpio1_init_verbs },
2992 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2993 .dac_nids = alc882_dac_nids,
2994 .channel_mode = alc885_macmini3_6ch_modes,
2995 .num_channel_mode = ARRAY_SIZE(alc885_macmini3_6ch_modes),
2996 .input_mux = &macmini3_capture_source,
2997 .dig_out_nid = ALC882_DIGOUT_NID,
2998 .dig_in_nid = ALC882_DIGIN_NID,
2999 .unsol_event = alc_sku_unsol_event,
3000 .setup = alc885_macmini3_setup,
3001 .init_hook = alc_hp_automute,
3002 },
3003 [ALC885_MACPRO] = {
3004 .mixers = { alc882_macpro_mixer },
3005 .init_verbs = { alc882_macpro_init_verbs },
3006 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3007 .dac_nids = alc882_dac_nids,
3008 .dig_out_nid = ALC882_DIGOUT_NID,
3009 .dig_in_nid = ALC882_DIGIN_NID,
3010 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
3011 .channel_mode = alc882_ch_modes,
3012 .input_mux = &alc882_capture_source,
3013 .init_hook = alc885_macpro_init_hook,
3014 },
3015 [ALC885_IMAC24] = {
3016 .mixers = { alc885_imac24_mixer },
3017 .init_verbs = { alc885_imac24_init_verbs },
3018 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3019 .dac_nids = alc882_dac_nids,
3020 .dig_out_nid = ALC882_DIGOUT_NID,
3021 .dig_in_nid = ALC882_DIGIN_NID,
3022 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
3023 .channel_mode = alc882_ch_modes,
3024 .input_mux = &alc882_capture_source,
3025 .unsol_event = alc_sku_unsol_event,
3026 .setup = alc885_imac24_setup,
3027 .init_hook = alc885_imac24_init_hook,
3028 },
3029 [ALC885_IMAC91] = {
3030 .mixers = {alc885_imac91_mixer},
3031 .init_verbs = { alc885_imac91_init_verbs,
3032 alc880_gpio1_init_verbs },
3033 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3034 .dac_nids = alc882_dac_nids,
3035 .channel_mode = alc885_mba21_ch_modes,
3036 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
3037 .input_mux = &alc889A_imac91_capture_source,
3038 .dig_out_nid = ALC882_DIGOUT_NID,
3039 .dig_in_nid = ALC882_DIGIN_NID,
3040 .unsol_event = alc_sku_unsol_event,
3041 .setup = alc885_imac91_setup,
3042 .init_hook = alc_hp_automute,
3043 },
3044 [ALC882_TARGA] = {
3045 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
3046 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
3047 alc880_gpio3_init_verbs, alc882_targa_verbs},
3048 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3049 .dac_nids = alc882_dac_nids,
3050 .dig_out_nid = ALC882_DIGOUT_NID,
3051 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
3052 .adc_nids = alc882_adc_nids,
3053 .capsrc_nids = alc882_capsrc_nids,
3054 .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
3055 .channel_mode = alc882_3ST_6ch_modes,
3056 .need_dac_fix = 1,
3057 .input_mux = &alc882_capture_source,
3058 .unsol_event = alc_sku_unsol_event,
3059 .setup = alc882_targa_setup,
3060 .init_hook = alc882_targa_automute,
3061 },
3062 [ALC882_ASUS_A7J] = {
3063 .mixers = { alc882_asus_a7j_mixer, alc882_chmode_mixer },
3064 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
3065 alc882_asus_a7j_verbs},
3066 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3067 .dac_nids = alc882_dac_nids,
3068 .dig_out_nid = ALC882_DIGOUT_NID,
3069 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
3070 .adc_nids = alc882_adc_nids,
3071 .capsrc_nids = alc882_capsrc_nids,
3072 .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
3073 .channel_mode = alc882_3ST_6ch_modes,
3074 .need_dac_fix = 1,
3075 .input_mux = &alc882_capture_source,
3076 },
3077 [ALC882_ASUS_A7M] = {
3078 .mixers = { alc882_asus_a7m_mixer, alc882_chmode_mixer },
3079 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
3080 alc882_eapd_verbs, alc880_gpio1_init_verbs,
3081 alc882_asus_a7m_verbs },
3082 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
3083 .dac_nids = alc882_dac_nids,
3084 .dig_out_nid = ALC882_DIGOUT_NID,
3085 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
3086 .channel_mode = alc880_threestack_modes,
3087 .need_dac_fix = 1,
3088 .input_mux = &alc882_capture_source,
3089 },
3090 [ALC883_3ST_2ch_DIG] = {
3091 .mixers = { alc883_3ST_2ch_mixer },
3092 .init_verbs = { alc883_init_verbs },
3093 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3094 .dac_nids = alc883_dac_nids,
3095 .dig_out_nid = ALC883_DIGOUT_NID,
3096 .dig_in_nid = ALC883_DIGIN_NID,
3097 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3098 .channel_mode = alc883_3ST_2ch_modes,
3099 .input_mux = &alc883_capture_source,
3100 },
3101 [ALC883_3ST_6ch_DIG] = {
3102 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3103 .init_verbs = { alc883_init_verbs },
3104 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3105 .dac_nids = alc883_dac_nids,
3106 .dig_out_nid = ALC883_DIGOUT_NID,
3107 .dig_in_nid = ALC883_DIGIN_NID,
3108 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3109 .channel_mode = alc883_3ST_6ch_modes,
3110 .need_dac_fix = 1,
3111 .input_mux = &alc883_capture_source,
3112 },
3113 [ALC883_3ST_6ch] = {
3114 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3115 .init_verbs = { alc883_init_verbs },
3116 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3117 .dac_nids = alc883_dac_nids,
3118 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3119 .channel_mode = alc883_3ST_6ch_modes,
3120 .need_dac_fix = 1,
3121 .input_mux = &alc883_capture_source,
3122 },
3123 [ALC883_3ST_6ch_INTEL] = {
3124 .mixers = { alc883_3ST_6ch_intel_mixer, alc883_chmode_mixer },
3125 .init_verbs = { alc883_init_verbs },
3126 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3127 .dac_nids = alc883_dac_nids,
3128 .dig_out_nid = ALC883_DIGOUT_NID,
3129 .dig_in_nid = ALC883_DIGIN_NID,
3130 .slave_dig_outs = alc883_slave_dig_outs,
3131 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes),
3132 .channel_mode = alc883_3ST_6ch_intel_modes,
3133 .need_dac_fix = 1,
3134 .input_mux = &alc883_3stack_6ch_intel,
3135 },
3136 [ALC889A_INTEL] = {
3137 .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
3138 .init_verbs = { alc885_init_verbs, alc885_init_input_verbs,
3139 alc_hp15_unsol_verbs },
3140 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3141 .dac_nids = alc883_dac_nids,
3142 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
3143 .adc_nids = alc889_adc_nids,
3144 .dig_out_nid = ALC883_DIGOUT_NID,
3145 .dig_in_nid = ALC883_DIGIN_NID,
3146 .slave_dig_outs = alc883_slave_dig_outs,
3147 .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
3148 .channel_mode = alc889_8ch_intel_modes,
3149 .capsrc_nids = alc889_capsrc_nids,
3150 .input_mux = &alc889_capture_source,
3151 .setup = alc889_automute_setup,
3152 .init_hook = alc_hp_automute,
3153 .unsol_event = alc_sku_unsol_event,
3154 .need_dac_fix = 1,
3155 },
3156 [ALC889_INTEL] = {
3157 .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
3158 .init_verbs = { alc885_init_verbs, alc889_init_input_verbs,
3159 alc889_eapd_verbs, alc_hp15_unsol_verbs},
3160 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3161 .dac_nids = alc883_dac_nids,
3162 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
3163 .adc_nids = alc889_adc_nids,
3164 .dig_out_nid = ALC883_DIGOUT_NID,
3165 .dig_in_nid = ALC883_DIGIN_NID,
3166 .slave_dig_outs = alc883_slave_dig_outs,
3167 .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
3168 .channel_mode = alc889_8ch_intel_modes,
3169 .capsrc_nids = alc889_capsrc_nids,
3170 .input_mux = &alc889_capture_source,
3171 .setup = alc889_automute_setup,
3172 .init_hook = alc889_intel_init_hook,
3173 .unsol_event = alc_sku_unsol_event,
3174 .need_dac_fix = 1,
3175 },
3176 [ALC883_6ST_DIG] = {
3177 .mixers = { alc883_base_mixer, alc883_chmode_mixer },
3178 .init_verbs = { alc883_init_verbs },
3179 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3180 .dac_nids = alc883_dac_nids,
3181 .dig_out_nid = ALC883_DIGOUT_NID,
3182 .dig_in_nid = ALC883_DIGIN_NID,
3183 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
3184 .channel_mode = alc883_sixstack_modes,
3185 .input_mux = &alc883_capture_source,
3186 },
3187 [ALC883_TARGA_DIG] = {
3188 .mixers = { alc883_targa_mixer, alc883_chmode_mixer },
3189 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
3190 alc883_targa_verbs},
3191 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3192 .dac_nids = alc883_dac_nids,
3193 .dig_out_nid = ALC883_DIGOUT_NID,
3194 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3195 .channel_mode = alc883_3ST_6ch_modes,
3196 .need_dac_fix = 1,
3197 .input_mux = &alc883_capture_source,
3198 .unsol_event = alc883_targa_unsol_event,
3199 .setup = alc882_targa_setup,
3200 .init_hook = alc882_targa_automute,
3201 },
3202 [ALC883_TARGA_2ch_DIG] = {
3203 .mixers = { alc883_targa_2ch_mixer},
3204 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
3205 alc883_targa_verbs},
3206 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3207 .dac_nids = alc883_dac_nids,
3208 .adc_nids = alc883_adc_nids_alt,
3209 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
3210 .capsrc_nids = alc883_capsrc_nids,
3211 .dig_out_nid = ALC883_DIGOUT_NID,
3212 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3213 .channel_mode = alc883_3ST_2ch_modes,
3214 .input_mux = &alc883_capture_source,
3215 .unsol_event = alc883_targa_unsol_event,
3216 .setup = alc882_targa_setup,
3217 .init_hook = alc882_targa_automute,
3218 },
3219 [ALC883_TARGA_8ch_DIG] = {
3220 .mixers = { alc883_targa_mixer, alc883_targa_8ch_mixer,
3221 alc883_chmode_mixer },
3222 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
3223 alc883_targa_verbs },
3224 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3225 .dac_nids = alc883_dac_nids,
3226 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
3227 .adc_nids = alc883_adc_nids_rev,
3228 .capsrc_nids = alc883_capsrc_nids_rev,
3229 .dig_out_nid = ALC883_DIGOUT_NID,
3230 .dig_in_nid = ALC883_DIGIN_NID,
3231 .num_channel_mode = ARRAY_SIZE(alc883_4ST_8ch_modes),
3232 .channel_mode = alc883_4ST_8ch_modes,
3233 .need_dac_fix = 1,
3234 .input_mux = &alc883_capture_source,
3235 .unsol_event = alc883_targa_unsol_event,
3236 .setup = alc882_targa_setup,
3237 .init_hook = alc882_targa_automute,
3238 },
3239 [ALC883_ACER] = {
3240 .mixers = { alc883_base_mixer },
3241 /* On TravelMate laptops, GPIO 0 enables the internal speaker
3242 * and the headphone jack. Turn this on and rely on the
3243 * standard mute methods whenever the user wants to turn
3244 * these outputs off.
3245 */
3246 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs },
3247 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3248 .dac_nids = alc883_dac_nids,
3249 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3250 .channel_mode = alc883_3ST_2ch_modes,
3251 .input_mux = &alc883_capture_source,
3252 },
3253 [ALC883_ACER_ASPIRE] = {
3254 .mixers = { alc883_acer_aspire_mixer },
3255 .init_verbs = { alc883_init_verbs, alc883_acer_eapd_verbs },
3256 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3257 .dac_nids = alc883_dac_nids,
3258 .dig_out_nid = ALC883_DIGOUT_NID,
3259 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3260 .channel_mode = alc883_3ST_2ch_modes,
3261 .input_mux = &alc883_capture_source,
3262 .unsol_event = alc_sku_unsol_event,
3263 .setup = alc883_acer_aspire_setup,
3264 .init_hook = alc_hp_automute,
3265 },
3266 [ALC888_ACER_ASPIRE_4930G] = {
3267 .mixers = { alc888_acer_aspire_4930g_mixer,
3268 alc883_chmode_mixer },
3269 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
3270 alc888_acer_aspire_4930g_verbs },
3271 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3272 .dac_nids = alc883_dac_nids,
3273 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
3274 .adc_nids = alc883_adc_nids_rev,
3275 .capsrc_nids = alc883_capsrc_nids_rev,
3276 .dig_out_nid = ALC883_DIGOUT_NID,
3277 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3278 .channel_mode = alc883_3ST_6ch_modes,
3279 .need_dac_fix = 1,
3280 .const_channel_count = 6,
3281 .num_mux_defs =
3282 ARRAY_SIZE(alc888_2_capture_sources),
3283 .input_mux = alc888_2_capture_sources,
3284 .unsol_event = alc_sku_unsol_event,
3285 .setup = alc888_acer_aspire_4930g_setup,
3286 .init_hook = alc_hp_automute,
3287 },
3288 [ALC888_ACER_ASPIRE_6530G] = {
3289 .mixers = { alc888_acer_aspire_6530_mixer },
3290 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
3291 alc888_acer_aspire_6530g_verbs },
3292 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3293 .dac_nids = alc883_dac_nids,
3294 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
3295 .adc_nids = alc883_adc_nids_rev,
3296 .capsrc_nids = alc883_capsrc_nids_rev,
3297 .dig_out_nid = ALC883_DIGOUT_NID,
3298 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3299 .channel_mode = alc883_3ST_2ch_modes,
3300 .num_mux_defs =
3301 ARRAY_SIZE(alc888_2_capture_sources),
3302 .input_mux = alc888_acer_aspire_6530_sources,
3303 .unsol_event = alc_sku_unsol_event,
3304 .setup = alc888_acer_aspire_6530g_setup,
3305 .init_hook = alc_hp_automute,
3306 },
3307 [ALC888_ACER_ASPIRE_8930G] = {
3308 .mixers = { alc889_acer_aspire_8930g_mixer,
3309 alc883_chmode_mixer },
3310 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
3311 alc889_acer_aspire_8930g_verbs,
3312 alc889_eapd_verbs},
3313 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3314 .dac_nids = alc883_dac_nids,
3315 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
3316 .adc_nids = alc889_adc_nids,
3317 .capsrc_nids = alc889_capsrc_nids,
3318 .dig_out_nid = ALC883_DIGOUT_NID,
3319 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3320 .channel_mode = alc883_3ST_6ch_modes,
3321 .need_dac_fix = 1,
3322 .const_channel_count = 6,
3323 .num_mux_defs =
3324 ARRAY_SIZE(alc889_capture_sources),
3325 .input_mux = alc889_capture_sources,
3326 .unsol_event = alc_sku_unsol_event,
3327 .setup = alc889_acer_aspire_8930g_setup,
3328 .init_hook = alc_hp_automute,
3329 #ifdef CONFIG_SND_HDA_POWER_SAVE
3330 .power_hook = alc_power_eapd,
3331 #endif
3332 },
3333 [ALC888_ACER_ASPIRE_7730G] = {
3334 .mixers = { alc883_3ST_6ch_mixer,
3335 alc883_chmode_mixer },
3336 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
3337 alc888_acer_aspire_7730G_verbs },
3338 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3339 .dac_nids = alc883_dac_nids,
3340 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
3341 .adc_nids = alc883_adc_nids_rev,
3342 .capsrc_nids = alc883_capsrc_nids_rev,
3343 .dig_out_nid = ALC883_DIGOUT_NID,
3344 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3345 .channel_mode = alc883_3ST_6ch_modes,
3346 .need_dac_fix = 1,
3347 .const_channel_count = 6,
3348 .input_mux = &alc883_capture_source,
3349 .unsol_event = alc_sku_unsol_event,
3350 .setup = alc888_acer_aspire_7730g_setup,
3351 .init_hook = alc_hp_automute,
3352 },
3353 [ALC883_MEDION] = {
3354 .mixers = { alc883_fivestack_mixer,
3355 alc883_chmode_mixer },
3356 .init_verbs = { alc883_init_verbs,
3357 alc883_medion_eapd_verbs },
3358 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3359 .dac_nids = alc883_dac_nids,
3360 .adc_nids = alc883_adc_nids_alt,
3361 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
3362 .capsrc_nids = alc883_capsrc_nids,
3363 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
3364 .channel_mode = alc883_sixstack_modes,
3365 .input_mux = &alc883_capture_source,
3366 },
3367 [ALC883_MEDION_WIM2160] = {
3368 .mixers = { alc883_medion_wim2160_mixer },
3369 .init_verbs = { alc883_init_verbs, alc883_medion_wim2160_verbs },
3370 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3371 .dac_nids = alc883_dac_nids,
3372 .dig_out_nid = ALC883_DIGOUT_NID,
3373 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
3374 .adc_nids = alc883_adc_nids,
3375 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3376 .channel_mode = alc883_3ST_2ch_modes,
3377 .input_mux = &alc883_capture_source,
3378 .unsol_event = alc_sku_unsol_event,
3379 .setup = alc883_medion_wim2160_setup,
3380 .init_hook = alc_hp_automute,
3381 },
3382 [ALC883_LAPTOP_EAPD] = {
3383 .mixers = { alc883_base_mixer },
3384 .init_verbs = { alc883_init_verbs, alc882_eapd_verbs },
3385 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3386 .dac_nids = alc883_dac_nids,
3387 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3388 .channel_mode = alc883_3ST_2ch_modes,
3389 .input_mux = &alc883_capture_source,
3390 },
3391 [ALC883_CLEVO_M540R] = {
3392 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3393 .init_verbs = { alc883_init_verbs, alc883_clevo_m540r_verbs },
3394 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3395 .dac_nids = alc883_dac_nids,
3396 .dig_out_nid = ALC883_DIGOUT_NID,
3397 .dig_in_nid = ALC883_DIGIN_NID,
3398 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_clevo_modes),
3399 .channel_mode = alc883_3ST_6ch_clevo_modes,
3400 .need_dac_fix = 1,
3401 .input_mux = &alc883_capture_source,
3402 /* This machine has the hardware HP auto-muting, thus
3403 * we need no software mute via unsol event
3404 */
3405 },
3406 [ALC883_CLEVO_M720] = {
3407 .mixers = { alc883_clevo_m720_mixer },
3408 .init_verbs = { alc883_init_verbs, alc883_clevo_m720_verbs },
3409 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3410 .dac_nids = alc883_dac_nids,
3411 .dig_out_nid = ALC883_DIGOUT_NID,
3412 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3413 .channel_mode = alc883_3ST_2ch_modes,
3414 .input_mux = &alc883_capture_source,
3415 .unsol_event = alc883_clevo_m720_unsol_event,
3416 .setup = alc883_clevo_m720_setup,
3417 .init_hook = alc883_clevo_m720_init_hook,
3418 },
3419 [ALC883_LENOVO_101E_2ch] = {
3420 .mixers = { alc883_lenovo_101e_2ch_mixer},
3421 .init_verbs = { alc883_init_verbs, alc883_lenovo_101e_verbs},
3422 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3423 .dac_nids = alc883_dac_nids,
3424 .adc_nids = alc883_adc_nids_alt,
3425 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
3426 .capsrc_nids = alc883_capsrc_nids,
3427 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3428 .channel_mode = alc883_3ST_2ch_modes,
3429 .input_mux = &alc883_lenovo_101e_capture_source,
3430 .setup = alc883_lenovo_101e_setup,
3431 .unsol_event = alc_sku_unsol_event,
3432 .init_hook = alc_inithook,
3433 },
3434 [ALC883_LENOVO_NB0763] = {
3435 .mixers = { alc883_lenovo_nb0763_mixer },
3436 .init_verbs = { alc883_init_verbs, alc883_lenovo_nb0763_verbs},
3437 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3438 .dac_nids = alc883_dac_nids,
3439 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3440 .channel_mode = alc883_3ST_2ch_modes,
3441 .need_dac_fix = 1,
3442 .input_mux = &alc883_lenovo_nb0763_capture_source,
3443 .unsol_event = alc_sku_unsol_event,
3444 .setup = alc883_lenovo_nb0763_setup,
3445 .init_hook = alc_hp_automute,
3446 },
3447 [ALC888_LENOVO_MS7195_DIG] = {
3448 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3449 .init_verbs = { alc883_init_verbs, alc888_lenovo_ms7195_verbs},
3450 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3451 .dac_nids = alc883_dac_nids,
3452 .dig_out_nid = ALC883_DIGOUT_NID,
3453 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3454 .channel_mode = alc883_3ST_6ch_modes,
3455 .need_dac_fix = 1,
3456 .input_mux = &alc883_capture_source,
3457 .unsol_event = alc_sku_unsol_event,
3458 .setup = alc888_lenovo_ms7195_setup,
3459 .init_hook = alc_inithook,
3460 },
3461 [ALC883_HAIER_W66] = {
3462 .mixers = { alc883_targa_2ch_mixer},
3463 .init_verbs = { alc883_init_verbs, alc883_haier_w66_verbs},
3464 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3465 .dac_nids = alc883_dac_nids,
3466 .dig_out_nid = ALC883_DIGOUT_NID,
3467 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3468 .channel_mode = alc883_3ST_2ch_modes,
3469 .input_mux = &alc883_capture_source,
3470 .unsol_event = alc_sku_unsol_event,
3471 .setup = alc883_haier_w66_setup,
3472 .init_hook = alc_hp_automute,
3473 },
3474 [ALC888_3ST_HP] = {
3475 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3476 .init_verbs = { alc883_init_verbs, alc888_3st_hp_verbs },
3477 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3478 .dac_nids = alc883_dac_nids,
3479 .num_channel_mode = ARRAY_SIZE(alc888_3st_hp_modes),
3480 .channel_mode = alc888_3st_hp_modes,
3481 .need_dac_fix = 1,
3482 .input_mux = &alc883_capture_source,
3483 .unsol_event = alc_sku_unsol_event,
3484 .setup = alc888_3st_hp_setup,
3485 .init_hook = alc_hp_automute,
3486 },
3487 [ALC888_6ST_DELL] = {
3488 .mixers = { alc883_base_mixer, alc883_chmode_mixer },
3489 .init_verbs = { alc883_init_verbs, alc888_6st_dell_verbs },
3490 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3491 .dac_nids = alc883_dac_nids,
3492 .dig_out_nid = ALC883_DIGOUT_NID,
3493 .dig_in_nid = ALC883_DIGIN_NID,
3494 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
3495 .channel_mode = alc883_sixstack_modes,
3496 .input_mux = &alc883_capture_source,
3497 .unsol_event = alc_sku_unsol_event,
3498 .setup = alc888_6st_dell_setup,
3499 .init_hook = alc_hp_automute,
3500 },
3501 [ALC883_MITAC] = {
3502 .mixers = { alc883_mitac_mixer },
3503 .init_verbs = { alc883_init_verbs, alc883_mitac_verbs },
3504 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3505 .dac_nids = alc883_dac_nids,
3506 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3507 .channel_mode = alc883_3ST_2ch_modes,
3508 .input_mux = &alc883_capture_source,
3509 .unsol_event = alc_sku_unsol_event,
3510 .setup = alc883_mitac_setup,
3511 .init_hook = alc_hp_automute,
3512 },
3513 [ALC883_FUJITSU_PI2515] = {
3514 .mixers = { alc883_2ch_fujitsu_pi2515_mixer },
3515 .init_verbs = { alc883_init_verbs,
3516 alc883_2ch_fujitsu_pi2515_verbs},
3517 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3518 .dac_nids = alc883_dac_nids,
3519 .dig_out_nid = ALC883_DIGOUT_NID,
3520 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
3521 .channel_mode = alc883_3ST_2ch_modes,
3522 .input_mux = &alc883_fujitsu_pi2515_capture_source,
3523 .unsol_event = alc_sku_unsol_event,
3524 .setup = alc883_2ch_fujitsu_pi2515_setup,
3525 .init_hook = alc_hp_automute,
3526 },
3527 [ALC888_FUJITSU_XA3530] = {
3528 .mixers = { alc888_base_mixer, alc883_chmode_mixer },
3529 .init_verbs = { alc883_init_verbs,
3530 alc888_fujitsu_xa3530_verbs },
3531 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3532 .dac_nids = alc883_dac_nids,
3533 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
3534 .adc_nids = alc883_adc_nids_rev,
3535 .capsrc_nids = alc883_capsrc_nids_rev,
3536 .dig_out_nid = ALC883_DIGOUT_NID,
3537 .num_channel_mode = ARRAY_SIZE(alc888_4ST_8ch_intel_modes),
3538 .channel_mode = alc888_4ST_8ch_intel_modes,
3539 .num_mux_defs =
3540 ARRAY_SIZE(alc888_2_capture_sources),
3541 .input_mux = alc888_2_capture_sources,
3542 .unsol_event = alc_sku_unsol_event,
3543 .setup = alc888_fujitsu_xa3530_setup,
3544 .init_hook = alc_hp_automute,
3545 },
3546 [ALC888_LENOVO_SKY] = {
3547 .mixers = { alc888_lenovo_sky_mixer, alc883_chmode_mixer },
3548 .init_verbs = { alc883_init_verbs, alc888_lenovo_sky_verbs},
3549 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3550 .dac_nids = alc883_dac_nids,
3551 .dig_out_nid = ALC883_DIGOUT_NID,
3552 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
3553 .channel_mode = alc883_sixstack_modes,
3554 .need_dac_fix = 1,
3555 .input_mux = &alc883_lenovo_sky_capture_source,
3556 .unsol_event = alc_sku_unsol_event,
3557 .setup = alc888_lenovo_sky_setup,
3558 .init_hook = alc_hp_automute,
3559 },
3560 [ALC888_ASUS_M90V] = {
3561 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
3562 .init_verbs = { alc883_init_verbs, alc888_asus_m90v_verbs },
3563 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3564 .dac_nids = alc883_dac_nids,
3565 .dig_out_nid = ALC883_DIGOUT_NID,
3566 .dig_in_nid = ALC883_DIGIN_NID,
3567 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
3568 .channel_mode = alc883_3ST_6ch_modes,
3569 .need_dac_fix = 1,
3570 .input_mux = &alc883_fujitsu_pi2515_capture_source,
3571 .unsol_event = alc_sku_unsol_event,
3572 .setup = alc883_mode2_setup,
3573 .init_hook = alc_inithook,
3574 },
3575 [ALC889A_MB31] = {
3576 .mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
3577 .init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
3578 alc880_gpio1_init_verbs },
3579 .adc_nids = alc883_adc_nids,
3580 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
3581 .capsrc_nids = alc883_capsrc_nids,
3582 .dac_nids = alc883_dac_nids,
3583 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
3584 .channel_mode = alc889A_mb31_6ch_modes,
3585 .num_channel_mode = ARRAY_SIZE(alc889A_mb31_6ch_modes),
3586 .input_mux = &alc889A_mb31_capture_source,
3587 .dig_out_nid = ALC883_DIGOUT_NID,
3588 .unsol_event = alc889A_mb31_unsol_event,
3589 .init_hook = alc889A_mb31_automute,
3590 },
3591 };
3592
3593