ALSA: hda/realtek - Drop ALC882 model=acer quirk
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / sound / pci / hda / alc882_quirks.c
blob29c9b8a0a655f97fbd7d4fb15f5b23afc3888028
1 /*
2 * ALC882/ALC883/ALC888/ALC889 quirk models
3 * included by patch_realtek.c
4 */
6 /* ALC882 models */
7 enum {
8 ALC882_AUTO,
9 ALC882_3ST_DIG,
10 ALC882_6ST_DIG,
11 ALC882_W2JC,
12 ALC882_TARGA,
13 ALC885_MACPRO,
14 ALC885_MBA21,
15 ALC885_MBP3,
16 ALC885_MB5,
17 ALC885_MACMINI3,
18 ALC885_IMAC24,
19 ALC885_IMAC91,
20 ALC883_3ST_2ch_DIG,
21 ALC883_3ST_6ch_DIG,
22 ALC883_3ST_6ch,
23 ALC883_6ST_DIG,
24 ALC883_TARGA_DIG,
25 ALC883_TARGA_2ch_DIG,
26 ALC883_TARGA_8ch_DIG,
27 ALC883_ACER_ASPIRE,
28 ALC888_ACER_ASPIRE_4930G,
29 ALC888_ACER_ASPIRE_6530G,
30 ALC888_ACER_ASPIRE_8930G,
31 ALC888_ACER_ASPIRE_7730G,
32 ALC883_3ST_6ch_INTEL,
33 ALC889A_INTEL,
34 ALC889_INTEL,
35 ALC889A_MB31,
36 ALC882_MODEL_LAST,
40 * 2ch mode
42 static const struct hda_verb alc888_4ST_ch2_intel_init[] = {
43 /* Mic-in jack as mic in */
44 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
45 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
46 /* Line-in jack as Line in */
47 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
48 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
49 /* Line-Out as Front */
50 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
51 { } /* end */
55 * 4ch mode
57 static const struct hda_verb alc888_4ST_ch4_intel_init[] = {
58 /* Mic-in jack as mic in */
59 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
60 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
61 /* Line-in jack as Surround */
62 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
63 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
64 /* Line-Out as Front */
65 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
66 { } /* end */
70 * 6ch mode
72 static const struct hda_verb alc888_4ST_ch6_intel_init[] = {
73 /* Mic-in jack as CLFE */
74 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
75 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
76 /* Line-in jack as Surround */
77 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
78 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
79 /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
80 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
81 { } /* end */
85 * 8ch mode
87 static const struct hda_verb alc888_4ST_ch8_intel_init[] = {
88 /* Mic-in jack as CLFE */
89 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
90 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
91 /* Line-in jack as Surround */
92 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
93 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
94 /* Line-Out as Side */
95 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
96 { } /* end */
99 static const struct hda_channel_mode alc888_4ST_8ch_intel_modes[4] = {
100 { 2, alc888_4ST_ch2_intel_init },
101 { 4, alc888_4ST_ch4_intel_init },
102 { 6, alc888_4ST_ch6_intel_init },
103 { 8, alc888_4ST_ch8_intel_init },
106 static void alc889_automute_setup(struct hda_codec *codec)
108 struct alc_spec *spec = codec->spec;
110 spec->autocfg.hp_pins[0] = 0x15;
111 spec->autocfg.speaker_pins[0] = 0x14;
112 spec->autocfg.speaker_pins[1] = 0x16;
113 spec->autocfg.speaker_pins[2] = 0x17;
114 spec->autocfg.speaker_pins[3] = 0x19;
115 spec->autocfg.speaker_pins[4] = 0x1a;
116 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
119 static void alc889_intel_init_hook(struct hda_codec *codec)
121 alc889_coef_init(codec);
122 alc_hp_automute(codec);
126 * ALC888 Acer Aspire 4930G model
129 static const struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
130 /* Front Mic: set to PIN_IN (empty by default) */
131 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
132 /* Unselect Front Mic by default in input mixer 3 */
133 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
134 /* Enable unsolicited event for HP jack */
135 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
136 /* Connect Internal HP to front */
137 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
138 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
139 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
140 /* Connect HP out to front */
141 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
142 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
143 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
144 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
149 * ALC888 Acer Aspire 6530G model
152 static const struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
153 /* Route to built-in subwoofer as well as speakers */
154 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
155 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
156 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
157 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
158 /* Bias voltage on for external mic port */
159 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
160 /* Front Mic: set to PIN_IN (empty by default) */
161 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
162 /* Unselect Front Mic by default in input mixer 3 */
163 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
164 /* Enable unsolicited event for HP jack */
165 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
166 /* Enable speaker output */
167 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
168 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
169 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
170 /* Enable headphone output */
171 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
172 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
173 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
174 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
179 *ALC888 Acer Aspire 7730G model
182 static const struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
183 /* Bias voltage on for external mic port */
184 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
185 /* Front Mic: set to PIN_IN (empty by default) */
186 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
187 /* Unselect Front Mic by default in input mixer 3 */
188 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
189 /* Enable unsolicited event for HP jack */
190 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
191 /* Enable speaker output */
192 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
193 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
194 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
195 /* Enable headphone output */
196 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
197 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
198 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
199 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
200 /*Enable internal subwoofer */
201 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
202 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
203 {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
204 {0x17, AC_VERB_SET_EAPD_BTLENABLE, 2},
209 * ALC889 Acer Aspire 8930G model
212 static const struct hda_verb alc889_acer_aspire_8930g_verbs[] = {
213 /* Front Mic: set to PIN_IN (empty by default) */
214 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
215 /* Unselect Front Mic by default in input mixer 3 */
216 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
217 /* Enable unsolicited event for HP jack */
218 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
219 /* Connect Internal Front to Front */
220 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
221 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
222 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
223 /* Connect Internal Rear to Rear */
224 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
225 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
226 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
227 /* Connect Internal CLFE to CLFE */
228 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
229 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
230 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
231 /* Connect HP out to Front */
232 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
233 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
234 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
235 /* Enable all DACs */
236 /* DAC DISABLE/MUTE 1? */
237 /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
238 {0x20, AC_VERB_SET_COEF_INDEX, 0x03},
239 {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
240 /* DAC DISABLE/MUTE 2? */
241 /* some bit here disables the other DACs. Init=0x4900 */
242 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
243 {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
244 /* DMIC fix
245 * This laptop has a stereo digital microphone. The mics are only 1cm apart
246 * which makes the stereo useless. However, either the mic or the ALC889
247 * makes the signal become a difference/sum signal instead of standard
248 * stereo, which is annoying. So instead we flip this bit which makes the
249 * codec replicate the sum signal to both channels, turning it into a
250 * normal mono mic.
252 /* DMIC_CONTROL? Init value = 0x0001 */
253 {0x20, AC_VERB_SET_COEF_INDEX, 0x0b},
254 {0x20, AC_VERB_SET_PROC_COEF, 0x0003},
258 static const struct hda_input_mux alc888_2_capture_sources[2] = {
259 /* Front mic only available on one ADC */
261 .num_items = 4,
262 .items = {
263 { "Mic", 0x0 },
264 { "Line", 0x2 },
265 { "CD", 0x4 },
266 { "Front Mic", 0xb },
270 .num_items = 3,
271 .items = {
272 { "Mic", 0x0 },
273 { "Line", 0x2 },
274 { "CD", 0x4 },
279 static const struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
280 /* Interal mic only available on one ADC */
282 .num_items = 5,
283 .items = {
284 { "Mic", 0x0 },
285 { "Line In", 0x2 },
286 { "CD", 0x4 },
287 { "Input Mix", 0xa },
288 { "Internal Mic", 0xb },
292 .num_items = 4,
293 .items = {
294 { "Mic", 0x0 },
295 { "Line In", 0x2 },
296 { "CD", 0x4 },
297 { "Input Mix", 0xa },
302 static const struct hda_input_mux alc889_capture_sources[3] = {
303 /* Digital mic only available on first "ADC" */
305 .num_items = 5,
306 .items = {
307 { "Mic", 0x0 },
308 { "Line", 0x2 },
309 { "CD", 0x4 },
310 { "Front Mic", 0xb },
311 { "Input Mix", 0xa },
315 .num_items = 4,
316 .items = {
317 { "Mic", 0x0 },
318 { "Line", 0x2 },
319 { "CD", 0x4 },
320 { "Input Mix", 0xa },
324 .num_items = 4,
325 .items = {
326 { "Mic", 0x0 },
327 { "Line", 0x2 },
328 { "CD", 0x4 },
329 { "Input Mix", 0xa },
334 static const struct snd_kcontrol_new alc888_base_mixer[] = {
335 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
336 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
337 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
338 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
339 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
340 HDA_OUTPUT),
341 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
342 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
343 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
344 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
345 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
346 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
347 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
348 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
349 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
350 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
351 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
352 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
353 { } /* end */
356 static const struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
357 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
358 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
359 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
360 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
361 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
362 HDA_OUTPUT),
363 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
364 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
365 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
366 HDA_CODEC_VOLUME_MONO("Internal LFE Playback Volume", 0x0f, 1, 0x0, HDA_OUTPUT),
367 HDA_BIND_MUTE_MONO("Internal LFE Playback Switch", 0x0f, 1, 2, HDA_INPUT),
368 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
369 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
370 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
371 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
372 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
373 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
374 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
375 { } /* end */
378 static const struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = {
379 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
380 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
381 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
382 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
383 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
384 HDA_OUTPUT),
385 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
386 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
387 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
388 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
389 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
390 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
391 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
392 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
393 { } /* end */
397 static void alc888_acer_aspire_4930g_setup(struct hda_codec *codec)
399 struct alc_spec *spec = codec->spec;
401 spec->autocfg.hp_pins[0] = 0x15;
402 spec->autocfg.speaker_pins[0] = 0x14;
403 spec->autocfg.speaker_pins[1] = 0x16;
404 spec->autocfg.speaker_pins[2] = 0x17;
405 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
408 static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
410 struct alc_spec *spec = codec->spec;
412 spec->autocfg.hp_pins[0] = 0x15;
413 spec->autocfg.speaker_pins[0] = 0x14;
414 spec->autocfg.speaker_pins[1] = 0x16;
415 spec->autocfg.speaker_pins[2] = 0x17;
416 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
419 static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec)
421 struct alc_spec *spec = codec->spec;
423 spec->autocfg.hp_pins[0] = 0x15;
424 spec->autocfg.speaker_pins[0] = 0x14;
425 spec->autocfg.speaker_pins[1] = 0x16;
426 spec->autocfg.speaker_pins[2] = 0x17;
427 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
430 static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
432 struct alc_spec *spec = codec->spec;
434 spec->autocfg.hp_pins[0] = 0x15;
435 spec->autocfg.speaker_pins[0] = 0x14;
436 spec->autocfg.speaker_pins[1] = 0x16;
437 spec->autocfg.speaker_pins[2] = 0x1b;
438 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
441 #define ALC882_DIGOUT_NID 0x06
442 #define ALC882_DIGIN_NID 0x0a
443 #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
444 #define ALC883_DIGIN_NID ALC882_DIGIN_NID
445 #define ALC1200_DIGOUT_NID 0x10
448 static const struct hda_channel_mode alc882_ch_modes[1] = {
449 { 8, NULL }
452 /* DACs */
453 static const hda_nid_t alc882_dac_nids[4] = {
454 /* front, rear, clfe, rear_surr */
455 0x02, 0x03, 0x04, 0x05
457 #define alc883_dac_nids alc882_dac_nids
459 /* ADCs */
460 #define alc882_adc_nids alc880_adc_nids
461 #define alc882_adc_nids_alt alc880_adc_nids_alt
462 #define alc883_adc_nids alc882_adc_nids_alt
463 static const hda_nid_t alc883_adc_nids_alt[1] = { 0x08 };
464 static const hda_nid_t alc883_adc_nids_rev[2] = { 0x09, 0x08 };
465 #define alc889_adc_nids alc880_adc_nids
467 static const hda_nid_t alc882_capsrc_nids[3] = { 0x24, 0x23, 0x22 };
468 static const hda_nid_t alc882_capsrc_nids_alt[2] = { 0x23, 0x22 };
469 #define alc883_capsrc_nids alc882_capsrc_nids_alt
470 static const hda_nid_t alc883_capsrc_nids_rev[2] = { 0x22, 0x23 };
471 #define alc889_capsrc_nids alc882_capsrc_nids
473 /* input MUX */
474 /* FIXME: should be a matrix-type input source selection */
476 static const struct hda_input_mux alc882_capture_source = {
477 .num_items = 4,
478 .items = {
479 { "Mic", 0x0 },
480 { "Front Mic", 0x1 },
481 { "Line", 0x2 },
482 { "CD", 0x4 },
486 #define alc883_capture_source alc882_capture_source
488 static const struct hda_input_mux alc889_capture_source = {
489 .num_items = 3,
490 .items = {
491 { "Front Mic", 0x0 },
492 { "Mic", 0x3 },
493 { "Line", 0x2 },
497 static const struct hda_input_mux mb5_capture_source = {
498 .num_items = 3,
499 .items = {
500 { "Mic", 0x1 },
501 { "Line", 0x7 },
502 { "CD", 0x4 },
506 static const struct hda_input_mux macmini3_capture_source = {
507 .num_items = 2,
508 .items = {
509 { "Line", 0x2 },
510 { "CD", 0x4 },
514 static const struct hda_input_mux alc883_3stack_6ch_intel = {
515 .num_items = 4,
516 .items = {
517 { "Mic", 0x1 },
518 { "Front Mic", 0x0 },
519 { "Line", 0x2 },
520 { "CD", 0x4 },
524 static const struct hda_input_mux alc889A_mb31_capture_source = {
525 .num_items = 2,
526 .items = {
527 { "Mic", 0x0 },
528 /* Front Mic (0x01) unused */
529 { "Line", 0x2 },
530 /* Line 2 (0x03) unused */
531 /* CD (0x04) unused? */
535 static const struct hda_input_mux alc889A_imac91_capture_source = {
536 .num_items = 2,
537 .items = {
538 { "Mic", 0x01 },
539 { "Line", 0x2 }, /* Not sure! */
544 * 2ch mode
546 static const struct hda_channel_mode alc883_3ST_2ch_modes[1] = {
547 { 2, NULL }
551 * 2ch mode
553 static const struct hda_verb alc882_3ST_ch2_init[] = {
554 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
555 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
556 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
557 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
558 { } /* end */
562 * 4ch mode
564 static const struct hda_verb alc882_3ST_ch4_init[] = {
565 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
566 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
567 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
568 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
569 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
570 { } /* end */
574 * 6ch mode
576 static const struct hda_verb alc882_3ST_ch6_init[] = {
577 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
578 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
579 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
580 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
581 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
582 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
583 { } /* end */
586 static const struct hda_channel_mode alc882_3ST_6ch_modes[3] = {
587 { 2, alc882_3ST_ch2_init },
588 { 4, alc882_3ST_ch4_init },
589 { 6, alc882_3ST_ch6_init },
592 #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
595 * 2ch mode
597 static const struct hda_verb alc883_3ST_ch2_clevo_init[] = {
598 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
599 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
600 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
601 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
602 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
603 { } /* end */
607 * 4ch mode
609 static const struct hda_verb alc883_3ST_ch4_clevo_init[] = {
610 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
611 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
612 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
613 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
614 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
615 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
616 { } /* end */
620 * 6ch mode
622 static const struct hda_verb alc883_3ST_ch6_clevo_init[] = {
623 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
624 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
625 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
626 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
627 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
628 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
629 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
630 { } /* end */
633 static const struct hda_channel_mode alc883_3ST_6ch_clevo_modes[3] = {
634 { 2, alc883_3ST_ch2_clevo_init },
635 { 4, alc883_3ST_ch4_clevo_init },
636 { 6, alc883_3ST_ch6_clevo_init },
641 * 6ch mode
643 static const struct hda_verb alc882_sixstack_ch6_init[] = {
644 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
645 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
646 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
647 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
648 { } /* end */
652 * 8ch mode
654 static const struct hda_verb alc882_sixstack_ch8_init[] = {
655 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
656 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
657 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
658 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
659 { } /* end */
662 static const struct hda_channel_mode alc882_sixstack_modes[2] = {
663 { 6, alc882_sixstack_ch6_init },
664 { 8, alc882_sixstack_ch8_init },
668 /* Macbook Air 2,1 */
670 static const struct hda_channel_mode alc885_mba21_ch_modes[1] = {
671 { 2, NULL },
675 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
679 * 2ch mode
681 static const struct hda_verb alc885_mbp_ch2_init[] = {
682 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
683 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
684 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
685 { } /* end */
689 * 4ch mode
691 static const struct hda_verb alc885_mbp_ch4_init[] = {
692 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
693 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
694 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
695 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
696 { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
697 { } /* end */
700 static const struct hda_channel_mode alc885_mbp_4ch_modes[2] = {
701 { 2, alc885_mbp_ch2_init },
702 { 4, alc885_mbp_ch4_init },
706 * 2ch
707 * Speakers/Woofer/HP = Front
708 * LineIn = Input
710 static const struct hda_verb alc885_mb5_ch2_init[] = {
711 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
712 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
713 { } /* end */
717 * 6ch mode
718 * Speakers/HP = Front
719 * Woofer = LFE
720 * LineIn = Surround
722 static const struct hda_verb alc885_mb5_ch6_init[] = {
723 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
724 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
725 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
726 { } /* end */
729 static const struct hda_channel_mode alc885_mb5_6ch_modes[2] = {
730 { 2, alc885_mb5_ch2_init },
731 { 6, alc885_mb5_ch6_init },
734 #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes
737 * 2ch mode
739 static const struct hda_verb alc883_4ST_ch2_init[] = {
740 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
741 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
742 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
743 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
744 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
745 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
746 { } /* end */
750 * 4ch mode
752 static const struct hda_verb alc883_4ST_ch4_init[] = {
753 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
754 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
755 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
756 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
757 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
758 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
759 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
760 { } /* end */
764 * 6ch mode
766 static const struct hda_verb alc883_4ST_ch6_init[] = {
767 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
768 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
769 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
770 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
771 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
772 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
773 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
774 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
775 { } /* end */
779 * 8ch mode
781 static const struct hda_verb alc883_4ST_ch8_init[] = {
782 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
783 { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
784 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
785 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
786 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
787 { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
788 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
789 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
790 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
791 { } /* end */
794 static const struct hda_channel_mode alc883_4ST_8ch_modes[4] = {
795 { 2, alc883_4ST_ch2_init },
796 { 4, alc883_4ST_ch4_init },
797 { 6, alc883_4ST_ch6_init },
798 { 8, alc883_4ST_ch8_init },
803 * 2ch mode
805 static const struct hda_verb alc883_3ST_ch2_intel_init[] = {
806 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
807 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
808 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
809 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
810 { } /* end */
814 * 4ch mode
816 static const struct hda_verb alc883_3ST_ch4_intel_init[] = {
817 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
818 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
819 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
820 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
821 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
822 { } /* end */
826 * 6ch mode
828 static const struct hda_verb alc883_3ST_ch6_intel_init[] = {
829 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
830 { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
831 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x02 },
832 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
833 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
834 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
835 { } /* end */
838 static const struct hda_channel_mode alc883_3ST_6ch_intel_modes[3] = {
839 { 2, alc883_3ST_ch2_intel_init },
840 { 4, alc883_3ST_ch4_intel_init },
841 { 6, alc883_3ST_ch6_intel_init },
845 * 2ch mode
847 static const struct hda_verb alc889_ch2_intel_init[] = {
848 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
849 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x00 },
850 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x00 },
851 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00 },
852 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
853 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
854 { } /* end */
858 * 6ch mode
860 static const struct hda_verb alc889_ch6_intel_init[] = {
861 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
862 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
863 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
864 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
865 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
866 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
867 { } /* end */
871 * 8ch mode
873 static const struct hda_verb alc889_ch8_intel_init[] = {
874 { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
875 { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
876 { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
877 { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
878 { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x03 },
879 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
880 { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
881 { } /* end */
884 static const struct hda_channel_mode alc889_8ch_intel_modes[3] = {
885 { 2, alc889_ch2_intel_init },
886 { 6, alc889_ch6_intel_init },
887 { 8, alc889_ch8_intel_init },
891 * 6ch mode
893 static const struct hda_verb alc883_sixstack_ch6_init[] = {
894 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
895 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
896 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
897 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
898 { } /* end */
902 * 8ch mode
904 static const struct hda_verb alc883_sixstack_ch8_init[] = {
905 { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
906 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
907 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
908 { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
909 { } /* end */
912 static const struct hda_channel_mode alc883_sixstack_modes[2] = {
913 { 6, alc883_sixstack_ch6_init },
914 { 8, alc883_sixstack_ch8_init },
918 /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
919 * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
921 static const struct snd_kcontrol_new alc882_base_mixer[] = {
922 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
923 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
924 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
925 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
926 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
927 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
928 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
929 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
930 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
931 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
932 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
933 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
934 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
935 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
936 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
937 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
938 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
939 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
940 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
941 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
942 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
943 { } /* end */
946 /* Macbook Air 2,1 same control for HP and internal Speaker */
948 static const struct snd_kcontrol_new alc885_mba21_mixer[] = {
949 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
950 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
955 static const struct snd_kcontrol_new alc885_mbp3_mixer[] = {
956 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
957 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
958 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
959 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT),
960 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
961 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
962 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
963 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
964 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
965 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
966 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
967 { } /* end */
970 static const struct snd_kcontrol_new alc885_mb5_mixer[] = {
971 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
972 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
973 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
974 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
975 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
976 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
977 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
978 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
979 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
980 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
981 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
982 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
983 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
984 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0x00, HDA_INPUT),
985 { } /* end */
988 static const struct snd_kcontrol_new alc885_macmini3_mixer[] = {
989 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
990 HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
991 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
992 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
993 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
994 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
995 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
996 HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
997 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
998 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
999 HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
1000 { } /* end */
1003 static const struct snd_kcontrol_new alc885_imac91_mixer[] = {
1004 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1005 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
1006 { } /* end */
1010 static const struct snd_kcontrol_new alc882_w2jc_mixer[] = {
1011 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1012 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1013 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1014 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1015 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1016 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1017 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1018 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1019 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1020 { } /* end */
1023 static const struct snd_kcontrol_new alc882_targa_mixer[] = {
1024 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1025 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1026 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1027 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1028 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1029 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1030 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1031 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1032 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1033 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1034 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1035 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1036 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1037 { } /* end */
1040 static const struct snd_kcontrol_new alc882_chmode_mixer[] = {
1042 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1043 .name = "Channel Mode",
1044 .info = alc_ch_mode_info,
1045 .get = alc_ch_mode_get,
1046 .put = alc_ch_mode_put,
1048 { } /* end */
1051 static const struct hda_verb alc882_base_init_verbs[] = {
1052 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1053 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1054 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1055 /* Rear mixer */
1056 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1057 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1058 /* CLFE mixer */
1059 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1060 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1061 /* Side mixer */
1062 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1063 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1065 /* Front Pin: output 0 (0x0c) */
1066 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1067 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1068 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1069 /* Rear Pin: output 1 (0x0d) */
1070 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1071 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1072 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
1073 /* CLFE Pin: output 2 (0x0e) */
1074 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1075 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1076 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
1077 /* Side Pin: output 3 (0x0f) */
1078 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1079 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1080 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1081 /* Mic (rear) pin: input vref at 80% */
1082 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1083 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1084 /* Front Mic pin: input vref at 80% */
1085 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1086 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1087 /* Line In pin: input */
1088 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1089 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1090 /* Line-2 In: Headphone output (output 0 - 0x0c) */
1091 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1092 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1093 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
1094 /* CD pin widget for input */
1095 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1097 /* FIXME: use matrix-type input source selection */
1098 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1099 /* Input mixer2 */
1100 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1101 /* Input mixer3 */
1102 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1103 /* ADC2: mute amp left and right */
1104 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1105 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1106 /* ADC3: mute amp left and right */
1107 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1108 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1113 static const struct hda_verb alc882_adc1_init_verbs[] = {
1114 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1115 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1116 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1117 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1118 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1119 /* ADC1: mute amp left and right */
1120 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1121 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1125 static const struct hda_verb alc882_eapd_verbs[] = {
1126 /* change to EAPD mode */
1127 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
1128 {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
1132 static const struct hda_verb alc889_eapd_verbs[] = {
1133 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
1134 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
1138 static const struct hda_verb alc_hp15_unsol_verbs[] = {
1139 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
1140 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1144 static const struct hda_verb alc885_init_verbs[] = {
1145 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1146 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1147 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1148 /* Rear mixer */
1149 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1150 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1151 /* CLFE mixer */
1152 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1153 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1154 /* Side mixer */
1155 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1156 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1158 /* Front HP Pin: output 0 (0x0c) */
1159 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1160 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1161 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1162 /* Front Pin: output 0 (0x0c) */
1163 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1164 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1165 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1166 /* Rear Pin: output 1 (0x0d) */
1167 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1168 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1169 {0x19, AC_VERB_SET_CONNECT_SEL, 0x01},
1170 /* CLFE Pin: output 2 (0x0e) */
1171 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1172 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1173 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
1174 /* Side Pin: output 3 (0x0f) */
1175 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1176 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1177 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1178 /* Mic (rear) pin: input vref at 80% */
1179 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1180 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1181 /* Front Mic pin: input vref at 80% */
1182 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1183 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1184 /* Line In pin: input */
1185 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1186 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1188 /* Mixer elements: 0x18, , 0x1a, 0x1b */
1189 /* Input mixer1 */
1190 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1191 /* Input mixer2 */
1192 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1193 /* Input mixer3 */
1194 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1195 /* ADC2: mute amp left and right */
1196 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1197 /* ADC3: mute amp left and right */
1198 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1203 static const struct hda_verb alc885_init_input_verbs[] = {
1204 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1205 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
1206 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
1211 /* Unmute Selector 24h and set the default input to front mic */
1212 static const struct hda_verb alc889_init_input_verbs[] = {
1213 {0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
1214 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1219 #define alc883_init_verbs alc882_base_init_verbs
1221 /* Mac Pro test */
1222 static const struct snd_kcontrol_new alc882_macpro_mixer[] = {
1223 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1224 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1225 HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT),
1226 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
1227 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
1228 /* FIXME: this looks suspicious...
1229 HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
1230 HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
1232 { } /* end */
1235 static const struct hda_verb alc882_macpro_init_verbs[] = {
1236 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1237 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1238 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1239 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1240 /* Front Pin: output 0 (0x0c) */
1241 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1242 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1243 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1244 /* Front Mic pin: input vref at 80% */
1245 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1246 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1247 /* Speaker: output */
1248 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1249 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1250 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x04},
1251 /* Headphone output (output 0 - 0x0c) */
1252 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1253 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1254 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1256 /* FIXME: use matrix-type input source selection */
1257 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1258 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1259 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1260 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1261 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1262 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1263 /* Input mixer2 */
1264 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1265 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1266 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1267 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1268 /* Input mixer3 */
1269 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1270 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1271 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1272 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1273 /* ADC1: mute amp left and right */
1274 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1275 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1276 /* ADC2: mute amp left and right */
1277 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1278 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1279 /* ADC3: mute amp left and right */
1280 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1281 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1286 /* Macbook 5,1 */
1287 static const struct hda_verb alc885_mb5_init_verbs[] = {
1288 /* DACs */
1289 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1290 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1291 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1292 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1293 /* Front mixer */
1294 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1295 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1296 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1297 /* Surround mixer */
1298 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1299 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1300 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1301 /* LFE mixer */
1302 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1303 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1304 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1305 /* HP mixer */
1306 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1307 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1308 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1309 /* Front Pin (0x0c) */
1310 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1311 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1312 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1313 /* LFE Pin (0x0e) */
1314 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1315 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1316 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
1317 /* HP Pin (0x0f) */
1318 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1319 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1320 {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
1321 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1322 /* Front Mic pin: input vref at 80% */
1323 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1324 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1325 /* Line In pin */
1326 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1327 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1329 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0x1)},
1330 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x7)},
1331 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x4)},
1335 /* Macmini 3,1 */
1336 static const struct hda_verb alc885_macmini3_init_verbs[] = {
1337 /* DACs */
1338 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1339 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1340 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1341 {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1342 /* Front mixer */
1343 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1344 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1345 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1346 /* Surround mixer */
1347 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1348 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1349 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1350 /* LFE mixer */
1351 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1352 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1353 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1354 /* HP mixer */
1355 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1356 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1357 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1358 /* Front Pin (0x0c) */
1359 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1360 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1361 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1362 /* LFE Pin (0x0e) */
1363 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
1364 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1365 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
1366 /* HP Pin (0x0f) */
1367 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1368 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1369 {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
1370 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1371 /* Line In pin */
1372 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1373 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1375 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1376 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1377 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1378 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1383 static const struct hda_verb alc885_mba21_init_verbs[] = {
1384 /*Internal and HP Speaker Mixer*/
1385 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1386 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1387 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1388 /*Internal Speaker Pin (0x0c)*/
1389 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1390 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1391 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1392 /* HP Pin: output 0 (0x0e) */
1393 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
1394 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1395 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1396 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
1397 /* Line in (is hp when jack connected)*/
1398 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
1399 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1405 /* Macbook Pro rev3 */
1406 static const struct hda_verb alc885_mbp3_init_verbs[] = {
1407 /* Front mixer: unmute input/output amp left and right (volume = 0) */
1408 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1409 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1410 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1411 /* Rear mixer */
1412 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1413 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1414 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1415 /* HP mixer */
1416 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1417 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1418 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1419 /* Front Pin: output 0 (0x0c) */
1420 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1421 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1422 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1423 /* HP Pin: output 0 (0x0e) */
1424 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
1425 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1426 {0x15, AC_VERB_SET_CONNECT_SEL, 0x02},
1427 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1428 /* Mic (rear) pin: input vref at 80% */
1429 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1430 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1431 /* Front Mic pin: input vref at 80% */
1432 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1433 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1434 /* Line In pin: use output 1 when in LineOut mode */
1435 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1436 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1437 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
1439 /* FIXME: use matrix-type input source selection */
1440 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
1441 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
1442 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1443 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1444 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1445 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1446 /* Input mixer2 */
1447 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1448 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1449 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1450 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1451 /* Input mixer3 */
1452 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1453 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1454 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1455 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1456 /* ADC1: mute amp left and right */
1457 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1458 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1459 /* ADC2: mute amp left and right */
1460 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1461 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1462 /* ADC3: mute amp left and right */
1463 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1464 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1469 /* iMac 9,1 */
1470 static const struct hda_verb alc885_imac91_init_verbs[] = {
1471 /* Internal Speaker Pin (0x0c) */
1472 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1473 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1474 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1475 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
1476 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1477 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
1478 /* HP Pin: Rear */
1479 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1480 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1481 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1482 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
1483 /* Line in Rear */
1484 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
1485 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1486 /* Front Mic pin: input vref at 80% */
1487 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1488 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1489 /* Rear mixer */
1490 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1491 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1492 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1493 /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
1494 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
1495 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1496 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
1497 /* 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1498 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1499 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1500 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1501 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1502 /* 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1503 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1504 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1505 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1506 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1507 /* 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
1508 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1509 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
1510 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
1511 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
1512 /* 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1513 {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1514 {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
1515 /* 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1516 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1517 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
1518 /* 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
1519 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
1520 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
1524 /* iMac 24 mixer. */
1525 static const struct snd_kcontrol_new alc885_imac24_mixer[] = {
1526 HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1527 HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT),
1528 { } /* end */
1531 /* iMac 24 init verbs. */
1532 static const struct hda_verb alc885_imac24_init_verbs[] = {
1533 /* Internal speakers: output 0 (0x0c) */
1534 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1535 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1536 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
1537 /* Internal speakers: output 0 (0x0c) */
1538 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1539 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1540 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
1541 /* Headphone: output 0 (0x0c) */
1542 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1543 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1544 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
1545 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1546 /* Front Mic: input vref at 80% */
1547 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1548 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1552 /* Toggle speaker-output according to the hp-jack state */
1553 static void alc885_imac24_setup(struct hda_codec *codec)
1555 struct alc_spec *spec = codec->spec;
1557 spec->autocfg.hp_pins[0] = 0x14;
1558 spec->autocfg.speaker_pins[0] = 0x18;
1559 spec->autocfg.speaker_pins[1] = 0x1a;
1560 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1563 #define alc885_mb5_setup alc885_imac24_setup
1564 #define alc885_macmini3_setup alc885_imac24_setup
1566 /* Macbook Air 2,1 */
1567 static void alc885_mba21_setup(struct hda_codec *codec)
1569 struct alc_spec *spec = codec->spec;
1571 spec->autocfg.hp_pins[0] = 0x14;
1572 spec->autocfg.speaker_pins[0] = 0x18;
1573 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1578 static void alc885_mbp3_setup(struct hda_codec *codec)
1580 struct alc_spec *spec = codec->spec;
1582 spec->autocfg.hp_pins[0] = 0x15;
1583 spec->autocfg.speaker_pins[0] = 0x14;
1584 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1587 static void alc885_imac91_setup(struct hda_codec *codec)
1589 struct alc_spec *spec = codec->spec;
1591 spec->autocfg.hp_pins[0] = 0x14;
1592 spec->autocfg.speaker_pins[0] = 0x18;
1593 spec->autocfg.speaker_pins[1] = 0x1a;
1594 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1597 static const struct hda_verb alc882_targa_verbs[] = {
1598 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1599 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1601 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1602 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1604 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
1605 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
1606 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
1608 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1609 { } /* end */
1612 /* toggle speaker-output according to the hp-jack state */
1613 static void alc882_targa_automute(struct hda_codec *codec)
1615 struct alc_spec *spec = codec->spec;
1616 alc_hp_automute(codec);
1617 snd_hda_codec_write_cache(codec, 1, 0, AC_VERB_SET_GPIO_DATA,
1618 spec->hp_jack_present ? 1 : 3);
1621 static void alc882_targa_setup(struct hda_codec *codec)
1623 struct alc_spec *spec = codec->spec;
1625 spec->autocfg.hp_pins[0] = 0x14;
1626 spec->autocfg.speaker_pins[0] = 0x1b;
1627 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
1630 static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res)
1632 if ((res >> 26) == ALC_HP_EVENT)
1633 alc882_targa_automute(codec);
1636 static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
1638 unsigned int gpiostate, gpiomask, gpiodir;
1640 gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
1641 AC_VERB_GET_GPIO_DATA, 0);
1643 if (!muted)
1644 gpiostate |= (1 << pin);
1645 else
1646 gpiostate &= ~(1 << pin);
1648 gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
1649 AC_VERB_GET_GPIO_MASK, 0);
1650 gpiomask |= (1 << pin);
1652 gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
1653 AC_VERB_GET_GPIO_DIRECTION, 0);
1654 gpiodir |= (1 << pin);
1657 snd_hda_codec_write(codec, codec->afg, 0,
1658 AC_VERB_SET_GPIO_MASK, gpiomask);
1659 snd_hda_codec_write(codec, codec->afg, 0,
1660 AC_VERB_SET_GPIO_DIRECTION, gpiodir);
1662 msleep(1);
1664 snd_hda_codec_write(codec, codec->afg, 0,
1665 AC_VERB_SET_GPIO_DATA, gpiostate);
1668 /* set up GPIO at initialization */
1669 static void alc885_macpro_init_hook(struct hda_codec *codec)
1671 alc882_gpio_mute(codec, 0, 0);
1672 alc882_gpio_mute(codec, 1, 0);
1675 /* set up GPIO and update auto-muting at initialization */
1676 static void alc885_imac24_init_hook(struct hda_codec *codec)
1678 alc885_macpro_init_hook(codec);
1679 alc_hp_automute(codec);
1682 /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
1683 static const struct hda_verb alc889A_mb31_ch2_init[] = {
1684 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
1685 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
1686 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
1687 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
1688 { } /* end */
1691 /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
1692 static const struct hda_verb alc889A_mb31_ch4_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_OUT}, /* Line as output */
1696 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
1697 { } /* end */
1700 /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
1701 static const struct hda_verb alc889A_mb31_ch5_init[] = {
1702 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as rear */
1703 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
1704 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
1705 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
1706 { } /* end */
1709 /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
1710 static const struct hda_verb alc889A_mb31_ch6_init[] = {
1711 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as front */
1712 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Subwoofer off */
1713 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
1714 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
1715 { } /* end */
1718 static const struct hda_channel_mode alc889A_mb31_6ch_modes[4] = {
1719 { 2, alc889A_mb31_ch2_init },
1720 { 4, alc889A_mb31_ch4_init },
1721 { 5, alc889A_mb31_ch5_init },
1722 { 6, alc889A_mb31_ch6_init },
1725 #define alc883_base_mixer alc882_base_mixer
1727 static const struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
1728 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1729 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1730 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1731 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1732 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1733 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1734 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1735 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1736 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1737 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1738 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1739 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1740 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1741 { } /* end */
1744 static const struct snd_kcontrol_new alc883_3ST_6ch_mixer[] = {
1745 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1746 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1747 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1748 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1749 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1750 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1751 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1752 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1753 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1754 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1755 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1756 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1757 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1758 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1759 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1760 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1761 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1762 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1763 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1764 { } /* end */
1767 static const struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer[] = {
1768 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1769 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1770 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1771 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1772 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1773 HDA_OUTPUT),
1774 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1775 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1776 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1777 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1778 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1779 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1780 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1781 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1782 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1783 HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT),
1784 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1785 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1786 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
1787 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1788 { } /* end */
1791 static const struct snd_kcontrol_new alc885_8ch_intel_mixer[] = {
1792 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1793 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1794 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1795 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1796 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
1797 HDA_OUTPUT),
1798 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1799 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1800 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1801 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1802 HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT),
1803 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
1804 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1805 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1806 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
1807 HDA_CODEC_VOLUME("Mic Boost Volume", 0x1b, 0, HDA_INPUT),
1808 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
1809 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1810 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
1811 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1812 { } /* end */
1815 static const struct snd_kcontrol_new alc883_fivestack_mixer[] = {
1816 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1817 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1818 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1819 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1820 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1821 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1822 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1823 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1824 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1825 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1826 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1827 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1828 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1829 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1830 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1831 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1832 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1833 HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
1834 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1835 { } /* end */
1838 static const struct snd_kcontrol_new alc883_targa_mixer[] = {
1839 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1840 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1841 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
1842 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1843 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
1844 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
1845 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
1846 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
1847 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
1848 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
1849 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1850 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1851 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1852 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1853 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1854 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1855 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1856 { } /* end */
1859 static const struct snd_kcontrol_new alc883_targa_2ch_mixer[] = {
1860 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1861 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1862 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
1863 HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
1864 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1865 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1866 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1867 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1868 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1869 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1870 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
1871 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1872 { } /* end */
1875 static const struct snd_kcontrol_new alc883_targa_8ch_mixer[] = {
1876 HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1877 HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
1878 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
1879 HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
1880 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
1881 { } /* end */
1884 static const struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
1885 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1886 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
1887 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
1888 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1889 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1890 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1891 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1892 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1893 { } /* end */
1896 static const struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
1897 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
1898 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
1899 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1900 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1901 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
1902 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
1903 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
1904 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
1905 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
1906 { } /* end */
1909 static const struct snd_kcontrol_new alc889A_mb31_mixer[] = {
1910 /* Output mixers */
1911 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
1912 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
1913 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
1914 HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
1915 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
1916 HDA_OUTPUT),
1917 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT),
1918 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT),
1919 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT),
1920 /* Output switches */
1921 HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT),
1922 HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT),
1923 HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT),
1924 /* Boost mixers */
1925 HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
1926 HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
1927 /* Input mixers */
1928 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
1929 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
1930 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
1931 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
1932 { } /* end */
1935 static const struct hda_bind_ctls alc883_bind_cap_vol = {
1936 .ops = &snd_hda_bind_vol,
1937 .values = {
1938 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
1939 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
1944 static const struct hda_bind_ctls alc883_bind_cap_switch = {
1945 .ops = &snd_hda_bind_sw,
1946 .values = {
1947 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
1948 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
1953 static const struct snd_kcontrol_new alc883_chmode_mixer[] = {
1955 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1956 .name = "Channel Mode",
1957 .info = alc_ch_mode_info,
1958 .get = alc_ch_mode_get,
1959 .put = alc_ch_mode_put,
1961 { } /* end */
1964 static const struct hda_verb alc883_targa_verbs[] = {
1965 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1966 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1968 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1969 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1971 /* Connect Line-Out side jack (SPDIF) to Side */
1972 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1973 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1974 {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
1975 /* Connect Mic jack to CLFE */
1976 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1977 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1978 {0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
1979 /* Connect Line-in jack to Surround */
1980 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1981 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1982 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
1983 /* Connect HP out jack to Front */
1984 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1985 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1986 {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
1988 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
1990 { } /* end */
1993 /* toggle speaker-output according to the hp-jack state */
1994 #define alc883_targa_init_hook alc882_targa_init_hook
1995 #define alc883_targa_unsol_event alc882_targa_unsol_event
1997 /* toggle speaker-output according to the hp-jack state */
1998 static void alc883_acer_aspire_setup(struct hda_codec *codec)
2000 struct alc_spec *spec = codec->spec;
2002 spec->autocfg.hp_pins[0] = 0x14;
2003 spec->autocfg.speaker_pins[0] = 0x15;
2004 spec->autocfg.speaker_pins[1] = 0x16;
2005 alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
2008 static const struct hda_verb alc883_acer_eapd_verbs[] = {
2009 /* HP Pin: output 0 (0x0c) */
2010 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
2011 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2012 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
2013 /* Front Pin: output 0 (0x0c) */
2014 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2015 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
2016 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2017 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
2018 /* eanable EAPD on medion laptop */
2019 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
2020 {0x20, AC_VERB_SET_PROC_COEF, 0x3050},
2021 /* enable unsolicited event */
2022 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2026 static const struct hda_verb alc889A_mb31_verbs[] = {
2027 /* Init rear pin (used as headphone output) */
2028 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, /* Apple Headphones */
2029 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Connect to front */
2030 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
2031 /* Init line pin (used as output in 4ch and 6ch mode) */
2032 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Connect to CLFE */
2033 /* Init line 2 pin (used as headphone out by default) */
2034 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Use as input */
2035 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Mute output */
2036 { } /* end */
2039 /* Mute speakers according to the headphone jack state */
2040 static void alc889A_mb31_automute(struct hda_codec *codec)
2042 unsigned int present;
2044 /* Mute only in 2ch or 4ch mode */
2045 if (snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_CONNECT_SEL, 0)
2046 == 0x00) {
2047 present = snd_hda_jack_detect(codec, 0x15);
2048 snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
2049 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
2050 snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
2051 HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
2055 static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
2057 if ((res >> 26) == ALC_HP_EVENT)
2058 alc889A_mb31_automute(codec);
2061 static const hda_nid_t alc883_slave_dig_outs[] = {
2062 ALC1200_DIGOUT_NID, 0,
2065 static const hda_nid_t alc1200_slave_dig_outs[] = {
2066 ALC883_DIGOUT_NID, 0,
2070 * configuration and preset
2072 static const char * const alc882_models[ALC882_MODEL_LAST] = {
2073 [ALC882_3ST_DIG] = "3stack-dig",
2074 [ALC882_6ST_DIG] = "6stack-dig",
2075 [ALC882_W2JC] = "w2jc",
2076 [ALC882_TARGA] = "targa",
2077 [ALC885_MACPRO] = "macpro",
2078 [ALC885_MB5] = "mb5",
2079 [ALC885_MACMINI3] = "macmini3",
2080 [ALC885_MBA21] = "mba21",
2081 [ALC885_MBP3] = "mbp3",
2082 [ALC885_IMAC24] = "imac24",
2083 [ALC885_IMAC91] = "imac91",
2084 [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
2085 [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
2086 [ALC883_3ST_6ch] = "3stack-6ch",
2087 [ALC883_6ST_DIG] = "alc883-6stack-dig",
2088 [ALC883_TARGA_DIG] = "targa-dig",
2089 [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
2090 [ALC883_TARGA_8ch_DIG] = "targa-8ch-dig",
2091 [ALC883_ACER_ASPIRE] = "acer-aspire",
2092 [ALC888_ACER_ASPIRE_4930G] = "acer-aspire-4930g",
2093 [ALC888_ACER_ASPIRE_6530G] = "acer-aspire-6530g",
2094 [ALC888_ACER_ASPIRE_8930G] = "acer-aspire-8930g",
2095 [ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g",
2096 [ALC883_3ST_6ch_INTEL] = "3stack-6ch-intel",
2097 [ALC889A_INTEL] = "intel-alc889a",
2098 [ALC889_INTEL] = "intel-x58",
2099 [ALC889A_MB31] = "mb31",
2100 [ALC882_AUTO] = "auto",
2103 static const struct snd_pci_quirk alc882_cfg_tbl[] = {
2104 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
2106 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
2107 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
2108 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE),
2109 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
2110 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
2111 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
2112 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2113 ALC888_ACER_ASPIRE_4930G),
2114 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2115 ALC888_ACER_ASPIRE_4930G),
2116 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2117 ALC888_ACER_ASPIRE_8930G),
2118 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2119 ALC888_ACER_ASPIRE_8930G),
2120 SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO),
2121 SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO),
2122 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2123 ALC888_ACER_ASPIRE_6530G),
2124 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2125 ALC888_ACER_ASPIRE_6530G),
2126 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2127 ALC888_ACER_ASPIRE_7730G),
2129 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavilion", ALC883_6ST_DIG),
2130 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
2132 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
2133 SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
2134 SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
2135 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
2136 SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG),
2138 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
2139 SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
2140 SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
2141 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
2143 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
2144 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
2145 SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
2146 SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
2147 SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
2148 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
2149 SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
2150 SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
2151 SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
2152 SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
2153 SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
2154 SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
2155 SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
2156 SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG),
2157 SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG),
2158 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
2159 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
2160 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
2161 SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG),
2162 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG),
2163 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
2164 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
2165 SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG),
2166 SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG),
2167 SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG),
2168 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
2169 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
2170 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
2171 SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG),
2172 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
2173 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
2175 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
2176 SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG),
2177 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
2178 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
2180 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
2181 SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
2182 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL),
2183 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL),
2184 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL),
2185 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG),
2190 /* codec SSID table for Intel Mac */
2191 static const struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
2192 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3),
2193 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3),
2194 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3),
2195 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO),
2196 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
2197 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
2198 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
2199 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
2200 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC885_MBP3),
2201 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC885_MBA21),
2202 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
2203 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
2204 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
2205 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
2206 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
2207 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
2208 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
2209 * so apparently no perfect solution yet
2211 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
2212 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
2213 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3),
2214 {} /* terminator */
2217 static const struct alc_config_preset alc882_presets[] = {
2218 [ALC882_3ST_DIG] = {
2219 .mixers = { alc882_base_mixer },
2220 .init_verbs = { alc882_base_init_verbs,
2221 alc882_adc1_init_verbs },
2222 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2223 .dac_nids = alc882_dac_nids,
2224 .dig_out_nid = ALC882_DIGOUT_NID,
2225 .dig_in_nid = ALC882_DIGIN_NID,
2226 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
2227 .channel_mode = alc882_ch_modes,
2228 .need_dac_fix = 1,
2229 .input_mux = &alc882_capture_source,
2231 [ALC882_6ST_DIG] = {
2232 .mixers = { alc882_base_mixer, alc882_chmode_mixer },
2233 .init_verbs = { alc882_base_init_verbs,
2234 alc882_adc1_init_verbs },
2235 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2236 .dac_nids = alc882_dac_nids,
2237 .dig_out_nid = ALC882_DIGOUT_NID,
2238 .dig_in_nid = ALC882_DIGIN_NID,
2239 .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
2240 .channel_mode = alc882_sixstack_modes,
2241 .input_mux = &alc882_capture_source,
2243 [ALC882_W2JC] = {
2244 .mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
2245 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
2246 alc882_eapd_verbs, alc880_gpio1_init_verbs },
2247 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2248 .dac_nids = alc882_dac_nids,
2249 .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
2250 .channel_mode = alc880_threestack_modes,
2251 .need_dac_fix = 1,
2252 .input_mux = &alc882_capture_source,
2253 .dig_out_nid = ALC882_DIGOUT_NID,
2255 [ALC885_MBA21] = {
2256 .mixers = { alc885_mba21_mixer },
2257 .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
2258 .num_dacs = 2,
2259 .dac_nids = alc882_dac_nids,
2260 .channel_mode = alc885_mba21_ch_modes,
2261 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
2262 .input_mux = &alc882_capture_source,
2263 .unsol_event = alc_sku_unsol_event,
2264 .setup = alc885_mba21_setup,
2265 .init_hook = alc_hp_automute,
2267 [ALC885_MBP3] = {
2268 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
2269 .init_verbs = { alc885_mbp3_init_verbs,
2270 alc880_gpio1_init_verbs },
2271 .num_dacs = 2,
2272 .dac_nids = alc882_dac_nids,
2273 .hp_nid = 0x04,
2274 .channel_mode = alc885_mbp_4ch_modes,
2275 .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
2276 .input_mux = &alc882_capture_source,
2277 .dig_out_nid = ALC882_DIGOUT_NID,
2278 .dig_in_nid = ALC882_DIGIN_NID,
2279 .unsol_event = alc_sku_unsol_event,
2280 .setup = alc885_mbp3_setup,
2281 .init_hook = alc_hp_automute,
2283 [ALC885_MB5] = {
2284 .mixers = { alc885_mb5_mixer, alc882_chmode_mixer },
2285 .init_verbs = { alc885_mb5_init_verbs,
2286 alc880_gpio1_init_verbs },
2287 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2288 .dac_nids = alc882_dac_nids,
2289 .channel_mode = alc885_mb5_6ch_modes,
2290 .num_channel_mode = ARRAY_SIZE(alc885_mb5_6ch_modes),
2291 .input_mux = &mb5_capture_source,
2292 .dig_out_nid = ALC882_DIGOUT_NID,
2293 .dig_in_nid = ALC882_DIGIN_NID,
2294 .unsol_event = alc_sku_unsol_event,
2295 .setup = alc885_mb5_setup,
2296 .init_hook = alc_hp_automute,
2298 [ALC885_MACMINI3] = {
2299 .mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
2300 .init_verbs = { alc885_macmini3_init_verbs,
2301 alc880_gpio1_init_verbs },
2302 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2303 .dac_nids = alc882_dac_nids,
2304 .channel_mode = alc885_macmini3_6ch_modes,
2305 .num_channel_mode = ARRAY_SIZE(alc885_macmini3_6ch_modes),
2306 .input_mux = &macmini3_capture_source,
2307 .dig_out_nid = ALC882_DIGOUT_NID,
2308 .dig_in_nid = ALC882_DIGIN_NID,
2309 .unsol_event = alc_sku_unsol_event,
2310 .setup = alc885_macmini3_setup,
2311 .init_hook = alc_hp_automute,
2313 [ALC885_MACPRO] = {
2314 .mixers = { alc882_macpro_mixer },
2315 .init_verbs = { alc882_macpro_init_verbs },
2316 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2317 .dac_nids = alc882_dac_nids,
2318 .dig_out_nid = ALC882_DIGOUT_NID,
2319 .dig_in_nid = ALC882_DIGIN_NID,
2320 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
2321 .channel_mode = alc882_ch_modes,
2322 .input_mux = &alc882_capture_source,
2323 .init_hook = alc885_macpro_init_hook,
2325 [ALC885_IMAC24] = {
2326 .mixers = { alc885_imac24_mixer },
2327 .init_verbs = { alc885_imac24_init_verbs },
2328 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2329 .dac_nids = alc882_dac_nids,
2330 .dig_out_nid = ALC882_DIGOUT_NID,
2331 .dig_in_nid = ALC882_DIGIN_NID,
2332 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
2333 .channel_mode = alc882_ch_modes,
2334 .input_mux = &alc882_capture_source,
2335 .unsol_event = alc_sku_unsol_event,
2336 .setup = alc885_imac24_setup,
2337 .init_hook = alc885_imac24_init_hook,
2339 [ALC885_IMAC91] = {
2340 .mixers = {alc885_imac91_mixer},
2341 .init_verbs = { alc885_imac91_init_verbs,
2342 alc880_gpio1_init_verbs },
2343 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2344 .dac_nids = alc882_dac_nids,
2345 .channel_mode = alc885_mba21_ch_modes,
2346 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
2347 .input_mux = &alc889A_imac91_capture_source,
2348 .dig_out_nid = ALC882_DIGOUT_NID,
2349 .dig_in_nid = ALC882_DIGIN_NID,
2350 .unsol_event = alc_sku_unsol_event,
2351 .setup = alc885_imac91_setup,
2352 .init_hook = alc_hp_automute,
2354 [ALC882_TARGA] = {
2355 .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
2356 .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
2357 alc880_gpio3_init_verbs, alc882_targa_verbs},
2358 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
2359 .dac_nids = alc882_dac_nids,
2360 .dig_out_nid = ALC882_DIGOUT_NID,
2361 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
2362 .adc_nids = alc882_adc_nids,
2363 .capsrc_nids = alc882_capsrc_nids,
2364 .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
2365 .channel_mode = alc882_3ST_6ch_modes,
2366 .need_dac_fix = 1,
2367 .input_mux = &alc882_capture_source,
2368 .unsol_event = alc_sku_unsol_event,
2369 .setup = alc882_targa_setup,
2370 .init_hook = alc882_targa_automute,
2372 [ALC883_3ST_2ch_DIG] = {
2373 .mixers = { alc883_3ST_2ch_mixer },
2374 .init_verbs = { alc883_init_verbs },
2375 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2376 .dac_nids = alc883_dac_nids,
2377 .dig_out_nid = ALC883_DIGOUT_NID,
2378 .dig_in_nid = ALC883_DIGIN_NID,
2379 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
2380 .channel_mode = alc883_3ST_2ch_modes,
2381 .input_mux = &alc883_capture_source,
2383 [ALC883_3ST_6ch_DIG] = {
2384 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
2385 .init_verbs = { alc883_init_verbs },
2386 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2387 .dac_nids = alc883_dac_nids,
2388 .dig_out_nid = ALC883_DIGOUT_NID,
2389 .dig_in_nid = ALC883_DIGIN_NID,
2390 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2391 .channel_mode = alc883_3ST_6ch_modes,
2392 .need_dac_fix = 1,
2393 .input_mux = &alc883_capture_source,
2395 [ALC883_3ST_6ch] = {
2396 .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
2397 .init_verbs = { alc883_init_verbs },
2398 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2399 .dac_nids = alc883_dac_nids,
2400 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2401 .channel_mode = alc883_3ST_6ch_modes,
2402 .need_dac_fix = 1,
2403 .input_mux = &alc883_capture_source,
2405 [ALC883_3ST_6ch_INTEL] = {
2406 .mixers = { alc883_3ST_6ch_intel_mixer, alc883_chmode_mixer },
2407 .init_verbs = { alc883_init_verbs },
2408 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2409 .dac_nids = alc883_dac_nids,
2410 .dig_out_nid = ALC883_DIGOUT_NID,
2411 .dig_in_nid = ALC883_DIGIN_NID,
2412 .slave_dig_outs = alc883_slave_dig_outs,
2413 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes),
2414 .channel_mode = alc883_3ST_6ch_intel_modes,
2415 .need_dac_fix = 1,
2416 .input_mux = &alc883_3stack_6ch_intel,
2418 [ALC889A_INTEL] = {
2419 .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
2420 .init_verbs = { alc885_init_verbs, alc885_init_input_verbs,
2421 alc_hp15_unsol_verbs },
2422 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2423 .dac_nids = alc883_dac_nids,
2424 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
2425 .adc_nids = alc889_adc_nids,
2426 .dig_out_nid = ALC883_DIGOUT_NID,
2427 .dig_in_nid = ALC883_DIGIN_NID,
2428 .slave_dig_outs = alc883_slave_dig_outs,
2429 .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
2430 .channel_mode = alc889_8ch_intel_modes,
2431 .capsrc_nids = alc889_capsrc_nids,
2432 .input_mux = &alc889_capture_source,
2433 .setup = alc889_automute_setup,
2434 .init_hook = alc_hp_automute,
2435 .unsol_event = alc_sku_unsol_event,
2436 .need_dac_fix = 1,
2438 [ALC889_INTEL] = {
2439 .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
2440 .init_verbs = { alc885_init_verbs, alc889_init_input_verbs,
2441 alc889_eapd_verbs, alc_hp15_unsol_verbs},
2442 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2443 .dac_nids = alc883_dac_nids,
2444 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
2445 .adc_nids = alc889_adc_nids,
2446 .dig_out_nid = ALC883_DIGOUT_NID,
2447 .dig_in_nid = ALC883_DIGIN_NID,
2448 .slave_dig_outs = alc883_slave_dig_outs,
2449 .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
2450 .channel_mode = alc889_8ch_intel_modes,
2451 .capsrc_nids = alc889_capsrc_nids,
2452 .input_mux = &alc889_capture_source,
2453 .setup = alc889_automute_setup,
2454 .init_hook = alc889_intel_init_hook,
2455 .unsol_event = alc_sku_unsol_event,
2456 .need_dac_fix = 1,
2458 [ALC883_6ST_DIG] = {
2459 .mixers = { alc883_base_mixer, alc883_chmode_mixer },
2460 .init_verbs = { alc883_init_verbs },
2461 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2462 .dac_nids = alc883_dac_nids,
2463 .dig_out_nid = ALC883_DIGOUT_NID,
2464 .dig_in_nid = ALC883_DIGIN_NID,
2465 .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
2466 .channel_mode = alc883_sixstack_modes,
2467 .input_mux = &alc883_capture_source,
2469 [ALC883_TARGA_DIG] = {
2470 .mixers = { alc883_targa_mixer, alc883_chmode_mixer },
2471 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
2472 alc883_targa_verbs},
2473 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2474 .dac_nids = alc883_dac_nids,
2475 .dig_out_nid = ALC883_DIGOUT_NID,
2476 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2477 .channel_mode = alc883_3ST_6ch_modes,
2478 .need_dac_fix = 1,
2479 .input_mux = &alc883_capture_source,
2480 .unsol_event = alc883_targa_unsol_event,
2481 .setup = alc882_targa_setup,
2482 .init_hook = alc882_targa_automute,
2484 [ALC883_TARGA_2ch_DIG] = {
2485 .mixers = { alc883_targa_2ch_mixer},
2486 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
2487 alc883_targa_verbs},
2488 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2489 .dac_nids = alc883_dac_nids,
2490 .adc_nids = alc883_adc_nids_alt,
2491 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
2492 .capsrc_nids = alc883_capsrc_nids,
2493 .dig_out_nid = ALC883_DIGOUT_NID,
2494 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
2495 .channel_mode = alc883_3ST_2ch_modes,
2496 .input_mux = &alc883_capture_source,
2497 .unsol_event = alc883_targa_unsol_event,
2498 .setup = alc882_targa_setup,
2499 .init_hook = alc882_targa_automute,
2501 [ALC883_TARGA_8ch_DIG] = {
2502 .mixers = { alc883_targa_mixer, alc883_targa_8ch_mixer,
2503 alc883_chmode_mixer },
2504 .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
2505 alc883_targa_verbs },
2506 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2507 .dac_nids = alc883_dac_nids,
2508 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
2509 .adc_nids = alc883_adc_nids_rev,
2510 .capsrc_nids = alc883_capsrc_nids_rev,
2511 .dig_out_nid = ALC883_DIGOUT_NID,
2512 .dig_in_nid = ALC883_DIGIN_NID,
2513 .num_channel_mode = ARRAY_SIZE(alc883_4ST_8ch_modes),
2514 .channel_mode = alc883_4ST_8ch_modes,
2515 .need_dac_fix = 1,
2516 .input_mux = &alc883_capture_source,
2517 .unsol_event = alc883_targa_unsol_event,
2518 .setup = alc882_targa_setup,
2519 .init_hook = alc882_targa_automute,
2521 [ALC883_ACER_ASPIRE] = {
2522 .mixers = { alc883_acer_aspire_mixer },
2523 .init_verbs = { alc883_init_verbs, alc883_acer_eapd_verbs },
2524 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2525 .dac_nids = alc883_dac_nids,
2526 .dig_out_nid = ALC883_DIGOUT_NID,
2527 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
2528 .channel_mode = alc883_3ST_2ch_modes,
2529 .input_mux = &alc883_capture_source,
2530 .unsol_event = alc_sku_unsol_event,
2531 .setup = alc883_acer_aspire_setup,
2532 .init_hook = alc_hp_automute,
2534 [ALC888_ACER_ASPIRE_4930G] = {
2535 .mixers = { alc888_acer_aspire_4930g_mixer,
2536 alc883_chmode_mixer },
2537 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
2538 alc888_acer_aspire_4930g_verbs },
2539 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2540 .dac_nids = alc883_dac_nids,
2541 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
2542 .adc_nids = alc883_adc_nids_rev,
2543 .capsrc_nids = alc883_capsrc_nids_rev,
2544 .dig_out_nid = ALC883_DIGOUT_NID,
2545 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2546 .channel_mode = alc883_3ST_6ch_modes,
2547 .need_dac_fix = 1,
2548 .const_channel_count = 6,
2549 .num_mux_defs =
2550 ARRAY_SIZE(alc888_2_capture_sources),
2551 .input_mux = alc888_2_capture_sources,
2552 .unsol_event = alc_sku_unsol_event,
2553 .setup = alc888_acer_aspire_4930g_setup,
2554 .init_hook = alc_hp_automute,
2556 [ALC888_ACER_ASPIRE_6530G] = {
2557 .mixers = { alc888_acer_aspire_6530_mixer },
2558 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
2559 alc888_acer_aspire_6530g_verbs },
2560 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2561 .dac_nids = alc883_dac_nids,
2562 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
2563 .adc_nids = alc883_adc_nids_rev,
2564 .capsrc_nids = alc883_capsrc_nids_rev,
2565 .dig_out_nid = ALC883_DIGOUT_NID,
2566 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
2567 .channel_mode = alc883_3ST_2ch_modes,
2568 .num_mux_defs =
2569 ARRAY_SIZE(alc888_2_capture_sources),
2570 .input_mux = alc888_acer_aspire_6530_sources,
2571 .unsol_event = alc_sku_unsol_event,
2572 .setup = alc888_acer_aspire_6530g_setup,
2573 .init_hook = alc_hp_automute,
2575 [ALC888_ACER_ASPIRE_8930G] = {
2576 .mixers = { alc889_acer_aspire_8930g_mixer,
2577 alc883_chmode_mixer },
2578 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
2579 alc889_acer_aspire_8930g_verbs,
2580 alc889_eapd_verbs},
2581 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2582 .dac_nids = alc883_dac_nids,
2583 .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
2584 .adc_nids = alc889_adc_nids,
2585 .capsrc_nids = alc889_capsrc_nids,
2586 .dig_out_nid = ALC883_DIGOUT_NID,
2587 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2588 .channel_mode = alc883_3ST_6ch_modes,
2589 .need_dac_fix = 1,
2590 .const_channel_count = 6,
2591 .num_mux_defs =
2592 ARRAY_SIZE(alc889_capture_sources),
2593 .input_mux = alc889_capture_sources,
2594 .unsol_event = alc_sku_unsol_event,
2595 .setup = alc889_acer_aspire_8930g_setup,
2596 .init_hook = alc_hp_automute,
2597 #ifdef CONFIG_SND_HDA_POWER_SAVE
2598 .power_hook = alc_power_eapd,
2599 #endif
2601 [ALC888_ACER_ASPIRE_7730G] = {
2602 .mixers = { alc883_3ST_6ch_mixer,
2603 alc883_chmode_mixer },
2604 .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
2605 alc888_acer_aspire_7730G_verbs },
2606 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2607 .dac_nids = alc883_dac_nids,
2608 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
2609 .adc_nids = alc883_adc_nids_rev,
2610 .capsrc_nids = alc883_capsrc_nids_rev,
2611 .dig_out_nid = ALC883_DIGOUT_NID,
2612 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
2613 .channel_mode = alc883_3ST_6ch_modes,
2614 .need_dac_fix = 1,
2615 .const_channel_count = 6,
2616 .input_mux = &alc883_capture_source,
2617 .unsol_event = alc_sku_unsol_event,
2618 .setup = alc888_acer_aspire_7730g_setup,
2619 .init_hook = alc_hp_automute,
2621 [ALC889A_MB31] = {
2622 .mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
2623 .init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
2624 alc880_gpio1_init_verbs },
2625 .adc_nids = alc883_adc_nids,
2626 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
2627 .capsrc_nids = alc883_capsrc_nids,
2628 .dac_nids = alc883_dac_nids,
2629 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
2630 .channel_mode = alc889A_mb31_6ch_modes,
2631 .num_channel_mode = ARRAY_SIZE(alc889A_mb31_6ch_modes),
2632 .input_mux = &alc889A_mb31_capture_source,
2633 .dig_out_nid = ALC883_DIGOUT_NID,
2634 .unsol_event = alc889A_mb31_unsol_event,
2635 .init_hook = alc889A_mb31_automute,