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