]>
Commit | Line | Data |
---|---|---|
d0fa1179 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
1da177e4 LT |
2 | /* |
3 | * Universal Interface for Intel High Definition Audio Codec | |
4 | * | |
1d045db9 | 5 | * HD audio interface patch for Realtek ALC codecs |
1da177e4 | 6 | * |
df694daa KY |
7 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
8 | * PeiSen Hou <pshou@realtek.com.tw> | |
1da177e4 | 9 | * Takashi Iwai <tiwai@suse.de> |
409a3e98 | 10 | * Jonathan Woithe <jwoithe@just42.net> |
1da177e4 LT |
11 | */ |
12 | ||
1da177e4 LT |
13 | #include <linux/init.h> |
14 | #include <linux/delay.h> | |
15 | #include <linux/slab.h> | |
16 | #include <linux/pci.h> | |
08fb0d0e | 17 | #include <linux/dmi.h> |
da155d5b | 18 | #include <linux/module.h> |
33f4acd3 | 19 | #include <linux/input.h> |
87dc3648 | 20 | #include <linux/leds.h> |
1da177e4 | 21 | #include <sound/core.h> |
9ad0e496 | 22 | #include <sound/jack.h> |
be57bfff | 23 | #include <sound/hda_codec.h> |
1da177e4 | 24 | #include "hda_local.h" |
23d30f28 | 25 | #include "hda_auto_parser.h" |
1835a0f9 | 26 | #include "hda_jack.h" |
08c189f2 | 27 | #include "hda_generic.h" |
1da177e4 | 28 | |
cd63a5ff TI |
29 | /* keep halting ALC5505 DSP, for power saving */ |
30 | #define HALT_REALTEK_ALC5505 | |
31 | ||
4a79ba34 TI |
32 | /* extra amp-initialization sequence types */ |
33 | enum { | |
1c76aa5f | 34 | ALC_INIT_UNDEFINED, |
4a79ba34 TI |
35 | ALC_INIT_NONE, |
36 | ALC_INIT_DEFAULT, | |
4a79ba34 TI |
37 | }; |
38 | ||
73bdd597 DH |
39 | enum { |
40 | ALC_HEADSET_MODE_UNKNOWN, | |
41 | ALC_HEADSET_MODE_UNPLUGGED, | |
42 | ALC_HEADSET_MODE_HEADSET, | |
43 | ALC_HEADSET_MODE_MIC, | |
44 | ALC_HEADSET_MODE_HEADPHONE, | |
45 | }; | |
46 | ||
47 | enum { | |
48 | ALC_HEADSET_TYPE_UNKNOWN, | |
49 | ALC_HEADSET_TYPE_CTIA, | |
50 | ALC_HEADSET_TYPE_OMTP, | |
51 | }; | |
52 | ||
c7b60a89 HW |
53 | enum { |
54 | ALC_KEY_MICMUTE_INDEX, | |
55 | }; | |
56 | ||
da00c244 KY |
57 | struct alc_customize_define { |
58 | unsigned int sku_cfg; | |
59 | unsigned char port_connectivity; | |
60 | unsigned char check_sum; | |
61 | unsigned char customization; | |
62 | unsigned char external_amp; | |
63 | unsigned int enable_pcbeep:1; | |
64 | unsigned int platform_type:1; | |
65 | unsigned int swap:1; | |
66 | unsigned int override:1; | |
90622917 | 67 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
da00c244 KY |
68 | }; |
69 | ||
766538ac TI |
70 | struct alc_coef_led { |
71 | unsigned int idx; | |
72 | unsigned int mask; | |
73 | unsigned int on; | |
74 | unsigned int off; | |
75 | }; | |
76 | ||
1da177e4 | 77 | struct alc_spec { |
08c189f2 | 78 | struct hda_gen_spec gen; /* must be at head */ |
23d30f28 | 79 | |
1da177e4 | 80 | /* codec parameterization */ |
da00c244 | 81 | struct alc_customize_define cdefine; |
08c189f2 | 82 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
834be88d | 83 | |
5579cd6f TI |
84 | /* GPIO bits */ |
85 | unsigned int gpio_mask; | |
86 | unsigned int gpio_dir; | |
87 | unsigned int gpio_data; | |
215c850c | 88 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
5579cd6f | 89 | |
8d3d1ece | 90 | /* mute LED for HP laptops, see vref_mute_led_set() */ |
08fb0d0e | 91 | int mute_led_polarity; |
dbd13179 | 92 | int micmute_led_polarity; |
08fb0d0e | 93 | hda_nid_t mute_led_nid; |
9c5dc3bf | 94 | hda_nid_t cap_mute_led_nid; |
08fb0d0e | 95 | |
0f32fd19 TI |
96 | unsigned int gpio_mute_led_mask; |
97 | unsigned int gpio_mic_led_mask; | |
766538ac TI |
98 | struct alc_coef_led mute_led_coef; |
99 | struct alc_coef_led mic_led_coef; | |
9f5c6faf | 100 | |
73bdd597 DH |
101 | hda_nid_t headset_mic_pin; |
102 | hda_nid_t headphone_mic_pin; | |
103 | int current_headset_mode; | |
104 | int current_headset_type; | |
105 | ||
ae6b813a TI |
106 | /* hooks */ |
107 | void (*init_hook)(struct hda_codec *codec); | |
83012a7c | 108 | #ifdef CONFIG_PM |
c97259df | 109 | void (*power_hook)(struct hda_codec *codec); |
f5de24b0 | 110 | #endif |
1c716153 | 111 | void (*shutup)(struct hda_codec *codec); |
70a0976b | 112 | void (*reboot_notify)(struct hda_codec *codec); |
d922b51d | 113 | |
4a79ba34 | 114 | int init_amp; |
d433a678 | 115 | int codec_variant; /* flag for other variants */ |
97a26570 KY |
116 | unsigned int has_alc5505_dsp:1; |
117 | unsigned int no_depop_delay:1; | |
693abe11 | 118 | unsigned int done_hp_init:1; |
c0ca5ece | 119 | unsigned int no_shutup_pins:1; |
d3ba58bb | 120 | unsigned int ultra_low_power:1; |
476c02e0 | 121 | unsigned int has_hs_key:1; |
e64f14f4 | 122 | |
2c3bf9ab TI |
123 | /* for PLL fix */ |
124 | hda_nid_t pll_nid; | |
125 | unsigned int pll_coef_idx, pll_coef_bit; | |
1bb7e43e | 126 | unsigned int coef0; |
33f4acd3 | 127 | struct input_dev *kb_dev; |
c7b60a89 | 128 | u8 alc_mute_keycode_map[1]; |
df694daa KY |
129 | }; |
130 | ||
f2a227cd TI |
131 | /* |
132 | * COEF access helper functions | |
133 | */ | |
134 | ||
135 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
136 | unsigned int coef_idx) | |
137 | { | |
138 | unsigned int val; | |
139 | ||
140 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
141 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); | |
142 | return val; | |
143 | } | |
144 | ||
145 | #define alc_read_coef_idx(codec, coef_idx) \ | |
146 | alc_read_coefex_idx(codec, 0x20, coef_idx) | |
147 | ||
148 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
149 | unsigned int coef_idx, unsigned int coef_val) | |
150 | { | |
151 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); | |
153 | } | |
154 | ||
155 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ | |
156 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) | |
157 | ||
98b24883 TI |
158 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
159 | unsigned int coef_idx, unsigned int mask, | |
160 | unsigned int bits_set) | |
161 | { | |
162 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); | |
163 | ||
164 | if (val != -1) | |
165 | alc_write_coefex_idx(codec, nid, coef_idx, | |
166 | (val & ~mask) | bits_set); | |
167 | } | |
168 | ||
169 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ | |
170 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) | |
171 | ||
f2a227cd TI |
172 | /* a special bypass for COEF 0; read the cached value at the second time */ |
173 | static unsigned int alc_get_coef0(struct hda_codec *codec) | |
174 | { | |
175 | struct alc_spec *spec = codec->spec; | |
176 | ||
177 | if (!spec->coef0) | |
178 | spec->coef0 = alc_read_coef_idx(codec, 0); | |
179 | return spec->coef0; | |
180 | } | |
181 | ||
54db6c39 TI |
182 | /* coef writes/updates batch */ |
183 | struct coef_fw { | |
184 | unsigned char nid; | |
185 | unsigned char idx; | |
186 | unsigned short mask; | |
187 | unsigned short val; | |
188 | }; | |
189 | ||
190 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ | |
191 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } | |
192 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) | |
193 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) | |
194 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) | |
195 | ||
196 | static void alc_process_coef_fw(struct hda_codec *codec, | |
197 | const struct coef_fw *fw) | |
198 | { | |
199 | for (; fw->nid; fw++) { | |
200 | if (fw->mask == (unsigned short)-1) | |
201 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); | |
202 | else | |
203 | alc_update_coefex_idx(codec, fw->nid, fw->idx, | |
204 | fw->mask, fw->val); | |
205 | } | |
206 | } | |
207 | ||
df694daa | 208 | /* |
1d045db9 | 209 | * GPIO setup tables, used in initialization |
df694daa | 210 | */ |
5579cd6f | 211 | |
bc9f98a9 | 212 | /* Enable GPIO mask and set output */ |
5579cd6f TI |
213 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
214 | { | |
215 | struct alc_spec *spec = codec->spec; | |
bc9f98a9 | 216 | |
5579cd6f TI |
217 | spec->gpio_mask |= mask; |
218 | spec->gpio_dir |= mask; | |
219 | spec->gpio_data |= mask; | |
220 | } | |
bc9f98a9 | 221 | |
5579cd6f TI |
222 | static void alc_write_gpio_data(struct hda_codec *codec) |
223 | { | |
224 | struct alc_spec *spec = codec->spec; | |
225 | ||
226 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
227 | spec->gpio_data); | |
228 | } | |
229 | ||
aaf312de TI |
230 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
231 | bool on) | |
232 | { | |
233 | struct alc_spec *spec = codec->spec; | |
234 | unsigned int oldval = spec->gpio_data; | |
235 | ||
236 | if (on) | |
237 | spec->gpio_data |= mask; | |
238 | else | |
239 | spec->gpio_data &= ~mask; | |
240 | if (oldval != spec->gpio_data) | |
241 | alc_write_gpio_data(codec); | |
242 | } | |
243 | ||
5579cd6f TI |
244 | static void alc_write_gpio(struct hda_codec *codec) |
245 | { | |
246 | struct alc_spec *spec = codec->spec; | |
247 | ||
248 | if (!spec->gpio_mask) | |
249 | return; | |
250 | ||
251 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
252 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); | |
253 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
254 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); | |
215c850c TI |
255 | if (spec->gpio_write_delay) |
256 | msleep(1); | |
5579cd6f TI |
257 | alc_write_gpio_data(codec); |
258 | } | |
259 | ||
260 | static void alc_fixup_gpio(struct hda_codec *codec, int action, | |
261 | unsigned int mask) | |
262 | { | |
263 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
264 | alc_setup_gpio(codec, mask); | |
265 | } | |
266 | ||
267 | static void alc_fixup_gpio1(struct hda_codec *codec, | |
268 | const struct hda_fixup *fix, int action) | |
269 | { | |
270 | alc_fixup_gpio(codec, action, 0x01); | |
271 | } | |
272 | ||
273 | static void alc_fixup_gpio2(struct hda_codec *codec, | |
274 | const struct hda_fixup *fix, int action) | |
275 | { | |
276 | alc_fixup_gpio(codec, action, 0x02); | |
277 | } | |
278 | ||
279 | static void alc_fixup_gpio3(struct hda_codec *codec, | |
280 | const struct hda_fixup *fix, int action) | |
281 | { | |
282 | alc_fixup_gpio(codec, action, 0x03); | |
283 | } | |
bdd148a3 | 284 | |
ae065f1c TI |
285 | static void alc_fixup_gpio4(struct hda_codec *codec, |
286 | const struct hda_fixup *fix, int action) | |
287 | { | |
288 | alc_fixup_gpio(codec, action, 0x04); | |
289 | } | |
290 | ||
8a503555 TI |
291 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
292 | const struct hda_fixup *fix, int action) | |
293 | { | |
294 | if (action == HDA_FIXUP_ACT_PROBE) | |
295 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); | |
296 | } | |
297 | ||
2c3bf9ab TI |
298 | /* |
299 | * Fix hardware PLL issue | |
300 | * On some codecs, the analog PLL gating control must be off while | |
301 | * the default value is 1. | |
302 | */ | |
303 | static void alc_fix_pll(struct hda_codec *codec) | |
304 | { | |
305 | struct alc_spec *spec = codec->spec; | |
2c3bf9ab | 306 | |
98b24883 TI |
307 | if (spec->pll_nid) |
308 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, | |
309 | 1 << spec->pll_coef_bit, 0); | |
2c3bf9ab TI |
310 | } |
311 | ||
312 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, | |
313 | unsigned int coef_idx, unsigned int coef_bit) | |
314 | { | |
315 | struct alc_spec *spec = codec->spec; | |
316 | spec->pll_nid = nid; | |
317 | spec->pll_coef_idx = coef_idx; | |
318 | spec->pll_coef_bit = coef_bit; | |
319 | alc_fix_pll(codec); | |
320 | } | |
321 | ||
cf5a2279 | 322 | /* update the master volume per volume-knob's unsol event */ |
1a4f69d5 TI |
323 | static void alc_update_knob_master(struct hda_codec *codec, |
324 | struct hda_jack_callback *jack) | |
cf5a2279 TI |
325 | { |
326 | unsigned int val; | |
327 | struct snd_kcontrol *kctl; | |
328 | struct snd_ctl_elem_value *uctl; | |
329 | ||
330 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); | |
331 | if (!kctl) | |
332 | return; | |
333 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | |
334 | if (!uctl) | |
335 | return; | |
2ebab40e | 336 | val = snd_hda_codec_read(codec, jack->nid, 0, |
cf5a2279 TI |
337 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
338 | val &= HDA_AMP_VOLMASK; | |
339 | uctl->value.integer.value[0] = val; | |
340 | uctl->value.integer.value[1] = val; | |
341 | kctl->put(kctl, uctl); | |
342 | kfree(uctl); | |
343 | } | |
344 | ||
29adc4b9 | 345 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
f21d78e2 | 346 | { |
29adc4b9 DH |
347 | /* For some reason, the res given from ALC880 is broken. |
348 | Here we adjust it properly. */ | |
349 | snd_hda_jack_unsol_event(codec, res >> 2); | |
f21d78e2 TI |
350 | } |
351 | ||
394c97f8 KY |
352 | /* Change EAPD to verb control */ |
353 | static void alc_fill_eapd_coef(struct hda_codec *codec) | |
354 | { | |
355 | int coef; | |
356 | ||
357 | coef = alc_get_coef0(codec); | |
358 | ||
7639a06c | 359 | switch (codec->core.vendor_id) { |
394c97f8 KY |
360 | case 0x10ec0262: |
361 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); | |
362 | break; | |
363 | case 0x10ec0267: | |
364 | case 0x10ec0268: | |
365 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); | |
366 | break; | |
367 | case 0x10ec0269: | |
368 | if ((coef & 0x00f0) == 0x0010) | |
369 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); | |
370 | if ((coef & 0x00f0) == 0x0020) | |
371 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
372 | if ((coef & 0x00f0) == 0x0030) | |
373 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
374 | break; | |
375 | case 0x10ec0280: | |
376 | case 0x10ec0284: | |
377 | case 0x10ec0290: | |
378 | case 0x10ec0292: | |
379 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
380 | break; | |
4231430d | 381 | case 0x10ec0225: |
44be77c5 TI |
382 | case 0x10ec0295: |
383 | case 0x10ec0299: | |
384 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
c0dbbdad | 385 | fallthrough; |
44be77c5 | 386 | case 0x10ec0215: |
394c97f8 | 387 | case 0x10ec0233: |
ea04a1db | 388 | case 0x10ec0235: |
c4473744 | 389 | case 0x10ec0236: |
7fbdcd83 | 390 | case 0x10ec0245: |
394c97f8 | 391 | case 0x10ec0255: |
c4473744 | 392 | case 0x10ec0256: |
f429e7e4 | 393 | case 0x10ec0257: |
394c97f8 KY |
394 | case 0x10ec0282: |
395 | case 0x10ec0283: | |
396 | case 0x10ec0286: | |
630e3612 | 397 | case 0x10ec0287: |
394c97f8 | 398 | case 0x10ec0288: |
0a6f0600 | 399 | case 0x10ec0285: |
506b62c3 | 400 | case 0x10ec0298: |
0a6f0600 | 401 | case 0x10ec0289: |
1078bef0 | 402 | case 0x10ec0300: |
394c97f8 KY |
403 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
404 | break; | |
3aabf94c KY |
405 | case 0x10ec0275: |
406 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); | |
407 | break; | |
394c97f8 KY |
408 | case 0x10ec0293: |
409 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); | |
410 | break; | |
dcd4f0db KY |
411 | case 0x10ec0234: |
412 | case 0x10ec0274: | |
413 | case 0x10ec0294: | |
6fbae35a KY |
414 | case 0x10ec0700: |
415 | case 0x10ec0701: | |
416 | case 0x10ec0703: | |
83629532 | 417 | case 0x10ec0711: |
dcd4f0db KY |
418 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
419 | break; | |
394c97f8 KY |
420 | case 0x10ec0662: |
421 | if ((coef & 0x00f0) == 0x0030) | |
422 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ | |
423 | break; | |
424 | case 0x10ec0272: | |
425 | case 0x10ec0273: | |
426 | case 0x10ec0663: | |
427 | case 0x10ec0665: | |
428 | case 0x10ec0670: | |
429 | case 0x10ec0671: | |
430 | case 0x10ec0672: | |
431 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ | |
432 | break; | |
9194a1eb | 433 | case 0x10ec0222: |
f0778871 KY |
434 | case 0x10ec0623: |
435 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); | |
436 | break; | |
394c97f8 KY |
437 | case 0x10ec0668: |
438 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); | |
439 | break; | |
440 | case 0x10ec0867: | |
441 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); | |
442 | break; | |
443 | case 0x10ec0888: | |
444 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) | |
445 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
446 | break; | |
447 | case 0x10ec0892: | |
448 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
449 | break; | |
450 | case 0x10ec0899: | |
451 | case 0x10ec0900: | |
6d9ffcff | 452 | case 0x10ec0b00: |
65553b12 | 453 | case 0x10ec1168: |
a535ad57 | 454 | case 0x10ec1220: |
394c97f8 KY |
455 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
456 | break; | |
457 | } | |
458 | } | |
459 | ||
f9423e7a KY |
460 | /* additional initialization for ALC888 variants */ |
461 | static void alc888_coef_init(struct hda_codec *codec) | |
462 | { | |
1df8874b KY |
463 | switch (alc_get_coef0(codec) & 0x00f0) { |
464 | /* alc888-VA */ | |
465 | case 0x00: | |
466 | /* alc888-VB */ | |
467 | case 0x10: | |
468 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ | |
469 | break; | |
470 | } | |
87a8c370 JK |
471 | } |
472 | ||
3fb4a508 TI |
473 | /* turn on/off EAPD control (only if available) */ |
474 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | |
475 | { | |
476 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | |
477 | return; | |
478 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | |
479 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | |
480 | on ? 2 : 0); | |
481 | } | |
482 | ||
691f1fcc TI |
483 | /* turn on/off EAPD controls of the codec */ |
484 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |
485 | { | |
486 | /* We currently only handle front, HP */ | |
caf3c043 | 487 | static const hda_nid_t pins[] = { |
af95b414 | 488 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
39fa84e9 | 489 | }; |
caf3c043 | 490 | const hda_nid_t *p; |
39fa84e9 TI |
491 | for (p = pins; *p; p++) |
492 | set_eapd(codec, *p, on); | |
691f1fcc TI |
493 | } |
494 | ||
dad3197d KY |
495 | static int find_ext_mic_pin(struct hda_codec *codec); |
496 | ||
497 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) | |
498 | { | |
499 | const struct hda_pincfg *pin; | |
500 | int mic_pin = find_ext_mic_pin(codec); | |
501 | int i; | |
502 | ||
503 | /* don't shut up pins when unloading the driver; otherwise it breaks | |
504 | * the default pin setup at the next load of the driver | |
505 | */ | |
506 | if (codec->bus->shutdown) | |
507 | return; | |
508 | ||
509 | snd_array_for_each(&codec->init_pins, i, pin) { | |
510 | /* use read here for syncing after issuing each verb */ | |
511 | if (pin->nid != mic_pin) | |
512 | snd_hda_codec_read(codec, pin->nid, 0, | |
513 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | |
514 | } | |
515 | ||
516 | codec->pins_shutup = 1; | |
517 | } | |
518 | ||
c0ca5ece TI |
519 | static void alc_shutup_pins(struct hda_codec *codec) |
520 | { | |
521 | struct alc_spec *spec = codec->spec; | |
522 | ||
dad3197d | 523 | switch (codec->core.vendor_id) { |
66c5d718 | 524 | case 0x10ec0283: |
dad3197d KY |
525 | case 0x10ec0286: |
526 | case 0x10ec0288: | |
527 | case 0x10ec0298: | |
528 | alc_headset_mic_no_shutup(codec); | |
529 | break; | |
530 | default: | |
531 | if (!spec->no_shutup_pins) | |
532 | snd_hda_shutup_pins(codec); | |
533 | break; | |
534 | } | |
c0ca5ece TI |
535 | } |
536 | ||
1c716153 | 537 | /* generic shutup callback; |
4ce8e6a5 | 538 | * just turning off EAPD and a little pause for avoiding pop-noise |
1c716153 TI |
539 | */ |
540 | static void alc_eapd_shutup(struct hda_codec *codec) | |
541 | { | |
97a26570 KY |
542 | struct alc_spec *spec = codec->spec; |
543 | ||
1c716153 | 544 | alc_auto_setup_eapd(codec, false); |
97a26570 KY |
545 | if (!spec->no_depop_delay) |
546 | msleep(200); | |
c0ca5ece | 547 | alc_shutup_pins(codec); |
1c716153 TI |
548 | } |
549 | ||
1d045db9 | 550 | /* generic EAPD initialization */ |
4a79ba34 | 551 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
bc9f98a9 | 552 | { |
39fa84e9 | 553 | alc_auto_setup_eapd(codec, true); |
5579cd6f | 554 | alc_write_gpio(codec); |
4a79ba34 | 555 | switch (type) { |
4a79ba34 | 556 | case ALC_INIT_DEFAULT: |
7639a06c | 557 | switch (codec->core.vendor_id) { |
c9b58006 | 558 | case 0x10ec0260: |
98b24883 | 559 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
c9b58006 | 560 | break; |
c9b58006 KY |
561 | case 0x10ec0880: |
562 | case 0x10ec0882: | |
563 | case 0x10ec0883: | |
564 | case 0x10ec0885: | |
1df8874b | 565 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
c9b58006 | 566 | break; |
f9423e7a | 567 | case 0x10ec0888: |
4a79ba34 | 568 | alc888_coef_init(codec); |
f9423e7a | 569 | break; |
bc9f98a9 | 570 | } |
4a79ba34 TI |
571 | break; |
572 | } | |
573 | } | |
574 | ||
35a39f98 TI |
575 | /* get a primary headphone pin if available */ |
576 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) | |
577 | { | |
578 | if (spec->gen.autocfg.hp_pins[0]) | |
579 | return spec->gen.autocfg.hp_pins[0]; | |
580 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
581 | return spec->gen.autocfg.line_out_pins[0]; | |
582 | return 0; | |
583 | } | |
08c189f2 | 584 | |
1d045db9 | 585 | /* |
08c189f2 | 586 | * Realtek SSID verification |
1d045db9 | 587 | */ |
42cf0d01 | 588 | |
08c189f2 TI |
589 | /* Could be any non-zero and even value. When used as fixup, tells |
590 | * the driver to ignore any present sku defines. | |
591 | */ | |
592 | #define ALC_FIXUP_SKU_IGNORE (2) | |
1a1455de | 593 | |
08c189f2 TI |
594 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
595 | const struct hda_fixup *fix, int action) | |
1a1455de | 596 | { |
1a1455de | 597 | struct alc_spec *spec = codec->spec; |
08c189f2 TI |
598 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
599 | spec->cdefine.fixup = 1; | |
600 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; | |
1a1455de | 601 | } |
1a1455de TI |
602 | } |
603 | ||
b5c6611f ML |
604 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
605 | const struct hda_fixup *fix, int action) | |
606 | { | |
607 | struct alc_spec *spec = codec->spec; | |
608 | ||
84d2dc3e | 609 | if (action == HDA_FIXUP_ACT_PROBE) { |
b5c6611f | 610 | spec->no_depop_delay = 1; |
84d2dc3e ML |
611 | codec->depop_delay = 0; |
612 | } | |
b5c6611f ML |
613 | } |
614 | ||
08c189f2 | 615 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
4a79ba34 | 616 | { |
08c189f2 TI |
617 | unsigned int ass, tmp, i; |
618 | unsigned nid = 0; | |
4a79ba34 TI |
619 | struct alc_spec *spec = codec->spec; |
620 | ||
08c189f2 | 621 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
4a79ba34 | 622 | |
08c189f2 TI |
623 | if (spec->cdefine.fixup) { |
624 | ass = spec->cdefine.sku_cfg; | |
625 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
626 | return -1; | |
627 | goto do_sku; | |
bb35febd TI |
628 | } |
629 | ||
5100cd07 TI |
630 | if (!codec->bus->pci) |
631 | return -1; | |
7639a06c | 632 | ass = codec->core.subsystem_id & 0xffff; |
08c189f2 TI |
633 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
634 | goto do_sku; | |
4a79ba34 | 635 | |
08c189f2 | 636 | nid = 0x1d; |
7639a06c | 637 | if (codec->core.vendor_id == 0x10ec0260) |
08c189f2 TI |
638 | nid = 0x17; |
639 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
42cf0d01 | 640 | |
08c189f2 | 641 | if (!(ass & 1)) { |
4e76a883 | 642 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
7639a06c | 643 | codec->core.chip_name, ass); |
08c189f2 | 644 | return -1; |
42cf0d01 DH |
645 | } |
646 | ||
08c189f2 TI |
647 | /* check sum */ |
648 | tmp = 0; | |
649 | for (i = 1; i < 16; i++) { | |
650 | if ((ass >> i) & 1) | |
651 | tmp++; | |
ae8a60a5 | 652 | } |
08c189f2 TI |
653 | if (((ass >> 16) & 0xf) != tmp) |
654 | return -1; | |
ae8a60a5 | 655 | |
da00c244 KY |
656 | spec->cdefine.port_connectivity = ass >> 30; |
657 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; | |
658 | spec->cdefine.check_sum = (ass >> 16) & 0xf; | |
659 | spec->cdefine.customization = ass >> 8; | |
660 | do_sku: | |
661 | spec->cdefine.sku_cfg = ass; | |
662 | spec->cdefine.external_amp = (ass & 0x38) >> 3; | |
663 | spec->cdefine.platform_type = (ass & 0x4) >> 2; | |
664 | spec->cdefine.swap = (ass & 0x2) >> 1; | |
665 | spec->cdefine.override = ass & 0x1; | |
666 | ||
4e76a883 | 667 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
da00c244 | 668 | nid, spec->cdefine.sku_cfg); |
4e76a883 | 669 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
da00c244 | 670 | spec->cdefine.port_connectivity); |
4e76a883 TI |
671 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
672 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); | |
673 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); | |
674 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); | |
675 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); | |
676 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); | |
677 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); | |
da00c244 KY |
678 | |
679 | return 0; | |
680 | } | |
681 | ||
08c189f2 TI |
682 | /* return the position of NID in the list, or -1 if not found */ |
683 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) | |
684 | { | |
685 | int i; | |
686 | for (i = 0; i < nums; i++) | |
687 | if (list[i] == nid) | |
688 | return i; | |
689 | return -1; | |
690 | } | |
1d045db9 | 691 | /* return true if the given NID is found in the list */ |
3af9ee6b TI |
692 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
693 | { | |
21268961 | 694 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
3af9ee6b TI |
695 | } |
696 | ||
4a79ba34 TI |
697 | /* check subsystem ID and set up device-specific initialization; |
698 | * return 1 if initialized, 0 if invalid SSID | |
699 | */ | |
700 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. | |
701 | * 31 ~ 16 : Manufacture ID | |
702 | * 15 ~ 8 : SKU ID | |
703 | * 7 ~ 0 : Assembly ID | |
704 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 | |
705 | */ | |
58c57cfa | 706 | static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) |
4a79ba34 TI |
707 | { |
708 | unsigned int ass, tmp, i; | |
709 | unsigned nid; | |
710 | struct alc_spec *spec = codec->spec; | |
711 | ||
90622917 DH |
712 | if (spec->cdefine.fixup) { |
713 | ass = spec->cdefine.sku_cfg; | |
714 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
715 | return 0; | |
716 | goto do_sku; | |
717 | } | |
718 | ||
7639a06c | 719 | ass = codec->core.subsystem_id & 0xffff; |
5100cd07 TI |
720 | if (codec->bus->pci && |
721 | ass != codec->bus->pci->subsystem_device && (ass & 1)) | |
4a79ba34 TI |
722 | goto do_sku; |
723 | ||
724 | /* invalid SSID, check the special NID pin defcfg instead */ | |
725 | /* | |
def319f9 | 726 | * 31~30 : port connectivity |
4a79ba34 TI |
727 | * 29~21 : reserve |
728 | * 20 : PCBEEP input | |
729 | * 19~16 : Check sum (15:1) | |
730 | * 15~1 : Custom | |
731 | * 0 : override | |
732 | */ | |
733 | nid = 0x1d; | |
7639a06c | 734 | if (codec->core.vendor_id == 0x10ec0260) |
4a79ba34 TI |
735 | nid = 0x17; |
736 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
4e76a883 TI |
737 | codec_dbg(codec, |
738 | "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", | |
cb6605c1 | 739 | ass, nid); |
6227cdce | 740 | if (!(ass & 1)) |
4a79ba34 TI |
741 | return 0; |
742 | if ((ass >> 30) != 1) /* no physical connection */ | |
743 | return 0; | |
744 | ||
745 | /* check sum */ | |
746 | tmp = 0; | |
747 | for (i = 1; i < 16; i++) { | |
748 | if ((ass >> i) & 1) | |
749 | tmp++; | |
750 | } | |
751 | if (((ass >> 16) & 0xf) != tmp) | |
752 | return 0; | |
753 | do_sku: | |
4e76a883 | 754 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
7639a06c | 755 | ass & 0xffff, codec->core.vendor_id); |
4a79ba34 TI |
756 | /* |
757 | * 0 : override | |
758 | * 1 : Swap Jack | |
759 | * 2 : 0 --> Desktop, 1 --> Laptop | |
760 | * 3~5 : External Amplifier control | |
761 | * 7~6 : Reserved | |
762 | */ | |
763 | tmp = (ass & 0x38) >> 3; /* external Amp control */ | |
1c76aa5f TI |
764 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
765 | switch (tmp) { | |
766 | case 1: | |
5579cd6f | 767 | alc_setup_gpio(codec, 0x01); |
1c76aa5f TI |
768 | break; |
769 | case 3: | |
5579cd6f | 770 | alc_setup_gpio(codec, 0x02); |
1c76aa5f TI |
771 | break; |
772 | case 7: | |
5579cd6f | 773 | alc_setup_gpio(codec, 0x03); |
1c76aa5f TI |
774 | break; |
775 | case 5: | |
776 | default: | |
777 | spec->init_amp = ALC_INIT_DEFAULT; | |
778 | break; | |
779 | } | |
bc9f98a9 | 780 | } |
ea1fb29a | 781 | |
8c427226 | 782 | /* is laptop or Desktop and enable the function "Mute internal speaker |
c9b58006 KY |
783 | * when the external headphone out jack is plugged" |
784 | */ | |
8c427226 | 785 | if (!(ass & 0x8000)) |
4a79ba34 | 786 | return 1; |
c9b58006 KY |
787 | /* |
788 | * 10~8 : Jack location | |
789 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered | |
790 | * 14~13: Resvered | |
791 | * 15 : 1 --> enable the function "Mute internal speaker | |
792 | * when the external headphone out jack is plugged" | |
793 | */ | |
35a39f98 | 794 | if (!alc_get_hp_pin(spec)) { |
01d4825d | 795 | hda_nid_t nid; |
c9b58006 | 796 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
58c57cfa | 797 | nid = ports[tmp]; |
08c189f2 TI |
798 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
799 | spec->gen.autocfg.line_outs)) | |
3af9ee6b | 800 | return 1; |
08c189f2 | 801 | spec->gen.autocfg.hp_pins[0] = nid; |
c9b58006 | 802 | } |
4a79ba34 TI |
803 | return 1; |
804 | } | |
ea1fb29a | 805 | |
3e6179b8 TI |
806 | /* Check the validity of ALC subsystem-id |
807 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ | |
808 | static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) | |
4a79ba34 | 809 | { |
58c57cfa | 810 | if (!alc_subsystem_id(codec, ports)) { |
4a79ba34 | 811 | struct alc_spec *spec = codec->spec; |
67791202 TI |
812 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
813 | codec_dbg(codec, | |
814 | "realtek: Enable default setup for auto mode as fallback\n"); | |
815 | spec->init_amp = ALC_INIT_DEFAULT; | |
816 | } | |
4a79ba34 | 817 | } |
21268961 | 818 | } |
1a1455de | 819 | |
1d045db9 | 820 | /* |
ef8ef5fb | 821 | */ |
f9e336f6 | 822 | |
9d36a7dc DH |
823 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
824 | const struct hda_fixup *fix, int action) | |
125821ae TI |
825 | { |
826 | struct alc_spec *spec = codec->spec; | |
668d1e96 | 827 | |
9d36a7dc | 828 | spec->gen.inv_dmic_split = 1; |
6e72aa5f TI |
829 | } |
830 | ||
e9edcee0 | 831 | |
08c189f2 | 832 | static int alc_build_controls(struct hda_codec *codec) |
1d045db9 | 833 | { |
a5cb463a | 834 | int err; |
e9427969 | 835 | |
08c189f2 TI |
836 | err = snd_hda_gen_build_controls(codec); |
837 | if (err < 0) | |
838 | return err; | |
1da177e4 | 839 | |
1727a771 | 840 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
1c4a54b4 | 841 | return 0; |
a361d84b KY |
842 | } |
843 | ||
a361d84b | 844 | |
df694daa | 845 | /* |
08c189f2 | 846 | * Common callbacks |
df694daa | 847 | */ |
a361d84b | 848 | |
c9af753f TI |
849 | static void alc_pre_init(struct hda_codec *codec) |
850 | { | |
851 | alc_fill_eapd_coef(codec); | |
852 | } | |
853 | ||
aeac1a0d KY |
854 | #define is_s3_resume(codec) \ |
855 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) | |
c9af753f TI |
856 | #define is_s4_resume(codec) \ |
857 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) | |
858 | ||
08c189f2 | 859 | static int alc_init(struct hda_codec *codec) |
1d045db9 TI |
860 | { |
861 | struct alc_spec *spec = codec->spec; | |
a361d84b | 862 | |
c9af753f TI |
863 | /* hibernation resume needs the full chip initialization */ |
864 | if (is_s4_resume(codec)) | |
865 | alc_pre_init(codec); | |
866 | ||
08c189f2 TI |
867 | if (spec->init_hook) |
868 | spec->init_hook(codec); | |
a361d84b | 869 | |
89781d08 | 870 | spec->gen.skip_verbs = 1; /* applied in below */ |
607ca3bd | 871 | snd_hda_gen_init(codec); |
08c189f2 TI |
872 | alc_fix_pll(codec); |
873 | alc_auto_init_amp(codec, spec->init_amp); | |
89781d08 | 874 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
3abf2f36 | 875 | |
1727a771 | 876 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
a361d84b | 877 | |
1d045db9 TI |
878 | return 0; |
879 | } | |
a361d84b | 880 | |
08c189f2 | 881 | static inline void alc_shutup(struct hda_codec *codec) |
1d045db9 TI |
882 | { |
883 | struct alc_spec *spec = codec->spec; | |
a361d84b | 884 | |
c7273bd6 TI |
885 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
886 | return; /* disabled explicitly by hints */ | |
887 | ||
08c189f2 TI |
888 | if (spec && spec->shutup) |
889 | spec->shutup(codec); | |
9bfb2844 | 890 | else |
c0ca5ece | 891 | alc_shutup_pins(codec); |
1d045db9 TI |
892 | } |
893 | ||
70a0976b TI |
894 | static void alc_reboot_notify(struct hda_codec *codec) |
895 | { | |
896 | struct alc_spec *spec = codec->spec; | |
897 | ||
898 | if (spec && spec->reboot_notify) | |
899 | spec->reboot_notify(codec); | |
900 | else | |
901 | alc_shutup(codec); | |
902 | } | |
903 | ||
8a02c0cc | 904 | #define alc_free snd_hda_gen_free |
2134ea4f | 905 | |
08c189f2 TI |
906 | #ifdef CONFIG_PM |
907 | static void alc_power_eapd(struct hda_codec *codec) | |
1d045db9 | 908 | { |
08c189f2 | 909 | alc_auto_setup_eapd(codec, false); |
1d045db9 | 910 | } |
2134ea4f | 911 | |
08c189f2 | 912 | static int alc_suspend(struct hda_codec *codec) |
1d045db9 TI |
913 | { |
914 | struct alc_spec *spec = codec->spec; | |
08c189f2 TI |
915 | alc_shutup(codec); |
916 | if (spec && spec->power_hook) | |
917 | spec->power_hook(codec); | |
a361d84b KY |
918 | return 0; |
919 | } | |
08c189f2 | 920 | #endif |
a361d84b | 921 | |
08c189f2 TI |
922 | #ifdef CONFIG_PM |
923 | static int alc_resume(struct hda_codec *codec) | |
1d045db9 | 924 | { |
97a26570 KY |
925 | struct alc_spec *spec = codec->spec; |
926 | ||
927 | if (!spec->no_depop_delay) | |
928 | msleep(150); /* to avoid pop noise */ | |
08c189f2 | 929 | codec->patch_ops.init(codec); |
1a462be5 | 930 | snd_hda_regmap_sync(codec); |
08c189f2 TI |
931 | hda_call_check_power_status(codec, 0x01); |
932 | return 0; | |
1d045db9 | 933 | } |
08c189f2 | 934 | #endif |
f6a92248 | 935 | |
1d045db9 | 936 | /* |
1d045db9 | 937 | */ |
08c189f2 TI |
938 | static const struct hda_codec_ops alc_patch_ops = { |
939 | .build_controls = alc_build_controls, | |
940 | .build_pcms = snd_hda_gen_build_pcms, | |
941 | .init = alc_init, | |
942 | .free = alc_free, | |
943 | .unsol_event = snd_hda_jack_unsol_event, | |
944 | #ifdef CONFIG_PM | |
945 | .resume = alc_resume, | |
08c189f2 | 946 | .suspend = alc_suspend, |
fce52a3b | 947 | .check_power_status = snd_hda_gen_check_power_status, |
08c189f2 | 948 | #endif |
70a0976b | 949 | .reboot_notify = alc_reboot_notify, |
08c189f2 | 950 | }; |
f6a92248 | 951 | |
f53281e6 | 952 | |
ded255be | 953 | #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) |
e01bf509 | 954 | |
e4770629 | 955 | /* |
4b016931 | 956 | * Rename codecs appropriately from COEF value or subvendor id |
e4770629 | 957 | */ |
08c189f2 TI |
958 | struct alc_codec_rename_table { |
959 | unsigned int vendor_id; | |
960 | unsigned short coef_mask; | |
961 | unsigned short coef_bits; | |
962 | const char *name; | |
963 | }; | |
84898e87 | 964 | |
4b016931 KY |
965 | struct alc_codec_rename_pci_table { |
966 | unsigned int codec_vendor_id; | |
967 | unsigned short pci_subvendor; | |
968 | unsigned short pci_subdevice; | |
969 | const char *name; | |
970 | }; | |
971 | ||
6b0f95c4 | 972 | static const struct alc_codec_rename_table rename_tbl[] = { |
e6e5f7ad | 973 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
08c189f2 TI |
974 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
975 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, | |
976 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, | |
977 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, | |
978 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, | |
979 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, | |
980 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, | |
981 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, | |
e6e5f7ad | 982 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
08c189f2 TI |
983 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
984 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, | |
985 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, | |
986 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, | |
987 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, | |
988 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, | |
989 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, | |
990 | { } /* terminator */ | |
991 | }; | |
84898e87 | 992 | |
6b0f95c4 | 993 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
4b016931 KY |
994 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
995 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, | |
996 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, | |
193177de | 997 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
4b016931 | 998 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
193177de | 999 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
4b016931 KY |
1000 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
1001 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, | |
e6e5f7ad KY |
1002 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
1003 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, | |
2c674fac | 1004 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
736f20a7 | 1005 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
82324502 | 1006 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
4231430d | 1007 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
7d727869 | 1008 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
28f1f9b2 | 1009 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
e6e5f7ad KY |
1010 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
1011 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, | |
1012 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, | |
1013 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, | |
1014 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, | |
1015 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, | |
1016 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, | |
1017 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, | |
1018 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, | |
1019 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, | |
1020 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, | |
4b016931 KY |
1021 | { } /* terminator */ |
1022 | }; | |
1023 | ||
08c189f2 | 1024 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
1d045db9 | 1025 | { |
08c189f2 | 1026 | const struct alc_codec_rename_table *p; |
4b016931 | 1027 | const struct alc_codec_rename_pci_table *q; |
60db6b53 | 1028 | |
08c189f2 | 1029 | for (p = rename_tbl; p->vendor_id; p++) { |
7639a06c | 1030 | if (p->vendor_id != codec->core.vendor_id) |
08c189f2 TI |
1031 | continue; |
1032 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) | |
1033 | return alc_codec_rename(codec, p->name); | |
1d045db9 | 1034 | } |
4b016931 | 1035 | |
5100cd07 TI |
1036 | if (!codec->bus->pci) |
1037 | return 0; | |
4b016931 | 1038 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
7639a06c | 1039 | if (q->codec_vendor_id != codec->core.vendor_id) |
4b016931 KY |
1040 | continue; |
1041 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) | |
1042 | continue; | |
1043 | if (!q->pci_subdevice || | |
1044 | q->pci_subdevice == codec->bus->pci->subsystem_device) | |
1045 | return alc_codec_rename(codec, q->name); | |
1046 | } | |
1047 | ||
08c189f2 | 1048 | return 0; |
1d045db9 | 1049 | } |
f53281e6 | 1050 | |
e4770629 | 1051 | |
1d045db9 TI |
1052 | /* |
1053 | * Digital-beep handlers | |
1054 | */ | |
1055 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | |
fea80fae TI |
1056 | |
1057 | /* additional beep mixers; private_value will be overwritten */ | |
1058 | static const struct snd_kcontrol_new alc_beep_mixer[] = { | |
1059 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), | |
1060 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), | |
1061 | }; | |
1062 | ||
1063 | /* set up and create beep controls */ | |
1064 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, | |
1065 | int idx, int dir) | |
1066 | { | |
1067 | struct snd_kcontrol_new *knew; | |
1068 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); | |
1069 | int i; | |
1070 | ||
1071 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { | |
1072 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, | |
1073 | &alc_beep_mixer[i]); | |
1074 | if (!knew) | |
1075 | return -ENOMEM; | |
1076 | knew->private_value = beep_amp; | |
1077 | } | |
1078 | return 0; | |
1079 | } | |
84898e87 | 1080 | |
6317e5eb | 1081 | static const struct snd_pci_quirk beep_allow_list[] = { |
7110005e | 1082 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
a4b7f21d | 1083 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
1d045db9 | 1084 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
8554ee40 | 1085 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
1d045db9 TI |
1086 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
1087 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), | |
1088 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), | |
78f8baf1 | 1089 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
1d045db9 | 1090 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
6317e5eb | 1091 | /* denylist -- no beep available */ |
051c78af TI |
1092 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
1093 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), | |
1d045db9 | 1094 | {} |
fe3eb0a7 KY |
1095 | }; |
1096 | ||
1d045db9 TI |
1097 | static inline int has_cdefine_beep(struct hda_codec *codec) |
1098 | { | |
1099 | struct alc_spec *spec = codec->spec; | |
1100 | const struct snd_pci_quirk *q; | |
6317e5eb | 1101 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
1d045db9 TI |
1102 | if (q) |
1103 | return q->value; | |
1104 | return spec->cdefine.enable_pcbeep; | |
1105 | } | |
1106 | #else | |
fea80fae | 1107 | #define set_beep_amp(spec, nid, idx, dir) 0 |
1d045db9 TI |
1108 | #define has_cdefine_beep(codec) 0 |
1109 | #endif | |
84898e87 | 1110 | |
1d045db9 TI |
1111 | /* parse the BIOS configuration and set up the alc_spec */ |
1112 | /* return 1 if successful, 0 if the proper config is not found, | |
1113 | * or a negative error code | |
1114 | */ | |
3e6179b8 TI |
1115 | static int alc_parse_auto_config(struct hda_codec *codec, |
1116 | const hda_nid_t *ignore_nids, | |
1117 | const hda_nid_t *ssid_nids) | |
1d045db9 TI |
1118 | { |
1119 | struct alc_spec *spec = codec->spec; | |
08c189f2 | 1120 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
1d045db9 | 1121 | int err; |
26f5df26 | 1122 | |
53c334ad TI |
1123 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
1124 | spec->parse_flags); | |
1d045db9 TI |
1125 | if (err < 0) |
1126 | return err; | |
3e6179b8 TI |
1127 | |
1128 | if (ssid_nids) | |
1129 | alc_ssid_check(codec, ssid_nids); | |
64154835 | 1130 | |
08c189f2 TI |
1131 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
1132 | if (err < 0) | |
1133 | return err; | |
070cff4c | 1134 | |
1d045db9 | 1135 | return 1; |
60db6b53 | 1136 | } |
f6a92248 | 1137 | |
3de95173 TI |
1138 | /* common preparation job for alc_spec */ |
1139 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |
1140 | { | |
1141 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); | |
1142 | int err; | |
1143 | ||
1144 | if (!spec) | |
1145 | return -ENOMEM; | |
1146 | codec->spec = spec; | |
08c189f2 TI |
1147 | snd_hda_gen_spec_init(&spec->gen); |
1148 | spec->gen.mixer_nid = mixer_nid; | |
1149 | spec->gen.own_eapd_ctl = 1; | |
1098b7c2 | 1150 | codec->single_adc_amp = 1; |
08c189f2 TI |
1151 | /* FIXME: do we need this for all Realtek codec models? */ |
1152 | codec->spdif_status_reset = 1; | |
a6e7d0a4 | 1153 | codec->forced_resume = 1; |
225068ab | 1154 | codec->patch_ops = alc_patch_ops; |
3de95173 TI |
1155 | |
1156 | err = alc_codec_rename_from_preset(codec); | |
1157 | if (err < 0) { | |
1158 | kfree(spec); | |
1159 | return err; | |
1160 | } | |
1161 | return 0; | |
1162 | } | |
1163 | ||
3e6179b8 TI |
1164 | static int alc880_parse_auto_config(struct hda_codec *codec) |
1165 | { | |
1166 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; | |
7d7eb9ea | 1167 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
3e6179b8 TI |
1168 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
1169 | } | |
1170 | ||
ee3b2969 TI |
1171 | /* |
1172 | * ALC880 fix-ups | |
1173 | */ | |
1174 | enum { | |
411225a0 | 1175 | ALC880_FIXUP_GPIO1, |
ee3b2969 TI |
1176 | ALC880_FIXUP_GPIO2, |
1177 | ALC880_FIXUP_MEDION_RIM, | |
dc6af52d | 1178 | ALC880_FIXUP_LG, |
db8a38e5 | 1179 | ALC880_FIXUP_LG_LW25, |
f02aab5d | 1180 | ALC880_FIXUP_W810, |
27e917f8 | 1181 | ALC880_FIXUP_EAPD_COEF, |
b9368f5c | 1182 | ALC880_FIXUP_TCL_S700, |
cf5a2279 TI |
1183 | ALC880_FIXUP_VOL_KNOB, |
1184 | ALC880_FIXUP_FUJITSU, | |
ba533818 | 1185 | ALC880_FIXUP_F1734, |
817de92f | 1186 | ALC880_FIXUP_UNIWILL, |
967b88c4 | 1187 | ALC880_FIXUP_UNIWILL_DIG, |
96e225f6 | 1188 | ALC880_FIXUP_Z71V, |
487a588d | 1189 | ALC880_FIXUP_ASUS_W5A, |
67b6ec31 TI |
1190 | ALC880_FIXUP_3ST_BASE, |
1191 | ALC880_FIXUP_3ST, | |
1192 | ALC880_FIXUP_3ST_DIG, | |
1193 | ALC880_FIXUP_5ST_BASE, | |
1194 | ALC880_FIXUP_5ST, | |
1195 | ALC880_FIXUP_5ST_DIG, | |
1196 | ALC880_FIXUP_6ST_BASE, | |
1197 | ALC880_FIXUP_6ST, | |
1198 | ALC880_FIXUP_6ST_DIG, | |
5397145f | 1199 | ALC880_FIXUP_6ST_AUTOMUTE, |
ee3b2969 TI |
1200 | }; |
1201 | ||
cf5a2279 TI |
1202 | /* enable the volume-knob widget support on NID 0x21 */ |
1203 | static void alc880_fixup_vol_knob(struct hda_codec *codec, | |
1727a771 | 1204 | const struct hda_fixup *fix, int action) |
cf5a2279 | 1205 | { |
1727a771 | 1206 | if (action == HDA_FIXUP_ACT_PROBE) |
62f949bf TI |
1207 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
1208 | alc_update_knob_master); | |
cf5a2279 TI |
1209 | } |
1210 | ||
1727a771 | 1211 | static const struct hda_fixup alc880_fixups[] = { |
411225a0 | 1212 | [ALC880_FIXUP_GPIO1] = { |
5579cd6f TI |
1213 | .type = HDA_FIXUP_FUNC, |
1214 | .v.func = alc_fixup_gpio1, | |
411225a0 | 1215 | }, |
ee3b2969 | 1216 | [ALC880_FIXUP_GPIO2] = { |
5579cd6f TI |
1217 | .type = HDA_FIXUP_FUNC, |
1218 | .v.func = alc_fixup_gpio2, | |
ee3b2969 TI |
1219 | }, |
1220 | [ALC880_FIXUP_MEDION_RIM] = { | |
1727a771 | 1221 | .type = HDA_FIXUP_VERBS, |
ee3b2969 TI |
1222 | .v.verbs = (const struct hda_verb[]) { |
1223 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1224 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1225 | { } | |
1226 | }, | |
1227 | .chained = true, | |
1228 | .chain_id = ALC880_FIXUP_GPIO2, | |
1229 | }, | |
dc6af52d | 1230 | [ALC880_FIXUP_LG] = { |
1727a771 TI |
1231 | .type = HDA_FIXUP_PINS, |
1232 | .v.pins = (const struct hda_pintbl[]) { | |
dc6af52d TI |
1233 | /* disable bogus unused pins */ |
1234 | { 0x16, 0x411111f0 }, | |
1235 | { 0x18, 0x411111f0 }, | |
1236 | { 0x1a, 0x411111f0 }, | |
1237 | { } | |
1238 | } | |
1239 | }, | |
db8a38e5 TI |
1240 | [ALC880_FIXUP_LG_LW25] = { |
1241 | .type = HDA_FIXUP_PINS, | |
1242 | .v.pins = (const struct hda_pintbl[]) { | |
1243 | { 0x1a, 0x0181344f }, /* line-in */ | |
1244 | { 0x1b, 0x0321403f }, /* headphone */ | |
1245 | { } | |
1246 | } | |
1247 | }, | |
f02aab5d | 1248 | [ALC880_FIXUP_W810] = { |
1727a771 TI |
1249 | .type = HDA_FIXUP_PINS, |
1250 | .v.pins = (const struct hda_pintbl[]) { | |
f02aab5d TI |
1251 | /* disable bogus unused pins */ |
1252 | { 0x17, 0x411111f0 }, | |
1253 | { } | |
1254 | }, | |
1255 | .chained = true, | |
1256 | .chain_id = ALC880_FIXUP_GPIO2, | |
1257 | }, | |
27e917f8 | 1258 | [ALC880_FIXUP_EAPD_COEF] = { |
1727a771 | 1259 | .type = HDA_FIXUP_VERBS, |
27e917f8 TI |
1260 | .v.verbs = (const struct hda_verb[]) { |
1261 | /* change to EAPD mode */ | |
1262 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1263 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1264 | {} | |
1265 | }, | |
1266 | }, | |
b9368f5c | 1267 | [ALC880_FIXUP_TCL_S700] = { |
1727a771 | 1268 | .type = HDA_FIXUP_VERBS, |
b9368f5c TI |
1269 | .v.verbs = (const struct hda_verb[]) { |
1270 | /* change to EAPD mode */ | |
1271 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1272 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
1273 | {} | |
1274 | }, | |
1275 | .chained = true, | |
1276 | .chain_id = ALC880_FIXUP_GPIO2, | |
1277 | }, | |
cf5a2279 | 1278 | [ALC880_FIXUP_VOL_KNOB] = { |
1727a771 | 1279 | .type = HDA_FIXUP_FUNC, |
cf5a2279 TI |
1280 | .v.func = alc880_fixup_vol_knob, |
1281 | }, | |
1282 | [ALC880_FIXUP_FUJITSU] = { | |
1283 | /* override all pins as BIOS on old Amilo is broken */ | |
1727a771 TI |
1284 | .type = HDA_FIXUP_PINS, |
1285 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1286 | { 0x14, 0x0121401f }, /* HP */ |
cf5a2279 TI |
1287 | { 0x15, 0x99030120 }, /* speaker */ |
1288 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1289 | { 0x17, 0x411111f0 }, /* N/A */ | |
1290 | { 0x18, 0x411111f0 }, /* N/A */ | |
1291 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1292 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1293 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1294 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1295 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1296 | { 0x1e, 0x01454140 }, /* SPDIF out */ | |
1297 | { } | |
1298 | }, | |
1299 | .chained = true, | |
1300 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1301 | }, | |
ba533818 TI |
1302 | [ALC880_FIXUP_F1734] = { |
1303 | /* almost compatible with FUJITSU, but no bass and SPDIF */ | |
1727a771 TI |
1304 | .type = HDA_FIXUP_PINS, |
1305 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1306 | { 0x14, 0x0121401f }, /* HP */ |
ba533818 TI |
1307 | { 0x15, 0x99030120 }, /* speaker */ |
1308 | { 0x16, 0x411111f0 }, /* N/A */ | |
1309 | { 0x17, 0x411111f0 }, /* N/A */ | |
1310 | { 0x18, 0x411111f0 }, /* N/A */ | |
1311 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1312 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1313 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1314 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1315 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1316 | { 0x1e, 0x411111f0 }, /* N/A */ | |
1317 | { } | |
1318 | }, | |
1319 | .chained = true, | |
1320 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1321 | }, | |
817de92f TI |
1322 | [ALC880_FIXUP_UNIWILL] = { |
1323 | /* need to fix HP and speaker pins to be parsed correctly */ | |
1727a771 TI |
1324 | .type = HDA_FIXUP_PINS, |
1325 | .v.pins = (const struct hda_pintbl[]) { | |
817de92f TI |
1326 | { 0x14, 0x0121411f }, /* HP */ |
1327 | { 0x15, 0x99030120 }, /* speaker */ | |
1328 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1329 | { } | |
1330 | }, | |
1331 | }, | |
967b88c4 | 1332 | [ALC880_FIXUP_UNIWILL_DIG] = { |
1727a771 TI |
1333 | .type = HDA_FIXUP_PINS, |
1334 | .v.pins = (const struct hda_pintbl[]) { | |
967b88c4 TI |
1335 | /* disable bogus unused pins */ |
1336 | { 0x17, 0x411111f0 }, | |
1337 | { 0x19, 0x411111f0 }, | |
1338 | { 0x1b, 0x411111f0 }, | |
1339 | { 0x1f, 0x411111f0 }, | |
1340 | { } | |
1341 | } | |
1342 | }, | |
96e225f6 | 1343 | [ALC880_FIXUP_Z71V] = { |
1727a771 TI |
1344 | .type = HDA_FIXUP_PINS, |
1345 | .v.pins = (const struct hda_pintbl[]) { | |
96e225f6 TI |
1346 | /* set up the whole pins as BIOS is utterly broken */ |
1347 | { 0x14, 0x99030120 }, /* speaker */ | |
1348 | { 0x15, 0x0121411f }, /* HP */ | |
1349 | { 0x16, 0x411111f0 }, /* N/A */ | |
1350 | { 0x17, 0x411111f0 }, /* N/A */ | |
1351 | { 0x18, 0x01a19950 }, /* mic-in */ | |
1352 | { 0x19, 0x411111f0 }, /* N/A */ | |
1353 | { 0x1a, 0x01813031 }, /* line-in */ | |
1354 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1355 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1356 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1357 | { 0x1e, 0x0144111e }, /* SPDIF */ | |
1358 | { } | |
1359 | } | |
1360 | }, | |
487a588d TI |
1361 | [ALC880_FIXUP_ASUS_W5A] = { |
1362 | .type = HDA_FIXUP_PINS, | |
1363 | .v.pins = (const struct hda_pintbl[]) { | |
1364 | /* set up the whole pins as BIOS is utterly broken */ | |
1365 | { 0x14, 0x0121411f }, /* HP */ | |
1366 | { 0x15, 0x411111f0 }, /* N/A */ | |
1367 | { 0x16, 0x411111f0 }, /* N/A */ | |
1368 | { 0x17, 0x411111f0 }, /* N/A */ | |
1369 | { 0x18, 0x90a60160 }, /* mic */ | |
1370 | { 0x19, 0x411111f0 }, /* N/A */ | |
1371 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1372 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1373 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1374 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1375 | { 0x1e, 0xb743111e }, /* SPDIF out */ | |
1376 | { } | |
1377 | }, | |
1378 | .chained = true, | |
1379 | .chain_id = ALC880_FIXUP_GPIO1, | |
1380 | }, | |
67b6ec31 | 1381 | [ALC880_FIXUP_3ST_BASE] = { |
1727a771 TI |
1382 | .type = HDA_FIXUP_PINS, |
1383 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1384 | { 0x14, 0x01014010 }, /* line-out */ |
1385 | { 0x15, 0x411111f0 }, /* N/A */ | |
1386 | { 0x16, 0x411111f0 }, /* N/A */ | |
1387 | { 0x17, 0x411111f0 }, /* N/A */ | |
1388 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1389 | { 0x19, 0x0121411f }, /* HP */ | |
1390 | { 0x1a, 0x01813031 }, /* line-in */ | |
1391 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1392 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1393 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1394 | /* 0x1e is filled in below */ | |
1395 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1396 | { } | |
1397 | } | |
1398 | }, | |
1399 | [ALC880_FIXUP_3ST] = { | |
1727a771 TI |
1400 | .type = HDA_FIXUP_PINS, |
1401 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1402 | { 0x1e, 0x411111f0 }, /* N/A */ |
1403 | { } | |
1404 | }, | |
1405 | .chained = true, | |
1406 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1407 | }, | |
1408 | [ALC880_FIXUP_3ST_DIG] = { | |
1727a771 TI |
1409 | .type = HDA_FIXUP_PINS, |
1410 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1411 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1412 | { } | |
1413 | }, | |
1414 | .chained = true, | |
1415 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1416 | }, | |
1417 | [ALC880_FIXUP_5ST_BASE] = { | |
1727a771 TI |
1418 | .type = HDA_FIXUP_PINS, |
1419 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1420 | { 0x14, 0x01014010 }, /* front */ |
1421 | { 0x15, 0x411111f0 }, /* N/A */ | |
1422 | { 0x16, 0x01011411 }, /* CLFE */ | |
1423 | { 0x17, 0x01016412 }, /* surr */ | |
1424 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1425 | { 0x19, 0x0121411f }, /* HP */ | |
1426 | { 0x1a, 0x01813031 }, /* line-in */ | |
1427 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1428 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1429 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1430 | /* 0x1e is filled in below */ | |
1431 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1432 | { } | |
1433 | } | |
1434 | }, | |
1435 | [ALC880_FIXUP_5ST] = { | |
1727a771 TI |
1436 | .type = HDA_FIXUP_PINS, |
1437 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1438 | { 0x1e, 0x411111f0 }, /* N/A */ |
1439 | { } | |
1440 | }, | |
1441 | .chained = true, | |
1442 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1443 | }, | |
1444 | [ALC880_FIXUP_5ST_DIG] = { | |
1727a771 TI |
1445 | .type = HDA_FIXUP_PINS, |
1446 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1447 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1448 | { } | |
1449 | }, | |
1450 | .chained = true, | |
1451 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1452 | }, | |
1453 | [ALC880_FIXUP_6ST_BASE] = { | |
1727a771 TI |
1454 | .type = HDA_FIXUP_PINS, |
1455 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1456 | { 0x14, 0x01014010 }, /* front */ |
1457 | { 0x15, 0x01016412 }, /* surr */ | |
1458 | { 0x16, 0x01011411 }, /* CLFE */ | |
1459 | { 0x17, 0x01012414 }, /* side */ | |
1460 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1461 | { 0x19, 0x02a19c40 }, /* front-mic */ | |
1462 | { 0x1a, 0x01813031 }, /* line-in */ | |
1463 | { 0x1b, 0x0121411f }, /* HP */ | |
1464 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1465 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1466 | /* 0x1e is filled in below */ | |
1467 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1468 | { } | |
1469 | } | |
1470 | }, | |
1471 | [ALC880_FIXUP_6ST] = { | |
1727a771 TI |
1472 | .type = HDA_FIXUP_PINS, |
1473 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1474 | { 0x1e, 0x411111f0 }, /* N/A */ |
1475 | { } | |
1476 | }, | |
1477 | .chained = true, | |
1478 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1479 | }, | |
1480 | [ALC880_FIXUP_6ST_DIG] = { | |
1727a771 TI |
1481 | .type = HDA_FIXUP_PINS, |
1482 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1483 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1484 | { } | |
1485 | }, | |
1486 | .chained = true, | |
1487 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1488 | }, | |
5397145f TI |
1489 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
1490 | .type = HDA_FIXUP_PINS, | |
1491 | .v.pins = (const struct hda_pintbl[]) { | |
1492 | { 0x1b, 0x0121401f }, /* HP with jack detect */ | |
1493 | { } | |
1494 | }, | |
1495 | .chained_before = true, | |
1496 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1497 | }, | |
ee3b2969 TI |
1498 | }; |
1499 | ||
1500 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { | |
f02aab5d | 1501 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
487a588d | 1502 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
96e225f6 | 1503 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
29e3fdcc | 1504 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
6538de03 | 1505 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
29e3fdcc | 1506 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
27e917f8 | 1507 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
967b88c4 | 1508 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
ba533818 | 1509 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
817de92f | 1510 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
7833c7e8 | 1511 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
f02aab5d | 1512 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
ee3b2969 | 1513 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
5397145f | 1514 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
a161574e | 1515 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
cf5a2279 | 1516 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
ba533818 | 1517 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
cf5a2279 | 1518 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
dc6af52d TI |
1519 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
1520 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), | |
1521 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), | |
db8a38e5 | 1522 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
b9368f5c | 1523 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
67b6ec31 TI |
1524 | |
1525 | /* Below is the copied entries from alc880_quirks.c. | |
1526 | * It's not quite sure whether BIOS sets the correct pin-config table | |
1527 | * on these machines, thus they are kept to be compatible with | |
1528 | * the old static quirks. Once when it's confirmed to work without | |
1529 | * these overrides, it'd be better to remove. | |
1530 | */ | |
1531 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), | |
1532 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), | |
1533 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), | |
1534 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), | |
1535 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), | |
1536 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), | |
1537 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), | |
1538 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), | |
1539 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), | |
1540 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), | |
1541 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), | |
1542 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), | |
1543 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), | |
1544 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), | |
1545 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), | |
1546 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), | |
1547 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), | |
1548 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), | |
1549 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), | |
1550 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), | |
1551 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), | |
1552 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ | |
1553 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), | |
1554 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1555 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1556 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1557 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1558 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1559 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1560 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1561 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1562 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1563 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1564 | /* default Intel */ | |
1565 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), | |
1566 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), | |
1567 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), | |
1568 | {} | |
1569 | }; | |
1570 | ||
1727a771 | 1571 | static const struct hda_model_fixup alc880_fixup_models[] = { |
67b6ec31 TI |
1572 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
1573 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, | |
1574 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, | |
1575 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, | |
1576 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, | |
1577 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, | |
5397145f | 1578 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
ee3b2969 TI |
1579 | {} |
1580 | }; | |
1581 | ||
1582 | ||
1d045db9 TI |
1583 | /* |
1584 | * OK, here we have finally the patch for ALC880 | |
1585 | */ | |
1d045db9 | 1586 | static int patch_alc880(struct hda_codec *codec) |
60db6b53 | 1587 | { |
1d045db9 | 1588 | struct alc_spec *spec; |
1d045db9 | 1589 | int err; |
f6a92248 | 1590 | |
3de95173 TI |
1591 | err = alc_alloc_spec(codec, 0x0b); |
1592 | if (err < 0) | |
1593 | return err; | |
64154835 | 1594 | |
3de95173 | 1595 | spec = codec->spec; |
08c189f2 | 1596 | spec->gen.need_dac_fix = 1; |
7504b6cd | 1597 | spec->gen.beep_nid = 0x01; |
f53281e6 | 1598 | |
225068ab TI |
1599 | codec->patch_ops.unsol_event = alc880_unsol_event; |
1600 | ||
c9af753f TI |
1601 | alc_pre_init(codec); |
1602 | ||
1727a771 | 1603 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
67b6ec31 | 1604 | alc880_fixups); |
1727a771 | 1605 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ee3b2969 | 1606 | |
67b6ec31 TI |
1607 | /* automatic parse from the BIOS config */ |
1608 | err = alc880_parse_auto_config(codec); | |
1609 | if (err < 0) | |
1610 | goto error; | |
fe3eb0a7 | 1611 | |
fea80fae TI |
1612 | if (!spec->gen.no_analog) { |
1613 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
1614 | if (err < 0) | |
1615 | goto error; | |
1616 | } | |
f53281e6 | 1617 | |
1727a771 | 1618 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1619 | |
1d045db9 | 1620 | return 0; |
e16fb6d1 TI |
1621 | |
1622 | error: | |
1623 | alc_free(codec); | |
1624 | return err; | |
226b1ec8 KY |
1625 | } |
1626 | ||
1d045db9 | 1627 | |
60db6b53 | 1628 | /* |
1d045db9 | 1629 | * ALC260 support |
60db6b53 | 1630 | */ |
1d045db9 | 1631 | static int alc260_parse_auto_config(struct hda_codec *codec) |
f6a92248 | 1632 | { |
1d045db9 | 1633 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
3e6179b8 TI |
1634 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
1635 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); | |
f6a92248 KY |
1636 | } |
1637 | ||
1d045db9 TI |
1638 | /* |
1639 | * Pin config fixes | |
1640 | */ | |
1641 | enum { | |
ca8f0424 TI |
1642 | ALC260_FIXUP_HP_DC5750, |
1643 | ALC260_FIXUP_HP_PIN_0F, | |
1644 | ALC260_FIXUP_COEF, | |
15317ab2 | 1645 | ALC260_FIXUP_GPIO1, |
20f7d928 TI |
1646 | ALC260_FIXUP_GPIO1_TOGGLE, |
1647 | ALC260_FIXUP_REPLACER, | |
0a1c4fa2 | 1648 | ALC260_FIXUP_HP_B1900, |
118cb4a4 | 1649 | ALC260_FIXUP_KN1, |
39aedee7 | 1650 | ALC260_FIXUP_FSC_S7020, |
5ebd3bbd | 1651 | ALC260_FIXUP_FSC_S7020_JWSE, |
d08c5ef2 | 1652 | ALC260_FIXUP_VAIO_PINS, |
1d045db9 TI |
1653 | }; |
1654 | ||
20f7d928 TI |
1655 | static void alc260_gpio1_automute(struct hda_codec *codec) |
1656 | { | |
1657 | struct alc_spec *spec = codec->spec; | |
aaf312de TI |
1658 | |
1659 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); | |
20f7d928 TI |
1660 | } |
1661 | ||
1662 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, | |
1727a771 | 1663 | const struct hda_fixup *fix, int action) |
20f7d928 TI |
1664 | { |
1665 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1666 | if (action == HDA_FIXUP_ACT_PROBE) { |
20f7d928 TI |
1667 | /* although the machine has only one output pin, we need to |
1668 | * toggle GPIO1 according to the jack state | |
1669 | */ | |
08c189f2 TI |
1670 | spec->gen.automute_hook = alc260_gpio1_automute; |
1671 | spec->gen.detect_hp = 1; | |
1672 | spec->gen.automute_speaker = 1; | |
1673 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ | |
62f949bf | 1674 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
08c189f2 | 1675 | snd_hda_gen_hp_automute); |
5579cd6f | 1676 | alc_setup_gpio(codec, 0x01); |
20f7d928 TI |
1677 | } |
1678 | } | |
1679 | ||
118cb4a4 | 1680 | static void alc260_fixup_kn1(struct hda_codec *codec, |
1727a771 | 1681 | const struct hda_fixup *fix, int action) |
118cb4a4 TI |
1682 | { |
1683 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1684 | static const struct hda_pintbl pincfgs[] = { |
118cb4a4 TI |
1685 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
1686 | { 0x12, 0x90a60160 }, /* int mic */ | |
1687 | { 0x13, 0x02a19000 }, /* ext mic */ | |
1688 | { 0x18, 0x01446000 }, /* SPDIF out */ | |
1689 | /* disable bogus I/O pins */ | |
1690 | { 0x10, 0x411111f0 }, | |
1691 | { 0x11, 0x411111f0 }, | |
1692 | { 0x14, 0x411111f0 }, | |
1693 | { 0x15, 0x411111f0 }, | |
1694 | { 0x16, 0x411111f0 }, | |
1695 | { 0x17, 0x411111f0 }, | |
1696 | { 0x19, 0x411111f0 }, | |
1697 | { } | |
1698 | }; | |
1699 | ||
1700 | switch (action) { | |
1727a771 TI |
1701 | case HDA_FIXUP_ACT_PRE_PROBE: |
1702 | snd_hda_apply_pincfgs(codec, pincfgs); | |
118cb4a4 TI |
1703 | spec->init_amp = ALC_INIT_NONE; |
1704 | break; | |
1705 | } | |
1706 | } | |
1707 | ||
39aedee7 TI |
1708 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
1709 | const struct hda_fixup *fix, int action) | |
1710 | { | |
1711 | struct alc_spec *spec = codec->spec; | |
1c76aa5f | 1712 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
5ebd3bbd TI |
1713 | spec->init_amp = ALC_INIT_NONE; |
1714 | } | |
39aedee7 | 1715 | |
5ebd3bbd TI |
1716 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
1717 | const struct hda_fixup *fix, int action) | |
1718 | { | |
1719 | struct alc_spec *spec = codec->spec; | |
1720 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
f811c3cf | 1721 | spec->gen.add_jack_modes = 1; |
5ebd3bbd | 1722 | spec->gen.hp_mic = 1; |
e6e0ee50 | 1723 | } |
39aedee7 TI |
1724 | } |
1725 | ||
1727a771 | 1726 | static const struct hda_fixup alc260_fixups[] = { |
ca8f0424 | 1727 | [ALC260_FIXUP_HP_DC5750] = { |
1727a771 TI |
1728 | .type = HDA_FIXUP_PINS, |
1729 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
1730 | { 0x11, 0x90130110 }, /* speaker */ |
1731 | { } | |
1732 | } | |
1733 | }, | |
ca8f0424 | 1734 | [ALC260_FIXUP_HP_PIN_0F] = { |
1727a771 TI |
1735 | .type = HDA_FIXUP_PINS, |
1736 | .v.pins = (const struct hda_pintbl[]) { | |
ca8f0424 TI |
1737 | { 0x0f, 0x01214000 }, /* HP */ |
1738 | { } | |
1739 | } | |
1740 | }, | |
1741 | [ALC260_FIXUP_COEF] = { | |
1727a771 | 1742 | .type = HDA_FIXUP_VERBS, |
ca8f0424 | 1743 | .v.verbs = (const struct hda_verb[]) { |
e30cf2d2 RM |
1744 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1745 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, | |
ca8f0424 TI |
1746 | { } |
1747 | }, | |
ca8f0424 | 1748 | }, |
15317ab2 | 1749 | [ALC260_FIXUP_GPIO1] = { |
5579cd6f TI |
1750 | .type = HDA_FIXUP_FUNC, |
1751 | .v.func = alc_fixup_gpio1, | |
15317ab2 | 1752 | }, |
20f7d928 | 1753 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
1727a771 | 1754 | .type = HDA_FIXUP_FUNC, |
20f7d928 TI |
1755 | .v.func = alc260_fixup_gpio1_toggle, |
1756 | .chained = true, | |
1757 | .chain_id = ALC260_FIXUP_HP_PIN_0F, | |
1758 | }, | |
1759 | [ALC260_FIXUP_REPLACER] = { | |
1727a771 | 1760 | .type = HDA_FIXUP_VERBS, |
20f7d928 | 1761 | .v.verbs = (const struct hda_verb[]) { |
192a98e2 TI |
1762 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1763 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
20f7d928 TI |
1764 | { } |
1765 | }, | |
1766 | .chained = true, | |
1767 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, | |
1768 | }, | |
0a1c4fa2 | 1769 | [ALC260_FIXUP_HP_B1900] = { |
1727a771 | 1770 | .type = HDA_FIXUP_FUNC, |
0a1c4fa2 TI |
1771 | .v.func = alc260_fixup_gpio1_toggle, |
1772 | .chained = true, | |
1773 | .chain_id = ALC260_FIXUP_COEF, | |
118cb4a4 TI |
1774 | }, |
1775 | [ALC260_FIXUP_KN1] = { | |
1727a771 | 1776 | .type = HDA_FIXUP_FUNC, |
118cb4a4 TI |
1777 | .v.func = alc260_fixup_kn1, |
1778 | }, | |
39aedee7 TI |
1779 | [ALC260_FIXUP_FSC_S7020] = { |
1780 | .type = HDA_FIXUP_FUNC, | |
1781 | .v.func = alc260_fixup_fsc_s7020, | |
1782 | }, | |
5ebd3bbd TI |
1783 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
1784 | .type = HDA_FIXUP_FUNC, | |
1785 | .v.func = alc260_fixup_fsc_s7020_jwse, | |
1786 | .chained = true, | |
1787 | .chain_id = ALC260_FIXUP_FSC_S7020, | |
1788 | }, | |
d08c5ef2 TI |
1789 | [ALC260_FIXUP_VAIO_PINS] = { |
1790 | .type = HDA_FIXUP_PINS, | |
1791 | .v.pins = (const struct hda_pintbl[]) { | |
1792 | /* Pin configs are missing completely on some VAIOs */ | |
1793 | { 0x0f, 0x01211020 }, | |
1794 | { 0x10, 0x0001003f }, | |
1795 | { 0x11, 0x411111f0 }, | |
1796 | { 0x12, 0x01a15930 }, | |
1797 | { 0x13, 0x411111f0 }, | |
1798 | { 0x14, 0x411111f0 }, | |
1799 | { 0x15, 0x411111f0 }, | |
1800 | { 0x16, 0x411111f0 }, | |
1801 | { 0x17, 0x411111f0 }, | |
1802 | { 0x18, 0x411111f0 }, | |
1803 | { 0x19, 0x411111f0 }, | |
1804 | { } | |
1805 | } | |
1806 | }, | |
1d045db9 TI |
1807 | }; |
1808 | ||
1809 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { | |
15317ab2 | 1810 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1811 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
15317ab2 | 1812 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1813 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
0a1c4fa2 | 1814 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
d08c5ef2 | 1815 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
0f5a5b85 | 1816 | SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), |
39aedee7 | 1817 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
b1f58085 | 1818 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
118cb4a4 | 1819 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
20f7d928 | 1820 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
ca8f0424 | 1821 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
1d045db9 TI |
1822 | {} |
1823 | }; | |
1824 | ||
5ebd3bbd TI |
1825 | static const struct hda_model_fixup alc260_fixup_models[] = { |
1826 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, | |
1827 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, | |
1828 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, | |
1829 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, | |
1830 | {} | |
1831 | }; | |
1832 | ||
1d045db9 TI |
1833 | /* |
1834 | */ | |
1d045db9 | 1835 | static int patch_alc260(struct hda_codec *codec) |
977ddd6b | 1836 | { |
1d045db9 | 1837 | struct alc_spec *spec; |
c3c2c9e7 | 1838 | int err; |
1d045db9 | 1839 | |
3de95173 TI |
1840 | err = alc_alloc_spec(codec, 0x07); |
1841 | if (err < 0) | |
1842 | return err; | |
1d045db9 | 1843 | |
3de95173 | 1844 | spec = codec->spec; |
ea46c3c8 TI |
1845 | /* as quite a few machines require HP amp for speaker outputs, |
1846 | * it's easier to enable it unconditionally; even if it's unneeded, | |
1847 | * it's almost harmless. | |
1848 | */ | |
1849 | spec->gen.prefer_hp_amp = 1; | |
7504b6cd | 1850 | spec->gen.beep_nid = 0x01; |
1d045db9 | 1851 | |
225068ab TI |
1852 | spec->shutup = alc_eapd_shutup; |
1853 | ||
c9af753f TI |
1854 | alc_pre_init(codec); |
1855 | ||
5ebd3bbd TI |
1856 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
1857 | alc260_fixups); | |
1727a771 | 1858 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
977ddd6b | 1859 | |
c3c2c9e7 TI |
1860 | /* automatic parse from the BIOS config */ |
1861 | err = alc260_parse_auto_config(codec); | |
1862 | if (err < 0) | |
1863 | goto error; | |
977ddd6b | 1864 | |
fea80fae TI |
1865 | if (!spec->gen.no_analog) { |
1866 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); | |
1867 | if (err < 0) | |
1868 | goto error; | |
1869 | } | |
977ddd6b | 1870 | |
1727a771 | 1871 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1872 | |
1d045db9 | 1873 | return 0; |
e16fb6d1 TI |
1874 | |
1875 | error: | |
1876 | alc_free(codec); | |
1877 | return err; | |
6981d184 TI |
1878 | } |
1879 | ||
1d045db9 TI |
1880 | |
1881 | /* | |
1882 | * ALC882/883/885/888/889 support | |
1883 | * | |
1884 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible | |
1885 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
1886 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
1887 | * 6-channel independent captures. | |
1888 | * | |
1889 | * In addition, an independent DAC for the multi-playback (not used in this | |
1890 | * driver yet). | |
1891 | */ | |
1d045db9 TI |
1892 | |
1893 | /* | |
1894 | * Pin config fixes | |
1895 | */ | |
ff818c24 | 1896 | enum { |
5c0ebfbe TI |
1897 | ALC882_FIXUP_ABIT_AW9D_MAX, |
1898 | ALC882_FIXUP_LENOVO_Y530, | |
1899 | ALC882_FIXUP_PB_M5210, | |
1900 | ALC882_FIXUP_ACER_ASPIRE_7736, | |
1901 | ALC882_FIXUP_ASUS_W90V, | |
8f239214 | 1902 | ALC889_FIXUP_CD, |
b2c53e20 | 1903 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
5c0ebfbe | 1904 | ALC889_FIXUP_VAIO_TT, |
0e7cc2e7 | 1905 | ALC888_FIXUP_EEE1601, |
177943a3 | 1906 | ALC882_FIXUP_EAPD, |
7a6069bf | 1907 | ALC883_FIXUP_EAPD, |
8812c4f9 | 1908 | ALC883_FIXUP_ACER_EAPD, |
1a97b7f2 TI |
1909 | ALC882_FIXUP_GPIO1, |
1910 | ALC882_FIXUP_GPIO2, | |
eb844d51 | 1911 | ALC882_FIXUP_GPIO3, |
68ef0561 TI |
1912 | ALC889_FIXUP_COEF, |
1913 | ALC882_FIXUP_ASUS_W2JC, | |
c3e837bb TI |
1914 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
1915 | ALC882_FIXUP_ACER_ASPIRE_8930G, | |
1916 | ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
5671087f | 1917 | ALC885_FIXUP_MACPRO_GPIO, |
02a237b2 | 1918 | ALC889_FIXUP_DAC_ROUTE, |
1a97b7f2 TI |
1919 | ALC889_FIXUP_MBP_VREF, |
1920 | ALC889_FIXUP_IMAC91_VREF, | |
e7729a41 | 1921 | ALC889_FIXUP_MBA11_VREF, |
0756f09c | 1922 | ALC889_FIXUP_MBA21_VREF, |
c20f31ec | 1923 | ALC889_FIXUP_MP11_VREF, |
9f660a1c | 1924 | ALC889_FIXUP_MP41_VREF, |
6e72aa5f | 1925 | ALC882_FIXUP_INV_DMIC, |
e427c237 | 1926 | ALC882_FIXUP_NO_PRIMARY_HP, |
1f0bbf03 | 1927 | ALC887_FIXUP_ASUS_BASS, |
eb9ca3ab | 1928 | ALC887_FIXUP_BASS_CHMAP, |
7beb3a6e | 1929 | ALC1220_FIXUP_GB_DUAL_CODECS, |
0202f5cd | 1930 | ALC1220_FIXUP_CLEVO_P950, |
80690a27 RS |
1931 | ALC1220_FIXUP_CLEVO_PB51ED, |
1932 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, | |
ca184355 JHP |
1933 | ALC887_FIXUP_ASUS_AUDIO, |
1934 | ALC887_FIXUP_ASUS_HMIC, | |
ff818c24 TI |
1935 | }; |
1936 | ||
68ef0561 | 1937 | static void alc889_fixup_coef(struct hda_codec *codec, |
1727a771 | 1938 | const struct hda_fixup *fix, int action) |
68ef0561 | 1939 | { |
1727a771 | 1940 | if (action != HDA_FIXUP_ACT_INIT) |
68ef0561 | 1941 | return; |
1df8874b | 1942 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
68ef0561 TI |
1943 | } |
1944 | ||
5671087f TI |
1945 | /* set up GPIO at initialization */ |
1946 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, | |
1727a771 | 1947 | const struct hda_fixup *fix, int action) |
5671087f | 1948 | { |
215c850c TI |
1949 | struct alc_spec *spec = codec->spec; |
1950 | ||
1951 | spec->gpio_write_delay = true; | |
1952 | alc_fixup_gpio3(codec, fix, action); | |
5671087f TI |
1953 | } |
1954 | ||
02a237b2 TI |
1955 | /* Fix the connection of some pins for ALC889: |
1956 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't | |
1957 | * work correctly (bko#42740) | |
1958 | */ | |
1959 | static void alc889_fixup_dac_route(struct hda_codec *codec, | |
1727a771 | 1960 | const struct hda_fixup *fix, int action) |
02a237b2 | 1961 | { |
1727a771 | 1962 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
ef8d60fb | 1963 | /* fake the connections during parsing the tree */ |
caf3c043 MM |
1964 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
1965 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; | |
1966 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
1967 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
1968 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); | |
1969 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); | |
1727a771 | 1970 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
ef8d60fb | 1971 | /* restore the connections */ |
caf3c043 MM |
1972 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
1973 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); | |
1974 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); | |
1975 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); | |
1976 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); | |
02a237b2 TI |
1977 | } |
1978 | } | |
1979 | ||
1a97b7f2 TI |
1980 | /* Set VREF on HP pin */ |
1981 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, | |
1727a771 | 1982 | const struct hda_fixup *fix, int action) |
1a97b7f2 | 1983 | { |
caf3c043 | 1984 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
1a97b7f2 | 1985 | struct alc_spec *spec = codec->spec; |
1a97b7f2 TI |
1986 | int i; |
1987 | ||
1727a771 | 1988 | if (action != HDA_FIXUP_ACT_INIT) |
1a97b7f2 TI |
1989 | return; |
1990 | for (i = 0; i < ARRAY_SIZE(nids); i++) { | |
1991 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); | |
1992 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) | |
1993 | continue; | |
d3f02d60 | 1994 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 1995 | val |= AC_PINCTL_VREF_80; |
cdd03ced | 1996 | snd_hda_set_pin_ctl(codec, nids[i], val); |
08c189f2 | 1997 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
1998 | break; |
1999 | } | |
2000 | } | |
2001 | ||
0756f09c TI |
2002 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
2003 | const hda_nid_t *nids, int num_nids) | |
1a97b7f2 TI |
2004 | { |
2005 | struct alc_spec *spec = codec->spec; | |
1a97b7f2 TI |
2006 | int i; |
2007 | ||
0756f09c | 2008 | for (i = 0; i < num_nids; i++) { |
1a97b7f2 | 2009 | unsigned int val; |
d3f02d60 | 2010 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 2011 | val |= AC_PINCTL_VREF_50; |
cdd03ced | 2012 | snd_hda_set_pin_ctl(codec, nids[i], val); |
1a97b7f2 | 2013 | } |
08c189f2 | 2014 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
2015 | } |
2016 | ||
0756f09c TI |
2017 | /* Set VREF on speaker pins on imac91 */ |
2018 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | |
2019 | const struct hda_fixup *fix, int action) | |
2020 | { | |
caf3c043 | 2021 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
0756f09c TI |
2022 | |
2023 | if (action == HDA_FIXUP_ACT_INIT) | |
2024 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2025 | } | |
2026 | ||
e7729a41 AV |
2027 | /* Set VREF on speaker pins on mba11 */ |
2028 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, | |
2029 | const struct hda_fixup *fix, int action) | |
2030 | { | |
caf3c043 | 2031 | static const hda_nid_t nids[] = { 0x18 }; |
e7729a41 AV |
2032 | |
2033 | if (action == HDA_FIXUP_ACT_INIT) | |
2034 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2035 | } | |
2036 | ||
0756f09c TI |
2037 | /* Set VREF on speaker pins on mba21 */ |
2038 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, | |
2039 | const struct hda_fixup *fix, int action) | |
2040 | { | |
caf3c043 | 2041 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
0756f09c TI |
2042 | |
2043 | if (action == HDA_FIXUP_ACT_INIT) | |
2044 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2045 | } | |
2046 | ||
e427c237 | 2047 | /* Don't take HP output as primary |
d9111496 FLVC |
2048 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
2049 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 | |
e427c237 TI |
2050 | */ |
2051 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, | |
1727a771 | 2052 | const struct hda_fixup *fix, int action) |
e427c237 TI |
2053 | { |
2054 | struct alc_spec *spec = codec->spec; | |
da96fb5b | 2055 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
08c189f2 | 2056 | spec->gen.no_primary_hp = 1; |
da96fb5b TI |
2057 | spec->gen.no_multi_io = 1; |
2058 | } | |
e427c237 TI |
2059 | } |
2060 | ||
eb9ca3ab TI |
2061 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
2062 | const struct hda_fixup *fix, int action); | |
2063 | ||
7beb3a6e TI |
2064 | /* For dual-codec configuration, we need to disable some features to avoid |
2065 | * conflicts of kctls and PCM streams | |
2066 | */ | |
2067 | static void alc_fixup_dual_codecs(struct hda_codec *codec, | |
2068 | const struct hda_fixup *fix, int action) | |
2069 | { | |
2070 | struct alc_spec *spec = codec->spec; | |
2071 | ||
2072 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2073 | return; | |
2074 | /* disable vmaster */ | |
2075 | spec->gen.suppress_vmaster = 1; | |
2076 | /* auto-mute and auto-mic switch don't work with multiple codecs */ | |
2077 | spec->gen.suppress_auto_mute = 1; | |
2078 | spec->gen.suppress_auto_mic = 1; | |
2079 | /* disable aamix as well */ | |
2080 | spec->gen.mixer_nid = 0; | |
2081 | /* add location prefix to avoid conflicts */ | |
2082 | codec->force_pin_prefix = 1; | |
2083 | } | |
2084 | ||
2085 | static void rename_ctl(struct hda_codec *codec, const char *oldname, | |
2086 | const char *newname) | |
2087 | { | |
2088 | struct snd_kcontrol *kctl; | |
2089 | ||
2090 | kctl = snd_hda_find_mixer_ctl(codec, oldname); | |
2091 | if (kctl) | |
2092 | strcpy(kctl->id.name, newname); | |
2093 | } | |
2094 | ||
2095 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, | |
2096 | const struct hda_fixup *fix, | |
2097 | int action) | |
2098 | { | |
2099 | alc_fixup_dual_codecs(codec, fix, action); | |
2100 | switch (action) { | |
2101 | case HDA_FIXUP_ACT_PRE_PROBE: | |
2102 | /* override card longname to provide a unique UCM profile */ | |
2103 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); | |
2104 | break; | |
2105 | case HDA_FIXUP_ACT_BUILD: | |
2106 | /* rename Capture controls depending on the codec */ | |
2107 | rename_ctl(codec, "Capture Volume", | |
2108 | codec->addr == 0 ? | |
2109 | "Rear-Panel Capture Volume" : | |
2110 | "Front-Panel Capture Volume"); | |
2111 | rename_ctl(codec, "Capture Switch", | |
2112 | codec->addr == 0 ? | |
2113 | "Rear-Panel Capture Switch" : | |
2114 | "Front-Panel Capture Switch"); | |
2115 | break; | |
2116 | } | |
2117 | } | |
2118 | ||
0202f5cd P |
2119 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
2120 | const struct hda_fixup *fix, | |
2121 | int action) | |
2122 | { | |
caf3c043 | 2123 | static const hda_nid_t conn1[] = { 0x0c }; |
0202f5cd P |
2124 | |
2125 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2126 | return; | |
2127 | ||
2128 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); | |
2129 | /* We therefore want to make sure 0x14 (front headphone) and | |
2130 | * 0x1b (speakers) use the stereo DAC 0x02 | |
2131 | */ | |
caf3c043 MM |
2132 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
2133 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); | |
0202f5cd P |
2134 | } |
2135 | ||
7f665b1c JS |
2136 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
2137 | const struct hda_fixup *fix, int action); | |
2138 | ||
80690a27 | 2139 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
7f665b1c JS |
2140 | const struct hda_fixup *fix, |
2141 | int action) | |
2142 | { | |
2143 | alc1220_fixup_clevo_p950(codec, fix, action); | |
2144 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); | |
2145 | } | |
2146 | ||
ca184355 JHP |
2147 | static void alc887_asus_hp_automute_hook(struct hda_codec *codec, |
2148 | struct hda_jack_callback *jack) | |
2149 | { | |
2150 | struct alc_spec *spec = codec->spec; | |
2151 | unsigned int vref; | |
2152 | ||
2153 | snd_hda_gen_hp_automute(codec, jack); | |
2154 | ||
2155 | if (spec->gen.hp_jack_present) | |
2156 | vref = AC_PINCTL_VREF_80; | |
2157 | else | |
2158 | vref = AC_PINCTL_VREF_HIZ; | |
2159 | snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); | |
2160 | } | |
2161 | ||
2162 | static void alc887_fixup_asus_jack(struct hda_codec *codec, | |
2163 | const struct hda_fixup *fix, int action) | |
2164 | { | |
2165 | struct alc_spec *spec = codec->spec; | |
2166 | if (action != HDA_FIXUP_ACT_PROBE) | |
2167 | return; | |
2168 | snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); | |
2169 | spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; | |
2170 | } | |
2171 | ||
1727a771 | 2172 | static const struct hda_fixup alc882_fixups[] = { |
5c0ebfbe | 2173 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
1727a771 TI |
2174 | .type = HDA_FIXUP_PINS, |
2175 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2176 | { 0x15, 0x01080104 }, /* side */ |
2177 | { 0x16, 0x01011012 }, /* rear */ | |
2178 | { 0x17, 0x01016011 }, /* clfe */ | |
2785591a | 2179 | { } |
145a902b DH |
2180 | } |
2181 | }, | |
5c0ebfbe | 2182 | [ALC882_FIXUP_LENOVO_Y530] = { |
1727a771 TI |
2183 | .type = HDA_FIXUP_PINS, |
2184 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2185 | { 0x15, 0x99130112 }, /* rear int speakers */ |
2186 | { 0x16, 0x99130111 }, /* subwoofer */ | |
ac612407 DH |
2187 | { } |
2188 | } | |
2189 | }, | |
5c0ebfbe | 2190 | [ALC882_FIXUP_PB_M5210] = { |
fd108215 TI |
2191 | .type = HDA_FIXUP_PINCTLS, |
2192 | .v.pins = (const struct hda_pintbl[]) { | |
2193 | { 0x19, PIN_VREF50 }, | |
357f915e KY |
2194 | {} |
2195 | } | |
2196 | }, | |
5c0ebfbe | 2197 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
1727a771 | 2198 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 2199 | .v.func = alc_fixup_sku_ignore, |
6981d184 | 2200 | }, |
5c0ebfbe | 2201 | [ALC882_FIXUP_ASUS_W90V] = { |
1727a771 TI |
2202 | .type = HDA_FIXUP_PINS, |
2203 | .v.pins = (const struct hda_pintbl[]) { | |
5cdf745e TI |
2204 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
2205 | { } | |
2206 | } | |
2207 | }, | |
8f239214 | 2208 | [ALC889_FIXUP_CD] = { |
1727a771 TI |
2209 | .type = HDA_FIXUP_PINS, |
2210 | .v.pins = (const struct hda_pintbl[]) { | |
8f239214 MB |
2211 | { 0x1c, 0x993301f0 }, /* CD */ |
2212 | { } | |
2213 | } | |
2214 | }, | |
b2c53e20 DH |
2215 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
2216 | .type = HDA_FIXUP_PINS, | |
2217 | .v.pins = (const struct hda_pintbl[]) { | |
2218 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ | |
2219 | { } | |
2220 | }, | |
2221 | .chained = true, | |
2222 | .chain_id = ALC889_FIXUP_CD, | |
2223 | }, | |
5c0ebfbe | 2224 | [ALC889_FIXUP_VAIO_TT] = { |
1727a771 TI |
2225 | .type = HDA_FIXUP_PINS, |
2226 | .v.pins = (const struct hda_pintbl[]) { | |
5c0ebfbe TI |
2227 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
2228 | { } | |
2229 | } | |
2230 | }, | |
0e7cc2e7 | 2231 | [ALC888_FIXUP_EEE1601] = { |
1727a771 | 2232 | .type = HDA_FIXUP_VERBS, |
0e7cc2e7 TI |
2233 | .v.verbs = (const struct hda_verb[]) { |
2234 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2235 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, | |
2236 | { } | |
2237 | } | |
177943a3 TI |
2238 | }, |
2239 | [ALC882_FIXUP_EAPD] = { | |
1727a771 | 2240 | .type = HDA_FIXUP_VERBS, |
177943a3 TI |
2241 | .v.verbs = (const struct hda_verb[]) { |
2242 | /* change to EAPD mode */ | |
2243 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2244 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
2245 | { } | |
2246 | } | |
2247 | }, | |
7a6069bf | 2248 | [ALC883_FIXUP_EAPD] = { |
1727a771 | 2249 | .type = HDA_FIXUP_VERBS, |
7a6069bf TI |
2250 | .v.verbs = (const struct hda_verb[]) { |
2251 | /* change to EAPD mode */ | |
2252 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2253 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2254 | { } | |
2255 | } | |
2256 | }, | |
8812c4f9 | 2257 | [ALC883_FIXUP_ACER_EAPD] = { |
1727a771 | 2258 | .type = HDA_FIXUP_VERBS, |
8812c4f9 TI |
2259 | .v.verbs = (const struct hda_verb[]) { |
2260 | /* eanable EAPD on Acer laptops */ | |
2261 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2262 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2263 | { } | |
2264 | } | |
2265 | }, | |
1a97b7f2 | 2266 | [ALC882_FIXUP_GPIO1] = { |
5579cd6f TI |
2267 | .type = HDA_FIXUP_FUNC, |
2268 | .v.func = alc_fixup_gpio1, | |
1a97b7f2 TI |
2269 | }, |
2270 | [ALC882_FIXUP_GPIO2] = { | |
5579cd6f TI |
2271 | .type = HDA_FIXUP_FUNC, |
2272 | .v.func = alc_fixup_gpio2, | |
1a97b7f2 | 2273 | }, |
eb844d51 | 2274 | [ALC882_FIXUP_GPIO3] = { |
5579cd6f TI |
2275 | .type = HDA_FIXUP_FUNC, |
2276 | .v.func = alc_fixup_gpio3, | |
eb844d51 | 2277 | }, |
68ef0561 | 2278 | [ALC882_FIXUP_ASUS_W2JC] = { |
5579cd6f TI |
2279 | .type = HDA_FIXUP_FUNC, |
2280 | .v.func = alc_fixup_gpio1, | |
68ef0561 TI |
2281 | .chained = true, |
2282 | .chain_id = ALC882_FIXUP_EAPD, | |
2283 | }, | |
2284 | [ALC889_FIXUP_COEF] = { | |
1727a771 | 2285 | .type = HDA_FIXUP_FUNC, |
68ef0561 TI |
2286 | .v.func = alc889_fixup_coef, |
2287 | }, | |
c3e837bb | 2288 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
1727a771 TI |
2289 | .type = HDA_FIXUP_PINS, |
2290 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2291 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2292 | { 0x17, 0x99130112 }, /* surround speaker */ | |
2293 | { } | |
038d4fef TI |
2294 | }, |
2295 | .chained = true, | |
2296 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb TI |
2297 | }, |
2298 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { | |
1727a771 TI |
2299 | .type = HDA_FIXUP_PINS, |
2300 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2301 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2302 | { 0x1b, 0x99130112 }, /* surround speaker */ | |
2303 | { } | |
2304 | }, | |
2305 | .chained = true, | |
2306 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
2307 | }, | |
2308 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { | |
2309 | /* additional init verbs for Acer Aspire 8930G */ | |
1727a771 | 2310 | .type = HDA_FIXUP_VERBS, |
c3e837bb TI |
2311 | .v.verbs = (const struct hda_verb[]) { |
2312 | /* Enable all DACs */ | |
2313 | /* DAC DISABLE/MUTE 1? */ | |
2314 | /* setting bits 1-5 disables DAC nids 0x02-0x06 | |
2315 | * apparently. Init=0x38 */ | |
2316 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, | |
2317 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2318 | /* DAC DISABLE/MUTE 2? */ | |
2319 | /* some bit here disables the other DACs. | |
2320 | * Init=0x4900 */ | |
2321 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, | |
2322 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2323 | /* DMIC fix | |
2324 | * This laptop has a stereo digital microphone. | |
2325 | * The mics are only 1cm apart which makes the stereo | |
2326 | * useless. However, either the mic or the ALC889 | |
2327 | * makes the signal become a difference/sum signal | |
2328 | * instead of standard stereo, which is annoying. | |
2329 | * So instead we flip this bit which makes the | |
2330 | * codec replicate the sum signal to both channels, | |
2331 | * turning it into a normal mono mic. | |
2332 | */ | |
2333 | /* DMIC_CONTROL? Init value = 0x0001 */ | |
2334 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2335 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, | |
2336 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2337 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2338 | { } | |
038d4fef TI |
2339 | }, |
2340 | .chained = true, | |
2341 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb | 2342 | }, |
5671087f | 2343 | [ALC885_FIXUP_MACPRO_GPIO] = { |
1727a771 | 2344 | .type = HDA_FIXUP_FUNC, |
5671087f TI |
2345 | .v.func = alc885_fixup_macpro_gpio, |
2346 | }, | |
02a237b2 | 2347 | [ALC889_FIXUP_DAC_ROUTE] = { |
1727a771 | 2348 | .type = HDA_FIXUP_FUNC, |
02a237b2 TI |
2349 | .v.func = alc889_fixup_dac_route, |
2350 | }, | |
1a97b7f2 | 2351 | [ALC889_FIXUP_MBP_VREF] = { |
1727a771 | 2352 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2353 | .v.func = alc889_fixup_mbp_vref, |
2354 | .chained = true, | |
2355 | .chain_id = ALC882_FIXUP_GPIO1, | |
2356 | }, | |
2357 | [ALC889_FIXUP_IMAC91_VREF] = { | |
1727a771 | 2358 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2359 | .v.func = alc889_fixup_imac91_vref, |
2360 | .chained = true, | |
2361 | .chain_id = ALC882_FIXUP_GPIO1, | |
2362 | }, | |
e7729a41 AV |
2363 | [ALC889_FIXUP_MBA11_VREF] = { |
2364 | .type = HDA_FIXUP_FUNC, | |
2365 | .v.func = alc889_fixup_mba11_vref, | |
2366 | .chained = true, | |
2367 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2368 | }, | |
0756f09c TI |
2369 | [ALC889_FIXUP_MBA21_VREF] = { |
2370 | .type = HDA_FIXUP_FUNC, | |
2371 | .v.func = alc889_fixup_mba21_vref, | |
2372 | .chained = true, | |
2373 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2374 | }, | |
c20f31ec TI |
2375 | [ALC889_FIXUP_MP11_VREF] = { |
2376 | .type = HDA_FIXUP_FUNC, | |
2377 | .v.func = alc889_fixup_mba11_vref, | |
2378 | .chained = true, | |
2379 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2380 | }, | |
9f660a1c MK |
2381 | [ALC889_FIXUP_MP41_VREF] = { |
2382 | .type = HDA_FIXUP_FUNC, | |
2383 | .v.func = alc889_fixup_mbp_vref, | |
2384 | .chained = true, | |
2385 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2386 | }, | |
6e72aa5f | 2387 | [ALC882_FIXUP_INV_DMIC] = { |
1727a771 | 2388 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2389 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2390 | }, |
e427c237 | 2391 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
1727a771 | 2392 | .type = HDA_FIXUP_FUNC, |
e427c237 TI |
2393 | .v.func = alc882_fixup_no_primary_hp, |
2394 | }, | |
1f0bbf03 TI |
2395 | [ALC887_FIXUP_ASUS_BASS] = { |
2396 | .type = HDA_FIXUP_PINS, | |
2397 | .v.pins = (const struct hda_pintbl[]) { | |
2398 | {0x16, 0x99130130}, /* bass speaker */ | |
2399 | {} | |
2400 | }, | |
eb9ca3ab TI |
2401 | .chained = true, |
2402 | .chain_id = ALC887_FIXUP_BASS_CHMAP, | |
2403 | }, | |
2404 | [ALC887_FIXUP_BASS_CHMAP] = { | |
2405 | .type = HDA_FIXUP_FUNC, | |
2406 | .v.func = alc_fixup_bass_chmap, | |
1f0bbf03 | 2407 | }, |
7beb3a6e TI |
2408 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
2409 | .type = HDA_FIXUP_FUNC, | |
2410 | .v.func = alc1220_fixup_gb_dual_codecs, | |
2411 | }, | |
0202f5cd P |
2412 | [ALC1220_FIXUP_CLEVO_P950] = { |
2413 | .type = HDA_FIXUP_FUNC, | |
2414 | .v.func = alc1220_fixup_clevo_p950, | |
2415 | }, | |
80690a27 | 2416 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
7f665b1c | 2417 | .type = HDA_FIXUP_FUNC, |
80690a27 | 2418 | .v.func = alc1220_fixup_clevo_pb51ed, |
7f665b1c | 2419 | }, |
80690a27 | 2420 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
7f665b1c JS |
2421 | .type = HDA_FIXUP_PINS, |
2422 | .v.pins = (const struct hda_pintbl[]) { | |
2423 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
2424 | {} | |
2425 | }, | |
2426 | .chained = true, | |
80690a27 | 2427 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
7f665b1c | 2428 | }, |
ca184355 JHP |
2429 | [ALC887_FIXUP_ASUS_AUDIO] = { |
2430 | .type = HDA_FIXUP_PINS, | |
2431 | .v.pins = (const struct hda_pintbl[]) { | |
2432 | { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ | |
2433 | { 0x19, 0x22219420 }, | |
2434 | {} | |
2435 | }, | |
2436 | }, | |
2437 | [ALC887_FIXUP_ASUS_HMIC] = { | |
2438 | .type = HDA_FIXUP_FUNC, | |
2439 | .v.func = alc887_fixup_asus_jack, | |
2440 | .chained = true, | |
2441 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, | |
2442 | }, | |
ff818c24 TI |
2443 | }; |
2444 | ||
1d045db9 | 2445 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
8812c4f9 TI |
2446 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
2447 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
b5d724b1 | 2448 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
8812c4f9 TI |
2449 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
2450 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
2451 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), | |
2452 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), | |
c3e837bb TI |
2453 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
2454 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2455 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | |
2456 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2457 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", | |
2458 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2459 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", | |
2460 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2461 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", | |
2462 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2463 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", | |
2464 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2465 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", | |
2466 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
5c0ebfbe | 2467 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
f5c53d89 TI |
2468 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
2469 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
02a237b2 | 2470 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
fe97da1f | 2471 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
ac9b1cdd | 2472 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
177943a3 | 2473 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
5c0ebfbe | 2474 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
68ef0561 | 2475 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
ca184355 | 2476 | SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), |
0e7cc2e7 | 2477 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
1f0bbf03 | 2478 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
85bcf96c | 2479 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
ac9b1cdd | 2480 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
e427c237 | 2481 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
3f3c3714 | 2482 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
12e31a78 | 2483 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
c44d9b11 | 2484 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
5671087f TI |
2485 | |
2486 | /* All Apple entries are in codec SSIDs */ | |
1a97b7f2 TI |
2487 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
2488 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), | |
2489 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
c20f31ec | 2490 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
5671087f TI |
2491 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
2492 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), | |
1a97b7f2 TI |
2493 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
2494 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2495 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
e7729a41 | 2496 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
0756f09c | 2497 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
1a97b7f2 TI |
2498 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
2499 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2500 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
1a97b7f2 TI |
2501 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
2502 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | |
2503 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | |
9f660a1c | 2504 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), |
05193639 | 2505 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
1a97b7f2 TI |
2506 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
2507 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | |
649ccd08 | 2508 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
5671087f | 2509 | |
7a6069bf | 2510 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
b2c53e20 | 2511 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
7beb3a6e | 2512 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
0d45e86d | 2513 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
d9e8fe0c | 2514 | SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
a0b03952 | 2515 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
a655e2b1 | 2516 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
1d3aa4a5 | 2517 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
7dafba37 | 2518 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
cc5049ae | 2519 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
d2c3b14e | 2520 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
63691587 | 2521 | SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
d2c3b14e | 2522 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
5c0ebfbe | 2523 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
0202f5cd | 2524 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 PH |
2525 | SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
2526 | SND_PCI_QUIRK(0x1558, 0x950A, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), | |
f3d737b6 | 2527 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
2f0d520a | 2528 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 PH |
2529 | SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), |
2530 | SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), | |
2531 | SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), | |
2532 | SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), | |
503d90b3 RS |
2533 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
2534 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), | |
b5acfe15 PH |
2535 | SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), |
2536 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
503d90b3 | 2537 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
b5acfe15 PH |
2538 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2539 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
503d90b3 | 2540 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
b5acfe15 | 2541 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
259eb824 PH |
2542 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2543 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
7a6069bf TI |
2544 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2545 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), | |
ac9b1cdd | 2546 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
68ef0561 | 2547 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
ff818c24 TI |
2548 | {} |
2549 | }; | |
2550 | ||
1727a771 | 2551 | static const struct hda_model_fixup alc882_fixup_models[] = { |
772c2917 TI |
2552 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
2553 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, | |
2554 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, | |
2555 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, | |
2556 | {.id = ALC889_FIXUP_CD, .name = "cd"}, | |
2557 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, | |
2558 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, | |
2559 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, | |
2560 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, | |
2561 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, | |
2562 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, | |
2563 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, | |
2564 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, | |
2565 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, | |
2566 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, | |
912093bc TI |
2567 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
2568 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, | |
2569 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, | |
772c2917 TI |
2570 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
2571 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, | |
2572 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, | |
2573 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, | |
2574 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, | |
2575 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, | |
2576 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, | |
2577 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, | |
6e72aa5f | 2578 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e427c237 | 2579 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
772c2917 | 2580 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
ba90d6a6 | 2581 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
772c2917 | 2582 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
912093bc TI |
2583 | {} |
2584 | }; | |
2585 | ||
f6a92248 | 2586 | /* |
1d045db9 | 2587 | * BIOS auto configuration |
f6a92248 | 2588 | */ |
1d045db9 TI |
2589 | /* almost identical with ALC880 parser... */ |
2590 | static int alc882_parse_auto_config(struct hda_codec *codec) | |
2591 | { | |
1d045db9 | 2592 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2593 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2594 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); | |
1d045db9 | 2595 | } |
b896b4eb | 2596 | |
1d045db9 TI |
2597 | /* |
2598 | */ | |
1d045db9 | 2599 | static int patch_alc882(struct hda_codec *codec) |
f6a92248 KY |
2600 | { |
2601 | struct alc_spec *spec; | |
1a97b7f2 | 2602 | int err; |
f6a92248 | 2603 | |
3de95173 TI |
2604 | err = alc_alloc_spec(codec, 0x0b); |
2605 | if (err < 0) | |
2606 | return err; | |
f6a92248 | 2607 | |
3de95173 | 2608 | spec = codec->spec; |
1f0f4b80 | 2609 | |
7639a06c | 2610 | switch (codec->core.vendor_id) { |
1d045db9 TI |
2611 | case 0x10ec0882: |
2612 | case 0x10ec0885: | |
acf08081 | 2613 | case 0x10ec0900: |
6d9ffcff | 2614 | case 0x10ec0b00: |
a535ad57 | 2615 | case 0x10ec1220: |
1d045db9 TI |
2616 | break; |
2617 | default: | |
2618 | /* ALC883 and variants */ | |
2619 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | |
2620 | break; | |
c793bec5 | 2621 | } |
977ddd6b | 2622 | |
c9af753f TI |
2623 | alc_pre_init(codec); |
2624 | ||
1727a771 | 2625 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
912093bc | 2626 | alc882_fixups); |
1727a771 | 2627 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ff818c24 | 2628 | |
1d045db9 TI |
2629 | alc_auto_parse_customize_define(codec); |
2630 | ||
7504b6cd TI |
2631 | if (has_cdefine_beep(codec)) |
2632 | spec->gen.beep_nid = 0x01; | |
2633 | ||
1a97b7f2 TI |
2634 | /* automatic parse from the BIOS config */ |
2635 | err = alc882_parse_auto_config(codec); | |
2636 | if (err < 0) | |
2637 | goto error; | |
f6a92248 | 2638 | |
fea80fae TI |
2639 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2640 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2641 | if (err < 0) | |
2642 | goto error; | |
2643 | } | |
f6a92248 | 2644 | |
1727a771 | 2645 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2646 | |
f6a92248 | 2647 | return 0; |
e16fb6d1 TI |
2648 | |
2649 | error: | |
2650 | alc_free(codec); | |
2651 | return err; | |
f6a92248 KY |
2652 | } |
2653 | ||
df694daa | 2654 | |
df694daa | 2655 | /* |
1d045db9 | 2656 | * ALC262 support |
df694daa | 2657 | */ |
1d045db9 | 2658 | static int alc262_parse_auto_config(struct hda_codec *codec) |
df694daa | 2659 | { |
1d045db9 | 2660 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2661 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2662 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); | |
df694daa KY |
2663 | } |
2664 | ||
df694daa | 2665 | /* |
1d045db9 | 2666 | * Pin config fixes |
df694daa | 2667 | */ |
cfc9b06f | 2668 | enum { |
ea4e7af1 | 2669 | ALC262_FIXUP_FSC_H270, |
7513e6da | 2670 | ALC262_FIXUP_FSC_S7110, |
ea4e7af1 TI |
2671 | ALC262_FIXUP_HP_Z200, |
2672 | ALC262_FIXUP_TYAN, | |
c470150c | 2673 | ALC262_FIXUP_LENOVO_3000, |
b42590b8 TI |
2674 | ALC262_FIXUP_BENQ, |
2675 | ALC262_FIXUP_BENQ_T31, | |
6e72aa5f | 2676 | ALC262_FIXUP_INV_DMIC, |
b5c6611f | 2677 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
cfc9b06f TI |
2678 | }; |
2679 | ||
1727a771 | 2680 | static const struct hda_fixup alc262_fixups[] = { |
ea4e7af1 | 2681 | [ALC262_FIXUP_FSC_H270] = { |
1727a771 TI |
2682 | .type = HDA_FIXUP_PINS, |
2683 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2684 | { 0x14, 0x99130110 }, /* speaker */ |
2685 | { 0x15, 0x0221142f }, /* front HP */ | |
2686 | { 0x1b, 0x0121141f }, /* rear HP */ | |
2687 | { } | |
2688 | } | |
2689 | }, | |
7513e6da TI |
2690 | [ALC262_FIXUP_FSC_S7110] = { |
2691 | .type = HDA_FIXUP_PINS, | |
2692 | .v.pins = (const struct hda_pintbl[]) { | |
2693 | { 0x15, 0x90170110 }, /* speaker */ | |
2694 | { } | |
2695 | }, | |
2696 | .chained = true, | |
2697 | .chain_id = ALC262_FIXUP_BENQ, | |
2698 | }, | |
ea4e7af1 | 2699 | [ALC262_FIXUP_HP_Z200] = { |
1727a771 TI |
2700 | .type = HDA_FIXUP_PINS, |
2701 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 | 2702 | { 0x16, 0x99130120 }, /* internal speaker */ |
73413b12 TI |
2703 | { } |
2704 | } | |
cfc9b06f | 2705 | }, |
ea4e7af1 | 2706 | [ALC262_FIXUP_TYAN] = { |
1727a771 TI |
2707 | .type = HDA_FIXUP_PINS, |
2708 | .v.pins = (const struct hda_pintbl[]) { | |
ea4e7af1 TI |
2709 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
2710 | { } | |
2711 | } | |
2712 | }, | |
c470150c | 2713 | [ALC262_FIXUP_LENOVO_3000] = { |
fd108215 TI |
2714 | .type = HDA_FIXUP_PINCTLS, |
2715 | .v.pins = (const struct hda_pintbl[]) { | |
2716 | { 0x19, PIN_VREF50 }, | |
b42590b8 TI |
2717 | {} |
2718 | }, | |
2719 | .chained = true, | |
2720 | .chain_id = ALC262_FIXUP_BENQ, | |
2721 | }, | |
2722 | [ALC262_FIXUP_BENQ] = { | |
1727a771 | 2723 | .type = HDA_FIXUP_VERBS, |
b42590b8 | 2724 | .v.verbs = (const struct hda_verb[]) { |
c470150c TI |
2725 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
2726 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2727 | {} | |
2728 | } | |
2729 | }, | |
b42590b8 | 2730 | [ALC262_FIXUP_BENQ_T31] = { |
1727a771 | 2731 | .type = HDA_FIXUP_VERBS, |
b42590b8 TI |
2732 | .v.verbs = (const struct hda_verb[]) { |
2733 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2734 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2735 | {} | |
2736 | } | |
2737 | }, | |
6e72aa5f | 2738 | [ALC262_FIXUP_INV_DMIC] = { |
1727a771 | 2739 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2740 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2741 | }, |
b5c6611f ML |
2742 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
2743 | .type = HDA_FIXUP_FUNC, | |
2744 | .v.func = alc_fixup_no_depop_delay, | |
2745 | }, | |
cfc9b06f TI |
2746 | }; |
2747 | ||
1d045db9 | 2748 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
ea4e7af1 | 2749 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
7513e6da | 2750 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
3dcd3be3 | 2751 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
ea4e7af1 | 2752 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
275ec0cb | 2753 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
ea4e7af1 | 2754 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
c470150c | 2755 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
b42590b8 TI |
2756 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
2757 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), | |
b5c6611f | 2758 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
cfc9b06f TI |
2759 | {} |
2760 | }; | |
df694daa | 2761 | |
1727a771 | 2762 | static const struct hda_model_fixup alc262_fixup_models[] = { |
6e72aa5f | 2763 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e43c44d6 TI |
2764 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
2765 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, | |
2766 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, | |
2767 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, | |
2768 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, | |
2769 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, | |
2770 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, | |
2771 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, | |
6e72aa5f TI |
2772 | {} |
2773 | }; | |
1d045db9 | 2774 | |
1d045db9 TI |
2775 | /* |
2776 | */ | |
1d045db9 | 2777 | static int patch_alc262(struct hda_codec *codec) |
df694daa KY |
2778 | { |
2779 | struct alc_spec *spec; | |
df694daa KY |
2780 | int err; |
2781 | ||
3de95173 TI |
2782 | err = alc_alloc_spec(codec, 0x0b); |
2783 | if (err < 0) | |
2784 | return err; | |
df694daa | 2785 | |
3de95173 | 2786 | spec = codec->spec; |
08c189f2 | 2787 | spec->gen.shared_mic_vref_pin = 0x18; |
1d045db9 | 2788 | |
225068ab TI |
2789 | spec->shutup = alc_eapd_shutup; |
2790 | ||
1d045db9 TI |
2791 | #if 0 |
2792 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is | |
2793 | * under-run | |
2794 | */ | |
98b24883 | 2795 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
1d045db9 | 2796 | #endif |
1d045db9 TI |
2797 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
2798 | ||
c9af753f TI |
2799 | alc_pre_init(codec); |
2800 | ||
1727a771 | 2801 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
6e72aa5f | 2802 | alc262_fixups); |
1727a771 | 2803 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
9c7f852e | 2804 | |
af741c15 TI |
2805 | alc_auto_parse_customize_define(codec); |
2806 | ||
7504b6cd TI |
2807 | if (has_cdefine_beep(codec)) |
2808 | spec->gen.beep_nid = 0x01; | |
2809 | ||
42399f7a TI |
2810 | /* automatic parse from the BIOS config */ |
2811 | err = alc262_parse_auto_config(codec); | |
2812 | if (err < 0) | |
2813 | goto error; | |
df694daa | 2814 | |
fea80fae TI |
2815 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2816 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2817 | if (err < 0) | |
2818 | goto error; | |
2819 | } | |
2134ea4f | 2820 | |
1727a771 | 2821 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2822 | |
1da177e4 | 2823 | return 0; |
e16fb6d1 TI |
2824 | |
2825 | error: | |
2826 | alc_free(codec); | |
2827 | return err; | |
1da177e4 LT |
2828 | } |
2829 | ||
f32610ed | 2830 | /* |
1d045db9 | 2831 | * ALC268 |
f32610ed | 2832 | */ |
1d045db9 | 2833 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
a717777d TI |
2834 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
2835 | struct snd_ctl_elem_value *ucontrol) | |
2836 | { | |
2837 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | |
2838 | unsigned long pval; | |
2839 | int err; | |
2840 | ||
2841 | mutex_lock(&codec->control_mutex); | |
2842 | pval = kcontrol->private_value; | |
2843 | kcontrol->private_value = (pval & ~0xff) | 0x0f; | |
2844 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2845 | if (err >= 0) { | |
2846 | kcontrol->private_value = (pval & ~0xff) | 0x10; | |
2847 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2848 | } | |
2849 | kcontrol->private_value = pval; | |
2850 | mutex_unlock(&codec->control_mutex); | |
2851 | return err; | |
2852 | } | |
f32610ed | 2853 | |
1d045db9 TI |
2854 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
2855 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), | |
a717777d TI |
2856 | { |
2857 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | |
2858 | .name = "Beep Playback Switch", | |
2859 | .subdevice = HDA_SUBDEV_AMP_FLAG, | |
2860 | .info = snd_hda_mixer_amp_switch_info, | |
2861 | .get = snd_hda_mixer_amp_switch_get, | |
2862 | .put = alc268_beep_switch_put, | |
2863 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) | |
2864 | }, | |
f32610ed JS |
2865 | }; |
2866 | ||
1d045db9 TI |
2867 | /* set PCBEEP vol = 0, mute connections */ |
2868 | static const struct hda_verb alc268_beep_init_verbs[] = { | |
2869 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | |
2870 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2871 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2872 | { } | |
f32610ed JS |
2873 | }; |
2874 | ||
6e72aa5f TI |
2875 | enum { |
2876 | ALC268_FIXUP_INV_DMIC, | |
cb766404 | 2877 | ALC268_FIXUP_HP_EAPD, |
24eff328 | 2878 | ALC268_FIXUP_SPDIF, |
6e72aa5f TI |
2879 | }; |
2880 | ||
1727a771 | 2881 | static const struct hda_fixup alc268_fixups[] = { |
6e72aa5f | 2882 | [ALC268_FIXUP_INV_DMIC] = { |
1727a771 | 2883 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2884 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2885 | }, |
cb766404 | 2886 | [ALC268_FIXUP_HP_EAPD] = { |
1727a771 | 2887 | .type = HDA_FIXUP_VERBS, |
cb766404 TI |
2888 | .v.verbs = (const struct hda_verb[]) { |
2889 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
2890 | {} | |
2891 | } | |
2892 | }, | |
24eff328 TI |
2893 | [ALC268_FIXUP_SPDIF] = { |
2894 | .type = HDA_FIXUP_PINS, | |
2895 | .v.pins = (const struct hda_pintbl[]) { | |
2896 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ | |
2897 | {} | |
2898 | } | |
2899 | }, | |
6e72aa5f TI |
2900 | }; |
2901 | ||
1727a771 | 2902 | static const struct hda_model_fixup alc268_fixup_models[] = { |
6e72aa5f | 2903 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
cb766404 | 2904 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
03bf11c9 | 2905 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
cb766404 TI |
2906 | {} |
2907 | }; | |
2908 | ||
2909 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { | |
24eff328 | 2910 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
fcd8f3b1 | 2911 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), |
cb766404 TI |
2912 | /* below is codec SSID since multiple Toshiba laptops have the |
2913 | * same PCI SSID 1179:ff00 | |
2914 | */ | |
2915 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), | |
6e72aa5f TI |
2916 | {} |
2917 | }; | |
2918 | ||
f32610ed JS |
2919 | /* |
2920 | * BIOS auto configuration | |
2921 | */ | |
1d045db9 | 2922 | static int alc268_parse_auto_config(struct hda_codec *codec) |
f32610ed | 2923 | { |
3e6179b8 | 2924 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
7504b6cd | 2925 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
f32610ed JS |
2926 | } |
2927 | ||
1d045db9 TI |
2928 | /* |
2929 | */ | |
1d045db9 | 2930 | static int patch_alc268(struct hda_codec *codec) |
f32610ed JS |
2931 | { |
2932 | struct alc_spec *spec; | |
a5cb463a | 2933 | int i, err; |
f32610ed | 2934 | |
1d045db9 | 2935 | /* ALC268 has no aa-loopback mixer */ |
3de95173 TI |
2936 | err = alc_alloc_spec(codec, 0); |
2937 | if (err < 0) | |
2938 | return err; | |
2939 | ||
2940 | spec = codec->spec; | |
2722b535 TI |
2941 | if (has_cdefine_beep(codec)) |
2942 | spec->gen.beep_nid = 0x01; | |
1f0f4b80 | 2943 | |
225068ab TI |
2944 | spec->shutup = alc_eapd_shutup; |
2945 | ||
c9af753f TI |
2946 | alc_pre_init(codec); |
2947 | ||
1727a771 TI |
2948 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
2949 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
6e72aa5f | 2950 | |
6ebb8053 TI |
2951 | /* automatic parse from the BIOS config */ |
2952 | err = alc268_parse_auto_config(codec); | |
e16fb6d1 TI |
2953 | if (err < 0) |
2954 | goto error; | |
f32610ed | 2955 | |
7504b6cd TI |
2956 | if (err > 0 && !spec->gen.no_analog && |
2957 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { | |
a5cb463a TI |
2958 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
2959 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, | |
2960 | &alc268_beep_mixer[i])) { | |
2961 | err = -ENOMEM; | |
2962 | goto error; | |
2963 | } | |
2964 | } | |
7504b6cd | 2965 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
1d045db9 TI |
2966 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
2967 | /* override the amp caps for beep generator */ | |
2968 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, | |
2969 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | | |
2970 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
2971 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
2972 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
2f893286 KY |
2973 | } |
2974 | ||
1727a771 | 2975 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
6e72aa5f | 2976 | |
f32610ed | 2977 | return 0; |
e16fb6d1 TI |
2978 | |
2979 | error: | |
2980 | alc_free(codec); | |
2981 | return err; | |
f32610ed JS |
2982 | } |
2983 | ||
bc9f98a9 | 2984 | /* |
1d045db9 | 2985 | * ALC269 |
bc9f98a9 | 2986 | */ |
08c189f2 | 2987 | |
1d045db9 | 2988 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
1d045db9 | 2989 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 KY |
2990 | }; |
2991 | ||
1d045db9 | 2992 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
1d045db9 | 2993 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 | 2994 | }; |
291702f0 | 2995 | |
1d045db9 TI |
2996 | /* different alc269-variants */ |
2997 | enum { | |
2998 | ALC269_TYPE_ALC269VA, | |
2999 | ALC269_TYPE_ALC269VB, | |
3000 | ALC269_TYPE_ALC269VC, | |
adcc70b2 | 3001 | ALC269_TYPE_ALC269VD, |
065380f0 KY |
3002 | ALC269_TYPE_ALC280, |
3003 | ALC269_TYPE_ALC282, | |
2af02be7 | 3004 | ALC269_TYPE_ALC283, |
065380f0 | 3005 | ALC269_TYPE_ALC284, |
4731d5de | 3006 | ALC269_TYPE_ALC293, |
7fc7d047 | 3007 | ALC269_TYPE_ALC286, |
506b62c3 | 3008 | ALC269_TYPE_ALC298, |
1d04c9de | 3009 | ALC269_TYPE_ALC255, |
4344aec8 | 3010 | ALC269_TYPE_ALC256, |
f429e7e4 | 3011 | ALC269_TYPE_ALC257, |
0a6f0600 | 3012 | ALC269_TYPE_ALC215, |
4231430d | 3013 | ALC269_TYPE_ALC225, |
dcd4f0db | 3014 | ALC269_TYPE_ALC294, |
1078bef0 | 3015 | ALC269_TYPE_ALC300, |
f0778871 | 3016 | ALC269_TYPE_ALC623, |
6fbae35a | 3017 | ALC269_TYPE_ALC700, |
bc9f98a9 KY |
3018 | }; |
3019 | ||
3020 | /* | |
1d045db9 | 3021 | * BIOS auto configuration |
bc9f98a9 | 3022 | */ |
1d045db9 TI |
3023 | static int alc269_parse_auto_config(struct hda_codec *codec) |
3024 | { | |
1d045db9 | 3025 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
3026 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
3027 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
3028 | struct alc_spec *spec = codec->spec; | |
adcc70b2 KY |
3029 | const hda_nid_t *ssids; |
3030 | ||
3031 | switch (spec->codec_variant) { | |
3032 | case ALC269_TYPE_ALC269VA: | |
3033 | case ALC269_TYPE_ALC269VC: | |
065380f0 KY |
3034 | case ALC269_TYPE_ALC280: |
3035 | case ALC269_TYPE_ALC284: | |
4731d5de | 3036 | case ALC269_TYPE_ALC293: |
adcc70b2 KY |
3037 | ssids = alc269va_ssids; |
3038 | break; | |
3039 | case ALC269_TYPE_ALC269VB: | |
3040 | case ALC269_TYPE_ALC269VD: | |
065380f0 | 3041 | case ALC269_TYPE_ALC282: |
2af02be7 | 3042 | case ALC269_TYPE_ALC283: |
7fc7d047 | 3043 | case ALC269_TYPE_ALC286: |
506b62c3 | 3044 | case ALC269_TYPE_ALC298: |
1d04c9de | 3045 | case ALC269_TYPE_ALC255: |
4344aec8 | 3046 | case ALC269_TYPE_ALC256: |
f429e7e4 | 3047 | case ALC269_TYPE_ALC257: |
0a6f0600 | 3048 | case ALC269_TYPE_ALC215: |
4231430d | 3049 | case ALC269_TYPE_ALC225: |
dcd4f0db | 3050 | case ALC269_TYPE_ALC294: |
1078bef0 | 3051 | case ALC269_TYPE_ALC300: |
f0778871 | 3052 | case ALC269_TYPE_ALC623: |
6fbae35a | 3053 | case ALC269_TYPE_ALC700: |
adcc70b2 KY |
3054 | ssids = alc269_ssids; |
3055 | break; | |
3056 | default: | |
3057 | ssids = alc269_ssids; | |
3058 | break; | |
3059 | } | |
bc9f98a9 | 3060 | |
3e6179b8 | 3061 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
1d045db9 | 3062 | } |
bc9f98a9 | 3063 | |
476c02e0 HW |
3064 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
3065 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, | |
3066 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, | |
3067 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, | |
3068 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, | |
3069 | {} | |
3070 | }; | |
3071 | ||
3072 | static void alc_headset_btn_callback(struct hda_codec *codec, | |
3073 | struct hda_jack_callback *jack) | |
3074 | { | |
3075 | int report = 0; | |
3076 | ||
3077 | if (jack->unsol_res & (7 << 13)) | |
3078 | report |= SND_JACK_BTN_0; | |
3079 | ||
3080 | if (jack->unsol_res & (1 << 16 | 3 << 8)) | |
3081 | report |= SND_JACK_BTN_1; | |
3082 | ||
3083 | /* Volume up key */ | |
3084 | if (jack->unsol_res & (7 << 23)) | |
3085 | report |= SND_JACK_BTN_2; | |
3086 | ||
3087 | /* Volume down key */ | |
3088 | if (jack->unsol_res & (7 << 10)) | |
3089 | report |= SND_JACK_BTN_3; | |
3090 | ||
3091 | jack->jack->button_state = report; | |
3092 | } | |
3093 | ||
3094 | static void alc_disable_headset_jack_key(struct hda_codec *codec) | |
3095 | { | |
3096 | struct alc_spec *spec = codec->spec; | |
3097 | ||
3098 | if (!spec->has_hs_key) | |
3099 | return; | |
3100 | ||
3101 | switch (codec->core.vendor_id) { | |
3102 | case 0x10ec0215: | |
3103 | case 0x10ec0225: | |
3104 | case 0x10ec0285: | |
3105 | case 0x10ec0295: | |
3106 | case 0x10ec0289: | |
3107 | case 0x10ec0299: | |
3108 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3109 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3110 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); | |
3111 | break; | |
3112 | case 0x10ec0236: | |
3113 | case 0x10ec0256: | |
3114 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3115 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3116 | break; | |
3117 | } | |
3118 | } | |
3119 | ||
3120 | static void alc_enable_headset_jack_key(struct hda_codec *codec) | |
3121 | { | |
3122 | struct alc_spec *spec = codec->spec; | |
3123 | ||
3124 | if (!spec->has_hs_key) | |
3125 | return; | |
3126 | ||
3127 | switch (codec->core.vendor_id) { | |
3128 | case 0x10ec0215: | |
3129 | case 0x10ec0225: | |
3130 | case 0x10ec0285: | |
3131 | case 0x10ec0295: | |
3132 | case 0x10ec0289: | |
3133 | case 0x10ec0299: | |
3134 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3135 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3136 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); | |
3137 | break; | |
3138 | case 0x10ec0236: | |
3139 | case 0x10ec0256: | |
3140 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3141 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3142 | break; | |
3143 | } | |
3144 | } | |
3145 | ||
3146 | static void alc_fixup_headset_jack(struct hda_codec *codec, | |
3147 | const struct hda_fixup *fix, int action) | |
3148 | { | |
3149 | struct alc_spec *spec = codec->spec; | |
3150 | ||
3151 | switch (action) { | |
3152 | case HDA_FIXUP_ACT_PRE_PROBE: | |
3153 | spec->has_hs_key = 1; | |
3154 | snd_hda_jack_detect_enable_callback(codec, 0x55, | |
3155 | alc_headset_btn_callback); | |
3156 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, | |
3157 | SND_JACK_HEADSET, alc_headset_btn_keymap); | |
3158 | break; | |
3159 | case HDA_FIXUP_ACT_INIT: | |
3160 | alc_enable_headset_jack_key(codec); | |
3161 | break; | |
3162 | } | |
3163 | } | |
3164 | ||
1387e2d1 | 3165 | static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) |
1d045db9 | 3166 | { |
98b24883 | 3167 | alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); |
1d045db9 | 3168 | } |
291702f0 | 3169 | |
1d045db9 TI |
3170 | static void alc269_shutup(struct hda_codec *codec) |
3171 | { | |
adcc70b2 KY |
3172 | struct alc_spec *spec = codec->spec; |
3173 | ||
1387e2d1 KY |
3174 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3175 | alc269vb_toggle_power_output(codec, 0); | |
3176 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
3177 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | |
1d045db9 TI |
3178 | msleep(150); |
3179 | } | |
c0ca5ece | 3180 | alc_shutup_pins(codec); |
1d045db9 | 3181 | } |
291702f0 | 3182 | |
6b0f95c4 | 3183 | static const struct coef_fw alc282_coefs[] = { |
54db6c39 | 3184 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
32fa7e49 | 3185 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3186 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3187 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3188 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3189 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3190 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3191 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ | |
3192 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3193 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3194 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ | |
3195 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ | |
3196 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ | |
3197 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ | |
3198 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3199 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3200 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3201 | WRITE_COEF(0x63, 0x2902), /* PLL */ | |
3202 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ | |
3203 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ | |
3204 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ | |
3205 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ | |
3206 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ | |
3207 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ | |
3208 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ | |
3209 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ | |
3210 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ | |
3211 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ | |
3212 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ | |
3213 | {} | |
3214 | }; | |
3215 | ||
cb149cb3 KY |
3216 | static void alc282_restore_default_value(struct hda_codec *codec) |
3217 | { | |
54db6c39 | 3218 | alc_process_coef_fw(codec, alc282_coefs); |
cb149cb3 KY |
3219 | } |
3220 | ||
7b5c7a02 KY |
3221 | static void alc282_init(struct hda_codec *codec) |
3222 | { | |
3223 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3224 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3225 | bool hp_pin_sense; |
3226 | int coef78; | |
3227 | ||
cb149cb3 KY |
3228 | alc282_restore_default_value(codec); |
3229 | ||
7b5c7a02 KY |
3230 | if (!hp_pin) |
3231 | return; | |
3232 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3233 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3234 | ||
3235 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ | |
3236 | /* Headphone capless set to high power mode */ | |
3237 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3238 | ||
3239 | if (hp_pin_sense) | |
3240 | msleep(2); | |
3241 | ||
3242 | snd_hda_codec_write(codec, hp_pin, 0, | |
3243 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3244 | ||
3245 | if (hp_pin_sense) | |
3246 | msleep(85); | |
3247 | ||
3248 | snd_hda_codec_write(codec, hp_pin, 0, | |
3249 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3250 | ||
3251 | if (hp_pin_sense) | |
3252 | msleep(100); | |
3253 | ||
3254 | /* Headphone capless set to normal mode */ | |
3255 | alc_write_coef_idx(codec, 0x78, coef78); | |
3256 | } | |
3257 | ||
3258 | static void alc282_shutup(struct hda_codec *codec) | |
3259 | { | |
3260 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3261 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3262 | bool hp_pin_sense; |
3263 | int coef78; | |
3264 | ||
3265 | if (!hp_pin) { | |
3266 | alc269_shutup(codec); | |
3267 | return; | |
3268 | } | |
3269 | ||
3270 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3271 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3272 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3273 | ||
3274 | if (hp_pin_sense) | |
3275 | msleep(2); | |
3276 | ||
3277 | snd_hda_codec_write(codec, hp_pin, 0, | |
3278 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3279 | ||
3280 | if (hp_pin_sense) | |
3281 | msleep(85); | |
3282 | ||
c0ca5ece TI |
3283 | if (!spec->no_shutup_pins) |
3284 | snd_hda_codec_write(codec, hp_pin, 0, | |
3285 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
7b5c7a02 KY |
3286 | |
3287 | if (hp_pin_sense) | |
3288 | msleep(100); | |
3289 | ||
3290 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3291 | alc_shutup_pins(codec); |
7b5c7a02 KY |
3292 | alc_write_coef_idx(codec, 0x78, coef78); |
3293 | } | |
3294 | ||
6b0f95c4 | 3295 | static const struct coef_fw alc283_coefs[] = { |
54db6c39 | 3296 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
56779864 | 3297 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3298 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3299 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3300 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3301 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3302 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3303 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ | |
3304 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3305 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3306 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ | |
3307 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ | |
3308 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ | |
3309 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ | |
3310 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3311 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3312 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3313 | WRITE_COEF(0x2e, 0x2902), /* PLL */ | |
3314 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ | |
3315 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ | |
3316 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ | |
3317 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ | |
3318 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ | |
3319 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ | |
3320 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ | |
3321 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ | |
3322 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ | |
3323 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ | |
3324 | WRITE_COEF(0x49, 0x0), /* test mode */ | |
3325 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ | |
3326 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ | |
3327 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ | |
56779864 | 3328 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
54db6c39 TI |
3329 | {} |
3330 | }; | |
3331 | ||
6bd55b04 KY |
3332 | static void alc283_restore_default_value(struct hda_codec *codec) |
3333 | { | |
54db6c39 | 3334 | alc_process_coef_fw(codec, alc283_coefs); |
6bd55b04 KY |
3335 | } |
3336 | ||
2af02be7 KY |
3337 | static void alc283_init(struct hda_codec *codec) |
3338 | { | |
3339 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3340 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3341 | bool hp_pin_sense; |
2af02be7 | 3342 | |
6bd55b04 KY |
3343 | alc283_restore_default_value(codec); |
3344 | ||
2af02be7 KY |
3345 | if (!hp_pin) |
3346 | return; | |
a59d7199 KY |
3347 | |
3348 | msleep(30); | |
2af02be7 KY |
3349 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
3350 | ||
3351 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ | |
3352 | /* Headphone capless set to high power mode */ | |
3353 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3354 | ||
3355 | snd_hda_codec_write(codec, hp_pin, 0, | |
3356 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3357 | ||
3358 | if (hp_pin_sense) | |
3359 | msleep(85); | |
3360 | ||
3361 | snd_hda_codec_write(codec, hp_pin, 0, | |
3362 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3363 | ||
3364 | if (hp_pin_sense) | |
3365 | msleep(85); | |
3366 | /* Index 0x46 Combo jack auto switch control 2 */ | |
3367 | /* 3k pull low control for Headset jack. */ | |
98b24883 | 3368 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
2af02be7 KY |
3369 | /* Headphone capless set to normal mode */ |
3370 | alc_write_coef_idx(codec, 0x43, 0x9614); | |
3371 | } | |
3372 | ||
3373 | static void alc283_shutup(struct hda_codec *codec) | |
3374 | { | |
3375 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3376 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3377 | bool hp_pin_sense; |
2af02be7 KY |
3378 | |
3379 | if (!hp_pin) { | |
3380 | alc269_shutup(codec); | |
3381 | return; | |
3382 | } | |
3383 | ||
3384 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3385 | ||
3386 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3387 | ||
b450b17c HP |
3388 | /*depop hp during suspend*/ |
3389 | alc_write_coef_idx(codec, 0x06, 0x2100); | |
3390 | ||
2af02be7 KY |
3391 | snd_hda_codec_write(codec, hp_pin, 0, |
3392 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3393 | ||
3394 | if (hp_pin_sense) | |
88011c09 | 3395 | msleep(100); |
2af02be7 | 3396 | |
c0ca5ece TI |
3397 | if (!spec->no_shutup_pins) |
3398 | snd_hda_codec_write(codec, hp_pin, 0, | |
3399 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
2af02be7 | 3400 | |
98b24883 | 3401 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
2af02be7 KY |
3402 | |
3403 | if (hp_pin_sense) | |
88011c09 | 3404 | msleep(100); |
0435b3ff | 3405 | alc_auto_setup_eapd(codec, false); |
c0ca5ece | 3406 | alc_shutup_pins(codec); |
2af02be7 KY |
3407 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3408 | } | |
3409 | ||
4a219ef8 KY |
3410 | static void alc256_init(struct hda_codec *codec) |
3411 | { | |
3412 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3413 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3414 | bool hp_pin_sense; |
3415 | ||
3416 | if (!hp_pin) | |
6447c962 | 3417 | hp_pin = 0x21; |
4a219ef8 KY |
3418 | |
3419 | msleep(30); | |
3420 | ||
3421 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3422 | ||
3423 | if (hp_pin_sense) | |
3424 | msleep(2); | |
3425 | ||
3426 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
6447c962 KY |
3427 | if (spec->ultra_low_power) { |
3428 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); | |
3429 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); | |
3430 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); | |
3431 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); | |
3432 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3433 | msleep(30); | |
3434 | } | |
4a219ef8 KY |
3435 | |
3436 | snd_hda_codec_write(codec, hp_pin, 0, | |
3437 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3438 | ||
6447c962 | 3439 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3440 | msleep(85); |
3441 | ||
3442 | snd_hda_codec_write(codec, hp_pin, 0, | |
3443 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3444 | ||
6447c962 | 3445 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3446 | msleep(100); |
3447 | ||
3448 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); | |
3449 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
88d42b2b KY |
3450 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
3451 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); | |
c4473744 TH |
3452 | /* |
3453 | * Expose headphone mic (or possibly Line In on some machines) instead | |
3454 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See | |
3455 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of | |
3456 | * this register. | |
3457 | */ | |
3458 | alc_write_coef_idx(codec, 0x36, 0x5757); | |
4a219ef8 KY |
3459 | } |
3460 | ||
3461 | static void alc256_shutup(struct hda_codec *codec) | |
3462 | { | |
3463 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3464 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3465 | bool hp_pin_sense; |
3466 | ||
6447c962 KY |
3467 | if (!hp_pin) |
3468 | hp_pin = 0x21; | |
4a219ef8 KY |
3469 | |
3470 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3471 | ||
3472 | if (hp_pin_sense) | |
3473 | msleep(2); | |
3474 | ||
3475 | snd_hda_codec_write(codec, hp_pin, 0, | |
3476 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3477 | ||
6447c962 | 3478 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3479 | msleep(85); |
3480 | ||
1c9609e3 TI |
3481 | /* 3k pull low control for Headset jack. */ |
3482 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ | |
3f742490 HW |
3483 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
3484 | * when booting with headset plugged. So skip setting it for the codec alc257 | |
3485 | */ | |
3486 | if (codec->core.vendor_id != 0x10ec0257) | |
3487 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); | |
1c9609e3 | 3488 | |
c0ca5ece TI |
3489 | if (!spec->no_shutup_pins) |
3490 | snd_hda_codec_write(codec, hp_pin, 0, | |
3491 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4a219ef8 | 3492 | |
6447c962 | 3493 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3494 | msleep(100); |
3495 | ||
3496 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3497 | alc_shutup_pins(codec); |
6447c962 KY |
3498 | if (spec->ultra_low_power) { |
3499 | msleep(50); | |
3500 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); | |
3501 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); | |
3502 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); | |
3503 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); | |
3504 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3505 | msleep(30); | |
3506 | } | |
4a219ef8 KY |
3507 | } |
3508 | ||
da911b1f KY |
3509 | static void alc225_init(struct hda_codec *codec) |
3510 | { | |
3511 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3512 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3513 | bool hp1_pin_sense, hp2_pin_sense; |
3514 | ||
3515 | if (!hp_pin) | |
d3ba58bb | 3516 | hp_pin = 0x21; |
da911b1f KY |
3517 | msleep(30); |
3518 | ||
3519 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3520 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3521 | ||
3522 | if (hp1_pin_sense || hp2_pin_sense) | |
3523 | msleep(2); | |
3524 | ||
3525 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
d3ba58bb KY |
3526 | if (spec->ultra_low_power) { |
3527 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); | |
3528 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3529 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); | |
3530 | msleep(30); | |
3531 | } | |
da911b1f | 3532 | |
d3ba58bb | 3533 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3534 | snd_hda_codec_write(codec, hp_pin, 0, |
3535 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3536 | if (hp2_pin_sense) | |
3537 | snd_hda_codec_write(codec, 0x16, 0, | |
3538 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3539 | ||
d3ba58bb | 3540 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3541 | msleep(85); |
3542 | ||
d3ba58bb | 3543 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3544 | snd_hda_codec_write(codec, hp_pin, 0, |
3545 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3546 | if (hp2_pin_sense) | |
3547 | snd_hda_codec_write(codec, 0x16, 0, | |
3548 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3549 | ||
d3ba58bb | 3550 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3551 | msleep(100); |
3552 | ||
3553 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3554 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
3555 | } | |
3556 | ||
3557 | static void alc225_shutup(struct hda_codec *codec) | |
3558 | { | |
3559 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3560 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3561 | bool hp1_pin_sense, hp2_pin_sense; |
3562 | ||
d3ba58bb KY |
3563 | if (!hp_pin) |
3564 | hp_pin = 0x21; | |
476c02e0 HW |
3565 | |
3566 | alc_disable_headset_jack_key(codec); | |
da911b1f KY |
3567 | /* 3k pull low control for Headset jack. */ |
3568 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); | |
3569 | ||
3570 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3571 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3572 | ||
3573 | if (hp1_pin_sense || hp2_pin_sense) | |
3574 | msleep(2); | |
3575 | ||
d3ba58bb | 3576 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3577 | snd_hda_codec_write(codec, hp_pin, 0, |
3578 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3579 | if (hp2_pin_sense) | |
3580 | snd_hda_codec_write(codec, 0x16, 0, | |
3581 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3582 | ||
d3ba58bb | 3583 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3584 | msleep(85); |
3585 | ||
d3ba58bb | 3586 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3587 | snd_hda_codec_write(codec, hp_pin, 0, |
3588 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3589 | if (hp2_pin_sense) | |
3590 | snd_hda_codec_write(codec, 0x16, 0, | |
3591 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3592 | ||
d3ba58bb | 3593 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3594 | msleep(100); |
3595 | ||
3596 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3597 | alc_shutup_pins(codec); |
d3ba58bb KY |
3598 | if (spec->ultra_low_power) { |
3599 | msleep(50); | |
3600 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); | |
3601 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3602 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); | |
3603 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); | |
3604 | msleep(30); | |
3605 | } | |
476c02e0 HW |
3606 | |
3607 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3608 | alc_enable_headset_jack_key(codec); | |
da911b1f KY |
3609 | } |
3610 | ||
c2d6af53 KY |
3611 | static void alc_default_init(struct hda_codec *codec) |
3612 | { | |
3613 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3614 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3615 | bool hp_pin_sense; |
3616 | ||
3617 | if (!hp_pin) | |
3618 | return; | |
3619 | ||
3620 | msleep(30); | |
3621 | ||
3622 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3623 | ||
3624 | if (hp_pin_sense) | |
3625 | msleep(2); | |
3626 | ||
3627 | snd_hda_codec_write(codec, hp_pin, 0, | |
3628 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3629 | ||
3630 | if (hp_pin_sense) | |
3631 | msleep(85); | |
3632 | ||
3633 | snd_hda_codec_write(codec, hp_pin, 0, | |
3634 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3635 | ||
3636 | if (hp_pin_sense) | |
3637 | msleep(100); | |
3638 | } | |
3639 | ||
3640 | static void alc_default_shutup(struct hda_codec *codec) | |
3641 | { | |
3642 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3643 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3644 | bool hp_pin_sense; |
3645 | ||
3646 | if (!hp_pin) { | |
3647 | alc269_shutup(codec); | |
3648 | return; | |
3649 | } | |
3650 | ||
3651 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3652 | ||
3653 | if (hp_pin_sense) | |
3654 | msleep(2); | |
3655 | ||
3656 | snd_hda_codec_write(codec, hp_pin, 0, | |
3657 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3658 | ||
3659 | if (hp_pin_sense) | |
3660 | msleep(85); | |
3661 | ||
c0ca5ece TI |
3662 | if (!spec->no_shutup_pins) |
3663 | snd_hda_codec_write(codec, hp_pin, 0, | |
3664 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
c2d6af53 KY |
3665 | |
3666 | if (hp_pin_sense) | |
3667 | msleep(100); | |
3668 | ||
3669 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3670 | alc_shutup_pins(codec); |
c2d6af53 KY |
3671 | } |
3672 | ||
693abe11 KY |
3673 | static void alc294_hp_init(struct hda_codec *codec) |
3674 | { | |
3675 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3676 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
693abe11 KY |
3677 | int i, val; |
3678 | ||
3679 | if (!hp_pin) | |
3680 | return; | |
3681 | ||
3682 | snd_hda_codec_write(codec, hp_pin, 0, | |
3683 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3684 | ||
3685 | msleep(100); | |
3686 | ||
c0ca5ece TI |
3687 | if (!spec->no_shutup_pins) |
3688 | snd_hda_codec_write(codec, hp_pin, 0, | |
3689 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
693abe11 KY |
3690 | |
3691 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ | |
3692 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ | |
3693 | ||
3694 | /* Wait for depop procedure finish */ | |
3695 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3696 | for (i = 0; i < 20 && val & 0x0080; i++) { | |
3697 | msleep(50); | |
3698 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3699 | } | |
3700 | /* Set HP depop to auto mode */ | |
3701 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); | |
3702 | msleep(50); | |
3703 | } | |
3704 | ||
3705 | static void alc294_init(struct hda_codec *codec) | |
3706 | { | |
3707 | struct alc_spec *spec = codec->spec; | |
3708 | ||
f6ef4e0e TI |
3709 | /* required only at boot or S4 resume time */ |
3710 | if (!spec->done_hp_init || | |
3711 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { | |
693abe11 KY |
3712 | alc294_hp_init(codec); |
3713 | spec->done_hp_init = true; | |
3714 | } | |
3715 | alc_default_init(codec); | |
3716 | } | |
3717 | ||
ad60d502 KY |
3718 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
3719 | unsigned int val) | |
3720 | { | |
3721 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3722 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ | |
3723 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ | |
3724 | } | |
3725 | ||
3726 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) | |
3727 | { | |
3728 | unsigned int val; | |
3729 | ||
3730 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3731 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3732 | & 0xffff; | |
3733 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3734 | << 16; | |
3735 | return val; | |
3736 | } | |
3737 | ||
3738 | static void alc5505_dsp_halt(struct hda_codec *codec) | |
3739 | { | |
3740 | unsigned int val; | |
3741 | ||
3742 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ | |
3743 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ | |
3744 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ | |
3745 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ | |
3746 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ | |
3747 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ | |
3748 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ | |
3749 | val = alc5505_coef_get(codec, 0x6220); | |
3750 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ | |
3751 | } | |
3752 | ||
3753 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) | |
3754 | { | |
3755 | alc5505_coef_set(codec, 0x61b8, 0x04133302); | |
3756 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); | |
3757 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); | |
3758 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); | |
3759 | alc5505_coef_set(codec, 0x6220, 0x2002010f); | |
3760 | alc5505_coef_set(codec, 0x880c, 0x00000004); | |
3761 | } | |
3762 | ||
3763 | static void alc5505_dsp_init(struct hda_codec *codec) | |
3764 | { | |
3765 | unsigned int val; | |
3766 | ||
3767 | alc5505_dsp_halt(codec); | |
3768 | alc5505_dsp_back_from_halt(codec); | |
3769 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ | |
3770 | alc5505_coef_set(codec, 0x61b0, 0x5b16); | |
3771 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ | |
3772 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); | |
3773 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ | |
3774 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); | |
3775 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ | |
3776 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); | |
3777 | alc5505_coef_set(codec, 0x61b8, 0x04173302); | |
3778 | alc5505_coef_set(codec, 0x61b8, 0x04163302); | |
3779 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ | |
3780 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ | |
3781 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ | |
3782 | ||
3783 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ | |
3784 | if (val <= 3) | |
3785 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ | |
3786 | else | |
3787 | alc5505_coef_set(codec, 0x6220, 0x6002018f); | |
3788 | ||
3789 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ | |
3790 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ | |
3791 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ | |
3792 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ | |
3793 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ | |
3794 | alc5505_coef_set(codec, 0x880c, 0x00000003); | |
3795 | alc5505_coef_set(codec, 0x880c, 0x00000010); | |
cd63a5ff TI |
3796 | |
3797 | #ifdef HALT_REALTEK_ALC5505 | |
3798 | alc5505_dsp_halt(codec); | |
3799 | #endif | |
ad60d502 KY |
3800 | } |
3801 | ||
cd63a5ff | 3802 | #ifdef HALT_REALTEK_ALC5505 |
8a71821f PLB |
3803 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
3804 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ | |
cd63a5ff TI |
3805 | #else |
3806 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) | |
3807 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) | |
3808 | #endif | |
3809 | ||
2a43952a | 3810 | #ifdef CONFIG_PM |
ad60d502 KY |
3811 | static int alc269_suspend(struct hda_codec *codec) |
3812 | { | |
3813 | struct alc_spec *spec = codec->spec; | |
3814 | ||
3815 | if (spec->has_alc5505_dsp) | |
cd63a5ff | 3816 | alc5505_dsp_suspend(codec); |
ad60d502 KY |
3817 | return alc_suspend(codec); |
3818 | } | |
3819 | ||
1d045db9 TI |
3820 | static int alc269_resume(struct hda_codec *codec) |
3821 | { | |
adcc70b2 KY |
3822 | struct alc_spec *spec = codec->spec; |
3823 | ||
1387e2d1 KY |
3824 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3825 | alc269vb_toggle_power_output(codec, 0); | |
3826 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3827 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 TI |
3828 | msleep(150); |
3829 | } | |
8c427226 | 3830 | |
1d045db9 | 3831 | codec->patch_ops.init(codec); |
f1d4e28b | 3832 | |
1387e2d1 KY |
3833 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3834 | alc269vb_toggle_power_output(codec, 1); | |
3835 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3836 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 TI |
3837 | msleep(200); |
3838 | } | |
f1d4e28b | 3839 | |
1a462be5 | 3840 | snd_hda_regmap_sync(codec); |
1d045db9 | 3841 | hda_call_check_power_status(codec, 0x01); |
f475371a HW |
3842 | |
3843 | /* on some machine, the BIOS will clear the codec gpio data when enter | |
3844 | * suspend, and won't restore the data after resume, so we restore it | |
3845 | * in the driver. | |
3846 | */ | |
d261eec8 TI |
3847 | if (spec->gpio_data) |
3848 | alc_write_gpio_data(codec); | |
f475371a | 3849 | |
ad60d502 | 3850 | if (spec->has_alc5505_dsp) |
cd63a5ff | 3851 | alc5505_dsp_resume(codec); |
c5177c86 | 3852 | |
1d045db9 TI |
3853 | return 0; |
3854 | } | |
2a43952a | 3855 | #endif /* CONFIG_PM */ |
f1d4e28b | 3856 | |
108cc108 | 3857 | static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, |
1727a771 | 3858 | const struct hda_fixup *fix, int action) |
108cc108 DH |
3859 | { |
3860 | struct alc_spec *spec = codec->spec; | |
3861 | ||
1727a771 | 3862 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
108cc108 DH |
3863 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
3864 | } | |
3865 | ||
fdcc968a JMG |
3866 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
3867 | const struct hda_fixup *fix, | |
3868 | int action) | |
3869 | { | |
3870 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); | |
3871 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); | |
3872 | ||
3873 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) | |
3874 | snd_hda_codec_set_pincfg(codec, 0x19, | |
3875 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | | |
3876 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); | |
3877 | } | |
3878 | ||
1d045db9 | 3879 | static void alc269_fixup_hweq(struct hda_codec *codec, |
1727a771 | 3880 | const struct hda_fixup *fix, int action) |
1d045db9 | 3881 | { |
98b24883 TI |
3882 | if (action == HDA_FIXUP_ACT_INIT) |
3883 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); | |
1d045db9 | 3884 | } |
f1d4e28b | 3885 | |
7c478f03 DH |
3886 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
3887 | const struct hda_fixup *fix, int action) | |
3888 | { | |
3889 | struct alc_spec *spec = codec->spec; | |
3890 | ||
3891 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
3892 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
3893 | } | |
3894 | ||
1d045db9 | 3895 | static void alc271_fixup_dmic(struct hda_codec *codec, |
1727a771 | 3896 | const struct hda_fixup *fix, int action) |
1d045db9 TI |
3897 | { |
3898 | static const struct hda_verb verbs[] = { | |
3899 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, | |
3900 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, | |
3901 | {} | |
3902 | }; | |
3903 | unsigned int cfg; | |
f1d4e28b | 3904 | |
7639a06c TI |
3905 | if (strcmp(codec->core.chip_name, "ALC271X") && |
3906 | strcmp(codec->core.chip_name, "ALC269VB")) | |
1d045db9 TI |
3907 | return; |
3908 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); | |
3909 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) | |
3910 | snd_hda_sequence_write(codec, verbs); | |
3911 | } | |
f1d4e28b | 3912 | |
017f2a10 | 3913 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
1727a771 | 3914 | const struct hda_fixup *fix, int action) |
017f2a10 TI |
3915 | { |
3916 | struct alc_spec *spec = codec->spec; | |
3917 | ||
1727a771 | 3918 | if (action != HDA_FIXUP_ACT_PROBE) |
017f2a10 TI |
3919 | return; |
3920 | ||
3921 | /* Due to a hardware problem on Lenovo Ideadpad, we need to | |
3922 | * fix the sample rate of analog I/O to 44.1kHz | |
3923 | */ | |
08c189f2 TI |
3924 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
3925 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; | |
017f2a10 TI |
3926 | } |
3927 | ||
adabb3ec | 3928 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
1727a771 | 3929 | const struct hda_fixup *fix, int action) |
adabb3ec | 3930 | { |
adabb3ec TI |
3931 | /* The digital-mic unit sends PDM (differential signal) instead of |
3932 | * the standard PCM, thus you can't record a valid mono stream as is. | |
3933 | * Below is a workaround specific to ALC269 to control the dmic | |
3934 | * signal source as mono. | |
3935 | */ | |
98b24883 TI |
3936 | if (action == HDA_FIXUP_ACT_INIT) |
3937 | alc_update_coef_idx(codec, 0x07, 0, 0x80); | |
adabb3ec TI |
3938 | } |
3939 | ||
24519911 TI |
3940 | static void alc269_quanta_automute(struct hda_codec *codec) |
3941 | { | |
08c189f2 | 3942 | snd_hda_gen_update_outputs(codec); |
24519911 | 3943 | |
1687ccc8 TI |
3944 | alc_write_coef_idx(codec, 0x0c, 0x680); |
3945 | alc_write_coef_idx(codec, 0x0c, 0x480); | |
24519911 TI |
3946 | } |
3947 | ||
3948 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, | |
1727a771 | 3949 | const struct hda_fixup *fix, int action) |
24519911 TI |
3950 | { |
3951 | struct alc_spec *spec = codec->spec; | |
1727a771 | 3952 | if (action != HDA_FIXUP_ACT_PROBE) |
24519911 | 3953 | return; |
08c189f2 | 3954 | spec->gen.automute_hook = alc269_quanta_automute; |
24519911 TI |
3955 | } |
3956 | ||
d240d1dc | 3957 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 3958 | struct hda_jack_callback *jack) |
d240d1dc DH |
3959 | { |
3960 | struct alc_spec *spec = codec->spec; | |
3961 | int vref; | |
3962 | msleep(200); | |
3963 | snd_hda_gen_hp_automute(codec, jack); | |
3964 | ||
3965 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
3966 | msleep(100); | |
3967 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
3968 | vref); | |
3969 | msleep(500); | |
3970 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
3971 | vref); | |
3972 | } | |
3973 | ||
a2ef03fe TE |
3974 | /* |
3975 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) | |
3976 | */ | |
3977 | struct hda_alc298_mbxinit { | |
3978 | unsigned char value_0x23; | |
3979 | unsigned char value_0x25; | |
3980 | }; | |
3981 | ||
3982 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, | |
3983 | const struct hda_alc298_mbxinit *initval, | |
3984 | bool first) | |
3985 | { | |
3986 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); | |
3987 | alc_write_coef_idx(codec, 0x26, 0xb000); | |
3988 | ||
3989 | if (first) | |
3990 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); | |
3991 | ||
3992 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
3993 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
3994 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); | |
3995 | ||
3996 | if (initval->value_0x23 != 0x1e) | |
3997 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); | |
3998 | ||
3999 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4000 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4001 | } | |
4002 | ||
4003 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, | |
4004 | const struct hda_fixup *fix, | |
4005 | int action) | |
4006 | { | |
4007 | /* Initialization magic */ | |
4008 | static const struct hda_alc298_mbxinit dac_init[] = { | |
4009 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, | |
4010 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, | |
4011 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, | |
4012 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, | |
4013 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, | |
4014 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, | |
4015 | {0x2f, 0x00}, | |
4016 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, | |
4017 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, | |
4018 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, | |
4019 | {} | |
4020 | }; | |
4021 | const struct hda_alc298_mbxinit *seq; | |
4022 | ||
4023 | if (action != HDA_FIXUP_ACT_INIT) | |
4024 | return; | |
4025 | ||
4026 | /* Start */ | |
4027 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); | |
4028 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
4029 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
4030 | alc_write_coef_idx(codec, 0x22, 0x31); | |
4031 | alc_write_coef_idx(codec, 0x23, 0x0b); | |
4032 | alc_write_coef_idx(codec, 0x25, 0x00); | |
4033 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4034 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4035 | ||
4036 | for (seq = dac_init; seq->value_0x23; seq++) | |
4037 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); | |
4038 | } | |
4039 | ||
d240d1dc DH |
4040 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
4041 | const struct hda_fixup *fix, int action) | |
4042 | { | |
4043 | struct alc_spec *spec = codec->spec; | |
4044 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4045 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
4046 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; | |
4047 | } | |
4048 | } | |
4049 | ||
766538ac TI |
4050 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
4051 | bool polarity, bool on) | |
4052 | { | |
4053 | unsigned int pinval; | |
4054 | ||
4055 | if (!pin) | |
4056 | return; | |
4057 | if (polarity) | |
4058 | on = !on; | |
4059 | pinval = snd_hda_codec_get_pin_target(codec, pin); | |
4060 | pinval &= ~AC_PINCTL_VREFEN; | |
4061 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; | |
4062 | /* temporarily power up/down for setting VREF */ | |
4063 | snd_hda_power_up_pm(codec); | |
4064 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); | |
4065 | snd_hda_power_down_pm(codec); | |
4066 | } | |
d240d1dc | 4067 | |
08fb0d0e | 4068 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
8d3d1ece TI |
4069 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
4070 | enum led_brightness brightness) | |
6d3cd5d4 | 4071 | { |
8d3d1ece | 4072 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
08fb0d0e | 4073 | struct alc_spec *spec = codec->spec; |
08fb0d0e | 4074 | |
766538ac TI |
4075 | alc_update_vref_led(codec, spec->mute_led_nid, |
4076 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4077 | return 0; |
6d3cd5d4 DH |
4078 | } |
4079 | ||
d5b6b65e DH |
4080 | /* Make sure the led works even in runtime suspend */ |
4081 | static unsigned int led_power_filter(struct hda_codec *codec, | |
4082 | hda_nid_t nid, | |
4083 | unsigned int power_state) | |
4084 | { | |
4085 | struct alc_spec *spec = codec->spec; | |
4086 | ||
50dd9050 HW |
4087 | if (power_state != AC_PWRST_D3 || nid == 0 || |
4088 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) | |
d5b6b65e DH |
4089 | return power_state; |
4090 | ||
4091 | /* Set pin ctl again, it might have just been set to 0 */ | |
4092 | snd_hda_set_pin_ctl(codec, nid, | |
4093 | snd_hda_codec_get_pin_target(codec, nid)); | |
4094 | ||
cffd3966 | 4095 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
d5b6b65e DH |
4096 | } |
4097 | ||
08fb0d0e TI |
4098 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
4099 | const struct hda_fixup *fix, int action) | |
6d3cd5d4 DH |
4100 | { |
4101 | struct alc_spec *spec = codec->spec; | |
08fb0d0e TI |
4102 | const struct dmi_device *dev = NULL; |
4103 | ||
4104 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4105 | return; | |
4106 | ||
4107 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { | |
4108 | int pol, pin; | |
4109 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) | |
4110 | continue; | |
4111 | if (pin < 0x0a || pin >= 0x10) | |
4112 | break; | |
4113 | spec->mute_led_polarity = pol; | |
4114 | spec->mute_led_nid = pin - 0x0a + 0x18; | |
8d3d1ece | 4115 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4116 | codec->power_filter = led_power_filter; |
4e76a883 TI |
4117 | codec_dbg(codec, |
4118 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, | |
08fb0d0e | 4119 | spec->mute_led_polarity); |
6d3cd5d4 DH |
4120 | break; |
4121 | } | |
4122 | } | |
4123 | ||
85c467dc TI |
4124 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
4125 | const struct hda_fixup *fix, | |
4126 | int action, hda_nid_t pin) | |
d06ac143 DH |
4127 | { |
4128 | struct alc_spec *spec = codec->spec; | |
85c467dc | 4129 | |
d06ac143 DH |
4130 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
4131 | spec->mute_led_polarity = 0; | |
85c467dc | 4132 | spec->mute_led_nid = pin; |
8d3d1ece | 4133 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4134 | codec->power_filter = led_power_filter; |
d06ac143 DH |
4135 | } |
4136 | } | |
4137 | ||
85c467dc TI |
4138 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
4139 | const struct hda_fixup *fix, int action) | |
4140 | { | |
4141 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); | |
4142 | } | |
4143 | ||
08fb0d0e TI |
4144 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
4145 | const struct hda_fixup *fix, int action) | |
420b0feb | 4146 | { |
85c467dc | 4147 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
420b0feb TI |
4148 | } |
4149 | ||
7f783bd5 TB |
4150 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
4151 | const struct hda_fixup *fix, int action) | |
4152 | { | |
85c467dc | 4153 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
7f783bd5 TB |
4154 | } |
4155 | ||
0f32fd19 TI |
4156 | /* update LED status via GPIO */ |
4157 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, | |
dbd13179 | 4158 | int polarity, bool enabled) |
9f5c6faf | 4159 | { |
dbd13179 | 4160 | if (polarity) |
0f32fd19 | 4161 | enabled = !enabled; |
d261eec8 | 4162 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
9f5c6faf TI |
4163 | } |
4164 | ||
0f32fd19 | 4165 | /* turn on/off mute LED via GPIO per vmaster hook */ |
8d3d1ece TI |
4166 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
4167 | enum led_brightness brightness) | |
9f5c6faf | 4168 | { |
8d3d1ece | 4169 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9f5c6faf | 4170 | struct alc_spec *spec = codec->spec; |
9f5c6faf | 4171 | |
dbd13179 | 4172 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
8d3d1ece TI |
4173 | spec->mute_led_polarity, !brightness); |
4174 | return 0; | |
0f32fd19 | 4175 | } |
9f5c6faf | 4176 | |
0f32fd19 | 4177 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
87dc3648 KHF |
4178 | static int micmute_led_set(struct led_classdev *led_cdev, |
4179 | enum led_brightness brightness) | |
4180 | { | |
4181 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); | |
4182 | struct alc_spec *spec = codec->spec; | |
4183 | ||
4184 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, | |
40469064 | 4185 | spec->micmute_led_polarity, !brightness); |
87dc3648 KHF |
4186 | return 0; |
4187 | } | |
4188 | ||
01e4a275 TI |
4189 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
4190 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, | |
4191 | int action, | |
4192 | unsigned int mute_mask, | |
4193 | unsigned int micmute_mask) | |
9f5c6faf TI |
4194 | { |
4195 | struct alc_spec *spec = codec->spec; | |
9f5c6faf | 4196 | |
01e4a275 TI |
4197 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
4198 | ||
4199 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4200 | return; | |
4201 | if (mute_mask) { | |
4202 | spec->gpio_mute_led_mask = mute_mask; | |
8d3d1ece | 4203 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
01e4a275 TI |
4204 | } |
4205 | if (micmute_mask) { | |
4206 | spec->gpio_mic_led_mask = micmute_mask; | |
7cdf8c49 | 4207 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
9f5c6faf TI |
4208 | } |
4209 | } | |
4210 | ||
01e4a275 | 4211 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
eaa8e5ef KY |
4212 | const struct hda_fixup *fix, int action) |
4213 | { | |
01e4a275 TI |
4214 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
4215 | } | |
eaa8e5ef | 4216 | |
f5a88b0a KHF |
4217 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
4218 | const struct hda_fixup *fix, int action) | |
4219 | { | |
3e0650ab | 4220 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
f5a88b0a KHF |
4221 | } |
4222 | ||
01e4a275 TI |
4223 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
4224 | const struct hda_fixup *fix, int action) | |
4225 | { | |
4226 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); | |
9f5c6faf TI |
4227 | } |
4228 | ||
a0ccbc53 KY |
4229 | static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, |
4230 | const struct hda_fixup *fix, int action) | |
4231 | { | |
4232 | alc_fixup_hp_gpio_led(codec, action, 0x10, 0); | |
4233 | } | |
4234 | ||
8a503555 TI |
4235 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
4236 | static int vref_micmute_led_set(struct led_classdev *led_cdev, | |
4237 | enum led_brightness brightness) | |
9c5dc3bf | 4238 | { |
8a503555 | 4239 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9c5dc3bf | 4240 | struct alc_spec *spec = codec->spec; |
9c5dc3bf | 4241 | |
766538ac TI |
4242 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
4243 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4244 | return 0; |
9c5dc3bf KY |
4245 | } |
4246 | ||
4247 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, | |
4248 | const struct hda_fixup *fix, int action) | |
4249 | { | |
4250 | struct alc_spec *spec = codec->spec; | |
9c5dc3bf | 4251 | |
01e4a275 | 4252 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
9c5dc3bf | 4253 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
4254 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
4255 | * enable headphone amp | |
4256 | */ | |
4257 | spec->gpio_mask |= 0x10; | |
4258 | spec->gpio_dir |= 0x10; | |
9c5dc3bf | 4259 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4260 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
50dd9050 | 4261 | codec->power_filter = led_power_filter; |
9c5dc3bf KY |
4262 | } |
4263 | } | |
4264 | ||
7a5255f1 DH |
4265 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
4266 | const struct hda_fixup *fix, int action) | |
4267 | { | |
7a5255f1 | 4268 | struct alc_spec *spec = codec->spec; |
7a5255f1 | 4269 | |
01e4a275 | 4270 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
7a5255f1 | 4271 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
7a5255f1 | 4272 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4273 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
7a5255f1 DH |
4274 | codec->power_filter = led_power_filter; |
4275 | } | |
4276 | } | |
4277 | ||
766538ac TI |
4278 | static void alc_update_coef_led(struct hda_codec *codec, |
4279 | struct alc_coef_led *led, | |
4280 | bool polarity, bool on) | |
4281 | { | |
4282 | if (polarity) | |
4283 | on = !on; | |
4284 | /* temporarily power up/down for setting COEF bit */ | |
4285 | alc_update_coef_idx(codec, led->idx, led->mask, | |
4286 | on ? led->on : led->off); | |
4287 | } | |
4288 | ||
431e76c3 | 4289 | /* update mute-LED according to the speaker mute state via COEF bit */ |
8d3d1ece TI |
4290 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
4291 | enum led_brightness brightness) | |
431e76c3 | 4292 | { |
8d3d1ece | 4293 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4294 | struct alc_spec *spec = codec->spec; |
4295 | ||
766538ac TI |
4296 | alc_update_coef_led(codec, &spec->mute_led_coef, |
4297 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4298 | return 0; |
431e76c3 KY |
4299 | } |
4300 | ||
4301 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, | |
4302 | const struct hda_fixup *fix, | |
4303 | int action) | |
4304 | { | |
4305 | struct alc_spec *spec = codec->spec; | |
4306 | ||
4307 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4308 | spec->mute_led_polarity = 0; | |
766538ac TI |
4309 | spec->mute_led_coef.idx = 0x0b; |
4310 | spec->mute_led_coef.mask = 1 << 3; | |
4311 | spec->mute_led_coef.on = 1 << 3; | |
4312 | spec->mute_led_coef.off = 0; | |
8d3d1ece | 4313 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
431e76c3 KY |
4314 | } |
4315 | } | |
4316 | ||
24164f43 KY |
4317 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
4318 | const struct hda_fixup *fix, | |
4319 | int action) | |
4320 | { | |
4321 | struct alc_spec *spec = codec->spec; | |
4322 | ||
4323 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4324 | spec->mute_led_polarity = 0; | |
766538ac TI |
4325 | spec->mute_led_coef.idx = 0x34; |
4326 | spec->mute_led_coef.mask = 1 << 5; | |
4327 | spec->mute_led_coef.on = 0; | |
4328 | spec->mute_led_coef.off = 1 << 5; | |
8d3d1ece | 4329 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
24164f43 KY |
4330 | } |
4331 | } | |
4332 | ||
431e76c3 | 4333 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
8a503555 TI |
4334 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
4335 | enum led_brightness brightness) | |
431e76c3 | 4336 | { |
8a503555 | 4337 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4338 | struct alc_spec *spec = codec->spec; |
4339 | ||
766538ac TI |
4340 | alc_update_coef_led(codec, &spec->mic_led_coef, |
4341 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4342 | return 0; |
431e76c3 KY |
4343 | } |
4344 | ||
4345 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, | |
4346 | const struct hda_fixup *fix, int action) | |
4347 | { | |
4348 | struct alc_spec *spec = codec->spec; | |
4349 | ||
4350 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4351 | spec->mic_led_coef.idx = 0x19; |
4352 | spec->mic_led_coef.mask = 1 << 13; | |
4353 | spec->mic_led_coef.on = 1 << 13; | |
4354 | spec->mic_led_coef.off = 0; | |
8a503555 | 4355 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
431e76c3 KY |
4356 | } |
4357 | } | |
4358 | ||
24164f43 KY |
4359 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
4360 | const struct hda_fixup *fix, int action) | |
4361 | { | |
4362 | struct alc_spec *spec = codec->spec; | |
4363 | ||
4364 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4365 | spec->mic_led_coef.idx = 0x35; |
4366 | spec->mic_led_coef.mask = 3 << 2; | |
4367 | spec->mic_led_coef.on = 2 << 2; | |
4368 | spec->mic_led_coef.off = 1 << 2; | |
8a503555 | 4369 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
24164f43 KY |
4370 | } |
4371 | } | |
4372 | ||
431e76c3 KY |
4373 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
4374 | const struct hda_fixup *fix, int action) | |
4375 | { | |
4376 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4377 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); | |
4378 | } | |
4379 | ||
24164f43 KY |
4380 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
4381 | const struct hda_fixup *fix, int action) | |
4382 | { | |
4383 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4384 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); | |
4385 | } | |
4386 | ||
6a30abaa | 4387 | #if IS_REACHABLE(CONFIG_INPUT) |
33f4acd3 DH |
4388 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
4389 | struct hda_jack_callback *event) | |
4390 | { | |
4391 | struct alc_spec *spec = codec->spec; | |
4392 | ||
4393 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore | |
4394 | send both key on and key off event for every interrupt. */ | |
c7b60a89 | 4395 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); |
33f4acd3 | 4396 | input_sync(spec->kb_dev); |
c7b60a89 | 4397 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); |
33f4acd3 DH |
4398 | input_sync(spec->kb_dev); |
4399 | } | |
33f4acd3 | 4400 | |
3694cb29 K |
4401 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
4402 | { | |
4403 | struct alc_spec *spec = codec->spec; | |
c7b60a89 | 4404 | int i; |
3694cb29 K |
4405 | |
4406 | spec->kb_dev = input_allocate_device(); | |
4407 | if (!spec->kb_dev) { | |
4408 | codec_err(codec, "Out of memory (input_allocate_device)\n"); | |
4409 | return -ENOMEM; | |
4410 | } | |
c7b60a89 HW |
4411 | |
4412 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; | |
4413 | ||
3694cb29 K |
4414 | spec->kb_dev->name = "Microphone Mute Button"; |
4415 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); | |
c7b60a89 HW |
4416 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
4417 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); | |
4418 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; | |
4419 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) | |
4420 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); | |
3694cb29 K |
4421 | |
4422 | if (input_register_device(spec->kb_dev)) { | |
4423 | codec_err(codec, "input_register_device failed\n"); | |
4424 | input_free_device(spec->kb_dev); | |
4425 | spec->kb_dev = NULL; | |
4426 | return -ENOMEM; | |
4427 | } | |
4428 | ||
4429 | return 0; | |
4430 | } | |
4431 | ||
01e4a275 TI |
4432 | /* GPIO1 = set according to SKU external amp |
4433 | * GPIO2 = mic mute hotkey | |
4434 | * GPIO3 = mute LED | |
4435 | * GPIO4 = mic mute LED | |
4436 | */ | |
33f4acd3 DH |
4437 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
4438 | const struct hda_fixup *fix, int action) | |
4439 | { | |
33f4acd3 DH |
4440 | struct alc_spec *spec = codec->spec; |
4441 | ||
01e4a275 | 4442 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
33f4acd3 | 4443 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4444 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 | 4445 | if (alc_register_micmute_input_device(codec) != 0) |
33f4acd3 | 4446 | return; |
33f4acd3 | 4447 | |
01e4a275 TI |
4448 | spec->gpio_mask |= 0x06; |
4449 | spec->gpio_dir |= 0x02; | |
4450 | spec->gpio_data |= 0x02; | |
7639a06c | 4451 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
33f4acd3 | 4452 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
7639a06c | 4453 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
33f4acd3 | 4454 | gpio2_mic_hotkey_event); |
33f4acd3 DH |
4455 | return; |
4456 | } | |
4457 | ||
4458 | if (!spec->kb_dev) | |
4459 | return; | |
4460 | ||
4461 | switch (action) { | |
33f4acd3 DH |
4462 | case HDA_FIXUP_ACT_FREE: |
4463 | input_unregister_device(spec->kb_dev); | |
33f4acd3 DH |
4464 | spec->kb_dev = NULL; |
4465 | } | |
33f4acd3 DH |
4466 | } |
4467 | ||
01e4a275 TI |
4468 | /* Line2 = mic mute hotkey |
4469 | * GPIO2 = mic mute LED | |
4470 | */ | |
3694cb29 K |
4471 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
4472 | const struct hda_fixup *fix, int action) | |
4473 | { | |
3694cb29 K |
4474 | struct alc_spec *spec = codec->spec; |
4475 | ||
01e4a275 | 4476 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
3694cb29 | 4477 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4478 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 K |
4479 | if (alc_register_micmute_input_device(codec) != 0) |
4480 | return; | |
4481 | ||
3694cb29 K |
4482 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
4483 | gpio2_mic_hotkey_event); | |
3694cb29 K |
4484 | return; |
4485 | } | |
4486 | ||
4487 | if (!spec->kb_dev) | |
4488 | return; | |
4489 | ||
4490 | switch (action) { | |
3694cb29 K |
4491 | case HDA_FIXUP_ACT_FREE: |
4492 | input_unregister_device(spec->kb_dev); | |
4493 | spec->kb_dev = NULL; | |
4494 | } | |
4495 | } | |
c469652b TI |
4496 | #else /* INPUT */ |
4497 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL | |
4498 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL | |
4499 | #endif /* INPUT */ | |
3694cb29 | 4500 | |
9c5dc3bf KY |
4501 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
4502 | const struct hda_fixup *fix, int action) | |
4503 | { | |
4504 | struct alc_spec *spec = codec->spec; | |
4505 | ||
1bce62a6 | 4506 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
9c5dc3bf | 4507 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9c5dc3bf | 4508 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4509 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
9c5dc3bf KY |
4510 | } |
4511 | } | |
4512 | ||
6b0f95c4 | 4513 | static const struct coef_fw alc225_pre_hsmode[] = { |
5a36767a KY |
4514 | UPDATE_COEF(0x4a, 1<<8, 0), |
4515 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | |
4516 | UPDATE_COEF(0x63, 3<<14, 3<<14), | |
4517 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4518 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | |
4519 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | |
4520 | UPDATE_COEF(0x4a, 3<<10, 0), | |
4521 | {} | |
4522 | }; | |
4523 | ||
73bdd597 DH |
4524 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
4525 | { | |
6b0f95c4 | 4526 | static const struct coef_fw coef0255[] = { |
717f43d8 | 4527 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
54db6c39 TI |
4528 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4529 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4530 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4531 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ | |
4532 | {} | |
4533 | }; | |
6b0f95c4 | 4534 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 4535 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
717f43d8 KY |
4536 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4537 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4538 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ | |
4539 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
e69e7e03 KY |
4540 | {} |
4541 | }; | |
6b0f95c4 | 4542 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4543 | WRITE_COEF(0x1b, 0x0c0b), |
4544 | WRITE_COEF(0x45, 0xc429), | |
4545 | UPDATE_COEF(0x35, 0x4000, 0), | |
4546 | WRITE_COEF(0x06, 0x2104), | |
4547 | WRITE_COEF(0x1a, 0x0001), | |
4548 | WRITE_COEF(0x26, 0x0004), | |
4549 | WRITE_COEF(0x32, 0x42a3), | |
4550 | {} | |
4551 | }; | |
6b0f95c4 | 4552 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4553 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
4554 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4555 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4556 | UPDATE_COEF(0x66, 0x0008, 0), | |
4557 | UPDATE_COEF(0x67, 0x2000, 0), | |
4558 | {} | |
4559 | }; | |
6b0f95c4 | 4560 | static const struct coef_fw coef0298[] = { |
89542936 KY |
4561 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
4562 | {} | |
4563 | }; | |
6b0f95c4 | 4564 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4565 | WRITE_COEF(0x76, 0x000e), |
4566 | WRITE_COEF(0x6c, 0x2400), | |
4567 | WRITE_COEF(0x18, 0x7308), | |
4568 | WRITE_COEF(0x6b, 0xc429), | |
4569 | {} | |
4570 | }; | |
6b0f95c4 | 4571 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4572 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
4573 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ | |
4574 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ | |
4575 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ | |
4576 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ | |
4577 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ | |
4578 | {} | |
4579 | }; | |
6b0f95c4 | 4580 | static const struct coef_fw coef0668[] = { |
54db6c39 TI |
4581 | WRITE_COEF(0x15, 0x0d40), |
4582 | WRITE_COEF(0xb7, 0x802b), | |
4583 | {} | |
4584 | }; | |
6b0f95c4 | 4585 | static const struct coef_fw coef0225[] = { |
5a36767a | 4586 | UPDATE_COEF(0x63, 3<<14, 0), |
4cc9b9d6 KY |
4587 | {} |
4588 | }; | |
6b0f95c4 | 4589 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4590 | UPDATE_COEF(0x4a, 0x0100, 0), |
4591 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), | |
4592 | UPDATE_COEF(0x6b, 0xf000, 0x5000), | |
4593 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4594 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), | |
4595 | WRITE_COEF(0x45, 0x5289), | |
4596 | UPDATE_COEF(0x4a, 0x0c00, 0), | |
4597 | {} | |
4598 | }; | |
54db6c39 | 4599 | |
7639a06c | 4600 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4601 | case 0x10ec0255: |
e69e7e03 KY |
4602 | alc_process_coef_fw(codec, coef0255); |
4603 | break; | |
736f20a7 | 4604 | case 0x10ec0236: |
7081adf3 | 4605 | case 0x10ec0256: |
e69e7e03 | 4606 | alc_process_coef_fw(codec, coef0256); |
9a22a8f5 | 4607 | break; |
71683c32 KY |
4608 | case 0x10ec0234: |
4609 | case 0x10ec0274: | |
4610 | case 0x10ec0294: | |
4611 | alc_process_coef_fw(codec, coef0274); | |
4612 | break; | |
13fd08a3 | 4613 | case 0x10ec0233: |
73bdd597 | 4614 | case 0x10ec0283: |
54db6c39 | 4615 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4616 | break; |
f3b70332 KY |
4617 | case 0x10ec0286: |
4618 | case 0x10ec0288: | |
89542936 KY |
4619 | alc_process_coef_fw(codec, coef0288); |
4620 | break; | |
1a5bc8d9 | 4621 | case 0x10ec0298: |
89542936 | 4622 | alc_process_coef_fw(codec, coef0298); |
f3b70332 KY |
4623 | alc_process_coef_fw(codec, coef0288); |
4624 | break; | |
73bdd597 | 4625 | case 0x10ec0292: |
54db6c39 | 4626 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4627 | break; |
a22aa26f | 4628 | case 0x10ec0293: |
54db6c39 | 4629 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4630 | break; |
73bdd597 | 4631 | case 0x10ec0668: |
54db6c39 | 4632 | alc_process_coef_fw(codec, coef0668); |
73bdd597 | 4633 | break; |
c2b691ee | 4634 | case 0x10ec0215: |
4cc9b9d6 | 4635 | case 0x10ec0225: |
c2b691ee | 4636 | case 0x10ec0285: |
7d727869 | 4637 | case 0x10ec0295: |
c2b691ee | 4638 | case 0x10ec0289: |
28f1f9b2 | 4639 | case 0x10ec0299: |
4d4b0c52 | 4640 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4641 | alc_process_coef_fw(codec, coef0225); |
4642 | break; | |
78f4f7c2 KY |
4643 | case 0x10ec0867: |
4644 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4645 | break; | |
73bdd597 | 4646 | } |
4e76a883 | 4647 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
73bdd597 DH |
4648 | } |
4649 | ||
4650 | ||
4651 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |
4652 | hda_nid_t mic_pin) | |
4653 | { | |
6b0f95c4 | 4654 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4655 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
4656 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4657 | {} | |
4658 | }; | |
6b0f95c4 | 4659 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
4660 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
4661 | WRITE_COEFEX(0x57, 0x03, 0x09a3), | |
4662 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4663 | {} | |
4664 | }; | |
6b0f95c4 | 4665 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4666 | UPDATE_COEF(0x35, 0, 1<<14), |
4667 | WRITE_COEF(0x06, 0x2100), | |
4668 | WRITE_COEF(0x1a, 0x0021), | |
4669 | WRITE_COEF(0x26, 0x008c), | |
4670 | {} | |
4671 | }; | |
6b0f95c4 | 4672 | static const struct coef_fw coef0288[] = { |
89542936 | 4673 | UPDATE_COEF(0x4f, 0x00c0, 0), |
f3b70332 KY |
4674 | UPDATE_COEF(0x50, 0x2000, 0), |
4675 | UPDATE_COEF(0x56, 0x0006, 0), | |
4676 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | |
4677 | UPDATE_COEF(0x66, 0x0008, 0x0008), | |
4678 | UPDATE_COEF(0x67, 0x2000, 0x2000), | |
4679 | {} | |
4680 | }; | |
6b0f95c4 | 4681 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4682 | WRITE_COEF(0x19, 0xa208), |
4683 | WRITE_COEF(0x2e, 0xacf0), | |
4684 | {} | |
4685 | }; | |
6b0f95c4 | 4686 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4687 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
4688 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ | |
4689 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4690 | {} | |
4691 | }; | |
6b0f95c4 | 4692 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4693 | WRITE_COEF(0xb7, 0x802b), |
4694 | WRITE_COEF(0xb5, 0x1040), | |
4695 | UPDATE_COEF(0xc3, 0, 1<<12), | |
4696 | {} | |
4697 | }; | |
6b0f95c4 | 4698 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 KY |
4699 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
4700 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4701 | UPDATE_COEF(0x63, 3<<14, 0), | |
4702 | {} | |
4703 | }; | |
6b0f95c4 | 4704 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4705 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
4706 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4707 | UPDATE_COEF(0x6b, 0xf000, 0), | |
4708 | {} | |
4709 | }; | |
54db6c39 | 4710 | |
7639a06c | 4711 | switch (codec->core.vendor_id) { |
9a22a8f5 KY |
4712 | case 0x10ec0255: |
4713 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4714 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4715 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
4716 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4717 | break; | |
717f43d8 KY |
4718 | case 0x10ec0236: |
4719 | case 0x10ec0256: | |
4720 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4721 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4722 | alc_process_coef_fw(codec, coef0256); | |
4723 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4724 | break; | |
71683c32 KY |
4725 | case 0x10ec0234: |
4726 | case 0x10ec0274: | |
4727 | case 0x10ec0294: | |
4728 | alc_write_coef_idx(codec, 0x45, 0x4689); | |
4729 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4730 | alc_process_coef_fw(codec, coef0274); | |
4731 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4732 | break; | |
13fd08a3 | 4733 | case 0x10ec0233: |
73bdd597 DH |
4734 | case 0x10ec0283: |
4735 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4736 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4737 | alc_process_coef_fw(codec, coef0233); |
73bdd597 DH |
4738 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4739 | break; | |
f3b70332 KY |
4740 | case 0x10ec0286: |
4741 | case 0x10ec0288: | |
1a5bc8d9 | 4742 | case 0x10ec0298: |
f3b70332 KY |
4743 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4744 | alc_process_coef_fw(codec, coef0288); | |
4745 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4746 | break; | |
73bdd597 DH |
4747 | case 0x10ec0292: |
4748 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4749 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4750 | break; |
a22aa26f KY |
4751 | case 0x10ec0293: |
4752 | /* Set to TRS mode */ | |
4753 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4754 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4755 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
4756 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4757 | break; | |
78f4f7c2 KY |
4758 | case 0x10ec0867: |
4759 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); | |
c0dbbdad | 4760 | fallthrough; |
9eb5d0e6 | 4761 | case 0x10ec0221: |
1f8b46cd DH |
4762 | case 0x10ec0662: |
4763 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4764 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4765 | break; | |
73bdd597 DH |
4766 | case 0x10ec0668: |
4767 | alc_write_coef_idx(codec, 0x11, 0x0001); | |
4768 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4769 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
4770 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4771 | break; | |
c2b691ee | 4772 | case 0x10ec0215: |
4cc9b9d6 | 4773 | case 0x10ec0225: |
c2b691ee | 4774 | case 0x10ec0285: |
7d727869 | 4775 | case 0x10ec0295: |
c2b691ee | 4776 | case 0x10ec0289: |
28f1f9b2 | 4777 | case 0x10ec0299: |
5a36767a | 4778 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4779 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
4780 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4781 | alc_process_coef_fw(codec, coef0225); | |
4782 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4783 | break; | |
73bdd597 | 4784 | } |
4e76a883 | 4785 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
73bdd597 DH |
4786 | } |
4787 | ||
4788 | static void alc_headset_mode_default(struct hda_codec *codec) | |
4789 | { | |
6b0f95c4 | 4790 | static const struct coef_fw coef0225[] = { |
5a36767a KY |
4791 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
4792 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), | |
4793 | UPDATE_COEF(0x49, 3<<8, 0<<8), | |
4794 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | |
4795 | UPDATE_COEF(0x63, 3<<14, 0), | |
4796 | UPDATE_COEF(0x67, 0xf000, 0x3000), | |
2ae95577 DH |
4797 | {} |
4798 | }; | |
6b0f95c4 | 4799 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4800 | WRITE_COEF(0x45, 0xc089), |
4801 | WRITE_COEF(0x45, 0xc489), | |
4802 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4803 | WRITE_COEF(0x49, 0x0049), | |
4804 | {} | |
4805 | }; | |
6b0f95c4 | 4806 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
4807 | WRITE_COEF(0x45, 0xc489), |
4808 | WRITE_COEFEX(0x57, 0x03, 0x0da3), | |
4809 | WRITE_COEF(0x49, 0x0049), | |
4810 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4811 | WRITE_COEF(0x06, 0x6100), | |
4812 | {} | |
4813 | }; | |
6b0f95c4 | 4814 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4815 | WRITE_COEF(0x06, 0x2100), |
4816 | WRITE_COEF(0x32, 0x4ea3), | |
4817 | {} | |
4818 | }; | |
6b0f95c4 | 4819 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4820 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
4821 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4822 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4823 | UPDATE_COEF(0x66, 0x0008, 0), | |
4824 | UPDATE_COEF(0x67, 0x2000, 0), | |
4825 | {} | |
4826 | }; | |
6b0f95c4 | 4827 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4828 | WRITE_COEF(0x76, 0x000e), |
4829 | WRITE_COEF(0x6c, 0x2400), | |
4830 | WRITE_COEF(0x6b, 0xc429), | |
4831 | WRITE_COEF(0x18, 0x7308), | |
4832 | {} | |
4833 | }; | |
6b0f95c4 | 4834 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4835 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
4836 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ | |
4837 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4838 | {} | |
4839 | }; | |
6b0f95c4 | 4840 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4841 | WRITE_COEF(0x11, 0x0041), |
4842 | WRITE_COEF(0x15, 0x0d40), | |
4843 | WRITE_COEF(0xb7, 0x802b), | |
4844 | {} | |
4845 | }; | |
6b0f95c4 | 4846 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4847 | WRITE_COEF(0x45, 0x4289), |
4848 | UPDATE_COEF(0x4a, 0x0010, 0x0010), | |
4849 | UPDATE_COEF(0x6b, 0x0f00, 0), | |
4850 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
4851 | {} | |
4852 | }; | |
54db6c39 | 4853 | |
7639a06c | 4854 | switch (codec->core.vendor_id) { |
c2b691ee | 4855 | case 0x10ec0215: |
2ae95577 | 4856 | case 0x10ec0225: |
c2b691ee | 4857 | case 0x10ec0285: |
7d727869 | 4858 | case 0x10ec0295: |
c2b691ee | 4859 | case 0x10ec0289: |
28f1f9b2 | 4860 | case 0x10ec0299: |
5a36767a | 4861 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
2ae95577 DH |
4862 | alc_process_coef_fw(codec, coef0225); |
4863 | break; | |
9a22a8f5 | 4864 | case 0x10ec0255: |
54db6c39 | 4865 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4866 | break; |
717f43d8 KY |
4867 | case 0x10ec0236: |
4868 | case 0x10ec0256: | |
4869 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); | |
4870 | alc_write_coef_idx(codec, 0x45, 0xc089); | |
4871 | msleep(50); | |
4872 | alc_process_coef_fw(codec, coef0256); | |
4873 | break; | |
71683c32 KY |
4874 | case 0x10ec0234: |
4875 | case 0x10ec0274: | |
4876 | case 0x10ec0294: | |
4877 | alc_process_coef_fw(codec, coef0274); | |
4878 | break; | |
13fd08a3 | 4879 | case 0x10ec0233: |
73bdd597 | 4880 | case 0x10ec0283: |
54db6c39 | 4881 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4882 | break; |
f3b70332 KY |
4883 | case 0x10ec0286: |
4884 | case 0x10ec0288: | |
1a5bc8d9 | 4885 | case 0x10ec0298: |
f3b70332 KY |
4886 | alc_process_coef_fw(codec, coef0288); |
4887 | break; | |
73bdd597 | 4888 | case 0x10ec0292: |
54db6c39 | 4889 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4890 | break; |
a22aa26f | 4891 | case 0x10ec0293: |
54db6c39 | 4892 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4893 | break; |
73bdd597 | 4894 | case 0x10ec0668: |
54db6c39 | 4895 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 4896 | break; |
78f4f7c2 KY |
4897 | case 0x10ec0867: |
4898 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4899 | break; | |
73bdd597 | 4900 | } |
4e76a883 | 4901 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
73bdd597 DH |
4902 | } |
4903 | ||
4904 | /* Iphone type */ | |
4905 | static void alc_headset_mode_ctia(struct hda_codec *codec) | |
4906 | { | |
89542936 KY |
4907 | int val; |
4908 | ||
6b0f95c4 | 4909 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4910 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
4911 | WRITE_COEF(0x1b, 0x0c2b), | |
4912 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4913 | {} | |
4914 | }; | |
6b0f95c4 | 4915 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 4916 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
717f43d8 | 4917 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
4918 | {} |
4919 | }; | |
6b0f95c4 | 4920 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4921 | WRITE_COEF(0x45, 0xd429), |
4922 | WRITE_COEF(0x1b, 0x0c2b), | |
4923 | WRITE_COEF(0x32, 0x4ea3), | |
4924 | {} | |
4925 | }; | |
6b0f95c4 | 4926 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4927 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
4928 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4929 | UPDATE_COEF(0x66, 0x0008, 0), | |
4930 | UPDATE_COEF(0x67, 0x2000, 0), | |
4931 | {} | |
4932 | }; | |
6b0f95c4 | 4933 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4934 | WRITE_COEF(0x6b, 0xd429), |
4935 | WRITE_COEF(0x76, 0x0008), | |
4936 | WRITE_COEF(0x18, 0x7388), | |
4937 | {} | |
4938 | }; | |
6b0f95c4 | 4939 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4940 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
4941 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
4942 | {} | |
4943 | }; | |
6b0f95c4 | 4944 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4945 | WRITE_COEF(0x11, 0x0001), |
4946 | WRITE_COEF(0x15, 0x0d60), | |
4947 | WRITE_COEF(0xc3, 0x0000), | |
4948 | {} | |
4949 | }; | |
6b0f95c4 | 4950 | static const struct coef_fw coef0225_1[] = { |
4cc9b9d6 | 4951 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5a36767a KY |
4952 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4953 | {} | |
4954 | }; | |
6b0f95c4 | 4955 | static const struct coef_fw coef0225_2[] = { |
5a36767a KY |
4956 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
4957 | UPDATE_COEF(0x63, 3<<14, 1<<14), | |
4cc9b9d6 KY |
4958 | {} |
4959 | }; | |
54db6c39 | 4960 | |
7639a06c | 4961 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4962 | case 0x10ec0255: |
54db6c39 | 4963 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4964 | break; |
736f20a7 | 4965 | case 0x10ec0236: |
e69e7e03 KY |
4966 | case 0x10ec0256: |
4967 | alc_process_coef_fw(codec, coef0256); | |
4968 | break; | |
71683c32 KY |
4969 | case 0x10ec0234: |
4970 | case 0x10ec0274: | |
4971 | case 0x10ec0294: | |
4972 | alc_write_coef_idx(codec, 0x45, 0xd689); | |
4973 | break; | |
13fd08a3 | 4974 | case 0x10ec0233: |
73bdd597 | 4975 | case 0x10ec0283: |
54db6c39 | 4976 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4977 | break; |
1a5bc8d9 | 4978 | case 0x10ec0298: |
89542936 KY |
4979 | val = alc_read_coef_idx(codec, 0x50); |
4980 | if (val & (1 << 12)) { | |
4981 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
4982 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4983 | msleep(300); | |
4984 | } else { | |
4985 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
4986 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4987 | msleep(300); | |
4988 | } | |
4989 | break; | |
f3b70332 KY |
4990 | case 0x10ec0286: |
4991 | case 0x10ec0288: | |
4992 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4993 | msleep(300); | |
4994 | alc_process_coef_fw(codec, coef0288); | |
4995 | break; | |
73bdd597 | 4996 | case 0x10ec0292: |
54db6c39 | 4997 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4998 | break; |
a22aa26f | 4999 | case 0x10ec0293: |
54db6c39 | 5000 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5001 | break; |
73bdd597 | 5002 | case 0x10ec0668: |
54db6c39 | 5003 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5004 | break; |
c2b691ee | 5005 | case 0x10ec0215: |
4cc9b9d6 | 5006 | case 0x10ec0225: |
c2b691ee | 5007 | case 0x10ec0285: |
7d727869 | 5008 | case 0x10ec0295: |
c2b691ee | 5009 | case 0x10ec0289: |
28f1f9b2 | 5010 | case 0x10ec0299: |
5a36767a KY |
5011 | val = alc_read_coef_idx(codec, 0x45); |
5012 | if (val & (1 << 9)) | |
5013 | alc_process_coef_fw(codec, coef0225_2); | |
5014 | else | |
5015 | alc_process_coef_fw(codec, coef0225_1); | |
4cc9b9d6 | 5016 | break; |
78f4f7c2 KY |
5017 | case 0x10ec0867: |
5018 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5019 | break; | |
73bdd597 | 5020 | } |
4e76a883 | 5021 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
73bdd597 DH |
5022 | } |
5023 | ||
5024 | /* Nokia type */ | |
5025 | static void alc_headset_mode_omtp(struct hda_codec *codec) | |
5026 | { | |
6b0f95c4 | 5027 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5028 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
5029 | WRITE_COEF(0x1b, 0x0c2b), | |
5030 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5031 | {} | |
5032 | }; | |
6b0f95c4 | 5033 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 5034 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
717f43d8 | 5035 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
5036 | {} |
5037 | }; | |
6b0f95c4 | 5038 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5039 | WRITE_COEF(0x45, 0xe429), |
5040 | WRITE_COEF(0x1b, 0x0c2b), | |
5041 | WRITE_COEF(0x32, 0x4ea3), | |
5042 | {} | |
5043 | }; | |
6b0f95c4 | 5044 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5045 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5046 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5047 | UPDATE_COEF(0x66, 0x0008, 0), | |
5048 | UPDATE_COEF(0x67, 0x2000, 0), | |
5049 | {} | |
5050 | }; | |
6b0f95c4 | 5051 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5052 | WRITE_COEF(0x6b, 0xe429), |
5053 | WRITE_COEF(0x76, 0x0008), | |
5054 | WRITE_COEF(0x18, 0x7388), | |
5055 | {} | |
5056 | }; | |
6b0f95c4 | 5057 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5058 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
5059 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
5060 | {} | |
5061 | }; | |
6b0f95c4 | 5062 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5063 | WRITE_COEF(0x11, 0x0001), |
5064 | WRITE_COEF(0x15, 0x0d50), | |
5065 | WRITE_COEF(0xc3, 0x0000), | |
5066 | {} | |
5067 | }; | |
6b0f95c4 | 5068 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 | 5069 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
5a36767a | 5070 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4cc9b9d6 KY |
5071 | {} |
5072 | }; | |
54db6c39 | 5073 | |
7639a06c | 5074 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5075 | case 0x10ec0255: |
54db6c39 | 5076 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5077 | break; |
736f20a7 | 5078 | case 0x10ec0236: |
e69e7e03 KY |
5079 | case 0x10ec0256: |
5080 | alc_process_coef_fw(codec, coef0256); | |
5081 | break; | |
71683c32 KY |
5082 | case 0x10ec0234: |
5083 | case 0x10ec0274: | |
5084 | case 0x10ec0294: | |
5085 | alc_write_coef_idx(codec, 0x45, 0xe689); | |
5086 | break; | |
13fd08a3 | 5087 | case 0x10ec0233: |
73bdd597 | 5088 | case 0x10ec0283: |
54db6c39 | 5089 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5090 | break; |
1a5bc8d9 KY |
5091 | case 0x10ec0298: |
5092 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ | |
89542936 KY |
5093 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
5094 | msleep(300); | |
5095 | break; | |
f3b70332 KY |
5096 | case 0x10ec0286: |
5097 | case 0x10ec0288: | |
5098 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | |
5099 | msleep(300); | |
5100 | alc_process_coef_fw(codec, coef0288); | |
5101 | break; | |
73bdd597 | 5102 | case 0x10ec0292: |
54db6c39 | 5103 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5104 | break; |
a22aa26f | 5105 | case 0x10ec0293: |
54db6c39 | 5106 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5107 | break; |
73bdd597 | 5108 | case 0x10ec0668: |
54db6c39 | 5109 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5110 | break; |
c2b691ee | 5111 | case 0x10ec0215: |
4cc9b9d6 | 5112 | case 0x10ec0225: |
c2b691ee | 5113 | case 0x10ec0285: |
7d727869 | 5114 | case 0x10ec0295: |
c2b691ee | 5115 | case 0x10ec0289: |
28f1f9b2 | 5116 | case 0x10ec0299: |
4cc9b9d6 KY |
5117 | alc_process_coef_fw(codec, coef0225); |
5118 | break; | |
73bdd597 | 5119 | } |
4e76a883 | 5120 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
73bdd597 DH |
5121 | } |
5122 | ||
5123 | static void alc_determine_headset_type(struct hda_codec *codec) | |
5124 | { | |
5125 | int val; | |
5126 | bool is_ctia = false; | |
5127 | struct alc_spec *spec = codec->spec; | |
6b0f95c4 | 5128 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5129 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
5130 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref | |
5131 | conteol) */ | |
5132 | {} | |
5133 | }; | |
6b0f95c4 | 5134 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5135 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
5136 | {} | |
5137 | }; | |
6b0f95c4 | 5138 | static const struct coef_fw coef0298[] = { |
89542936 KY |
5139 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5140 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5141 | UPDATE_COEF(0x66, 0x0008, 0), | |
5142 | UPDATE_COEF(0x67, 0x2000, 0), | |
5143 | UPDATE_COEF(0x19, 0x1300, 0x1300), | |
5144 | {} | |
5145 | }; | |
6b0f95c4 | 5146 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5147 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
5148 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | |
5149 | {} | |
5150 | }; | |
6b0f95c4 | 5151 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5152 | WRITE_COEF(0x11, 0x0001), |
5153 | WRITE_COEF(0xb7, 0x802b), | |
5154 | WRITE_COEF(0x15, 0x0d60), | |
5155 | WRITE_COEF(0xc3, 0x0c00), | |
5156 | {} | |
5157 | }; | |
6b0f95c4 | 5158 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
5159 | UPDATE_COEF(0x4a, 0x0010, 0), |
5160 | UPDATE_COEF(0x4a, 0x8000, 0), | |
5161 | WRITE_COEF(0x45, 0xd289), | |
5162 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
5163 | {} | |
5164 | }; | |
73bdd597 | 5165 | |
7639a06c | 5166 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5167 | case 0x10ec0255: |
717f43d8 KY |
5168 | alc_process_coef_fw(codec, coef0255); |
5169 | msleep(300); | |
5170 | val = alc_read_coef_idx(codec, 0x46); | |
5171 | is_ctia = (val & 0x0070) == 0x0070; | |
5172 | break; | |
5173 | case 0x10ec0236: | |
7081adf3 | 5174 | case 0x10ec0256: |
717f43d8 KY |
5175 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
5176 | alc_write_coef_idx(codec, 0x06, 0x6104); | |
5177 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); | |
5178 | ||
5179 | snd_hda_codec_write(codec, 0x21, 0, | |
5180 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5181 | msleep(80); | |
5182 | snd_hda_codec_write(codec, 0x21, 0, | |
5183 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5184 | ||
54db6c39 | 5185 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
5186 | msleep(300); |
5187 | val = alc_read_coef_idx(codec, 0x46); | |
5188 | is_ctia = (val & 0x0070) == 0x0070; | |
717f43d8 KY |
5189 | |
5190 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); | |
5191 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5192 | ||
5193 | snd_hda_codec_write(codec, 0x21, 0, | |
5194 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5195 | msleep(80); | |
5196 | snd_hda_codec_write(codec, 0x21, 0, | |
5197 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
9a22a8f5 | 5198 | break; |
71683c32 KY |
5199 | case 0x10ec0234: |
5200 | case 0x10ec0274: | |
5201 | case 0x10ec0294: | |
5202 | alc_process_coef_fw(codec, coef0274); | |
5203 | msleep(80); | |
5204 | val = alc_read_coef_idx(codec, 0x46); | |
5205 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5206 | break; | |
13fd08a3 | 5207 | case 0x10ec0233: |
73bdd597 DH |
5208 | case 0x10ec0283: |
5209 | alc_write_coef_idx(codec, 0x45, 0xd029); | |
5210 | msleep(300); | |
5211 | val = alc_read_coef_idx(codec, 0x46); | |
5212 | is_ctia = (val & 0x0070) == 0x0070; | |
5213 | break; | |
1a5bc8d9 | 5214 | case 0x10ec0298: |
89542936 KY |
5215 | snd_hda_codec_write(codec, 0x21, 0, |
5216 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5217 | msleep(100); | |
5218 | snd_hda_codec_write(codec, 0x21, 0, | |
5219 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5220 | msleep(200); | |
5221 | ||
5222 | val = alc_read_coef_idx(codec, 0x50); | |
5223 | if (val & (1 << 12)) { | |
5224 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
5225 | alc_process_coef_fw(codec, coef0288); | |
5226 | msleep(350); | |
5227 | val = alc_read_coef_idx(codec, 0x50); | |
5228 | is_ctia = (val & 0x0070) == 0x0070; | |
5229 | } else { | |
5230 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
5231 | alc_process_coef_fw(codec, coef0288); | |
5232 | msleep(350); | |
5233 | val = alc_read_coef_idx(codec, 0x50); | |
5234 | is_ctia = (val & 0x0070) == 0x0070; | |
5235 | } | |
5236 | alc_process_coef_fw(codec, coef0298); | |
5237 | snd_hda_codec_write(codec, 0x21, 0, | |
5238 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); | |
5239 | msleep(75); | |
5240 | snd_hda_codec_write(codec, 0x21, 0, | |
5241 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
5242 | break; | |
f3b70332 KY |
5243 | case 0x10ec0286: |
5244 | case 0x10ec0288: | |
5245 | alc_process_coef_fw(codec, coef0288); | |
5246 | msleep(350); | |
5247 | val = alc_read_coef_idx(codec, 0x50); | |
5248 | is_ctia = (val & 0x0070) == 0x0070; | |
5249 | break; | |
73bdd597 DH |
5250 | case 0x10ec0292: |
5251 | alc_write_coef_idx(codec, 0x6b, 0xd429); | |
5252 | msleep(300); | |
5253 | val = alc_read_coef_idx(codec, 0x6c); | |
5254 | is_ctia = (val & 0x001c) == 0x001c; | |
5255 | break; | |
a22aa26f | 5256 | case 0x10ec0293: |
54db6c39 | 5257 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
5258 | msleep(300); |
5259 | val = alc_read_coef_idx(codec, 0x46); | |
5260 | is_ctia = (val & 0x0070) == 0x0070; | |
5261 | break; | |
73bdd597 | 5262 | case 0x10ec0668: |
54db6c39 | 5263 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
5264 | msleep(300); |
5265 | val = alc_read_coef_idx(codec, 0xbe); | |
5266 | is_ctia = (val & 0x1c02) == 0x1c02; | |
5267 | break; | |
c2b691ee | 5268 | case 0x10ec0215: |
4cc9b9d6 | 5269 | case 0x10ec0225: |
c2b691ee | 5270 | case 0x10ec0285: |
7d727869 | 5271 | case 0x10ec0295: |
c2b691ee | 5272 | case 0x10ec0289: |
28f1f9b2 | 5273 | case 0x10ec0299: |
da911b1f KY |
5274 | snd_hda_codec_write(codec, 0x21, 0, |
5275 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5276 | msleep(80); | |
5277 | snd_hda_codec_write(codec, 0x21, 0, | |
5278 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5279 | ||
5a36767a KY |
5280 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
5281 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); | |
5282 | val = alc_read_coef_idx(codec, 0x45); | |
5283 | if (val & (1 << 9)) { | |
5284 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5285 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); | |
5286 | msleep(800); | |
5287 | val = alc_read_coef_idx(codec, 0x46); | |
5288 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5289 | } else { | |
5290 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5291 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); | |
5292 | msleep(800); | |
5293 | val = alc_read_coef_idx(codec, 0x46); | |
5294 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5295 | } | |
5296 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); | |
5297 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); | |
5298 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
da911b1f KY |
5299 | |
5300 | snd_hda_codec_write(codec, 0x21, 0, | |
5301 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5302 | msleep(80); | |
5303 | snd_hda_codec_write(codec, 0x21, 0, | |
5304 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
4cc9b9d6 | 5305 | break; |
78f4f7c2 KY |
5306 | case 0x10ec0867: |
5307 | is_ctia = true; | |
5308 | break; | |
73bdd597 DH |
5309 | } |
5310 | ||
4e76a883 | 5311 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
73bdd597 DH |
5312 | is_ctia ? "yes" : "no"); |
5313 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; | |
5314 | } | |
5315 | ||
5316 | static void alc_update_headset_mode(struct hda_codec *codec) | |
5317 | { | |
5318 | struct alc_spec *spec = codec->spec; | |
5319 | ||
5320 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; | |
35a39f98 | 5321 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
73bdd597 DH |
5322 | |
5323 | int new_headset_mode; | |
5324 | ||
5325 | if (!snd_hda_jack_detect(codec, hp_pin)) | |
5326 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; | |
5327 | else if (mux_pin == spec->headset_mic_pin) | |
5328 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; | |
5329 | else if (mux_pin == spec->headphone_mic_pin) | |
5330 | new_headset_mode = ALC_HEADSET_MODE_MIC; | |
5331 | else | |
5332 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; | |
5333 | ||
5959a6bc DH |
5334 | if (new_headset_mode == spec->current_headset_mode) { |
5335 | snd_hda_gen_update_outputs(codec); | |
73bdd597 | 5336 | return; |
5959a6bc | 5337 | } |
73bdd597 DH |
5338 | |
5339 | switch (new_headset_mode) { | |
5340 | case ALC_HEADSET_MODE_UNPLUGGED: | |
5341 | alc_headset_mode_unplugged(codec); | |
aeac1a0d KY |
5342 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
5343 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
73bdd597 DH |
5344 | spec->gen.hp_jack_present = false; |
5345 | break; | |
5346 | case ALC_HEADSET_MODE_HEADSET: | |
5347 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) | |
5348 | alc_determine_headset_type(codec); | |
5349 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) | |
5350 | alc_headset_mode_ctia(codec); | |
5351 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) | |
5352 | alc_headset_mode_omtp(codec); | |
5353 | spec->gen.hp_jack_present = true; | |
5354 | break; | |
5355 | case ALC_HEADSET_MODE_MIC: | |
5356 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); | |
5357 | spec->gen.hp_jack_present = false; | |
5358 | break; | |
5359 | case ALC_HEADSET_MODE_HEADPHONE: | |
5360 | alc_headset_mode_default(codec); | |
5361 | spec->gen.hp_jack_present = true; | |
5362 | break; | |
5363 | } | |
5364 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { | |
5365 | snd_hda_set_pin_ctl_cache(codec, hp_pin, | |
5366 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); | |
1f8b46cd | 5367 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
73bdd597 DH |
5368 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
5369 | PIN_VREFHIZ); | |
5370 | } | |
5371 | spec->current_headset_mode = new_headset_mode; | |
5372 | ||
5373 | snd_hda_gen_update_outputs(codec); | |
5374 | } | |
5375 | ||
5376 | static void alc_update_headset_mode_hook(struct hda_codec *codec, | |
7fe30711 TI |
5377 | struct snd_kcontrol *kcontrol, |
5378 | struct snd_ctl_elem_value *ucontrol) | |
73bdd597 DH |
5379 | { |
5380 | alc_update_headset_mode(codec); | |
5381 | } | |
5382 | ||
1a4f69d5 TI |
5383 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
5384 | struct hda_jack_callback *jack) | |
73bdd597 | 5385 | { |
73bdd597 DH |
5386 | snd_hda_gen_hp_automute(codec, jack); |
5387 | } | |
5388 | ||
5389 | static void alc_probe_headset_mode(struct hda_codec *codec) | |
5390 | { | |
5391 | int i; | |
5392 | struct alc_spec *spec = codec->spec; | |
5393 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5394 | ||
5395 | /* Find mic pins */ | |
5396 | for (i = 0; i < cfg->num_inputs; i++) { | |
5397 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) | |
5398 | spec->headset_mic_pin = cfg->inputs[i].pin; | |
5399 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) | |
5400 | spec->headphone_mic_pin = cfg->inputs[i].pin; | |
5401 | } | |
5402 | ||
0bed2aa3 | 5403 | WARN_ON(spec->gen.cap_sync_hook); |
73bdd597 DH |
5404 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
5405 | spec->gen.automute_hook = alc_update_headset_mode; | |
5406 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; | |
5407 | } | |
5408 | ||
5409 | static void alc_fixup_headset_mode(struct hda_codec *codec, | |
5410 | const struct hda_fixup *fix, int action) | |
5411 | { | |
5412 | struct alc_spec *spec = codec->spec; | |
5413 | ||
5414 | switch (action) { | |
5415 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5416 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; | |
5417 | break; | |
5418 | case HDA_FIXUP_ACT_PROBE: | |
5419 | alc_probe_headset_mode(codec); | |
5420 | break; | |
5421 | case HDA_FIXUP_ACT_INIT: | |
aeac1a0d KY |
5422 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
5423 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; | |
5424 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
5425 | } | |
73bdd597 DH |
5426 | alc_update_headset_mode(codec); |
5427 | break; | |
5428 | } | |
5429 | } | |
5430 | ||
5431 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, | |
5432 | const struct hda_fixup *fix, int action) | |
5433 | { | |
5434 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5435 | struct alc_spec *spec = codec->spec; | |
5436 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5437 | } | |
5438 | else | |
5439 | alc_fixup_headset_mode(codec, fix, action); | |
5440 | } | |
5441 | ||
31278997 KY |
5442 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
5443 | { | |
5444 | /* Set to iphone type */ | |
6b0f95c4 | 5445 | static const struct coef_fw alc255fw[] = { |
54db6c39 TI |
5446 | WRITE_COEF(0x1b, 0x880b), |
5447 | WRITE_COEF(0x45, 0xd089), | |
5448 | WRITE_COEF(0x1b, 0x080b), | |
5449 | WRITE_COEF(0x46, 0x0004), | |
5450 | WRITE_COEF(0x1b, 0x0c0b), | |
5451 | {} | |
5452 | }; | |
6b0f95c4 | 5453 | static const struct coef_fw alc256fw[] = { |
e69e7e03 KY |
5454 | WRITE_COEF(0x1b, 0x884b), |
5455 | WRITE_COEF(0x45, 0xd089), | |
5456 | WRITE_COEF(0x1b, 0x084b), | |
5457 | WRITE_COEF(0x46, 0x0004), | |
5458 | WRITE_COEF(0x1b, 0x0c4b), | |
5459 | {} | |
5460 | }; | |
5461 | switch (codec->core.vendor_id) { | |
5462 | case 0x10ec0255: | |
5463 | alc_process_coef_fw(codec, alc255fw); | |
5464 | break; | |
736f20a7 | 5465 | case 0x10ec0236: |
e69e7e03 KY |
5466 | case 0x10ec0256: |
5467 | alc_process_coef_fw(codec, alc256fw); | |
5468 | break; | |
5469 | } | |
31278997 KY |
5470 | msleep(30); |
5471 | } | |
5472 | ||
9a22a8f5 KY |
5473 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
5474 | const struct hda_fixup *fix, int action) | |
5475 | { | |
5476 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
31278997 | 5477 | alc255_set_default_jack_type(codec); |
9a22a8f5 KY |
5478 | } |
5479 | alc_fixup_headset_mode(codec, fix, action); | |
5480 | } | |
5481 | ||
31278997 KY |
5482 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
5483 | const struct hda_fixup *fix, int action) | |
5484 | { | |
5485 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5486 | struct alc_spec *spec = codec->spec; | |
5487 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5488 | alc255_set_default_jack_type(codec); | |
5489 | } | |
5490 | else | |
5491 | alc_fixup_headset_mode(codec, fix, action); | |
5492 | } | |
5493 | ||
e1e62b98 KY |
5494 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
5495 | struct hda_jack_callback *jack) | |
5496 | { | |
5497 | struct alc_spec *spec = codec->spec; | |
e1e62b98 KY |
5498 | |
5499 | alc_update_headset_jack_cb(codec, jack); | |
5500 | /* Headset Mic enable or disable, only for Dell Dino */ | |
d44a6864 | 5501 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
e1e62b98 KY |
5502 | } |
5503 | ||
5504 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, | |
5505 | const struct hda_fixup *fix, int action) | |
5506 | { | |
5507 | alc_fixup_headset_mode(codec, fix, action); | |
5508 | if (action == HDA_FIXUP_ACT_PROBE) { | |
5509 | struct alc_spec *spec = codec->spec; | |
d44a6864 TI |
5510 | /* toggled via hp_automute_hook */ |
5511 | spec->gpio_mask |= 0x40; | |
5512 | spec->gpio_dir |= 0x40; | |
e1e62b98 KY |
5513 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
5514 | } | |
5515 | } | |
5516 | ||
493a52a9 HW |
5517 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
5518 | const struct hda_fixup *fix, int action) | |
5519 | { | |
5520 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5521 | struct alc_spec *spec = codec->spec; | |
5522 | spec->gen.auto_mute_via_amp = 1; | |
5523 | } | |
5524 | } | |
5525 | ||
9b745ab8 TI |
5526 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
5527 | const struct hda_fixup *fix, int action) | |
5528 | { | |
efe55732 | 5529 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9b745ab8 | 5530 | struct alc_spec *spec = codec->spec; |
c0ca5ece | 5531 | spec->no_shutup_pins = 1; |
9b745ab8 TI |
5532 | } |
5533 | } | |
5534 | ||
5e6db669 GM |
5535 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
5536 | const struct hda_fixup *fix, int action) | |
5537 | { | |
5538 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5539 | struct alc_spec *spec = codec->spec; | |
5540 | /* Disable AA-loopback as it causes white noise */ | |
5541 | spec->gen.mixer_nid = 0; | |
5542 | } | |
5543 | } | |
5544 | ||
7f57d803 TI |
5545 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
5546 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, | |
5547 | const struct hda_fixup *fix, int action) | |
5548 | { | |
5549 | static const struct hda_pintbl pincfgs[] = { | |
5550 | { 0x16, 0x21211010 }, /* dock headphone */ | |
5551 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5552 | { } | |
5553 | }; | |
5554 | struct alc_spec *spec = codec->spec; | |
5555 | ||
5556 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
871b9066 | 5557 | spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ |
7f57d803 TI |
5558 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
5559 | codec->power_save_node = 0; /* avoid click noises */ | |
5560 | snd_hda_apply_pincfgs(codec, pincfgs); | |
5561 | } | |
5562 | } | |
5563 | ||
61fcf8ec KY |
5564 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
5565 | const struct hda_fixup *fix, int action) | |
5566 | { | |
5567 | static const struct hda_pintbl pincfgs[] = { | |
5568 | { 0x17, 0x21211010 }, /* dock headphone */ | |
5569 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5570 | { } | |
5571 | }; | |
5572 | struct alc_spec *spec = codec->spec; | |
5573 | ||
5574 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5575 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
71db96dd TI |
5576 | snd_hda_apply_pincfgs(codec, pincfgs); |
5577 | } else if (action == HDA_FIXUP_ACT_INIT) { | |
61fcf8ec KY |
5578 | /* Enable DOCK device */ |
5579 | snd_hda_codec_write(codec, 0x17, 0, | |
5580 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
5581 | /* Enable DOCK device */ | |
5582 | snd_hda_codec_write(codec, 0x19, 0, | |
5583 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
61fcf8ec KY |
5584 | } |
5585 | } | |
5586 | ||
399c01aa TI |
5587 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
5588 | const struct hda_fixup *fix, int action) | |
5589 | { | |
5590 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise | |
5591 | * the speaker output becomes too low by some reason on Thinkpads with | |
5592 | * ALC298 codec | |
5593 | */ | |
5594 | static const hda_nid_t preferred_pairs[] = { | |
5595 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, | |
5596 | 0 | |
5597 | }; | |
5598 | struct alc_spec *spec = codec->spec; | |
5599 | ||
5600 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5601 | spec->gen.preferred_dacs = preferred_pairs; | |
5602 | } | |
5603 | ||
9476d369 | 5604 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
033b0a7c GM |
5605 | { |
5606 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 5607 | int hp_pin = alc_get_hp_pin(spec); |
033b0a7c | 5608 | |
9476d369 GM |
5609 | /* Prevent pop noises when headphones are plugged in */ |
5610 | snd_hda_codec_write(codec, hp_pin, 0, | |
5611 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5612 | msleep(20); | |
033b0a7c GM |
5613 | } |
5614 | ||
5615 | static void alc_fixup_dell_xps13(struct hda_codec *codec, | |
5616 | const struct hda_fixup *fix, int action) | |
5617 | { | |
3e1b0c4a TI |
5618 | struct alc_spec *spec = codec->spec; |
5619 | struct hda_input_mux *imux = &spec->gen.input_mux; | |
5620 | int i; | |
f38663ab | 5621 | |
3e1b0c4a TI |
5622 | switch (action) { |
5623 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5624 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise | |
5625 | * it causes a click noise at start up | |
5626 | */ | |
5627 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
efe55732 | 5628 | spec->shutup = alc_shutup_dell_xps13; |
3e1b0c4a TI |
5629 | break; |
5630 | case HDA_FIXUP_ACT_PROBE: | |
f38663ab GM |
5631 | /* Make the internal mic the default input source. */ |
5632 | for (i = 0; i < imux->num_items; i++) { | |
5633 | if (spec->gen.imux_pins[i] == 0x12) { | |
5634 | spec->gen.cur_mux[0] = i; | |
5635 | break; | |
5636 | } | |
5637 | } | |
3e1b0c4a | 5638 | break; |
033b0a7c GM |
5639 | } |
5640 | } | |
5641 | ||
1f8b46cd DH |
5642 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
5643 | const struct hda_fixup *fix, int action) | |
5644 | { | |
5645 | struct alc_spec *spec = codec->spec; | |
5646 | ||
5647 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5648 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5649 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ | |
b40eda64 DH |
5650 | |
5651 | /* Disable boost for mic-in permanently. (This code is only called | |
5652 | from quirks that guarantee that the headphone is at NID 0x1b.) */ | |
5653 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); | |
5654 | snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); | |
1f8b46cd DH |
5655 | } else |
5656 | alc_fixup_headset_mode(codec, fix, action); | |
5657 | } | |
5658 | ||
73bdd597 DH |
5659 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
5660 | const struct hda_fixup *fix, int action) | |
5661 | { | |
5662 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
73bdd597 | 5663 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
98b24883 | 5664 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
73bdd597 DH |
5665 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
5666 | } | |
5667 | alc_fixup_headset_mode(codec, fix, action); | |
5668 | } | |
5669 | ||
bde7bc60 CCC |
5670 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
5671 | static int find_ext_mic_pin(struct hda_codec *codec) | |
5672 | { | |
5673 | struct alc_spec *spec = codec->spec; | |
5674 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5675 | hda_nid_t nid; | |
5676 | unsigned int defcfg; | |
5677 | int i; | |
5678 | ||
5679 | for (i = 0; i < cfg->num_inputs; i++) { | |
5680 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5681 | continue; | |
5682 | nid = cfg->inputs[i].pin; | |
5683 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5684 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) | |
5685 | continue; | |
5686 | return nid; | |
5687 | } | |
5688 | ||
5689 | return 0; | |
5690 | } | |
5691 | ||
08a978db | 5692 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
1727a771 | 5693 | const struct hda_fixup *fix, |
08a978db DR |
5694 | int action) |
5695 | { | |
5696 | struct alc_spec *spec = codec->spec; | |
5697 | ||
0db75790 | 5698 | if (action == HDA_FIXUP_ACT_PROBE) { |
bde7bc60 | 5699 | int mic_pin = find_ext_mic_pin(codec); |
35a39f98 | 5700 | int hp_pin = alc_get_hp_pin(spec); |
bde7bc60 CCC |
5701 | |
5702 | if (snd_BUG_ON(!mic_pin || !hp_pin)) | |
0db75790 | 5703 | return; |
bde7bc60 | 5704 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
0db75790 | 5705 | } |
08a978db | 5706 | } |
693b613d | 5707 | |
3e0d611b DH |
5708 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
5709 | const struct hda_fixup *fix, | |
5710 | int action) | |
5711 | { | |
5712 | struct alc_spec *spec = codec->spec; | |
5713 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5714 | int i; | |
5715 | ||
5716 | /* The mic boosts on level 2 and 3 are too noisy | |
5717 | on the internal mic input. | |
5718 | Therefore limit the boost to 0 or 1. */ | |
5719 | ||
5720 | if (action != HDA_FIXUP_ACT_PROBE) | |
5721 | return; | |
5722 | ||
5723 | for (i = 0; i < cfg->num_inputs; i++) { | |
5724 | hda_nid_t nid = cfg->inputs[i].pin; | |
5725 | unsigned int defcfg; | |
5726 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5727 | continue; | |
5728 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5729 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) | |
5730 | continue; | |
5731 | ||
5732 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, | |
5733 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | | |
5734 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
5735 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
5736 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
5737 | } | |
5738 | } | |
5739 | ||
cd217a63 | 5740 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 5741 | struct hda_jack_callback *jack) |
cd217a63 KY |
5742 | { |
5743 | struct alc_spec *spec = codec->spec; | |
5744 | int vref; | |
5745 | ||
5746 | msleep(200); | |
5747 | snd_hda_gen_hp_automute(codec, jack); | |
5748 | ||
5749 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
5750 | ||
5751 | msleep(600); | |
5752 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
5753 | vref); | |
5754 | } | |
5755 | ||
cd217a63 KY |
5756 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
5757 | const struct hda_fixup *fix, int action) | |
5758 | { | |
5759 | struct alc_spec *spec = codec->spec; | |
cd217a63 KY |
5760 | |
5761 | switch (action) { | |
5762 | case HDA_FIXUP_ACT_PRE_PROBE: | |
0202e99c | 5763 | snd_hda_override_wcaps(codec, 0x03, 0); |
d2e92709 TI |
5764 | /* Disable AA-loopback as it causes white noise */ |
5765 | spec->gen.mixer_nid = 0; | |
38070219 | 5766 | break; |
0202e99c | 5767 | case HDA_FIXUP_ACT_INIT: |
de9481cb KY |
5768 | /* MIC2-VREF control */ |
5769 | /* Set to manual mode */ | |
98b24883 | 5770 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
0202e99c | 5771 | /* Enable Line1 input control by verb */ |
98b24883 | 5772 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
0202e99c KY |
5773 | break; |
5774 | } | |
5775 | } | |
5776 | ||
5777 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, | |
5778 | const struct hda_fixup *fix, int action) | |
5779 | { | |
5780 | struct alc_spec *spec = codec->spec; | |
0202e99c KY |
5781 | |
5782 | switch (action) { | |
5783 | case HDA_FIXUP_ACT_PRE_PROBE: | |
cd217a63 | 5784 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
38070219 KY |
5785 | break; |
5786 | case HDA_FIXUP_ACT_INIT: | |
cd217a63 KY |
5787 | /* MIC2-VREF control */ |
5788 | /* Set to manual mode */ | |
98b24883 | 5789 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
cd217a63 KY |
5790 | break; |
5791 | } | |
5792 | } | |
5793 | ||
7bba2157 TI |
5794 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
5795 | static void asus_tx300_automute(struct hda_codec *codec) | |
5796 | { | |
5797 | struct alc_spec *spec = codec->spec; | |
5798 | snd_hda_gen_update_outputs(codec); | |
5799 | if (snd_hda_jack_detect(codec, 0x1b)) | |
5800 | spec->gen.mute_bits |= (1ULL << 0x14); | |
5801 | } | |
5802 | ||
5803 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, | |
5804 | const struct hda_fixup *fix, int action) | |
5805 | { | |
5806 | struct alc_spec *spec = codec->spec; | |
7bba2157 TI |
5807 | static const struct hda_pintbl dock_pins[] = { |
5808 | { 0x1b, 0x21114000 }, /* dock speaker pin */ | |
5809 | {} | |
5810 | }; | |
7bba2157 TI |
5811 | |
5812 | switch (action) { | |
5813 | case HDA_FIXUP_ACT_PRE_PROBE: | |
1c76aa5f | 5814 | spec->init_amp = ALC_INIT_DEFAULT; |
ae065f1c TI |
5815 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
5816 | alc_setup_gpio(codec, 0x04); | |
7bba2157 TI |
5817 | snd_hda_apply_pincfgs(codec, dock_pins); |
5818 | spec->gen.auto_mute_via_amp = 1; | |
5819 | spec->gen.automute_hook = asus_tx300_automute; | |
5820 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
7bba2157 TI |
5821 | snd_hda_gen_hp_automute); |
5822 | break; | |
5579cd6f TI |
5823 | case HDA_FIXUP_ACT_PROBE: |
5824 | spec->init_amp = ALC_INIT_DEFAULT; | |
5825 | break; | |
7bba2157 TI |
5826 | case HDA_FIXUP_ACT_BUILD: |
5827 | /* this is a bit tricky; give more sane names for the main | |
5828 | * (tablet) speaker and the dock speaker, respectively | |
5829 | */ | |
56798e6b TI |
5830 | rename_ctl(codec, "Speaker Playback Switch", |
5831 | "Dock Speaker Playback Switch"); | |
5832 | rename_ctl(codec, "Bass Speaker Playback Switch", | |
5833 | "Speaker Playback Switch"); | |
7bba2157 TI |
5834 | break; |
5835 | } | |
5836 | } | |
5837 | ||
338cae56 DH |
5838 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
5839 | const struct hda_fixup *fix, int action) | |
5840 | { | |
0f4881dc DH |
5841 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
5842 | /* DAC node 0x03 is giving mono output. We therefore want to | |
5843 | make sure 0x14 (front speaker) and 0x15 (headphones) use the | |
5844 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ | |
caf3c043 MM |
5845 | static const hda_nid_t conn1[] = { 0x0c }; |
5846 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
5847 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
0f4881dc | 5848 | } |
338cae56 DH |
5849 | } |
5850 | ||
dd9aa335 HW |
5851 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
5852 | const struct hda_fixup *fix, int action) | |
5853 | { | |
5854 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5855 | /* The speaker is routed to the Node 0x06 by a mistake, as a result | |
5856 | we can't adjust the speaker's volume since this node does not has | |
5857 | Amp-out capability. we change the speaker's route to: | |
5858 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( | |
5859 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust | |
5860 | speaker's volume now. */ | |
5861 | ||
caf3c043 MM |
5862 | static const hda_nid_t conn1[] = { 0x0c }; |
5863 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); | |
dd9aa335 HW |
5864 | } |
5865 | } | |
5866 | ||
e312a869 TI |
5867 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
5868 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, | |
5869 | const struct hda_fixup *fix, int action) | |
5870 | { | |
5871 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
5872 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
5873 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
e312a869 TI |
5874 | } |
5875 | } | |
5876 | ||
d2cd795c JK |
5877 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
5878 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, | |
5879 | const struct hda_fixup *fix, int action) | |
5880 | { | |
5881 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
5882 | static const hda_nid_t conn[] = { 0x02 }; |
5883 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
d2cd795c JK |
5884 | } |
5885 | } | |
5886 | ||
98973f2f KP |
5887 | /* Hook to update amp GPIO4 for automute */ |
5888 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, | |
5889 | struct hda_jack_callback *jack) | |
5890 | { | |
5891 | struct alc_spec *spec = codec->spec; | |
5892 | ||
5893 | snd_hda_gen_hp_automute(codec, jack); | |
5894 | /* mute_led_polarity is set to 0, so we pass inverted value here */ | |
dbd13179 KHF |
5895 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
5896 | !spec->gen.hp_jack_present); | |
98973f2f KP |
5897 | } |
5898 | ||
5899 | /* Manage GPIOs for HP EliteBook Folio 9480m. | |
5900 | * | |
5901 | * GPIO4 is the headphone amplifier power control | |
5902 | * GPIO3 is the audio output mute indicator LED | |
5903 | */ | |
5904 | ||
5905 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, | |
5906 | const struct hda_fixup *fix, | |
5907 | int action) | |
5908 | { | |
5909 | struct alc_spec *spec = codec->spec; | |
98973f2f | 5910 | |
01e4a275 | 5911 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
98973f2f | 5912 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
5913 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
5914 | spec->gpio_mask |= 0x10; | |
5915 | spec->gpio_dir |= 0x10; | |
98973f2f | 5916 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
98973f2f KP |
5917 | } |
5918 | } | |
5919 | ||
ae065f1c TI |
5920 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
5921 | const struct hda_fixup *fix, | |
5922 | int action) | |
5923 | { | |
5924 | struct alc_spec *spec = codec->spec; | |
5925 | ||
5926 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5927 | spec->gpio_mask |= 0x04; | |
5928 | spec->gpio_dir |= 0x04; | |
5929 | /* set data bit low */ | |
5930 | } | |
5931 | } | |
5932 | ||
6a6660d0 TI |
5933 | /* Quirk for Thinkpad X1 7th and 8th Gen |
5934 | * The following fixed routing needed | |
5935 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly | |
5936 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC | |
5937 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp | |
5938 | */ | |
5939 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, | |
5940 | const struct hda_fixup *fix, int action) | |
5941 | { | |
5942 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ | |
5943 | static const hda_nid_t preferred_pairs[] = { | |
5944 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 | |
5945 | }; | |
5946 | struct alc_spec *spec = codec->spec; | |
5947 | ||
5948 | switch (action) { | |
5949 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5950 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
5951 | spec->gen.preferred_dacs = preferred_pairs; | |
5952 | break; | |
5953 | case HDA_FIXUP_ACT_BUILD: | |
5954 | /* The generic parser creates somewhat unintuitive volume ctls | |
5955 | * with the fixed routing above, and the shared DAC2 may be | |
5956 | * confusing for PA. | |
5957 | * Rename those to unique names so that PA doesn't touch them | |
5958 | * and use only Master volume. | |
5959 | */ | |
5960 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); | |
5961 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); | |
5962 | break; | |
5963 | } | |
5964 | } | |
5965 | ||
ca169cc2 KY |
5966 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
5967 | const struct hda_fixup *fix, | |
5968 | int action) | |
5969 | { | |
5970 | alc_fixup_dual_codecs(codec, fix, action); | |
5971 | switch (action) { | |
5972 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5973 | /* override card longname to provide a unique UCM profile */ | |
5974 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); | |
5975 | break; | |
5976 | case HDA_FIXUP_ACT_BUILD: | |
5977 | /* rename Capture controls depending on the codec */ | |
5978 | rename_ctl(codec, "Capture Volume", | |
5979 | codec->addr == 0 ? | |
5980 | "Rear-Panel Capture Volume" : | |
5981 | "Front-Panel Capture Volume"); | |
5982 | rename_ctl(codec, "Capture Switch", | |
5983 | codec->addr == 0 ? | |
5984 | "Rear-Panel Capture Switch" : | |
5985 | "Front-Panel Capture Switch"); | |
5986 | break; | |
5987 | } | |
5988 | } | |
5989 | ||
52e4e368 KHF |
5990 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
5991 | const struct hda_fixup *fix, int action) | |
5992 | { | |
5993 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
5994 | return; | |
5995 | ||
5996 | codec->power_save_node = 1; | |
5997 | } | |
5998 | ||
92266651 KY |
5999 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
6000 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |
6001 | const struct hda_fixup *fix, int action) | |
6002 | { | |
6003 | struct alc_spec *spec = codec->spec; | |
caf3c043 | 6004 | static const hda_nid_t preferred_pairs[] = { |
92266651 KY |
6005 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
6006 | 0 | |
6007 | }; | |
6008 | ||
6009 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6010 | return; | |
6011 | ||
6012 | spec->gen.preferred_dacs = preferred_pairs; | |
0700d3d1 KY |
6013 | spec->gen.auto_mute_via_amp = 1; |
6014 | codec->power_save_node = 0; | |
92266651 KY |
6015 | } |
6016 | ||
c4cfcf6f HW |
6017 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
6018 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, | |
6019 | const struct hda_fixup *fix, int action) | |
6020 | { | |
6021 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6022 | return; | |
6023 | ||
6024 | snd_hda_override_wcaps(codec, 0x03, 0); | |
6025 | } | |
6026 | ||
8a8de09c KY |
6027 | static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) |
6028 | { | |
6029 | switch (codec->core.vendor_id) { | |
6030 | case 0x10ec0274: | |
6031 | case 0x10ec0294: | |
6032 | case 0x10ec0225: | |
6033 | case 0x10ec0295: | |
6034 | case 0x10ec0299: | |
6035 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ | |
6036 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); | |
6037 | break; | |
6038 | case 0x10ec0235: | |
6039 | case 0x10ec0236: | |
6040 | case 0x10ec0255: | |
6041 | case 0x10ec0256: | |
6042 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ | |
6043 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); | |
6044 | break; | |
6045 | } | |
6046 | } | |
6047 | ||
8983eb60 KY |
6048 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
6049 | const struct hda_fixup *fix, int action) | |
6050 | { | |
d3ba58bb KY |
6051 | struct alc_spec *spec = codec->spec; |
6052 | ||
8983eb60 | 6053 | switch (action) { |
d3ba58bb KY |
6054 | case HDA_FIXUP_ACT_PRE_PROBE: |
6055 | spec->ultra_low_power = true; | |
6056 | break; | |
8983eb60 | 6057 | case HDA_FIXUP_ACT_INIT: |
8a8de09c | 6058 | alc_combo_jack_hp_jd_restart(codec); |
8983eb60 KY |
6059 | break; |
6060 | } | |
6061 | } | |
6062 | ||
d1dd4211 KY |
6063 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
6064 | const struct hda_fixup *fix, int action) | |
6065 | { | |
6066 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
6067 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
6068 | } | |
6069 | ||
c3cdf189 LJ |
6070 | |
6071 | static void alc294_gx502_toggle_output(struct hda_codec *codec, | |
6072 | struct hda_jack_callback *cb) | |
6073 | { | |
6074 | /* The Windows driver sets the codec up in a very different way where | |
6075 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it | |
6076 | */ | |
6077 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) | |
6078 | alc_write_coef_idx(codec, 0x10, 0x8a20); | |
6079 | else | |
6080 | alc_write_coef_idx(codec, 0x10, 0x0a20); | |
6081 | } | |
6082 | ||
6083 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, | |
6084 | const struct hda_fixup *fix, int action) | |
6085 | { | |
6086 | /* Pin 0x21: headphones/headset mic */ | |
6087 | if (!is_jack_detectable(codec, 0x21)) | |
6088 | return; | |
6089 | ||
6090 | switch (action) { | |
6091 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6092 | snd_hda_jack_detect_enable_callback(codec, 0x21, | |
6093 | alc294_gx502_toggle_output); | |
6094 | break; | |
6095 | case HDA_FIXUP_ACT_INIT: | |
6096 | /* Make sure to start in a correct state, i.e. if | |
6097 | * headphones have been plugged in before powering up the system | |
6098 | */ | |
6099 | alc294_gx502_toggle_output(codec, NULL); | |
6100 | break; | |
6101 | } | |
6102 | } | |
6103 | ||
56496253 KY |
6104 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
6105 | const struct hda_fixup *fix, int action) | |
6106 | { | |
6107 | if (action != HDA_FIXUP_ACT_INIT) | |
6108 | return; | |
6109 | ||
6110 | msleep(100); | |
6111 | alc_write_coef_idx(codec, 0x65, 0x0); | |
6112 | } | |
6113 | ||
8a8de09c KY |
6114 | static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, |
6115 | const struct hda_fixup *fix, int action) | |
6116 | { | |
6117 | switch (action) { | |
6118 | case HDA_FIXUP_ACT_INIT: | |
6119 | alc_combo_jack_hp_jd_restart(codec); | |
6120 | break; | |
6121 | } | |
6122 | } | |
6123 | ||
b317b032 TI |
6124 | /* for hda_fixup_thinkpad_acpi() */ |
6125 | #include "thinkpad_helper.c" | |
b67ae3f1 | 6126 | |
d5a6cabf TI |
6127 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
6128 | const struct hda_fixup *fix, int action) | |
6129 | { | |
6130 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ | |
6131 | hda_fixup_thinkpad_acpi(codec, fix, action); | |
6132 | } | |
6133 | ||
bbf8ff6b TB |
6134 | /* for alc295_fixup_hp_top_speakers */ |
6135 | #include "hp_x360_helper.c" | |
6136 | ||
1d045db9 | 6137 | enum { |
f73bbf63 | 6138 | ALC269_FIXUP_GPIO2, |
1d045db9 TI |
6139 | ALC269_FIXUP_SONY_VAIO, |
6140 | ALC275_FIXUP_SONY_VAIO_GPIO2, | |
6141 | ALC269_FIXUP_DELL_M101Z, | |
6142 | ALC269_FIXUP_SKU_IGNORE, | |
6143 | ALC269_FIXUP_ASUS_G73JW, | |
6144 | ALC269_FIXUP_LENOVO_EAPD, | |
6145 | ALC275_FIXUP_SONY_HWEQ, | |
e9bd7d5c | 6146 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
1d045db9 | 6147 | ALC271_FIXUP_DMIC, |
017f2a10 | 6148 | ALC269_FIXUP_PCM_44K, |
adabb3ec | 6149 | ALC269_FIXUP_STEREO_DMIC, |
7c478f03 | 6150 | ALC269_FIXUP_HEADSET_MIC, |
24519911 TI |
6151 | ALC269_FIXUP_QUANTA_MUTE, |
6152 | ALC269_FIXUP_LIFEBOOK, | |
2041d564 | 6153 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
cc7016ab | 6154 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
4df3fd17 | 6155 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
fdcc968a | 6156 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
a4297b5d TI |
6157 | ALC269_FIXUP_AMIC, |
6158 | ALC269_FIXUP_DMIC, | |
6159 | ALC269VB_FIXUP_AMIC, | |
6160 | ALC269VB_FIXUP_DMIC, | |
08fb0d0e | 6161 | ALC269_FIXUP_HP_MUTE_LED, |
d06ac143 | 6162 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
08fb0d0e | 6163 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
7f783bd5 | 6164 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
9f5c6faf | 6165 | ALC269_FIXUP_HP_GPIO_LED, |
9c5dc3bf KY |
6166 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
6167 | ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
693b613d | 6168 | ALC269_FIXUP_INV_DMIC, |
108cc108 | 6169 | ALC269_FIXUP_LENOVO_DOCK, |
b590b38c | 6170 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
9b745ab8 | 6171 | ALC269_FIXUP_NO_SHUTUP, |
88cfcf86 | 6172 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
108cc108 | 6173 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
73bdd597 DH |
6174 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
6175 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, | |
338cae56 | 6176 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
fcc6c877 | 6177 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
73bdd597 DH |
6178 | ALC269_FIXUP_HEADSET_MODE, |
6179 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | |
7819717b | 6180 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
d240d1dc DH |
6181 | ALC269_FIXUP_ASUS_X101_FUNC, |
6182 | ALC269_FIXUP_ASUS_X101_VERB, | |
6183 | ALC269_FIXUP_ASUS_X101, | |
08a978db DR |
6184 | ALC271_FIXUP_AMIC_MIC2, |
6185 | ALC271_FIXUP_HP_GATE_MIC_JACK, | |
b1e8972e | 6186 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
42397004 | 6187 | ALC269_FIXUP_ACER_AC700, |
3e0d611b | 6188 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
2cede303 | 6189 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
23870831 | 6190 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
8e35cd4a | 6191 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
02b504d9 | 6192 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
cd217a63 | 6193 | ALC283_FIXUP_CHROME_BOOK, |
0202e99c | 6194 | ALC283_FIXUP_SENSE_COMBO_JACK, |
7bba2157 | 6195 | ALC282_FIXUP_ASUS_TX300, |
1bb3e062 | 6196 | ALC283_FIXUP_INT_MIC, |
338cae56 | 6197 | ALC290_FIXUP_MONO_SPEAKERS, |
0f4881dc DH |
6198 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
6199 | ALC290_FIXUP_SUBWOOFER, | |
6200 | ALC290_FIXUP_SUBWOOFER_HSJACK, | |
b67ae3f1 | 6201 | ALC269_FIXUP_THINKPAD_ACPI, |
56f27013 | 6202 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
5824ce8d | 6203 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
615966ad | 6204 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
9a22a8f5 | 6205 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
31278997 | 6206 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
9a22a8f5 | 6207 | ALC255_FIXUP_HEADSET_MODE, |
31278997 | 6208 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
a22aa26f | 6209 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
1c37c223 | 6210 | ALC292_FIXUP_TPT440_DOCK, |
9a811230 | 6211 | ALC292_FIXUP_TPT440, |
abaa2274 | 6212 | ALC283_FIXUP_HEADSET_MIC, |
b3802783 | 6213 | ALC255_FIXUP_MIC_MUTE_LED, |
1a22e775 | 6214 | ALC282_FIXUP_ASPIRE_V5_PINS, |
7a5255f1 | 6215 | ALC280_FIXUP_HP_GPIO4, |
eaa8e5ef | 6216 | ALC286_FIXUP_HP_GPIO_LED, |
33f4acd3 | 6217 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
b4b33f9d | 6218 | ALC280_FIXUP_HP_DOCK_PINS, |
04d5466a | 6219 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
98973f2f | 6220 | ALC280_FIXUP_HP_9480M, |
e1e62b98 KY |
6221 | ALC288_FIXUP_DELL_HEADSET_MODE, |
6222 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, | |
831bfdf9 HW |
6223 | ALC288_FIXUP_DELL_XPS_13, |
6224 | ALC288_FIXUP_DISABLE_AAMIX, | |
5fab5829 | 6225 | ALC292_FIXUP_DELL_E7X_AAMIX, |
8b99aba7 TI |
6226 | ALC292_FIXUP_DELL_E7X, |
6227 | ALC292_FIXUP_DISABLE_AAMIX, | |
c04017ea | 6228 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
54324221 | 6229 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
977e6276 | 6230 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
2f726aec | 6231 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
6ed1131f | 6232 | ALC275_FIXUP_DELL_XPS, |
23adc192 | 6233 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
3694cb29 | 6234 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
3b43b71f | 6235 | ALC255_FIXUP_DELL_SPK_NOISE, |
d1dd4211 | 6236 | ALC225_FIXUP_DISABLE_MIC_VREF, |
2ae95577 | 6237 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
e312a869 | 6238 | ALC295_FIXUP_DISABLE_DAC3, |
d2cd795c | 6239 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
f883982d | 6240 | ALC280_FIXUP_HP_HEADSET_MIC, |
e549d190 | 6241 | ALC221_FIXUP_HP_FRONT_MIC, |
c636b95e | 6242 | ALC292_FIXUP_TPT460, |
dd9aa335 | 6243 | ALC298_FIXUP_SPK_VOLUME, |
fd06c77e | 6244 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
823ff161 | 6245 | ALC269_FIXUP_ATIV_BOOK_8, |
9eb5d0e6 | 6246 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
c1732ede CC |
6247 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
6248 | ALC256_FIXUP_ASUS_MIC, | |
eeed4cd1 | 6249 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
216d7aeb CC |
6250 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
6251 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, | |
ca169cc2 | 6252 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
ea5c7eba | 6253 | ALC233_FIXUP_ACER_HEADSET_MIC, |
f33f79f3 | 6254 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
5f364135 | 6255 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
52e4e368 | 6256 | ALC225_FIXUP_S3_POP_NOISE, |
b84e8436 | 6257 | ALC700_FIXUP_INTEL_REFERENCE, |
92266651 KY |
6258 | ALC274_FIXUP_DELL_BIND_DACS, |
6259 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, | |
399c01aa | 6260 | ALC298_FIXUP_TPT470_DOCK_FIX, |
61fcf8ec | 6261 | ALC298_FIXUP_TPT470_DOCK, |
ae104a21 | 6262 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
f0ba9d69 | 6263 | ALC255_FIXUP_DELL_HEADSET_MIC, |
0fbf21c3 | 6264 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
a2ef03fe | 6265 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
bbf8ff6b | 6266 | ALC295_FIXUP_HP_X360, |
8a328ac1 | 6267 | ALC221_FIXUP_HP_HEADSET_MIC, |
c4cfcf6f | 6268 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
e8ed64b0 | 6269 | ALC295_FIXUP_HP_AUTO_MUTE, |
33aaebd4 | 6270 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
d8ae458e | 6271 | ALC294_FIXUP_ASUS_MIC, |
4e051106 JHP |
6272 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
6273 | ALC294_FIXUP_ASUS_SPK, | |
89e3a568 | 6274 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
c8c6ee61 | 6275 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
cbc05fd6 | 6276 | ALC255_FIXUP_ACER_HEADSET_MIC, |
10f5b1b8 | 6277 | ALC295_FIXUP_CHROME_BOOK, |
8983eb60 | 6278 | ALC225_FIXUP_HEADSET_JACK, |
136824ef KY |
6279 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
6280 | ALC225_FIXUP_WYSE_AUTO_MUTE, | |
6281 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | |
667a8f73 | 6282 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
8c8967a7 | 6283 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
e1037354 | 6284 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
e2a829b3 | 6285 | ALC299_FIXUP_PREDATOR_SPK, |
bd9c10bc | 6286 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
e79c2269 KY |
6287 | ALC289_FIXUP_DELL_SPK2, |
6288 | ALC289_FIXUP_DUAL_SPK, | |
48e01504 CC |
6289 | ALC294_FIXUP_SPK2_TO_DAC1, |
6290 | ALC294_FIXUP_ASUS_DUAL_SPK, | |
6a6660d0 | 6291 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
76f7dec0 | 6292 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
8b33a134 | 6293 | ALC294_FIXUP_ASUS_HPE, |
1b94e59d | 6294 | ALC294_FIXUP_ASUS_COEF_1B, |
c3cdf189 LJ |
6295 | ALC294_FIXUP_ASUS_GX502_HP, |
6296 | ALC294_FIXUP_ASUS_GX502_PINS, | |
6297 | ALC294_FIXUP_ASUS_GX502_VERBS, | |
f5a88b0a | 6298 | ALC285_FIXUP_HP_GPIO_LED, |
431e76c3 | 6299 | ALC285_FIXUP_HP_MUTE_LED, |
24164f43 | 6300 | ALC236_FIXUP_HP_MUTE_LED, |
14425f1f | 6301 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
9e43342b | 6302 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
8eae7e9b | 6303 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
6e15d126 | 6304 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
781c90c0 | 6305 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
293a92c1 | 6306 | ALC289_FIXUP_ASUS_GA401, |
4b43d05a | 6307 | ALC289_FIXUP_ASUS_GA502, |
f50a121d | 6308 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
56496253 | 6309 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
f1ec5be1 HC |
6310 | ALC269_FIXUP_CZC_B20, |
6311 | ALC269_FIXUP_CZC_TMI, | |
6312 | ALC269_FIXUP_CZC_L101, | |
6313 | ALC269_FIXUP_LEMOTE_A1802, | |
6314 | ALC269_FIXUP_LEMOTE_A190X, | |
e2d2fded | 6315 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
fc19d559 | 6316 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
13468bfa | 6317 | ALC274_FIXUP_HP_MIC, |
8a8de09c | 6318 | ALC274_FIXUP_HP_HEADSET_MIC, |
ef9ce66f | 6319 | ALC256_FIXUP_ASUS_HPE, |
446b8185 | 6320 | ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
a0ccbc53 | 6321 | ALC287_FIXUP_HP_GPIO_LED, |
f1d4e28b KY |
6322 | }; |
6323 | ||
1727a771 | 6324 | static const struct hda_fixup alc269_fixups[] = { |
f73bbf63 KHF |
6325 | [ALC269_FIXUP_GPIO2] = { |
6326 | .type = HDA_FIXUP_FUNC, | |
6327 | .v.func = alc_fixup_gpio2, | |
6328 | }, | |
1d045db9 | 6329 | [ALC269_FIXUP_SONY_VAIO] = { |
fd108215 TI |
6330 | .type = HDA_FIXUP_PINCTLS, |
6331 | .v.pins = (const struct hda_pintbl[]) { | |
6332 | {0x19, PIN_VREFGRD}, | |
1d045db9 TI |
6333 | {} |
6334 | } | |
f1d4e28b | 6335 | }, |
1d045db9 | 6336 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
ae065f1c TI |
6337 | .type = HDA_FIXUP_FUNC, |
6338 | .v.func = alc275_fixup_gpio4_off, | |
1d045db9 TI |
6339 | .chained = true, |
6340 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6341 | }, | |
6342 | [ALC269_FIXUP_DELL_M101Z] = { | |
1727a771 | 6343 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6344 | .v.verbs = (const struct hda_verb[]) { |
6345 | /* Enables internal speaker */ | |
6346 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | |
6347 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | |
6348 | {} | |
6349 | } | |
6350 | }, | |
6351 | [ALC269_FIXUP_SKU_IGNORE] = { | |
1727a771 | 6352 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 6353 | .v.func = alc_fixup_sku_ignore, |
1d045db9 TI |
6354 | }, |
6355 | [ALC269_FIXUP_ASUS_G73JW] = { | |
1727a771 TI |
6356 | .type = HDA_FIXUP_PINS, |
6357 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
6358 | { 0x17, 0x99130111 }, /* subwoofer */ |
6359 | { } | |
6360 | } | |
6361 | }, | |
6362 | [ALC269_FIXUP_LENOVO_EAPD] = { | |
1727a771 | 6363 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6364 | .v.verbs = (const struct hda_verb[]) { |
6365 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
6366 | {} | |
6367 | } | |
6368 | }, | |
6369 | [ALC275_FIXUP_SONY_HWEQ] = { | |
1727a771 | 6370 | .type = HDA_FIXUP_FUNC, |
1d045db9 TI |
6371 | .v.func = alc269_fixup_hweq, |
6372 | .chained = true, | |
6373 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 | |
6374 | }, | |
e9bd7d5c TI |
6375 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
6376 | .type = HDA_FIXUP_FUNC, | |
6377 | .v.func = alc_fixup_disable_aamix, | |
6378 | .chained = true, | |
6379 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6380 | }, | |
1d045db9 | 6381 | [ALC271_FIXUP_DMIC] = { |
1727a771 | 6382 | .type = HDA_FIXUP_FUNC, |
1d045db9 | 6383 | .v.func = alc271_fixup_dmic, |
f1d4e28b | 6384 | }, |
017f2a10 | 6385 | [ALC269_FIXUP_PCM_44K] = { |
1727a771 | 6386 | .type = HDA_FIXUP_FUNC, |
017f2a10 | 6387 | .v.func = alc269_fixup_pcm_44k, |
012e7eb1 DH |
6388 | .chained = true, |
6389 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
017f2a10 | 6390 | }, |
adabb3ec | 6391 | [ALC269_FIXUP_STEREO_DMIC] = { |
1727a771 | 6392 | .type = HDA_FIXUP_FUNC, |
adabb3ec TI |
6393 | .v.func = alc269_fixup_stereo_dmic, |
6394 | }, | |
7c478f03 DH |
6395 | [ALC269_FIXUP_HEADSET_MIC] = { |
6396 | .type = HDA_FIXUP_FUNC, | |
6397 | .v.func = alc269_fixup_headset_mic, | |
6398 | }, | |
24519911 | 6399 | [ALC269_FIXUP_QUANTA_MUTE] = { |
1727a771 | 6400 | .type = HDA_FIXUP_FUNC, |
24519911 TI |
6401 | .v.func = alc269_fixup_quanta_mute, |
6402 | }, | |
6403 | [ALC269_FIXUP_LIFEBOOK] = { | |
1727a771 TI |
6404 | .type = HDA_FIXUP_PINS, |
6405 | .v.pins = (const struct hda_pintbl[]) { | |
24519911 TI |
6406 | { 0x1a, 0x2101103f }, /* dock line-out */ |
6407 | { 0x1b, 0x23a11040 }, /* dock mic-in */ | |
6408 | { } | |
6409 | }, | |
6410 | .chained = true, | |
6411 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
6412 | }, | |
2041d564 DH |
6413 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
6414 | .type = HDA_FIXUP_PINS, | |
6415 | .v.pins = (const struct hda_pintbl[]) { | |
6416 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ | |
6417 | { } | |
6418 | }, | |
6419 | }, | |
cc7016ab TI |
6420 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
6421 | .type = HDA_FIXUP_PINS, | |
6422 | .v.pins = (const struct hda_pintbl[]) { | |
6423 | { 0x21, 0x0221102f }, /* HP out */ | |
6424 | { } | |
6425 | }, | |
6426 | }, | |
4df3fd17 TI |
6427 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
6428 | .type = HDA_FIXUP_FUNC, | |
6429 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, | |
6430 | }, | |
fdcc968a JMG |
6431 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
6432 | .type = HDA_FIXUP_FUNC, | |
6433 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, | |
6434 | }, | |
a4297b5d | 6435 | [ALC269_FIXUP_AMIC] = { |
1727a771 TI |
6436 | .type = HDA_FIXUP_PINS, |
6437 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6438 | { 0x14, 0x99130110 }, /* speaker */ |
6439 | { 0x15, 0x0121401f }, /* HP out */ | |
6440 | { 0x18, 0x01a19c20 }, /* mic */ | |
6441 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6442 | { } | |
6443 | }, | |
6444 | }, | |
6445 | [ALC269_FIXUP_DMIC] = { | |
1727a771 TI |
6446 | .type = HDA_FIXUP_PINS, |
6447 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6448 | { 0x12, 0x99a3092f }, /* int-mic */ |
6449 | { 0x14, 0x99130110 }, /* speaker */ | |
6450 | { 0x15, 0x0121401f }, /* HP out */ | |
6451 | { 0x18, 0x01a19c20 }, /* mic */ | |
6452 | { } | |
6453 | }, | |
6454 | }, | |
6455 | [ALC269VB_FIXUP_AMIC] = { | |
1727a771 TI |
6456 | .type = HDA_FIXUP_PINS, |
6457 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6458 | { 0x14, 0x99130110 }, /* speaker */ |
6459 | { 0x18, 0x01a19c20 }, /* mic */ | |
6460 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6461 | { 0x21, 0x0121401f }, /* HP out */ | |
6462 | { } | |
6463 | }, | |
6464 | }, | |
2267ea97 | 6465 | [ALC269VB_FIXUP_DMIC] = { |
1727a771 TI |
6466 | .type = HDA_FIXUP_PINS, |
6467 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6468 | { 0x12, 0x99a3092f }, /* int-mic */ |
6469 | { 0x14, 0x99130110 }, /* speaker */ | |
6470 | { 0x18, 0x01a19c20 }, /* mic */ | |
6471 | { 0x21, 0x0121401f }, /* HP out */ | |
6472 | { } | |
6473 | }, | |
6474 | }, | |
08fb0d0e | 6475 | [ALC269_FIXUP_HP_MUTE_LED] = { |
1727a771 | 6476 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6477 | .v.func = alc269_fixup_hp_mute_led, |
6d3cd5d4 | 6478 | }, |
d06ac143 DH |
6479 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
6480 | .type = HDA_FIXUP_FUNC, | |
6481 | .v.func = alc269_fixup_hp_mute_led_mic1, | |
6482 | }, | |
08fb0d0e | 6483 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
1727a771 | 6484 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6485 | .v.func = alc269_fixup_hp_mute_led_mic2, |
420b0feb | 6486 | }, |
7f783bd5 TB |
6487 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
6488 | .type = HDA_FIXUP_FUNC, | |
6489 | .v.func = alc269_fixup_hp_mute_led_mic3, | |
e8ed64b0 GKK |
6490 | .chained = true, |
6491 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE | |
7f783bd5 | 6492 | }, |
9f5c6faf TI |
6493 | [ALC269_FIXUP_HP_GPIO_LED] = { |
6494 | .type = HDA_FIXUP_FUNC, | |
6495 | .v.func = alc269_fixup_hp_gpio_led, | |
6496 | }, | |
9c5dc3bf KY |
6497 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
6498 | .type = HDA_FIXUP_FUNC, | |
6499 | .v.func = alc269_fixup_hp_gpio_mic1_led, | |
6500 | }, | |
6501 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { | |
6502 | .type = HDA_FIXUP_FUNC, | |
6503 | .v.func = alc269_fixup_hp_line1_mic1_led, | |
6504 | }, | |
693b613d | 6505 | [ALC269_FIXUP_INV_DMIC] = { |
1727a771 | 6506 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 6507 | .v.func = alc_fixup_inv_dmic, |
693b613d | 6508 | }, |
9b745ab8 TI |
6509 | [ALC269_FIXUP_NO_SHUTUP] = { |
6510 | .type = HDA_FIXUP_FUNC, | |
6511 | .v.func = alc_fixup_no_shutup, | |
6512 | }, | |
108cc108 | 6513 | [ALC269_FIXUP_LENOVO_DOCK] = { |
1727a771 TI |
6514 | .type = HDA_FIXUP_PINS, |
6515 | .v.pins = (const struct hda_pintbl[]) { | |
108cc108 DH |
6516 | { 0x19, 0x23a11040 }, /* dock mic */ |
6517 | { 0x1b, 0x2121103f }, /* dock headphone */ | |
6518 | { } | |
6519 | }, | |
6520 | .chained = true, | |
6521 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT | |
6522 | }, | |
b590b38c TI |
6523 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
6524 | .type = HDA_FIXUP_FUNC, | |
6525 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6526 | .chained = true, | |
6527 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, | |
6528 | }, | |
108cc108 | 6529 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
1727a771 | 6530 | .type = HDA_FIXUP_FUNC, |
108cc108 | 6531 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
52129000 DH |
6532 | .chained = true, |
6533 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
108cc108 | 6534 | }, |
73bdd597 DH |
6535 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6536 | .type = HDA_FIXUP_PINS, | |
6537 | .v.pins = (const struct hda_pintbl[]) { | |
6538 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6539 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6540 | { } | |
6541 | }, | |
6542 | .chained = true, | |
6543 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6544 | }, | |
6545 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { | |
6546 | .type = HDA_FIXUP_PINS, | |
6547 | .v.pins = (const struct hda_pintbl[]) { | |
6548 | { 0x16, 0x21014020 }, /* dock line out */ | |
6549 | { 0x19, 0x21a19030 }, /* dock mic */ | |
6550 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6551 | { } | |
6552 | }, | |
6553 | .chained = true, | |
6554 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6555 | }, | |
338cae56 DH |
6556 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
6557 | .type = HDA_FIXUP_PINS, | |
6558 | .v.pins = (const struct hda_pintbl[]) { | |
6559 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6560 | { } | |
6561 | }, | |
6562 | .chained = true, | |
6563 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6564 | }, | |
fcc6c877 KY |
6565 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
6566 | .type = HDA_FIXUP_PINS, | |
6567 | .v.pins = (const struct hda_pintbl[]) { | |
6568 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6569 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6570 | { } | |
6571 | }, | |
6572 | .chained = true, | |
6573 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6574 | }, | |
73bdd597 DH |
6575 | [ALC269_FIXUP_HEADSET_MODE] = { |
6576 | .type = HDA_FIXUP_FUNC, | |
6577 | .v.func = alc_fixup_headset_mode, | |
6676f308 | 6578 | .chained = true, |
b3802783 | 6579 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
73bdd597 DH |
6580 | }, |
6581 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { | |
6582 | .type = HDA_FIXUP_FUNC, | |
6583 | .v.func = alc_fixup_headset_mode_no_hp_mic, | |
6584 | }, | |
7819717b TI |
6585 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
6586 | .type = HDA_FIXUP_PINS, | |
6587 | .v.pins = (const struct hda_pintbl[]) { | |
6588 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ | |
6589 | { } | |
6590 | }, | |
6591 | .chained = true, | |
6592 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
6593 | }, | |
88cfcf86 DH |
6594 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
6595 | .type = HDA_FIXUP_PINS, | |
6596 | .v.pins = (const struct hda_pintbl[]) { | |
6597 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6598 | { } | |
6599 | }, | |
fbc78ad6 DH |
6600 | .chained = true, |
6601 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
88cfcf86 | 6602 | }, |
0fbf21c3 | 6603 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
8ac51bbc AB |
6604 | .type = HDA_FIXUP_PINS, |
6605 | .v.pins = (const struct hda_pintbl[]) { | |
6606 | {0x12, 0x90a60130}, | |
6607 | {0x13, 0x40000000}, | |
6608 | {0x14, 0x90170110}, | |
6609 | {0x18, 0x411111f0}, | |
6610 | {0x19, 0x04a11040}, | |
6611 | {0x1a, 0x411111f0}, | |
6612 | {0x1b, 0x90170112}, | |
6613 | {0x1d, 0x40759a05}, | |
6614 | {0x1e, 0x411111f0}, | |
6615 | {0x21, 0x04211020}, | |
6616 | { } | |
6617 | }, | |
e2744fd7 AB |
6618 | .chained = true, |
6619 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
8ac51bbc | 6620 | }, |
a2ef03fe TE |
6621 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
6622 | .type = HDA_FIXUP_FUNC, | |
6623 | .v.func = alc298_fixup_huawei_mbx_stereo, | |
6624 | .chained = true, | |
6625 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
6626 | }, | |
d240d1dc DH |
6627 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
6628 | .type = HDA_FIXUP_FUNC, | |
6629 | .v.func = alc269_fixup_x101_headset_mic, | |
6630 | }, | |
6631 | [ALC269_FIXUP_ASUS_X101_VERB] = { | |
6632 | .type = HDA_FIXUP_VERBS, | |
6633 | .v.verbs = (const struct hda_verb[]) { | |
6634 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, | |
6635 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, | |
6636 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, | |
6637 | { } | |
6638 | }, | |
6639 | .chained = true, | |
6640 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC | |
6641 | }, | |
6642 | [ALC269_FIXUP_ASUS_X101] = { | |
6643 | .type = HDA_FIXUP_PINS, | |
6644 | .v.pins = (const struct hda_pintbl[]) { | |
6645 | { 0x18, 0x04a1182c }, /* Headset mic */ | |
6646 | { } | |
6647 | }, | |
6648 | .chained = true, | |
6649 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB | |
6650 | }, | |
08a978db | 6651 | [ALC271_FIXUP_AMIC_MIC2] = { |
1727a771 TI |
6652 | .type = HDA_FIXUP_PINS, |
6653 | .v.pins = (const struct hda_pintbl[]) { | |
08a978db DR |
6654 | { 0x14, 0x99130110 }, /* speaker */ |
6655 | { 0x19, 0x01a19c20 }, /* mic */ | |
6656 | { 0x1b, 0x99a7012f }, /* int-mic */ | |
6657 | { 0x21, 0x0121401f }, /* HP out */ | |
6658 | { } | |
6659 | }, | |
6660 | }, | |
6661 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { | |
1727a771 | 6662 | .type = HDA_FIXUP_FUNC, |
08a978db DR |
6663 | .v.func = alc271_hp_gate_mic_jack, |
6664 | .chained = true, | |
6665 | .chain_id = ALC271_FIXUP_AMIC_MIC2, | |
6666 | }, | |
b1e8972e OR |
6667 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
6668 | .type = HDA_FIXUP_FUNC, | |
6669 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6670 | .chained = true, | |
6671 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, | |
6672 | }, | |
42397004 DR |
6673 | [ALC269_FIXUP_ACER_AC700] = { |
6674 | .type = HDA_FIXUP_PINS, | |
6675 | .v.pins = (const struct hda_pintbl[]) { | |
6676 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6677 | { 0x14, 0x99130110 }, /* speaker */ | |
6678 | { 0x18, 0x03a11c20 }, /* mic */ | |
6679 | { 0x1e, 0x0346101e }, /* SPDIF1 */ | |
6680 | { 0x21, 0x0321101f }, /* HP out */ | |
6681 | { } | |
6682 | }, | |
6683 | .chained = true, | |
6684 | .chain_id = ALC271_FIXUP_DMIC, | |
6685 | }, | |
3e0d611b DH |
6686 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
6687 | .type = HDA_FIXUP_FUNC, | |
6688 | .v.func = alc269_fixup_limit_int_mic_boost, | |
2793769f DH |
6689 | .chained = true, |
6690 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
3e0d611b | 6691 | }, |
2cede303 OR |
6692 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
6693 | .type = HDA_FIXUP_FUNC, | |
6694 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6695 | .chained = true, | |
6696 | .chain_id = ALC269VB_FIXUP_DMIC, | |
6697 | }, | |
23870831 TI |
6698 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
6699 | .type = HDA_FIXUP_VERBS, | |
6700 | .v.verbs = (const struct hda_verb[]) { | |
6701 | /* class-D output amp +5dB */ | |
6702 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, | |
6703 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, | |
6704 | {} | |
6705 | }, | |
6706 | .chained = true, | |
6707 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, | |
6708 | }, | |
8e35cd4a DH |
6709 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
6710 | .type = HDA_FIXUP_FUNC, | |
6711 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6712 | .chained = true, | |
6713 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
6714 | }, | |
02b504d9 AA |
6715 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
6716 | .type = HDA_FIXUP_PINS, | |
6717 | .v.pins = (const struct hda_pintbl[]) { | |
6718 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6719 | { 0x18, 0x03a11d20 }, /* mic */ | |
6720 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ | |
6721 | { } | |
6722 | }, | |
6723 | }, | |
cd217a63 KY |
6724 | [ALC283_FIXUP_CHROME_BOOK] = { |
6725 | .type = HDA_FIXUP_FUNC, | |
6726 | .v.func = alc283_fixup_chromebook, | |
6727 | }, | |
0202e99c KY |
6728 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
6729 | .type = HDA_FIXUP_FUNC, | |
6730 | .v.func = alc283_fixup_sense_combo_jack, | |
6731 | .chained = true, | |
6732 | .chain_id = ALC283_FIXUP_CHROME_BOOK, | |
6733 | }, | |
7bba2157 TI |
6734 | [ALC282_FIXUP_ASUS_TX300] = { |
6735 | .type = HDA_FIXUP_FUNC, | |
6736 | .v.func = alc282_fixup_asus_tx300, | |
6737 | }, | |
1bb3e062 KY |
6738 | [ALC283_FIXUP_INT_MIC] = { |
6739 | .type = HDA_FIXUP_VERBS, | |
6740 | .v.verbs = (const struct hda_verb[]) { | |
6741 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, | |
6742 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, | |
6743 | { } | |
6744 | }, | |
6745 | .chained = true, | |
6746 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
6747 | }, | |
0f4881dc DH |
6748 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
6749 | .type = HDA_FIXUP_PINS, | |
6750 | .v.pins = (const struct hda_pintbl[]) { | |
6751 | { 0x17, 0x90170112 }, /* subwoofer */ | |
6752 | { } | |
6753 | }, | |
6754 | .chained = true, | |
6755 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, | |
6756 | }, | |
6757 | [ALC290_FIXUP_SUBWOOFER] = { | |
6758 | .type = HDA_FIXUP_PINS, | |
6759 | .v.pins = (const struct hda_pintbl[]) { | |
6760 | { 0x17, 0x90170112 }, /* subwoofer */ | |
6761 | { } | |
6762 | }, | |
6763 | .chained = true, | |
6764 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, | |
6765 | }, | |
338cae56 DH |
6766 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
6767 | .type = HDA_FIXUP_FUNC, | |
6768 | .v.func = alc290_fixup_mono_speakers, | |
0f4881dc DH |
6769 | }, |
6770 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { | |
6771 | .type = HDA_FIXUP_FUNC, | |
6772 | .v.func = alc290_fixup_mono_speakers, | |
338cae56 DH |
6773 | .chained = true, |
6774 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | |
6775 | }, | |
b67ae3f1 DH |
6776 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
6777 | .type = HDA_FIXUP_FUNC, | |
d5a6cabf | 6778 | .v.func = alc_fixup_thinkpad_acpi, |
09da111a TI |
6779 | .chained = true, |
6780 | .chain_id = ALC269_FIXUP_SKU_IGNORE, | |
b67ae3f1 | 6781 | }, |
56f27013 DH |
6782 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
6783 | .type = HDA_FIXUP_FUNC, | |
6784 | .v.func = alc_fixup_inv_dmic, | |
6785 | .chained = true, | |
6786 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
6787 | }, | |
5824ce8d | 6788 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
17d30460 HW |
6789 | .type = HDA_FIXUP_PINS, |
6790 | .v.pins = (const struct hda_pintbl[]) { | |
6791 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6792 | { } | |
5824ce8d CC |
6793 | }, |
6794 | .chained = true, | |
17d30460 | 6795 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
5824ce8d | 6796 | }, |
615966ad CC |
6797 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
6798 | .type = HDA_FIXUP_PINS, | |
6799 | .v.pins = (const struct hda_pintbl[]) { | |
6800 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6801 | { } | |
6802 | }, | |
6803 | .chained = true, | |
6804 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
6805 | }, | |
9a22a8f5 KY |
6806 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6807 | .type = HDA_FIXUP_PINS, | |
6808 | .v.pins = (const struct hda_pintbl[]) { | |
6809 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6810 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6811 | { } | |
6812 | }, | |
6813 | .chained = true, | |
6814 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
6815 | }, | |
31278997 KY |
6816 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
6817 | .type = HDA_FIXUP_PINS, | |
6818 | .v.pins = (const struct hda_pintbl[]) { | |
6819 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6820 | { } | |
6821 | }, | |
6822 | .chained = true, | |
6823 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6824 | }, | |
9a22a8f5 KY |
6825 | [ALC255_FIXUP_HEADSET_MODE] = { |
6826 | .type = HDA_FIXUP_FUNC, | |
6827 | .v.func = alc_fixup_headset_mode_alc255, | |
4a83d42a | 6828 | .chained = true, |
b3802783 | 6829 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
9a22a8f5 | 6830 | }, |
31278997 KY |
6831 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
6832 | .type = HDA_FIXUP_FUNC, | |
6833 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, | |
6834 | }, | |
a22aa26f KY |
6835 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6836 | .type = HDA_FIXUP_PINS, | |
6837 | .v.pins = (const struct hda_pintbl[]) { | |
6838 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6839 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6840 | { } | |
6841 | }, | |
6842 | .chained = true, | |
6843 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6844 | }, | |
1c37c223 | 6845 | [ALC292_FIXUP_TPT440_DOCK] = { |
ec56af67 | 6846 | .type = HDA_FIXUP_FUNC, |
7f57d803 | 6847 | .v.func = alc_fixup_tpt440_dock, |
1c37c223 TI |
6848 | .chained = true, |
6849 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
6850 | }, | |
9a811230 TI |
6851 | [ALC292_FIXUP_TPT440] = { |
6852 | .type = HDA_FIXUP_FUNC, | |
157f0b7f | 6853 | .v.func = alc_fixup_disable_aamix, |
9a811230 TI |
6854 | .chained = true, |
6855 | .chain_id = ALC292_FIXUP_TPT440_DOCK, | |
6856 | }, | |
abaa2274 | 6857 | [ALC283_FIXUP_HEADSET_MIC] = { |
9dc12862 DD |
6858 | .type = HDA_FIXUP_PINS, |
6859 | .v.pins = (const struct hda_pintbl[]) { | |
6860 | { 0x19, 0x04a110f0 }, | |
6861 | { }, | |
6862 | }, | |
6863 | }, | |
b3802783 | 6864 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
00ef9940 | 6865 | .type = HDA_FIXUP_FUNC, |
8a503555 | 6866 | .v.func = alc_fixup_micmute_led, |
00ef9940 | 6867 | }, |
1a22e775 TI |
6868 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
6869 | .type = HDA_FIXUP_PINS, | |
6870 | .v.pins = (const struct hda_pintbl[]) { | |
6871 | { 0x12, 0x90a60130 }, | |
6872 | { 0x14, 0x90170110 }, | |
6873 | { 0x17, 0x40000008 }, | |
6874 | { 0x18, 0x411111f0 }, | |
0420694d | 6875 | { 0x19, 0x01a1913c }, |
1a22e775 TI |
6876 | { 0x1a, 0x411111f0 }, |
6877 | { 0x1b, 0x411111f0 }, | |
6878 | { 0x1d, 0x40f89b2d }, | |
6879 | { 0x1e, 0x411111f0 }, | |
6880 | { 0x21, 0x0321101f }, | |
6881 | { }, | |
6882 | }, | |
6883 | }, | |
7a5255f1 DH |
6884 | [ALC280_FIXUP_HP_GPIO4] = { |
6885 | .type = HDA_FIXUP_FUNC, | |
6886 | .v.func = alc280_fixup_hp_gpio4, | |
6887 | }, | |
eaa8e5ef KY |
6888 | [ALC286_FIXUP_HP_GPIO_LED] = { |
6889 | .type = HDA_FIXUP_FUNC, | |
6890 | .v.func = alc286_fixup_hp_gpio_led, | |
6891 | }, | |
33f4acd3 DH |
6892 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
6893 | .type = HDA_FIXUP_FUNC, | |
6894 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, | |
6895 | }, | |
b4b33f9d TC |
6896 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
6897 | .type = HDA_FIXUP_PINS, | |
6898 | .v.pins = (const struct hda_pintbl[]) { | |
6899 | { 0x1b, 0x21011020 }, /* line-out */ | |
6900 | { 0x1a, 0x01a1903c }, /* headset mic */ | |
6901 | { 0x18, 0x2181103f }, /* line-in */ | |
6902 | { }, | |
6903 | }, | |
6904 | .chained = true, | |
6905 | .chain_id = ALC280_FIXUP_HP_GPIO4 | |
6906 | }, | |
04d5466a JK |
6907 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
6908 | .type = HDA_FIXUP_PINS, | |
6909 | .v.pins = (const struct hda_pintbl[]) { | |
6910 | { 0x1b, 0x21011020 }, /* line-out */ | |
6911 | { 0x18, 0x2181103f }, /* line-in */ | |
6912 | { }, | |
6913 | }, | |
6914 | .chained = true, | |
6915 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED | |
6916 | }, | |
98973f2f KP |
6917 | [ALC280_FIXUP_HP_9480M] = { |
6918 | .type = HDA_FIXUP_FUNC, | |
6919 | .v.func = alc280_fixup_hp_9480m, | |
6920 | }, | |
e1e62b98 KY |
6921 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
6922 | .type = HDA_FIXUP_FUNC, | |
6923 | .v.func = alc_fixup_headset_mode_dell_alc288, | |
6924 | .chained = true, | |
b3802783 | 6925 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
e1e62b98 KY |
6926 | }, |
6927 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { | |
6928 | .type = HDA_FIXUP_PINS, | |
6929 | .v.pins = (const struct hda_pintbl[]) { | |
6930 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6931 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6932 | { } | |
6933 | }, | |
6934 | .chained = true, | |
6935 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE | |
6936 | }, | |
831bfdf9 HW |
6937 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
6938 | .type = HDA_FIXUP_FUNC, | |
6939 | .v.func = alc_fixup_disable_aamix, | |
6940 | .chained = true, | |
d44a6864 | 6941 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
831bfdf9 HW |
6942 | }, |
6943 | [ALC288_FIXUP_DELL_XPS_13] = { | |
6944 | .type = HDA_FIXUP_FUNC, | |
6945 | .v.func = alc_fixup_dell_xps13, | |
6946 | .chained = true, | |
6947 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX | |
6948 | }, | |
8b99aba7 TI |
6949 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
6950 | .type = HDA_FIXUP_FUNC, | |
6951 | .v.func = alc_fixup_disable_aamix, | |
831bfdf9 HW |
6952 | .chained = true, |
6953 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE | |
8b99aba7 | 6954 | }, |
c04017ea DH |
6955 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
6956 | .type = HDA_FIXUP_FUNC, | |
6957 | .v.func = alc_fixup_disable_aamix, | |
6958 | .chained = true, | |
6959 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE | |
6960 | }, | |
5fab5829 | 6961 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
8b99aba7 TI |
6962 | .type = HDA_FIXUP_FUNC, |
6963 | .v.func = alc_fixup_dell_xps13, | |
6964 | .chained = true, | |
6965 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX | |
6966 | }, | |
5fab5829 TI |
6967 | [ALC292_FIXUP_DELL_E7X] = { |
6968 | .type = HDA_FIXUP_FUNC, | |
8a503555 | 6969 | .v.func = alc_fixup_micmute_led, |
5fab5829 TI |
6970 | /* micmute fixup must be applied at last */ |
6971 | .chained_before = true, | |
6972 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, | |
6973 | }, | |
54324221 JM |
6974 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
6975 | .type = HDA_FIXUP_PINS, | |
6976 | .v.pins = (const struct hda_pintbl[]) { | |
6977 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ | |
6978 | { } | |
6979 | }, | |
6980 | .chained_before = true, | |
6981 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
6982 | }, | |
977e6276 KY |
6983 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6984 | .type = HDA_FIXUP_PINS, | |
6985 | .v.pins = (const struct hda_pintbl[]) { | |
6986 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6987 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6988 | { } | |
6989 | }, | |
6990 | .chained = true, | |
6991 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6992 | }, | |
2f726aec HW |
6993 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
6994 | .type = HDA_FIXUP_PINS, | |
6995 | .v.pins = (const struct hda_pintbl[]) { | |
6996 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6997 | { } | |
6998 | }, | |
6999 | .chained = true, | |
7000 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7001 | }, | |
6ed1131f KY |
7002 | [ALC275_FIXUP_DELL_XPS] = { |
7003 | .type = HDA_FIXUP_VERBS, | |
7004 | .v.verbs = (const struct hda_verb[]) { | |
7005 | /* Enables internal speaker */ | |
7006 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, | |
7007 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, | |
7008 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, | |
7009 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, | |
7010 | {} | |
7011 | } | |
7012 | }, | |
23adc192 HW |
7013 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
7014 | .type = HDA_FIXUP_FUNC, | |
7015 | .v.func = alc_fixup_disable_aamix, | |
7016 | .chained = true, | |
7017 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7018 | }, | |
3694cb29 K |
7019 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
7020 | .type = HDA_FIXUP_FUNC, | |
7021 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, | |
7022 | }, | |
3b43b71f KHF |
7023 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
7024 | .type = HDA_FIXUP_FUNC, | |
7025 | .v.func = alc_fixup_disable_aamix, | |
7026 | .chained = true, | |
7027 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7028 | }, | |
d1dd4211 KY |
7029 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
7030 | .type = HDA_FIXUP_FUNC, | |
7031 | .v.func = alc_fixup_disable_mic_vref, | |
7032 | .chained = true, | |
7033 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7034 | }, | |
2ae95577 DH |
7035 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7036 | .type = HDA_FIXUP_VERBS, | |
7037 | .v.verbs = (const struct hda_verb[]) { | |
7038 | /* Disable pass-through path for FRONT 14h */ | |
7039 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7040 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7041 | {} | |
7042 | }, | |
7043 | .chained = true, | |
d1dd4211 | 7044 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
2ae95577 | 7045 | }, |
f883982d TI |
7046 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
7047 | .type = HDA_FIXUP_FUNC, | |
7048 | .v.func = alc_fixup_disable_aamix, | |
7049 | .chained = true, | |
7050 | .chain_id = ALC269_FIXUP_HEADSET_MIC, | |
7051 | }, | |
e549d190 HW |
7052 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
7053 | .type = HDA_FIXUP_PINS, | |
7054 | .v.pins = (const struct hda_pintbl[]) { | |
7055 | { 0x19, 0x02a19020 }, /* Front Mic */ | |
7056 | { } | |
7057 | }, | |
7058 | }, | |
c636b95e SE |
7059 | [ALC292_FIXUP_TPT460] = { |
7060 | .type = HDA_FIXUP_FUNC, | |
7061 | .v.func = alc_fixup_tpt440_dock, | |
7062 | .chained = true, | |
7063 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, | |
7064 | }, | |
dd9aa335 HW |
7065 | [ALC298_FIXUP_SPK_VOLUME] = { |
7066 | .type = HDA_FIXUP_FUNC, | |
7067 | .v.func = alc298_fixup_speaker_volume, | |
59ec4b57 | 7068 | .chained = true, |
2f726aec | 7069 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
dd9aa335 | 7070 | }, |
e312a869 TI |
7071 | [ALC295_FIXUP_DISABLE_DAC3] = { |
7072 | .type = HDA_FIXUP_FUNC, | |
7073 | .v.func = alc295_fixup_disable_dac3, | |
7074 | }, | |
d2cd795c JK |
7075 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
7076 | .type = HDA_FIXUP_FUNC, | |
7077 | .v.func = alc285_fixup_speaker2_to_dac1, | |
c37c0ab0 HW |
7078 | .chained = true, |
7079 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
d2cd795c | 7080 | }, |
fd06c77e KHF |
7081 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
7082 | .type = HDA_FIXUP_PINS, | |
7083 | .v.pins = (const struct hda_pintbl[]) { | |
7084 | { 0x1b, 0x90170151 }, | |
7085 | { } | |
7086 | }, | |
7087 | .chained = true, | |
7088 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7089 | }, | |
823ff161 GM |
7090 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
7091 | .type = HDA_FIXUP_FUNC, | |
7092 | .v.func = alc_fixup_auto_mute_via_amp, | |
7093 | .chained = true, | |
7094 | .chain_id = ALC269_FIXUP_NO_SHUTUP | |
7095 | }, | |
9eb5d0e6 KY |
7096 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
7097 | .type = HDA_FIXUP_PINS, | |
7098 | .v.pins = (const struct hda_pintbl[]) { | |
7099 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7100 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7101 | { } | |
7102 | }, | |
7103 | .chained = true, | |
7104 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7105 | }, | |
c1732ede CC |
7106 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
7107 | .type = HDA_FIXUP_FUNC, | |
7108 | .v.func = alc_fixup_headset_mode, | |
7109 | }, | |
7110 | [ALC256_FIXUP_ASUS_MIC] = { | |
7111 | .type = HDA_FIXUP_PINS, | |
7112 | .v.pins = (const struct hda_pintbl[]) { | |
7113 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7114 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7115 | { } | |
7116 | }, | |
7117 | .chained = true, | |
7118 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7119 | }, | |
eeed4cd1 | 7120 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
ae065f1c TI |
7121 | .type = HDA_FIXUP_FUNC, |
7122 | /* Set up GPIO2 for the speaker amp */ | |
7123 | .v.func = alc_fixup_gpio4, | |
eeed4cd1 | 7124 | }, |
216d7aeb CC |
7125 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7126 | .type = HDA_FIXUP_PINS, | |
7127 | .v.pins = (const struct hda_pintbl[]) { | |
7128 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7129 | { } | |
7130 | }, | |
7131 | .chained = true, | |
7132 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7133 | }, | |
7134 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { | |
7135 | .type = HDA_FIXUP_VERBS, | |
7136 | .v.verbs = (const struct hda_verb[]) { | |
7137 | /* Enables internal speaker */ | |
7138 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, | |
7139 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, | |
7140 | {} | |
7141 | }, | |
7142 | .chained = true, | |
7143 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7144 | }, | |
ca169cc2 KY |
7145 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
7146 | .type = HDA_FIXUP_FUNC, | |
7147 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
f73bbf63 KHF |
7148 | .chained = true, |
7149 | .chain_id = ALC269_FIXUP_GPIO2 | |
ca169cc2 | 7150 | }, |
ea5c7eba JHP |
7151 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
7152 | .type = HDA_FIXUP_VERBS, | |
7153 | .v.verbs = (const struct hda_verb[]) { | |
7154 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
7155 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
7156 | { } | |
7157 | }, | |
7158 | .chained = true, | |
7159 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7160 | }, | |
f33f79f3 HW |
7161 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
7162 | .type = HDA_FIXUP_PINS, | |
7163 | .v.pins = (const struct hda_pintbl[]) { | |
7164 | /* Change the mic location from front to right, otherwise there are | |
7165 | two front mics with the same name, pulseaudio can't handle them. | |
7166 | This is just a temporary workaround, after applying this fixup, | |
7167 | there will be one "Front Mic" and one "Mic" in this machine. | |
7168 | */ | |
7169 | { 0x1a, 0x04a19040 }, | |
7170 | { } | |
7171 | }, | |
7172 | }, | |
5f364135 KY |
7173 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
7174 | .type = HDA_FIXUP_PINS, | |
7175 | .v.pins = (const struct hda_pintbl[]) { | |
7176 | { 0x16, 0x0101102f }, /* Rear Headset HP */ | |
7177 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7178 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ | |
7179 | { 0x1b, 0x02011020 }, | |
7180 | { } | |
7181 | }, | |
7182 | .chained = true, | |
52e4e368 KHF |
7183 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
7184 | }, | |
7185 | [ALC225_FIXUP_S3_POP_NOISE] = { | |
7186 | .type = HDA_FIXUP_FUNC, | |
7187 | .v.func = alc225_fixup_s3_pop_noise, | |
7188 | .chained = true, | |
5f364135 KY |
7189 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
7190 | }, | |
b84e8436 PH |
7191 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
7192 | .type = HDA_FIXUP_VERBS, | |
7193 | .v.verbs = (const struct hda_verb[]) { | |
7194 | /* Enables internal speaker */ | |
7195 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, | |
7196 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, | |
7197 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, | |
7198 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, | |
7199 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, | |
7200 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, | |
7201 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, | |
7202 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, | |
7203 | {} | |
7204 | } | |
7205 | }, | |
92266651 KY |
7206 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
7207 | .type = HDA_FIXUP_FUNC, | |
7208 | .v.func = alc274_fixup_bind_dacs, | |
7209 | .chained = true, | |
7210 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7211 | }, | |
7212 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { | |
7213 | .type = HDA_FIXUP_PINS, | |
7214 | .v.pins = (const struct hda_pintbl[]) { | |
7215 | { 0x1b, 0x0401102f }, | |
7216 | { } | |
7217 | }, | |
7218 | .chained = true, | |
7219 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS | |
7220 | }, | |
399c01aa | 7221 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
61fcf8ec KY |
7222 | .type = HDA_FIXUP_FUNC, |
7223 | .v.func = alc_fixup_tpt470_dock, | |
7224 | .chained = true, | |
7225 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE | |
7226 | }, | |
399c01aa TI |
7227 | [ALC298_FIXUP_TPT470_DOCK] = { |
7228 | .type = HDA_FIXUP_FUNC, | |
7229 | .v.func = alc_fixup_tpt470_dacs, | |
7230 | .chained = true, | |
7231 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX | |
7232 | }, | |
ae104a21 KY |
7233 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
7234 | .type = HDA_FIXUP_PINS, | |
7235 | .v.pins = (const struct hda_pintbl[]) { | |
7236 | { 0x14, 0x0201101f }, | |
7237 | { } | |
7238 | }, | |
7239 | .chained = true, | |
7240 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7241 | }, | |
f0ba9d69 KY |
7242 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
7243 | .type = HDA_FIXUP_PINS, | |
7244 | .v.pins = (const struct hda_pintbl[]) { | |
7245 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7246 | { } | |
7247 | }, | |
3ce0d5aa HW |
7248 | .chained = true, |
7249 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
f0ba9d69 | 7250 | }, |
bbf8ff6b TB |
7251 | [ALC295_FIXUP_HP_X360] = { |
7252 | .type = HDA_FIXUP_FUNC, | |
7253 | .v.func = alc295_fixup_hp_top_speakers, | |
7254 | .chained = true, | |
7255 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 | |
8a328ac1 KY |
7256 | }, |
7257 | [ALC221_FIXUP_HP_HEADSET_MIC] = { | |
7258 | .type = HDA_FIXUP_PINS, | |
7259 | .v.pins = (const struct hda_pintbl[]) { | |
7260 | { 0x19, 0x0181313f}, | |
7261 | { } | |
7262 | }, | |
7263 | .chained = true, | |
7264 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7265 | }, | |
c4cfcf6f HW |
7266 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
7267 | .type = HDA_FIXUP_FUNC, | |
7268 | .v.func = alc285_fixup_invalidate_dacs, | |
6ba189c5 HW |
7269 | .chained = true, |
7270 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
c4cfcf6f | 7271 | }, |
e8ed64b0 GKK |
7272 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
7273 | .type = HDA_FIXUP_FUNC, | |
7274 | .v.func = alc_fixup_auto_mute_via_amp, | |
7275 | }, | |
33aaebd4 CC |
7276 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
7277 | .type = HDA_FIXUP_PINS, | |
7278 | .v.pins = (const struct hda_pintbl[]) { | |
7279 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7280 | { } | |
7281 | }, | |
7282 | .chained = true, | |
7283 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7284 | }, | |
d8ae458e CC |
7285 | [ALC294_FIXUP_ASUS_MIC] = { |
7286 | .type = HDA_FIXUP_PINS, | |
7287 | .v.pins = (const struct hda_pintbl[]) { | |
7288 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7289 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7290 | { } | |
7291 | }, | |
7292 | .chained = true, | |
ef9ddb9d | 7293 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
d8ae458e | 7294 | }, |
4e051106 JHP |
7295 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
7296 | .type = HDA_FIXUP_PINS, | |
7297 | .v.pins = (const struct hda_pintbl[]) { | |
82b01149 | 7298 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
4e051106 JHP |
7299 | { } |
7300 | }, | |
7301 | .chained = true, | |
ef9ddb9d | 7302 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
4e051106 JHP |
7303 | }, |
7304 | [ALC294_FIXUP_ASUS_SPK] = { | |
7305 | .type = HDA_FIXUP_VERBS, | |
7306 | .v.verbs = (const struct hda_verb[]) { | |
7307 | /* Set EAPD high */ | |
7308 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, | |
7309 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, | |
473fbe13 KY |
7310 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
7311 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
4e051106 JHP |
7312 | { } |
7313 | }, | |
7314 | .chained = true, | |
7315 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7316 | }, | |
c8a9afa6 | 7317 | [ALC295_FIXUP_CHROME_BOOK] = { |
e854747d | 7318 | .type = HDA_FIXUP_FUNC, |
c8a9afa6 | 7319 | .v.func = alc295_fixup_chromebook, |
8983eb60 KY |
7320 | .chained = true, |
7321 | .chain_id = ALC225_FIXUP_HEADSET_JACK | |
7322 | }, | |
7323 | [ALC225_FIXUP_HEADSET_JACK] = { | |
7324 | .type = HDA_FIXUP_FUNC, | |
7325 | .v.func = alc_fixup_headset_jack, | |
e854747d | 7326 | }, |
89e3a568 JS |
7327 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
7328 | .type = HDA_FIXUP_PINS, | |
7329 | .v.pins = (const struct hda_pintbl[]) { | |
7330 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7331 | { } | |
7332 | }, | |
7333 | .chained = true, | |
7334 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7335 | }, | |
c8c6ee61 HW |
7336 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
7337 | .type = HDA_FIXUP_VERBS, | |
7338 | .v.verbs = (const struct hda_verb[]) { | |
7339 | /* Disable PCBEEP-IN passthrough */ | |
7340 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7341 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7342 | { } | |
7343 | }, | |
7344 | .chained = true, | |
7345 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | |
7346 | }, | |
cbc05fd6 JHP |
7347 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
7348 | .type = HDA_FIXUP_PINS, | |
7349 | .v.pins = (const struct hda_pintbl[]) { | |
7350 | { 0x19, 0x03a11130 }, | |
7351 | { 0x1a, 0x90a60140 }, /* use as internal mic */ | |
7352 | { } | |
7353 | }, | |
7354 | .chained = true, | |
7355 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7356 | }, | |
136824ef KY |
7357 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
7358 | .type = HDA_FIXUP_PINS, | |
7359 | .v.pins = (const struct hda_pintbl[]) { | |
7360 | { 0x16, 0x01011020 }, /* Rear Line out */ | |
7361 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7362 | { } | |
7363 | }, | |
7364 | .chained = true, | |
7365 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | |
7366 | }, | |
7367 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | |
7368 | .type = HDA_FIXUP_FUNC, | |
7369 | .v.func = alc_fixup_auto_mute_via_amp, | |
7370 | .chained = true, | |
7371 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | |
7372 | }, | |
7373 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | |
7374 | .type = HDA_FIXUP_FUNC, | |
7375 | .v.func = alc_fixup_disable_mic_vref, | |
7376 | .chained = true, | |
7377 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7378 | }, | |
667a8f73 JHP |
7379 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
7380 | .type = HDA_FIXUP_VERBS, | |
7381 | .v.verbs = (const struct hda_verb[]) { | |
7382 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, | |
7383 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, | |
7384 | { } | |
7385 | }, | |
7386 | .chained = true, | |
7387 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE | |
7388 | }, | |
8c8967a7 DD |
7389 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
7390 | .type = HDA_FIXUP_PINS, | |
7391 | .v.pins = (const struct hda_pintbl[]) { | |
7392 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7393 | { } | |
7394 | }, | |
7395 | .chained = true, | |
7396 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7397 | }, | |
e1037354 JHP |
7398 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7399 | .type = HDA_FIXUP_PINS, | |
7400 | .v.pins = (const struct hda_pintbl[]) { | |
7401 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7402 | { } | |
7403 | }, | |
7404 | .chained = true, | |
7405 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7406 | }, | |
e2a829b3 BR |
7407 | [ALC299_FIXUP_PREDATOR_SPK] = { |
7408 | .type = HDA_FIXUP_PINS, | |
7409 | .v.pins = (const struct hda_pintbl[]) { | |
7410 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ | |
7411 | { } | |
7412 | } | |
7413 | }, | |
bd9c10bc | 7414 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
60083f9e JHP |
7415 | .type = HDA_FIXUP_PINS, |
7416 | .v.pins = (const struct hda_pintbl[]) { | |
bd9c10bc JMG |
7417 | { 0x19, 0x04a11040 }, |
7418 | { 0x21, 0x04211020 }, | |
60083f9e JHP |
7419 | { } |
7420 | }, | |
7421 | .chained = true, | |
bd9c10bc | 7422 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
60083f9e | 7423 | }, |
e79c2269 | 7424 | [ALC289_FIXUP_DELL_SPK2] = { |
bd9c10bc JMG |
7425 | .type = HDA_FIXUP_PINS, |
7426 | .v.pins = (const struct hda_pintbl[]) { | |
e79c2269 | 7427 | { 0x17, 0x90170130 }, /* bass spk */ |
bd9c10bc JMG |
7428 | { } |
7429 | }, | |
7430 | .chained = true, | |
e79c2269 | 7431 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
bd9c10bc | 7432 | }, |
e79c2269 KY |
7433 | [ALC289_FIXUP_DUAL_SPK] = { |
7434 | .type = HDA_FIXUP_FUNC, | |
7435 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7436 | .chained = true, | |
7437 | .chain_id = ALC289_FIXUP_DELL_SPK2 | |
7438 | }, | |
48e01504 CC |
7439 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
7440 | .type = HDA_FIXUP_FUNC, | |
7441 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7442 | .chained = true, | |
7443 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7444 | }, | |
7445 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { | |
436e2550 JHP |
7446 | .type = HDA_FIXUP_FUNC, |
7447 | /* The GPIO must be pulled to initialize the AMP */ | |
7448 | .v.func = alc_fixup_gpio4, | |
7449 | .chained = true, | |
48e01504 | 7450 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
436e2550 | 7451 | }, |
6a6660d0 TI |
7452 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
7453 | .type = HDA_FIXUP_FUNC, | |
7454 | .v.func = alc285_fixup_thinkpad_x1_gen7, | |
7455 | .chained = true, | |
7456 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7457 | }, | |
76f7dec0 KY |
7458 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
7459 | .type = HDA_FIXUP_FUNC, | |
7460 | .v.func = alc_fixup_headset_jack, | |
7461 | .chained = true, | |
6a6660d0 | 7462 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
76f7dec0 | 7463 | }, |
8b33a134 JHP |
7464 | [ALC294_FIXUP_ASUS_HPE] = { |
7465 | .type = HDA_FIXUP_VERBS, | |
7466 | .v.verbs = (const struct hda_verb[]) { | |
7467 | /* Set EAPD high */ | |
7468 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
7469 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
7470 | { } | |
7471 | }, | |
7472 | .chained = true, | |
7473 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7474 | }, | |
c3cdf189 LJ |
7475 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
7476 | .type = HDA_FIXUP_PINS, | |
7477 | .v.pins = (const struct hda_pintbl[]) { | |
7478 | { 0x19, 0x03a11050 }, /* front HP mic */ | |
7479 | { 0x1a, 0x01a11830 }, /* rear external mic */ | |
7480 | { 0x21, 0x03211020 }, /* front HP out */ | |
7481 | { } | |
7482 | }, | |
7483 | .chained = true, | |
7484 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS | |
7485 | }, | |
7486 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { | |
7487 | .type = HDA_FIXUP_VERBS, | |
7488 | .v.verbs = (const struct hda_verb[]) { | |
7489 | /* set 0x15 to HP-OUT ctrl */ | |
7490 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, | |
7491 | /* unmute the 0x15 amp */ | |
7492 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, | |
7493 | { } | |
7494 | }, | |
7495 | .chained = true, | |
7496 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP | |
7497 | }, | |
7498 | [ALC294_FIXUP_ASUS_GX502_HP] = { | |
7499 | .type = HDA_FIXUP_FUNC, | |
7500 | .v.func = alc294_fixup_gx502_hp, | |
7501 | }, | |
1b94e59d TI |
7502 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
7503 | .type = HDA_FIXUP_VERBS, | |
7504 | .v.verbs = (const struct hda_verb[]) { | |
7505 | /* Set bit 10 to correct noisy output after reboot from | |
7506 | * Windows 10 (due to pop noise reduction?) | |
7507 | */ | |
7508 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, | |
7509 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, | |
7510 | { } | |
7511 | }, | |
7512 | }, | |
f5a88b0a KHF |
7513 | [ALC285_FIXUP_HP_GPIO_LED] = { |
7514 | .type = HDA_FIXUP_FUNC, | |
7515 | .v.func = alc285_fixup_hp_gpio_led, | |
7516 | }, | |
431e76c3 KY |
7517 | [ALC285_FIXUP_HP_MUTE_LED] = { |
7518 | .type = HDA_FIXUP_FUNC, | |
7519 | .v.func = alc285_fixup_hp_mute_led, | |
7520 | }, | |
24164f43 KY |
7521 | [ALC236_FIXUP_HP_MUTE_LED] = { |
7522 | .type = HDA_FIXUP_FUNC, | |
7523 | .v.func = alc236_fixup_hp_mute_led, | |
7524 | }, | |
14425f1f MP |
7525 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
7526 | .type = HDA_FIXUP_VERBS, | |
7527 | .v.verbs = (const struct hda_verb[]) { | |
7528 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, | |
7529 | { } | |
7530 | }, | |
7531 | }, | |
9e43342b CC |
7532 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7533 | .type = HDA_FIXUP_PINS, | |
7534 | .v.pins = (const struct hda_pintbl[]) { | |
7535 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7536 | { } | |
7537 | }, | |
7538 | .chained = true, | |
7539 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7540 | }, | |
8eae7e9b JHP |
7541 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
7542 | .type = HDA_FIXUP_PINS, | |
7543 | .v.pins = (const struct hda_pintbl[]) { | |
7544 | { 0x14, 0x90100120 }, /* use as internal speaker */ | |
7545 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ | |
7546 | { 0x1a, 0x01011020 }, /* use as line out */ | |
7547 | { }, | |
7548 | }, | |
7549 | .chained = true, | |
7550 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7551 | }, | |
6e15d126 JHP |
7552 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
7553 | .type = HDA_FIXUP_PINS, | |
7554 | .v.pins = (const struct hda_pintbl[]) { | |
7555 | { 0x18, 0x02a11030 }, /* use as headset mic */ | |
7556 | { } | |
7557 | }, | |
7558 | .chained = true, | |
7559 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7560 | }, | |
781c90c0 JHP |
7561 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
7562 | .type = HDA_FIXUP_PINS, | |
7563 | .v.pins = (const struct hda_pintbl[]) { | |
7564 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ | |
7565 | { } | |
7566 | }, | |
7567 | .chained = true, | |
7568 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7569 | }, | |
293a92c1 | 7570 | [ALC289_FIXUP_ASUS_GA401] = { |
ff53664d AS |
7571 | .type = HDA_FIXUP_PINS, |
7572 | .v.pins = (const struct hda_pintbl[]) { | |
7573 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7574 | { } | |
7575 | }, | |
7576 | }, | |
4b43d05a AS |
7577 | [ALC289_FIXUP_ASUS_GA502] = { |
7578 | .type = HDA_FIXUP_PINS, | |
7579 | .v.pins = (const struct hda_pintbl[]) { | |
7580 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7581 | { } | |
7582 | }, | |
7583 | }, | |
f50a121d JHP |
7584 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
7585 | .type = HDA_FIXUP_PINS, | |
7586 | .v.pins = (const struct hda_pintbl[]) { | |
7587 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ | |
7588 | { } | |
7589 | }, | |
7590 | .chained = true, | |
7591 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7592 | }, | |
56496253 KY |
7593 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
7594 | .type = HDA_FIXUP_FUNC, | |
7595 | .v.func = alc285_fixup_hp_gpio_amp_init, | |
7596 | .chained = true, | |
7597 | .chain_id = ALC285_FIXUP_HP_GPIO_LED | |
7598 | }, | |
f1ec5be1 HC |
7599 | [ALC269_FIXUP_CZC_B20] = { |
7600 | .type = HDA_FIXUP_PINS, | |
7601 | .v.pins = (const struct hda_pintbl[]) { | |
7602 | { 0x12, 0x411111f0 }, | |
7603 | { 0x14, 0x90170110 }, /* speaker */ | |
7604 | { 0x15, 0x032f1020 }, /* HP out */ | |
7605 | { 0x17, 0x411111f0 }, | |
7606 | { 0x18, 0x03ab1040 }, /* mic */ | |
7607 | { 0x19, 0xb7a7013f }, | |
7608 | { 0x1a, 0x0181305f }, | |
7609 | { 0x1b, 0x411111f0 }, | |
7610 | { 0x1d, 0x411111f0 }, | |
7611 | { 0x1e, 0x411111f0 }, | |
7612 | { } | |
7613 | }, | |
7614 | .chain_id = ALC269_FIXUP_DMIC, | |
7615 | }, | |
7616 | [ALC269_FIXUP_CZC_TMI] = { | |
7617 | .type = HDA_FIXUP_PINS, | |
7618 | .v.pins = (const struct hda_pintbl[]) { | |
7619 | { 0x12, 0x4000c000 }, | |
7620 | { 0x14, 0x90170110 }, /* speaker */ | |
7621 | { 0x15, 0x0421401f }, /* HP out */ | |
7622 | { 0x17, 0x411111f0 }, | |
7623 | { 0x18, 0x04a19020 }, /* mic */ | |
7624 | { 0x19, 0x411111f0 }, | |
7625 | { 0x1a, 0x411111f0 }, | |
7626 | { 0x1b, 0x411111f0 }, | |
7627 | { 0x1d, 0x40448505 }, | |
7628 | { 0x1e, 0x411111f0 }, | |
7629 | { 0x20, 0x8000ffff }, | |
7630 | { } | |
7631 | }, | |
7632 | .chain_id = ALC269_FIXUP_DMIC, | |
7633 | }, | |
7634 | [ALC269_FIXUP_CZC_L101] = { | |
7635 | .type = HDA_FIXUP_PINS, | |
7636 | .v.pins = (const struct hda_pintbl[]) { | |
7637 | { 0x12, 0x40000000 }, | |
7638 | { 0x14, 0x01014010 }, /* speaker */ | |
7639 | { 0x15, 0x411111f0 }, /* HP out */ | |
7640 | { 0x16, 0x411111f0 }, | |
7641 | { 0x18, 0x01a19020 }, /* mic */ | |
7642 | { 0x19, 0x02a19021 }, | |
7643 | { 0x1a, 0x0181302f }, | |
7644 | { 0x1b, 0x0221401f }, | |
7645 | { 0x1c, 0x411111f0 }, | |
7646 | { 0x1d, 0x4044c601 }, | |
7647 | { 0x1e, 0x411111f0 }, | |
7648 | { } | |
7649 | }, | |
7650 | .chain_id = ALC269_FIXUP_DMIC, | |
7651 | }, | |
7652 | [ALC269_FIXUP_LEMOTE_A1802] = { | |
7653 | .type = HDA_FIXUP_PINS, | |
7654 | .v.pins = (const struct hda_pintbl[]) { | |
7655 | { 0x12, 0x40000000 }, | |
7656 | { 0x14, 0x90170110 }, /* speaker */ | |
7657 | { 0x17, 0x411111f0 }, | |
7658 | { 0x18, 0x03a19040 }, /* mic1 */ | |
7659 | { 0x19, 0x90a70130 }, /* mic2 */ | |
7660 | { 0x1a, 0x411111f0 }, | |
7661 | { 0x1b, 0x411111f0 }, | |
7662 | { 0x1d, 0x40489d2d }, | |
7663 | { 0x1e, 0x411111f0 }, | |
7664 | { 0x20, 0x0003ffff }, | |
7665 | { 0x21, 0x03214020 }, | |
7666 | { } | |
7667 | }, | |
7668 | .chain_id = ALC269_FIXUP_DMIC, | |
7669 | }, | |
7670 | [ALC269_FIXUP_LEMOTE_A190X] = { | |
7671 | .type = HDA_FIXUP_PINS, | |
7672 | .v.pins = (const struct hda_pintbl[]) { | |
7673 | { 0x14, 0x99130110 }, /* speaker */ | |
7674 | { 0x15, 0x0121401f }, /* HP out */ | |
7675 | { 0x18, 0x01a19c20 }, /* rear mic */ | |
7676 | { 0x19, 0x99a3092f }, /* front mic */ | |
7677 | { 0x1b, 0x0201401f }, /* front lineout */ | |
7678 | { } | |
7679 | }, | |
7680 | .chain_id = ALC269_FIXUP_DMIC, | |
7681 | }, | |
e2d2fded KHF |
7682 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
7683 | .type = HDA_FIXUP_PINS, | |
7684 | .v.pins = (const struct hda_pintbl[]) { | |
7685 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7686 | { } | |
7687 | }, | |
7688 | .chained = true, | |
7689 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7690 | }, | |
fc19d559 HW |
7691 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
7692 | .type = HDA_FIXUP_VERBS, | |
7693 | .v.verbs = (const struct hda_verb[]) { | |
7694 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
7695 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
7696 | { } | |
7697 | }, | |
7698 | .chained = true, | |
7699 | .chain_id = ALC289_FIXUP_ASUS_GA401 | |
7700 | }, | |
13468bfa HW |
7701 | [ALC274_FIXUP_HP_MIC] = { |
7702 | .type = HDA_FIXUP_VERBS, | |
7703 | .v.verbs = (const struct hda_verb[]) { | |
7704 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
7705 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
7706 | { } | |
7707 | }, | |
7708 | }, | |
8a8de09c KY |
7709 | [ALC274_FIXUP_HP_HEADSET_MIC] = { |
7710 | .type = HDA_FIXUP_FUNC, | |
7711 | .v.func = alc274_fixup_hp_headset_mic, | |
7712 | .chained = true, | |
7713 | .chain_id = ALC274_FIXUP_HP_MIC | |
7714 | }, | |
ef9ce66f KY |
7715 | [ALC256_FIXUP_ASUS_HPE] = { |
7716 | .type = HDA_FIXUP_VERBS, | |
7717 | .v.verbs = (const struct hda_verb[]) { | |
7718 | /* Set EAPD high */ | |
7719 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
7720 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, | |
7721 | { } | |
7722 | }, | |
7723 | .chained = true, | |
7724 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7725 | }, | |
446b8185 KY |
7726 | [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { |
7727 | .type = HDA_FIXUP_FUNC, | |
7728 | .v.func = alc_fixup_headset_jack, | |
7729 | .chained = true, | |
7730 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7731 | }, | |
a0ccbc53 KY |
7732 | [ALC287_FIXUP_HP_GPIO_LED] = { |
7733 | .type = HDA_FIXUP_FUNC, | |
7734 | .v.func = alc287_fixup_hp_gpio_led, | |
7735 | }, | |
f1d4e28b KY |
7736 | }; |
7737 | ||
1d045db9 | 7738 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
a6b92b66 | 7739 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
693b613d DH |
7740 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
7741 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), | |
aaedfb47 | 7742 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
7819717b TI |
7743 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
7744 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), | |
aaedfb47 DH |
7745 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
7746 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), | |
02322ac9 | 7747 | SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
b1e8972e | 7748 | SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
1a22e775 | 7749 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
705b65f1 | 7750 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6e15d126 | 7751 | SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), |
b9c2fa52 | 7752 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
c7531e31 CC |
7753 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
7754 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), | |
e2a829b3 | 7755 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
8eae7e9b | 7756 | SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), |
781c90c0 | 7757 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
667a8f73 JHP |
7758 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
7759 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
7760 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
2733cceb | 7761 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
ea5c7eba | 7762 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), |
cbc05fd6 | 7763 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
f50a121d | 7764 | SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
aaedfb47 | 7765 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6ed1131f | 7766 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
86f799b8 | 7767 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
cf52103a | 7768 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
8b99aba7 TI |
7769 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
7770 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), | |
0f4881dc | 7771 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
73bdd597 DH |
7772 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
7773 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
7774 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
0f4881dc DH |
7775 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
7776 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), | |
98070576 | 7777 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
4275554d | 7778 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
0f4881dc | 7779 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), |
a22aa26f KY |
7780 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
7781 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
831bfdf9 | 7782 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
afecb146 | 7783 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
3a05d12f | 7784 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8b72415d | 7785 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
b734304f KY |
7786 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
7787 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
c04017ea DH |
7788 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
7789 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
7790 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
7791 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
7792 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
fd06c77e | 7793 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
3b43b71f | 7794 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
c0ca5ece | 7795 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
709ae62e | 7796 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
dd9aa335 | 7797 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
e312a869 | 7798 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
493de342 | 7799 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
5f364135 | 7800 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
40e2c4e5 KY |
7801 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
7802 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | |
f0ba9d69 KY |
7803 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
7804 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | |
ae104a21 | 7805 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
136824ef | 7806 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
da484d00 | 7807 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
c2a7c55a | 7808 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
e79c2269 KY |
7809 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
7810 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), | |
78def224 KY |
7811 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
7812 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), | |
a22aa26f KY |
7813 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
7814 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
08fb0d0e | 7815 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
9f5c6faf | 7816 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
8e35cd4a | 7817 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
33f4acd3 | 7818 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
c60666bd | 7819 | /* ALC282 */ |
7976eb49 | 7820 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 7821 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 7822 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
9c5dc3bf KY |
7823 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
7824 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
7825 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
7826 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
9c5dc3bf | 7827 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
c60666bd | 7828 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
7829 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7830 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8a02b164 | 7831 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
eaa8e5ef | 7832 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
b4b33f9d | 7833 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
3271cb22 | 7834 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
c60666bd | 7835 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
7836 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7837 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
7838 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 7839 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
98973f2f | 7840 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
9c5dc3bf KY |
7841 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
7842 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
c60666bd | 7843 | /* ALC290 */ |
9c5dc3bf | 7844 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf | 7845 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf | 7846 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf KY |
7847 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
7848 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
7849 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
7850 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
7851 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 7852 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
04d5466a | 7853 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
c60666bd | 7854 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
7855 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7856 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
7857 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
9c5dc3bf KY |
7858 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
7859 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 7860 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
c60666bd | 7861 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 7862 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 7863 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
7864 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7865 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd KY |
7866 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7867 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 7868 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 KY |
7869 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
7870 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
7871 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
7872 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
f883982d | 7873 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
167897f4 JK |
7874 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
7875 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
563785ed | 7876 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
e549d190 | 7877 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
bbf8ff6b | 7878 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
167897f4 JK |
7879 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
7880 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
56e40eb6 | 7881 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
190d0381 | 7882 | SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
d33cd42d | 7883 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
b2c22910 KHF |
7884 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
7885 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), | |
56496253 | 7886 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
08befca4 | 7887 | SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), |
431e76c3 | 7888 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
24164f43 | 7889 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
a0ccbc53 KY |
7890 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
7891 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), | |
c1732ede | 7892 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
7bba2157 | 7893 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
3e0d611b | 7894 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9cf6533e | 7895 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
c1732ede | 7896 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
4eab0ea1 | 7897 | SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3e0d611b | 7898 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4eab0ea1 TI |
7899 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
7900 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
7901 | SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
c1732ede CC |
7902 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
7903 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), | |
7904 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), | |
2cede303 | 7905 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
23870831 | 7906 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
3e0d611b | 7907 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
48e01504 | 7908 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
8c8967a7 | 7909 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
4963d66b | 7910 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
158ae2f5 | 7911 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
8b33a134 | 7912 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
7900e817 | 7913 | SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), |
017f2a10 | 7914 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
28e8af8a | 7915 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
1b94e59d | 7916 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
693b613d | 7917 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
615966ad | 7918 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 | 7919 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
c1732ede | 7920 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
ef9ce66f | 7921 | SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), |
4b43d05a | 7922 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
293a92c1 | 7923 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
c3cdf189 | 7924 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
eeed4cd1 | 7925 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
adabb3ec TI |
7926 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
7927 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | |
7928 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
7929 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
d240d1dc | 7930 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
f88abaa0 | 7931 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
88cfcf86 | 7932 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
1d045db9 TI |
7933 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
7934 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
7935 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
e9bd7d5c | 7936 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
24519911 | 7937 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
4df3fd17 | 7938 | SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), |
cc7016ab | 7939 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
88776f36 | 7940 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
fdcc968a | 7941 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
2041d564 | 7942 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
b84e8436 | 7943 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
6fa38ef1 | 7944 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
0fca97a2 | 7945 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
a33cc48d | 7946 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
14425f1f MP |
7947 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
7948 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), | |
f70fff83 | 7949 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
8bcea6cb AC |
7950 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
7951 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), | |
823ff161 | 7952 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
568e4e82 | 7953 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
abaa2274 AA |
7954 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
7955 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | |
8cd65271 | 7956 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
b5acfe15 | 7957 | SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
89e3a568 | 7958 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 PH |
7959 | SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
7960 | SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7961 | SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7962 | SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7963 | SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7964 | SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7965 | SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7966 | SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7967 | SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7968 | SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7969 | SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7970 | SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7971 | SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7972 | SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7973 | SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7974 | SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7975 | SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7976 | SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7977 | SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7978 | SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7979 | SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7980 | SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7981 | SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7982 | SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7983 | SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7984 | SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7985 | SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
80a5052d | 7986 | SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
891afcf2 JS |
7987 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
7988 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), | |
7989 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), | |
b5acfe15 PH |
7990 | SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
7991 | SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7992 | SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7993 | SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7994 | SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7995 | SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7996 | SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7997 | SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7998 | SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
7999 | SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
ca169cc2 | 8000 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
ef0b3203 | 8001 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
1d045db9 TI |
8002 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
8003 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | |
8004 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | |
8005 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), | |
8006 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), | |
b590b38c | 8007 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), |
c8415a48 | 8008 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
84f98fdf | 8009 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
4407be6b | 8010 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
108cc108 | 8011 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
aaedfb47 | 8012 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
9a811230 | 8013 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
1c37c223 | 8014 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
a12137e7 | 8015 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
59a51a6b | 8016 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
6d16941a | 8017 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
7c21539c | 8018 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
a4a9e082 | 8019 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
b6903c0e | 8020 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
d05ea7da | 8021 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
c0278669 | 8022 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
61fcf8ec KY |
8023 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8024 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
dab38e43 | 8025 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
c636b95e | 8026 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8027 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
8028 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8029 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
e4c07b3b | 8030 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8031 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8032 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8033 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
85981dfd | 8034 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9774dc21 | 8035 | SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
ca707b3f | 8036 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
446b8185 KY |
8037 | SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
8038 | SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), | |
3694cb29 | 8039 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
6ef2f68f | 8040 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
f33f79f3 | 8041 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
bef33e19 | 8042 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
e41fc8c5 | 8043 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
65811834 | 8044 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
8da5bbfc | 8045 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
2a36c16e | 8046 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8a6c55d0 AM |
8047 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8048 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), | |
56f27013 | 8049 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
fedb2245 | 8050 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
56df90b6 | 8051 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
a4a9e082 | 8052 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
1bb3e062 | 8053 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
c497d9f9 | 8054 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
cd5302c0 | 8055 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
f2aa1110 | 8056 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
80b311d3 | 8057 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
09ea9976 | 8058 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
037e1197 | 8059 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
23adc192 | 8060 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
0f087ee3 | 8061 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
9cd25743 | 8062 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
0f087ee3 | 8063 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8064 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8065 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8066 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
cd5302c0 | 8067 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
61fcf8ec KY |
8068 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8069 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
012e7eb1 | 8070 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
1d045db9 | 8071 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
0fbf21c3 | 8072 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), |
f1ec5be1 HC |
8073 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
8074 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), | |
8075 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), | |
02b504d9 | 8076 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
fc19d559 | 8077 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
695d1ec3 | 8078 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
bd9c10bc | 8079 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
f1ec5be1 HC |
8080 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
8081 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), | |
e2d2fded | 8082 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
a4297b5d | 8083 | |
a7f3eedc | 8084 | #if 0 |
a4297b5d TI |
8085 | /* Below is a quirk table taken from the old code. |
8086 | * Basically the device should work as is without the fixup table. | |
8087 | * If BIOS doesn't give a proper info, enable the corresponding | |
8088 | * fixup entry. | |
7d7eb9ea | 8089 | */ |
a4297b5d TI |
8090 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
8091 | ALC269_FIXUP_AMIC), | |
8092 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), | |
a4297b5d TI |
8093 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
8094 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), | |
8095 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), | |
8096 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), | |
8097 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), | |
8098 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), | |
8099 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), | |
8100 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), | |
8101 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), | |
8102 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), | |
8103 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), | |
8104 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), | |
8105 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), | |
8106 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), | |
8107 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), | |
8108 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), | |
8109 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), | |
8110 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), | |
8111 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), | |
8112 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), | |
8113 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), | |
8114 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), | |
8115 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), | |
8116 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), | |
8117 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), | |
8118 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), | |
8119 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), | |
8120 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), | |
8121 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), | |
8122 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), | |
8123 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), | |
8124 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), | |
8125 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), | |
8126 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), | |
8127 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), | |
8128 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), | |
8129 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), | |
8130 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), | |
8131 | #endif | |
8132 | {} | |
8133 | }; | |
8134 | ||
214eef76 DH |
8135 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
8136 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), | |
8137 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | |
8138 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | |
8139 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), | |
0fbf21c3 | 8140 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
214eef76 DH |
8141 | {} |
8142 | }; | |
8143 | ||
1727a771 | 8144 | static const struct hda_model_fixup alc269_fixup_models[] = { |
a4297b5d TI |
8145 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
8146 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, | |
6e72aa5f TI |
8147 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
8148 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, | |
8149 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, | |
7c478f03 | 8150 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
b016951e TI |
8151 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
8152 | {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, | |
108cc108 | 8153 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
b590b38c | 8154 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
9f5c6faf | 8155 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
04d5466a | 8156 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, |
e32aa85a DH |
8157 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
8158 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | |
a26d96c7 TI |
8159 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
8160 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, | |
be8ef16a | 8161 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
0202e99c | 8162 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
1c37c223 | 8163 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
9a811230 | 8164 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
c636b95e | 8165 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
399c01aa | 8166 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
a26d96c7 | 8167 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
ba90d6a6 | 8168 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
28d1d6d2 | 8169 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
a26d96c7 TI |
8170 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
8171 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, | |
8172 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, | |
8173 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, | |
8174 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, | |
8175 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, | |
8176 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, | |
8177 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, | |
8178 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, | |
8179 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, | |
8180 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, | |
8181 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, | |
8182 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, | |
8183 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, | |
8184 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, | |
8185 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, | |
8186 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, | |
8187 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, | |
8188 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, | |
8189 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, | |
8190 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, | |
8191 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, | |
8192 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, | |
8193 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, | |
8194 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, | |
8195 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, | |
8196 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, | |
8197 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, | |
8198 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, | |
8199 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, | |
8200 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, | |
8201 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, | |
8202 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, | |
8203 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, | |
8204 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, | |
8205 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, | |
8206 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, | |
8207 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, | |
8208 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, | |
8209 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, | |
b3802783 | 8210 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
a26d96c7 TI |
8211 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
8212 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, | |
8213 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | |
8214 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, | |
8215 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, | |
8216 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, | |
8217 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, | |
8218 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, | |
8219 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, | |
8220 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, | |
8221 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, | |
8222 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, | |
8223 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, | |
8224 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, | |
8225 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, | |
a26d96c7 TI |
8226 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
8227 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, | |
8228 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, | |
82aa0d7e | 8229 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
a26d96c7 | 8230 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
d2cd795c | 8231 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
a26d96c7 TI |
8232 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
8233 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, | |
8234 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, | |
8235 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, | |
8236 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, | |
8237 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, | |
8238 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, | |
8239 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, | |
8240 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, | |
8241 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, | |
8242 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, | |
8243 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, | |
8244 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, | |
8245 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, | |
8246 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, | |
8247 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, | |
8248 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, | |
8983eb60 KY |
8249 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
8250 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, | |
e2a829b3 | 8251 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
a2ef03fe | 8252 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
bd9c10bc | 8253 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
23dc9586 | 8254 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
fc19d559 | 8255 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
13468bfa | 8256 | {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, |
1d045db9 | 8257 | {} |
6dda9f4a | 8258 | }; |
cfc5a845 | 8259 | #define ALC225_STANDARD_PINS \ |
cfc5a845 | 8260 | {0x21, 0x04211020} |
6dda9f4a | 8261 | |
e8191a8e HW |
8262 | #define ALC256_STANDARD_PINS \ |
8263 | {0x12, 0x90a60140}, \ | |
8264 | {0x14, 0x90170110}, \ | |
e8191a8e HW |
8265 | {0x21, 0x02211020} |
8266 | ||
fea185e2 | 8267 | #define ALC282_STANDARD_PINS \ |
11580297 | 8268 | {0x14, 0x90170110} |
e1e62b98 | 8269 | |
fea185e2 | 8270 | #define ALC290_STANDARD_PINS \ |
11580297 | 8271 | {0x12, 0x99a30130} |
fea185e2 DH |
8272 | |
8273 | #define ALC292_STANDARD_PINS \ | |
8274 | {0x14, 0x90170110}, \ | |
11580297 | 8275 | {0x15, 0x0221401f} |
977e6276 | 8276 | |
3f640970 HW |
8277 | #define ALC295_STANDARD_PINS \ |
8278 | {0x12, 0xb7a60130}, \ | |
8279 | {0x14, 0x90170110}, \ | |
3f640970 HW |
8280 | {0x21, 0x04211020} |
8281 | ||
703867e2 WS |
8282 | #define ALC298_STANDARD_PINS \ |
8283 | {0x12, 0x90a60130}, \ | |
8284 | {0x21, 0x03211020} | |
8285 | ||
e1918938 | 8286 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
8a328ac1 KY |
8287 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
8288 | {0x14, 0x01014020}, | |
8289 | {0x17, 0x90170110}, | |
8290 | {0x18, 0x02a11030}, | |
8291 | {0x19, 0x0181303F}, | |
8292 | {0x21, 0x0221102f}), | |
5824ce8d CC |
8293 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
8294 | {0x12, 0x90a601c0}, | |
8295 | {0x14, 0x90171120}, | |
8296 | {0x21, 0x02211030}), | |
615966ad CC |
8297 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
8298 | {0x14, 0x90170110}, | |
8299 | {0x1b, 0x90a70130}, | |
8300 | {0x21, 0x03211020}), | |
8301 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, | |
8302 | {0x1a, 0x90a70130}, | |
8303 | {0x1b, 0x90170110}, | |
8304 | {0x21, 0x03211020}), | |
2ae95577 | 8305 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 8306 | ALC225_STANDARD_PINS, |
8a132099 | 8307 | {0x12, 0xb7a60130}, |
cfc5a845 | 8308 | {0x14, 0x901701a0}), |
2ae95577 | 8309 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 8310 | ALC225_STANDARD_PINS, |
8a132099 | 8311 | {0x12, 0xb7a60130}, |
cfc5a845 | 8312 | {0x14, 0x901701b0}), |
8a132099 HW |
8313 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
8314 | ALC225_STANDARD_PINS, | |
8315 | {0x12, 0xb7a60150}, | |
8316 | {0x14, 0x901701a0}), | |
8317 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8318 | ALC225_STANDARD_PINS, | |
8319 | {0x12, 0xb7a60150}, | |
8320 | {0x14, 0x901701b0}), | |
8321 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8322 | ALC225_STANDARD_PINS, | |
8323 | {0x12, 0xb7a60130}, | |
8324 | {0x1b, 0x90170110}), | |
0ce48e17 KHF |
8325 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
8326 | {0x1b, 0x01111010}, | |
8327 | {0x1e, 0x01451130}, | |
8328 | {0x21, 0x02211020}), | |
986376b6 HW |
8329 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
8330 | {0x12, 0x90a60140}, | |
8331 | {0x14, 0x90170110}, | |
8332 | {0x19, 0x02a11030}, | |
8333 | {0x21, 0x02211020}), | |
e41fc8c5 HW |
8334 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8335 | {0x14, 0x90170110}, | |
8336 | {0x19, 0x02a11030}, | |
8337 | {0x1a, 0x02a11040}, | |
8338 | {0x1b, 0x01014020}, | |
8339 | {0x21, 0x0221101f}), | |
d06fb562 HW |
8340 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8341 | {0x14, 0x90170110}, | |
8342 | {0x19, 0x02a11030}, | |
8343 | {0x1a, 0x02a11040}, | |
8344 | {0x1b, 0x01011020}, | |
8345 | {0x21, 0x0221101f}), | |
c6b17f10 HW |
8346 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8347 | {0x14, 0x90170110}, | |
8348 | {0x19, 0x02a11020}, | |
8349 | {0x1a, 0x02a11030}, | |
8350 | {0x21, 0x0221101f}), | |
c77900e6 | 8351 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
c77900e6 | 8352 | {0x14, 0x90170110}, |
c77900e6 | 8353 | {0x21, 0x02211020}), |
86c72d1c HW |
8354 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8355 | {0x14, 0x90170130}, | |
8356 | {0x21, 0x02211040}), | |
76c2132e DH |
8357 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8358 | {0x12, 0x90a60140}, | |
8359 | {0x14, 0x90170110}, | |
76c2132e DH |
8360 | {0x21, 0x02211020}), |
8361 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8362 | {0x12, 0x90a60160}, | |
8363 | {0x14, 0x90170120}, | |
76c2132e | 8364 | {0x21, 0x02211030}), |
392c9da2 HW |
8365 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8366 | {0x14, 0x90170110}, | |
8367 | {0x1b, 0x02011020}, | |
8368 | {0x21, 0x0221101f}), | |
6aecd871 HW |
8369 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8370 | {0x14, 0x90170110}, | |
8371 | {0x1b, 0x01011020}, | |
8372 | {0x21, 0x0221101f}), | |
cba59972 | 8373 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
cba59972 | 8374 | {0x14, 0x90170130}, |
cba59972 | 8375 | {0x1b, 0x01014020}, |
cba59972 | 8376 | {0x21, 0x0221103f}), |
6aecd871 HW |
8377 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8378 | {0x14, 0x90170130}, | |
8379 | {0x1b, 0x01011020}, | |
8380 | {0x21, 0x0221103f}), | |
59ec4b57 HW |
8381 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8382 | {0x14, 0x90170130}, | |
8383 | {0x1b, 0x02011020}, | |
8384 | {0x21, 0x0221103f}), | |
e9c28e16 | 8385 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
e9c28e16 | 8386 | {0x14, 0x90170150}, |
e9c28e16 | 8387 | {0x1b, 0x02011020}, |
e9c28e16 WS |
8388 | {0x21, 0x0221105f}), |
8389 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
e9c28e16 | 8390 | {0x14, 0x90170110}, |
e9c28e16 | 8391 | {0x1b, 0x01014020}, |
e9c28e16 | 8392 | {0x21, 0x0221101f}), |
76c2132e DH |
8393 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8394 | {0x12, 0x90a60160}, | |
8395 | {0x14, 0x90170120}, | |
8396 | {0x17, 0x90170140}, | |
76c2132e DH |
8397 | {0x21, 0x0321102f}), |
8398 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8399 | {0x12, 0x90a60160}, | |
8400 | {0x14, 0x90170130}, | |
76c2132e DH |
8401 | {0x21, 0x02211040}), |
8402 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8403 | {0x12, 0x90a60160}, | |
8404 | {0x14, 0x90170140}, | |
76c2132e DH |
8405 | {0x21, 0x02211050}), |
8406 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8407 | {0x12, 0x90a60170}, | |
8408 | {0x14, 0x90170120}, | |
76c2132e DH |
8409 | {0x21, 0x02211030}), |
8410 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8411 | {0x12, 0x90a60170}, | |
8412 | {0x14, 0x90170130}, | |
76c2132e | 8413 | {0x21, 0x02211040}), |
0a1f90a9 HW |
8414 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8415 | {0x12, 0x90a60170}, | |
8416 | {0x14, 0x90171130}, | |
8417 | {0x21, 0x02211040}), | |
70658b99 | 8418 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
70658b99 HW |
8419 | {0x12, 0x90a60170}, |
8420 | {0x14, 0x90170140}, | |
70658b99 | 8421 | {0x21, 0x02211050}), |
9b5a4e39 | 8422 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9b5a4e39 DH |
8423 | {0x12, 0x90a60180}, |
8424 | {0x14, 0x90170130}, | |
9b5a4e39 | 8425 | {0x21, 0x02211040}), |
f90d83b3 AK |
8426 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8427 | {0x12, 0x90a60180}, | |
8428 | {0x14, 0x90170120}, | |
8429 | {0x21, 0x02211030}), | |
989dbe4a HW |
8430 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8431 | {0x1b, 0x01011020}, | |
8432 | {0x21, 0x02211010}), | |
c1732ede CC |
8433 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
8434 | {0x14, 0x90170110}, | |
8435 | {0x1b, 0x90a70130}, | |
8436 | {0x21, 0x04211020}), | |
8437 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, | |
8438 | {0x14, 0x90170110}, | |
8439 | {0x1b, 0x90a70130}, | |
8440 | {0x21, 0x03211020}), | |
a806ef1c CC |
8441 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8442 | {0x12, 0x90a60130}, | |
8443 | {0x14, 0x90170110}, | |
8444 | {0x21, 0x03211020}), | |
6ac371aa JHP |
8445 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8446 | {0x12, 0x90a60130}, | |
8447 | {0x14, 0x90170110}, | |
8448 | {0x21, 0x04211020}), | |
e1037354 JHP |
8449 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8450 | {0x1a, 0x90a70130}, | |
8451 | {0x1b, 0x90170110}, | |
8452 | {0x21, 0x03211020}), | |
8a8de09c KY |
8453 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, |
8454 | {0x17, 0x90170110}, | |
8455 | {0x19, 0x03a11030}, | |
8456 | {0x21, 0x03211020}), | |
cf51eb9d DH |
8457 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
8458 | {0x12, 0x90a60130}, | |
cf51eb9d DH |
8459 | {0x14, 0x90170110}, |
8460 | {0x15, 0x0421101f}, | |
11580297 | 8461 | {0x1a, 0x04a11020}), |
0279661b HW |
8462 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
8463 | {0x12, 0x90a60140}, | |
0279661b HW |
8464 | {0x14, 0x90170110}, |
8465 | {0x15, 0x0421101f}, | |
0279661b | 8466 | {0x18, 0x02811030}, |
0279661b | 8467 | {0x1a, 0x04a1103f}, |
11580297 | 8468 | {0x1b, 0x02011020}), |
42304474 | 8469 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8470 | ALC282_STANDARD_PINS, |
42304474 | 8471 | {0x12, 0x99a30130}, |
42304474 | 8472 | {0x19, 0x03a11020}, |
42304474 | 8473 | {0x21, 0x0321101f}), |
2c609999 | 8474 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8475 | ALC282_STANDARD_PINS, |
2c609999 | 8476 | {0x12, 0x99a30130}, |
2c609999 | 8477 | {0x19, 0x03a11020}, |
2c609999 HW |
8478 | {0x21, 0x03211040}), |
8479 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 8480 | ALC282_STANDARD_PINS, |
2c609999 | 8481 | {0x12, 0x99a30130}, |
2c609999 | 8482 | {0x19, 0x03a11030}, |
2c609999 HW |
8483 | {0x21, 0x03211020}), |
8484 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 8485 | ALC282_STANDARD_PINS, |
2c609999 | 8486 | {0x12, 0x99a30130}, |
2c609999 | 8487 | {0x19, 0x04a11020}, |
2c609999 | 8488 | {0x21, 0x0421101f}), |
200afc09 | 8489 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, |
aec856d0 | 8490 | ALC282_STANDARD_PINS, |
200afc09 | 8491 | {0x12, 0x90a60140}, |
200afc09 | 8492 | {0x19, 0x04a11030}, |
200afc09 | 8493 | {0x21, 0x04211020}), |
76c2132e | 8494 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 8495 | ALC282_STANDARD_PINS, |
76c2132e | 8496 | {0x12, 0x90a60130}, |
76c2132e DH |
8497 | {0x21, 0x0321101f}), |
8498 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8499 | {0x12, 0x90a60160}, | |
8500 | {0x14, 0x90170120}, | |
76c2132e | 8501 | {0x21, 0x02211030}), |
bc262179 | 8502 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 8503 | ALC282_STANDARD_PINS, |
bc262179 | 8504 | {0x12, 0x90a60130}, |
bc262179 | 8505 | {0x19, 0x03a11020}, |
bc262179 | 8506 | {0x21, 0x0321101f}), |
c8c6ee61 | 8507 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
c4cfcf6f HW |
8508 | {0x12, 0x90a60130}, |
8509 | {0x14, 0x90170110}, | |
8510 | {0x19, 0x04a11040}, | |
8511 | {0x21, 0x04211020}), | |
33aaebd4 CC |
8512 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
8513 | {0x12, 0x90a60130}, | |
8514 | {0x17, 0x90170110}, | |
8515 | {0x21, 0x02211020}), | |
d44a6864 | 8516 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
e1e62b98 | 8517 | {0x12, 0x90a60120}, |
e1e62b98 | 8518 | {0x14, 0x90170110}, |
e1e62b98 | 8519 | {0x21, 0x0321101f}), |
e4442bcf | 8520 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8521 | ALC290_STANDARD_PINS, |
e4442bcf | 8522 | {0x15, 0x04211040}, |
e4442bcf | 8523 | {0x18, 0x90170112}, |
11580297 | 8524 | {0x1a, 0x04a11020}), |
e4442bcf | 8525 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8526 | ALC290_STANDARD_PINS, |
e4442bcf | 8527 | {0x15, 0x04211040}, |
e4442bcf | 8528 | {0x18, 0x90170110}, |
11580297 | 8529 | {0x1a, 0x04a11020}), |
e4442bcf | 8530 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8531 | ALC290_STANDARD_PINS, |
e4442bcf | 8532 | {0x15, 0x0421101f}, |
11580297 | 8533 | {0x1a, 0x04a11020}), |
e4442bcf | 8534 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8535 | ALC290_STANDARD_PINS, |
e4442bcf | 8536 | {0x15, 0x04211020}, |
11580297 | 8537 | {0x1a, 0x04a11040}), |
e4442bcf | 8538 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8539 | ALC290_STANDARD_PINS, |
e4442bcf HW |
8540 | {0x14, 0x90170110}, |
8541 | {0x15, 0x04211020}, | |
11580297 | 8542 | {0x1a, 0x04a11040}), |
e4442bcf | 8543 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8544 | ALC290_STANDARD_PINS, |
e4442bcf HW |
8545 | {0x14, 0x90170110}, |
8546 | {0x15, 0x04211020}, | |
11580297 | 8547 | {0x1a, 0x04a11020}), |
e4442bcf | 8548 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 8549 | ALC290_STANDARD_PINS, |
e4442bcf HW |
8550 | {0x14, 0x90170110}, |
8551 | {0x15, 0x0421101f}, | |
11580297 | 8552 | {0x1a, 0x04a11020}), |
e8818fa8 | 8553 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 8554 | ALC292_STANDARD_PINS, |
e8818fa8 | 8555 | {0x12, 0x90a60140}, |
e8818fa8 | 8556 | {0x16, 0x01014020}, |
11580297 | 8557 | {0x19, 0x01a19030}), |
e8818fa8 | 8558 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 8559 | ALC292_STANDARD_PINS, |
e8818fa8 | 8560 | {0x12, 0x90a60140}, |
e8818fa8 HW |
8561 | {0x16, 0x01014020}, |
8562 | {0x18, 0x02a19031}, | |
11580297 | 8563 | {0x19, 0x01a1903e}), |
76c2132e | 8564 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
aec856d0 | 8565 | ALC292_STANDARD_PINS, |
11580297 | 8566 | {0x12, 0x90a60140}), |
76c2132e | 8567 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 8568 | ALC292_STANDARD_PINS, |
76c2132e | 8569 | {0x13, 0x90a60140}, |
76c2132e | 8570 | {0x16, 0x21014020}, |
11580297 | 8571 | {0x19, 0x21a19030}), |
e03fdbde | 8572 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 8573 | ALC292_STANDARD_PINS, |
11580297 | 8574 | {0x13, 0x90a60140}), |
d8ae458e CC |
8575 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
8576 | {0x14, 0x90170110}, | |
8577 | {0x1b, 0x90a70130}, | |
8578 | {0x21, 0x04211020}), | |
8bb37a2a JHP |
8579 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
8580 | {0x12, 0x90a60130}, | |
8581 | {0x17, 0x90170110}, | |
8582 | {0x21, 0x03211020}), | |
0bea4cc8 JHP |
8583 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
8584 | {0x12, 0x90a60130}, | |
8585 | {0x17, 0x90170110}, | |
8586 | {0x21, 0x04211020}), | |
3887c26c TI |
8587 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
8588 | {0x12, 0x90a60130}, | |
8589 | {0x17, 0x90170110}, | |
8590 | {0x21, 0x03211020}), | |
9e43342b | 8591 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
ad97d667 JHP |
8592 | {0x12, 0x90a60120}, |
8593 | {0x17, 0x90170110}, | |
8594 | {0x21, 0x04211030}), | |
8595 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9e43342b CC |
8596 | {0x12, 0x90a60130}, |
8597 | {0x17, 0x90170110}, | |
8598 | {0x21, 0x03211020}), | |
8599 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
8600 | {0x12, 0x90a60130}, | |
8601 | {0x17, 0x90170110}, | |
8602 | {0x21, 0x03211020}), | |
fbc57129 | 8603 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
0a29c57b KY |
8604 | {0x14, 0x90170110}, |
8605 | {0x21, 0x04211020}), | |
fbc57129 KY |
8606 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
8607 | {0x14, 0x90170110}, | |
8608 | {0x21, 0x04211030}), | |
3f640970 | 8609 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
f771d5bb HW |
8610 | ALC295_STANDARD_PINS, |
8611 | {0x17, 0x21014020}, | |
8612 | {0x18, 0x21a19030}), | |
8613 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8614 | ALC295_STANDARD_PINS, | |
8615 | {0x17, 0x21014040}, | |
8616 | {0x18, 0x21a19050}), | |
3f307834 HW |
8617 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
8618 | ALC295_STANDARD_PINS), | |
9f502ff5 TI |
8619 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
8620 | ALC298_STANDARD_PINS, | |
8621 | {0x17, 0x90170110}), | |
977e6276 | 8622 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
703867e2 WS |
8623 | ALC298_STANDARD_PINS, |
8624 | {0x17, 0x90170140}), | |
8625 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8626 | ALC298_STANDARD_PINS, | |
9f502ff5 | 8627 | {0x17, 0x90170150}), |
9f1bc2c4 KHF |
8628 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
8629 | {0x12, 0xb7a60140}, | |
8630 | {0x13, 0xb7a60150}, | |
8631 | {0x17, 0x90170110}, | |
8632 | {0x1a, 0x03011020}, | |
8633 | {0x21, 0x03211030}), | |
54324221 JM |
8634 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
8635 | {0x12, 0xb7a60140}, | |
8636 | {0x17, 0x90170110}, | |
8637 | {0x1a, 0x03a11030}, | |
8638 | {0x21, 0x03211020}), | |
fcc6c877 KY |
8639 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
8640 | ALC225_STANDARD_PINS, | |
8641 | {0x12, 0xb7a60130}, | |
fcc6c877 | 8642 | {0x17, 0x90170110}), |
573fcbfd HW |
8643 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
8644 | {0x14, 0x01014010}, | |
8645 | {0x17, 0x90170120}, | |
8646 | {0x18, 0x02a11030}, | |
8647 | {0x19, 0x02a1103f}, | |
8648 | {0x21, 0x0221101f}), | |
e1918938 HW |
8649 | {} |
8650 | }; | |
6dda9f4a | 8651 | |
7c0a6939 HW |
8652 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
8653 | * more machines, don't need to match all valid pins, just need to match | |
8654 | * all the pins defined in the tbl. Just because of this reason, it is possible | |
8655 | * that a single machine matches multiple tbls, so there is one limitation: | |
8656 | * at most one tbl is allowed to define for the same vendor and same codec | |
8657 | */ | |
8658 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { | |
8659 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, | |
8660 | {0x19, 0x40000000}, | |
8661 | {0x1b, 0x40000000}), | |
aed8c7f4 HW |
8662 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8663 | {0x19, 0x40000000}, | |
8664 | {0x1a, 0x40000000}), | |
d64ebdbf HW |
8665 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8666 | {0x19, 0x40000000}, | |
8667 | {0x1a, 0x40000000}), | |
5815bdfd HW |
8668 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
8669 | {0x19, 0x40000000}, | |
8670 | {0x1a, 0x40000000}), | |
7c0a6939 HW |
8671 | {} |
8672 | }; | |
8673 | ||
546bb678 | 8674 | static void alc269_fill_coef(struct hda_codec *codec) |
1d045db9 | 8675 | { |
526af6eb | 8676 | struct alc_spec *spec = codec->spec; |
1d045db9 | 8677 | int val; |
ebb83eeb | 8678 | |
526af6eb | 8679 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
546bb678 | 8680 | return; |
526af6eb | 8681 | |
1bb7e43e | 8682 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
1d045db9 TI |
8683 | alc_write_coef_idx(codec, 0xf, 0x960b); |
8684 | alc_write_coef_idx(codec, 0xe, 0x8817); | |
8685 | } | |
ebb83eeb | 8686 | |
1bb7e43e | 8687 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
1d045db9 TI |
8688 | alc_write_coef_idx(codec, 0xf, 0x960b); |
8689 | alc_write_coef_idx(codec, 0xe, 0x8814); | |
8690 | } | |
ebb83eeb | 8691 | |
1bb7e43e | 8692 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 | 8693 | /* Power up output pin */ |
98b24883 | 8694 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
1d045db9 | 8695 | } |
ebb83eeb | 8696 | |
1bb7e43e | 8697 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 | 8698 | val = alc_read_coef_idx(codec, 0xd); |
f3ee07d8 | 8699 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
1d045db9 TI |
8700 | /* Capless ramp up clock control */ |
8701 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); | |
8702 | } | |
8703 | val = alc_read_coef_idx(codec, 0x17); | |
f3ee07d8 | 8704 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
1d045db9 TI |
8705 | /* Class D power on reset */ |
8706 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); | |
8707 | } | |
8708 | } | |
ebb83eeb | 8709 | |
98b24883 TI |
8710 | /* HP */ |
8711 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); | |
1d045db9 | 8712 | } |
a7f2371f | 8713 | |
1d045db9 TI |
8714 | /* |
8715 | */ | |
1d045db9 TI |
8716 | static int patch_alc269(struct hda_codec *codec) |
8717 | { | |
8718 | struct alc_spec *spec; | |
3de95173 | 8719 | int err; |
f1d4e28b | 8720 | |
3de95173 | 8721 | err = alc_alloc_spec(codec, 0x0b); |
e16fb6d1 | 8722 | if (err < 0) |
3de95173 TI |
8723 | return err; |
8724 | ||
8725 | spec = codec->spec; | |
08c189f2 | 8726 | spec->gen.shared_mic_vref_pin = 0x18; |
317d9313 | 8727 | codec->power_save_node = 0; |
e16fb6d1 | 8728 | |
225068ab TI |
8729 | #ifdef CONFIG_PM |
8730 | codec->patch_ops.suspend = alc269_suspend; | |
8731 | codec->patch_ops.resume = alc269_resume; | |
8732 | #endif | |
c2d6af53 KY |
8733 | spec->shutup = alc_default_shutup; |
8734 | spec->init_hook = alc_default_init; | |
225068ab | 8735 | |
7639a06c | 8736 | switch (codec->core.vendor_id) { |
065380f0 | 8737 | case 0x10ec0269: |
1d045db9 | 8738 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
1bb7e43e TI |
8739 | switch (alc_get_coef0(codec) & 0x00f0) { |
8740 | case 0x0010: | |
5100cd07 TI |
8741 | if (codec->bus->pci && |
8742 | codec->bus->pci->subsystem_vendor == 0x1025 && | |
e16fb6d1 | 8743 | spec->cdefine.platform_type == 1) |
20ca0c35 | 8744 | err = alc_codec_rename(codec, "ALC271X"); |
1d045db9 | 8745 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
1bb7e43e TI |
8746 | break; |
8747 | case 0x0020: | |
5100cd07 TI |
8748 | if (codec->bus->pci && |
8749 | codec->bus->pci->subsystem_vendor == 0x17aa && | |
e16fb6d1 | 8750 | codec->bus->pci->subsystem_device == 0x21f3) |
20ca0c35 | 8751 | err = alc_codec_rename(codec, "ALC3202"); |
1d045db9 | 8752 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
1bb7e43e | 8753 | break; |
adcc70b2 KY |
8754 | case 0x0030: |
8755 | spec->codec_variant = ALC269_TYPE_ALC269VD; | |
8756 | break; | |
1bb7e43e | 8757 | default: |
1d045db9 | 8758 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
1bb7e43e | 8759 | } |
e16fb6d1 TI |
8760 | if (err < 0) |
8761 | goto error; | |
c2d6af53 | 8762 | spec->shutup = alc269_shutup; |
546bb678 | 8763 | spec->init_hook = alc269_fill_coef; |
1d045db9 | 8764 | alc269_fill_coef(codec); |
065380f0 KY |
8765 | break; |
8766 | ||
8767 | case 0x10ec0280: | |
8768 | case 0x10ec0290: | |
8769 | spec->codec_variant = ALC269_TYPE_ALC280; | |
8770 | break; | |
8771 | case 0x10ec0282: | |
065380f0 | 8772 | spec->codec_variant = ALC269_TYPE_ALC282; |
7b5c7a02 KY |
8773 | spec->shutup = alc282_shutup; |
8774 | spec->init_hook = alc282_init; | |
065380f0 | 8775 | break; |
2af02be7 KY |
8776 | case 0x10ec0233: |
8777 | case 0x10ec0283: | |
8778 | spec->codec_variant = ALC269_TYPE_ALC283; | |
8779 | spec->shutup = alc283_shutup; | |
8780 | spec->init_hook = alc283_init; | |
8781 | break; | |
065380f0 KY |
8782 | case 0x10ec0284: |
8783 | case 0x10ec0292: | |
8784 | spec->codec_variant = ALC269_TYPE_ALC284; | |
8785 | break; | |
161ebf29 | 8786 | case 0x10ec0293: |
4731d5de | 8787 | spec->codec_variant = ALC269_TYPE_ALC293; |
161ebf29 | 8788 | break; |
7fc7d047 | 8789 | case 0x10ec0286: |
7c665932 | 8790 | case 0x10ec0288: |
7fc7d047 KY |
8791 | spec->codec_variant = ALC269_TYPE_ALC286; |
8792 | break; | |
506b62c3 KY |
8793 | case 0x10ec0298: |
8794 | spec->codec_variant = ALC269_TYPE_ALC298; | |
8795 | break; | |
ea04a1db | 8796 | case 0x10ec0235: |
1d04c9de KY |
8797 | case 0x10ec0255: |
8798 | spec->codec_variant = ALC269_TYPE_ALC255; | |
ab3b8e51 KY |
8799 | spec->shutup = alc256_shutup; |
8800 | spec->init_hook = alc256_init; | |
1d04c9de | 8801 | break; |
736f20a7 | 8802 | case 0x10ec0236: |
4344aec8 KY |
8803 | case 0x10ec0256: |
8804 | spec->codec_variant = ALC269_TYPE_ALC256; | |
4a219ef8 KY |
8805 | spec->shutup = alc256_shutup; |
8806 | spec->init_hook = alc256_init; | |
7d1b6e29 | 8807 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
4344aec8 | 8808 | break; |
f429e7e4 KY |
8809 | case 0x10ec0257: |
8810 | spec->codec_variant = ALC269_TYPE_ALC257; | |
88d42b2b KY |
8811 | spec->shutup = alc256_shutup; |
8812 | spec->init_hook = alc256_init; | |
f429e7e4 KY |
8813 | spec->gen.mixer_nid = 0; |
8814 | break; | |
0a6f0600 | 8815 | case 0x10ec0215: |
7fbdcd83 | 8816 | case 0x10ec0245: |
0a6f0600 | 8817 | case 0x10ec0285: |
630e3612 | 8818 | case 0x10ec0287: |
0a6f0600 KY |
8819 | case 0x10ec0289: |
8820 | spec->codec_variant = ALC269_TYPE_ALC215; | |
1b6832be KY |
8821 | spec->shutup = alc225_shutup; |
8822 | spec->init_hook = alc225_init; | |
0a6f0600 KY |
8823 | spec->gen.mixer_nid = 0; |
8824 | break; | |
4231430d | 8825 | case 0x10ec0225: |
7d727869 | 8826 | case 0x10ec0295: |
28f1f9b2 | 8827 | case 0x10ec0299: |
4231430d | 8828 | spec->codec_variant = ALC269_TYPE_ALC225; |
da911b1f KY |
8829 | spec->shutup = alc225_shutup; |
8830 | spec->init_hook = alc225_init; | |
c1350bff | 8831 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
4231430d | 8832 | break; |
dcd4f0db KY |
8833 | case 0x10ec0234: |
8834 | case 0x10ec0274: | |
8835 | case 0x10ec0294: | |
8836 | spec->codec_variant = ALC269_TYPE_ALC294; | |
532a7784 | 8837 | spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ |
71683c32 | 8838 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
693abe11 | 8839 | spec->init_hook = alc294_init; |
dcd4f0db | 8840 | break; |
1078bef0 KY |
8841 | case 0x10ec0300: |
8842 | spec->codec_variant = ALC269_TYPE_ALC300; | |
8843 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ | |
dcd4f0db | 8844 | break; |
f0778871 KY |
8845 | case 0x10ec0623: |
8846 | spec->codec_variant = ALC269_TYPE_ALC623; | |
8847 | break; | |
6fbae35a KY |
8848 | case 0x10ec0700: |
8849 | case 0x10ec0701: | |
8850 | case 0x10ec0703: | |
83629532 | 8851 | case 0x10ec0711: |
6fbae35a KY |
8852 | spec->codec_variant = ALC269_TYPE_ALC700; |
8853 | spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ | |
2d7fe618 | 8854 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
693abe11 | 8855 | spec->init_hook = alc294_init; |
6fbae35a KY |
8856 | break; |
8857 | ||
1d045db9 | 8858 | } |
6dda9f4a | 8859 | |
ad60d502 | 8860 | if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { |
97a26570 | 8861 | spec->has_alc5505_dsp = 1; |
ad60d502 KY |
8862 | spec->init_hook = alc5505_dsp_init; |
8863 | } | |
8864 | ||
c9af753f TI |
8865 | alc_pre_init(codec); |
8866 | ||
efe55732 TI |
8867 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
8868 | alc269_fixup_tbl, alc269_fixups); | |
0fc1e447 | 8869 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); |
7c0a6939 | 8870 | snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); |
efe55732 TI |
8871 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
8872 | alc269_fixups); | |
8873 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
8874 | ||
8875 | alc_auto_parse_customize_define(codec); | |
8876 | ||
8877 | if (has_cdefine_beep(codec)) | |
8878 | spec->gen.beep_nid = 0x01; | |
8879 | ||
a4297b5d TI |
8880 | /* automatic parse from the BIOS config */ |
8881 | err = alc269_parse_auto_config(codec); | |
e16fb6d1 TI |
8882 | if (err < 0) |
8883 | goto error; | |
6dda9f4a | 8884 | |
fea80fae TI |
8885 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
8886 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); | |
8887 | if (err < 0) | |
8888 | goto error; | |
8889 | } | |
f1d4e28b | 8890 | |
1727a771 | 8891 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 8892 | |
1d045db9 | 8893 | return 0; |
e16fb6d1 TI |
8894 | |
8895 | error: | |
8896 | alc_free(codec); | |
8897 | return err; | |
1d045db9 | 8898 | } |
f1d4e28b | 8899 | |
1d045db9 TI |
8900 | /* |
8901 | * ALC861 | |
8902 | */ | |
622e84cd | 8903 | |
1d045db9 | 8904 | static int alc861_parse_auto_config(struct hda_codec *codec) |
6dda9f4a | 8905 | { |
1d045db9 | 8906 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
8907 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
8908 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); | |
604401a9 TI |
8909 | } |
8910 | ||
1d045db9 TI |
8911 | /* Pin config fixes */ |
8912 | enum { | |
e652f4c8 TI |
8913 | ALC861_FIXUP_FSC_AMILO_PI1505, |
8914 | ALC861_FIXUP_AMP_VREF_0F, | |
8915 | ALC861_FIXUP_NO_JACK_DETECT, | |
8916 | ALC861_FIXUP_ASUS_A6RP, | |
6ddf0fd1 | 8917 | ALC660_FIXUP_ASUS_W7J, |
1d045db9 | 8918 | }; |
7085ec12 | 8919 | |
31150f23 TI |
8920 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
8921 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, | |
1727a771 | 8922 | const struct hda_fixup *fix, int action) |
31150f23 TI |
8923 | { |
8924 | struct alc_spec *spec = codec->spec; | |
8925 | unsigned int val; | |
8926 | ||
1727a771 | 8927 | if (action != HDA_FIXUP_ACT_INIT) |
31150f23 | 8928 | return; |
d3f02d60 | 8929 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
31150f23 TI |
8930 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
8931 | val |= AC_PINCTL_IN_EN; | |
8932 | val |= AC_PINCTL_VREF_50; | |
cdd03ced | 8933 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
08c189f2 | 8934 | spec->gen.keep_vref_in_automute = 1; |
31150f23 TI |
8935 | } |
8936 | ||
e652f4c8 TI |
8937 | /* suppress the jack-detection */ |
8938 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, | |
1727a771 | 8939 | const struct hda_fixup *fix, int action) |
e652f4c8 | 8940 | { |
1727a771 | 8941 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
e652f4c8 | 8942 | codec->no_jack_detect = 1; |
7d7eb9ea | 8943 | } |
e652f4c8 | 8944 | |
1727a771 | 8945 | static const struct hda_fixup alc861_fixups[] = { |
e652f4c8 | 8946 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
1727a771 TI |
8947 | .type = HDA_FIXUP_PINS, |
8948 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
8949 | { 0x0b, 0x0221101f }, /* HP */ |
8950 | { 0x0f, 0x90170310 }, /* speaker */ | |
8951 | { } | |
8952 | } | |
8953 | }, | |
e652f4c8 | 8954 | [ALC861_FIXUP_AMP_VREF_0F] = { |
1727a771 | 8955 | .type = HDA_FIXUP_FUNC, |
31150f23 | 8956 | .v.func = alc861_fixup_asus_amp_vref_0f, |
3b25eb69 | 8957 | }, |
e652f4c8 | 8958 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 8959 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
8960 | .v.func = alc_fixup_no_jack_detect, |
8961 | }, | |
8962 | [ALC861_FIXUP_ASUS_A6RP] = { | |
1727a771 | 8963 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
8964 | .v.func = alc861_fixup_asus_amp_vref_0f, |
8965 | .chained = true, | |
8966 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, | |
6ddf0fd1 TI |
8967 | }, |
8968 | [ALC660_FIXUP_ASUS_W7J] = { | |
8969 | .type = HDA_FIXUP_VERBS, | |
8970 | .v.verbs = (const struct hda_verb[]) { | |
8971 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 | |
8972 | * for enabling outputs | |
8973 | */ | |
8974 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | |
8975 | { } | |
8976 | }, | |
e652f4c8 | 8977 | } |
1d045db9 | 8978 | }; |
7085ec12 | 8979 | |
1d045db9 | 8980 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
6ddf0fd1 | 8981 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
e7ca237b | 8982 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
e652f4c8 TI |
8983 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
8984 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), | |
8985 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), | |
8986 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), | |
8987 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), | |
8988 | SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), | |
1d045db9 TI |
8989 | {} |
8990 | }; | |
3af9ee6b | 8991 | |
1d045db9 TI |
8992 | /* |
8993 | */ | |
1d045db9 | 8994 | static int patch_alc861(struct hda_codec *codec) |
7085ec12 | 8995 | { |
1d045db9 | 8996 | struct alc_spec *spec; |
1d045db9 | 8997 | int err; |
7085ec12 | 8998 | |
3de95173 TI |
8999 | err = alc_alloc_spec(codec, 0x15); |
9000 | if (err < 0) | |
9001 | return err; | |
1d045db9 | 9002 | |
3de95173 | 9003 | spec = codec->spec; |
2722b535 TI |
9004 | if (has_cdefine_beep(codec)) |
9005 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 9006 | |
225068ab TI |
9007 | #ifdef CONFIG_PM |
9008 | spec->power_hook = alc_power_eapd; | |
9009 | #endif | |
9010 | ||
c9af753f TI |
9011 | alc_pre_init(codec); |
9012 | ||
1727a771 TI |
9013 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
9014 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
3af9ee6b | 9015 | |
cb4e4824 TI |
9016 | /* automatic parse from the BIOS config */ |
9017 | err = alc861_parse_auto_config(codec); | |
e16fb6d1 TI |
9018 | if (err < 0) |
9019 | goto error; | |
3af9ee6b | 9020 | |
fea80fae TI |
9021 | if (!spec->gen.no_analog) { |
9022 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | |
9023 | if (err < 0) | |
9024 | goto error; | |
9025 | } | |
7085ec12 | 9026 | |
1727a771 | 9027 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9028 | |
1d045db9 | 9029 | return 0; |
e16fb6d1 TI |
9030 | |
9031 | error: | |
9032 | alc_free(codec); | |
9033 | return err; | |
7085ec12 TI |
9034 | } |
9035 | ||
1d045db9 TI |
9036 | /* |
9037 | * ALC861-VD support | |
9038 | * | |
9039 | * Based on ALC882 | |
9040 | * | |
9041 | * In addition, an independent DAC | |
9042 | */ | |
1d045db9 | 9043 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
bc9f98a9 | 9044 | { |
1d045db9 | 9045 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9046 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
9047 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); | |
ce764ab2 TI |
9048 | } |
9049 | ||
1d045db9 | 9050 | enum { |
8fdcb6fe TI |
9051 | ALC660VD_FIX_ASUS_GPIO1, |
9052 | ALC861VD_FIX_DALLAS, | |
1d045db9 | 9053 | }; |
ce764ab2 | 9054 | |
8fdcb6fe TI |
9055 | /* exclude VREF80 */ |
9056 | static void alc861vd_fixup_dallas(struct hda_codec *codec, | |
1727a771 | 9057 | const struct hda_fixup *fix, int action) |
8fdcb6fe | 9058 | { |
1727a771 | 9059 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
b78562b1 TI |
9060 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
9061 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); | |
8fdcb6fe TI |
9062 | } |
9063 | } | |
9064 | ||
df73d83f TI |
9065 | /* reset GPIO1 */ |
9066 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, | |
9067 | const struct hda_fixup *fix, int action) | |
9068 | { | |
9069 | struct alc_spec *spec = codec->spec; | |
9070 | ||
9071 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
9072 | spec->gpio_mask |= 0x02; | |
9073 | alc_fixup_gpio(codec, action, 0x01); | |
9074 | } | |
9075 | ||
1727a771 | 9076 | static const struct hda_fixup alc861vd_fixups[] = { |
1d045db9 | 9077 | [ALC660VD_FIX_ASUS_GPIO1] = { |
df73d83f TI |
9078 | .type = HDA_FIXUP_FUNC, |
9079 | .v.func = alc660vd_fixup_asus_gpio1, | |
1d045db9 | 9080 | }, |
8fdcb6fe | 9081 | [ALC861VD_FIX_DALLAS] = { |
1727a771 | 9082 | .type = HDA_FIXUP_FUNC, |
8fdcb6fe TI |
9083 | .v.func = alc861vd_fixup_dallas, |
9084 | }, | |
1d045db9 | 9085 | }; |
ce764ab2 | 9086 | |
1d045db9 | 9087 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
8fdcb6fe | 9088 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
1d045db9 | 9089 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
8fdcb6fe | 9090 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
1d045db9 TI |
9091 | {} |
9092 | }; | |
ce764ab2 | 9093 | |
1d045db9 TI |
9094 | /* |
9095 | */ | |
1d045db9 | 9096 | static int patch_alc861vd(struct hda_codec *codec) |
ce764ab2 | 9097 | { |
1d045db9 | 9098 | struct alc_spec *spec; |
cb4e4824 | 9099 | int err; |
ce764ab2 | 9100 | |
3de95173 TI |
9101 | err = alc_alloc_spec(codec, 0x0b); |
9102 | if (err < 0) | |
9103 | return err; | |
1d045db9 | 9104 | |
3de95173 | 9105 | spec = codec->spec; |
2722b535 TI |
9106 | if (has_cdefine_beep(codec)) |
9107 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 9108 | |
225068ab TI |
9109 | spec->shutup = alc_eapd_shutup; |
9110 | ||
c9af753f TI |
9111 | alc_pre_init(codec); |
9112 | ||
1727a771 TI |
9113 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
9114 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
1d045db9 | 9115 | |
cb4e4824 TI |
9116 | /* automatic parse from the BIOS config */ |
9117 | err = alc861vd_parse_auto_config(codec); | |
e16fb6d1 TI |
9118 | if (err < 0) |
9119 | goto error; | |
ce764ab2 | 9120 | |
fea80fae TI |
9121 | if (!spec->gen.no_analog) { |
9122 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
9123 | if (err < 0) | |
9124 | goto error; | |
9125 | } | |
1d045db9 | 9126 | |
1727a771 | 9127 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9128 | |
ce764ab2 | 9129 | return 0; |
e16fb6d1 TI |
9130 | |
9131 | error: | |
9132 | alc_free(codec); | |
9133 | return err; | |
ce764ab2 TI |
9134 | } |
9135 | ||
1d045db9 TI |
9136 | /* |
9137 | * ALC662 support | |
9138 | * | |
9139 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible | |
9140 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
9141 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
9142 | * 6-channel independent captures. | |
9143 | * | |
9144 | * In addition, an independent DAC for the multi-playback (not used in this | |
9145 | * driver yet). | |
9146 | */ | |
1d045db9 TI |
9147 | |
9148 | /* | |
9149 | * BIOS auto configuration | |
9150 | */ | |
9151 | ||
bc9f98a9 KY |
9152 | static int alc662_parse_auto_config(struct hda_codec *codec) |
9153 | { | |
4c6d72d1 | 9154 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9155 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
9156 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
9157 | const hda_nid_t *ssids; | |
ee979a14 | 9158 | |
7639a06c TI |
9159 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
9160 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || | |
9161 | codec->core.vendor_id == 0x10ec0671) | |
3e6179b8 | 9162 | ssids = alc663_ssids; |
6227cdce | 9163 | else |
3e6179b8 TI |
9164 | ssids = alc662_ssids; |
9165 | return alc_parse_auto_config(codec, alc662_ignore, ssids); | |
bc9f98a9 KY |
9166 | } |
9167 | ||
6be7948f | 9168 | static void alc272_fixup_mario(struct hda_codec *codec, |
1727a771 | 9169 | const struct hda_fixup *fix, int action) |
6fc398cb | 9170 | { |
9bb1f06f | 9171 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
6fc398cb | 9172 | return; |
6be7948f TB |
9173 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
9174 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | | |
9175 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
9176 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
9177 | (0 << AC_AMPCAP_MUTE_SHIFT))) | |
4e76a883 | 9178 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
6be7948f TB |
9179 | } |
9180 | ||
8e383953 TI |
9181 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
9182 | { .channels = 2, | |
9183 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, | |
9184 | { .channels = 4, | |
9185 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, | |
9186 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ | |
9187 | { } | |
9188 | }; | |
9189 | ||
9190 | /* override the 2.1 chmap */ | |
eb9ca3ab | 9191 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
8e383953 TI |
9192 | const struct hda_fixup *fix, int action) |
9193 | { | |
9194 | if (action == HDA_FIXUP_ACT_BUILD) { | |
9195 | struct alc_spec *spec = codec->spec; | |
bbbc7e85 | 9196 | spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; |
8e383953 TI |
9197 | } |
9198 | } | |
9199 | ||
bf68665d TI |
9200 | /* avoid D3 for keeping GPIO up */ |
9201 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, | |
9202 | hda_nid_t nid, | |
9203 | unsigned int power_state) | |
9204 | { | |
9205 | struct alc_spec *spec = codec->spec; | |
d261eec8 | 9206 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) |
bf68665d TI |
9207 | return AC_PWRST_D0; |
9208 | return power_state; | |
9209 | } | |
9210 | ||
3e887f37 TI |
9211 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
9212 | const struct hda_fixup *fix, int action) | |
9213 | { | |
9214 | struct alc_spec *spec = codec->spec; | |
3e887f37 | 9215 | |
01e4a275 | 9216 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
3e887f37 | 9217 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
0f32fd19 | 9218 | spec->mute_led_polarity = 1; |
bf68665d | 9219 | codec->power_filter = gpio_led_power_filter; |
3e887f37 TI |
9220 | } |
9221 | } | |
9222 | ||
c6790c8e KY |
9223 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
9224 | struct hda_jack_callback *jack) | |
9225 | { | |
9226 | struct alc_spec *spec = codec->spec; | |
9227 | int vref; | |
9228 | msleep(200); | |
9229 | snd_hda_gen_hp_automute(codec, jack); | |
9230 | ||
9231 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
9232 | msleep(100); | |
9233 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
9234 | vref); | |
9235 | } | |
9236 | ||
9237 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, | |
9238 | const struct hda_fixup *fix, int action) | |
9239 | { | |
9240 | struct alc_spec *spec = codec->spec; | |
9241 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
9242 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
9243 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; | |
9244 | } | |
9245 | } | |
9246 | ||
00066e97 SB |
9247 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
9248 | struct hda_jack_callback *cb) | |
9249 | { | |
9250 | /* surround speakers at 0x1b already get muted automatically when | |
9251 | * headphones are plugged in, but we have to mute/unmute the remaining | |
9252 | * channels manually: | |
9253 | * 0x15 - front left/front right | |
9254 | * 0x18 - front center/ LFE | |
9255 | */ | |
9256 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { | |
9257 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); | |
9258 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); | |
9259 | } else { | |
9260 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); | |
9261 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); | |
9262 | } | |
9263 | } | |
9264 | ||
9265 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, | |
9266 | const struct hda_fixup *fix, int action) | |
9267 | { | |
9268 | /* Pin 0x1b: shared headphones jack and surround speakers */ | |
9269 | if (!is_jack_detectable(codec, 0x1b)) | |
9270 | return; | |
9271 | ||
9272 | switch (action) { | |
9273 | case HDA_FIXUP_ACT_PRE_PROBE: | |
9274 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
9275 | alc662_aspire_ethos_mute_speakers); | |
336820c4 TI |
9276 | /* subwoofer needs an extra GPIO setting to become audible */ |
9277 | alc_setup_gpio(codec, 0x02); | |
00066e97 SB |
9278 | break; |
9279 | case HDA_FIXUP_ACT_INIT: | |
9280 | /* Make sure to start in a correct state, i.e. if | |
9281 | * headphones have been plugged in before powering up the system | |
9282 | */ | |
9283 | alc662_aspire_ethos_mute_speakers(codec, NULL); | |
9284 | break; | |
9285 | } | |
9286 | } | |
9287 | ||
5af29028 KY |
9288 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
9289 | const struct hda_fixup *fix, int action) | |
9290 | { | |
9291 | struct alc_spec *spec = codec->spec; | |
9292 | ||
9293 | static const struct hda_pintbl pincfgs[] = { | |
9294 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ | |
9295 | { 0x1b, 0x0181304f }, | |
9296 | { } | |
9297 | }; | |
9298 | ||
9299 | switch (action) { | |
9300 | case HDA_FIXUP_ACT_PRE_PROBE: | |
9301 | spec->gen.mixer_nid = 0; | |
9302 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
9303 | snd_hda_apply_pincfgs(codec, pincfgs); | |
9304 | break; | |
9305 | case HDA_FIXUP_ACT_INIT: | |
9306 | alc_write_coef_idx(codec, 0x19, 0xa054); | |
9307 | break; | |
9308 | } | |
9309 | } | |
9310 | ||
6b0f95c4 | 9311 | static const struct coef_fw alc668_coefs[] = { |
f3f9185f KY |
9312 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
9313 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), | |
9314 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), | |
9315 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), | |
9316 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), | |
9317 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), | |
9318 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), | |
9319 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), | |
9320 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), | |
9321 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), | |
9322 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), | |
9323 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), | |
9324 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), | |
9325 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), | |
9326 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), | |
9327 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), | |
9328 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), | |
9329 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), | |
9330 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), | |
9331 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), | |
9332 | {} | |
9333 | }; | |
9334 | ||
9335 | static void alc668_restore_default_value(struct hda_codec *codec) | |
9336 | { | |
9337 | alc_process_coef_fw(codec, alc668_coefs); | |
9338 | } | |
9339 | ||
6cb3b707 | 9340 | enum { |
2df03514 | 9341 | ALC662_FIXUP_ASPIRE, |
3e887f37 | 9342 | ALC662_FIXUP_LED_GPIO1, |
6cb3b707 | 9343 | ALC662_FIXUP_IDEAPAD, |
6be7948f | 9344 | ALC272_FIXUP_MARIO, |
f1ec5be1 | 9345 | ALC662_FIXUP_CZC_ET26, |
d2ebd479 | 9346 | ALC662_FIXUP_CZC_P10T, |
94024cd1 | 9347 | ALC662_FIXUP_SKU_IGNORE, |
e59ea3ed | 9348 | ALC662_FIXUP_HP_RP5800, |
53c334ad TI |
9349 | ALC662_FIXUP_ASUS_MODE1, |
9350 | ALC662_FIXUP_ASUS_MODE2, | |
9351 | ALC662_FIXUP_ASUS_MODE3, | |
9352 | ALC662_FIXUP_ASUS_MODE4, | |
9353 | ALC662_FIXUP_ASUS_MODE5, | |
9354 | ALC662_FIXUP_ASUS_MODE6, | |
9355 | ALC662_FIXUP_ASUS_MODE7, | |
9356 | ALC662_FIXUP_ASUS_MODE8, | |
1565cc35 | 9357 | ALC662_FIXUP_NO_JACK_DETECT, |
edfe3bfc | 9358 | ALC662_FIXUP_ZOTAC_Z68, |
125821ae | 9359 | ALC662_FIXUP_INV_DMIC, |
1f8b46cd | 9360 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
73bdd597 | 9361 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 9362 | ALC662_FIXUP_HEADSET_MODE, |
73bdd597 | 9363 | ALC668_FIXUP_HEADSET_MODE, |
8e54b4ac | 9364 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
61a75f13 | 9365 | ALC662_FIXUP_BASS_16, |
a30c9aaa | 9366 | ALC662_FIXUP_BASS_1A, |
8e54b4ac | 9367 | ALC662_FIXUP_BASS_CHMAP, |
493a52a9 | 9368 | ALC668_FIXUP_AUTO_MUTE, |
5e6db669 | 9369 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
033b0a7c | 9370 | ALC668_FIXUP_DELL_XPS13, |
9d4dc584 | 9371 | ALC662_FIXUP_ASUS_Nx50, |
fc7438b1 | 9372 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 9373 | ALC668_FIXUP_ASUS_Nx51, |
5b7c5e1f | 9374 | ALC668_FIXUP_MIC_COEF, |
11ba6111 | 9375 | ALC668_FIXUP_ASUS_G751, |
78f4f7c2 KY |
9376 | ALC891_FIXUP_HEADSET_MODE, |
9377 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, | |
9b51fe3e | 9378 | ALC662_FIXUP_ACER_VERITON, |
1a3f0991 | 9379 | ALC892_FIXUP_ASROCK_MOBO, |
c6790c8e KY |
9380 | ALC662_FIXUP_USI_FUNC, |
9381 | ALC662_FIXUP_USI_HEADSET_MODE, | |
ca169cc2 | 9382 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
00066e97 | 9383 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
00066e97 | 9384 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
5af29028 | 9385 | ALC671_FIXUP_HP_HEADSET_MIC2, |
d858c706 | 9386 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
a124458a | 9387 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
6cb3b707 DH |
9388 | }; |
9389 | ||
1727a771 | 9390 | static const struct hda_fixup alc662_fixups[] = { |
2df03514 | 9391 | [ALC662_FIXUP_ASPIRE] = { |
1727a771 TI |
9392 | .type = HDA_FIXUP_PINS, |
9393 | .v.pins = (const struct hda_pintbl[]) { | |
2df03514 DC |
9394 | { 0x15, 0x99130112 }, /* subwoofer */ |
9395 | { } | |
9396 | } | |
9397 | }, | |
3e887f37 TI |
9398 | [ALC662_FIXUP_LED_GPIO1] = { |
9399 | .type = HDA_FIXUP_FUNC, | |
9400 | .v.func = alc662_fixup_led_gpio1, | |
9401 | }, | |
6cb3b707 | 9402 | [ALC662_FIXUP_IDEAPAD] = { |
1727a771 TI |
9403 | .type = HDA_FIXUP_PINS, |
9404 | .v.pins = (const struct hda_pintbl[]) { | |
6cb3b707 DH |
9405 | { 0x17, 0x99130112 }, /* subwoofer */ |
9406 | { } | |
3e887f37 TI |
9407 | }, |
9408 | .chained = true, | |
9409 | .chain_id = ALC662_FIXUP_LED_GPIO1, | |
6cb3b707 | 9410 | }, |
6be7948f | 9411 | [ALC272_FIXUP_MARIO] = { |
1727a771 | 9412 | .type = HDA_FIXUP_FUNC, |
b5bfbc67 | 9413 | .v.func = alc272_fixup_mario, |
d2ebd479 | 9414 | }, |
f1ec5be1 HC |
9415 | [ALC662_FIXUP_CZC_ET26] = { |
9416 | .type = HDA_FIXUP_PINS, | |
9417 | .v.pins = (const struct hda_pintbl[]) { | |
9418 | {0x12, 0x403cc000}, | |
9419 | {0x14, 0x90170110}, /* speaker */ | |
9420 | {0x15, 0x411111f0}, | |
9421 | {0x16, 0x411111f0}, | |
9422 | {0x18, 0x01a19030}, /* mic */ | |
9423 | {0x19, 0x90a7013f}, /* int-mic */ | |
9424 | {0x1a, 0x01014020}, | |
9425 | {0x1b, 0x0121401f}, | |
9426 | {0x1c, 0x411111f0}, | |
9427 | {0x1d, 0x411111f0}, | |
9428 | {0x1e, 0x40478e35}, | |
9429 | {} | |
9430 | }, | |
9431 | .chained = true, | |
9432 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9433 | }, | |
d2ebd479 | 9434 | [ALC662_FIXUP_CZC_P10T] = { |
1727a771 | 9435 | .type = HDA_FIXUP_VERBS, |
d2ebd479 AA |
9436 | .v.verbs = (const struct hda_verb[]) { |
9437 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
9438 | {} | |
9439 | } | |
9440 | }, | |
94024cd1 | 9441 | [ALC662_FIXUP_SKU_IGNORE] = { |
1727a771 | 9442 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 9443 | .v.func = alc_fixup_sku_ignore, |
c6b35874 | 9444 | }, |
e59ea3ed | 9445 | [ALC662_FIXUP_HP_RP5800] = { |
1727a771 TI |
9446 | .type = HDA_FIXUP_PINS, |
9447 | .v.pins = (const struct hda_pintbl[]) { | |
e59ea3ed TI |
9448 | { 0x14, 0x0221201f }, /* HP out */ |
9449 | { } | |
9450 | }, | |
9451 | .chained = true, | |
9452 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9453 | }, | |
53c334ad | 9454 | [ALC662_FIXUP_ASUS_MODE1] = { |
1727a771 TI |
9455 | .type = HDA_FIXUP_PINS, |
9456 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9457 | { 0x14, 0x99130110 }, /* speaker */ |
9458 | { 0x18, 0x01a19c20 }, /* mic */ | |
9459 | { 0x19, 0x99a3092f }, /* int-mic */ | |
9460 | { 0x21, 0x0121401f }, /* HP out */ | |
9461 | { } | |
9462 | }, | |
9463 | .chained = true, | |
9464 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9465 | }, | |
9466 | [ALC662_FIXUP_ASUS_MODE2] = { | |
1727a771 TI |
9467 | .type = HDA_FIXUP_PINS, |
9468 | .v.pins = (const struct hda_pintbl[]) { | |
2996bdba TI |
9469 | { 0x14, 0x99130110 }, /* speaker */ |
9470 | { 0x18, 0x01a19820 }, /* mic */ | |
9471 | { 0x19, 0x99a3092f }, /* int-mic */ | |
9472 | { 0x1b, 0x0121401f }, /* HP out */ | |
9473 | { } | |
9474 | }, | |
53c334ad TI |
9475 | .chained = true, |
9476 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9477 | }, | |
9478 | [ALC662_FIXUP_ASUS_MODE3] = { | |
1727a771 TI |
9479 | .type = HDA_FIXUP_PINS, |
9480 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9481 | { 0x14, 0x99130110 }, /* speaker */ |
9482 | { 0x15, 0x0121441f }, /* HP */ | |
9483 | { 0x18, 0x01a19840 }, /* mic */ | |
9484 | { 0x19, 0x99a3094f }, /* int-mic */ | |
9485 | { 0x21, 0x01211420 }, /* HP2 */ | |
9486 | { } | |
9487 | }, | |
9488 | .chained = true, | |
9489 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9490 | }, | |
9491 | [ALC662_FIXUP_ASUS_MODE4] = { | |
1727a771 TI |
9492 | .type = HDA_FIXUP_PINS, |
9493 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9494 | { 0x14, 0x99130110 }, /* speaker */ |
9495 | { 0x16, 0x99130111 }, /* speaker */ | |
9496 | { 0x18, 0x01a19840 }, /* mic */ | |
9497 | { 0x19, 0x99a3094f }, /* int-mic */ | |
9498 | { 0x21, 0x0121441f }, /* HP */ | |
9499 | { } | |
9500 | }, | |
9501 | .chained = true, | |
9502 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9503 | }, | |
9504 | [ALC662_FIXUP_ASUS_MODE5] = { | |
1727a771 TI |
9505 | .type = HDA_FIXUP_PINS, |
9506 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9507 | { 0x14, 0x99130110 }, /* speaker */ |
9508 | { 0x15, 0x0121441f }, /* HP */ | |
9509 | { 0x16, 0x99130111 }, /* speaker */ | |
9510 | { 0x18, 0x01a19840 }, /* mic */ | |
9511 | { 0x19, 0x99a3094f }, /* int-mic */ | |
9512 | { } | |
9513 | }, | |
9514 | .chained = true, | |
9515 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9516 | }, | |
9517 | [ALC662_FIXUP_ASUS_MODE6] = { | |
1727a771 TI |
9518 | .type = HDA_FIXUP_PINS, |
9519 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9520 | { 0x14, 0x99130110 }, /* speaker */ |
9521 | { 0x15, 0x01211420 }, /* HP2 */ | |
9522 | { 0x18, 0x01a19840 }, /* mic */ | |
9523 | { 0x19, 0x99a3094f }, /* int-mic */ | |
9524 | { 0x1b, 0x0121441f }, /* HP */ | |
9525 | { } | |
9526 | }, | |
9527 | .chained = true, | |
9528 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9529 | }, | |
9530 | [ALC662_FIXUP_ASUS_MODE7] = { | |
1727a771 TI |
9531 | .type = HDA_FIXUP_PINS, |
9532 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9533 | { 0x14, 0x99130110 }, /* speaker */ |
9534 | { 0x17, 0x99130111 }, /* speaker */ | |
9535 | { 0x18, 0x01a19840 }, /* mic */ | |
9536 | { 0x19, 0x99a3094f }, /* int-mic */ | |
9537 | { 0x1b, 0x01214020 }, /* HP */ | |
9538 | { 0x21, 0x0121401f }, /* HP */ | |
9539 | { } | |
9540 | }, | |
9541 | .chained = true, | |
9542 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
9543 | }, | |
9544 | [ALC662_FIXUP_ASUS_MODE8] = { | |
1727a771 TI |
9545 | .type = HDA_FIXUP_PINS, |
9546 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
9547 | { 0x14, 0x99130110 }, /* speaker */ |
9548 | { 0x12, 0x99a30970 }, /* int-mic */ | |
9549 | { 0x15, 0x01214020 }, /* HP */ | |
9550 | { 0x17, 0x99130111 }, /* speaker */ | |
9551 | { 0x18, 0x01a19840 }, /* mic */ | |
9552 | { 0x21, 0x0121401f }, /* HP */ | |
9553 | { } | |
9554 | }, | |
9555 | .chained = true, | |
9556 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
2996bdba | 9557 | }, |
1565cc35 | 9558 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 9559 | .type = HDA_FIXUP_FUNC, |
1565cc35 TI |
9560 | .v.func = alc_fixup_no_jack_detect, |
9561 | }, | |
edfe3bfc | 9562 | [ALC662_FIXUP_ZOTAC_Z68] = { |
1727a771 TI |
9563 | .type = HDA_FIXUP_PINS, |
9564 | .v.pins = (const struct hda_pintbl[]) { | |
edfe3bfc DH |
9565 | { 0x1b, 0x02214020 }, /* Front HP */ |
9566 | { } | |
9567 | } | |
9568 | }, | |
125821ae | 9569 | [ALC662_FIXUP_INV_DMIC] = { |
1727a771 | 9570 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 9571 | .v.func = alc_fixup_inv_dmic, |
125821ae | 9572 | }, |
033b0a7c GM |
9573 | [ALC668_FIXUP_DELL_XPS13] = { |
9574 | .type = HDA_FIXUP_FUNC, | |
9575 | .v.func = alc_fixup_dell_xps13, | |
9576 | .chained = true, | |
9577 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX | |
9578 | }, | |
5e6db669 GM |
9579 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
9580 | .type = HDA_FIXUP_FUNC, | |
9581 | .v.func = alc_fixup_disable_aamix, | |
9582 | .chained = true, | |
9583 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
9584 | }, | |
493a52a9 HW |
9585 | [ALC668_FIXUP_AUTO_MUTE] = { |
9586 | .type = HDA_FIXUP_FUNC, | |
9587 | .v.func = alc_fixup_auto_mute_via_amp, | |
9588 | .chained = true, | |
9589 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
9590 | }, | |
1f8b46cd DH |
9591 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
9592 | .type = HDA_FIXUP_PINS, | |
9593 | .v.pins = (const struct hda_pintbl[]) { | |
9594 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
9595 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ | |
9596 | { } | |
9597 | }, | |
9598 | .chained = true, | |
9599 | .chain_id = ALC662_FIXUP_HEADSET_MODE | |
9600 | }, | |
9601 | [ALC662_FIXUP_HEADSET_MODE] = { | |
9602 | .type = HDA_FIXUP_FUNC, | |
9603 | .v.func = alc_fixup_headset_mode_alc662, | |
9604 | }, | |
73bdd597 DH |
9605 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
9606 | .type = HDA_FIXUP_PINS, | |
9607 | .v.pins = (const struct hda_pintbl[]) { | |
9608 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
9609 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
9610 | { } | |
9611 | }, | |
9612 | .chained = true, | |
9613 | .chain_id = ALC668_FIXUP_HEADSET_MODE | |
9614 | }, | |
9615 | [ALC668_FIXUP_HEADSET_MODE] = { | |
9616 | .type = HDA_FIXUP_FUNC, | |
9617 | .v.func = alc_fixup_headset_mode_alc668, | |
9618 | }, | |
8e54b4ac | 9619 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
8e383953 | 9620 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 9621 | .v.func = alc_fixup_bass_chmap, |
8e383953 TI |
9622 | .chained = true, |
9623 | .chain_id = ALC662_FIXUP_ASUS_MODE4 | |
9624 | }, | |
61a75f13 DH |
9625 | [ALC662_FIXUP_BASS_16] = { |
9626 | .type = HDA_FIXUP_PINS, | |
9627 | .v.pins = (const struct hda_pintbl[]) { | |
9628 | {0x16, 0x80106111}, /* bass speaker */ | |
9629 | {} | |
9630 | }, | |
9631 | .chained = true, | |
9632 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
9633 | }, | |
a30c9aaa TI |
9634 | [ALC662_FIXUP_BASS_1A] = { |
9635 | .type = HDA_FIXUP_PINS, | |
9636 | .v.pins = (const struct hda_pintbl[]) { | |
9637 | {0x1a, 0x80106111}, /* bass speaker */ | |
9638 | {} | |
9639 | }, | |
8e54b4ac DH |
9640 | .chained = true, |
9641 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
a30c9aaa | 9642 | }, |
8e54b4ac | 9643 | [ALC662_FIXUP_BASS_CHMAP] = { |
a30c9aaa | 9644 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 9645 | .v.func = alc_fixup_bass_chmap, |
a30c9aaa | 9646 | }, |
9d4dc584 BM |
9647 | [ALC662_FIXUP_ASUS_Nx50] = { |
9648 | .type = HDA_FIXUP_FUNC, | |
9649 | .v.func = alc_fixup_auto_mute_via_amp, | |
9650 | .chained = true, | |
9651 | .chain_id = ALC662_FIXUP_BASS_1A | |
9652 | }, | |
fc7438b1 MP |
9653 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
9654 | .type = HDA_FIXUP_FUNC, | |
9655 | .v.func = alc_fixup_headset_mode_alc668, | |
9656 | .chain_id = ALC662_FIXUP_BASS_CHMAP | |
9657 | }, | |
3231e205 YP |
9658 | [ALC668_FIXUP_ASUS_Nx51] = { |
9659 | .type = HDA_FIXUP_PINS, | |
9660 | .v.pins = (const struct hda_pintbl[]) { | |
fc7438b1 MP |
9661 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
9662 | { 0x1a, 0x90170151 }, /* bass speaker */ | |
9663 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
3231e205 YP |
9664 | {} |
9665 | }, | |
9666 | .chained = true, | |
fc7438b1 | 9667 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 9668 | }, |
5b7c5e1f | 9669 | [ALC668_FIXUP_MIC_COEF] = { |
11ba6111 TI |
9670 | .type = HDA_FIXUP_VERBS, |
9671 | .v.verbs = (const struct hda_verb[]) { | |
9672 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, | |
9673 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, | |
9674 | {} | |
9675 | }, | |
9676 | }, | |
5b7c5e1f TI |
9677 | [ALC668_FIXUP_ASUS_G751] = { |
9678 | .type = HDA_FIXUP_PINS, | |
9679 | .v.pins = (const struct hda_pintbl[]) { | |
9680 | { 0x16, 0x0421101f }, /* HP */ | |
9681 | {} | |
9682 | }, | |
9683 | .chained = true, | |
9684 | .chain_id = ALC668_FIXUP_MIC_COEF | |
9685 | }, | |
78f4f7c2 KY |
9686 | [ALC891_FIXUP_HEADSET_MODE] = { |
9687 | .type = HDA_FIXUP_FUNC, | |
9688 | .v.func = alc_fixup_headset_mode, | |
9689 | }, | |
9690 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { | |
9691 | .type = HDA_FIXUP_PINS, | |
9692 | .v.pins = (const struct hda_pintbl[]) { | |
9693 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
9694 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
9695 | { } | |
9696 | }, | |
9697 | .chained = true, | |
9698 | .chain_id = ALC891_FIXUP_HEADSET_MODE | |
9699 | }, | |
9b51fe3e SB |
9700 | [ALC662_FIXUP_ACER_VERITON] = { |
9701 | .type = HDA_FIXUP_PINS, | |
9702 | .v.pins = (const struct hda_pintbl[]) { | |
9703 | { 0x15, 0x50170120 }, /* no internal speaker */ | |
9704 | { } | |
9705 | } | |
9706 | }, | |
1a3f0991 TI |
9707 | [ALC892_FIXUP_ASROCK_MOBO] = { |
9708 | .type = HDA_FIXUP_PINS, | |
9709 | .v.pins = (const struct hda_pintbl[]) { | |
9710 | { 0x15, 0x40f000f0 }, /* disabled */ | |
9711 | { 0x16, 0x40f000f0 }, /* disabled */ | |
1a3f0991 TI |
9712 | { } |
9713 | } | |
9714 | }, | |
c6790c8e KY |
9715 | [ALC662_FIXUP_USI_FUNC] = { |
9716 | .type = HDA_FIXUP_FUNC, | |
9717 | .v.func = alc662_fixup_usi_headset_mic, | |
9718 | }, | |
9719 | [ALC662_FIXUP_USI_HEADSET_MODE] = { | |
9720 | .type = HDA_FIXUP_PINS, | |
9721 | .v.pins = (const struct hda_pintbl[]) { | |
9722 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ | |
9723 | { 0x18, 0x01a1903d }, | |
9724 | { } | |
9725 | }, | |
9726 | .chained = true, | |
9727 | .chain_id = ALC662_FIXUP_USI_FUNC | |
9728 | }, | |
ca169cc2 KY |
9729 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
9730 | .type = HDA_FIXUP_FUNC, | |
9731 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
9732 | }, | |
00066e97 SB |
9733 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
9734 | .type = HDA_FIXUP_FUNC, | |
9735 | .v.func = alc662_fixup_aspire_ethos_hp, | |
9736 | }, | |
00066e97 SB |
9737 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
9738 | .type = HDA_FIXUP_PINS, | |
9739 | .v.pins = (const struct hda_pintbl[]) { | |
9740 | { 0x15, 0x92130110 }, /* front speakers */ | |
9741 | { 0x18, 0x99130111 }, /* center/subwoofer */ | |
9742 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ | |
9743 | { } | |
9744 | }, | |
9745 | .chained = true, | |
336820c4 | 9746 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
00066e97 | 9747 | }, |
5af29028 KY |
9748 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
9749 | .type = HDA_FIXUP_FUNC, | |
9750 | .v.func = alc671_fixup_hp_headset_mic2, | |
9751 | }, | |
d858c706 JHP |
9752 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
9753 | .type = HDA_FIXUP_PINS, | |
9754 | .v.pins = (const struct hda_pintbl[]) { | |
9755 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ | |
9756 | { } | |
9757 | }, | |
9758 | .chained = true, | |
9759 | .chain_id = ALC662_FIXUP_USI_FUNC | |
9760 | }, | |
a124458a JHP |
9761 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
9762 | .type = HDA_FIXUP_PINS, | |
9763 | .v.pins = (const struct hda_pintbl[]) { | |
9764 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ | |
9765 | { 0x1b, 0x0221144f }, | |
9766 | { } | |
9767 | }, | |
9768 | .chained = true, | |
9769 | .chain_id = ALC662_FIXUP_USI_FUNC | |
9770 | }, | |
6cb3b707 DH |
9771 | }; |
9772 | ||
a9111321 | 9773 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
53c334ad | 9774 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
d3d3835c | 9775 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
02f6ff90 | 9776 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
a6c47a85 | 9777 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
94024cd1 | 9778 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
125821ae | 9779 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
1801928e | 9780 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
2df03514 | 9781 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
a124458a | 9782 | SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), |
d858c706 | 9783 | SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), |
73bdd597 DH |
9784 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
9785 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
c5d019c3 | 9786 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
033b0a7c | 9787 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
467e1436 | 9788 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
09d2014f | 9789 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
ad8ff99e | 9790 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8dc9abb9 KY |
9791 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
9792 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
6a98e34b | 9793 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
e59ea3ed | 9794 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
148ebf54 | 9795 | SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), |
2da2dc9e | 9796 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
83a9efb5 | 9797 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
db8948e6 | 9798 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
9d4dc584 | 9799 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
11ba6111 | 9800 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
8e54b4ac | 9801 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
61a75f13 | 9802 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
3231e205 YP |
9803 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
9804 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), | |
c7efff92 | 9805 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
61a75f13 | 9806 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
8e54b4ac | 9807 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
1565cc35 | 9808 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
53c334ad | 9809 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
a0e90acc | 9810 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
c6790c8e | 9811 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
ca169cc2 | 9812 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
d4118588 | 9813 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6cb3b707 | 9814 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
1a3f0991 | 9815 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
edfe3bfc | 9816 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
9b51fe3e | 9817 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
f1ec5be1 | 9818 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
d2ebd479 | 9819 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
00066e97 | 9820 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
53c334ad TI |
9821 | |
9822 | #if 0 | |
9823 | /* Below is a quirk table taken from the old code. | |
9824 | * Basically the device should work as is without the fixup table. | |
9825 | * If BIOS doesn't give a proper info, enable the corresponding | |
9826 | * fixup entry. | |
7d7eb9ea | 9827 | */ |
53c334ad TI |
9828 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
9829 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), | |
9830 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), | |
9831 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), | |
9832 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
9833 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9834 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
9835 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), | |
9836 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), | |
9837 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9838 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), | |
9839 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), | |
9840 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), | |
9841 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), | |
9842 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), | |
9843 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9844 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), | |
9845 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), | |
9846 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9847 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
9848 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
9849 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9850 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), | |
9851 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), | |
9852 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), | |
9853 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9854 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), | |
9855 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
9856 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9857 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), | |
9858 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9859 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9860 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), | |
9861 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), | |
9862 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), | |
9863 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), | |
9864 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), | |
9865 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), | |
9866 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), | |
9867 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
9868 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), | |
9869 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), | |
9870 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
9871 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), | |
9872 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), | |
9873 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), | |
9874 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), | |
9875 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), | |
9876 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
9877 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), | |
9878 | #endif | |
6cb3b707 DH |
9879 | {} |
9880 | }; | |
9881 | ||
1727a771 | 9882 | static const struct hda_model_fixup alc662_fixup_models[] = { |
aa3841b5 TI |
9883 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
9884 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, | |
6be7948f | 9885 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
aa3841b5 | 9886 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
53c334ad TI |
9887 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
9888 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, | |
9889 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, | |
9890 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, | |
9891 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, | |
9892 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, | |
9893 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, | |
9894 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, | |
aa3841b5 | 9895 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
6e72aa5f | 9896 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
aa3841b5 | 9897 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
e32aa85a | 9898 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
aa3841b5 TI |
9899 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
9900 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, | |
9901 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, | |
9902 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, | |
9903 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, | |
9904 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, | |
9905 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, | |
9906 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, | |
40c51675 | 9907 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
aa3841b5 TI |
9908 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
9909 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, | |
9910 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, | |
9911 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, | |
9912 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, | |
ba90d6a6 | 9913 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
00066e97 | 9914 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
6be7948f TB |
9915 | {} |
9916 | }; | |
6cb3b707 | 9917 | |
532895c5 | 9918 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
78f4f7c2 KY |
9919 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
9920 | {0x17, 0x02211010}, | |
9921 | {0x18, 0x01a19030}, | |
9922 | {0x1a, 0x01813040}, | |
9923 | {0x21, 0x01014020}), | |
4b4e0e32 HW |
9924 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
9925 | {0x16, 0x01813030}, | |
9926 | {0x17, 0x02211010}, | |
9927 | {0x18, 0x01a19040}, | |
9928 | {0x21, 0x01014020}), | |
1f8b46cd | 9929 | SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 9930 | {0x14, 0x01014010}, |
1f8b46cd | 9931 | {0x18, 0x01a19020}, |
1f8b46cd | 9932 | {0x1a, 0x0181302f}, |
11580297 | 9933 | {0x1b, 0x0221401f}), |
76c2132e DH |
9934 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
9935 | {0x12, 0x99a30130}, | |
9936 | {0x14, 0x90170110}, | |
9937 | {0x15, 0x0321101f}, | |
11580297 | 9938 | {0x16, 0x03011020}), |
76c2132e DH |
9939 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
9940 | {0x12, 0x99a30140}, | |
9941 | {0x14, 0x90170110}, | |
9942 | {0x15, 0x0321101f}, | |
11580297 | 9943 | {0x16, 0x03011020}), |
76c2132e DH |
9944 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
9945 | {0x12, 0x99a30150}, | |
9946 | {0x14, 0x90170110}, | |
9947 | {0x15, 0x0321101f}, | |
11580297 | 9948 | {0x16, 0x03011020}), |
76c2132e | 9949 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
76c2132e DH |
9950 | {0x14, 0x90170110}, |
9951 | {0x15, 0x0321101f}, | |
11580297 | 9952 | {0x16, 0x03011020}), |
76c2132e DH |
9953 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
9954 | {0x12, 0x90a60130}, | |
9955 | {0x14, 0x90170110}, | |
11580297 | 9956 | {0x15, 0x0321101f}), |
5af29028 KY |
9957 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
9958 | {0x14, 0x01014010}, | |
9959 | {0x17, 0x90170150}, | |
f2adbae0 | 9960 | {0x19, 0x02a11060}, |
5af29028 KY |
9961 | {0x1b, 0x01813030}, |
9962 | {0x21, 0x02211020}), | |
9963 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
9964 | {0x14, 0x01014010}, | |
9965 | {0x18, 0x01a19040}, | |
9966 | {0x1b, 0x01813030}, | |
9967 | {0x21, 0x02211020}), | |
9968 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
9969 | {0x14, 0x01014020}, | |
9970 | {0x17, 0x90170110}, | |
9971 | {0x18, 0x01a19050}, | |
9972 | {0x1b, 0x01813040}, | |
9973 | {0x21, 0x02211030}), | |
532895c5 HW |
9974 | {} |
9975 | }; | |
9976 | ||
1d045db9 TI |
9977 | /* |
9978 | */ | |
bc9f98a9 KY |
9979 | static int patch_alc662(struct hda_codec *codec) |
9980 | { | |
9981 | struct alc_spec *spec; | |
3de95173 | 9982 | int err; |
bc9f98a9 | 9983 | |
3de95173 TI |
9984 | err = alc_alloc_spec(codec, 0x0b); |
9985 | if (err < 0) | |
9986 | return err; | |
bc9f98a9 | 9987 | |
3de95173 | 9988 | spec = codec->spec; |
1f0f4b80 | 9989 | |
225068ab TI |
9990 | spec->shutup = alc_eapd_shutup; |
9991 | ||
53c334ad TI |
9992 | /* handle multiple HPs as is */ |
9993 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
9994 | ||
2c3bf9ab TI |
9995 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
9996 | ||
7639a06c | 9997 | switch (codec->core.vendor_id) { |
f3f9185f KY |
9998 | case 0x10ec0668: |
9999 | spec->init_hook = alc668_restore_default_value; | |
10000 | break; | |
f3f9185f | 10001 | } |
8663ff75 | 10002 | |
c9af753f TI |
10003 | alc_pre_init(codec); |
10004 | ||
1727a771 | 10005 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
8e5a0509 | 10006 | alc662_fixup_tbl, alc662_fixups); |
0fc1e447 | 10007 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); |
1727a771 | 10008 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
8e5a0509 TI |
10009 | |
10010 | alc_auto_parse_customize_define(codec); | |
10011 | ||
7504b6cd TI |
10012 | if (has_cdefine_beep(codec)) |
10013 | spec->gen.beep_nid = 0x01; | |
10014 | ||
1bb7e43e | 10015 | if ((alc_get_coef0(codec) & (1 << 14)) && |
5100cd07 | 10016 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
e16fb6d1 | 10017 | spec->cdefine.platform_type == 1) { |
6134b1a2 WY |
10018 | err = alc_codec_rename(codec, "ALC272X"); |
10019 | if (err < 0) | |
e16fb6d1 | 10020 | goto error; |
20ca0c35 | 10021 | } |
274693f3 | 10022 | |
b9c5106c TI |
10023 | /* automatic parse from the BIOS config */ |
10024 | err = alc662_parse_auto_config(codec); | |
e16fb6d1 TI |
10025 | if (err < 0) |
10026 | goto error; | |
bc9f98a9 | 10027 | |
7504b6cd | 10028 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
7639a06c | 10029 | switch (codec->core.vendor_id) { |
da00c244 | 10030 | case 0x10ec0662: |
fea80fae | 10031 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
da00c244 KY |
10032 | break; |
10033 | case 0x10ec0272: | |
10034 | case 0x10ec0663: | |
10035 | case 0x10ec0665: | |
9ad54547 | 10036 | case 0x10ec0668: |
fea80fae | 10037 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
da00c244 KY |
10038 | break; |
10039 | case 0x10ec0273: | |
fea80fae | 10040 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
da00c244 KY |
10041 | break; |
10042 | } | |
fea80fae TI |
10043 | if (err < 0) |
10044 | goto error; | |
cec27c89 | 10045 | } |
2134ea4f | 10046 | |
1727a771 | 10047 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 10048 | |
bc9f98a9 | 10049 | return 0; |
801f49d3 | 10050 | |
e16fb6d1 TI |
10051 | error: |
10052 | alc_free(codec); | |
10053 | return err; | |
b478b998 KY |
10054 | } |
10055 | ||
d1eb57f4 KY |
10056 | /* |
10057 | * ALC680 support | |
10058 | */ | |
d1eb57f4 | 10059 | |
d1eb57f4 KY |
10060 | static int alc680_parse_auto_config(struct hda_codec *codec) |
10061 | { | |
3e6179b8 | 10062 | return alc_parse_auto_config(codec, NULL, NULL); |
d1eb57f4 KY |
10063 | } |
10064 | ||
d1eb57f4 | 10065 | /* |
d1eb57f4 | 10066 | */ |
d1eb57f4 KY |
10067 | static int patch_alc680(struct hda_codec *codec) |
10068 | { | |
d1eb57f4 KY |
10069 | int err; |
10070 | ||
1f0f4b80 | 10071 | /* ALC680 has no aa-loopback mixer */ |
3de95173 TI |
10072 | err = alc_alloc_spec(codec, 0); |
10073 | if (err < 0) | |
10074 | return err; | |
1f0f4b80 | 10075 | |
1ebec5f2 TI |
10076 | /* automatic parse from the BIOS config */ |
10077 | err = alc680_parse_auto_config(codec); | |
10078 | if (err < 0) { | |
10079 | alc_free(codec); | |
10080 | return err; | |
d1eb57f4 KY |
10081 | } |
10082 | ||
d1eb57f4 KY |
10083 | return 0; |
10084 | } | |
10085 | ||
1da177e4 LT |
10086 | /* |
10087 | * patch entries | |
10088 | */ | |
b9a94a9c | 10089 | static const struct hda_device_id snd_hda_id_realtek[] = { |
0a6f0600 | 10090 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
b9a94a9c | 10091 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
2a36c16e | 10092 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
4231430d | 10093 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
b9a94a9c TI |
10094 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
10095 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), | |
dcd4f0db | 10096 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
b9a94a9c | 10097 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
736f20a7 | 10098 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
7fbdcd83 | 10099 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
b9a94a9c TI |
10100 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
10101 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), | |
f429e7e4 | 10102 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
b9a94a9c TI |
10103 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
10104 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), | |
10105 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), | |
10106 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), | |
10107 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), | |
10108 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), | |
10109 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), | |
dcd4f0db | 10110 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
b9a94a9c TI |
10111 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
10112 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), | |
10113 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), | |
10114 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), | |
10115 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), | |
10116 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), | |
0a6f0600 | 10117 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
b9a94a9c | 10118 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
630e3612 | 10119 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
b9a94a9c | 10120 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
0a6f0600 | 10121 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
b9a94a9c TI |
10122 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
10123 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), | |
10124 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), | |
dcd4f0db | 10125 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
7d727869 | 10126 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
b9a94a9c | 10127 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
28f1f9b2 | 10128 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
1078bef0 | 10129 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
f0778871 | 10130 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
b9a94a9c TI |
10131 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
10132 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), | |
10133 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), | |
10134 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), | |
10135 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), | |
10136 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), | |
10137 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), | |
10138 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), | |
10139 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), | |
10140 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), | |
10141 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), | |
10142 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), | |
10143 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), | |
10144 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), | |
6fbae35a KY |
10145 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
10146 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), | |
10147 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), | |
83629532 | 10148 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
78f4f7c2 | 10149 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
b9a94a9c TI |
10150 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
10151 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), | |
10152 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), | |
10153 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), | |
10154 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), | |
10155 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), | |
10156 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), | |
10157 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), | |
10158 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), | |
10159 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), | |
10160 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), | |
10161 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), | |
10162 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), | |
6d9ffcff | 10163 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
65553b12 | 10164 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
a535ad57 | 10165 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
1da177e4 LT |
10166 | {} /* terminator */ |
10167 | }; | |
b9a94a9c | 10168 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
1289e9e8 TI |
10169 | |
10170 | MODULE_LICENSE("GPL"); | |
10171 | MODULE_DESCRIPTION("Realtek HD-audio codec"); | |
10172 | ||
d8a766a1 | 10173 | static struct hda_codec_driver realtek_driver = { |
b9a94a9c | 10174 | .id = snd_hda_id_realtek, |
1289e9e8 TI |
10175 | }; |
10176 | ||
d8a766a1 | 10177 | module_hda_codec_driver(realtek_driver); |