1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Universal Interface for Intel High Definition Audio Codec
4 *
5 * HD audio interface patch for Realtek ALC codecs
6 *
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
11 */
12
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <linux/ctype.h>
22 #include <sound/core.h>
23 #include <sound/jack.h>
24 #include <sound/hda_codec.h>
25 #include "hda_local.h"
26 #include "hda_auto_parser.h"
27 #include "hda_beep.h"
28 #include "hda_jack.h"
29 #include "hda_generic.h"
30 #include "hda_component.h"
31
32 /* keep halting ALC5505 DSP, for power saving */
33 #define HALT_REALTEK_ALC5505
34
35 /* extra amp-initialization sequence types */
36 enum {
37 ALC_INIT_UNDEFINED,
38 ALC_INIT_NONE,
39 ALC_INIT_DEFAULT,
40 };
41
42 enum {
43 ALC_HEADSET_MODE_UNKNOWN,
44 ALC_HEADSET_MODE_UNPLUGGED,
45 ALC_HEADSET_MODE_HEADSET,
46 ALC_HEADSET_MODE_MIC,
47 ALC_HEADSET_MODE_HEADPHONE,
48 };
49
50 enum {
51 ALC_HEADSET_TYPE_UNKNOWN,
52 ALC_HEADSET_TYPE_CTIA,
53 ALC_HEADSET_TYPE_OMTP,
54 };
55
56 enum {
57 ALC_KEY_MICMUTE_INDEX,
58 };
59
60 struct alc_customize_define {
61 unsigned int sku_cfg;
62 unsigned char port_connectivity;
63 unsigned char check_sum;
64 unsigned char customization;
65 unsigned char external_amp;
66 unsigned int enable_pcbeep:1;
67 unsigned int platform_type:1;
68 unsigned int swap:1;
69 unsigned int override:1;
70 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
71 };
72
73 struct alc_coef_led {
74 unsigned int idx;
75 unsigned int mask;
76 unsigned int on;
77 unsigned int off;
78 };
79
80 struct alc_spec {
81 struct hda_gen_spec gen; /* must be at head */
82
83 /* codec parameterization */
84 struct alc_customize_define cdefine;
85 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
86
87 /* GPIO bits */
88 unsigned int gpio_mask;
89 unsigned int gpio_dir;
90 unsigned int gpio_data;
91 bool gpio_write_delay; /* add a delay before writing gpio_data */
92
93 /* mute LED for HP laptops, see vref_mute_led_set() */
94 int mute_led_polarity;
95 int micmute_led_polarity;
96 hda_nid_t mute_led_nid;
97 hda_nid_t cap_mute_led_nid;
98
99 unsigned int gpio_mute_led_mask;
100 unsigned int gpio_mic_led_mask;
101 struct alc_coef_led mute_led_coef;
102 struct alc_coef_led mic_led_coef;
103 struct mutex coef_mutex;
104
105 hda_nid_t headset_mic_pin;
106 hda_nid_t headphone_mic_pin;
107 int current_headset_mode;
108 int current_headset_type;
109
110 /* hooks */
111 void (*init_hook)(struct hda_codec *codec);
112 #ifdef CONFIG_PM
113 void (*power_hook)(struct hda_codec *codec);
114 #endif
115 void (*shutup)(struct hda_codec *codec);
116
117 int init_amp;
118 int codec_variant; /* flag for other variants */
119 unsigned int has_alc5505_dsp:1;
120 unsigned int no_depop_delay:1;
121 unsigned int done_hp_init:1;
122 unsigned int no_shutup_pins:1;
123 unsigned int ultra_low_power:1;
124 unsigned int has_hs_key:1;
125 unsigned int no_internal_mic_pin:1;
126 unsigned int en_3kpull_low:1;
127
128 /* for PLL fix */
129 hda_nid_t pll_nid;
130 unsigned int pll_coef_idx, pll_coef_bit;
131 unsigned int coef0;
132 struct input_dev *kb_dev;
133 u8 alc_mute_keycode_map[1];
134
135 /* component binding */
136 struct component_match *match;
137 struct hda_component comps[HDA_MAX_COMPONENTS];
138 };
139
140 /*
141 * COEF access helper functions
142 */
143
coef_mutex_lock(struct hda_codec * codec)144 static void coef_mutex_lock(struct hda_codec *codec)
145 {
146 struct alc_spec *spec = codec->spec;
147
148 snd_hda_power_up_pm(codec);
149 mutex_lock(&spec->coef_mutex);
150 }
151
coef_mutex_unlock(struct hda_codec * codec)152 static void coef_mutex_unlock(struct hda_codec *codec)
153 {
154 struct alc_spec *spec = codec->spec;
155
156 mutex_unlock(&spec->coef_mutex);
157 snd_hda_power_down_pm(codec);
158 }
159
__alc_read_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx)160 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
161 unsigned int coef_idx)
162 {
163 unsigned int val;
164
165 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
166 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
167 return val;
168 }
169
alc_read_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx)170 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
171 unsigned int coef_idx)
172 {
173 unsigned int val;
174
175 coef_mutex_lock(codec);
176 val = __alc_read_coefex_idx(codec, nid, coef_idx);
177 coef_mutex_unlock(codec);
178 return val;
179 }
180
181 #define alc_read_coef_idx(codec, coef_idx) \
182 alc_read_coefex_idx(codec, 0x20, coef_idx)
183
__alc_write_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx,unsigned int coef_val)184 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
185 unsigned int coef_idx, unsigned int coef_val)
186 {
187 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
188 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
189 }
190
alc_write_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx,unsigned int coef_val)191 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
192 unsigned int coef_idx, unsigned int coef_val)
193 {
194 coef_mutex_lock(codec);
195 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
196 coef_mutex_unlock(codec);
197 }
198
199 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
200 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
201
__alc_update_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx,unsigned int mask,unsigned int bits_set)202 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
203 unsigned int coef_idx, unsigned int mask,
204 unsigned int bits_set)
205 {
206 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
207
208 if (val != -1)
209 __alc_write_coefex_idx(codec, nid, coef_idx,
210 (val & ~mask) | bits_set);
211 }
212
alc_update_coefex_idx(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx,unsigned int mask,unsigned int bits_set)213 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
214 unsigned int coef_idx, unsigned int mask,
215 unsigned int bits_set)
216 {
217 coef_mutex_lock(codec);
218 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
219 coef_mutex_unlock(codec);
220 }
221
222 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
223 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
224
225 /* a special bypass for COEF 0; read the cached value at the second time */
alc_get_coef0(struct hda_codec * codec)226 static unsigned int alc_get_coef0(struct hda_codec *codec)
227 {
228 struct alc_spec *spec = codec->spec;
229
230 if (!spec->coef0)
231 spec->coef0 = alc_read_coef_idx(codec, 0);
232 return spec->coef0;
233 }
234
235 /* coef writes/updates batch */
236 struct coef_fw {
237 unsigned char nid;
238 unsigned char idx;
239 unsigned short mask;
240 unsigned short val;
241 };
242
243 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
244 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
245 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
246 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
247 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
248
alc_process_coef_fw(struct hda_codec * codec,const struct coef_fw * fw)249 static void alc_process_coef_fw(struct hda_codec *codec,
250 const struct coef_fw *fw)
251 {
252 coef_mutex_lock(codec);
253 for (; fw->nid; fw++) {
254 if (fw->mask == (unsigned short)-1)
255 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
256 else
257 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
258 fw->mask, fw->val);
259 }
260 coef_mutex_unlock(codec);
261 }
262
263 /*
264 * GPIO setup tables, used in initialization
265 */
266
267 /* Enable GPIO mask and set output */
alc_setup_gpio(struct hda_codec * codec,unsigned int mask)268 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
269 {
270 struct alc_spec *spec = codec->spec;
271
272 spec->gpio_mask |= mask;
273 spec->gpio_dir |= mask;
274 spec->gpio_data |= mask;
275 }
276
alc_write_gpio_data(struct hda_codec * codec)277 static void alc_write_gpio_data(struct hda_codec *codec)
278 {
279 struct alc_spec *spec = codec->spec;
280
281 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
282 spec->gpio_data);
283 }
284
alc_update_gpio_data(struct hda_codec * codec,unsigned int mask,bool on)285 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
286 bool on)
287 {
288 struct alc_spec *spec = codec->spec;
289 unsigned int oldval = spec->gpio_data;
290
291 if (on)
292 spec->gpio_data |= mask;
293 else
294 spec->gpio_data &= ~mask;
295 if (oldval != spec->gpio_data)
296 alc_write_gpio_data(codec);
297 }
298
alc_write_gpio(struct hda_codec * codec)299 static void alc_write_gpio(struct hda_codec *codec)
300 {
301 struct alc_spec *spec = codec->spec;
302
303 if (!spec->gpio_mask)
304 return;
305
306 snd_hda_codec_write(codec, codec->core.afg, 0,
307 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
308 snd_hda_codec_write(codec, codec->core.afg, 0,
309 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
310 if (spec->gpio_write_delay)
311 msleep(1);
312 alc_write_gpio_data(codec);
313 }
314
alc_fixup_gpio(struct hda_codec * codec,int action,unsigned int mask)315 static void alc_fixup_gpio(struct hda_codec *codec, int action,
316 unsigned int mask)
317 {
318 if (action == HDA_FIXUP_ACT_PRE_PROBE)
319 alc_setup_gpio(codec, mask);
320 }
321
alc_fixup_gpio1(struct hda_codec * codec,const struct hda_fixup * fix,int action)322 static void alc_fixup_gpio1(struct hda_codec *codec,
323 const struct hda_fixup *fix, int action)
324 {
325 alc_fixup_gpio(codec, action, 0x01);
326 }
327
alc_fixup_gpio2(struct hda_codec * codec,const struct hda_fixup * fix,int action)328 static void alc_fixup_gpio2(struct hda_codec *codec,
329 const struct hda_fixup *fix, int action)
330 {
331 alc_fixup_gpio(codec, action, 0x02);
332 }
333
alc_fixup_gpio3(struct hda_codec * codec,const struct hda_fixup * fix,int action)334 static void alc_fixup_gpio3(struct hda_codec *codec,
335 const struct hda_fixup *fix, int action)
336 {
337 alc_fixup_gpio(codec, action, 0x03);
338 }
339
alc_fixup_gpio4(struct hda_codec * codec,const struct hda_fixup * fix,int action)340 static void alc_fixup_gpio4(struct hda_codec *codec,
341 const struct hda_fixup *fix, int action)
342 {
343 alc_fixup_gpio(codec, action, 0x04);
344 }
345
alc_fixup_micmute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)346 static void alc_fixup_micmute_led(struct hda_codec *codec,
347 const struct hda_fixup *fix, int action)
348 {
349 if (action == HDA_FIXUP_ACT_PRE_PROBE)
350 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
351 }
352
353 /*
354 * Fix hardware PLL issue
355 * On some codecs, the analog PLL gating control must be off while
356 * the default value is 1.
357 */
alc_fix_pll(struct hda_codec * codec)358 static void alc_fix_pll(struct hda_codec *codec)
359 {
360 struct alc_spec *spec = codec->spec;
361
362 if (spec->pll_nid)
363 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
364 1 << spec->pll_coef_bit, 0);
365 }
366
alc_fix_pll_init(struct hda_codec * codec,hda_nid_t nid,unsigned int coef_idx,unsigned int coef_bit)367 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
368 unsigned int coef_idx, unsigned int coef_bit)
369 {
370 struct alc_spec *spec = codec->spec;
371 spec->pll_nid = nid;
372 spec->pll_coef_idx = coef_idx;
373 spec->pll_coef_bit = coef_bit;
374 alc_fix_pll(codec);
375 }
376
377 /* update the master volume per volume-knob's unsol event */
alc_update_knob_master(struct hda_codec * codec,struct hda_jack_callback * jack)378 static void alc_update_knob_master(struct hda_codec *codec,
379 struct hda_jack_callback *jack)
380 {
381 unsigned int val;
382 struct snd_kcontrol *kctl;
383 struct snd_ctl_elem_value *uctl;
384
385 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
386 if (!kctl)
387 return;
388 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
389 if (!uctl)
390 return;
391 val = snd_hda_codec_read(codec, jack->nid, 0,
392 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
393 val &= HDA_AMP_VOLMASK;
394 uctl->value.integer.value[0] = val;
395 uctl->value.integer.value[1] = val;
396 kctl->put(kctl, uctl);
397 kfree(uctl);
398 }
399
alc880_unsol_event(struct hda_codec * codec,unsigned int res)400 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
401 {
402 /* For some reason, the res given from ALC880 is broken.
403 Here we adjust it properly. */
404 snd_hda_jack_unsol_event(codec, res >> 2);
405 }
406
407 /* Change EAPD to verb control */
alc_fill_eapd_coef(struct hda_codec * codec)408 static void alc_fill_eapd_coef(struct hda_codec *codec)
409 {
410 int coef;
411
412 coef = alc_get_coef0(codec);
413
414 switch (codec->core.vendor_id) {
415 case 0x10ec0262:
416 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
417 break;
418 case 0x10ec0267:
419 case 0x10ec0268:
420 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
421 break;
422 case 0x10ec0269:
423 if ((coef & 0x00f0) == 0x0010)
424 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
425 if ((coef & 0x00f0) == 0x0020)
426 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
427 if ((coef & 0x00f0) == 0x0030)
428 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
429 break;
430 case 0x10ec0280:
431 case 0x10ec0284:
432 case 0x10ec0290:
433 case 0x10ec0292:
434 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
435 break;
436 case 0x10ec0225:
437 case 0x10ec0295:
438 case 0x10ec0299:
439 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
440 fallthrough;
441 case 0x10ec0215:
442 case 0x10ec0285:
443 case 0x10ec0289:
444 alc_update_coef_idx(codec, 0x36, 1<<13, 0);
445 fallthrough;
446 case 0x10ec0230:
447 case 0x10ec0233:
448 case 0x10ec0235:
449 case 0x10ec0236:
450 case 0x10ec0245:
451 case 0x10ec0255:
452 case 0x10ec0256:
453 case 0x19e58326:
454 case 0x10ec0257:
455 case 0x10ec0282:
456 case 0x10ec0283:
457 case 0x10ec0286:
458 case 0x10ec0288:
459 case 0x10ec0298:
460 case 0x10ec0300:
461 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
462 break;
463 case 0x10ec0275:
464 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
465 break;
466 case 0x10ec0287:
467 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
468 alc_write_coef_idx(codec, 0x8, 0x4ab7);
469 break;
470 case 0x10ec0293:
471 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
472 break;
473 case 0x10ec0234:
474 case 0x10ec0274:
475 alc_write_coef_idx(codec, 0x6e, 0x0c25);
476 fallthrough;
477 case 0x10ec0294:
478 case 0x10ec0700:
479 case 0x10ec0701:
480 case 0x10ec0703:
481 case 0x10ec0711:
482 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
483 break;
484 case 0x10ec0662:
485 if ((coef & 0x00f0) == 0x0030)
486 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
487 break;
488 case 0x10ec0272:
489 case 0x10ec0273:
490 case 0x10ec0663:
491 case 0x10ec0665:
492 case 0x10ec0670:
493 case 0x10ec0671:
494 case 0x10ec0672:
495 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
496 break;
497 case 0x10ec0222:
498 case 0x10ec0623:
499 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
500 break;
501 case 0x10ec0668:
502 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
503 break;
504 case 0x10ec0867:
505 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
506 break;
507 case 0x10ec0888:
508 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
509 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
510 break;
511 case 0x10ec0892:
512 case 0x10ec0897:
513 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
514 break;
515 case 0x10ec0899:
516 case 0x10ec0900:
517 case 0x10ec0b00:
518 case 0x10ec1168:
519 case 0x10ec1220:
520 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
521 break;
522 }
523 }
524
525 /* additional initialization for ALC888 variants */
alc888_coef_init(struct hda_codec * codec)526 static void alc888_coef_init(struct hda_codec *codec)
527 {
528 switch (alc_get_coef0(codec) & 0x00f0) {
529 /* alc888-VA */
530 case 0x00:
531 /* alc888-VB */
532 case 0x10:
533 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
534 break;
535 }
536 }
537
538 /* turn on/off EAPD control (only if available) */
set_eapd(struct hda_codec * codec,hda_nid_t nid,int on)539 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
540 {
541 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
542 return;
543 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
544 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
545 on ? 2 : 0);
546 }
547
548 /* turn on/off EAPD controls of the codec */
alc_auto_setup_eapd(struct hda_codec * codec,bool on)549 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
550 {
551 /* We currently only handle front, HP */
552 static const hda_nid_t pins[] = {
553 0x0f, 0x10, 0x14, 0x15, 0x17, 0
554 };
555 const hda_nid_t *p;
556 for (p = pins; *p; p++)
557 set_eapd(codec, *p, on);
558 }
559
560 static int find_ext_mic_pin(struct hda_codec *codec);
561
alc_headset_mic_no_shutup(struct hda_codec * codec)562 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
563 {
564 const struct hda_pincfg *pin;
565 int mic_pin = find_ext_mic_pin(codec);
566 int i;
567
568 /* don't shut up pins when unloading the driver; otherwise it breaks
569 * the default pin setup at the next load of the driver
570 */
571 if (codec->bus->shutdown)
572 return;
573
574 snd_array_for_each(&codec->init_pins, i, pin) {
575 /* use read here for syncing after issuing each verb */
576 if (pin->nid != mic_pin)
577 snd_hda_codec_read(codec, pin->nid, 0,
578 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
579 }
580
581 codec->pins_shutup = 1;
582 }
583
alc_shutup_pins(struct hda_codec * codec)584 static void alc_shutup_pins(struct hda_codec *codec)
585 {
586 struct alc_spec *spec = codec->spec;
587
588 if (spec->no_shutup_pins)
589 return;
590
591 switch (codec->core.vendor_id) {
592 case 0x10ec0236:
593 case 0x10ec0256:
594 case 0x10ec0257:
595 case 0x19e58326:
596 case 0x10ec0283:
597 case 0x10ec0285:
598 case 0x10ec0286:
599 case 0x10ec0287:
600 case 0x10ec0288:
601 case 0x10ec0295:
602 case 0x10ec0298:
603 alc_headset_mic_no_shutup(codec);
604 break;
605 default:
606 snd_hda_shutup_pins(codec);
607 break;
608 }
609 }
610
611 /* generic shutup callback;
612 * just turning off EAPD and a little pause for avoiding pop-noise
613 */
alc_eapd_shutup(struct hda_codec * codec)614 static void alc_eapd_shutup(struct hda_codec *codec)
615 {
616 struct alc_spec *spec = codec->spec;
617
618 alc_auto_setup_eapd(codec, false);
619 if (!spec->no_depop_delay)
620 msleep(200);
621 alc_shutup_pins(codec);
622 }
623
624 /* generic EAPD initialization */
alc_auto_init_amp(struct hda_codec * codec,int type)625 static void alc_auto_init_amp(struct hda_codec *codec, int type)
626 {
627 alc_auto_setup_eapd(codec, true);
628 alc_write_gpio(codec);
629 switch (type) {
630 case ALC_INIT_DEFAULT:
631 switch (codec->core.vendor_id) {
632 case 0x10ec0260:
633 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
634 break;
635 case 0x10ec0880:
636 case 0x10ec0882:
637 case 0x10ec0883:
638 case 0x10ec0885:
639 alc_update_coef_idx(codec, 7, 0, 0x2030);
640 break;
641 case 0x10ec0888:
642 alc888_coef_init(codec);
643 break;
644 }
645 break;
646 }
647 }
648
649 /* get a primary headphone pin if available */
alc_get_hp_pin(struct alc_spec * spec)650 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
651 {
652 if (spec->gen.autocfg.hp_pins[0])
653 return spec->gen.autocfg.hp_pins[0];
654 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
655 return spec->gen.autocfg.line_out_pins[0];
656 return 0;
657 }
658
659 /*
660 * Realtek SSID verification
661 */
662
663 /* Could be any non-zero and even value. When used as fixup, tells
664 * the driver to ignore any present sku defines.
665 */
666 #define ALC_FIXUP_SKU_IGNORE (2)
667
alc_fixup_sku_ignore(struct hda_codec * codec,const struct hda_fixup * fix,int action)668 static void alc_fixup_sku_ignore(struct hda_codec *codec,
669 const struct hda_fixup *fix, int action)
670 {
671 struct alc_spec *spec = codec->spec;
672 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
673 spec->cdefine.fixup = 1;
674 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
675 }
676 }
677
alc_fixup_no_depop_delay(struct hda_codec * codec,const struct hda_fixup * fix,int action)678 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
679 const struct hda_fixup *fix, int action)
680 {
681 struct alc_spec *spec = codec->spec;
682
683 if (action == HDA_FIXUP_ACT_PROBE) {
684 spec->no_depop_delay = 1;
685 codec->depop_delay = 0;
686 }
687 }
688
alc_auto_parse_customize_define(struct hda_codec * codec)689 static int alc_auto_parse_customize_define(struct hda_codec *codec)
690 {
691 unsigned int ass, tmp, i;
692 unsigned nid = 0;
693 struct alc_spec *spec = codec->spec;
694
695 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
696
697 if (spec->cdefine.fixup) {
698 ass = spec->cdefine.sku_cfg;
699 if (ass == ALC_FIXUP_SKU_IGNORE)
700 return -1;
701 goto do_sku;
702 }
703
704 if (!codec->bus->pci)
705 return -1;
706 ass = codec->core.subsystem_id & 0xffff;
707 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
708 goto do_sku;
709
710 nid = 0x1d;
711 if (codec->core.vendor_id == 0x10ec0260)
712 nid = 0x17;
713 ass = snd_hda_codec_get_pincfg(codec, nid);
714
715 if (!(ass & 1)) {
716 codec_info(codec, "%s: SKU not ready 0x%08x\n",
717 codec->core.chip_name, ass);
718 return -1;
719 }
720
721 /* check sum */
722 tmp = 0;
723 for (i = 1; i < 16; i++) {
724 if ((ass >> i) & 1)
725 tmp++;
726 }
727 if (((ass >> 16) & 0xf) != tmp)
728 return -1;
729
730 spec->cdefine.port_connectivity = ass >> 30;
731 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
732 spec->cdefine.check_sum = (ass >> 16) & 0xf;
733 spec->cdefine.customization = ass >> 8;
734 do_sku:
735 spec->cdefine.sku_cfg = ass;
736 spec->cdefine.external_amp = (ass & 0x38) >> 3;
737 spec->cdefine.platform_type = (ass & 0x4) >> 2;
738 spec->cdefine.swap = (ass & 0x2) >> 1;
739 spec->cdefine.override = ass & 0x1;
740
741 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
742 nid, spec->cdefine.sku_cfg);
743 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
744 spec->cdefine.port_connectivity);
745 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
746 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
747 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
748 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
749 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
750 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
751 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
752
753 return 0;
754 }
755
756 /* return the position of NID in the list, or -1 if not found */
find_idx_in_nid_list(hda_nid_t nid,const hda_nid_t * list,int nums)757 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
758 {
759 int i;
760 for (i = 0; i < nums; i++)
761 if (list[i] == nid)
762 return i;
763 return -1;
764 }
765 /* return true if the given NID is found in the list */
found_in_nid_list(hda_nid_t nid,const hda_nid_t * list,int nums)766 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
767 {
768 return find_idx_in_nid_list(nid, list, nums) >= 0;
769 }
770
771 /* check subsystem ID and set up device-specific initialization;
772 * return 1 if initialized, 0 if invalid SSID
773 */
774 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
775 * 31 ~ 16 : Manufacture ID
776 * 15 ~ 8 : SKU ID
777 * 7 ~ 0 : Assembly ID
778 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
779 */
alc_subsystem_id(struct hda_codec * codec,const hda_nid_t * ports)780 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
781 {
782 unsigned int ass, tmp, i;
783 unsigned nid;
784 struct alc_spec *spec = codec->spec;
785
786 if (spec->cdefine.fixup) {
787 ass = spec->cdefine.sku_cfg;
788 if (ass == ALC_FIXUP_SKU_IGNORE)
789 return 0;
790 goto do_sku;
791 }
792
793 ass = codec->core.subsystem_id & 0xffff;
794 if (codec->bus->pci &&
795 ass != codec->bus->pci->subsystem_device && (ass & 1))
796 goto do_sku;
797
798 /* invalid SSID, check the special NID pin defcfg instead */
799 /*
800 * 31~30 : port connectivity
801 * 29~21 : reserve
802 * 20 : PCBEEP input
803 * 19~16 : Check sum (15:1)
804 * 15~1 : Custom
805 * 0 : override
806 */
807 nid = 0x1d;
808 if (codec->core.vendor_id == 0x10ec0260)
809 nid = 0x17;
810 ass = snd_hda_codec_get_pincfg(codec, nid);
811 codec_dbg(codec,
812 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
813 ass, nid);
814 if (!(ass & 1))
815 return 0;
816 if ((ass >> 30) != 1) /* no physical connection */
817 return 0;
818
819 /* check sum */
820 tmp = 0;
821 for (i = 1; i < 16; i++) {
822 if ((ass >> i) & 1)
823 tmp++;
824 }
825 if (((ass >> 16) & 0xf) != tmp)
826 return 0;
827 do_sku:
828 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
829 ass & 0xffff, codec->core.vendor_id);
830 /*
831 * 0 : override
832 * 1 : Swap Jack
833 * 2 : 0 --> Desktop, 1 --> Laptop
834 * 3~5 : External Amplifier control
835 * 7~6 : Reserved
836 */
837 tmp = (ass & 0x38) >> 3; /* external Amp control */
838 if (spec->init_amp == ALC_INIT_UNDEFINED) {
839 switch (tmp) {
840 case 1:
841 alc_setup_gpio(codec, 0x01);
842 break;
843 case 3:
844 alc_setup_gpio(codec, 0x02);
845 break;
846 case 7:
847 alc_setup_gpio(codec, 0x04);
848 break;
849 case 5:
850 default:
851 spec->init_amp = ALC_INIT_DEFAULT;
852 break;
853 }
854 }
855
856 /* is laptop or Desktop and enable the function "Mute internal speaker
857 * when the external headphone out jack is plugged"
858 */
859 if (!(ass & 0x8000))
860 return 1;
861 /*
862 * 10~8 : Jack location
863 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
864 * 14~13: Resvered
865 * 15 : 1 --> enable the function "Mute internal speaker
866 * when the external headphone out jack is plugged"
867 */
868 if (!alc_get_hp_pin(spec)) {
869 hda_nid_t nid;
870 tmp = (ass >> 11) & 0x3; /* HP to chassis */
871 nid = ports[tmp];
872 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
873 spec->gen.autocfg.line_outs))
874 return 1;
875 spec->gen.autocfg.hp_pins[0] = nid;
876 }
877 return 1;
878 }
879
880 /* Check the validity of ALC subsystem-id
881 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
alc_ssid_check(struct hda_codec * codec,const hda_nid_t * ports)882 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
883 {
884 if (!alc_subsystem_id(codec, ports)) {
885 struct alc_spec *spec = codec->spec;
886 if (spec->init_amp == ALC_INIT_UNDEFINED) {
887 codec_dbg(codec,
888 "realtek: Enable default setup for auto mode as fallback\n");
889 spec->init_amp = ALC_INIT_DEFAULT;
890 }
891 }
892 }
893
894 /*
895 */
896
alc_fixup_inv_dmic(struct hda_codec * codec,const struct hda_fixup * fix,int action)897 static void alc_fixup_inv_dmic(struct hda_codec *codec,
898 const struct hda_fixup *fix, int action)
899 {
900 struct alc_spec *spec = codec->spec;
901
902 spec->gen.inv_dmic_split = 1;
903 }
904
905
alc_build_controls(struct hda_codec * codec)906 static int alc_build_controls(struct hda_codec *codec)
907 {
908 int err;
909
910 err = snd_hda_gen_build_controls(codec);
911 if (err < 0)
912 return err;
913
914 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
915 return 0;
916 }
917
918
919 /*
920 * Common callbacks
921 */
922
alc_pre_init(struct hda_codec * codec)923 static void alc_pre_init(struct hda_codec *codec)
924 {
925 alc_fill_eapd_coef(codec);
926 }
927
928 #define is_s3_resume(codec) \
929 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
930 #define is_s4_resume(codec) \
931 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
932
alc_init(struct hda_codec * codec)933 static int alc_init(struct hda_codec *codec)
934 {
935 struct alc_spec *spec = codec->spec;
936
937 /* hibernation resume needs the full chip initialization */
938 if (is_s4_resume(codec))
939 alc_pre_init(codec);
940
941 if (spec->init_hook)
942 spec->init_hook(codec);
943
944 spec->gen.skip_verbs = 1; /* applied in below */
945 snd_hda_gen_init(codec);
946 alc_fix_pll(codec);
947 alc_auto_init_amp(codec, spec->init_amp);
948 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
949
950 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
951
952 return 0;
953 }
954
955 #define alc_free snd_hda_gen_free
956
957 #ifdef CONFIG_PM
alc_shutup(struct hda_codec * codec)958 static inline void alc_shutup(struct hda_codec *codec)
959 {
960 struct alc_spec *spec = codec->spec;
961
962 if (!snd_hda_get_bool_hint(codec, "shutup"))
963 return; /* disabled explicitly by hints */
964
965 if (spec && spec->shutup)
966 spec->shutup(codec);
967 else
968 alc_shutup_pins(codec);
969 }
970
alc_power_eapd(struct hda_codec * codec)971 static void alc_power_eapd(struct hda_codec *codec)
972 {
973 alc_auto_setup_eapd(codec, false);
974 }
975
alc_suspend(struct hda_codec * codec)976 static int alc_suspend(struct hda_codec *codec)
977 {
978 struct alc_spec *spec = codec->spec;
979 alc_shutup(codec);
980 if (spec && spec->power_hook)
981 spec->power_hook(codec);
982 return 0;
983 }
984
alc_resume(struct hda_codec * codec)985 static int alc_resume(struct hda_codec *codec)
986 {
987 struct alc_spec *spec = codec->spec;
988
989 if (!spec->no_depop_delay)
990 msleep(150); /* to avoid pop noise */
991 codec->patch_ops.init(codec);
992 snd_hda_regmap_sync(codec);
993 hda_call_check_power_status(codec, 0x01);
994 return 0;
995 }
996 #endif
997
998 /*
999 */
1000 static const struct hda_codec_ops alc_patch_ops = {
1001 .build_controls = alc_build_controls,
1002 .build_pcms = snd_hda_gen_build_pcms,
1003 .init = alc_init,
1004 .free = alc_free,
1005 .unsol_event = snd_hda_jack_unsol_event,
1006 #ifdef CONFIG_PM
1007 .resume = alc_resume,
1008 .suspend = alc_suspend,
1009 .check_power_status = snd_hda_gen_check_power_status,
1010 #endif
1011 };
1012
1013
1014 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1015
1016 /*
1017 * Rename codecs appropriately from COEF value or subvendor id
1018 */
1019 struct alc_codec_rename_table {
1020 unsigned int vendor_id;
1021 unsigned short coef_mask;
1022 unsigned short coef_bits;
1023 const char *name;
1024 };
1025
1026 struct alc_codec_rename_pci_table {
1027 unsigned int codec_vendor_id;
1028 unsigned short pci_subvendor;
1029 unsigned short pci_subdevice;
1030 const char *name;
1031 };
1032
1033 static const struct alc_codec_rename_table rename_tbl[] = {
1034 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1035 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1036 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1037 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1038 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1039 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1040 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1041 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1042 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1043 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1044 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1045 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1046 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1047 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1048 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1049 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1050 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1051 { } /* terminator */
1052 };
1053
1054 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1055 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1056 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1057 { 0x10ec0283, 0x1028, 0, "ALC3223" },
1058 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1059 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1060 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1061 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1062 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1063 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1064 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1065 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1066 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1067 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1068 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1069 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1070 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1071 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1072 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1073 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1074 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1075 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1076 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1077 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1078 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1079 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1080 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1081 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1082 { } /* terminator */
1083 };
1084
alc_codec_rename_from_preset(struct hda_codec * codec)1085 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1086 {
1087 const struct alc_codec_rename_table *p;
1088 const struct alc_codec_rename_pci_table *q;
1089
1090 for (p = rename_tbl; p->vendor_id; p++) {
1091 if (p->vendor_id != codec->core.vendor_id)
1092 continue;
1093 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1094 return alc_codec_rename(codec, p->name);
1095 }
1096
1097 if (!codec->bus->pci)
1098 return 0;
1099 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1100 if (q->codec_vendor_id != codec->core.vendor_id)
1101 continue;
1102 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1103 continue;
1104 if (!q->pci_subdevice ||
1105 q->pci_subdevice == codec->bus->pci->subsystem_device)
1106 return alc_codec_rename(codec, q->name);
1107 }
1108
1109 return 0;
1110 }
1111
1112
1113 /*
1114 * Digital-beep handlers
1115 */
1116 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1117
1118 /* additional beep mixers; private_value will be overwritten */
1119 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1120 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1121 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1122 };
1123
1124 /* set up and create beep controls */
set_beep_amp(struct alc_spec * spec,hda_nid_t nid,int idx,int dir)1125 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1126 int idx, int dir)
1127 {
1128 struct snd_kcontrol_new *knew;
1129 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1130 int i;
1131
1132 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1133 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1134 &alc_beep_mixer[i]);
1135 if (!knew)
1136 return -ENOMEM;
1137 knew->private_value = beep_amp;
1138 }
1139 return 0;
1140 }
1141
1142 static const struct snd_pci_quirk beep_allow_list[] = {
1143 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1144 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1145 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1146 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1147 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1148 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1149 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1150 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1151 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1152 /* denylist -- no beep available */
1153 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1154 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1155 {}
1156 };
1157
has_cdefine_beep(struct hda_codec * codec)1158 static inline int has_cdefine_beep(struct hda_codec *codec)
1159 {
1160 struct alc_spec *spec = codec->spec;
1161 const struct snd_pci_quirk *q;
1162 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1163 if (q)
1164 return q->value;
1165 return spec->cdefine.enable_pcbeep;
1166 }
1167 #else
1168 #define set_beep_amp(spec, nid, idx, dir) 0
1169 #define has_cdefine_beep(codec) 0
1170 #endif
1171
1172 /* parse the BIOS configuration and set up the alc_spec */
1173 /* return 1 if successful, 0 if the proper config is not found,
1174 * or a negative error code
1175 */
alc_parse_auto_config(struct hda_codec * codec,const hda_nid_t * ignore_nids,const hda_nid_t * ssid_nids)1176 static int alc_parse_auto_config(struct hda_codec *codec,
1177 const hda_nid_t *ignore_nids,
1178 const hda_nid_t *ssid_nids)
1179 {
1180 struct alc_spec *spec = codec->spec;
1181 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1182 int err;
1183
1184 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1185 spec->parse_flags);
1186 if (err < 0)
1187 return err;
1188
1189 if (ssid_nids)
1190 alc_ssid_check(codec, ssid_nids);
1191
1192 err = snd_hda_gen_parse_auto_config(codec, cfg);
1193 if (err < 0)
1194 return err;
1195
1196 return 1;
1197 }
1198
1199 /* common preparation job for alc_spec */
alc_alloc_spec(struct hda_codec * codec,hda_nid_t mixer_nid)1200 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1201 {
1202 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1203 int err;
1204
1205 if (!spec)
1206 return -ENOMEM;
1207 codec->spec = spec;
1208 snd_hda_gen_spec_init(&spec->gen);
1209 spec->gen.mixer_nid = mixer_nid;
1210 spec->gen.own_eapd_ctl = 1;
1211 codec->single_adc_amp = 1;
1212 /* FIXME: do we need this for all Realtek codec models? */
1213 codec->spdif_status_reset = 1;
1214 codec->forced_resume = 1;
1215 codec->patch_ops = alc_patch_ops;
1216 mutex_init(&spec->coef_mutex);
1217
1218 err = alc_codec_rename_from_preset(codec);
1219 if (err < 0) {
1220 kfree(spec);
1221 return err;
1222 }
1223 return 0;
1224 }
1225
alc880_parse_auto_config(struct hda_codec * codec)1226 static int alc880_parse_auto_config(struct hda_codec *codec)
1227 {
1228 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1229 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1230 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1231 }
1232
1233 /*
1234 * ALC880 fix-ups
1235 */
1236 enum {
1237 ALC880_FIXUP_GPIO1,
1238 ALC880_FIXUP_GPIO2,
1239 ALC880_FIXUP_MEDION_RIM,
1240 ALC880_FIXUP_LG,
1241 ALC880_FIXUP_LG_LW25,
1242 ALC880_FIXUP_W810,
1243 ALC880_FIXUP_EAPD_COEF,
1244 ALC880_FIXUP_TCL_S700,
1245 ALC880_FIXUP_VOL_KNOB,
1246 ALC880_FIXUP_FUJITSU,
1247 ALC880_FIXUP_F1734,
1248 ALC880_FIXUP_UNIWILL,
1249 ALC880_FIXUP_UNIWILL_DIG,
1250 ALC880_FIXUP_Z71V,
1251 ALC880_FIXUP_ASUS_W5A,
1252 ALC880_FIXUP_3ST_BASE,
1253 ALC880_FIXUP_3ST,
1254 ALC880_FIXUP_3ST_DIG,
1255 ALC880_FIXUP_5ST_BASE,
1256 ALC880_FIXUP_5ST,
1257 ALC880_FIXUP_5ST_DIG,
1258 ALC880_FIXUP_6ST_BASE,
1259 ALC880_FIXUP_6ST,
1260 ALC880_FIXUP_6ST_DIG,
1261 ALC880_FIXUP_6ST_AUTOMUTE,
1262 };
1263
1264 /* enable the volume-knob widget support on NID 0x21 */
alc880_fixup_vol_knob(struct hda_codec * codec,const struct hda_fixup * fix,int action)1265 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1266 const struct hda_fixup *fix, int action)
1267 {
1268 if (action == HDA_FIXUP_ACT_PROBE)
1269 snd_hda_jack_detect_enable_callback(codec, 0x21,
1270 alc_update_knob_master);
1271 }
1272
1273 static const struct hda_fixup alc880_fixups[] = {
1274 [ALC880_FIXUP_GPIO1] = {
1275 .type = HDA_FIXUP_FUNC,
1276 .v.func = alc_fixup_gpio1,
1277 },
1278 [ALC880_FIXUP_GPIO2] = {
1279 .type = HDA_FIXUP_FUNC,
1280 .v.func = alc_fixup_gpio2,
1281 },
1282 [ALC880_FIXUP_MEDION_RIM] = {
1283 .type = HDA_FIXUP_VERBS,
1284 .v.verbs = (const struct hda_verb[]) {
1285 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1286 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1287 { }
1288 },
1289 .chained = true,
1290 .chain_id = ALC880_FIXUP_GPIO2,
1291 },
1292 [ALC880_FIXUP_LG] = {
1293 .type = HDA_FIXUP_PINS,
1294 .v.pins = (const struct hda_pintbl[]) {
1295 /* disable bogus unused pins */
1296 { 0x16, 0x411111f0 },
1297 { 0x18, 0x411111f0 },
1298 { 0x1a, 0x411111f0 },
1299 { }
1300 }
1301 },
1302 [ALC880_FIXUP_LG_LW25] = {
1303 .type = HDA_FIXUP_PINS,
1304 .v.pins = (const struct hda_pintbl[]) {
1305 { 0x1a, 0x0181344f }, /* line-in */
1306 { 0x1b, 0x0321403f }, /* headphone */
1307 { }
1308 }
1309 },
1310 [ALC880_FIXUP_W810] = {
1311 .type = HDA_FIXUP_PINS,
1312 .v.pins = (const struct hda_pintbl[]) {
1313 /* disable bogus unused pins */
1314 { 0x17, 0x411111f0 },
1315 { }
1316 },
1317 .chained = true,
1318 .chain_id = ALC880_FIXUP_GPIO2,
1319 },
1320 [ALC880_FIXUP_EAPD_COEF] = {
1321 .type = HDA_FIXUP_VERBS,
1322 .v.verbs = (const struct hda_verb[]) {
1323 /* change to EAPD mode */
1324 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1325 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1326 {}
1327 },
1328 },
1329 [ALC880_FIXUP_TCL_S700] = {
1330 .type = HDA_FIXUP_VERBS,
1331 .v.verbs = (const struct hda_verb[]) {
1332 /* change to EAPD mode */
1333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1334 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1335 {}
1336 },
1337 .chained = true,
1338 .chain_id = ALC880_FIXUP_GPIO2,
1339 },
1340 [ALC880_FIXUP_VOL_KNOB] = {
1341 .type = HDA_FIXUP_FUNC,
1342 .v.func = alc880_fixup_vol_knob,
1343 },
1344 [ALC880_FIXUP_FUJITSU] = {
1345 /* override all pins as BIOS on old Amilo is broken */
1346 .type = HDA_FIXUP_PINS,
1347 .v.pins = (const struct hda_pintbl[]) {
1348 { 0x14, 0x0121401f }, /* HP */
1349 { 0x15, 0x99030120 }, /* speaker */
1350 { 0x16, 0x99030130 }, /* bass speaker */
1351 { 0x17, 0x411111f0 }, /* N/A */
1352 { 0x18, 0x411111f0 }, /* N/A */
1353 { 0x19, 0x01a19950 }, /* mic-in */
1354 { 0x1a, 0x411111f0 }, /* N/A */
1355 { 0x1b, 0x411111f0 }, /* N/A */
1356 { 0x1c, 0x411111f0 }, /* N/A */
1357 { 0x1d, 0x411111f0 }, /* N/A */
1358 { 0x1e, 0x01454140 }, /* SPDIF out */
1359 { }
1360 },
1361 .chained = true,
1362 .chain_id = ALC880_FIXUP_VOL_KNOB,
1363 },
1364 [ALC880_FIXUP_F1734] = {
1365 /* almost compatible with FUJITSU, but no bass and SPDIF */
1366 .type = HDA_FIXUP_PINS,
1367 .v.pins = (const struct hda_pintbl[]) {
1368 { 0x14, 0x0121401f }, /* HP */
1369 { 0x15, 0x99030120 }, /* speaker */
1370 { 0x16, 0x411111f0 }, /* N/A */
1371 { 0x17, 0x411111f0 }, /* N/A */
1372 { 0x18, 0x411111f0 }, /* N/A */
1373 { 0x19, 0x01a19950 }, /* mic-in */
1374 { 0x1a, 0x411111f0 }, /* N/A */
1375 { 0x1b, 0x411111f0 }, /* N/A */
1376 { 0x1c, 0x411111f0 }, /* N/A */
1377 { 0x1d, 0x411111f0 }, /* N/A */
1378 { 0x1e, 0x411111f0 }, /* N/A */
1379 { }
1380 },
1381 .chained = true,
1382 .chain_id = ALC880_FIXUP_VOL_KNOB,
1383 },
1384 [ALC880_FIXUP_UNIWILL] = {
1385 /* need to fix HP and speaker pins to be parsed correctly */
1386 .type = HDA_FIXUP_PINS,
1387 .v.pins = (const struct hda_pintbl[]) {
1388 { 0x14, 0x0121411f }, /* HP */
1389 { 0x15, 0x99030120 }, /* speaker */
1390 { 0x16, 0x99030130 }, /* bass speaker */
1391 { }
1392 },
1393 },
1394 [ALC880_FIXUP_UNIWILL_DIG] = {
1395 .type = HDA_FIXUP_PINS,
1396 .v.pins = (const struct hda_pintbl[]) {
1397 /* disable bogus unused pins */
1398 { 0x17, 0x411111f0 },
1399 { 0x19, 0x411111f0 },
1400 { 0x1b, 0x411111f0 },
1401 { 0x1f, 0x411111f0 },
1402 { }
1403 }
1404 },
1405 [ALC880_FIXUP_Z71V] = {
1406 .type = HDA_FIXUP_PINS,
1407 .v.pins = (const struct hda_pintbl[]) {
1408 /* set up the whole pins as BIOS is utterly broken */
1409 { 0x14, 0x99030120 }, /* speaker */
1410 { 0x15, 0x0121411f }, /* HP */
1411 { 0x16, 0x411111f0 }, /* N/A */
1412 { 0x17, 0x411111f0 }, /* N/A */
1413 { 0x18, 0x01a19950 }, /* mic-in */
1414 { 0x19, 0x411111f0 }, /* N/A */
1415 { 0x1a, 0x01813031 }, /* line-in */
1416 { 0x1b, 0x411111f0 }, /* N/A */
1417 { 0x1c, 0x411111f0 }, /* N/A */
1418 { 0x1d, 0x411111f0 }, /* N/A */
1419 { 0x1e, 0x0144111e }, /* SPDIF */
1420 { }
1421 }
1422 },
1423 [ALC880_FIXUP_ASUS_W5A] = {
1424 .type = HDA_FIXUP_PINS,
1425 .v.pins = (const struct hda_pintbl[]) {
1426 /* set up the whole pins as BIOS is utterly broken */
1427 { 0x14, 0x0121411f }, /* HP */
1428 { 0x15, 0x411111f0 }, /* N/A */
1429 { 0x16, 0x411111f0 }, /* N/A */
1430 { 0x17, 0x411111f0 }, /* N/A */
1431 { 0x18, 0x90a60160 }, /* mic */
1432 { 0x19, 0x411111f0 }, /* N/A */
1433 { 0x1a, 0x411111f0 }, /* N/A */
1434 { 0x1b, 0x411111f0 }, /* N/A */
1435 { 0x1c, 0x411111f0 }, /* N/A */
1436 { 0x1d, 0x411111f0 }, /* N/A */
1437 { 0x1e, 0xb743111e }, /* SPDIF out */
1438 { }
1439 },
1440 .chained = true,
1441 .chain_id = ALC880_FIXUP_GPIO1,
1442 },
1443 [ALC880_FIXUP_3ST_BASE] = {
1444 .type = HDA_FIXUP_PINS,
1445 .v.pins = (const struct hda_pintbl[]) {
1446 { 0x14, 0x01014010 }, /* line-out */
1447 { 0x15, 0x411111f0 }, /* N/A */
1448 { 0x16, 0x411111f0 }, /* N/A */
1449 { 0x17, 0x411111f0 }, /* N/A */
1450 { 0x18, 0x01a19c30 }, /* mic-in */
1451 { 0x19, 0x0121411f }, /* HP */
1452 { 0x1a, 0x01813031 }, /* line-in */
1453 { 0x1b, 0x02a19c40 }, /* front-mic */
1454 { 0x1c, 0x411111f0 }, /* N/A */
1455 { 0x1d, 0x411111f0 }, /* N/A */
1456 /* 0x1e is filled in below */
1457 { 0x1f, 0x411111f0 }, /* N/A */
1458 { }
1459 }
1460 },
1461 [ALC880_FIXUP_3ST] = {
1462 .type = HDA_FIXUP_PINS,
1463 .v.pins = (const struct hda_pintbl[]) {
1464 { 0x1e, 0x411111f0 }, /* N/A */
1465 { }
1466 },
1467 .chained = true,
1468 .chain_id = ALC880_FIXUP_3ST_BASE,
1469 },
1470 [ALC880_FIXUP_3ST_DIG] = {
1471 .type = HDA_FIXUP_PINS,
1472 .v.pins = (const struct hda_pintbl[]) {
1473 { 0x1e, 0x0144111e }, /* SPDIF */
1474 { }
1475 },
1476 .chained = true,
1477 .chain_id = ALC880_FIXUP_3ST_BASE,
1478 },
1479 [ALC880_FIXUP_5ST_BASE] = {
1480 .type = HDA_FIXUP_PINS,
1481 .v.pins = (const struct hda_pintbl[]) {
1482 { 0x14, 0x01014010 }, /* front */
1483 { 0x15, 0x411111f0 }, /* N/A */
1484 { 0x16, 0x01011411 }, /* CLFE */
1485 { 0x17, 0x01016412 }, /* surr */
1486 { 0x18, 0x01a19c30 }, /* mic-in */
1487 { 0x19, 0x0121411f }, /* HP */
1488 { 0x1a, 0x01813031 }, /* line-in */
1489 { 0x1b, 0x02a19c40 }, /* front-mic */
1490 { 0x1c, 0x411111f0 }, /* N/A */
1491 { 0x1d, 0x411111f0 }, /* N/A */
1492 /* 0x1e is filled in below */
1493 { 0x1f, 0x411111f0 }, /* N/A */
1494 { }
1495 }
1496 },
1497 [ALC880_FIXUP_5ST] = {
1498 .type = HDA_FIXUP_PINS,
1499 .v.pins = (const struct hda_pintbl[]) {
1500 { 0x1e, 0x411111f0 }, /* N/A */
1501 { }
1502 },
1503 .chained = true,
1504 .chain_id = ALC880_FIXUP_5ST_BASE,
1505 },
1506 [ALC880_FIXUP_5ST_DIG] = {
1507 .type = HDA_FIXUP_PINS,
1508 .v.pins = (const struct hda_pintbl[]) {
1509 { 0x1e, 0x0144111e }, /* SPDIF */
1510 { }
1511 },
1512 .chained = true,
1513 .chain_id = ALC880_FIXUP_5ST_BASE,
1514 },
1515 [ALC880_FIXUP_6ST_BASE] = {
1516 .type = HDA_FIXUP_PINS,
1517 .v.pins = (const struct hda_pintbl[]) {
1518 { 0x14, 0x01014010 }, /* front */
1519 { 0x15, 0x01016412 }, /* surr */
1520 { 0x16, 0x01011411 }, /* CLFE */
1521 { 0x17, 0x01012414 }, /* side */
1522 { 0x18, 0x01a19c30 }, /* mic-in */
1523 { 0x19, 0x02a19c40 }, /* front-mic */
1524 { 0x1a, 0x01813031 }, /* line-in */
1525 { 0x1b, 0x0121411f }, /* HP */
1526 { 0x1c, 0x411111f0 }, /* N/A */
1527 { 0x1d, 0x411111f0 }, /* N/A */
1528 /* 0x1e is filled in below */
1529 { 0x1f, 0x411111f0 }, /* N/A */
1530 { }
1531 }
1532 },
1533 [ALC880_FIXUP_6ST] = {
1534 .type = HDA_FIXUP_PINS,
1535 .v.pins = (const struct hda_pintbl[]) {
1536 { 0x1e, 0x411111f0 }, /* N/A */
1537 { }
1538 },
1539 .chained = true,
1540 .chain_id = ALC880_FIXUP_6ST_BASE,
1541 },
1542 [ALC880_FIXUP_6ST_DIG] = {
1543 .type = HDA_FIXUP_PINS,
1544 .v.pins = (const struct hda_pintbl[]) {
1545 { 0x1e, 0x0144111e }, /* SPDIF */
1546 { }
1547 },
1548 .chained = true,
1549 .chain_id = ALC880_FIXUP_6ST_BASE,
1550 },
1551 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1552 .type = HDA_FIXUP_PINS,
1553 .v.pins = (const struct hda_pintbl[]) {
1554 { 0x1b, 0x0121401f }, /* HP with jack detect */
1555 { }
1556 },
1557 .chained_before = true,
1558 .chain_id = ALC880_FIXUP_6ST_BASE,
1559 },
1560 };
1561
1562 static const struct hda_quirk alc880_fixup_tbl[] = {
1563 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1564 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1565 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1566 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1567 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1568 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1569 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1570 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1571 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1572 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1573 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1574 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1575 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1576 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1577 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1578 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1579 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1580 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1581 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1582 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1583 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1584 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1585 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1586
1587 /* Below is the copied entries from alc880_quirks.c.
1588 * It's not quite sure whether BIOS sets the correct pin-config table
1589 * on these machines, thus they are kept to be compatible with
1590 * the old static quirks. Once when it's confirmed to work without
1591 * these overrides, it'd be better to remove.
1592 */
1593 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1594 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1595 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1596 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1597 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1598 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1599 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1600 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1601 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1602 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1603 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1604 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1605 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1606 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1607 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1608 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1609 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1610 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1611 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1612 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1613 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1614 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1615 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1616 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1617 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1618 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1619 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1620 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1621 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1622 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1623 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1624 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1625 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1626 /* default Intel */
1627 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1628 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1629 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1630 {}
1631 };
1632
1633 static const struct hda_model_fixup alc880_fixup_models[] = {
1634 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1635 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1636 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1637 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1638 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1639 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1640 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1641 {}
1642 };
1643
1644
1645 /*
1646 * OK, here we have finally the patch for ALC880
1647 */
patch_alc880(struct hda_codec * codec)1648 static int patch_alc880(struct hda_codec *codec)
1649 {
1650 struct alc_spec *spec;
1651 int err;
1652
1653 err = alc_alloc_spec(codec, 0x0b);
1654 if (err < 0)
1655 return err;
1656
1657 spec = codec->spec;
1658 spec->gen.need_dac_fix = 1;
1659 spec->gen.beep_nid = 0x01;
1660
1661 codec->patch_ops.unsol_event = alc880_unsol_event;
1662
1663 alc_pre_init(codec);
1664
1665 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1666 alc880_fixups);
1667 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1668
1669 /* automatic parse from the BIOS config */
1670 err = alc880_parse_auto_config(codec);
1671 if (err < 0)
1672 goto error;
1673
1674 if (!spec->gen.no_analog) {
1675 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1676 if (err < 0)
1677 goto error;
1678 }
1679
1680 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1681
1682 return 0;
1683
1684 error:
1685 alc_free(codec);
1686 return err;
1687 }
1688
1689
1690 /*
1691 * ALC260 support
1692 */
alc260_parse_auto_config(struct hda_codec * codec)1693 static int alc260_parse_auto_config(struct hda_codec *codec)
1694 {
1695 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1696 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1697 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1698 }
1699
1700 /*
1701 * Pin config fixes
1702 */
1703 enum {
1704 ALC260_FIXUP_HP_DC5750,
1705 ALC260_FIXUP_HP_PIN_0F,
1706 ALC260_FIXUP_COEF,
1707 ALC260_FIXUP_GPIO1,
1708 ALC260_FIXUP_GPIO1_TOGGLE,
1709 ALC260_FIXUP_REPLACER,
1710 ALC260_FIXUP_HP_B1900,
1711 ALC260_FIXUP_KN1,
1712 ALC260_FIXUP_FSC_S7020,
1713 ALC260_FIXUP_FSC_S7020_JWSE,
1714 ALC260_FIXUP_VAIO_PINS,
1715 };
1716
alc260_gpio1_automute(struct hda_codec * codec)1717 static void alc260_gpio1_automute(struct hda_codec *codec)
1718 {
1719 struct alc_spec *spec = codec->spec;
1720
1721 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1722 }
1723
alc260_fixup_gpio1_toggle(struct hda_codec * codec,const struct hda_fixup * fix,int action)1724 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1725 const struct hda_fixup *fix, int action)
1726 {
1727 struct alc_spec *spec = codec->spec;
1728 if (action == HDA_FIXUP_ACT_PROBE) {
1729 /* although the machine has only one output pin, we need to
1730 * toggle GPIO1 according to the jack state
1731 */
1732 spec->gen.automute_hook = alc260_gpio1_automute;
1733 spec->gen.detect_hp = 1;
1734 spec->gen.automute_speaker = 1;
1735 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1736 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1737 snd_hda_gen_hp_automute);
1738 alc_setup_gpio(codec, 0x01);
1739 }
1740 }
1741
alc260_fixup_kn1(struct hda_codec * codec,const struct hda_fixup * fix,int action)1742 static void alc260_fixup_kn1(struct hda_codec *codec,
1743 const struct hda_fixup *fix, int action)
1744 {
1745 struct alc_spec *spec = codec->spec;
1746 static const struct hda_pintbl pincfgs[] = {
1747 { 0x0f, 0x02214000 }, /* HP/speaker */
1748 { 0x12, 0x90a60160 }, /* int mic */
1749 { 0x13, 0x02a19000 }, /* ext mic */
1750 { 0x18, 0x01446000 }, /* SPDIF out */
1751 /* disable bogus I/O pins */
1752 { 0x10, 0x411111f0 },
1753 { 0x11, 0x411111f0 },
1754 { 0x14, 0x411111f0 },
1755 { 0x15, 0x411111f0 },
1756 { 0x16, 0x411111f0 },
1757 { 0x17, 0x411111f0 },
1758 { 0x19, 0x411111f0 },
1759 { }
1760 };
1761
1762 switch (action) {
1763 case HDA_FIXUP_ACT_PRE_PROBE:
1764 snd_hda_apply_pincfgs(codec, pincfgs);
1765 spec->init_amp = ALC_INIT_NONE;
1766 break;
1767 }
1768 }
1769
alc260_fixup_fsc_s7020(struct hda_codec * codec,const struct hda_fixup * fix,int action)1770 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1771 const struct hda_fixup *fix, int action)
1772 {
1773 struct alc_spec *spec = codec->spec;
1774 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1775 spec->init_amp = ALC_INIT_NONE;
1776 }
1777
alc260_fixup_fsc_s7020_jwse(struct hda_codec * codec,const struct hda_fixup * fix,int action)1778 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1779 const struct hda_fixup *fix, int action)
1780 {
1781 struct alc_spec *spec = codec->spec;
1782 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1783 spec->gen.add_jack_modes = 1;
1784 spec->gen.hp_mic = 1;
1785 }
1786 }
1787
1788 static const struct hda_fixup alc260_fixups[] = {
1789 [ALC260_FIXUP_HP_DC5750] = {
1790 .type = HDA_FIXUP_PINS,
1791 .v.pins = (const struct hda_pintbl[]) {
1792 { 0x11, 0x90130110 }, /* speaker */
1793 { }
1794 }
1795 },
1796 [ALC260_FIXUP_HP_PIN_0F] = {
1797 .type = HDA_FIXUP_PINS,
1798 .v.pins = (const struct hda_pintbl[]) {
1799 { 0x0f, 0x01214000 }, /* HP */
1800 { }
1801 }
1802 },
1803 [ALC260_FIXUP_COEF] = {
1804 .type = HDA_FIXUP_VERBS,
1805 .v.verbs = (const struct hda_verb[]) {
1806 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1807 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1808 { }
1809 },
1810 },
1811 [ALC260_FIXUP_GPIO1] = {
1812 .type = HDA_FIXUP_FUNC,
1813 .v.func = alc_fixup_gpio1,
1814 },
1815 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1816 .type = HDA_FIXUP_FUNC,
1817 .v.func = alc260_fixup_gpio1_toggle,
1818 .chained = true,
1819 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1820 },
1821 [ALC260_FIXUP_REPLACER] = {
1822 .type = HDA_FIXUP_VERBS,
1823 .v.verbs = (const struct hda_verb[]) {
1824 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1825 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1826 { }
1827 },
1828 .chained = true,
1829 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1830 },
1831 [ALC260_FIXUP_HP_B1900] = {
1832 .type = HDA_FIXUP_FUNC,
1833 .v.func = alc260_fixup_gpio1_toggle,
1834 .chained = true,
1835 .chain_id = ALC260_FIXUP_COEF,
1836 },
1837 [ALC260_FIXUP_KN1] = {
1838 .type = HDA_FIXUP_FUNC,
1839 .v.func = alc260_fixup_kn1,
1840 },
1841 [ALC260_FIXUP_FSC_S7020] = {
1842 .type = HDA_FIXUP_FUNC,
1843 .v.func = alc260_fixup_fsc_s7020,
1844 },
1845 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1846 .type = HDA_FIXUP_FUNC,
1847 .v.func = alc260_fixup_fsc_s7020_jwse,
1848 .chained = true,
1849 .chain_id = ALC260_FIXUP_FSC_S7020,
1850 },
1851 [ALC260_FIXUP_VAIO_PINS] = {
1852 .type = HDA_FIXUP_PINS,
1853 .v.pins = (const struct hda_pintbl[]) {
1854 /* Pin configs are missing completely on some VAIOs */
1855 { 0x0f, 0x01211020 },
1856 { 0x10, 0x0001003f },
1857 { 0x11, 0x411111f0 },
1858 { 0x12, 0x01a15930 },
1859 { 0x13, 0x411111f0 },
1860 { 0x14, 0x411111f0 },
1861 { 0x15, 0x411111f0 },
1862 { 0x16, 0x411111f0 },
1863 { 0x17, 0x411111f0 },
1864 { 0x18, 0x411111f0 },
1865 { 0x19, 0x411111f0 },
1866 { }
1867 }
1868 },
1869 };
1870
1871 static const struct hda_quirk alc260_fixup_tbl[] = {
1872 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1873 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1874 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1875 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1876 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1877 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1878 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1879 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1880 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1881 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1882 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1883 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1884 {}
1885 };
1886
1887 static const struct hda_model_fixup alc260_fixup_models[] = {
1888 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1889 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1890 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1891 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1892 {}
1893 };
1894
1895 /*
1896 */
patch_alc260(struct hda_codec * codec)1897 static int patch_alc260(struct hda_codec *codec)
1898 {
1899 struct alc_spec *spec;
1900 int err;
1901
1902 err = alc_alloc_spec(codec, 0x07);
1903 if (err < 0)
1904 return err;
1905
1906 spec = codec->spec;
1907 /* as quite a few machines require HP amp for speaker outputs,
1908 * it's easier to enable it unconditionally; even if it's unneeded,
1909 * it's almost harmless.
1910 */
1911 spec->gen.prefer_hp_amp = 1;
1912 spec->gen.beep_nid = 0x01;
1913
1914 spec->shutup = alc_eapd_shutup;
1915
1916 alc_pre_init(codec);
1917
1918 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1919 alc260_fixups);
1920 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1921
1922 /* automatic parse from the BIOS config */
1923 err = alc260_parse_auto_config(codec);
1924 if (err < 0)
1925 goto error;
1926
1927 if (!spec->gen.no_analog) {
1928 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1929 if (err < 0)
1930 goto error;
1931 }
1932
1933 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1934
1935 return 0;
1936
1937 error:
1938 alc_free(codec);
1939 return err;
1940 }
1941
1942
1943 /*
1944 * ALC882/883/885/888/889 support
1945 *
1946 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1947 * configuration. Each pin widget can choose any input DACs and a mixer.
1948 * Each ADC is connected from a mixer of all inputs. This makes possible
1949 * 6-channel independent captures.
1950 *
1951 * In addition, an independent DAC for the multi-playback (not used in this
1952 * driver yet).
1953 */
1954
1955 /*
1956 * Pin config fixes
1957 */
1958 enum {
1959 ALC882_FIXUP_ABIT_AW9D_MAX,
1960 ALC882_FIXUP_LENOVO_Y530,
1961 ALC882_FIXUP_PB_M5210,
1962 ALC882_FIXUP_ACER_ASPIRE_7736,
1963 ALC882_FIXUP_ASUS_W90V,
1964 ALC889_FIXUP_CD,
1965 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1966 ALC889_FIXUP_VAIO_TT,
1967 ALC888_FIXUP_EEE1601,
1968 ALC886_FIXUP_EAPD,
1969 ALC882_FIXUP_EAPD,
1970 ALC883_FIXUP_EAPD,
1971 ALC883_FIXUP_ACER_EAPD,
1972 ALC882_FIXUP_GPIO1,
1973 ALC882_FIXUP_GPIO2,
1974 ALC882_FIXUP_GPIO3,
1975 ALC889_FIXUP_COEF,
1976 ALC882_FIXUP_ASUS_W2JC,
1977 ALC882_FIXUP_ACER_ASPIRE_4930G,
1978 ALC882_FIXUP_ACER_ASPIRE_8930G,
1979 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1980 ALC885_FIXUP_MACPRO_GPIO,
1981 ALC889_FIXUP_DAC_ROUTE,
1982 ALC889_FIXUP_MBP_VREF,
1983 ALC889_FIXUP_IMAC91_VREF,
1984 ALC889_FIXUP_MBA11_VREF,
1985 ALC889_FIXUP_MBA21_VREF,
1986 ALC889_FIXUP_MP11_VREF,
1987 ALC889_FIXUP_MP41_VREF,
1988 ALC882_FIXUP_INV_DMIC,
1989 ALC882_FIXUP_NO_PRIMARY_HP,
1990 ALC887_FIXUP_ASUS_BASS,
1991 ALC887_FIXUP_BASS_CHMAP,
1992 ALC1220_FIXUP_GB_DUAL_CODECS,
1993 ALC1220_FIXUP_GB_X570,
1994 ALC1220_FIXUP_CLEVO_P950,
1995 ALC1220_FIXUP_CLEVO_PB51ED,
1996 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1997 ALC887_FIXUP_ASUS_AUDIO,
1998 ALC887_FIXUP_ASUS_HMIC,
1999 ALCS1200A_FIXUP_MIC_VREF,
2000 ALC888VD_FIXUP_MIC_100VREF,
2001 };
2002
alc889_fixup_coef(struct hda_codec * codec,const struct hda_fixup * fix,int action)2003 static void alc889_fixup_coef(struct hda_codec *codec,
2004 const struct hda_fixup *fix, int action)
2005 {
2006 if (action != HDA_FIXUP_ACT_INIT)
2007 return;
2008 alc_update_coef_idx(codec, 7, 0, 0x2030);
2009 }
2010
2011 /* set up GPIO at initialization */
alc885_fixup_macpro_gpio(struct hda_codec * codec,const struct hda_fixup * fix,int action)2012 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2013 const struct hda_fixup *fix, int action)
2014 {
2015 struct alc_spec *spec = codec->spec;
2016
2017 spec->gpio_write_delay = true;
2018 alc_fixup_gpio3(codec, fix, action);
2019 }
2020
2021 /* Fix the connection of some pins for ALC889:
2022 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2023 * work correctly (bko#42740)
2024 */
alc889_fixup_dac_route(struct hda_codec * codec,const struct hda_fixup * fix,int action)2025 static void alc889_fixup_dac_route(struct hda_codec *codec,
2026 const struct hda_fixup *fix, int action)
2027 {
2028 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2029 /* fake the connections during parsing the tree */
2030 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2031 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2032 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2033 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2034 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2035 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2036 } else if (action == HDA_FIXUP_ACT_PROBE) {
2037 /* restore the connections */
2038 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2039 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2040 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2041 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2042 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2043 }
2044 }
2045
2046 /* Set VREF on HP pin */
alc889_fixup_mbp_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)2047 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2048 const struct hda_fixup *fix, int action)
2049 {
2050 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2051 struct alc_spec *spec = codec->spec;
2052 int i;
2053
2054 if (action != HDA_FIXUP_ACT_INIT)
2055 return;
2056 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2057 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2058 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2059 continue;
2060 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2061 val |= AC_PINCTL_VREF_80;
2062 snd_hda_set_pin_ctl(codec, nids[i], val);
2063 spec->gen.keep_vref_in_automute = 1;
2064 break;
2065 }
2066 }
2067
alc889_fixup_mac_pins(struct hda_codec * codec,const hda_nid_t * nids,int num_nids)2068 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2069 const hda_nid_t *nids, int num_nids)
2070 {
2071 struct alc_spec *spec = codec->spec;
2072 int i;
2073
2074 for (i = 0; i < num_nids; i++) {
2075 unsigned int val;
2076 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2077 val |= AC_PINCTL_VREF_50;
2078 snd_hda_set_pin_ctl(codec, nids[i], val);
2079 }
2080 spec->gen.keep_vref_in_automute = 1;
2081 }
2082
2083 /* Set VREF on speaker pins on imac91 */
alc889_fixup_imac91_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)2084 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2085 const struct hda_fixup *fix, int action)
2086 {
2087 static const hda_nid_t nids[] = { 0x18, 0x1a };
2088
2089 if (action == HDA_FIXUP_ACT_INIT)
2090 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2091 }
2092
2093 /* Set VREF on speaker pins on mba11 */
alc889_fixup_mba11_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)2094 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2095 const struct hda_fixup *fix, int action)
2096 {
2097 static const hda_nid_t nids[] = { 0x18 };
2098
2099 if (action == HDA_FIXUP_ACT_INIT)
2100 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2101 }
2102
2103 /* Set VREF on speaker pins on mba21 */
alc889_fixup_mba21_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)2104 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2105 const struct hda_fixup *fix, int action)
2106 {
2107 static const hda_nid_t nids[] = { 0x18, 0x19 };
2108
2109 if (action == HDA_FIXUP_ACT_INIT)
2110 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2111 }
2112
2113 /* Don't take HP output as primary
2114 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2115 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2116 */
alc882_fixup_no_primary_hp(struct hda_codec * codec,const struct hda_fixup * fix,int action)2117 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2118 const struct hda_fixup *fix, int action)
2119 {
2120 struct alc_spec *spec = codec->spec;
2121 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2122 spec->gen.no_primary_hp = 1;
2123 spec->gen.no_multi_io = 1;
2124 }
2125 }
2126
2127 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2128 const struct hda_fixup *fix, int action);
2129
2130 /* For dual-codec configuration, we need to disable some features to avoid
2131 * conflicts of kctls and PCM streams
2132 */
alc_fixup_dual_codecs(struct hda_codec * codec,const struct hda_fixup * fix,int action)2133 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2134 const struct hda_fixup *fix, int action)
2135 {
2136 struct alc_spec *spec = codec->spec;
2137
2138 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2139 return;
2140 /* disable vmaster */
2141 spec->gen.suppress_vmaster = 1;
2142 /* auto-mute and auto-mic switch don't work with multiple codecs */
2143 spec->gen.suppress_auto_mute = 1;
2144 spec->gen.suppress_auto_mic = 1;
2145 /* disable aamix as well */
2146 spec->gen.mixer_nid = 0;
2147 /* add location prefix to avoid conflicts */
2148 codec->force_pin_prefix = 1;
2149 }
2150
rename_ctl(struct hda_codec * codec,const char * oldname,const char * newname)2151 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2152 const char *newname)
2153 {
2154 struct snd_kcontrol *kctl;
2155
2156 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2157 if (kctl)
2158 snd_ctl_rename(codec->card, kctl, newname);
2159 }
2160
alc1220_fixup_gb_dual_codecs(struct hda_codec * codec,const struct hda_fixup * fix,int action)2161 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2162 const struct hda_fixup *fix,
2163 int action)
2164 {
2165 alc_fixup_dual_codecs(codec, fix, action);
2166 switch (action) {
2167 case HDA_FIXUP_ACT_PRE_PROBE:
2168 /* override card longname to provide a unique UCM profile */
2169 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2170 break;
2171 case HDA_FIXUP_ACT_BUILD:
2172 /* rename Capture controls depending on the codec */
2173 rename_ctl(codec, "Capture Volume",
2174 codec->addr == 0 ?
2175 "Rear-Panel Capture Volume" :
2176 "Front-Panel Capture Volume");
2177 rename_ctl(codec, "Capture Switch",
2178 codec->addr == 0 ?
2179 "Rear-Panel Capture Switch" :
2180 "Front-Panel Capture Switch");
2181 break;
2182 }
2183 }
2184
alc1220_fixup_gb_x570(struct hda_codec * codec,const struct hda_fixup * fix,int action)2185 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2186 const struct hda_fixup *fix,
2187 int action)
2188 {
2189 static const hda_nid_t conn1[] = { 0x0c };
2190 static const struct coef_fw gb_x570_coefs[] = {
2191 WRITE_COEF(0x07, 0x03c0),
2192 WRITE_COEF(0x1a, 0x01c1),
2193 WRITE_COEF(0x1b, 0x0202),
2194 WRITE_COEF(0x43, 0x3005),
2195 {}
2196 };
2197
2198 switch (action) {
2199 case HDA_FIXUP_ACT_PRE_PROBE:
2200 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2201 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2202 break;
2203 case HDA_FIXUP_ACT_INIT:
2204 alc_process_coef_fw(codec, gb_x570_coefs);
2205 break;
2206 }
2207 }
2208
alc1220_fixup_clevo_p950(struct hda_codec * codec,const struct hda_fixup * fix,int action)2209 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2210 const struct hda_fixup *fix,
2211 int action)
2212 {
2213 static const hda_nid_t conn1[] = { 0x0c };
2214
2215 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2216 return;
2217
2218 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2219 /* We therefore want to make sure 0x14 (front headphone) and
2220 * 0x1b (speakers) use the stereo DAC 0x02
2221 */
2222 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2223 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2224 }
2225
2226 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2227 const struct hda_fixup *fix, int action);
2228
alc1220_fixup_clevo_pb51ed(struct hda_codec * codec,const struct hda_fixup * fix,int action)2229 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2230 const struct hda_fixup *fix,
2231 int action)
2232 {
2233 alc1220_fixup_clevo_p950(codec, fix, action);
2234 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2235 }
2236
alc887_asus_hp_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)2237 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2238 struct hda_jack_callback *jack)
2239 {
2240 struct alc_spec *spec = codec->spec;
2241 unsigned int vref;
2242
2243 snd_hda_gen_hp_automute(codec, jack);
2244
2245 if (spec->gen.hp_jack_present)
2246 vref = AC_PINCTL_VREF_80;
2247 else
2248 vref = AC_PINCTL_VREF_HIZ;
2249 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2250 }
2251
alc887_fixup_asus_jack(struct hda_codec * codec,const struct hda_fixup * fix,int action)2252 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2253 const struct hda_fixup *fix, int action)
2254 {
2255 struct alc_spec *spec = codec->spec;
2256 if (action != HDA_FIXUP_ACT_PROBE)
2257 return;
2258 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2259 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2260 }
2261
2262 static const struct hda_fixup alc882_fixups[] = {
2263 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2264 .type = HDA_FIXUP_PINS,
2265 .v.pins = (const struct hda_pintbl[]) {
2266 { 0x15, 0x01080104 }, /* side */
2267 { 0x16, 0x01011012 }, /* rear */
2268 { 0x17, 0x01016011 }, /* clfe */
2269 { }
2270 }
2271 },
2272 [ALC882_FIXUP_LENOVO_Y530] = {
2273 .type = HDA_FIXUP_PINS,
2274 .v.pins = (const struct hda_pintbl[]) {
2275 { 0x15, 0x99130112 }, /* rear int speakers */
2276 { 0x16, 0x99130111 }, /* subwoofer */
2277 { }
2278 }
2279 },
2280 [ALC882_FIXUP_PB_M5210] = {
2281 .type = HDA_FIXUP_PINCTLS,
2282 .v.pins = (const struct hda_pintbl[]) {
2283 { 0x19, PIN_VREF50 },
2284 {}
2285 }
2286 },
2287 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2288 .type = HDA_FIXUP_FUNC,
2289 .v.func = alc_fixup_sku_ignore,
2290 },
2291 [ALC882_FIXUP_ASUS_W90V] = {
2292 .type = HDA_FIXUP_PINS,
2293 .v.pins = (const struct hda_pintbl[]) {
2294 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2295 { }
2296 }
2297 },
2298 [ALC889_FIXUP_CD] = {
2299 .type = HDA_FIXUP_PINS,
2300 .v.pins = (const struct hda_pintbl[]) {
2301 { 0x1c, 0x993301f0 }, /* CD */
2302 { }
2303 }
2304 },
2305 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2306 .type = HDA_FIXUP_PINS,
2307 .v.pins = (const struct hda_pintbl[]) {
2308 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2309 { }
2310 },
2311 .chained = true,
2312 .chain_id = ALC889_FIXUP_CD,
2313 },
2314 [ALC889_FIXUP_VAIO_TT] = {
2315 .type = HDA_FIXUP_PINS,
2316 .v.pins = (const struct hda_pintbl[]) {
2317 { 0x17, 0x90170111 }, /* hidden surround speaker */
2318 { }
2319 }
2320 },
2321 [ALC888_FIXUP_EEE1601] = {
2322 .type = HDA_FIXUP_VERBS,
2323 .v.verbs = (const struct hda_verb[]) {
2324 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2325 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2326 { }
2327 }
2328 },
2329 [ALC886_FIXUP_EAPD] = {
2330 .type = HDA_FIXUP_VERBS,
2331 .v.verbs = (const struct hda_verb[]) {
2332 /* change to EAPD mode */
2333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2334 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2335 { }
2336 }
2337 },
2338 [ALC882_FIXUP_EAPD] = {
2339 .type = HDA_FIXUP_VERBS,
2340 .v.verbs = (const struct hda_verb[]) {
2341 /* change to EAPD mode */
2342 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2343 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2344 { }
2345 }
2346 },
2347 [ALC883_FIXUP_EAPD] = {
2348 .type = HDA_FIXUP_VERBS,
2349 .v.verbs = (const struct hda_verb[]) {
2350 /* change to EAPD mode */
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2353 { }
2354 }
2355 },
2356 [ALC883_FIXUP_ACER_EAPD] = {
2357 .type = HDA_FIXUP_VERBS,
2358 .v.verbs = (const struct hda_verb[]) {
2359 /* eanable EAPD on Acer laptops */
2360 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2361 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2362 { }
2363 }
2364 },
2365 [ALC882_FIXUP_GPIO1] = {
2366 .type = HDA_FIXUP_FUNC,
2367 .v.func = alc_fixup_gpio1,
2368 },
2369 [ALC882_FIXUP_GPIO2] = {
2370 .type = HDA_FIXUP_FUNC,
2371 .v.func = alc_fixup_gpio2,
2372 },
2373 [ALC882_FIXUP_GPIO3] = {
2374 .type = HDA_FIXUP_FUNC,
2375 .v.func = alc_fixup_gpio3,
2376 },
2377 [ALC882_FIXUP_ASUS_W2JC] = {
2378 .type = HDA_FIXUP_FUNC,
2379 .v.func = alc_fixup_gpio1,
2380 .chained = true,
2381 .chain_id = ALC882_FIXUP_EAPD,
2382 },
2383 [ALC889_FIXUP_COEF] = {
2384 .type = HDA_FIXUP_FUNC,
2385 .v.func = alc889_fixup_coef,
2386 },
2387 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2388 .type = HDA_FIXUP_PINS,
2389 .v.pins = (const struct hda_pintbl[]) {
2390 { 0x16, 0x99130111 }, /* CLFE speaker */
2391 { 0x17, 0x99130112 }, /* surround speaker */
2392 { }
2393 },
2394 .chained = true,
2395 .chain_id = ALC882_FIXUP_GPIO1,
2396 },
2397 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2398 .type = HDA_FIXUP_PINS,
2399 .v.pins = (const struct hda_pintbl[]) {
2400 { 0x16, 0x99130111 }, /* CLFE speaker */
2401 { 0x1b, 0x99130112 }, /* surround speaker */
2402 { }
2403 },
2404 .chained = true,
2405 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2406 },
2407 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2408 /* additional init verbs for Acer Aspire 8930G */
2409 .type = HDA_FIXUP_VERBS,
2410 .v.verbs = (const struct hda_verb[]) {
2411 /* Enable all DACs */
2412 /* DAC DISABLE/MUTE 1? */
2413 /* setting bits 1-5 disables DAC nids 0x02-0x06
2414 * apparently. Init=0x38 */
2415 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2416 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2417 /* DAC DISABLE/MUTE 2? */
2418 /* some bit here disables the other DACs.
2419 * Init=0x4900 */
2420 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2421 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2422 /* DMIC fix
2423 * This laptop has a stereo digital microphone.
2424 * The mics are only 1cm apart which makes the stereo
2425 * useless. However, either the mic or the ALC889
2426 * makes the signal become a difference/sum signal
2427 * instead of standard stereo, which is annoying.
2428 * So instead we flip this bit which makes the
2429 * codec replicate the sum signal to both channels,
2430 * turning it into a normal mono mic.
2431 */
2432 /* DMIC_CONTROL? Init value = 0x0001 */
2433 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2434 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2435 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2436 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2437 { }
2438 },
2439 .chained = true,
2440 .chain_id = ALC882_FIXUP_GPIO1,
2441 },
2442 [ALC885_FIXUP_MACPRO_GPIO] = {
2443 .type = HDA_FIXUP_FUNC,
2444 .v.func = alc885_fixup_macpro_gpio,
2445 },
2446 [ALC889_FIXUP_DAC_ROUTE] = {
2447 .type = HDA_FIXUP_FUNC,
2448 .v.func = alc889_fixup_dac_route,
2449 },
2450 [ALC889_FIXUP_MBP_VREF] = {
2451 .type = HDA_FIXUP_FUNC,
2452 .v.func = alc889_fixup_mbp_vref,
2453 .chained = true,
2454 .chain_id = ALC882_FIXUP_GPIO1,
2455 },
2456 [ALC889_FIXUP_IMAC91_VREF] = {
2457 .type = HDA_FIXUP_FUNC,
2458 .v.func = alc889_fixup_imac91_vref,
2459 .chained = true,
2460 .chain_id = ALC882_FIXUP_GPIO1,
2461 },
2462 [ALC889_FIXUP_MBA11_VREF] = {
2463 .type = HDA_FIXUP_FUNC,
2464 .v.func = alc889_fixup_mba11_vref,
2465 .chained = true,
2466 .chain_id = ALC889_FIXUP_MBP_VREF,
2467 },
2468 [ALC889_FIXUP_MBA21_VREF] = {
2469 .type = HDA_FIXUP_FUNC,
2470 .v.func = alc889_fixup_mba21_vref,
2471 .chained = true,
2472 .chain_id = ALC889_FIXUP_MBP_VREF,
2473 },
2474 [ALC889_FIXUP_MP11_VREF] = {
2475 .type = HDA_FIXUP_FUNC,
2476 .v.func = alc889_fixup_mba11_vref,
2477 .chained = true,
2478 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2479 },
2480 [ALC889_FIXUP_MP41_VREF] = {
2481 .type = HDA_FIXUP_FUNC,
2482 .v.func = alc889_fixup_mbp_vref,
2483 .chained = true,
2484 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2485 },
2486 [ALC882_FIXUP_INV_DMIC] = {
2487 .type = HDA_FIXUP_FUNC,
2488 .v.func = alc_fixup_inv_dmic,
2489 },
2490 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2491 .type = HDA_FIXUP_FUNC,
2492 .v.func = alc882_fixup_no_primary_hp,
2493 },
2494 [ALC887_FIXUP_ASUS_BASS] = {
2495 .type = HDA_FIXUP_PINS,
2496 .v.pins = (const struct hda_pintbl[]) {
2497 {0x16, 0x99130130}, /* bass speaker */
2498 {}
2499 },
2500 .chained = true,
2501 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2502 },
2503 [ALC887_FIXUP_BASS_CHMAP] = {
2504 .type = HDA_FIXUP_FUNC,
2505 .v.func = alc_fixup_bass_chmap,
2506 },
2507 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2508 .type = HDA_FIXUP_FUNC,
2509 .v.func = alc1220_fixup_gb_dual_codecs,
2510 },
2511 [ALC1220_FIXUP_GB_X570] = {
2512 .type = HDA_FIXUP_FUNC,
2513 .v.func = alc1220_fixup_gb_x570,
2514 },
2515 [ALC1220_FIXUP_CLEVO_P950] = {
2516 .type = HDA_FIXUP_FUNC,
2517 .v.func = alc1220_fixup_clevo_p950,
2518 },
2519 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2520 .type = HDA_FIXUP_FUNC,
2521 .v.func = alc1220_fixup_clevo_pb51ed,
2522 },
2523 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2524 .type = HDA_FIXUP_PINS,
2525 .v.pins = (const struct hda_pintbl[]) {
2526 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2527 {}
2528 },
2529 .chained = true,
2530 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2531 },
2532 [ALC887_FIXUP_ASUS_AUDIO] = {
2533 .type = HDA_FIXUP_PINS,
2534 .v.pins = (const struct hda_pintbl[]) {
2535 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2536 { 0x19, 0x22219420 },
2537 {}
2538 },
2539 },
2540 [ALC887_FIXUP_ASUS_HMIC] = {
2541 .type = HDA_FIXUP_FUNC,
2542 .v.func = alc887_fixup_asus_jack,
2543 .chained = true,
2544 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2545 },
2546 [ALCS1200A_FIXUP_MIC_VREF] = {
2547 .type = HDA_FIXUP_PINCTLS,
2548 .v.pins = (const struct hda_pintbl[]) {
2549 { 0x18, PIN_VREF50 }, /* rear mic */
2550 { 0x19, PIN_VREF50 }, /* front mic */
2551 {}
2552 }
2553 },
2554 [ALC888VD_FIXUP_MIC_100VREF] = {
2555 .type = HDA_FIXUP_PINCTLS,
2556 .v.pins = (const struct hda_pintbl[]) {
2557 { 0x18, PIN_VREF100 }, /* headset mic */
2558 {}
2559 }
2560 },
2561 };
2562
2563 static const struct hda_quirk alc882_fixup_tbl[] = {
2564 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2565 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2566 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2567 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2568 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2569 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2570 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2571 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2572 ALC882_FIXUP_ACER_ASPIRE_4930G),
2573 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2574 ALC882_FIXUP_ACER_ASPIRE_4930G),
2575 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2576 ALC882_FIXUP_ACER_ASPIRE_8930G),
2577 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2578 ALC882_FIXUP_ACER_ASPIRE_8930G),
2579 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2580 ALC882_FIXUP_ACER_ASPIRE_4930G),
2581 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2582 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2583 ALC882_FIXUP_ACER_ASPIRE_4930G),
2584 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2585 ALC882_FIXUP_ACER_ASPIRE_4930G),
2586 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2587 ALC882_FIXUP_ACER_ASPIRE_4930G),
2588 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2589 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2590 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2591 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2592 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2593 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2594 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2595 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2596 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2597 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2598 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2599 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2600 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2601 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2602 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2603 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2604
2605 /* All Apple entries are in codec SSIDs */
2606 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2607 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2608 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2609 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2610 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2611 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2612 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2613 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2614 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2615 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2616 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2617 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2618 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2619 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2620 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2621 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2622 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2623 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2624 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2625 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2626 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2627 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2628
2629 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2630 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2631 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2632 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2633 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2634 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2635 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2636 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2637 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2638 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2639 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2640 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2641 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2642 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2643 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2644 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2645 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2646 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2647 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2648 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2649 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2650 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2651 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2653 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2654 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2660 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2661 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2662 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2663 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2664 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2665 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2666 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2667 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2668 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2669 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2670 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2671 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2672 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2673 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2674 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2675 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2676 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2677 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2678 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2679 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2680 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2681 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2682 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2683 {}
2684 };
2685
2686 static const struct hda_model_fixup alc882_fixup_models[] = {
2687 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2688 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2689 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2690 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2691 {.id = ALC889_FIXUP_CD, .name = "cd"},
2692 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2693 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2694 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2695 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2696 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2697 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2698 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2699 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2700 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2701 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2702 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2703 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2704 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2705 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2706 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2707 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2708 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2709 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2710 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2711 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2712 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2713 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2714 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2715 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2716 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2717 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2718 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2719 {}
2720 };
2721
2722 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2723 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2724 {0x14, 0x01014010},
2725 {0x15, 0x01011012},
2726 {0x16, 0x01016011},
2727 {0x18, 0x01a19040},
2728 {0x19, 0x02a19050},
2729 {0x1a, 0x0181304f},
2730 {0x1b, 0x0221401f},
2731 {0x1e, 0x01456130}),
2732 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2733 {0x14, 0x01015010},
2734 {0x15, 0x01011012},
2735 {0x16, 0x01011011},
2736 {0x18, 0x01a11040},
2737 {0x19, 0x02a19050},
2738 {0x1a, 0x0181104f},
2739 {0x1b, 0x0221401f},
2740 {0x1e, 0x01451130}),
2741 {}
2742 };
2743
2744 /*
2745 * BIOS auto configuration
2746 */
2747 /* almost identical with ALC880 parser... */
alc882_parse_auto_config(struct hda_codec * codec)2748 static int alc882_parse_auto_config(struct hda_codec *codec)
2749 {
2750 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2751 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2752 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2753 }
2754
2755 /*
2756 */
patch_alc882(struct hda_codec * codec)2757 static int patch_alc882(struct hda_codec *codec)
2758 {
2759 struct alc_spec *spec;
2760 int err;
2761
2762 err = alc_alloc_spec(codec, 0x0b);
2763 if (err < 0)
2764 return err;
2765
2766 spec = codec->spec;
2767
2768 switch (codec->core.vendor_id) {
2769 case 0x10ec0882:
2770 case 0x10ec0885:
2771 case 0x10ec0900:
2772 case 0x10ec0b00:
2773 case 0x10ec1220:
2774 break;
2775 default:
2776 /* ALC883 and variants */
2777 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2778 break;
2779 }
2780
2781 alc_pre_init(codec);
2782
2783 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2784 alc882_fixups);
2785 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2786 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2787
2788 alc_auto_parse_customize_define(codec);
2789
2790 if (has_cdefine_beep(codec))
2791 spec->gen.beep_nid = 0x01;
2792
2793 /* automatic parse from the BIOS config */
2794 err = alc882_parse_auto_config(codec);
2795 if (err < 0)
2796 goto error;
2797
2798 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2799 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2800 if (err < 0)
2801 goto error;
2802 }
2803
2804 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2805
2806 return 0;
2807
2808 error:
2809 alc_free(codec);
2810 return err;
2811 }
2812
2813
2814 /*
2815 * ALC262 support
2816 */
alc262_parse_auto_config(struct hda_codec * codec)2817 static int alc262_parse_auto_config(struct hda_codec *codec)
2818 {
2819 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2820 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2821 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2822 }
2823
2824 /*
2825 * Pin config fixes
2826 */
2827 enum {
2828 ALC262_FIXUP_FSC_H270,
2829 ALC262_FIXUP_FSC_S7110,
2830 ALC262_FIXUP_HP_Z200,
2831 ALC262_FIXUP_TYAN,
2832 ALC262_FIXUP_LENOVO_3000,
2833 ALC262_FIXUP_BENQ,
2834 ALC262_FIXUP_BENQ_T31,
2835 ALC262_FIXUP_INV_DMIC,
2836 ALC262_FIXUP_INTEL_BAYLEYBAY,
2837 };
2838
2839 static const struct hda_fixup alc262_fixups[] = {
2840 [ALC262_FIXUP_FSC_H270] = {
2841 .type = HDA_FIXUP_PINS,
2842 .v.pins = (const struct hda_pintbl[]) {
2843 { 0x14, 0x99130110 }, /* speaker */
2844 { 0x15, 0x0221142f }, /* front HP */
2845 { 0x1b, 0x0121141f }, /* rear HP */
2846 { }
2847 }
2848 },
2849 [ALC262_FIXUP_FSC_S7110] = {
2850 .type = HDA_FIXUP_PINS,
2851 .v.pins = (const struct hda_pintbl[]) {
2852 { 0x15, 0x90170110 }, /* speaker */
2853 { }
2854 },
2855 .chained = true,
2856 .chain_id = ALC262_FIXUP_BENQ,
2857 },
2858 [ALC262_FIXUP_HP_Z200] = {
2859 .type = HDA_FIXUP_PINS,
2860 .v.pins = (const struct hda_pintbl[]) {
2861 { 0x16, 0x99130120 }, /* internal speaker */
2862 { }
2863 }
2864 },
2865 [ALC262_FIXUP_TYAN] = {
2866 .type = HDA_FIXUP_PINS,
2867 .v.pins = (const struct hda_pintbl[]) {
2868 { 0x14, 0x1993e1f0 }, /* int AUX */
2869 { }
2870 }
2871 },
2872 [ALC262_FIXUP_LENOVO_3000] = {
2873 .type = HDA_FIXUP_PINCTLS,
2874 .v.pins = (const struct hda_pintbl[]) {
2875 { 0x19, PIN_VREF50 },
2876 {}
2877 },
2878 .chained = true,
2879 .chain_id = ALC262_FIXUP_BENQ,
2880 },
2881 [ALC262_FIXUP_BENQ] = {
2882 .type = HDA_FIXUP_VERBS,
2883 .v.verbs = (const struct hda_verb[]) {
2884 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2885 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2886 {}
2887 }
2888 },
2889 [ALC262_FIXUP_BENQ_T31] = {
2890 .type = HDA_FIXUP_VERBS,
2891 .v.verbs = (const struct hda_verb[]) {
2892 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2893 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2894 {}
2895 }
2896 },
2897 [ALC262_FIXUP_INV_DMIC] = {
2898 .type = HDA_FIXUP_FUNC,
2899 .v.func = alc_fixup_inv_dmic,
2900 },
2901 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2902 .type = HDA_FIXUP_FUNC,
2903 .v.func = alc_fixup_no_depop_delay,
2904 },
2905 };
2906
2907 static const struct hda_quirk alc262_fixup_tbl[] = {
2908 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2909 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2910 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2911 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2912 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2913 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2914 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2915 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2916 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2917 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2918 {}
2919 };
2920
2921 static const struct hda_model_fixup alc262_fixup_models[] = {
2922 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2923 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2924 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2925 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2926 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2927 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2928 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2929 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2930 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2931 {}
2932 };
2933
2934 /*
2935 */
patch_alc262(struct hda_codec * codec)2936 static int patch_alc262(struct hda_codec *codec)
2937 {
2938 struct alc_spec *spec;
2939 int err;
2940
2941 err = alc_alloc_spec(codec, 0x0b);
2942 if (err < 0)
2943 return err;
2944
2945 spec = codec->spec;
2946 spec->gen.shared_mic_vref_pin = 0x18;
2947
2948 spec->shutup = alc_eapd_shutup;
2949
2950 #if 0
2951 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2952 * under-run
2953 */
2954 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2955 #endif
2956 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2957
2958 alc_pre_init(codec);
2959
2960 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2961 alc262_fixups);
2962 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2963
2964 alc_auto_parse_customize_define(codec);
2965
2966 if (has_cdefine_beep(codec))
2967 spec->gen.beep_nid = 0x01;
2968
2969 /* automatic parse from the BIOS config */
2970 err = alc262_parse_auto_config(codec);
2971 if (err < 0)
2972 goto error;
2973
2974 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2975 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2976 if (err < 0)
2977 goto error;
2978 }
2979
2980 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2981
2982 return 0;
2983
2984 error:
2985 alc_free(codec);
2986 return err;
2987 }
2988
2989 /*
2990 * ALC268
2991 */
2992 /* bind Beep switches of both NID 0x0f and 0x10 */
alc268_beep_switch_put(struct snd_kcontrol * kcontrol,struct snd_ctl_elem_value * ucontrol)2993 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2994 struct snd_ctl_elem_value *ucontrol)
2995 {
2996 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2997 unsigned long pval;
2998 int err;
2999
3000 mutex_lock(&codec->control_mutex);
3001 pval = kcontrol->private_value;
3002 kcontrol->private_value = (pval & ~0xff) | 0x0f;
3003 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3004 if (err >= 0) {
3005 kcontrol->private_value = (pval & ~0xff) | 0x10;
3006 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3007 }
3008 kcontrol->private_value = pval;
3009 mutex_unlock(&codec->control_mutex);
3010 return err;
3011 }
3012
3013 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3014 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3015 {
3016 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3017 .name = "Beep Playback Switch",
3018 .subdevice = HDA_SUBDEV_AMP_FLAG,
3019 .info = snd_hda_mixer_amp_switch_info,
3020 .get = snd_hda_mixer_amp_switch_get,
3021 .put = alc268_beep_switch_put,
3022 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3023 },
3024 };
3025
3026 /* set PCBEEP vol = 0, mute connections */
3027 static const struct hda_verb alc268_beep_init_verbs[] = {
3028 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3029 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3030 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3031 { }
3032 };
3033
3034 enum {
3035 ALC268_FIXUP_INV_DMIC,
3036 ALC268_FIXUP_HP_EAPD,
3037 ALC268_FIXUP_SPDIF,
3038 };
3039
3040 static const struct hda_fixup alc268_fixups[] = {
3041 [ALC268_FIXUP_INV_DMIC] = {
3042 .type = HDA_FIXUP_FUNC,
3043 .v.func = alc_fixup_inv_dmic,
3044 },
3045 [ALC268_FIXUP_HP_EAPD] = {
3046 .type = HDA_FIXUP_VERBS,
3047 .v.verbs = (const struct hda_verb[]) {
3048 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3049 {}
3050 }
3051 },
3052 [ALC268_FIXUP_SPDIF] = {
3053 .type = HDA_FIXUP_PINS,
3054 .v.pins = (const struct hda_pintbl[]) {
3055 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3056 {}
3057 }
3058 },
3059 };
3060
3061 static const struct hda_model_fixup alc268_fixup_models[] = {
3062 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3063 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3064 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3065 {}
3066 };
3067
3068 static const struct hda_quirk alc268_fixup_tbl[] = {
3069 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3070 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3071 /* below is codec SSID since multiple Toshiba laptops have the
3072 * same PCI SSID 1179:ff00
3073 */
3074 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3075 {}
3076 };
3077
3078 /*
3079 * BIOS auto configuration
3080 */
alc268_parse_auto_config(struct hda_codec * codec)3081 static int alc268_parse_auto_config(struct hda_codec *codec)
3082 {
3083 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3084 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3085 }
3086
3087 /*
3088 */
patch_alc268(struct hda_codec * codec)3089 static int patch_alc268(struct hda_codec *codec)
3090 {
3091 struct alc_spec *spec;
3092 int i, err;
3093
3094 /* ALC268 has no aa-loopback mixer */
3095 err = alc_alloc_spec(codec, 0);
3096 if (err < 0)
3097 return err;
3098
3099 spec = codec->spec;
3100 if (has_cdefine_beep(codec))
3101 spec->gen.beep_nid = 0x01;
3102
3103 spec->shutup = alc_eapd_shutup;
3104
3105 alc_pre_init(codec);
3106
3107 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3108 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3109
3110 /* automatic parse from the BIOS config */
3111 err = alc268_parse_auto_config(codec);
3112 if (err < 0)
3113 goto error;
3114
3115 if (err > 0 && !spec->gen.no_analog &&
3116 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3117 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3118 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3119 &alc268_beep_mixer[i])) {
3120 err = -ENOMEM;
3121 goto error;
3122 }
3123 }
3124 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3125 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3126 /* override the amp caps for beep generator */
3127 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3128 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3129 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3130 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3131 (0 << AC_AMPCAP_MUTE_SHIFT));
3132 }
3133
3134 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3135
3136 return 0;
3137
3138 error:
3139 alc_free(codec);
3140 return err;
3141 }
3142
3143 /*
3144 * ALC269
3145 */
3146
3147 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3148 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3149 };
3150
3151 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3152 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3153 };
3154
3155 /* different alc269-variants */
3156 enum {
3157 ALC269_TYPE_ALC269VA,
3158 ALC269_TYPE_ALC269VB,
3159 ALC269_TYPE_ALC269VC,
3160 ALC269_TYPE_ALC269VD,
3161 ALC269_TYPE_ALC280,
3162 ALC269_TYPE_ALC282,
3163 ALC269_TYPE_ALC283,
3164 ALC269_TYPE_ALC284,
3165 ALC269_TYPE_ALC293,
3166 ALC269_TYPE_ALC286,
3167 ALC269_TYPE_ALC298,
3168 ALC269_TYPE_ALC255,
3169 ALC269_TYPE_ALC256,
3170 ALC269_TYPE_ALC257,
3171 ALC269_TYPE_ALC215,
3172 ALC269_TYPE_ALC225,
3173 ALC269_TYPE_ALC245,
3174 ALC269_TYPE_ALC287,
3175 ALC269_TYPE_ALC294,
3176 ALC269_TYPE_ALC300,
3177 ALC269_TYPE_ALC623,
3178 ALC269_TYPE_ALC700,
3179 };
3180
3181 /*
3182 * BIOS auto configuration
3183 */
alc269_parse_auto_config(struct hda_codec * codec)3184 static int alc269_parse_auto_config(struct hda_codec *codec)
3185 {
3186 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3187 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3188 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3189 struct alc_spec *spec = codec->spec;
3190 const hda_nid_t *ssids;
3191
3192 switch (spec->codec_variant) {
3193 case ALC269_TYPE_ALC269VA:
3194 case ALC269_TYPE_ALC269VC:
3195 case ALC269_TYPE_ALC280:
3196 case ALC269_TYPE_ALC284:
3197 case ALC269_TYPE_ALC293:
3198 ssids = alc269va_ssids;
3199 break;
3200 case ALC269_TYPE_ALC269VB:
3201 case ALC269_TYPE_ALC269VD:
3202 case ALC269_TYPE_ALC282:
3203 case ALC269_TYPE_ALC283:
3204 case ALC269_TYPE_ALC286:
3205 case ALC269_TYPE_ALC298:
3206 case ALC269_TYPE_ALC255:
3207 case ALC269_TYPE_ALC256:
3208 case ALC269_TYPE_ALC257:
3209 case ALC269_TYPE_ALC215:
3210 case ALC269_TYPE_ALC225:
3211 case ALC269_TYPE_ALC245:
3212 case ALC269_TYPE_ALC287:
3213 case ALC269_TYPE_ALC294:
3214 case ALC269_TYPE_ALC300:
3215 case ALC269_TYPE_ALC623:
3216 case ALC269_TYPE_ALC700:
3217 ssids = alc269_ssids;
3218 break;
3219 default:
3220 ssids = alc269_ssids;
3221 break;
3222 }
3223
3224 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3225 }
3226
3227 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3228 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3229 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3230 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3231 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3232 {}
3233 };
3234
alc_headset_btn_callback(struct hda_codec * codec,struct hda_jack_callback * jack)3235 static void alc_headset_btn_callback(struct hda_codec *codec,
3236 struct hda_jack_callback *jack)
3237 {
3238 int report = 0;
3239
3240 if (jack->unsol_res & (7 << 13))
3241 report |= SND_JACK_BTN_0;
3242
3243 if (jack->unsol_res & (1 << 16 | 3 << 8))
3244 report |= SND_JACK_BTN_1;
3245
3246 /* Volume up key */
3247 if (jack->unsol_res & (7 << 23))
3248 report |= SND_JACK_BTN_2;
3249
3250 /* Volume down key */
3251 if (jack->unsol_res & (7 << 10))
3252 report |= SND_JACK_BTN_3;
3253
3254 snd_hda_jack_set_button_state(codec, jack->nid, report);
3255 }
3256
alc_disable_headset_jack_key(struct hda_codec * codec)3257 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3258 {
3259 struct alc_spec *spec = codec->spec;
3260
3261 if (!spec->has_hs_key)
3262 return;
3263
3264 switch (codec->core.vendor_id) {
3265 case 0x10ec0215:
3266 case 0x10ec0225:
3267 case 0x10ec0285:
3268 case 0x10ec0287:
3269 case 0x10ec0295:
3270 case 0x10ec0289:
3271 case 0x10ec0299:
3272 alc_write_coef_idx(codec, 0x48, 0x0);
3273 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3274 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3275 break;
3276 case 0x10ec0230:
3277 case 0x10ec0236:
3278 case 0x10ec0256:
3279 case 0x10ec0257:
3280 case 0x19e58326:
3281 alc_write_coef_idx(codec, 0x48, 0x0);
3282 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3283 break;
3284 }
3285 }
3286
alc_enable_headset_jack_key(struct hda_codec * codec)3287 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3288 {
3289 struct alc_spec *spec = codec->spec;
3290
3291 if (!spec->has_hs_key)
3292 return;
3293
3294 switch (codec->core.vendor_id) {
3295 case 0x10ec0215:
3296 case 0x10ec0225:
3297 case 0x10ec0285:
3298 case 0x10ec0287:
3299 case 0x10ec0295:
3300 case 0x10ec0289:
3301 case 0x10ec0299:
3302 alc_write_coef_idx(codec, 0x48, 0xd011);
3303 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3304 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3305 break;
3306 case 0x10ec0230:
3307 case 0x10ec0236:
3308 case 0x10ec0256:
3309 case 0x10ec0257:
3310 case 0x19e58326:
3311 alc_write_coef_idx(codec, 0x48, 0xd011);
3312 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3313 break;
3314 }
3315 }
3316
alc_fixup_headset_jack(struct hda_codec * codec,const struct hda_fixup * fix,int action)3317 static void alc_fixup_headset_jack(struct hda_codec *codec,
3318 const struct hda_fixup *fix, int action)
3319 {
3320 struct alc_spec *spec = codec->spec;
3321 hda_nid_t hp_pin;
3322
3323 switch (action) {
3324 case HDA_FIXUP_ACT_PRE_PROBE:
3325 spec->has_hs_key = 1;
3326 snd_hda_jack_detect_enable_callback(codec, 0x55,
3327 alc_headset_btn_callback);
3328 break;
3329 case HDA_FIXUP_ACT_BUILD:
3330 hp_pin = alc_get_hp_pin(spec);
3331 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3332 alc_headset_btn_keymap,
3333 hp_pin))
3334 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3335 false, SND_JACK_HEADSET,
3336 alc_headset_btn_keymap);
3337
3338 alc_enable_headset_jack_key(codec);
3339 break;
3340 }
3341 }
3342
alc269vb_toggle_power_output(struct hda_codec * codec,int power_up)3343 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3344 {
3345 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3346 }
3347
alc269_shutup(struct hda_codec * codec)3348 static void alc269_shutup(struct hda_codec *codec)
3349 {
3350 struct alc_spec *spec = codec->spec;
3351
3352 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3353 alc269vb_toggle_power_output(codec, 0);
3354 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3355 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3356 msleep(150);
3357 }
3358 alc_shutup_pins(codec);
3359 }
3360
3361 static const struct coef_fw alc282_coefs[] = {
3362 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3363 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3364 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3365 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3366 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3367 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3368 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3369 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3370 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3371 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3372 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3373 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3374 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3375 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3376 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3377 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3378 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3379 WRITE_COEF(0x63, 0x2902), /* PLL */
3380 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3381 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3382 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3383 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3384 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3385 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3386 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3387 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3388 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3389 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3390 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3391 {}
3392 };
3393
alc282_restore_default_value(struct hda_codec * codec)3394 static void alc282_restore_default_value(struct hda_codec *codec)
3395 {
3396 alc_process_coef_fw(codec, alc282_coefs);
3397 }
3398
alc282_init(struct hda_codec * codec)3399 static void alc282_init(struct hda_codec *codec)
3400 {
3401 struct alc_spec *spec = codec->spec;
3402 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3403 bool hp_pin_sense;
3404 int coef78;
3405
3406 alc282_restore_default_value(codec);
3407
3408 if (!hp_pin)
3409 return;
3410 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3411 coef78 = alc_read_coef_idx(codec, 0x78);
3412
3413 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3414 /* Headphone capless set to high power mode */
3415 alc_write_coef_idx(codec, 0x78, 0x9004);
3416
3417 if (hp_pin_sense)
3418 msleep(2);
3419
3420 snd_hda_codec_write(codec, hp_pin, 0,
3421 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3422
3423 if (hp_pin_sense)
3424 msleep(85);
3425
3426 snd_hda_codec_write(codec, hp_pin, 0,
3427 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3428
3429 if (hp_pin_sense)
3430 msleep(100);
3431
3432 /* Headphone capless set to normal mode */
3433 alc_write_coef_idx(codec, 0x78, coef78);
3434 }
3435
alc282_shutup(struct hda_codec * codec)3436 static void alc282_shutup(struct hda_codec *codec)
3437 {
3438 struct alc_spec *spec = codec->spec;
3439 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3440 bool hp_pin_sense;
3441 int coef78;
3442
3443 if (!hp_pin) {
3444 alc269_shutup(codec);
3445 return;
3446 }
3447
3448 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3449 coef78 = alc_read_coef_idx(codec, 0x78);
3450 alc_write_coef_idx(codec, 0x78, 0x9004);
3451
3452 if (hp_pin_sense)
3453 msleep(2);
3454
3455 snd_hda_codec_write(codec, hp_pin, 0,
3456 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3457
3458 if (hp_pin_sense)
3459 msleep(85);
3460
3461 if (!spec->no_shutup_pins)
3462 snd_hda_codec_write(codec, hp_pin, 0,
3463 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3464
3465 if (hp_pin_sense)
3466 msleep(100);
3467
3468 alc_auto_setup_eapd(codec, false);
3469 alc_shutup_pins(codec);
3470 alc_write_coef_idx(codec, 0x78, coef78);
3471 }
3472
3473 static const struct coef_fw alc283_coefs[] = {
3474 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3475 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3476 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3477 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3478 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3479 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3480 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3481 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3482 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3483 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3484 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3485 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3486 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3487 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3488 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3489 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3490 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3491 WRITE_COEF(0x2e, 0x2902), /* PLL */
3492 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3493 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3494 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3495 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3496 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3497 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3498 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3499 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3500 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3501 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3502 WRITE_COEF(0x49, 0x0), /* test mode */
3503 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3504 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3505 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3506 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3507 {}
3508 };
3509
alc283_restore_default_value(struct hda_codec * codec)3510 static void alc283_restore_default_value(struct hda_codec *codec)
3511 {
3512 alc_process_coef_fw(codec, alc283_coefs);
3513 }
3514
alc283_init(struct hda_codec * codec)3515 static void alc283_init(struct hda_codec *codec)
3516 {
3517 struct alc_spec *spec = codec->spec;
3518 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3519 bool hp_pin_sense;
3520
3521 alc283_restore_default_value(codec);
3522
3523 if (!hp_pin)
3524 return;
3525
3526 msleep(30);
3527 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3528
3529 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3530 /* Headphone capless set to high power mode */
3531 alc_write_coef_idx(codec, 0x43, 0x9004);
3532
3533 snd_hda_codec_write(codec, hp_pin, 0,
3534 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3535
3536 if (hp_pin_sense)
3537 msleep(85);
3538
3539 snd_hda_codec_write(codec, hp_pin, 0,
3540 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3541
3542 if (hp_pin_sense)
3543 msleep(85);
3544 /* Index 0x46 Combo jack auto switch control 2 */
3545 /* 3k pull low control for Headset jack. */
3546 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3547 /* Headphone capless set to normal mode */
3548 alc_write_coef_idx(codec, 0x43, 0x9614);
3549 }
3550
alc283_shutup(struct hda_codec * codec)3551 static void alc283_shutup(struct hda_codec *codec)
3552 {
3553 struct alc_spec *spec = codec->spec;
3554 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3555 bool hp_pin_sense;
3556
3557 if (!hp_pin) {
3558 alc269_shutup(codec);
3559 return;
3560 }
3561
3562 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3563
3564 alc_write_coef_idx(codec, 0x43, 0x9004);
3565
3566 /*depop hp during suspend*/
3567 alc_write_coef_idx(codec, 0x06, 0x2100);
3568
3569 snd_hda_codec_write(codec, hp_pin, 0,
3570 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3571
3572 if (hp_pin_sense)
3573 msleep(100);
3574
3575 if (!spec->no_shutup_pins)
3576 snd_hda_codec_write(codec, hp_pin, 0,
3577 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3578
3579 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3580
3581 if (hp_pin_sense)
3582 msleep(100);
3583 alc_auto_setup_eapd(codec, false);
3584 alc_shutup_pins(codec);
3585 alc_write_coef_idx(codec, 0x43, 0x9614);
3586 }
3587
alc256_init(struct hda_codec * codec)3588 static void alc256_init(struct hda_codec *codec)
3589 {
3590 struct alc_spec *spec = codec->spec;
3591 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3592 bool hp_pin_sense;
3593
3594 if (spec->ultra_low_power) {
3595 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3596 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3597 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3598 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3599 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3600 msleep(30);
3601 }
3602
3603 if (!hp_pin)
3604 hp_pin = 0x21;
3605
3606 msleep(30);
3607
3608 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3609
3610 if (hp_pin_sense) {
3611 msleep(2);
3612 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3613
3614 snd_hda_codec_write(codec, hp_pin, 0,
3615 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3616
3617 msleep(75);
3618
3619 snd_hda_codec_write(codec, hp_pin, 0,
3620 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3621
3622 msleep(75);
3623 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3624 }
3625 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3626 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3627 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3628 /*
3629 * Expose headphone mic (or possibly Line In on some machines) instead
3630 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3631 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3632 * this register.
3633 */
3634 alc_write_coef_idx(codec, 0x36, 0x5757);
3635 }
3636
alc256_shutup(struct hda_codec * codec)3637 static void alc256_shutup(struct hda_codec *codec)
3638 {
3639 struct alc_spec *spec = codec->spec;
3640 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3641 bool hp_pin_sense;
3642
3643 if (!hp_pin)
3644 hp_pin = 0x21;
3645
3646 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3647 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3648
3649 if (hp_pin_sense) {
3650 msleep(2);
3651
3652 snd_hda_codec_write(codec, hp_pin, 0,
3653 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3654
3655 msleep(75);
3656
3657 /* 3k pull low control for Headset jack. */
3658 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3659 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3660 * when booting with headset plugged. So skip setting it for the codec alc257
3661 */
3662 if (spec->en_3kpull_low)
3663 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3664
3665 if (!spec->no_shutup_pins)
3666 snd_hda_codec_write(codec, hp_pin, 0,
3667 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3668
3669 msleep(75);
3670 }
3671
3672 alc_auto_setup_eapd(codec, false);
3673 alc_shutup_pins(codec);
3674 if (spec->ultra_low_power) {
3675 msleep(50);
3676 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3677 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3678 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3679 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3680 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3681 msleep(30);
3682 }
3683 }
3684
alc285_hp_init(struct hda_codec * codec)3685 static void alc285_hp_init(struct hda_codec *codec)
3686 {
3687 struct alc_spec *spec = codec->spec;
3688 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3689 int i, val;
3690 int coef38, coef0d, coef36;
3691
3692 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3693 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3694 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3695 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3696 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3697 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3698 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3699
3700 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3701
3702 if (hp_pin)
3703 snd_hda_codec_write(codec, hp_pin, 0,
3704 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3705
3706 msleep(130);
3707 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3708 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3709
3710 if (hp_pin)
3711 snd_hda_codec_write(codec, hp_pin, 0,
3712 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3713 msleep(10);
3714 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3715 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3716 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3717 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3718
3719 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3720 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3721 for (i = 0; i < 20 && val & 0x8000; i++) {
3722 msleep(50);
3723 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3724 } /* Wait for depop procedure finish */
3725
3726 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3727 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3728 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3729 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3730
3731 msleep(50);
3732 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3733 }
3734
alc225_init(struct hda_codec * codec)3735 static void alc225_init(struct hda_codec *codec)
3736 {
3737 struct alc_spec *spec = codec->spec;
3738 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3739 bool hp1_pin_sense, hp2_pin_sense;
3740
3741 if (spec->ultra_low_power) {
3742 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3743 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3744 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3745 msleep(30);
3746 }
3747
3748 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3749 spec->codec_variant != ALC269_TYPE_ALC245)
3750 /* required only at boot or S3 and S4 resume time */
3751 if (!spec->done_hp_init ||
3752 is_s3_resume(codec) ||
3753 is_s4_resume(codec)) {
3754 alc285_hp_init(codec);
3755 spec->done_hp_init = true;
3756 }
3757
3758 if (!hp_pin)
3759 hp_pin = 0x21;
3760 msleep(30);
3761
3762 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3763 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3764
3765 if (hp1_pin_sense || hp2_pin_sense) {
3766 msleep(2);
3767 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3768
3769 if (hp1_pin_sense)
3770 snd_hda_codec_write(codec, hp_pin, 0,
3771 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3772 if (hp2_pin_sense)
3773 snd_hda_codec_write(codec, 0x16, 0,
3774 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3775 msleep(75);
3776
3777 if (hp1_pin_sense)
3778 snd_hda_codec_write(codec, hp_pin, 0,
3779 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3780 if (hp2_pin_sense)
3781 snd_hda_codec_write(codec, 0x16, 0,
3782 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3783
3784 msleep(75);
3785 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3786 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3787 }
3788 }
3789
alc225_shutup(struct hda_codec * codec)3790 static void alc225_shutup(struct hda_codec *codec)
3791 {
3792 struct alc_spec *spec = codec->spec;
3793 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3794 bool hp1_pin_sense, hp2_pin_sense;
3795
3796 if (!hp_pin)
3797 hp_pin = 0x21;
3798
3799 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3800 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3801
3802 if (hp1_pin_sense || hp2_pin_sense) {
3803 alc_disable_headset_jack_key(codec);
3804 /* 3k pull low control for Headset jack. */
3805 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3806 msleep(2);
3807
3808 if (hp1_pin_sense)
3809 snd_hda_codec_write(codec, hp_pin, 0,
3810 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3811 if (hp2_pin_sense)
3812 snd_hda_codec_write(codec, 0x16, 0,
3813 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3814
3815 msleep(75);
3816
3817 if (hp1_pin_sense)
3818 snd_hda_codec_write(codec, hp_pin, 0,
3819 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3820 if (hp2_pin_sense)
3821 snd_hda_codec_write(codec, 0x16, 0,
3822 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3823
3824 msleep(75);
3825 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3826 alc_enable_headset_jack_key(codec);
3827 }
3828 alc_auto_setup_eapd(codec, false);
3829 alc_shutup_pins(codec);
3830 if (spec->ultra_low_power) {
3831 msleep(50);
3832 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3833 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3834 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3835 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3836 msleep(30);
3837 }
3838 }
3839
alc222_init(struct hda_codec * codec)3840 static void alc222_init(struct hda_codec *codec)
3841 {
3842 struct alc_spec *spec = codec->spec;
3843 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3844 bool hp1_pin_sense, hp2_pin_sense;
3845
3846 if (!hp_pin)
3847 return;
3848
3849 msleep(30);
3850
3851 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3852 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
3853
3854 if (hp1_pin_sense || hp2_pin_sense) {
3855 msleep(2);
3856
3857 if (hp1_pin_sense)
3858 snd_hda_codec_write(codec, hp_pin, 0,
3859 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3860 if (hp2_pin_sense)
3861 snd_hda_codec_write(codec, 0x14, 0,
3862 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3863 msleep(75);
3864
3865 if (hp1_pin_sense)
3866 snd_hda_codec_write(codec, hp_pin, 0,
3867 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3868 if (hp2_pin_sense)
3869 snd_hda_codec_write(codec, 0x14, 0,
3870 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3871
3872 msleep(75);
3873 }
3874 }
3875
alc222_shutup(struct hda_codec * codec)3876 static void alc222_shutup(struct hda_codec *codec)
3877 {
3878 struct alc_spec *spec = codec->spec;
3879 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3880 bool hp1_pin_sense, hp2_pin_sense;
3881
3882 if (!hp_pin)
3883 hp_pin = 0x21;
3884
3885 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3886 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
3887
3888 if (hp1_pin_sense || hp2_pin_sense) {
3889 msleep(2);
3890
3891 if (hp1_pin_sense)
3892 snd_hda_codec_write(codec, hp_pin, 0,
3893 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3894 if (hp2_pin_sense)
3895 snd_hda_codec_write(codec, 0x14, 0,
3896 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3897
3898 msleep(75);
3899
3900 if (hp1_pin_sense)
3901 snd_hda_codec_write(codec, hp_pin, 0,
3902 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3903 if (hp2_pin_sense)
3904 snd_hda_codec_write(codec, 0x14, 0,
3905 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3906
3907 msleep(75);
3908 }
3909 alc_auto_setup_eapd(codec, false);
3910 alc_shutup_pins(codec);
3911 }
3912
alc_default_init(struct hda_codec * codec)3913 static void alc_default_init(struct hda_codec *codec)
3914 {
3915 struct alc_spec *spec = codec->spec;
3916 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3917 bool hp_pin_sense;
3918
3919 if (!hp_pin)
3920 return;
3921
3922 msleep(30);
3923
3924 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3925
3926 if (hp_pin_sense) {
3927 msleep(2);
3928
3929 snd_hda_codec_write(codec, hp_pin, 0,
3930 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3931
3932 msleep(75);
3933
3934 snd_hda_codec_write(codec, hp_pin, 0,
3935 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3936 msleep(75);
3937 }
3938 }
3939
alc_default_shutup(struct hda_codec * codec)3940 static void alc_default_shutup(struct hda_codec *codec)
3941 {
3942 struct alc_spec *spec = codec->spec;
3943 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3944 bool hp_pin_sense;
3945
3946 if (!hp_pin) {
3947 alc269_shutup(codec);
3948 return;
3949 }
3950
3951 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3952
3953 if (hp_pin_sense) {
3954 msleep(2);
3955
3956 snd_hda_codec_write(codec, hp_pin, 0,
3957 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3958
3959 msleep(75);
3960
3961 if (!spec->no_shutup_pins)
3962 snd_hda_codec_write(codec, hp_pin, 0,
3963 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3964
3965 msleep(75);
3966 }
3967 alc_auto_setup_eapd(codec, false);
3968 alc_shutup_pins(codec);
3969 }
3970
alc294_hp_init(struct hda_codec * codec)3971 static void alc294_hp_init(struct hda_codec *codec)
3972 {
3973 struct alc_spec *spec = codec->spec;
3974 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3975 int i, val;
3976
3977 if (!hp_pin)
3978 return;
3979
3980 snd_hda_codec_write(codec, hp_pin, 0,
3981 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3982
3983 msleep(100);
3984
3985 if (!spec->no_shutup_pins)
3986 snd_hda_codec_write(codec, hp_pin, 0,
3987 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3988
3989 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3990 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3991
3992 /* Wait for depop procedure finish */
3993 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3994 for (i = 0; i < 20 && val & 0x0080; i++) {
3995 msleep(50);
3996 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3997 }
3998 /* Set HP depop to auto mode */
3999 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
4000 msleep(50);
4001 }
4002
alc294_init(struct hda_codec * codec)4003 static void alc294_init(struct hda_codec *codec)
4004 {
4005 struct alc_spec *spec = codec->spec;
4006
4007 /* required only at boot or S4 resume time */
4008 if (!spec->done_hp_init ||
4009 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
4010 alc294_hp_init(codec);
4011 spec->done_hp_init = true;
4012 }
4013 alc_default_init(codec);
4014 }
4015
alc5505_coef_set(struct hda_codec * codec,unsigned int index_reg,unsigned int val)4016 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
4017 unsigned int val)
4018 {
4019 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
4020 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
4021 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
4022 }
4023
alc5505_coef_get(struct hda_codec * codec,unsigned int index_reg)4024 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
4025 {
4026 unsigned int val;
4027
4028 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
4029 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
4030 & 0xffff;
4031 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
4032 << 16;
4033 return val;
4034 }
4035
alc5505_dsp_halt(struct hda_codec * codec)4036 static void alc5505_dsp_halt(struct hda_codec *codec)
4037 {
4038 unsigned int val;
4039
4040 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
4041 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
4042 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
4043 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
4044 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
4045 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
4046 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
4047 val = alc5505_coef_get(codec, 0x6220);
4048 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
4049 }
4050
alc5505_dsp_back_from_halt(struct hda_codec * codec)4051 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
4052 {
4053 alc5505_coef_set(codec, 0x61b8, 0x04133302);
4054 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
4055 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
4056 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
4057 alc5505_coef_set(codec, 0x6220, 0x2002010f);
4058 alc5505_coef_set(codec, 0x880c, 0x00000004);
4059 }
4060
alc5505_dsp_init(struct hda_codec * codec)4061 static void alc5505_dsp_init(struct hda_codec *codec)
4062 {
4063 unsigned int val;
4064
4065 alc5505_dsp_halt(codec);
4066 alc5505_dsp_back_from_halt(codec);
4067 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4068 alc5505_coef_set(codec, 0x61b0, 0x5b16);
4069 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4070 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4071 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4072 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4073 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4074 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4075 alc5505_coef_set(codec, 0x61b8, 0x04173302);
4076 alc5505_coef_set(codec, 0x61b8, 0x04163302);
4077 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4078 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4079 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4080
4081 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4082 if (val <= 3)
4083 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4084 else
4085 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4086
4087 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4088 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4089 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4090 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4091 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4092 alc5505_coef_set(codec, 0x880c, 0x00000003);
4093 alc5505_coef_set(codec, 0x880c, 0x00000010);
4094
4095 #ifdef HALT_REALTEK_ALC5505
4096 alc5505_dsp_halt(codec);
4097 #endif
4098 }
4099
4100 #ifdef HALT_REALTEK_ALC5505
4101 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4102 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
4103 #else
4104 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4105 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4106 #endif
4107
4108 #ifdef CONFIG_PM
alc269_suspend(struct hda_codec * codec)4109 static int alc269_suspend(struct hda_codec *codec)
4110 {
4111 struct alc_spec *spec = codec->spec;
4112
4113 if (spec->has_alc5505_dsp)
4114 alc5505_dsp_suspend(codec);
4115
4116 return alc_suspend(codec);
4117 }
4118
alc269_resume(struct hda_codec * codec)4119 static int alc269_resume(struct hda_codec *codec)
4120 {
4121 struct alc_spec *spec = codec->spec;
4122
4123 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4124 alc269vb_toggle_power_output(codec, 0);
4125 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4126 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
4127 msleep(150);
4128 }
4129
4130 codec->patch_ops.init(codec);
4131
4132 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4133 alc269vb_toggle_power_output(codec, 1);
4134 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4135 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
4136 msleep(200);
4137 }
4138
4139 snd_hda_regmap_sync(codec);
4140 hda_call_check_power_status(codec, 0x01);
4141
4142 /* on some machine, the BIOS will clear the codec gpio data when enter
4143 * suspend, and won't restore the data after resume, so we restore it
4144 * in the driver.
4145 */
4146 if (spec->gpio_data)
4147 alc_write_gpio_data(codec);
4148
4149 if (spec->has_alc5505_dsp)
4150 alc5505_dsp_resume(codec);
4151
4152 return 0;
4153 }
4154 #endif /* CONFIG_PM */
4155
alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec * codec,const struct hda_fixup * fix,int action)4156 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4157 const struct hda_fixup *fix, int action)
4158 {
4159 struct alc_spec *spec = codec->spec;
4160
4161 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4162 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4163 }
4164
alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)4165 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4166 const struct hda_fixup *fix,
4167 int action)
4168 {
4169 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4170 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4171
4172 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4173 snd_hda_codec_set_pincfg(codec, 0x19,
4174 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4175 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4176 }
4177
alc269_fixup_hweq(struct hda_codec * codec,const struct hda_fixup * fix,int action)4178 static void alc269_fixup_hweq(struct hda_codec *codec,
4179 const struct hda_fixup *fix, int action)
4180 {
4181 if (action == HDA_FIXUP_ACT_INIT)
4182 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4183 }
4184
alc269_fixup_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)4185 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4186 const struct hda_fixup *fix, int action)
4187 {
4188 struct alc_spec *spec = codec->spec;
4189
4190 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4191 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4192 }
4193
alc271_fixup_dmic(struct hda_codec * codec,const struct hda_fixup * fix,int action)4194 static void alc271_fixup_dmic(struct hda_codec *codec,
4195 const struct hda_fixup *fix, int action)
4196 {
4197 static const struct hda_verb verbs[] = {
4198 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4199 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4200 {}
4201 };
4202 unsigned int cfg;
4203
4204 if (strcmp(codec->core.chip_name, "ALC271X") &&
4205 strcmp(codec->core.chip_name, "ALC269VB"))
4206 return;
4207 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4208 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4209 snd_hda_sequence_write(codec, verbs);
4210 }
4211
4212 /* Fix the speaker amp after resume, etc */
alc269vb_fixup_aspire_e1_coef(struct hda_codec * codec,const struct hda_fixup * fix,int action)4213 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4214 const struct hda_fixup *fix,
4215 int action)
4216 {
4217 if (action == HDA_FIXUP_ACT_INIT)
4218 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4219 }
4220
alc269_fixup_pcm_44k(struct hda_codec * codec,const struct hda_fixup * fix,int action)4221 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4222 const struct hda_fixup *fix, int action)
4223 {
4224 struct alc_spec *spec = codec->spec;
4225
4226 if (action != HDA_FIXUP_ACT_PROBE)
4227 return;
4228
4229 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4230 * fix the sample rate of analog I/O to 44.1kHz
4231 */
4232 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4233 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4234 }
4235
alc269_fixup_stereo_dmic(struct hda_codec * codec,const struct hda_fixup * fix,int action)4236 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4237 const struct hda_fixup *fix, int action)
4238 {
4239 /* The digital-mic unit sends PDM (differential signal) instead of
4240 * the standard PCM, thus you can't record a valid mono stream as is.
4241 * Below is a workaround specific to ALC269 to control the dmic
4242 * signal source as mono.
4243 */
4244 if (action == HDA_FIXUP_ACT_INIT)
4245 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4246 }
4247
alc269_quanta_automute(struct hda_codec * codec)4248 static void alc269_quanta_automute(struct hda_codec *codec)
4249 {
4250 snd_hda_gen_update_outputs(codec);
4251
4252 alc_write_coef_idx(codec, 0x0c, 0x680);
4253 alc_write_coef_idx(codec, 0x0c, 0x480);
4254 }
4255
alc269_fixup_quanta_mute(struct hda_codec * codec,const struct hda_fixup * fix,int action)4256 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4257 const struct hda_fixup *fix, int action)
4258 {
4259 struct alc_spec *spec = codec->spec;
4260 if (action != HDA_FIXUP_ACT_PROBE)
4261 return;
4262 spec->gen.automute_hook = alc269_quanta_automute;
4263 }
4264
alc269_x101_hp_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)4265 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4266 struct hda_jack_callback *jack)
4267 {
4268 struct alc_spec *spec = codec->spec;
4269 int vref;
4270 msleep(200);
4271 snd_hda_gen_hp_automute(codec, jack);
4272
4273 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4274 msleep(100);
4275 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4276 vref);
4277 msleep(500);
4278 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4279 vref);
4280 }
4281
4282 /*
4283 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4284 */
4285 struct hda_alc298_mbxinit {
4286 unsigned char value_0x23;
4287 unsigned char value_0x25;
4288 };
4289
alc298_huawei_mbx_stereo_seq(struct hda_codec * codec,const struct hda_alc298_mbxinit * initval,bool first)4290 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4291 const struct hda_alc298_mbxinit *initval,
4292 bool first)
4293 {
4294 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4295 alc_write_coef_idx(codec, 0x26, 0xb000);
4296
4297 if (first)
4298 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4299
4300 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4301 alc_write_coef_idx(codec, 0x26, 0xf000);
4302 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4303
4304 if (initval->value_0x23 != 0x1e)
4305 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4306
4307 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4308 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4309 }
4310
alc298_fixup_huawei_mbx_stereo(struct hda_codec * codec,const struct hda_fixup * fix,int action)4311 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4312 const struct hda_fixup *fix,
4313 int action)
4314 {
4315 /* Initialization magic */
4316 static const struct hda_alc298_mbxinit dac_init[] = {
4317 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4318 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4319 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4320 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4321 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4322 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4323 {0x2f, 0x00},
4324 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4325 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4326 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4327 {}
4328 };
4329 const struct hda_alc298_mbxinit *seq;
4330
4331 if (action != HDA_FIXUP_ACT_INIT)
4332 return;
4333
4334 /* Start */
4335 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4336 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4337 alc_write_coef_idx(codec, 0x26, 0xf000);
4338 alc_write_coef_idx(codec, 0x22, 0x31);
4339 alc_write_coef_idx(codec, 0x23, 0x0b);
4340 alc_write_coef_idx(codec, 0x25, 0x00);
4341 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4342 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4343
4344 for (seq = dac_init; seq->value_0x23; seq++)
4345 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4346 }
4347
alc269_fixup_x101_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)4348 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4349 const struct hda_fixup *fix, int action)
4350 {
4351 struct alc_spec *spec = codec->spec;
4352 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4353 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4354 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4355 }
4356 }
4357
alc_update_vref_led(struct hda_codec * codec,hda_nid_t pin,bool polarity,bool on)4358 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4359 bool polarity, bool on)
4360 {
4361 unsigned int pinval;
4362
4363 if (!pin)
4364 return;
4365 if (polarity)
4366 on = !on;
4367 pinval = snd_hda_codec_get_pin_target(codec, pin);
4368 pinval &= ~AC_PINCTL_VREFEN;
4369 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4370 /* temporarily power up/down for setting VREF */
4371 snd_hda_power_up_pm(codec);
4372 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4373 snd_hda_power_down_pm(codec);
4374 }
4375
4376 /* update mute-LED according to the speaker mute state via mic VREF pin */
vref_mute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4377 static int vref_mute_led_set(struct led_classdev *led_cdev,
4378 enum led_brightness brightness)
4379 {
4380 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4381 struct alc_spec *spec = codec->spec;
4382
4383 alc_update_vref_led(codec, spec->mute_led_nid,
4384 spec->mute_led_polarity, brightness);
4385 return 0;
4386 }
4387
4388 /* Make sure the led works even in runtime suspend */
led_power_filter(struct hda_codec * codec,hda_nid_t nid,unsigned int power_state)4389 static unsigned int led_power_filter(struct hda_codec *codec,
4390 hda_nid_t nid,
4391 unsigned int power_state)
4392 {
4393 struct alc_spec *spec = codec->spec;
4394
4395 if (power_state != AC_PWRST_D3 || nid == 0 ||
4396 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4397 return power_state;
4398
4399 /* Set pin ctl again, it might have just been set to 0 */
4400 snd_hda_set_pin_ctl(codec, nid,
4401 snd_hda_codec_get_pin_target(codec, nid));
4402
4403 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4404 }
4405
alc269_fixup_hp_mute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4406 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4407 const struct hda_fixup *fix, int action)
4408 {
4409 struct alc_spec *spec = codec->spec;
4410 const struct dmi_device *dev = NULL;
4411
4412 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4413 return;
4414
4415 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4416 int pol, pin;
4417 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4418 continue;
4419 if (pin < 0x0a || pin >= 0x10)
4420 break;
4421 spec->mute_led_polarity = pol;
4422 spec->mute_led_nid = pin - 0x0a + 0x18;
4423 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4424 codec->power_filter = led_power_filter;
4425 codec_dbg(codec,
4426 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4427 spec->mute_led_polarity);
4428 break;
4429 }
4430 }
4431
alc269_fixup_hp_mute_led_micx(struct hda_codec * codec,const struct hda_fixup * fix,int action,hda_nid_t pin)4432 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4433 const struct hda_fixup *fix,
4434 int action, hda_nid_t pin)
4435 {
4436 struct alc_spec *spec = codec->spec;
4437
4438 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4439 spec->mute_led_polarity = 0;
4440 spec->mute_led_nid = pin;
4441 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4442 codec->power_filter = led_power_filter;
4443 }
4444 }
4445
alc269_fixup_hp_mute_led_mic1(struct hda_codec * codec,const struct hda_fixup * fix,int action)4446 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4447 const struct hda_fixup *fix, int action)
4448 {
4449 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4450 }
4451
alc269_fixup_hp_mute_led_mic2(struct hda_codec * codec,const struct hda_fixup * fix,int action)4452 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4453 const struct hda_fixup *fix, int action)
4454 {
4455 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4456 }
4457
alc269_fixup_hp_mute_led_mic3(struct hda_codec * codec,const struct hda_fixup * fix,int action)4458 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4459 const struct hda_fixup *fix, int action)
4460 {
4461 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4462 }
4463
4464 /* update LED status via GPIO */
alc_update_gpio_led(struct hda_codec * codec,unsigned int mask,int polarity,bool enabled)4465 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4466 int polarity, bool enabled)
4467 {
4468 if (polarity)
4469 enabled = !enabled;
4470 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4471 }
4472
4473 /* turn on/off mute LED via GPIO per vmaster hook */
gpio_mute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4474 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4475 enum led_brightness brightness)
4476 {
4477 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4478 struct alc_spec *spec = codec->spec;
4479
4480 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4481 spec->mute_led_polarity, !brightness);
4482 return 0;
4483 }
4484
4485 /* turn on/off mic-mute LED via GPIO per capture hook */
micmute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4486 static int micmute_led_set(struct led_classdev *led_cdev,
4487 enum led_brightness brightness)
4488 {
4489 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4490 struct alc_spec *spec = codec->spec;
4491
4492 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4493 spec->micmute_led_polarity, !brightness);
4494 return 0;
4495 }
4496
4497 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
alc_fixup_hp_gpio_led(struct hda_codec * codec,int action,unsigned int mute_mask,unsigned int micmute_mask)4498 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4499 int action,
4500 unsigned int mute_mask,
4501 unsigned int micmute_mask)
4502 {
4503 struct alc_spec *spec = codec->spec;
4504
4505 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4506
4507 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4508 return;
4509 if (mute_mask) {
4510 spec->gpio_mute_led_mask = mute_mask;
4511 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4512 }
4513 if (micmute_mask) {
4514 spec->gpio_mic_led_mask = micmute_mask;
4515 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4516 }
4517 }
4518
alc236_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4519 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4520 const struct hda_fixup *fix, int action)
4521 {
4522 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4523 }
4524
alc269_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4525 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4526 const struct hda_fixup *fix, int action)
4527 {
4528 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4529 }
4530
alc285_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4531 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4532 const struct hda_fixup *fix, int action)
4533 {
4534 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4535 }
4536
alc286_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4537 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4538 const struct hda_fixup *fix, int action)
4539 {
4540 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4541 }
4542
alc287_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4543 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4544 const struct hda_fixup *fix, int action)
4545 {
4546 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4547 }
4548
alc245_fixup_hp_gpio_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4549 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4550 const struct hda_fixup *fix, int action)
4551 {
4552 struct alc_spec *spec = codec->spec;
4553
4554 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4555 spec->micmute_led_polarity = 1;
4556 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4557 }
4558
4559 /* turn on/off mic-mute LED per capture hook via VREF change */
vref_micmute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4560 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4561 enum led_brightness brightness)
4562 {
4563 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4564 struct alc_spec *spec = codec->spec;
4565
4566 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4567 spec->micmute_led_polarity, brightness);
4568 return 0;
4569 }
4570
alc269_fixup_hp_gpio_mic1_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4571 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4572 const struct hda_fixup *fix, int action)
4573 {
4574 struct alc_spec *spec = codec->spec;
4575
4576 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4577 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4578 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4579 * enable headphone amp
4580 */
4581 spec->gpio_mask |= 0x10;
4582 spec->gpio_dir |= 0x10;
4583 spec->cap_mute_led_nid = 0x18;
4584 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4585 codec->power_filter = led_power_filter;
4586 }
4587 }
4588
alc280_fixup_hp_gpio4(struct hda_codec * codec,const struct hda_fixup * fix,int action)4589 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4590 const struct hda_fixup *fix, int action)
4591 {
4592 struct alc_spec *spec = codec->spec;
4593
4594 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4595 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4596 spec->cap_mute_led_nid = 0x18;
4597 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4598 codec->power_filter = led_power_filter;
4599 }
4600 }
4601
4602 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4603 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4604 */
alc245_fixup_hp_x360_amp(struct hda_codec * codec,const struct hda_fixup * fix,int action)4605 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4606 const struct hda_fixup *fix, int action)
4607 {
4608 struct alc_spec *spec = codec->spec;
4609
4610 switch (action) {
4611 case HDA_FIXUP_ACT_PRE_PROBE:
4612 spec->gpio_mask |= 0x01;
4613 spec->gpio_dir |= 0x01;
4614 break;
4615 case HDA_FIXUP_ACT_INIT:
4616 /* need to toggle GPIO to enable the amp */
4617 alc_update_gpio_data(codec, 0x01, true);
4618 msleep(100);
4619 alc_update_gpio_data(codec, 0x01, false);
4620 break;
4621 }
4622 }
4623
4624 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
alc274_hp_envy_pcm_hook(struct hda_pcm_stream * hinfo,struct hda_codec * codec,struct snd_pcm_substream * substream,int action)4625 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4626 struct hda_codec *codec,
4627 struct snd_pcm_substream *substream,
4628 int action)
4629 {
4630 switch (action) {
4631 case HDA_GEN_PCM_ACT_PREPARE:
4632 alc_update_gpio_data(codec, 0x04, true);
4633 break;
4634 case HDA_GEN_PCM_ACT_CLEANUP:
4635 alc_update_gpio_data(codec, 0x04, false);
4636 break;
4637 }
4638 }
4639
alc274_fixup_hp_envy_gpio(struct hda_codec * codec,const struct hda_fixup * fix,int action)4640 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4641 const struct hda_fixup *fix,
4642 int action)
4643 {
4644 struct alc_spec *spec = codec->spec;
4645
4646 if (action == HDA_FIXUP_ACT_PROBE) {
4647 spec->gpio_mask |= 0x04;
4648 spec->gpio_dir |= 0x04;
4649 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4650 }
4651 }
4652
alc_update_coef_led(struct hda_codec * codec,struct alc_coef_led * led,bool polarity,bool on)4653 static void alc_update_coef_led(struct hda_codec *codec,
4654 struct alc_coef_led *led,
4655 bool polarity, bool on)
4656 {
4657 if (polarity)
4658 on = !on;
4659 /* temporarily power up/down for setting COEF bit */
4660 alc_update_coef_idx(codec, led->idx, led->mask,
4661 on ? led->on : led->off);
4662 }
4663
4664 /* update mute-LED according to the speaker mute state via COEF bit */
coef_mute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4665 static int coef_mute_led_set(struct led_classdev *led_cdev,
4666 enum led_brightness brightness)
4667 {
4668 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4669 struct alc_spec *spec = codec->spec;
4670
4671 alc_update_coef_led(codec, &spec->mute_led_coef,
4672 spec->mute_led_polarity, brightness);
4673 return 0;
4674 }
4675
alc285_fixup_hp_mute_led_coefbit(struct hda_codec * codec,const struct hda_fixup * fix,int action)4676 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4677 const struct hda_fixup *fix,
4678 int action)
4679 {
4680 struct alc_spec *spec = codec->spec;
4681
4682 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4683 spec->mute_led_polarity = 0;
4684 spec->mute_led_coef.idx = 0x0b;
4685 spec->mute_led_coef.mask = 1 << 3;
4686 spec->mute_led_coef.on = 1 << 3;
4687 spec->mute_led_coef.off = 0;
4688 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4689 }
4690 }
4691
alc236_fixup_hp_mute_led_coefbit(struct hda_codec * codec,const struct hda_fixup * fix,int action)4692 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4693 const struct hda_fixup *fix,
4694 int action)
4695 {
4696 struct alc_spec *spec = codec->spec;
4697
4698 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4699 spec->mute_led_polarity = 0;
4700 spec->mute_led_coef.idx = 0x34;
4701 spec->mute_led_coef.mask = 1 << 5;
4702 spec->mute_led_coef.on = 0;
4703 spec->mute_led_coef.off = 1 << 5;
4704 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4705 }
4706 }
4707
alc236_fixup_hp_mute_led_coefbit2(struct hda_codec * codec,const struct hda_fixup * fix,int action)4708 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4709 const struct hda_fixup *fix, int action)
4710 {
4711 struct alc_spec *spec = codec->spec;
4712
4713 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4714 spec->mute_led_polarity = 0;
4715 spec->mute_led_coef.idx = 0x07;
4716 spec->mute_led_coef.mask = 1;
4717 spec->mute_led_coef.on = 1;
4718 spec->mute_led_coef.off = 0;
4719 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4720 }
4721 }
4722
alc245_fixup_hp_mute_led_coefbit(struct hda_codec * codec,const struct hda_fixup * fix,int action)4723 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4724 const struct hda_fixup *fix,
4725 int action)
4726 {
4727 struct alc_spec *spec = codec->spec;
4728
4729 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4730 spec->mute_led_polarity = 0;
4731 spec->mute_led_coef.idx = 0x0b;
4732 spec->mute_led_coef.mask = 3 << 2;
4733 spec->mute_led_coef.on = 2 << 2;
4734 spec->mute_led_coef.off = 1 << 2;
4735 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4736 }
4737 }
4738
4739 /* turn on/off mic-mute LED per capture hook by coef bit */
coef_micmute_led_set(struct led_classdev * led_cdev,enum led_brightness brightness)4740 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4741 enum led_brightness brightness)
4742 {
4743 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4744 struct alc_spec *spec = codec->spec;
4745
4746 alc_update_coef_led(codec, &spec->mic_led_coef,
4747 spec->micmute_led_polarity, brightness);
4748 return 0;
4749 }
4750
alc285_fixup_hp_coef_micmute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4751 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4752 const struct hda_fixup *fix, int action)
4753 {
4754 struct alc_spec *spec = codec->spec;
4755
4756 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4757 spec->mic_led_coef.idx = 0x19;
4758 spec->mic_led_coef.mask = 1 << 13;
4759 spec->mic_led_coef.on = 1 << 13;
4760 spec->mic_led_coef.off = 0;
4761 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4762 }
4763 }
4764
alc285_fixup_hp_gpio_micmute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4765 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4766 const struct hda_fixup *fix, int action)
4767 {
4768 struct alc_spec *spec = codec->spec;
4769
4770 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4771 spec->micmute_led_polarity = 1;
4772 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4773 }
4774
alc236_fixup_hp_coef_micmute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4775 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4776 const struct hda_fixup *fix, int action)
4777 {
4778 struct alc_spec *spec = codec->spec;
4779
4780 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4781 spec->mic_led_coef.idx = 0x35;
4782 spec->mic_led_coef.mask = 3 << 2;
4783 spec->mic_led_coef.on = 2 << 2;
4784 spec->mic_led_coef.off = 1 << 2;
4785 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4786 }
4787 }
4788
alc295_fixup_hp_mute_led_coefbit11(struct hda_codec * codec,const struct hda_fixup * fix,int action)4789 static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec,
4790 const struct hda_fixup *fix, int action)
4791 {
4792 struct alc_spec *spec = codec->spec;
4793
4794 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4795 spec->mute_led_polarity = 0;
4796 spec->mute_led_coef.idx = 0xb;
4797 spec->mute_led_coef.mask = 3 << 3;
4798 spec->mute_led_coef.on = 1 << 3;
4799 spec->mute_led_coef.off = 1 << 4;
4800 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4801 }
4802 }
4803
alc285_fixup_hp_mute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4804 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4805 const struct hda_fixup *fix, int action)
4806 {
4807 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4808 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4809 }
4810
alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4811 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4812 const struct hda_fixup *fix, int action)
4813 {
4814 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4815 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4816 }
4817
alc236_fixup_hp_mute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4818 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4819 const struct hda_fixup *fix, int action)
4820 {
4821 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4822 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4823 }
4824
alc236_fixup_hp_micmute_led_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)4825 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4826 const struct hda_fixup *fix, int action)
4827 {
4828 struct alc_spec *spec = codec->spec;
4829
4830 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4831 spec->cap_mute_led_nid = 0x1a;
4832 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4833 codec->power_filter = led_power_filter;
4834 }
4835 }
4836
alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)4837 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4838 const struct hda_fixup *fix, int action)
4839 {
4840 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4841 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4842 }
4843
alc298_samsung_write_coef_pack(struct hda_codec * codec,const unsigned short coefs[2])4844 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4845 const unsigned short coefs[2])
4846 {
4847 alc_write_coef_idx(codec, 0x23, coefs[0]);
4848 alc_write_coef_idx(codec, 0x25, coefs[1]);
4849 alc_write_coef_idx(codec, 0x26, 0xb011);
4850 }
4851
4852 struct alc298_samsung_amp_desc {
4853 unsigned char nid;
4854 unsigned short init_seq[2][2];
4855 };
4856
alc298_fixup_samsung_amp(struct hda_codec * codec,const struct hda_fixup * fix,int action)4857 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4858 const struct hda_fixup *fix, int action)
4859 {
4860 int i, j;
4861 static const unsigned short init_seq[][2] = {
4862 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4863 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4864 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4865 { 0x41, 0x07 }, { 0x400, 0x1 }
4866 };
4867 static const struct alc298_samsung_amp_desc amps[] = {
4868 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4869 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4870 };
4871
4872 if (action != HDA_FIXUP_ACT_INIT)
4873 return;
4874
4875 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4876 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4877
4878 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4879 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4880
4881 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4882 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4883 }
4884 }
4885
gpio2_mic_hotkey_event(struct hda_codec * codec,struct hda_jack_callback * event)4886 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4887 struct hda_jack_callback *event)
4888 {
4889 struct alc_spec *spec = codec->spec;
4890
4891 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4892 send both key on and key off event for every interrupt. */
4893 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4894 input_sync(spec->kb_dev);
4895 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4896 input_sync(spec->kb_dev);
4897 }
4898
alc_register_micmute_input_device(struct hda_codec * codec)4899 static int alc_register_micmute_input_device(struct hda_codec *codec)
4900 {
4901 struct alc_spec *spec = codec->spec;
4902 int i;
4903
4904 spec->kb_dev = input_allocate_device();
4905 if (!spec->kb_dev) {
4906 codec_err(codec, "Out of memory (input_allocate_device)\n");
4907 return -ENOMEM;
4908 }
4909
4910 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4911
4912 spec->kb_dev->name = "Microphone Mute Button";
4913 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4914 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4915 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4916 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4917 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4918 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4919
4920 if (input_register_device(spec->kb_dev)) {
4921 codec_err(codec, "input_register_device failed\n");
4922 input_free_device(spec->kb_dev);
4923 spec->kb_dev = NULL;
4924 return -ENOMEM;
4925 }
4926
4927 return 0;
4928 }
4929
4930 /* GPIO1 = set according to SKU external amp
4931 * GPIO2 = mic mute hotkey
4932 * GPIO3 = mute LED
4933 * GPIO4 = mic mute LED
4934 */
alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec * codec,const struct hda_fixup * fix,int action)4935 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4936 const struct hda_fixup *fix, int action)
4937 {
4938 struct alc_spec *spec = codec->spec;
4939
4940 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4941 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4942 spec->init_amp = ALC_INIT_DEFAULT;
4943 if (alc_register_micmute_input_device(codec) != 0)
4944 return;
4945
4946 spec->gpio_mask |= 0x06;
4947 spec->gpio_dir |= 0x02;
4948 spec->gpio_data |= 0x02;
4949 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4950 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4951 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4952 gpio2_mic_hotkey_event);
4953 return;
4954 }
4955
4956 if (!spec->kb_dev)
4957 return;
4958
4959 switch (action) {
4960 case HDA_FIXUP_ACT_FREE:
4961 input_unregister_device(spec->kb_dev);
4962 spec->kb_dev = NULL;
4963 }
4964 }
4965
4966 /* Line2 = mic mute hotkey
4967 * GPIO2 = mic mute LED
4968 */
alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec * codec,const struct hda_fixup * fix,int action)4969 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4970 const struct hda_fixup *fix, int action)
4971 {
4972 struct alc_spec *spec = codec->spec;
4973
4974 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4975 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4976 spec->init_amp = ALC_INIT_DEFAULT;
4977 if (alc_register_micmute_input_device(codec) != 0)
4978 return;
4979
4980 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4981 gpio2_mic_hotkey_event);
4982 return;
4983 }
4984
4985 if (!spec->kb_dev)
4986 return;
4987
4988 switch (action) {
4989 case HDA_FIXUP_ACT_FREE:
4990 input_unregister_device(spec->kb_dev);
4991 spec->kb_dev = NULL;
4992 }
4993 }
4994
alc269_fixup_hp_line1_mic1_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)4995 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4996 const struct hda_fixup *fix, int action)
4997 {
4998 struct alc_spec *spec = codec->spec;
4999
5000 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
5001 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5002 spec->cap_mute_led_nid = 0x18;
5003 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
5004 }
5005 }
5006
alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec * codec,const struct hda_fixup * fix,int action)5007 static void alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec *codec,
5008 const struct hda_fixup *fix, int action)
5009 {
5010 struct alc_spec *spec = codec->spec;
5011
5012 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5013 spec->micmute_led_polarity = 1;
5014 alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action);
5015 }
5016
alc_hp_mute_disable(struct hda_codec * codec,unsigned int delay)5017 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
5018 {
5019 if (delay <= 0)
5020 delay = 75;
5021 snd_hda_codec_write(codec, 0x21, 0,
5022 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5023 msleep(delay);
5024 snd_hda_codec_write(codec, 0x21, 0,
5025 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5026 msleep(delay);
5027 }
5028
alc_hp_enable_unmute(struct hda_codec * codec,unsigned int delay)5029 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
5030 {
5031 if (delay <= 0)
5032 delay = 75;
5033 snd_hda_codec_write(codec, 0x21, 0,
5034 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5035 msleep(delay);
5036 snd_hda_codec_write(codec, 0x21, 0,
5037 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5038 msleep(delay);
5039 }
5040
5041 static const struct coef_fw alc225_pre_hsmode[] = {
5042 UPDATE_COEF(0x4a, 1<<8, 0),
5043 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
5044 UPDATE_COEF(0x63, 3<<14, 3<<14),
5045 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5046 UPDATE_COEF(0x4a, 3<<10, 3<<10),
5047 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
5048 UPDATE_COEF(0x4a, 3<<10, 0),
5049 {}
5050 };
5051
alc_headset_mode_unplugged(struct hda_codec * codec)5052 static void alc_headset_mode_unplugged(struct hda_codec *codec)
5053 {
5054 struct alc_spec *spec = codec->spec;
5055 static const struct coef_fw coef0255[] = {
5056 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
5057 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5058 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5059 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5060 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
5061 {}
5062 };
5063 static const struct coef_fw coef0256[] = {
5064 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
5065 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5066 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5067 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
5068 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5069 {}
5070 };
5071 static const struct coef_fw coef0233[] = {
5072 WRITE_COEF(0x1b, 0x0c0b),
5073 WRITE_COEF(0x45, 0xc429),
5074 UPDATE_COEF(0x35, 0x4000, 0),
5075 WRITE_COEF(0x06, 0x2104),
5076 WRITE_COEF(0x1a, 0x0001),
5077 WRITE_COEF(0x26, 0x0004),
5078 WRITE_COEF(0x32, 0x42a3),
5079 {}
5080 };
5081 static const struct coef_fw coef0288[] = {
5082 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5083 UPDATE_COEF(0x50, 0x2000, 0x2000),
5084 UPDATE_COEF(0x56, 0x0006, 0x0006),
5085 UPDATE_COEF(0x66, 0x0008, 0),
5086 UPDATE_COEF(0x67, 0x2000, 0),
5087 {}
5088 };
5089 static const struct coef_fw coef0298[] = {
5090 UPDATE_COEF(0x19, 0x1300, 0x0300),
5091 {}
5092 };
5093 static const struct coef_fw coef0292[] = {
5094 WRITE_COEF(0x76, 0x000e),
5095 WRITE_COEF(0x6c, 0x2400),
5096 WRITE_COEF(0x18, 0x7308),
5097 WRITE_COEF(0x6b, 0xc429),
5098 {}
5099 };
5100 static const struct coef_fw coef0293[] = {
5101 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
5102 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
5103 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
5104 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
5105 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5106 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5107 {}
5108 };
5109 static const struct coef_fw coef0668[] = {
5110 WRITE_COEF(0x15, 0x0d40),
5111 WRITE_COEF(0xb7, 0x802b),
5112 {}
5113 };
5114 static const struct coef_fw coef0225[] = {
5115 UPDATE_COEF(0x63, 3<<14, 0),
5116 {}
5117 };
5118 static const struct coef_fw coef0274[] = {
5119 UPDATE_COEF(0x4a, 0x0100, 0),
5120 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5121 UPDATE_COEF(0x6b, 0xf000, 0x5000),
5122 UPDATE_COEF(0x4a, 0x0010, 0),
5123 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5124 WRITE_COEF(0x45, 0x5289),
5125 UPDATE_COEF(0x4a, 0x0c00, 0),
5126 {}
5127 };
5128
5129 if (spec->no_internal_mic_pin) {
5130 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5131 return;
5132 }
5133
5134 switch (codec->core.vendor_id) {
5135 case 0x10ec0255:
5136 alc_process_coef_fw(codec, coef0255);
5137 break;
5138 case 0x10ec0230:
5139 case 0x10ec0236:
5140 case 0x10ec0256:
5141 case 0x19e58326:
5142 alc_hp_mute_disable(codec, 75);
5143 alc_process_coef_fw(codec, coef0256);
5144 break;
5145 case 0x10ec0234:
5146 case 0x10ec0274:
5147 case 0x10ec0294:
5148 alc_process_coef_fw(codec, coef0274);
5149 break;
5150 case 0x10ec0233:
5151 case 0x10ec0283:
5152 alc_process_coef_fw(codec, coef0233);
5153 break;
5154 case 0x10ec0286:
5155 case 0x10ec0288:
5156 alc_process_coef_fw(codec, coef0288);
5157 break;
5158 case 0x10ec0298:
5159 alc_process_coef_fw(codec, coef0298);
5160 alc_process_coef_fw(codec, coef0288);
5161 break;
5162 case 0x10ec0292:
5163 alc_process_coef_fw(codec, coef0292);
5164 break;
5165 case 0x10ec0293:
5166 alc_process_coef_fw(codec, coef0293);
5167 break;
5168 case 0x10ec0668:
5169 alc_process_coef_fw(codec, coef0668);
5170 break;
5171 case 0x10ec0215:
5172 case 0x10ec0225:
5173 case 0x10ec0285:
5174 case 0x10ec0295:
5175 case 0x10ec0289:
5176 case 0x10ec0299:
5177 alc_hp_mute_disable(codec, 75);
5178 alc_process_coef_fw(codec, alc225_pre_hsmode);
5179 alc_process_coef_fw(codec, coef0225);
5180 break;
5181 case 0x10ec0867:
5182 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5183 break;
5184 }
5185 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5186 }
5187
5188
alc_headset_mode_mic_in(struct hda_codec * codec,hda_nid_t hp_pin,hda_nid_t mic_pin)5189 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5190 hda_nid_t mic_pin)
5191 {
5192 static const struct coef_fw coef0255[] = {
5193 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5194 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5195 {}
5196 };
5197 static const struct coef_fw coef0256[] = {
5198 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5199 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5200 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5201 {}
5202 };
5203 static const struct coef_fw coef0233[] = {
5204 UPDATE_COEF(0x35, 0, 1<<14),
5205 WRITE_COEF(0x06, 0x2100),
5206 WRITE_COEF(0x1a, 0x0021),
5207 WRITE_COEF(0x26, 0x008c),
5208 {}
5209 };
5210 static const struct coef_fw coef0288[] = {
5211 UPDATE_COEF(0x4f, 0x00c0, 0),
5212 UPDATE_COEF(0x50, 0x2000, 0),
5213 UPDATE_COEF(0x56, 0x0006, 0),
5214 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5215 UPDATE_COEF(0x66, 0x0008, 0x0008),
5216 UPDATE_COEF(0x67, 0x2000, 0x2000),
5217 {}
5218 };
5219 static const struct coef_fw coef0292[] = {
5220 WRITE_COEF(0x19, 0xa208),
5221 WRITE_COEF(0x2e, 0xacf0),
5222 {}
5223 };
5224 static const struct coef_fw coef0293[] = {
5225 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5226 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5227 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5228 {}
5229 };
5230 static const struct coef_fw coef0688[] = {
5231 WRITE_COEF(0xb7, 0x802b),
5232 WRITE_COEF(0xb5, 0x1040),
5233 UPDATE_COEF(0xc3, 0, 1<<12),
5234 {}
5235 };
5236 static const struct coef_fw coef0225[] = {
5237 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5238 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5239 UPDATE_COEF(0x63, 3<<14, 0),
5240 {}
5241 };
5242 static const struct coef_fw coef0274[] = {
5243 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5244 UPDATE_COEF(0x4a, 0x0010, 0),
5245 UPDATE_COEF(0x6b, 0xf000, 0),
5246 {}
5247 };
5248
5249 switch (codec->core.vendor_id) {
5250 case 0x10ec0255:
5251 alc_write_coef_idx(codec, 0x45, 0xc489);
5252 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5253 alc_process_coef_fw(codec, coef0255);
5254 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5255 break;
5256 case 0x10ec0230:
5257 case 0x10ec0236:
5258 case 0x10ec0256:
5259 case 0x19e58326:
5260 alc_write_coef_idx(codec, 0x45, 0xc489);
5261 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5262 alc_process_coef_fw(codec, coef0256);
5263 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5264 break;
5265 case 0x10ec0234:
5266 case 0x10ec0274:
5267 case 0x10ec0294:
5268 alc_write_coef_idx(codec, 0x45, 0x4689);
5269 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5270 alc_process_coef_fw(codec, coef0274);
5271 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5272 break;
5273 case 0x10ec0233:
5274 case 0x10ec0283:
5275 alc_write_coef_idx(codec, 0x45, 0xc429);
5276 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5277 alc_process_coef_fw(codec, coef0233);
5278 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5279 break;
5280 case 0x10ec0286:
5281 case 0x10ec0288:
5282 case 0x10ec0298:
5283 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5284 alc_process_coef_fw(codec, coef0288);
5285 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5286 break;
5287 case 0x10ec0292:
5288 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5289 alc_process_coef_fw(codec, coef0292);
5290 break;
5291 case 0x10ec0293:
5292 /* Set to TRS mode */
5293 alc_write_coef_idx(codec, 0x45, 0xc429);
5294 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5295 alc_process_coef_fw(codec, coef0293);
5296 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5297 break;
5298 case 0x10ec0867:
5299 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5300 fallthrough;
5301 case 0x10ec0221:
5302 case 0x10ec0662:
5303 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5304 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5305 break;
5306 case 0x10ec0668:
5307 alc_write_coef_idx(codec, 0x11, 0x0001);
5308 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5309 alc_process_coef_fw(codec, coef0688);
5310 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5311 break;
5312 case 0x10ec0215:
5313 case 0x10ec0225:
5314 case 0x10ec0285:
5315 case 0x10ec0295:
5316 case 0x10ec0289:
5317 case 0x10ec0299:
5318 alc_process_coef_fw(codec, alc225_pre_hsmode);
5319 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5320 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5321 alc_process_coef_fw(codec, coef0225);
5322 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5323 break;
5324 }
5325 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5326 }
5327
alc_headset_mode_default(struct hda_codec * codec)5328 static void alc_headset_mode_default(struct hda_codec *codec)
5329 {
5330 static const struct coef_fw coef0225[] = {
5331 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5332 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5333 UPDATE_COEF(0x49, 3<<8, 0<<8),
5334 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5335 UPDATE_COEF(0x63, 3<<14, 0),
5336 UPDATE_COEF(0x67, 0xf000, 0x3000),
5337 {}
5338 };
5339 static const struct coef_fw coef0255[] = {
5340 WRITE_COEF(0x45, 0xc089),
5341 WRITE_COEF(0x45, 0xc489),
5342 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5343 WRITE_COEF(0x49, 0x0049),
5344 {}
5345 };
5346 static const struct coef_fw coef0256[] = {
5347 WRITE_COEF(0x45, 0xc489),
5348 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5349 WRITE_COEF(0x49, 0x0049),
5350 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5351 WRITE_COEF(0x06, 0x6100),
5352 {}
5353 };
5354 static const struct coef_fw coef0233[] = {
5355 WRITE_COEF(0x06, 0x2100),
5356 WRITE_COEF(0x32, 0x4ea3),
5357 {}
5358 };
5359 static const struct coef_fw coef0288[] = {
5360 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5361 UPDATE_COEF(0x50, 0x2000, 0x2000),
5362 UPDATE_COEF(0x56, 0x0006, 0x0006),
5363 UPDATE_COEF(0x66, 0x0008, 0),
5364 UPDATE_COEF(0x67, 0x2000, 0),
5365 {}
5366 };
5367 static const struct coef_fw coef0292[] = {
5368 WRITE_COEF(0x76, 0x000e),
5369 WRITE_COEF(0x6c, 0x2400),
5370 WRITE_COEF(0x6b, 0xc429),
5371 WRITE_COEF(0x18, 0x7308),
5372 {}
5373 };
5374 static const struct coef_fw coef0293[] = {
5375 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5376 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5377 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5378 {}
5379 };
5380 static const struct coef_fw coef0688[] = {
5381 WRITE_COEF(0x11, 0x0041),
5382 WRITE_COEF(0x15, 0x0d40),
5383 WRITE_COEF(0xb7, 0x802b),
5384 {}
5385 };
5386 static const struct coef_fw coef0274[] = {
5387 WRITE_COEF(0x45, 0x4289),
5388 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5389 UPDATE_COEF(0x6b, 0x0f00, 0),
5390 UPDATE_COEF(0x49, 0x0300, 0x0300),
5391 {}
5392 };
5393
5394 switch (codec->core.vendor_id) {
5395 case 0x10ec0215:
5396 case 0x10ec0225:
5397 case 0x10ec0285:
5398 case 0x10ec0295:
5399 case 0x10ec0289:
5400 case 0x10ec0299:
5401 alc_process_coef_fw(codec, alc225_pre_hsmode);
5402 alc_process_coef_fw(codec, coef0225);
5403 alc_hp_enable_unmute(codec, 75);
5404 break;
5405 case 0x10ec0255:
5406 alc_process_coef_fw(codec, coef0255);
5407 break;
5408 case 0x10ec0230:
5409 case 0x10ec0236:
5410 case 0x10ec0256:
5411 case 0x19e58326:
5412 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5413 alc_write_coef_idx(codec, 0x45, 0xc089);
5414 msleep(50);
5415 alc_process_coef_fw(codec, coef0256);
5416 alc_hp_enable_unmute(codec, 75);
5417 break;
5418 case 0x10ec0234:
5419 case 0x10ec0274:
5420 case 0x10ec0294:
5421 alc_process_coef_fw(codec, coef0274);
5422 break;
5423 case 0x10ec0233:
5424 case 0x10ec0283:
5425 alc_process_coef_fw(codec, coef0233);
5426 break;
5427 case 0x10ec0286:
5428 case 0x10ec0288:
5429 case 0x10ec0298:
5430 alc_process_coef_fw(codec, coef0288);
5431 break;
5432 case 0x10ec0292:
5433 alc_process_coef_fw(codec, coef0292);
5434 break;
5435 case 0x10ec0293:
5436 alc_process_coef_fw(codec, coef0293);
5437 break;
5438 case 0x10ec0668:
5439 alc_process_coef_fw(codec, coef0688);
5440 break;
5441 case 0x10ec0867:
5442 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5443 break;
5444 }
5445 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5446 }
5447
5448 /* Iphone type */
alc_headset_mode_ctia(struct hda_codec * codec)5449 static void alc_headset_mode_ctia(struct hda_codec *codec)
5450 {
5451 int val;
5452
5453 static const struct coef_fw coef0255[] = {
5454 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5455 WRITE_COEF(0x1b, 0x0c2b),
5456 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5457 {}
5458 };
5459 static const struct coef_fw coef0256[] = {
5460 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5461 WRITE_COEF(0x1b, 0x0e6b),
5462 {}
5463 };
5464 static const struct coef_fw coef0233[] = {
5465 WRITE_COEF(0x45, 0xd429),
5466 WRITE_COEF(0x1b, 0x0c2b),
5467 WRITE_COEF(0x32, 0x4ea3),
5468 {}
5469 };
5470 static const struct coef_fw coef0288[] = {
5471 UPDATE_COEF(0x50, 0x2000, 0x2000),
5472 UPDATE_COEF(0x56, 0x0006, 0x0006),
5473 UPDATE_COEF(0x66, 0x0008, 0),
5474 UPDATE_COEF(0x67, 0x2000, 0),
5475 {}
5476 };
5477 static const struct coef_fw coef0292[] = {
5478 WRITE_COEF(0x6b, 0xd429),
5479 WRITE_COEF(0x76, 0x0008),
5480 WRITE_COEF(0x18, 0x7388),
5481 {}
5482 };
5483 static const struct coef_fw coef0293[] = {
5484 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5485 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5486 {}
5487 };
5488 static const struct coef_fw coef0688[] = {
5489 WRITE_COEF(0x11, 0x0001),
5490 WRITE_COEF(0x15, 0x0d60),
5491 WRITE_COEF(0xc3, 0x0000),
5492 {}
5493 };
5494 static const struct coef_fw coef0225_1[] = {
5495 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5496 UPDATE_COEF(0x63, 3<<14, 2<<14),
5497 {}
5498 };
5499 static const struct coef_fw coef0225_2[] = {
5500 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5501 UPDATE_COEF(0x63, 3<<14, 1<<14),
5502 {}
5503 };
5504
5505 switch (codec->core.vendor_id) {
5506 case 0x10ec0255:
5507 alc_process_coef_fw(codec, coef0255);
5508 break;
5509 case 0x10ec0230:
5510 case 0x10ec0236:
5511 case 0x10ec0256:
5512 case 0x19e58326:
5513 alc_process_coef_fw(codec, coef0256);
5514 alc_hp_enable_unmute(codec, 75);
5515 break;
5516 case 0x10ec0234:
5517 case 0x10ec0274:
5518 case 0x10ec0294:
5519 alc_write_coef_idx(codec, 0x45, 0xd689);
5520 break;
5521 case 0x10ec0233:
5522 case 0x10ec0283:
5523 alc_process_coef_fw(codec, coef0233);
5524 break;
5525 case 0x10ec0298:
5526 val = alc_read_coef_idx(codec, 0x50);
5527 if (val & (1 << 12)) {
5528 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5529 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5530 msleep(300);
5531 } else {
5532 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5533 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5534 msleep(300);
5535 }
5536 break;
5537 case 0x10ec0286:
5538 case 0x10ec0288:
5539 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5540 msleep(300);
5541 alc_process_coef_fw(codec, coef0288);
5542 break;
5543 case 0x10ec0292:
5544 alc_process_coef_fw(codec, coef0292);
5545 break;
5546 case 0x10ec0293:
5547 alc_process_coef_fw(codec, coef0293);
5548 break;
5549 case 0x10ec0668:
5550 alc_process_coef_fw(codec, coef0688);
5551 break;
5552 case 0x10ec0215:
5553 case 0x10ec0225:
5554 case 0x10ec0285:
5555 case 0x10ec0295:
5556 case 0x10ec0289:
5557 case 0x10ec0299:
5558 val = alc_read_coef_idx(codec, 0x45);
5559 if (val & (1 << 9))
5560 alc_process_coef_fw(codec, coef0225_2);
5561 else
5562 alc_process_coef_fw(codec, coef0225_1);
5563 alc_hp_enable_unmute(codec, 75);
5564 break;
5565 case 0x10ec0867:
5566 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5567 break;
5568 }
5569 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5570 }
5571
5572 /* Nokia type */
alc_headset_mode_omtp(struct hda_codec * codec)5573 static void alc_headset_mode_omtp(struct hda_codec *codec)
5574 {
5575 static const struct coef_fw coef0255[] = {
5576 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5577 WRITE_COEF(0x1b, 0x0c2b),
5578 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5579 {}
5580 };
5581 static const struct coef_fw coef0256[] = {
5582 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5583 WRITE_COEF(0x1b, 0x0e6b),
5584 {}
5585 };
5586 static const struct coef_fw coef0233[] = {
5587 WRITE_COEF(0x45, 0xe429),
5588 WRITE_COEF(0x1b, 0x0c2b),
5589 WRITE_COEF(0x32, 0x4ea3),
5590 {}
5591 };
5592 static const struct coef_fw coef0288[] = {
5593 UPDATE_COEF(0x50, 0x2000, 0x2000),
5594 UPDATE_COEF(0x56, 0x0006, 0x0006),
5595 UPDATE_COEF(0x66, 0x0008, 0),
5596 UPDATE_COEF(0x67, 0x2000, 0),
5597 {}
5598 };
5599 static const struct coef_fw coef0292[] = {
5600 WRITE_COEF(0x6b, 0xe429),
5601 WRITE_COEF(0x76, 0x0008),
5602 WRITE_COEF(0x18, 0x7388),
5603 {}
5604 };
5605 static const struct coef_fw coef0293[] = {
5606 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5607 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5608 {}
5609 };
5610 static const struct coef_fw coef0688[] = {
5611 WRITE_COEF(0x11, 0x0001),
5612 WRITE_COEF(0x15, 0x0d50),
5613 WRITE_COEF(0xc3, 0x0000),
5614 {}
5615 };
5616 static const struct coef_fw coef0225[] = {
5617 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5618 UPDATE_COEF(0x63, 3<<14, 2<<14),
5619 {}
5620 };
5621
5622 switch (codec->core.vendor_id) {
5623 case 0x10ec0255:
5624 alc_process_coef_fw(codec, coef0255);
5625 break;
5626 case 0x10ec0230:
5627 case 0x10ec0236:
5628 case 0x10ec0256:
5629 case 0x19e58326:
5630 alc_process_coef_fw(codec, coef0256);
5631 alc_hp_enable_unmute(codec, 75);
5632 break;
5633 case 0x10ec0234:
5634 case 0x10ec0274:
5635 case 0x10ec0294:
5636 alc_write_coef_idx(codec, 0x45, 0xe689);
5637 break;
5638 case 0x10ec0233:
5639 case 0x10ec0283:
5640 alc_process_coef_fw(codec, coef0233);
5641 break;
5642 case 0x10ec0298:
5643 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5644 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5645 msleep(300);
5646 break;
5647 case 0x10ec0286:
5648 case 0x10ec0288:
5649 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5650 msleep(300);
5651 alc_process_coef_fw(codec, coef0288);
5652 break;
5653 case 0x10ec0292:
5654 alc_process_coef_fw(codec, coef0292);
5655 break;
5656 case 0x10ec0293:
5657 alc_process_coef_fw(codec, coef0293);
5658 break;
5659 case 0x10ec0668:
5660 alc_process_coef_fw(codec, coef0688);
5661 break;
5662 case 0x10ec0215:
5663 case 0x10ec0225:
5664 case 0x10ec0285:
5665 case 0x10ec0295:
5666 case 0x10ec0289:
5667 case 0x10ec0299:
5668 alc_process_coef_fw(codec, coef0225);
5669 alc_hp_enable_unmute(codec, 75);
5670 break;
5671 }
5672 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5673 }
5674
alc_determine_headset_type(struct hda_codec * codec)5675 static void alc_determine_headset_type(struct hda_codec *codec)
5676 {
5677 int val;
5678 bool is_ctia = false;
5679 struct alc_spec *spec = codec->spec;
5680 static const struct coef_fw coef0255[] = {
5681 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5682 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5683 conteol) */
5684 {}
5685 };
5686 static const struct coef_fw coef0288[] = {
5687 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5688 {}
5689 };
5690 static const struct coef_fw coef0298[] = {
5691 UPDATE_COEF(0x50, 0x2000, 0x2000),
5692 UPDATE_COEF(0x56, 0x0006, 0x0006),
5693 UPDATE_COEF(0x66, 0x0008, 0),
5694 UPDATE_COEF(0x67, 0x2000, 0),
5695 UPDATE_COEF(0x19, 0x1300, 0x1300),
5696 {}
5697 };
5698 static const struct coef_fw coef0293[] = {
5699 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5700 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5701 {}
5702 };
5703 static const struct coef_fw coef0688[] = {
5704 WRITE_COEF(0x11, 0x0001),
5705 WRITE_COEF(0xb7, 0x802b),
5706 WRITE_COEF(0x15, 0x0d60),
5707 WRITE_COEF(0xc3, 0x0c00),
5708 {}
5709 };
5710 static const struct coef_fw coef0274[] = {
5711 UPDATE_COEF(0x4a, 0x0010, 0),
5712 UPDATE_COEF(0x4a, 0x8000, 0),
5713 WRITE_COEF(0x45, 0xd289),
5714 UPDATE_COEF(0x49, 0x0300, 0x0300),
5715 {}
5716 };
5717
5718 if (spec->no_internal_mic_pin) {
5719 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5720 return;
5721 }
5722
5723 switch (codec->core.vendor_id) {
5724 case 0x10ec0255:
5725 alc_process_coef_fw(codec, coef0255);
5726 msleep(300);
5727 val = alc_read_coef_idx(codec, 0x46);
5728 is_ctia = (val & 0x0070) == 0x0070;
5729 break;
5730 case 0x10ec0230:
5731 case 0x10ec0236:
5732 case 0x10ec0256:
5733 case 0x19e58326:
5734 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5735 alc_write_coef_idx(codec, 0x06, 0x6104);
5736 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5737
5738 alc_process_coef_fw(codec, coef0255);
5739 msleep(300);
5740 val = alc_read_coef_idx(codec, 0x46);
5741 is_ctia = (val & 0x0070) == 0x0070;
5742 if (!is_ctia) {
5743 alc_write_coef_idx(codec, 0x45, 0xe089);
5744 msleep(100);
5745 val = alc_read_coef_idx(codec, 0x46);
5746 if ((val & 0x0070) == 0x0070)
5747 is_ctia = false;
5748 else
5749 is_ctia = true;
5750 }
5751 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5752 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5753 break;
5754 case 0x10ec0234:
5755 case 0x10ec0274:
5756 case 0x10ec0294:
5757 alc_process_coef_fw(codec, coef0274);
5758 msleep(850);
5759 val = alc_read_coef_idx(codec, 0x46);
5760 is_ctia = (val & 0x00f0) == 0x00f0;
5761 break;
5762 case 0x10ec0233:
5763 case 0x10ec0283:
5764 alc_write_coef_idx(codec, 0x45, 0xd029);
5765 msleep(300);
5766 val = alc_read_coef_idx(codec, 0x46);
5767 is_ctia = (val & 0x0070) == 0x0070;
5768 break;
5769 case 0x10ec0298:
5770 snd_hda_codec_write(codec, 0x21, 0,
5771 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5772 msleep(100);
5773 snd_hda_codec_write(codec, 0x21, 0,
5774 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5775 msleep(200);
5776
5777 val = alc_read_coef_idx(codec, 0x50);
5778 if (val & (1 << 12)) {
5779 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5780 alc_process_coef_fw(codec, coef0288);
5781 msleep(350);
5782 val = alc_read_coef_idx(codec, 0x50);
5783 is_ctia = (val & 0x0070) == 0x0070;
5784 } else {
5785 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5786 alc_process_coef_fw(codec, coef0288);
5787 msleep(350);
5788 val = alc_read_coef_idx(codec, 0x50);
5789 is_ctia = (val & 0x0070) == 0x0070;
5790 }
5791 alc_process_coef_fw(codec, coef0298);
5792 snd_hda_codec_write(codec, 0x21, 0,
5793 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5794 msleep(75);
5795 snd_hda_codec_write(codec, 0x21, 0,
5796 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5797 break;
5798 case 0x10ec0286:
5799 case 0x10ec0288:
5800 alc_process_coef_fw(codec, coef0288);
5801 msleep(350);
5802 val = alc_read_coef_idx(codec, 0x50);
5803 is_ctia = (val & 0x0070) == 0x0070;
5804 break;
5805 case 0x10ec0292:
5806 alc_write_coef_idx(codec, 0x6b, 0xd429);
5807 msleep(300);
5808 val = alc_read_coef_idx(codec, 0x6c);
5809 is_ctia = (val & 0x001c) == 0x001c;
5810 break;
5811 case 0x10ec0293:
5812 alc_process_coef_fw(codec, coef0293);
5813 msleep(300);
5814 val = alc_read_coef_idx(codec, 0x46);
5815 is_ctia = (val & 0x0070) == 0x0070;
5816 break;
5817 case 0x10ec0668:
5818 alc_process_coef_fw(codec, coef0688);
5819 msleep(300);
5820 val = alc_read_coef_idx(codec, 0xbe);
5821 is_ctia = (val & 0x1c02) == 0x1c02;
5822 break;
5823 case 0x10ec0215:
5824 case 0x10ec0225:
5825 case 0x10ec0285:
5826 case 0x10ec0295:
5827 case 0x10ec0289:
5828 case 0x10ec0299:
5829 alc_process_coef_fw(codec, alc225_pre_hsmode);
5830 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5831 val = alc_read_coef_idx(codec, 0x45);
5832 if (val & (1 << 9)) {
5833 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5834 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5835 msleep(800);
5836 val = alc_read_coef_idx(codec, 0x46);
5837 is_ctia = (val & 0x00f0) == 0x00f0;
5838 } else {
5839 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5840 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5841 msleep(800);
5842 val = alc_read_coef_idx(codec, 0x46);
5843 is_ctia = (val & 0x00f0) == 0x00f0;
5844 }
5845 if (!is_ctia) {
5846 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5847 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5848 msleep(100);
5849 val = alc_read_coef_idx(codec, 0x46);
5850 if ((val & 0x00f0) == 0x00f0)
5851 is_ctia = false;
5852 else
5853 is_ctia = true;
5854 }
5855 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5856 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5857 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5858 break;
5859 case 0x10ec0867:
5860 is_ctia = true;
5861 break;
5862 }
5863
5864 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5865 is_ctia ? "yes" : "no");
5866 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5867 }
5868
alc_update_headset_mode(struct hda_codec * codec)5869 static void alc_update_headset_mode(struct hda_codec *codec)
5870 {
5871 struct alc_spec *spec = codec->spec;
5872
5873 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5874 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5875
5876 int new_headset_mode;
5877
5878 if (!snd_hda_jack_detect(codec, hp_pin))
5879 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5880 else if (mux_pin == spec->headset_mic_pin)
5881 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5882 else if (mux_pin == spec->headphone_mic_pin)
5883 new_headset_mode = ALC_HEADSET_MODE_MIC;
5884 else
5885 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5886
5887 if (new_headset_mode == spec->current_headset_mode) {
5888 snd_hda_gen_update_outputs(codec);
5889 return;
5890 }
5891
5892 switch (new_headset_mode) {
5893 case ALC_HEADSET_MODE_UNPLUGGED:
5894 alc_headset_mode_unplugged(codec);
5895 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5896 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5897 spec->gen.hp_jack_present = false;
5898 break;
5899 case ALC_HEADSET_MODE_HEADSET:
5900 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5901 alc_determine_headset_type(codec);
5902 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5903 alc_headset_mode_ctia(codec);
5904 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5905 alc_headset_mode_omtp(codec);
5906 spec->gen.hp_jack_present = true;
5907 break;
5908 case ALC_HEADSET_MODE_MIC:
5909 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5910 spec->gen.hp_jack_present = false;
5911 break;
5912 case ALC_HEADSET_MODE_HEADPHONE:
5913 alc_headset_mode_default(codec);
5914 spec->gen.hp_jack_present = true;
5915 break;
5916 }
5917 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5918 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5919 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5920 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5921 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5922 PIN_VREFHIZ);
5923 }
5924 spec->current_headset_mode = new_headset_mode;
5925
5926 snd_hda_gen_update_outputs(codec);
5927 }
5928
alc_update_headset_mode_hook(struct hda_codec * codec,struct snd_kcontrol * kcontrol,struct snd_ctl_elem_value * ucontrol)5929 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5930 struct snd_kcontrol *kcontrol,
5931 struct snd_ctl_elem_value *ucontrol)
5932 {
5933 alc_update_headset_mode(codec);
5934 }
5935
alc_update_headset_jack_cb(struct hda_codec * codec,struct hda_jack_callback * jack)5936 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5937 struct hda_jack_callback *jack)
5938 {
5939 snd_hda_gen_hp_automute(codec, jack);
5940 alc_update_headset_mode(codec);
5941 }
5942
alc_probe_headset_mode(struct hda_codec * codec)5943 static void alc_probe_headset_mode(struct hda_codec *codec)
5944 {
5945 int i;
5946 struct alc_spec *spec = codec->spec;
5947 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5948
5949 /* Find mic pins */
5950 for (i = 0; i < cfg->num_inputs; i++) {
5951 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5952 spec->headset_mic_pin = cfg->inputs[i].pin;
5953 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5954 spec->headphone_mic_pin = cfg->inputs[i].pin;
5955 }
5956
5957 WARN_ON(spec->gen.cap_sync_hook);
5958 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5959 spec->gen.automute_hook = alc_update_headset_mode;
5960 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5961 }
5962
alc_fixup_headset_mode(struct hda_codec * codec,const struct hda_fixup * fix,int action)5963 static void alc_fixup_headset_mode(struct hda_codec *codec,
5964 const struct hda_fixup *fix, int action)
5965 {
5966 struct alc_spec *spec = codec->spec;
5967
5968 switch (action) {
5969 case HDA_FIXUP_ACT_PRE_PROBE:
5970 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5971 break;
5972 case HDA_FIXUP_ACT_PROBE:
5973 alc_probe_headset_mode(codec);
5974 break;
5975 case HDA_FIXUP_ACT_INIT:
5976 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5977 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5978 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5979 }
5980 alc_update_headset_mode(codec);
5981 break;
5982 }
5983 }
5984
alc_fixup_headset_mode_no_hp_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)5985 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5986 const struct hda_fixup *fix, int action)
5987 {
5988 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5989 struct alc_spec *spec = codec->spec;
5990 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5991 }
5992 else
5993 alc_fixup_headset_mode(codec, fix, action);
5994 }
5995
alc255_set_default_jack_type(struct hda_codec * codec)5996 static void alc255_set_default_jack_type(struct hda_codec *codec)
5997 {
5998 /* Set to iphone type */
5999 static const struct coef_fw alc255fw[] = {
6000 WRITE_COEF(0x1b, 0x880b),
6001 WRITE_COEF(0x45, 0xd089),
6002 WRITE_COEF(0x1b, 0x080b),
6003 WRITE_COEF(0x46, 0x0004),
6004 WRITE_COEF(0x1b, 0x0c0b),
6005 {}
6006 };
6007 static const struct coef_fw alc256fw[] = {
6008 WRITE_COEF(0x1b, 0x884b),
6009 WRITE_COEF(0x45, 0xd089),
6010 WRITE_COEF(0x1b, 0x084b),
6011 WRITE_COEF(0x46, 0x0004),
6012 WRITE_COEF(0x1b, 0x0c4b),
6013 {}
6014 };
6015 switch (codec->core.vendor_id) {
6016 case 0x10ec0255:
6017 alc_process_coef_fw(codec, alc255fw);
6018 break;
6019 case 0x10ec0230:
6020 case 0x10ec0236:
6021 case 0x10ec0256:
6022 case 0x19e58326:
6023 alc_process_coef_fw(codec, alc256fw);
6024 break;
6025 }
6026 msleep(30);
6027 }
6028
alc_fixup_headset_mode_alc255(struct hda_codec * codec,const struct hda_fixup * fix,int action)6029 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
6030 const struct hda_fixup *fix, int action)
6031 {
6032 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6033 alc255_set_default_jack_type(codec);
6034 }
6035 alc_fixup_headset_mode(codec, fix, action);
6036 }
6037
alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)6038 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
6039 const struct hda_fixup *fix, int action)
6040 {
6041 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6042 struct alc_spec *spec = codec->spec;
6043 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6044 alc255_set_default_jack_type(codec);
6045 }
6046 else
6047 alc_fixup_headset_mode(codec, fix, action);
6048 }
6049
alc288_update_headset_jack_cb(struct hda_codec * codec,struct hda_jack_callback * jack)6050 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
6051 struct hda_jack_callback *jack)
6052 {
6053 struct alc_spec *spec = codec->spec;
6054
6055 alc_update_headset_jack_cb(codec, jack);
6056 /* Headset Mic enable or disable, only for Dell Dino */
6057 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
6058 }
6059
alc_fixup_headset_mode_dell_alc288(struct hda_codec * codec,const struct hda_fixup * fix,int action)6060 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
6061 const struct hda_fixup *fix, int action)
6062 {
6063 alc_fixup_headset_mode(codec, fix, action);
6064 if (action == HDA_FIXUP_ACT_PROBE) {
6065 struct alc_spec *spec = codec->spec;
6066 /* toggled via hp_automute_hook */
6067 spec->gpio_mask |= 0x40;
6068 spec->gpio_dir |= 0x40;
6069 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
6070 }
6071 }
6072
alc_fixup_auto_mute_via_amp(struct hda_codec * codec,const struct hda_fixup * fix,int action)6073 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
6074 const struct hda_fixup *fix, int action)
6075 {
6076 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6077 struct alc_spec *spec = codec->spec;
6078 spec->gen.auto_mute_via_amp = 1;
6079 }
6080 }
6081
alc_fixup_no_shutup(struct hda_codec * codec,const struct hda_fixup * fix,int action)6082 static void alc_fixup_no_shutup(struct hda_codec *codec,
6083 const struct hda_fixup *fix, int action)
6084 {
6085 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6086 struct alc_spec *spec = codec->spec;
6087 spec->no_shutup_pins = 1;
6088 }
6089 }
6090
alc_fixup_disable_aamix(struct hda_codec * codec,const struct hda_fixup * fix,int action)6091 static void alc_fixup_disable_aamix(struct hda_codec *codec,
6092 const struct hda_fixup *fix, int action)
6093 {
6094 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6095 struct alc_spec *spec = codec->spec;
6096 /* Disable AA-loopback as it causes white noise */
6097 spec->gen.mixer_nid = 0;
6098 }
6099 }
6100
6101 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
alc_fixup_tpt440_dock(struct hda_codec * codec,const struct hda_fixup * fix,int action)6102 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
6103 const struct hda_fixup *fix, int action)
6104 {
6105 static const struct hda_pintbl pincfgs[] = {
6106 { 0x16, 0x21211010 }, /* dock headphone */
6107 { 0x19, 0x21a11010 }, /* dock mic */
6108 { }
6109 };
6110 struct alc_spec *spec = codec->spec;
6111
6112 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6113 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6114 codec->power_save_node = 0; /* avoid click noises */
6115 snd_hda_apply_pincfgs(codec, pincfgs);
6116 }
6117 }
6118
alc_fixup_tpt470_dock(struct hda_codec * codec,const struct hda_fixup * fix,int action)6119 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6120 const struct hda_fixup *fix, int action)
6121 {
6122 static const struct hda_pintbl pincfgs[] = {
6123 { 0x17, 0x21211010 }, /* dock headphone */
6124 { 0x19, 0x21a11010 }, /* dock mic */
6125 { }
6126 };
6127 struct alc_spec *spec = codec->spec;
6128
6129 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6130 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6131 snd_hda_apply_pincfgs(codec, pincfgs);
6132 } else if (action == HDA_FIXUP_ACT_INIT) {
6133 /* Enable DOCK device */
6134 snd_hda_codec_write(codec, 0x17, 0,
6135 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6136 /* Enable DOCK device */
6137 snd_hda_codec_write(codec, 0x19, 0,
6138 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6139 }
6140 }
6141
alc_fixup_tpt470_dacs(struct hda_codec * codec,const struct hda_fixup * fix,int action)6142 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6143 const struct hda_fixup *fix, int action)
6144 {
6145 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6146 * the speaker output becomes too low by some reason on Thinkpads with
6147 * ALC298 codec
6148 */
6149 static const hda_nid_t preferred_pairs[] = {
6150 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6151 0
6152 };
6153 struct alc_spec *spec = codec->spec;
6154
6155 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6156 spec->gen.preferred_dacs = preferred_pairs;
6157 }
6158
alc295_fixup_asus_dacs(struct hda_codec * codec,const struct hda_fixup * fix,int action)6159 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6160 const struct hda_fixup *fix, int action)
6161 {
6162 static const hda_nid_t preferred_pairs[] = {
6163 0x17, 0x02, 0x21, 0x03, 0
6164 };
6165 struct alc_spec *spec = codec->spec;
6166
6167 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6168 spec->gen.preferred_dacs = preferred_pairs;
6169 }
6170
alc_shutup_dell_xps13(struct hda_codec * codec)6171 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6172 {
6173 struct alc_spec *spec = codec->spec;
6174 int hp_pin = alc_get_hp_pin(spec);
6175
6176 /* Prevent pop noises when headphones are plugged in */
6177 snd_hda_codec_write(codec, hp_pin, 0,
6178 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6179 msleep(20);
6180 }
6181
alc_fixup_dell_xps13(struct hda_codec * codec,const struct hda_fixup * fix,int action)6182 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6183 const struct hda_fixup *fix, int action)
6184 {
6185 struct alc_spec *spec = codec->spec;
6186 struct hda_input_mux *imux = &spec->gen.input_mux;
6187 int i;
6188
6189 switch (action) {
6190 case HDA_FIXUP_ACT_PRE_PROBE:
6191 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6192 * it causes a click noise at start up
6193 */
6194 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6195 spec->shutup = alc_shutup_dell_xps13;
6196 break;
6197 case HDA_FIXUP_ACT_PROBE:
6198 /* Make the internal mic the default input source. */
6199 for (i = 0; i < imux->num_items; i++) {
6200 if (spec->gen.imux_pins[i] == 0x12) {
6201 spec->gen.cur_mux[0] = i;
6202 break;
6203 }
6204 }
6205 break;
6206 }
6207 }
6208
alc_fixup_headset_mode_alc662(struct hda_codec * codec,const struct hda_fixup * fix,int action)6209 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6210 const struct hda_fixup *fix, int action)
6211 {
6212 struct alc_spec *spec = codec->spec;
6213
6214 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6215 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6216 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6217
6218 /* Disable boost for mic-in permanently. (This code is only called
6219 from quirks that guarantee that the headphone is at NID 0x1b.) */
6220 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6221 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6222 } else
6223 alc_fixup_headset_mode(codec, fix, action);
6224 }
6225
alc_fixup_headset_mode_alc668(struct hda_codec * codec,const struct hda_fixup * fix,int action)6226 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6227 const struct hda_fixup *fix, int action)
6228 {
6229 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6230 alc_write_coef_idx(codec, 0xc4, 0x8000);
6231 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6232 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6233 }
6234 alc_fixup_headset_mode(codec, fix, action);
6235 }
6236
6237 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
find_ext_mic_pin(struct hda_codec * codec)6238 static int find_ext_mic_pin(struct hda_codec *codec)
6239 {
6240 struct alc_spec *spec = codec->spec;
6241 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6242 hda_nid_t nid;
6243 unsigned int defcfg;
6244 int i;
6245
6246 for (i = 0; i < cfg->num_inputs; i++) {
6247 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6248 continue;
6249 nid = cfg->inputs[i].pin;
6250 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6251 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6252 continue;
6253 return nid;
6254 }
6255
6256 return 0;
6257 }
6258
alc271_hp_gate_mic_jack(struct hda_codec * codec,const struct hda_fixup * fix,int action)6259 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6260 const struct hda_fixup *fix,
6261 int action)
6262 {
6263 struct alc_spec *spec = codec->spec;
6264
6265 if (action == HDA_FIXUP_ACT_PROBE) {
6266 int mic_pin = find_ext_mic_pin(codec);
6267 int hp_pin = alc_get_hp_pin(spec);
6268
6269 if (snd_BUG_ON(!mic_pin || !hp_pin))
6270 return;
6271 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6272 }
6273 }
6274
alc269_fixup_limit_int_mic_boost(struct hda_codec * codec,const struct hda_fixup * fix,int action)6275 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6276 const struct hda_fixup *fix,
6277 int action)
6278 {
6279 struct alc_spec *spec = codec->spec;
6280 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6281 int i;
6282
6283 /* The mic boosts on level 2 and 3 are too noisy
6284 on the internal mic input.
6285 Therefore limit the boost to 0 or 1. */
6286
6287 if (action != HDA_FIXUP_ACT_PROBE)
6288 return;
6289
6290 for (i = 0; i < cfg->num_inputs; i++) {
6291 hda_nid_t nid = cfg->inputs[i].pin;
6292 unsigned int defcfg;
6293 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6294 continue;
6295 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6296 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6297 continue;
6298
6299 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6300 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6301 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6302 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6303 (0 << AC_AMPCAP_MUTE_SHIFT));
6304 }
6305 }
6306
alc283_hp_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)6307 static void alc283_hp_automute_hook(struct hda_codec *codec,
6308 struct hda_jack_callback *jack)
6309 {
6310 struct alc_spec *spec = codec->spec;
6311 int vref;
6312
6313 msleep(200);
6314 snd_hda_gen_hp_automute(codec, jack);
6315
6316 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6317
6318 msleep(600);
6319 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6320 vref);
6321 }
6322
alc283_fixup_chromebook(struct hda_codec * codec,const struct hda_fixup * fix,int action)6323 static void alc283_fixup_chromebook(struct hda_codec *codec,
6324 const struct hda_fixup *fix, int action)
6325 {
6326 struct alc_spec *spec = codec->spec;
6327
6328 switch (action) {
6329 case HDA_FIXUP_ACT_PRE_PROBE:
6330 snd_hda_override_wcaps(codec, 0x03, 0);
6331 /* Disable AA-loopback as it causes white noise */
6332 spec->gen.mixer_nid = 0;
6333 break;
6334 case HDA_FIXUP_ACT_INIT:
6335 /* MIC2-VREF control */
6336 /* Set to manual mode */
6337 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6338 /* Enable Line1 input control by verb */
6339 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6340 break;
6341 }
6342 }
6343
alc283_fixup_sense_combo_jack(struct hda_codec * codec,const struct hda_fixup * fix,int action)6344 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6345 const struct hda_fixup *fix, int action)
6346 {
6347 struct alc_spec *spec = codec->spec;
6348
6349 switch (action) {
6350 case HDA_FIXUP_ACT_PRE_PROBE:
6351 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6352 break;
6353 case HDA_FIXUP_ACT_INIT:
6354 /* MIC2-VREF control */
6355 /* Set to manual mode */
6356 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6357 break;
6358 }
6359 }
6360
6361 /* mute tablet speaker pin (0x14) via dock plugging in addition */
asus_tx300_automute(struct hda_codec * codec)6362 static void asus_tx300_automute(struct hda_codec *codec)
6363 {
6364 struct alc_spec *spec = codec->spec;
6365 snd_hda_gen_update_outputs(codec);
6366 if (snd_hda_jack_detect(codec, 0x1b))
6367 spec->gen.mute_bits |= (1ULL << 0x14);
6368 }
6369
alc282_fixup_asus_tx300(struct hda_codec * codec,const struct hda_fixup * fix,int action)6370 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6371 const struct hda_fixup *fix, int action)
6372 {
6373 struct alc_spec *spec = codec->spec;
6374 static const struct hda_pintbl dock_pins[] = {
6375 { 0x1b, 0x21114000 }, /* dock speaker pin */
6376 {}
6377 };
6378
6379 switch (action) {
6380 case HDA_FIXUP_ACT_PRE_PROBE:
6381 spec->init_amp = ALC_INIT_DEFAULT;
6382 /* TX300 needs to set up GPIO2 for the speaker amp */
6383 alc_setup_gpio(codec, 0x04);
6384 snd_hda_apply_pincfgs(codec, dock_pins);
6385 spec->gen.auto_mute_via_amp = 1;
6386 spec->gen.automute_hook = asus_tx300_automute;
6387 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6388 snd_hda_gen_hp_automute);
6389 break;
6390 case HDA_FIXUP_ACT_PROBE:
6391 spec->init_amp = ALC_INIT_DEFAULT;
6392 break;
6393 case HDA_FIXUP_ACT_BUILD:
6394 /* this is a bit tricky; give more sane names for the main
6395 * (tablet) speaker and the dock speaker, respectively
6396 */
6397 rename_ctl(codec, "Speaker Playback Switch",
6398 "Dock Speaker Playback Switch");
6399 rename_ctl(codec, "Bass Speaker Playback Switch",
6400 "Speaker Playback Switch");
6401 break;
6402 }
6403 }
6404
alc290_fixup_mono_speakers(struct hda_codec * codec,const struct hda_fixup * fix,int action)6405 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6406 const struct hda_fixup *fix, int action)
6407 {
6408 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6409 /* DAC node 0x03 is giving mono output. We therefore want to
6410 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6411 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6412 static const hda_nid_t conn1[] = { 0x0c };
6413 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6414 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6415 }
6416 }
6417
alc298_fixup_speaker_volume(struct hda_codec * codec,const struct hda_fixup * fix,int action)6418 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6419 const struct hda_fixup *fix, int action)
6420 {
6421 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6422 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6423 we can't adjust the speaker's volume since this node does not has
6424 Amp-out capability. we change the speaker's route to:
6425 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6426 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6427 speaker's volume now. */
6428
6429 static const hda_nid_t conn1[] = { 0x0c };
6430 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6431 }
6432 }
6433
6434 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
alc295_fixup_disable_dac3(struct hda_codec * codec,const struct hda_fixup * fix,int action)6435 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6436 const struct hda_fixup *fix, int action)
6437 {
6438 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6439 static const hda_nid_t conn[] = { 0x02, 0x03 };
6440 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6441 }
6442 }
6443
6444 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
alc285_fixup_speaker2_to_dac1(struct hda_codec * codec,const struct hda_fixup * fix,int action)6445 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6446 const struct hda_fixup *fix, int action)
6447 {
6448 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6449 static const hda_nid_t conn[] = { 0x02 };
6450 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6451 }
6452 }
6453
6454 /* Hook to update amp GPIO4 for automute */
alc280_hp_gpio4_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)6455 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6456 struct hda_jack_callback *jack)
6457 {
6458 struct alc_spec *spec = codec->spec;
6459
6460 snd_hda_gen_hp_automute(codec, jack);
6461 /* mute_led_polarity is set to 0, so we pass inverted value here */
6462 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6463 !spec->gen.hp_jack_present);
6464 }
6465
6466 /* Manage GPIOs for HP EliteBook Folio 9480m.
6467 *
6468 * GPIO4 is the headphone amplifier power control
6469 * GPIO3 is the audio output mute indicator LED
6470 */
6471
alc280_fixup_hp_9480m(struct hda_codec * codec,const struct hda_fixup * fix,int action)6472 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6473 const struct hda_fixup *fix,
6474 int action)
6475 {
6476 struct alc_spec *spec = codec->spec;
6477
6478 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6479 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6480 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6481 spec->gpio_mask |= 0x10;
6482 spec->gpio_dir |= 0x10;
6483 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6484 }
6485 }
6486
alc275_fixup_gpio4_off(struct hda_codec * codec,const struct hda_fixup * fix,int action)6487 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6488 const struct hda_fixup *fix,
6489 int action)
6490 {
6491 struct alc_spec *spec = codec->spec;
6492
6493 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6494 spec->gpio_mask |= 0x04;
6495 spec->gpio_dir |= 0x04;
6496 /* set data bit low */
6497 }
6498 }
6499
6500 /* Quirk for Thinkpad X1 7th and 8th Gen
6501 * The following fixed routing needed
6502 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6503 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6504 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6505 */
alc285_fixup_thinkpad_x1_gen7(struct hda_codec * codec,const struct hda_fixup * fix,int action)6506 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6507 const struct hda_fixup *fix, int action)
6508 {
6509 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6510 static const hda_nid_t preferred_pairs[] = {
6511 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6512 };
6513 struct alc_spec *spec = codec->spec;
6514
6515 switch (action) {
6516 case HDA_FIXUP_ACT_PRE_PROBE:
6517 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6518 spec->gen.preferred_dacs = preferred_pairs;
6519 break;
6520 case HDA_FIXUP_ACT_BUILD:
6521 /* The generic parser creates somewhat unintuitive volume ctls
6522 * with the fixed routing above, and the shared DAC2 may be
6523 * confusing for PA.
6524 * Rename those to unique names so that PA doesn't touch them
6525 * and use only Master volume.
6526 */
6527 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6528 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6529 break;
6530 }
6531 }
6532
alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec * codec,const struct hda_fixup * fix,int action)6533 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6534 const struct hda_fixup *fix,
6535 int action)
6536 {
6537 alc_fixup_dual_codecs(codec, fix, action);
6538 switch (action) {
6539 case HDA_FIXUP_ACT_PRE_PROBE:
6540 /* override card longname to provide a unique UCM profile */
6541 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6542 break;
6543 case HDA_FIXUP_ACT_BUILD:
6544 /* rename Capture controls depending on the codec */
6545 rename_ctl(codec, "Capture Volume",
6546 codec->addr == 0 ?
6547 "Rear-Panel Capture Volume" :
6548 "Front-Panel Capture Volume");
6549 rename_ctl(codec, "Capture Switch",
6550 codec->addr == 0 ?
6551 "Rear-Panel Capture Switch" :
6552 "Front-Panel Capture Switch");
6553 break;
6554 }
6555 }
6556
alc225_fixup_s3_pop_noise(struct hda_codec * codec,const struct hda_fixup * fix,int action)6557 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6558 const struct hda_fixup *fix, int action)
6559 {
6560 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6561 return;
6562
6563 codec->power_save_node = 1;
6564 }
6565
6566 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
alc274_fixup_bind_dacs(struct hda_codec * codec,const struct hda_fixup * fix,int action)6567 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6568 const struct hda_fixup *fix, int action)
6569 {
6570 struct alc_spec *spec = codec->spec;
6571 static const hda_nid_t preferred_pairs[] = {
6572 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6573 0
6574 };
6575
6576 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6577 return;
6578
6579 spec->gen.preferred_dacs = preferred_pairs;
6580 spec->gen.auto_mute_via_amp = 1;
6581 codec->power_save_node = 0;
6582 }
6583
6584 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
alc289_fixup_asus_ga401(struct hda_codec * codec,const struct hda_fixup * fix,int action)6585 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6586 const struct hda_fixup *fix, int action)
6587 {
6588 static const hda_nid_t preferred_pairs[] = {
6589 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6590 };
6591 struct alc_spec *spec = codec->spec;
6592
6593 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6594 spec->gen.preferred_dacs = preferred_pairs;
6595 spec->gen.obey_preferred_dacs = 1;
6596 }
6597 }
6598
6599 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
alc285_fixup_invalidate_dacs(struct hda_codec * codec,const struct hda_fixup * fix,int action)6600 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6601 const struct hda_fixup *fix, int action)
6602 {
6603 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6604 return;
6605
6606 snd_hda_override_wcaps(codec, 0x03, 0);
6607 }
6608
alc_combo_jack_hp_jd_restart(struct hda_codec * codec)6609 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6610 {
6611 switch (codec->core.vendor_id) {
6612 case 0x10ec0274:
6613 case 0x10ec0294:
6614 case 0x10ec0225:
6615 case 0x10ec0295:
6616 case 0x10ec0299:
6617 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6618 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6619 break;
6620 case 0x10ec0230:
6621 case 0x10ec0235:
6622 case 0x10ec0236:
6623 case 0x10ec0255:
6624 case 0x10ec0256:
6625 case 0x10ec0257:
6626 case 0x19e58326:
6627 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6628 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6629 break;
6630 }
6631 }
6632
alc295_fixup_chromebook(struct hda_codec * codec,const struct hda_fixup * fix,int action)6633 static void alc295_fixup_chromebook(struct hda_codec *codec,
6634 const struct hda_fixup *fix, int action)
6635 {
6636 struct alc_spec *spec = codec->spec;
6637
6638 switch (action) {
6639 case HDA_FIXUP_ACT_PRE_PROBE:
6640 spec->ultra_low_power = true;
6641 break;
6642 case HDA_FIXUP_ACT_INIT:
6643 alc_combo_jack_hp_jd_restart(codec);
6644 break;
6645 }
6646 }
6647
alc_fixup_disable_mic_vref(struct hda_codec * codec,const struct hda_fixup * fix,int action)6648 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6649 const struct hda_fixup *fix, int action)
6650 {
6651 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6652 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6653 }
6654
6655
alc294_gx502_toggle_output(struct hda_codec * codec,struct hda_jack_callback * cb)6656 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6657 struct hda_jack_callback *cb)
6658 {
6659 /* The Windows driver sets the codec up in a very different way where
6660 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6661 */
6662 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6663 alc_write_coef_idx(codec, 0x10, 0x8a20);
6664 else
6665 alc_write_coef_idx(codec, 0x10, 0x0a20);
6666 }
6667
alc294_fixup_gx502_hp(struct hda_codec * codec,const struct hda_fixup * fix,int action)6668 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6669 const struct hda_fixup *fix, int action)
6670 {
6671 /* Pin 0x21: headphones/headset mic */
6672 if (!is_jack_detectable(codec, 0x21))
6673 return;
6674
6675 switch (action) {
6676 case HDA_FIXUP_ACT_PRE_PROBE:
6677 snd_hda_jack_detect_enable_callback(codec, 0x21,
6678 alc294_gx502_toggle_output);
6679 break;
6680 case HDA_FIXUP_ACT_INIT:
6681 /* Make sure to start in a correct state, i.e. if
6682 * headphones have been plugged in before powering up the system
6683 */
6684 alc294_gx502_toggle_output(codec, NULL);
6685 break;
6686 }
6687 }
6688
alc294_gu502_toggle_output(struct hda_codec * codec,struct hda_jack_callback * cb)6689 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6690 struct hda_jack_callback *cb)
6691 {
6692 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6693 * responsible from changes between speakers and headphones
6694 */
6695 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6696 alc_write_coef_idx(codec, 0x10, 0x8420);
6697 else
6698 alc_write_coef_idx(codec, 0x10, 0x0a20);
6699 }
6700
alc294_fixup_gu502_hp(struct hda_codec * codec,const struct hda_fixup * fix,int action)6701 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6702 const struct hda_fixup *fix, int action)
6703 {
6704 if (!is_jack_detectable(codec, 0x21))
6705 return;
6706
6707 switch (action) {
6708 case HDA_FIXUP_ACT_PRE_PROBE:
6709 snd_hda_jack_detect_enable_callback(codec, 0x21,
6710 alc294_gu502_toggle_output);
6711 break;
6712 case HDA_FIXUP_ACT_INIT:
6713 alc294_gu502_toggle_output(codec, NULL);
6714 break;
6715 }
6716 }
6717
alc285_fixup_hp_gpio_amp_init(struct hda_codec * codec,const struct hda_fixup * fix,int action)6718 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6719 const struct hda_fixup *fix, int action)
6720 {
6721 if (action != HDA_FIXUP_ACT_INIT)
6722 return;
6723
6724 msleep(100);
6725 alc_write_coef_idx(codec, 0x65, 0x0);
6726 }
6727
alc274_fixup_hp_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)6728 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6729 const struct hda_fixup *fix, int action)
6730 {
6731 switch (action) {
6732 case HDA_FIXUP_ACT_INIT:
6733 alc_combo_jack_hp_jd_restart(codec);
6734 break;
6735 }
6736 }
6737
alc_fixup_no_int_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)6738 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6739 const struct hda_fixup *fix, int action)
6740 {
6741 struct alc_spec *spec = codec->spec;
6742
6743 switch (action) {
6744 case HDA_FIXUP_ACT_PRE_PROBE:
6745 /* Mic RING SLEEVE swap for combo jack */
6746 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6747 spec->no_internal_mic_pin = true;
6748 break;
6749 case HDA_FIXUP_ACT_INIT:
6750 alc_combo_jack_hp_jd_restart(codec);
6751 break;
6752 }
6753 }
6754
6755 /* GPIO1 = amplifier on/off
6756 * GPIO3 = mic mute LED
6757 */
alc285_fixup_hp_spectre_x360_eb1(struct hda_codec * codec,const struct hda_fixup * fix,int action)6758 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6759 const struct hda_fixup *fix, int action)
6760 {
6761 static const hda_nid_t conn[] = { 0x02 };
6762
6763 struct alc_spec *spec = codec->spec;
6764 static const struct hda_pintbl pincfgs[] = {
6765 { 0x14, 0x90170110 }, /* front/high speakers */
6766 { 0x17, 0x90170130 }, /* back/bass speakers */
6767 { }
6768 };
6769
6770 //enable micmute led
6771 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6772
6773 switch (action) {
6774 case HDA_FIXUP_ACT_PRE_PROBE:
6775 spec->micmute_led_polarity = 1;
6776 /* needed for amp of back speakers */
6777 spec->gpio_mask |= 0x01;
6778 spec->gpio_dir |= 0x01;
6779 snd_hda_apply_pincfgs(codec, pincfgs);
6780 /* share DAC to have unified volume control */
6781 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6782 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6783 break;
6784 case HDA_FIXUP_ACT_INIT:
6785 /* need to toggle GPIO to enable the amp of back speakers */
6786 alc_update_gpio_data(codec, 0x01, true);
6787 msleep(100);
6788 alc_update_gpio_data(codec, 0x01, false);
6789 break;
6790 }
6791 }
6792
6793 /* GPIO1 = amplifier on/off */
alc285_fixup_hp_spectre_x360_df1(struct hda_codec * codec,const struct hda_fixup * fix,int action)6794 static void alc285_fixup_hp_spectre_x360_df1(struct hda_codec *codec,
6795 const struct hda_fixup *fix,
6796 int action)
6797 {
6798 struct alc_spec *spec = codec->spec;
6799 static const hda_nid_t conn[] = { 0x02 };
6800 static const struct hda_pintbl pincfgs[] = {
6801 { 0x14, 0x90170110 }, /* front/high speakers */
6802 { 0x17, 0x90170130 }, /* back/bass speakers */
6803 { }
6804 };
6805
6806 // enable mute led
6807 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
6808
6809 switch (action) {
6810 case HDA_FIXUP_ACT_PRE_PROBE:
6811 /* needed for amp of back speakers */
6812 spec->gpio_mask |= 0x01;
6813 spec->gpio_dir |= 0x01;
6814 snd_hda_apply_pincfgs(codec, pincfgs);
6815 /* share DAC to have unified volume control */
6816 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6817 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6818 break;
6819 case HDA_FIXUP_ACT_INIT:
6820 /* need to toggle GPIO to enable the amp of back speakers */
6821 alc_update_gpio_data(codec, 0x01, true);
6822 msleep(100);
6823 alc_update_gpio_data(codec, 0x01, false);
6824 break;
6825 }
6826 }
6827
alc285_fixup_hp_spectre_x360(struct hda_codec * codec,const struct hda_fixup * fix,int action)6828 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6829 const struct hda_fixup *fix, int action)
6830 {
6831 static const hda_nid_t conn[] = { 0x02 };
6832 static const struct hda_pintbl pincfgs[] = {
6833 { 0x14, 0x90170110 }, /* rear speaker */
6834 { }
6835 };
6836
6837 switch (action) {
6838 case HDA_FIXUP_ACT_PRE_PROBE:
6839 snd_hda_apply_pincfgs(codec, pincfgs);
6840 /* force front speaker to DAC1 */
6841 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6842 break;
6843 }
6844 }
6845
alc285_fixup_hp_envy_x360(struct hda_codec * codec,const struct hda_fixup * fix,int action)6846 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6847 const struct hda_fixup *fix,
6848 int action)
6849 {
6850 static const struct coef_fw coefs[] = {
6851 WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6852 WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6853 WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6854 WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6855 WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6856 WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6857 WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6858 WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6859 WRITE_COEF(0x6e, 0x1005), { }
6860 };
6861
6862 static const struct hda_pintbl pincfgs[] = {
6863 { 0x12, 0xb7a60130 }, /* Internal microphone*/
6864 { 0x14, 0x90170150 }, /* B&O soundbar speakers */
6865 { 0x17, 0x90170153 }, /* Side speakers */
6866 { 0x19, 0x03a11040 }, /* Headset microphone */
6867 { }
6868 };
6869
6870 switch (action) {
6871 case HDA_FIXUP_ACT_PRE_PROBE:
6872 snd_hda_apply_pincfgs(codec, pincfgs);
6873
6874 /* Fixes volume control problem for side speakers */
6875 alc295_fixup_disable_dac3(codec, fix, action);
6876
6877 /* Fixes no sound from headset speaker */
6878 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6879
6880 /* Auto-enable headset mic when plugged */
6881 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6882
6883 /* Headset mic volume enhancement */
6884 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6885 break;
6886 case HDA_FIXUP_ACT_INIT:
6887 alc_process_coef_fw(codec, coefs);
6888 break;
6889 case HDA_FIXUP_ACT_BUILD:
6890 rename_ctl(codec, "Bass Speaker Playback Volume",
6891 "B&O-Tuned Playback Volume");
6892 rename_ctl(codec, "Front Playback Switch",
6893 "B&O Soundbar Playback Switch");
6894 rename_ctl(codec, "Bass Speaker Playback Switch",
6895 "Side Speaker Playback Switch");
6896 break;
6897 }
6898 }
6899
alc285_fixup_hp_beep(struct hda_codec * codec,const struct hda_fixup * fix,int action)6900 static void alc285_fixup_hp_beep(struct hda_codec *codec,
6901 const struct hda_fixup *fix, int action)
6902 {
6903 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6904 codec->beep_just_power_on = true;
6905 } else if (action == HDA_FIXUP_ACT_INIT) {
6906 #ifdef CONFIG_SND_HDA_INPUT_BEEP
6907 /*
6908 * Just enable loopback to internal speaker and headphone jack.
6909 * Disable amplification to get about the same beep volume as
6910 * was on pure BIOS setup before loading the driver.
6911 */
6912 alc_update_coef_idx(codec, 0x36, 0x7070, BIT(13));
6913
6914 snd_hda_enable_beep_device(codec, 1);
6915
6916 #if !IS_ENABLED(CONFIG_INPUT_PCSPKR)
6917 dev_warn_once(hda_codec_dev(codec),
6918 "enable CONFIG_INPUT_PCSPKR to get PC beeps\n");
6919 #endif
6920 #endif
6921 }
6922 }
6923
6924 /* for hda_fixup_thinkpad_acpi() */
6925 #include "thinkpad_helper.c"
6926
alc_fixup_thinkpad_acpi(struct hda_codec * codec,const struct hda_fixup * fix,int action)6927 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6928 const struct hda_fixup *fix, int action)
6929 {
6930 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6931 hda_fixup_thinkpad_acpi(codec, fix, action);
6932 }
6933
6934 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
alc287_fixup_legion_15imhg05_speakers(struct hda_codec * codec,const struct hda_fixup * fix,int action)6935 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6936 const struct hda_fixup *fix,
6937 int action)
6938 {
6939 struct alc_spec *spec = codec->spec;
6940
6941 switch (action) {
6942 case HDA_FIXUP_ACT_PRE_PROBE:
6943 spec->gen.suppress_auto_mute = 1;
6944 break;
6945 }
6946 }
6947
comp_bind(struct device * dev)6948 static int comp_bind(struct device *dev)
6949 {
6950 struct hda_codec *cdc = dev_to_hda_codec(dev);
6951 struct alc_spec *spec = cdc->spec;
6952
6953 return component_bind_all(dev, spec->comps);
6954 }
6955
comp_unbind(struct device * dev)6956 static void comp_unbind(struct device *dev)
6957 {
6958 struct hda_codec *cdc = dev_to_hda_codec(dev);
6959 struct alc_spec *spec = cdc->spec;
6960
6961 component_unbind_all(dev, spec->comps);
6962 }
6963
6964 static const struct component_master_ops comp_master_ops = {
6965 .bind = comp_bind,
6966 .unbind = comp_unbind,
6967 };
6968
comp_generic_playback_hook(struct hda_pcm_stream * hinfo,struct hda_codec * cdc,struct snd_pcm_substream * sub,int action)6969 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6970 struct snd_pcm_substream *sub, int action)
6971 {
6972 struct alc_spec *spec = cdc->spec;
6973 int i;
6974
6975 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6976 if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
6977 spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
6978 }
6979 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6980 if (spec->comps[i].dev && spec->comps[i].playback_hook)
6981 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6982 }
6983 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6984 if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
6985 spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
6986 }
6987 }
6988
6989 struct scodec_dev_name {
6990 const char *bus;
6991 const char *hid;
6992 int index;
6993 };
6994
6995 /* match the device name in a slightly relaxed manner */
comp_match_cs35l41_dev_name(struct device * dev,void * data)6996 static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6997 {
6998 struct scodec_dev_name *p = data;
6999 const char *d = dev_name(dev);
7000 int n = strlen(p->bus);
7001 char tmp[32];
7002
7003 /* check the bus name */
7004 if (strncmp(d, p->bus, n))
7005 return 0;
7006 /* skip the bus number */
7007 if (isdigit(d[n]))
7008 n++;
7009 /* the rest must be exact matching */
7010 snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
7011 return !strcmp(d + n, tmp);
7012 }
7013
comp_match_tas2781_dev_name(struct device * dev,void * data)7014 static int comp_match_tas2781_dev_name(struct device *dev,
7015 void *data)
7016 {
7017 struct scodec_dev_name *p = data;
7018 const char *d = dev_name(dev);
7019 int n = strlen(p->bus);
7020 char tmp[32];
7021
7022 /* check the bus name */
7023 if (strncmp(d, p->bus, n))
7024 return 0;
7025 /* skip the bus number */
7026 if (isdigit(d[n]))
7027 n++;
7028 /* the rest must be exact matching */
7029 snprintf(tmp, sizeof(tmp), "-%s:00", p->hid);
7030
7031 return !strcmp(d + n, tmp);
7032 }
7033
cs35l41_generic_fixup(struct hda_codec * cdc,int action,const char * bus,const char * hid,int count)7034 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
7035 const char *hid, int count)
7036 {
7037 struct device *dev = hda_codec_dev(cdc);
7038 struct alc_spec *spec = cdc->spec;
7039 struct scodec_dev_name *rec;
7040 int ret, i;
7041
7042 switch (action) {
7043 case HDA_FIXUP_ACT_PRE_PROBE:
7044 for (i = 0; i < count; i++) {
7045 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
7046 if (!rec)
7047 return;
7048 rec->bus = bus;
7049 rec->hid = hid;
7050 rec->index = i;
7051 spec->comps[i].codec = cdc;
7052 component_match_add(dev, &spec->match,
7053 comp_match_cs35l41_dev_name, rec);
7054 }
7055 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
7056 if (ret)
7057 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
7058 else
7059 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
7060 break;
7061 case HDA_FIXUP_ACT_FREE:
7062 component_master_del(dev, &comp_master_ops);
7063 break;
7064 }
7065 }
7066
tas2781_generic_fixup(struct hda_codec * cdc,int action,const char * bus,const char * hid)7067 static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
7068 const char *bus, const char *hid)
7069 {
7070 struct device *dev = hda_codec_dev(cdc);
7071 struct alc_spec *spec = cdc->spec;
7072 struct scodec_dev_name *rec;
7073 int ret;
7074
7075 switch (action) {
7076 case HDA_FIXUP_ACT_PRE_PROBE:
7077 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
7078 if (!rec)
7079 return;
7080 rec->bus = bus;
7081 rec->hid = hid;
7082 rec->index = 0;
7083 spec->comps[0].codec = cdc;
7084 component_match_add(dev, &spec->match,
7085 comp_match_tas2781_dev_name, rec);
7086 ret = component_master_add_with_match(dev, &comp_master_ops,
7087 spec->match);
7088 if (ret)
7089 codec_err(cdc,
7090 "Fail to register component aggregator %d\n",
7091 ret);
7092 else
7093 spec->gen.pcm_playback_hook =
7094 comp_generic_playback_hook;
7095 break;
7096 case HDA_FIXUP_ACT_FREE:
7097 component_master_del(dev, &comp_master_ops);
7098 break;
7099 }
7100 }
7101
cs35l41_fixup_i2c_two(struct hda_codec * cdc,const struct hda_fixup * fix,int action)7102 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7103 {
7104 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
7105 }
7106
cs35l41_fixup_spi_two(struct hda_codec * codec,const struct hda_fixup * fix,int action)7107 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7108 {
7109 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
7110 }
7111
cs35l41_fixup_spi_four(struct hda_codec * codec,const struct hda_fixup * fix,int action)7112 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7113 {
7114 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
7115 }
7116
alc287_fixup_legion_16achg6_speakers(struct hda_codec * cdc,const struct hda_fixup * fix,int action)7117 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7118 int action)
7119 {
7120 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
7121 }
7122
alc287_fixup_legion_16ithg6_speakers(struct hda_codec * cdc,const struct hda_fixup * fix,int action)7123 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7124 int action)
7125 {
7126 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
7127 }
7128
tas2781_fixup_i2c(struct hda_codec * cdc,const struct hda_fixup * fix,int action)7129 static void tas2781_fixup_i2c(struct hda_codec *cdc,
7130 const struct hda_fixup *fix, int action)
7131 {
7132 tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
7133 }
7134
7135 /* for alc295_fixup_hp_top_speakers */
7136 #include "hp_x360_helper.c"
7137
7138 /* for alc285_fixup_ideapad_s740_coef() */
7139 #include "ideapad_s740_helper.c"
7140
7141 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7142 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7143 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7144 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7145 {}
7146 };
7147
alc256_fixup_set_coef_defaults(struct hda_codec * codec,const struct hda_fixup * fix,int action)7148 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7149 const struct hda_fixup *fix,
7150 int action)
7151 {
7152 /*
7153 * A certain other OS sets these coeffs to different values. On at least
7154 * one TongFang barebone these settings might survive even a cold
7155 * reboot. So to restore a clean slate the values are explicitly reset
7156 * to default here. Without this, the external microphone is always in a
7157 * plugged-in state, while the internal microphone is always in an
7158 * unplugged state, breaking the ability to use the internal microphone.
7159 */
7160 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
7161 }
7162
7163 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7164 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7165 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7166 WRITE_COEF(0x49, 0x0149),
7167 {}
7168 };
7169
alc233_fixup_no_audio_jack(struct hda_codec * codec,const struct hda_fixup * fix,int action)7170 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7171 const struct hda_fixup *fix,
7172 int action)
7173 {
7174 /*
7175 * The audio jack input and output is not detected on the ASRock NUC Box
7176 * 1100 series when cold booting without this fix. Warm rebooting from a
7177 * certain other OS makes the audio functional, as COEF settings are
7178 * preserved in this case. This fix sets these altered COEF values as
7179 * the default.
7180 */
7181 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7182 }
7183
alc256_fixup_mic_no_presence_and_resume(struct hda_codec * codec,const struct hda_fixup * fix,int action)7184 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7185 const struct hda_fixup *fix,
7186 int action)
7187 {
7188 /*
7189 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7190 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7191 * needs an additional quirk for sound working after suspend and resume.
7192 */
7193 if (codec->core.vendor_id == 0x10ec0256) {
7194 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7195 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7196 } else {
7197 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7198 }
7199 }
7200
alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec * codec,const struct hda_fixup * fix,int action)7201 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7202 const struct hda_fixup *fix,
7203 int action)
7204 {
7205 struct alc_spec *spec = codec->spec;
7206 struct hda_input_mux *imux = &spec->gen.input_mux;
7207 int i;
7208
7209 alc269_fixup_limit_int_mic_boost(codec, fix, action);
7210
7211 switch (action) {
7212 case HDA_FIXUP_ACT_PRE_PROBE:
7213 /**
7214 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7215 * to Hi-Z to avoid pop noises at startup and when plugging and
7216 * unplugging headphones.
7217 */
7218 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7219 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7220 break;
7221 case HDA_FIXUP_ACT_PROBE:
7222 /**
7223 * Make the internal mic (0x12) the default input source to
7224 * prevent pop noises on cold boot.
7225 */
7226 for (i = 0; i < imux->num_items; i++) {
7227 if (spec->gen.imux_pins[i] == 0x12) {
7228 spec->gen.cur_mux[0] = i;
7229 break;
7230 }
7231 }
7232 break;
7233 }
7234 }
7235
alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec * codec,const struct hda_fixup * fix,int action)7236 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7237 const struct hda_fixup *fix, int action)
7238 {
7239 /*
7240 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7241 * unconnected.
7242 */
7243 static const struct hda_pintbl pincfgs[] = {
7244 { 0x17, 0x90170121 },
7245 { }
7246 };
7247 /*
7248 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7249 * DAC 0x02 and 0x03 would be fine.
7250 */
7251 static const hda_nid_t conn[] = { 0x02, 0x03 };
7252 /*
7253 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7254 * Headphones (0x21) are connected to DAC 0x03.
7255 */
7256 static const hda_nid_t preferred_pairs[] = {
7257 0x14, 0x02,
7258 0x17, 0x02,
7259 0x21, 0x03,
7260 0
7261 };
7262 struct alc_spec *spec = codec->spec;
7263
7264 switch (action) {
7265 case HDA_FIXUP_ACT_PRE_PROBE:
7266 snd_hda_apply_pincfgs(codec, pincfgs);
7267 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7268 spec->gen.preferred_dacs = preferred_pairs;
7269 break;
7270 }
7271 }
7272
alc295_fixup_dell_inspiron_top_speakers(struct hda_codec * codec,const struct hda_fixup * fix,int action)7273 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7274 const struct hda_fixup *fix, int action)
7275 {
7276 static const struct hda_pintbl pincfgs[] = {
7277 { 0x14, 0x90170151 },
7278 { 0x17, 0x90170150 },
7279 { }
7280 };
7281 static const hda_nid_t conn[] = { 0x02, 0x03 };
7282 static const hda_nid_t preferred_pairs[] = {
7283 0x14, 0x02,
7284 0x17, 0x03,
7285 0x21, 0x02,
7286 0
7287 };
7288 struct alc_spec *spec = codec->spec;
7289
7290 alc_fixup_no_shutup(codec, fix, action);
7291
7292 switch (action) {
7293 case HDA_FIXUP_ACT_PRE_PROBE:
7294 snd_hda_apply_pincfgs(codec, pincfgs);
7295 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7296 spec->gen.preferred_dacs = preferred_pairs;
7297 break;
7298 }
7299 }
7300
7301 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
alc287_fixup_bind_dacs(struct hda_codec * codec,const struct hda_fixup * fix,int action)7302 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7303 const struct hda_fixup *fix, int action)
7304 {
7305 struct alc_spec *spec = codec->spec;
7306 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7307 static const hda_nid_t preferred_pairs[] = {
7308 0x17, 0x02, 0x21, 0x03, 0
7309 };
7310
7311 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7312 return;
7313
7314 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7315 spec->gen.preferred_dacs = preferred_pairs;
7316 spec->gen.auto_mute_via_amp = 1;
7317 if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7318 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7319 0x0); /* Make sure 0x14 was disable */
7320 }
7321 }
7322 /* Fix none verb table of Headset Mic pin */
alc_fixup_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)7323 static void alc_fixup_headset_mic(struct hda_codec *codec,
7324 const struct hda_fixup *fix, int action)
7325 {
7326 struct alc_spec *spec = codec->spec;
7327 static const struct hda_pintbl pincfgs[] = {
7328 { 0x19, 0x03a1103c },
7329 { }
7330 };
7331
7332 switch (action) {
7333 case HDA_FIXUP_ACT_PRE_PROBE:
7334 snd_hda_apply_pincfgs(codec, pincfgs);
7335 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7336 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7337 break;
7338 }
7339 }
7340
7341
7342 enum {
7343 ALC269_FIXUP_GPIO2,
7344 ALC269_FIXUP_SONY_VAIO,
7345 ALC275_FIXUP_SONY_VAIO_GPIO2,
7346 ALC269_FIXUP_DELL_M101Z,
7347 ALC269_FIXUP_SKU_IGNORE,
7348 ALC269_FIXUP_ASUS_G73JW,
7349 ALC269_FIXUP_ASUS_N7601ZM_PINS,
7350 ALC269_FIXUP_ASUS_N7601ZM,
7351 ALC269_FIXUP_LENOVO_EAPD,
7352 ALC275_FIXUP_SONY_HWEQ,
7353 ALC275_FIXUP_SONY_DISABLE_AAMIX,
7354 ALC271_FIXUP_DMIC,
7355 ALC269_FIXUP_PCM_44K,
7356 ALC269_FIXUP_STEREO_DMIC,
7357 ALC269_FIXUP_HEADSET_MIC,
7358 ALC269_FIXUP_QUANTA_MUTE,
7359 ALC269_FIXUP_LIFEBOOK,
7360 ALC269_FIXUP_LIFEBOOK_EXTMIC,
7361 ALC269_FIXUP_LIFEBOOK_HP_PIN,
7362 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7363 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7364 ALC269_FIXUP_AMIC,
7365 ALC269_FIXUP_DMIC,
7366 ALC269VB_FIXUP_AMIC,
7367 ALC269VB_FIXUP_DMIC,
7368 ALC269_FIXUP_HP_MUTE_LED,
7369 ALC269_FIXUP_HP_MUTE_LED_MIC1,
7370 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7371 ALC269_FIXUP_HP_MUTE_LED_MIC3,
7372 ALC269_FIXUP_HP_GPIO_LED,
7373 ALC269_FIXUP_HP_GPIO_MIC1_LED,
7374 ALC269_FIXUP_HP_LINE1_MIC1_LED,
7375 ALC269_FIXUP_INV_DMIC,
7376 ALC269_FIXUP_LENOVO_DOCK,
7377 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7378 ALC269_FIXUP_NO_SHUTUP,
7379 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7380 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7381 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7382 ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
7383 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7384 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7385 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7386 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7387 ALC269_FIXUP_HEADSET_MODE,
7388 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7389 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7390 ALC269_FIXUP_ASUS_X101_FUNC,
7391 ALC269_FIXUP_ASUS_X101_VERB,
7392 ALC269_FIXUP_ASUS_X101,
7393 ALC271_FIXUP_AMIC_MIC2,
7394 ALC271_FIXUP_HP_GATE_MIC_JACK,
7395 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7396 ALC269_FIXUP_ACER_AC700,
7397 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7398 ALC269VB_FIXUP_ASUS_ZENBOOK,
7399 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7400 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7401 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7402 ALC269VB_FIXUP_ORDISSIMO_EVE2,
7403 ALC283_FIXUP_CHROME_BOOK,
7404 ALC283_FIXUP_SENSE_COMBO_JACK,
7405 ALC282_FIXUP_ASUS_TX300,
7406 ALC283_FIXUP_INT_MIC,
7407 ALC290_FIXUP_MONO_SPEAKERS,
7408 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7409 ALC290_FIXUP_SUBWOOFER,
7410 ALC290_FIXUP_SUBWOOFER_HSJACK,
7411 ALC295_FIXUP_HP_MUTE_LED_COEFBIT11,
7412 ALC269_FIXUP_THINKPAD_ACPI,
7413 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7414 ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13,
7415 ALC269VC_FIXUP_INFINIX_Y4_MAX,
7416 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7417 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7418 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7419 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7420 ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
7421 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7422 ALC255_FIXUP_HEADSET_MODE,
7423 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7424 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7425 ALC292_FIXUP_TPT440_DOCK,
7426 ALC292_FIXUP_TPT440,
7427 ALC283_FIXUP_HEADSET_MIC,
7428 ALC255_FIXUP_MIC_MUTE_LED,
7429 ALC282_FIXUP_ASPIRE_V5_PINS,
7430 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7431 ALC280_FIXUP_HP_GPIO4,
7432 ALC286_FIXUP_HP_GPIO_LED,
7433 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7434 ALC280_FIXUP_HP_DOCK_PINS,
7435 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7436 ALC280_FIXUP_HP_9480M,
7437 ALC245_FIXUP_HP_X360_AMP,
7438 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7439 ALC285_FIXUP_HP_SPECTRE_X360_DF1,
7440 ALC285_FIXUP_HP_ENVY_X360,
7441 ALC288_FIXUP_DELL_HEADSET_MODE,
7442 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7443 ALC288_FIXUP_DELL_XPS_13,
7444 ALC288_FIXUP_DISABLE_AAMIX,
7445 ALC292_FIXUP_DELL_E7X_AAMIX,
7446 ALC292_FIXUP_DELL_E7X,
7447 ALC292_FIXUP_DISABLE_AAMIX,
7448 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7449 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7450 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7451 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7452 ALC275_FIXUP_DELL_XPS,
7453 ALC293_FIXUP_LENOVO_SPK_NOISE,
7454 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7455 ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED,
7456 ALC255_FIXUP_DELL_SPK_NOISE,
7457 ALC225_FIXUP_DISABLE_MIC_VREF,
7458 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7459 ALC295_FIXUP_DISABLE_DAC3,
7460 ALC285_FIXUP_SPEAKER2_TO_DAC1,
7461 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7462 ALC285_FIXUP_ASUS_HEADSET_MIC,
7463 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7464 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7465 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7466 ALC280_FIXUP_HP_HEADSET_MIC,
7467 ALC221_FIXUP_HP_FRONT_MIC,
7468 ALC292_FIXUP_TPT460,
7469 ALC298_FIXUP_SPK_VOLUME,
7470 ALC298_FIXUP_LENOVO_SPK_VOLUME,
7471 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7472 ALC269_FIXUP_ATIV_BOOK_8,
7473 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7474 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7475 ALC256_FIXUP_ASUS_HEADSET_MODE,
7476 ALC256_FIXUP_ASUS_MIC,
7477 ALC256_FIXUP_ASUS_AIO_GPIO2,
7478 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7479 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7480 ALC233_FIXUP_LENOVO_MULTI_CODECS,
7481 ALC233_FIXUP_ACER_HEADSET_MIC,
7482 ALC294_FIXUP_LENOVO_MIC_LOCATION,
7483 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7484 ALC225_FIXUP_S3_POP_NOISE,
7485 ALC700_FIXUP_INTEL_REFERENCE,
7486 ALC274_FIXUP_DELL_BIND_DACS,
7487 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7488 ALC298_FIXUP_TPT470_DOCK_FIX,
7489 ALC298_FIXUP_TPT470_DOCK,
7490 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7491 ALC255_FIXUP_DELL_HEADSET_MIC,
7492 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7493 ALC298_FIXUP_HUAWEI_MBX_STEREO,
7494 ALC295_FIXUP_HP_X360,
7495 ALC221_FIXUP_HP_HEADSET_MIC,
7496 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7497 ALC295_FIXUP_HP_AUTO_MUTE,
7498 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7499 ALC294_FIXUP_ASUS_MIC,
7500 ALC294_FIXUP_ASUS_HEADSET_MIC,
7501 ALC294_FIXUP_ASUS_SPK,
7502 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7503 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7504 ALC255_FIXUP_ACER_HEADSET_MIC,
7505 ALC295_FIXUP_CHROME_BOOK,
7506 ALC225_FIXUP_HEADSET_JACK,
7507 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7508 ALC225_FIXUP_WYSE_AUTO_MUTE,
7509 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7510 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7511 ALC256_FIXUP_ASUS_HEADSET_MIC,
7512 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7513 ALC255_FIXUP_PREDATOR_SUBWOOFER,
7514 ALC299_FIXUP_PREDATOR_SPK,
7515 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7516 ALC289_FIXUP_DELL_SPK1,
7517 ALC289_FIXUP_DELL_SPK2,
7518 ALC289_FIXUP_DUAL_SPK,
7519 ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7520 ALC294_FIXUP_SPK2_TO_DAC1,
7521 ALC294_FIXUP_ASUS_DUAL_SPK,
7522 ALC285_FIXUP_THINKPAD_X1_GEN7,
7523 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7524 ALC294_FIXUP_ASUS_ALLY,
7525 ALC294_FIXUP_ASUS_ALLY_PINS,
7526 ALC294_FIXUP_ASUS_ALLY_VERBS,
7527 ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7528 ALC294_FIXUP_ASUS_HPE,
7529 ALC294_FIXUP_ASUS_COEF_1B,
7530 ALC294_FIXUP_ASUS_GX502_HP,
7531 ALC294_FIXUP_ASUS_GX502_PINS,
7532 ALC294_FIXUP_ASUS_GX502_VERBS,
7533 ALC294_FIXUP_ASUS_GU502_HP,
7534 ALC294_FIXUP_ASUS_GU502_PINS,
7535 ALC294_FIXUP_ASUS_GU502_VERBS,
7536 ALC294_FIXUP_ASUS_G513_PINS,
7537 ALC285_FIXUP_ASUS_G533Z_PINS,
7538 ALC285_FIXUP_HP_GPIO_LED,
7539 ALC285_FIXUP_HP_MUTE_LED,
7540 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7541 ALC285_FIXUP_HP_BEEP_MICMUTE_LED,
7542 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7543 ALC236_FIXUP_HP_GPIO_LED,
7544 ALC236_FIXUP_HP_MUTE_LED,
7545 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7546 ALC236_FIXUP_LENOVO_INV_DMIC,
7547 ALC298_FIXUP_SAMSUNG_AMP,
7548 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7549 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7550 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7551 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7552 ALC269VC_FIXUP_ACER_HEADSET_MIC,
7553 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7554 ALC289_FIXUP_ASUS_GA401,
7555 ALC289_FIXUP_ASUS_GA502,
7556 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7557 ALC285_FIXUP_HP_GPIO_AMP_INIT,
7558 ALC269_FIXUP_CZC_B20,
7559 ALC269_FIXUP_CZC_TMI,
7560 ALC269_FIXUP_CZC_L101,
7561 ALC269_FIXUP_LEMOTE_A1802,
7562 ALC269_FIXUP_LEMOTE_A190X,
7563 ALC256_FIXUP_INTEL_NUC8_RUGGED,
7564 ALC233_FIXUP_INTEL_NUC8_DMIC,
7565 ALC233_FIXUP_INTEL_NUC8_BOOST,
7566 ALC256_FIXUP_INTEL_NUC10,
7567 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7568 ALC274_FIXUP_HP_MIC,
7569 ALC274_FIXUP_HP_HEADSET_MIC,
7570 ALC274_FIXUP_HP_ENVY_GPIO,
7571 ALC256_FIXUP_ASUS_HPE,
7572 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7573 ALC287_FIXUP_HP_GPIO_LED,
7574 ALC256_FIXUP_HP_HEADSET_MIC,
7575 ALC245_FIXUP_HP_GPIO_LED,
7576 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7577 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7578 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7579 ALC256_FIXUP_ACER_HEADSET_MIC,
7580 ALC285_FIXUP_IDEAPAD_S740_COEF,
7581 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7582 ALC295_FIXUP_ASUS_DACS,
7583 ALC295_FIXUP_HP_OMEN,
7584 ALC285_FIXUP_HP_SPECTRE_X360,
7585 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7586 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7587 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7588 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7589 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7590 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7591 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7592 ALC298_FIXUP_LENOVO_C940_DUET7,
7593 ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
7594 ALC287_FIXUP_13S_GEN2_SPEAKERS,
7595 ALC256_FIXUP_SET_COEF_DEFAULTS,
7596 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7597 ALC233_FIXUP_NO_AUDIO_JACK,
7598 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7599 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7600 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7601 ALC287_FIXUP_LEGION_16ACHG6,
7602 ALC287_FIXUP_CS35L41_I2C_2,
7603 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7604 ALC245_FIXUP_CS35L41_SPI_2,
7605 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7606 ALC245_FIXUP_CS35L41_SPI_4,
7607 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7608 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7609 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7610 ALC287_FIXUP_LEGION_16ITHG6,
7611 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7612 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7613 ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
7614 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7615 ALC236_FIXUP_DELL_DUAL_CODECS,
7616 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
7617 ALC287_FIXUP_TAS2781_I2C,
7618 ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
7619 ALC245_FIXUP_HP_X360_MUTE_LEDS,
7620 ALC287_FIXUP_THINKPAD_I2S_SPK,
7621 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
7622 ALC2XX_FIXUP_HEADSET_MIC,
7623 ALC289_FIXUP_DELL_CS35L41_SPI_2,
7624 ALC294_FIXUP_CS35L41_I2C_2,
7625 };
7626
7627 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7628 * both have the very same PCI SSID, and we need to apply different fixups
7629 * depending on the codec ID
7630 */
alc298_fixup_lenovo_c940_duet7(struct hda_codec * codec,const struct hda_fixup * fix,int action)7631 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7632 const struct hda_fixup *fix,
7633 int action)
7634 {
7635 int id;
7636
7637 if (codec->core.vendor_id == 0x10ec0298)
7638 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7639 else
7640 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7641 __snd_hda_apply_fixup(codec, id, action, 0);
7642 }
7643
7644 /* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
7645 * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
7646 * so we need to apply a different fixup in this case. The only DuetITL codec
7647 * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
7648 * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
7649 * have matched correctly by their codecs.
7650 */
alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec * codec,const struct hda_fixup * fix,int action)7651 static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
7652 const struct hda_fixup *fix,
7653 int action)
7654 {
7655 int id;
7656
7657 if (codec->core.subsystem_id == 0x17aa3802)
7658 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
7659 else
7660 id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
7661 __snd_hda_apply_fixup(codec, id, action, 0);
7662 }
7663
7664 static const struct hda_fixup alc269_fixups[] = {
7665 [ALC269_FIXUP_GPIO2] = {
7666 .type = HDA_FIXUP_FUNC,
7667 .v.func = alc_fixup_gpio2,
7668 },
7669 [ALC269_FIXUP_SONY_VAIO] = {
7670 .type = HDA_FIXUP_PINCTLS,
7671 .v.pins = (const struct hda_pintbl[]) {
7672 {0x19, PIN_VREFGRD},
7673 {}
7674 }
7675 },
7676 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7677 .type = HDA_FIXUP_FUNC,
7678 .v.func = alc275_fixup_gpio4_off,
7679 .chained = true,
7680 .chain_id = ALC269_FIXUP_SONY_VAIO
7681 },
7682 [ALC269_FIXUP_DELL_M101Z] = {
7683 .type = HDA_FIXUP_VERBS,
7684 .v.verbs = (const struct hda_verb[]) {
7685 /* Enables internal speaker */
7686 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7687 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7688 {}
7689 }
7690 },
7691 [ALC269_FIXUP_SKU_IGNORE] = {
7692 .type = HDA_FIXUP_FUNC,
7693 .v.func = alc_fixup_sku_ignore,
7694 },
7695 [ALC269_FIXUP_ASUS_G73JW] = {
7696 .type = HDA_FIXUP_PINS,
7697 .v.pins = (const struct hda_pintbl[]) {
7698 { 0x17, 0x99130111 }, /* subwoofer */
7699 { }
7700 }
7701 },
7702 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7703 .type = HDA_FIXUP_PINS,
7704 .v.pins = (const struct hda_pintbl[]) {
7705 { 0x19, 0x03A11050 },
7706 { 0x1a, 0x03A11C30 },
7707 { 0x21, 0x03211420 },
7708 { }
7709 }
7710 },
7711 [ALC269_FIXUP_ASUS_N7601ZM] = {
7712 .type = HDA_FIXUP_VERBS,
7713 .v.verbs = (const struct hda_verb[]) {
7714 {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7715 {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7716 {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7717 {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7718 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7719 {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7720 { }
7721 },
7722 .chained = true,
7723 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7724 },
7725 [ALC269_FIXUP_LENOVO_EAPD] = {
7726 .type = HDA_FIXUP_VERBS,
7727 .v.verbs = (const struct hda_verb[]) {
7728 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7729 {}
7730 }
7731 },
7732 [ALC275_FIXUP_SONY_HWEQ] = {
7733 .type = HDA_FIXUP_FUNC,
7734 .v.func = alc269_fixup_hweq,
7735 .chained = true,
7736 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7737 },
7738 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7739 .type = HDA_FIXUP_FUNC,
7740 .v.func = alc_fixup_disable_aamix,
7741 .chained = true,
7742 .chain_id = ALC269_FIXUP_SONY_VAIO
7743 },
7744 [ALC271_FIXUP_DMIC] = {
7745 .type = HDA_FIXUP_FUNC,
7746 .v.func = alc271_fixup_dmic,
7747 },
7748 [ALC269_FIXUP_PCM_44K] = {
7749 .type = HDA_FIXUP_FUNC,
7750 .v.func = alc269_fixup_pcm_44k,
7751 .chained = true,
7752 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7753 },
7754 [ALC269_FIXUP_STEREO_DMIC] = {
7755 .type = HDA_FIXUP_FUNC,
7756 .v.func = alc269_fixup_stereo_dmic,
7757 },
7758 [ALC269_FIXUP_HEADSET_MIC] = {
7759 .type = HDA_FIXUP_FUNC,
7760 .v.func = alc269_fixup_headset_mic,
7761 },
7762 [ALC269_FIXUP_QUANTA_MUTE] = {
7763 .type = HDA_FIXUP_FUNC,
7764 .v.func = alc269_fixup_quanta_mute,
7765 },
7766 [ALC269_FIXUP_LIFEBOOK] = {
7767 .type = HDA_FIXUP_PINS,
7768 .v.pins = (const struct hda_pintbl[]) {
7769 { 0x1a, 0x2101103f }, /* dock line-out */
7770 { 0x1b, 0x23a11040 }, /* dock mic-in */
7771 { }
7772 },
7773 .chained = true,
7774 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7775 },
7776 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7777 .type = HDA_FIXUP_PINS,
7778 .v.pins = (const struct hda_pintbl[]) {
7779 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7780 { }
7781 },
7782 },
7783 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7784 .type = HDA_FIXUP_PINS,
7785 .v.pins = (const struct hda_pintbl[]) {
7786 { 0x21, 0x0221102f }, /* HP out */
7787 { }
7788 },
7789 },
7790 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7791 .type = HDA_FIXUP_FUNC,
7792 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7793 },
7794 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7795 .type = HDA_FIXUP_FUNC,
7796 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7797 },
7798 [ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13] = {
7799 .type = HDA_FIXUP_PINS,
7800 .v.pins = (const struct hda_pintbl[]) {
7801 { 0x14, 0x90170151 }, /* use as internal speaker (LFE) */
7802 { 0x1b, 0x90170152 }, /* use as internal speaker (back) */
7803 { }
7804 },
7805 .chained = true,
7806 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7807 },
7808 [ALC269VC_FIXUP_INFINIX_Y4_MAX] = {
7809 .type = HDA_FIXUP_PINS,
7810 .v.pins = (const struct hda_pintbl[]) {
7811 { 0x1b, 0x90170150 }, /* use as internal speaker */
7812 { }
7813 },
7814 .chained = true,
7815 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7816 },
7817 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7818 .type = HDA_FIXUP_PINS,
7819 .v.pins = (const struct hda_pintbl[]) {
7820 { 0x18, 0x03a19020 }, /* headset mic */
7821 { 0x1b, 0x90170150 }, /* speaker */
7822 { }
7823 },
7824 },
7825 [ALC269_FIXUP_AMIC] = {
7826 .type = HDA_FIXUP_PINS,
7827 .v.pins = (const struct hda_pintbl[]) {
7828 { 0x14, 0x99130110 }, /* speaker */
7829 { 0x15, 0x0121401f }, /* HP out */
7830 { 0x18, 0x01a19c20 }, /* mic */
7831 { 0x19, 0x99a3092f }, /* int-mic */
7832 { }
7833 },
7834 },
7835 [ALC269_FIXUP_DMIC] = {
7836 .type = HDA_FIXUP_PINS,
7837 .v.pins = (const struct hda_pintbl[]) {
7838 { 0x12, 0x99a3092f }, /* int-mic */
7839 { 0x14, 0x99130110 }, /* speaker */
7840 { 0x15, 0x0121401f }, /* HP out */
7841 { 0x18, 0x01a19c20 }, /* mic */
7842 { }
7843 },
7844 },
7845 [ALC269VB_FIXUP_AMIC] = {
7846 .type = HDA_FIXUP_PINS,
7847 .v.pins = (const struct hda_pintbl[]) {
7848 { 0x14, 0x99130110 }, /* speaker */
7849 { 0x18, 0x01a19c20 }, /* mic */
7850 { 0x19, 0x99a3092f }, /* int-mic */
7851 { 0x21, 0x0121401f }, /* HP out */
7852 { }
7853 },
7854 },
7855 [ALC269VB_FIXUP_DMIC] = {
7856 .type = HDA_FIXUP_PINS,
7857 .v.pins = (const struct hda_pintbl[]) {
7858 { 0x12, 0x99a3092f }, /* int-mic */
7859 { 0x14, 0x99130110 }, /* speaker */
7860 { 0x18, 0x01a19c20 }, /* mic */
7861 { 0x21, 0x0121401f }, /* HP out */
7862 { }
7863 },
7864 },
7865 [ALC269_FIXUP_HP_MUTE_LED] = {
7866 .type = HDA_FIXUP_FUNC,
7867 .v.func = alc269_fixup_hp_mute_led,
7868 },
7869 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7870 .type = HDA_FIXUP_FUNC,
7871 .v.func = alc269_fixup_hp_mute_led_mic1,
7872 },
7873 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7874 .type = HDA_FIXUP_FUNC,
7875 .v.func = alc269_fixup_hp_mute_led_mic2,
7876 },
7877 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7878 .type = HDA_FIXUP_FUNC,
7879 .v.func = alc269_fixup_hp_mute_led_mic3,
7880 .chained = true,
7881 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7882 },
7883 [ALC269_FIXUP_HP_GPIO_LED] = {
7884 .type = HDA_FIXUP_FUNC,
7885 .v.func = alc269_fixup_hp_gpio_led,
7886 },
7887 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7888 .type = HDA_FIXUP_FUNC,
7889 .v.func = alc269_fixup_hp_gpio_mic1_led,
7890 },
7891 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7892 .type = HDA_FIXUP_FUNC,
7893 .v.func = alc269_fixup_hp_line1_mic1_led,
7894 },
7895 [ALC269_FIXUP_INV_DMIC] = {
7896 .type = HDA_FIXUP_FUNC,
7897 .v.func = alc_fixup_inv_dmic,
7898 },
7899 [ALC269_FIXUP_NO_SHUTUP] = {
7900 .type = HDA_FIXUP_FUNC,
7901 .v.func = alc_fixup_no_shutup,
7902 },
7903 [ALC269_FIXUP_LENOVO_DOCK] = {
7904 .type = HDA_FIXUP_PINS,
7905 .v.pins = (const struct hda_pintbl[]) {
7906 { 0x19, 0x23a11040 }, /* dock mic */
7907 { 0x1b, 0x2121103f }, /* dock headphone */
7908 { }
7909 },
7910 .chained = true,
7911 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7912 },
7913 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7914 .type = HDA_FIXUP_FUNC,
7915 .v.func = alc269_fixup_limit_int_mic_boost,
7916 .chained = true,
7917 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7918 },
7919 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7920 .type = HDA_FIXUP_FUNC,
7921 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7922 .chained = true,
7923 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7924 },
7925 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7926 .type = HDA_FIXUP_PINS,
7927 .v.pins = (const struct hda_pintbl[]) {
7928 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7929 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7930 { }
7931 },
7932 .chained = true,
7933 .chain_id = ALC269_FIXUP_HEADSET_MODE
7934 },
7935 [ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
7936 .type = HDA_FIXUP_FUNC,
7937 .v.func = alc269_fixup_limit_int_mic_boost,
7938 .chained = true,
7939 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7940 },
7941 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7942 .type = HDA_FIXUP_PINS,
7943 .v.pins = (const struct hda_pintbl[]) {
7944 { 0x16, 0x21014020 }, /* dock line out */
7945 { 0x19, 0x21a19030 }, /* dock mic */
7946 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7947 { }
7948 },
7949 .chained = true,
7950 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7951 },
7952 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7953 .type = HDA_FIXUP_PINS,
7954 .v.pins = (const struct hda_pintbl[]) {
7955 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7956 { }
7957 },
7958 .chained = true,
7959 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7960 },
7961 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7962 .type = HDA_FIXUP_PINS,
7963 .v.pins = (const struct hda_pintbl[]) {
7964 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7965 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7966 { }
7967 },
7968 .chained = true,
7969 .chain_id = ALC269_FIXUP_HEADSET_MODE
7970 },
7971 [ALC269_FIXUP_HEADSET_MODE] = {
7972 .type = HDA_FIXUP_FUNC,
7973 .v.func = alc_fixup_headset_mode,
7974 .chained = true,
7975 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7976 },
7977 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7978 .type = HDA_FIXUP_FUNC,
7979 .v.func = alc_fixup_headset_mode_no_hp_mic,
7980 },
7981 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7982 .type = HDA_FIXUP_PINS,
7983 .v.pins = (const struct hda_pintbl[]) {
7984 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7985 { }
7986 },
7987 .chained = true,
7988 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7989 },
7990 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7991 .type = HDA_FIXUP_PINS,
7992 .v.pins = (const struct hda_pintbl[]) {
7993 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7994 { }
7995 },
7996 .chained = true,
7997 .chain_id = ALC269_FIXUP_HEADSET_MIC
7998 },
7999 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8000 .type = HDA_FIXUP_PINS,
8001 .v.pins = (const struct hda_pintbl[]) {
8002 {0x12, 0x90a60130},
8003 {0x13, 0x40000000},
8004 {0x14, 0x90170110},
8005 {0x18, 0x411111f0},
8006 {0x19, 0x04a11040},
8007 {0x1a, 0x411111f0},
8008 {0x1b, 0x90170112},
8009 {0x1d, 0x40759a05},
8010 {0x1e, 0x411111f0},
8011 {0x21, 0x04211020},
8012 { }
8013 },
8014 .chained = true,
8015 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8016 },
8017 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
8018 .type = HDA_FIXUP_FUNC,
8019 .v.func = alc298_fixup_huawei_mbx_stereo,
8020 .chained = true,
8021 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8022 },
8023 [ALC269_FIXUP_ASUS_X101_FUNC] = {
8024 .type = HDA_FIXUP_FUNC,
8025 .v.func = alc269_fixup_x101_headset_mic,
8026 },
8027 [ALC269_FIXUP_ASUS_X101_VERB] = {
8028 .type = HDA_FIXUP_VERBS,
8029 .v.verbs = (const struct hda_verb[]) {
8030 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
8031 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8032 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
8033 { }
8034 },
8035 .chained = true,
8036 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
8037 },
8038 [ALC269_FIXUP_ASUS_X101] = {
8039 .type = HDA_FIXUP_PINS,
8040 .v.pins = (const struct hda_pintbl[]) {
8041 { 0x18, 0x04a1182c }, /* Headset mic */
8042 { }
8043 },
8044 .chained = true,
8045 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
8046 },
8047 [ALC271_FIXUP_AMIC_MIC2] = {
8048 .type = HDA_FIXUP_PINS,
8049 .v.pins = (const struct hda_pintbl[]) {
8050 { 0x14, 0x99130110 }, /* speaker */
8051 { 0x19, 0x01a19c20 }, /* mic */
8052 { 0x1b, 0x99a7012f }, /* int-mic */
8053 { 0x21, 0x0121401f }, /* HP out */
8054 { }
8055 },
8056 },
8057 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
8058 .type = HDA_FIXUP_FUNC,
8059 .v.func = alc271_hp_gate_mic_jack,
8060 .chained = true,
8061 .chain_id = ALC271_FIXUP_AMIC_MIC2,
8062 },
8063 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
8064 .type = HDA_FIXUP_FUNC,
8065 .v.func = alc269_fixup_limit_int_mic_boost,
8066 .chained = true,
8067 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
8068 },
8069 [ALC269_FIXUP_ACER_AC700] = {
8070 .type = HDA_FIXUP_PINS,
8071 .v.pins = (const struct hda_pintbl[]) {
8072 { 0x12, 0x99a3092f }, /* int-mic */
8073 { 0x14, 0x99130110 }, /* speaker */
8074 { 0x18, 0x03a11c20 }, /* mic */
8075 { 0x1e, 0x0346101e }, /* SPDIF1 */
8076 { 0x21, 0x0321101f }, /* HP out */
8077 { }
8078 },
8079 .chained = true,
8080 .chain_id = ALC271_FIXUP_DMIC,
8081 },
8082 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
8083 .type = HDA_FIXUP_FUNC,
8084 .v.func = alc269_fixup_limit_int_mic_boost,
8085 .chained = true,
8086 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8087 },
8088 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
8089 .type = HDA_FIXUP_FUNC,
8090 .v.func = alc269_fixup_limit_int_mic_boost,
8091 .chained = true,
8092 .chain_id = ALC269VB_FIXUP_DMIC,
8093 },
8094 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
8095 .type = HDA_FIXUP_VERBS,
8096 .v.verbs = (const struct hda_verb[]) {
8097 /* class-D output amp +5dB */
8098 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
8099 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
8100 {}
8101 },
8102 .chained = true,
8103 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
8104 },
8105 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8106 .type = HDA_FIXUP_PINS,
8107 .v.pins = (const struct hda_pintbl[]) {
8108 { 0x18, 0x01a110f0 }, /* use as headset mic */
8109 { }
8110 },
8111 .chained = true,
8112 .chain_id = ALC269_FIXUP_HEADSET_MIC
8113 },
8114 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8115 .type = HDA_FIXUP_FUNC,
8116 .v.func = alc269_fixup_limit_int_mic_boost,
8117 .chained = true,
8118 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8119 },
8120 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8121 .type = HDA_FIXUP_PINS,
8122 .v.pins = (const struct hda_pintbl[]) {
8123 { 0x12, 0x99a3092f }, /* int-mic */
8124 { 0x18, 0x03a11d20 }, /* mic */
8125 { 0x19, 0x411111f0 }, /* Unused bogus pin */
8126 { }
8127 },
8128 },
8129 [ALC283_FIXUP_CHROME_BOOK] = {
8130 .type = HDA_FIXUP_FUNC,
8131 .v.func = alc283_fixup_chromebook,
8132 },
8133 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
8134 .type = HDA_FIXUP_FUNC,
8135 .v.func = alc283_fixup_sense_combo_jack,
8136 .chained = true,
8137 .chain_id = ALC283_FIXUP_CHROME_BOOK,
8138 },
8139 [ALC282_FIXUP_ASUS_TX300] = {
8140 .type = HDA_FIXUP_FUNC,
8141 .v.func = alc282_fixup_asus_tx300,
8142 },
8143 [ALC283_FIXUP_INT_MIC] = {
8144 .type = HDA_FIXUP_VERBS,
8145 .v.verbs = (const struct hda_verb[]) {
8146 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8147 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8148 { }
8149 },
8150 .chained = true,
8151 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8152 },
8153 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8154 .type = HDA_FIXUP_PINS,
8155 .v.pins = (const struct hda_pintbl[]) {
8156 { 0x17, 0x90170112 }, /* subwoofer */
8157 { }
8158 },
8159 .chained = true,
8160 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8161 },
8162 [ALC290_FIXUP_SUBWOOFER] = {
8163 .type = HDA_FIXUP_PINS,
8164 .v.pins = (const struct hda_pintbl[]) {
8165 { 0x17, 0x90170112 }, /* subwoofer */
8166 { }
8167 },
8168 .chained = true,
8169 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8170 },
8171 [ALC290_FIXUP_MONO_SPEAKERS] = {
8172 .type = HDA_FIXUP_FUNC,
8173 .v.func = alc290_fixup_mono_speakers,
8174 },
8175 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8176 .type = HDA_FIXUP_FUNC,
8177 .v.func = alc290_fixup_mono_speakers,
8178 .chained = true,
8179 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8180 },
8181 [ALC269_FIXUP_THINKPAD_ACPI] = {
8182 .type = HDA_FIXUP_FUNC,
8183 .v.func = alc_fixup_thinkpad_acpi,
8184 .chained = true,
8185 .chain_id = ALC269_FIXUP_SKU_IGNORE,
8186 },
8187 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8188 .type = HDA_FIXUP_FUNC,
8189 .v.func = alc_fixup_inv_dmic,
8190 .chained = true,
8191 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8192 },
8193 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
8194 .type = HDA_FIXUP_PINS,
8195 .v.pins = (const struct hda_pintbl[]) {
8196 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8197 { }
8198 },
8199 .chained = true,
8200 .chain_id = ALC255_FIXUP_HEADSET_MODE
8201 },
8202 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8203 .type = HDA_FIXUP_PINS,
8204 .v.pins = (const struct hda_pintbl[]) {
8205 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8206 { }
8207 },
8208 .chained = true,
8209 .chain_id = ALC255_FIXUP_HEADSET_MODE
8210 },
8211 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8212 .type = HDA_FIXUP_PINS,
8213 .v.pins = (const struct hda_pintbl[]) {
8214 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8215 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8216 { }
8217 },
8218 .chained = true,
8219 .chain_id = ALC255_FIXUP_HEADSET_MODE
8220 },
8221 [ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
8222 .type = HDA_FIXUP_FUNC,
8223 .v.func = alc269_fixup_limit_int_mic_boost,
8224 .chained = true,
8225 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8226 },
8227 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8228 .type = HDA_FIXUP_PINS,
8229 .v.pins = (const struct hda_pintbl[]) {
8230 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8231 { }
8232 },
8233 .chained = true,
8234 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8235 },
8236 [ALC255_FIXUP_HEADSET_MODE] = {
8237 .type = HDA_FIXUP_FUNC,
8238 .v.func = alc_fixup_headset_mode_alc255,
8239 .chained = true,
8240 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8241 },
8242 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8243 .type = HDA_FIXUP_FUNC,
8244 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8245 },
8246 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8247 .type = HDA_FIXUP_PINS,
8248 .v.pins = (const struct hda_pintbl[]) {
8249 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8250 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8251 { }
8252 },
8253 .chained = true,
8254 .chain_id = ALC269_FIXUP_HEADSET_MODE
8255 },
8256 [ALC292_FIXUP_TPT440_DOCK] = {
8257 .type = HDA_FIXUP_FUNC,
8258 .v.func = alc_fixup_tpt440_dock,
8259 .chained = true,
8260 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8261 },
8262 [ALC292_FIXUP_TPT440] = {
8263 .type = HDA_FIXUP_FUNC,
8264 .v.func = alc_fixup_disable_aamix,
8265 .chained = true,
8266 .chain_id = ALC292_FIXUP_TPT440_DOCK,
8267 },
8268 [ALC283_FIXUP_HEADSET_MIC] = {
8269 .type = HDA_FIXUP_PINS,
8270 .v.pins = (const struct hda_pintbl[]) {
8271 { 0x19, 0x04a110f0 },
8272 { },
8273 },
8274 },
8275 [ALC255_FIXUP_MIC_MUTE_LED] = {
8276 .type = HDA_FIXUP_FUNC,
8277 .v.func = alc_fixup_micmute_led,
8278 },
8279 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
8280 .type = HDA_FIXUP_PINS,
8281 .v.pins = (const struct hda_pintbl[]) {
8282 { 0x12, 0x90a60130 },
8283 { 0x14, 0x90170110 },
8284 { 0x17, 0x40000008 },
8285 { 0x18, 0x411111f0 },
8286 { 0x19, 0x01a1913c },
8287 { 0x1a, 0x411111f0 },
8288 { 0x1b, 0x411111f0 },
8289 { 0x1d, 0x40f89b2d },
8290 { 0x1e, 0x411111f0 },
8291 { 0x21, 0x0321101f },
8292 { },
8293 },
8294 },
8295 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8296 .type = HDA_FIXUP_FUNC,
8297 .v.func = alc269vb_fixup_aspire_e1_coef,
8298 },
8299 [ALC280_FIXUP_HP_GPIO4] = {
8300 .type = HDA_FIXUP_FUNC,
8301 .v.func = alc280_fixup_hp_gpio4,
8302 },
8303 [ALC286_FIXUP_HP_GPIO_LED] = {
8304 .type = HDA_FIXUP_FUNC,
8305 .v.func = alc286_fixup_hp_gpio_led,
8306 },
8307 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8308 .type = HDA_FIXUP_FUNC,
8309 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8310 },
8311 [ALC280_FIXUP_HP_DOCK_PINS] = {
8312 .type = HDA_FIXUP_PINS,
8313 .v.pins = (const struct hda_pintbl[]) {
8314 { 0x1b, 0x21011020 }, /* line-out */
8315 { 0x1a, 0x01a1903c }, /* headset mic */
8316 { 0x18, 0x2181103f }, /* line-in */
8317 { },
8318 },
8319 .chained = true,
8320 .chain_id = ALC280_FIXUP_HP_GPIO4
8321 },
8322 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8323 .type = HDA_FIXUP_PINS,
8324 .v.pins = (const struct hda_pintbl[]) {
8325 { 0x1b, 0x21011020 }, /* line-out */
8326 { 0x18, 0x2181103f }, /* line-in */
8327 { },
8328 },
8329 .chained = true,
8330 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8331 },
8332 [ALC280_FIXUP_HP_9480M] = {
8333 .type = HDA_FIXUP_FUNC,
8334 .v.func = alc280_fixup_hp_9480m,
8335 },
8336 [ALC245_FIXUP_HP_X360_AMP] = {
8337 .type = HDA_FIXUP_FUNC,
8338 .v.func = alc245_fixup_hp_x360_amp,
8339 .chained = true,
8340 .chain_id = ALC245_FIXUP_HP_GPIO_LED
8341 },
8342 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
8343 .type = HDA_FIXUP_FUNC,
8344 .v.func = alc_fixup_headset_mode_dell_alc288,
8345 .chained = true,
8346 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8347 },
8348 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8349 .type = HDA_FIXUP_PINS,
8350 .v.pins = (const struct hda_pintbl[]) {
8351 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8352 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8353 { }
8354 },
8355 .chained = true,
8356 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8357 },
8358 [ALC288_FIXUP_DISABLE_AAMIX] = {
8359 .type = HDA_FIXUP_FUNC,
8360 .v.func = alc_fixup_disable_aamix,
8361 .chained = true,
8362 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
8363 },
8364 [ALC288_FIXUP_DELL_XPS_13] = {
8365 .type = HDA_FIXUP_FUNC,
8366 .v.func = alc_fixup_dell_xps13,
8367 .chained = true,
8368 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
8369 },
8370 [ALC292_FIXUP_DISABLE_AAMIX] = {
8371 .type = HDA_FIXUP_FUNC,
8372 .v.func = alc_fixup_disable_aamix,
8373 .chained = true,
8374 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8375 },
8376 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8377 .type = HDA_FIXUP_FUNC,
8378 .v.func = alc_fixup_disable_aamix,
8379 .chained = true,
8380 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8381 },
8382 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8383 .type = HDA_FIXUP_FUNC,
8384 .v.func = alc_fixup_dell_xps13,
8385 .chained = true,
8386 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
8387 },
8388 [ALC292_FIXUP_DELL_E7X] = {
8389 .type = HDA_FIXUP_FUNC,
8390 .v.func = alc_fixup_micmute_led,
8391 /* micmute fixup must be applied at last */
8392 .chained_before = true,
8393 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8394 },
8395 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8396 .type = HDA_FIXUP_PINS,
8397 .v.pins = (const struct hda_pintbl[]) {
8398 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8399 { }
8400 },
8401 .chained_before = true,
8402 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8403 },
8404 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8405 .type = HDA_FIXUP_PINS,
8406 .v.pins = (const struct hda_pintbl[]) {
8407 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8408 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8409 { }
8410 },
8411 .chained = true,
8412 .chain_id = ALC269_FIXUP_HEADSET_MODE
8413 },
8414 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8415 .type = HDA_FIXUP_PINS,
8416 .v.pins = (const struct hda_pintbl[]) {
8417 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8418 { }
8419 },
8420 .chained = true,
8421 .chain_id = ALC269_FIXUP_HEADSET_MODE
8422 },
8423 [ALC275_FIXUP_DELL_XPS] = {
8424 .type = HDA_FIXUP_VERBS,
8425 .v.verbs = (const struct hda_verb[]) {
8426 /* Enables internal speaker */
8427 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8428 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8429 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8430 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8431 {}
8432 }
8433 },
8434 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8435 .type = HDA_FIXUP_FUNC,
8436 .v.func = alc_fixup_disable_aamix,
8437 .chained = true,
8438 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8439 },
8440 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8441 .type = HDA_FIXUP_FUNC,
8442 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8443 },
8444 [ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED] = {
8445 .type = HDA_FIXUP_FUNC,
8446 .v.func = alc233_fixup_lenovo_low_en_micmute_led,
8447 },
8448 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8449 .type = HDA_FIXUP_FUNC,
8450 .v.func = alc_fixup_inv_dmic,
8451 .chained = true,
8452 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8453 },
8454 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8455 .type = HDA_FIXUP_FUNC,
8456 .v.func = alc269_fixup_limit_int_mic_boost
8457 },
8458 [ALC255_FIXUP_DELL_SPK_NOISE] = {
8459 .type = HDA_FIXUP_FUNC,
8460 .v.func = alc_fixup_disable_aamix,
8461 .chained = true,
8462 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8463 },
8464 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
8465 .type = HDA_FIXUP_FUNC,
8466 .v.func = alc_fixup_disable_mic_vref,
8467 .chained = true,
8468 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8469 },
8470 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8471 .type = HDA_FIXUP_VERBS,
8472 .v.verbs = (const struct hda_verb[]) {
8473 /* Disable pass-through path for FRONT 14h */
8474 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8475 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8476 {}
8477 },
8478 .chained = true,
8479 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8480 },
8481 [ALC280_FIXUP_HP_HEADSET_MIC] = {
8482 .type = HDA_FIXUP_FUNC,
8483 .v.func = alc_fixup_disable_aamix,
8484 .chained = true,
8485 .chain_id = ALC269_FIXUP_HEADSET_MIC,
8486 },
8487 [ALC221_FIXUP_HP_FRONT_MIC] = {
8488 .type = HDA_FIXUP_PINS,
8489 .v.pins = (const struct hda_pintbl[]) {
8490 { 0x19, 0x02a19020 }, /* Front Mic */
8491 { }
8492 },
8493 },
8494 [ALC292_FIXUP_TPT460] = {
8495 .type = HDA_FIXUP_FUNC,
8496 .v.func = alc_fixup_tpt440_dock,
8497 .chained = true,
8498 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8499 },
8500 [ALC298_FIXUP_SPK_VOLUME] = {
8501 .type = HDA_FIXUP_FUNC,
8502 .v.func = alc298_fixup_speaker_volume,
8503 .chained = true,
8504 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8505 },
8506 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8507 .type = HDA_FIXUP_FUNC,
8508 .v.func = alc298_fixup_speaker_volume,
8509 },
8510 [ALC295_FIXUP_DISABLE_DAC3] = {
8511 .type = HDA_FIXUP_FUNC,
8512 .v.func = alc295_fixup_disable_dac3,
8513 },
8514 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8515 .type = HDA_FIXUP_FUNC,
8516 .v.func = alc285_fixup_speaker2_to_dac1,
8517 .chained = true,
8518 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8519 },
8520 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8521 .type = HDA_FIXUP_FUNC,
8522 .v.func = alc285_fixup_speaker2_to_dac1,
8523 .chained = true,
8524 .chain_id = ALC245_FIXUP_CS35L41_SPI_2
8525 },
8526 [ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8527 .type = HDA_FIXUP_PINS,
8528 .v.pins = (const struct hda_pintbl[]) {
8529 { 0x19, 0x03a11050 },
8530 { 0x1b, 0x03a11c30 },
8531 { }
8532 },
8533 .chained = true,
8534 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8535 },
8536 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8537 .type = HDA_FIXUP_PINS,
8538 .v.pins = (const struct hda_pintbl[]) {
8539 { 0x14, 0x90170120 },
8540 { }
8541 },
8542 .chained = true,
8543 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8544 },
8545 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8546 .type = HDA_FIXUP_FUNC,
8547 .v.func = alc285_fixup_speaker2_to_dac1,
8548 .chained = true,
8549 .chain_id = ALC287_FIXUP_CS35L41_I2C_2
8550 },
8551 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8552 .type = HDA_FIXUP_PINS,
8553 .v.pins = (const struct hda_pintbl[]) {
8554 { 0x19, 0x03a11050 },
8555 { 0x1b, 0x03a11c30 },
8556 { }
8557 },
8558 .chained = true,
8559 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8560 },
8561 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8562 .type = HDA_FIXUP_PINS,
8563 .v.pins = (const struct hda_pintbl[]) {
8564 { 0x1b, 0x90170151 },
8565 { }
8566 },
8567 .chained = true,
8568 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8569 },
8570 [ALC269_FIXUP_ATIV_BOOK_8] = {
8571 .type = HDA_FIXUP_FUNC,
8572 .v.func = alc_fixup_auto_mute_via_amp,
8573 .chained = true,
8574 .chain_id = ALC269_FIXUP_NO_SHUTUP
8575 },
8576 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8577 .type = HDA_FIXUP_PINS,
8578 .v.pins = (const struct hda_pintbl[]) {
8579 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8580 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8581 { }
8582 },
8583 .chained = true,
8584 .chain_id = ALC269_FIXUP_HEADSET_MODE
8585 },
8586 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8587 .type = HDA_FIXUP_PINS,
8588 .v.pins = (const struct hda_pintbl[]) {
8589 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8590 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8591 { }
8592 },
8593 .chained = true,
8594 .chain_id = ALC269_FIXUP_HEADSET_MODE
8595 },
8596 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8597 .type = HDA_FIXUP_FUNC,
8598 .v.func = alc_fixup_headset_mode,
8599 },
8600 [ALC256_FIXUP_ASUS_MIC] = {
8601 .type = HDA_FIXUP_PINS,
8602 .v.pins = (const struct hda_pintbl[]) {
8603 { 0x13, 0x90a60160 }, /* use as internal mic */
8604 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8605 { }
8606 },
8607 .chained = true,
8608 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8609 },
8610 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8611 .type = HDA_FIXUP_FUNC,
8612 /* Set up GPIO2 for the speaker amp */
8613 .v.func = alc_fixup_gpio4,
8614 },
8615 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8616 .type = HDA_FIXUP_PINS,
8617 .v.pins = (const struct hda_pintbl[]) {
8618 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8619 { }
8620 },
8621 .chained = true,
8622 .chain_id = ALC269_FIXUP_HEADSET_MIC
8623 },
8624 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8625 .type = HDA_FIXUP_VERBS,
8626 .v.verbs = (const struct hda_verb[]) {
8627 /* Enables internal speaker */
8628 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8629 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8630 {}
8631 },
8632 .chained = true,
8633 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8634 },
8635 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8636 .type = HDA_FIXUP_FUNC,
8637 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8638 .chained = true,
8639 .chain_id = ALC269_FIXUP_GPIO2
8640 },
8641 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
8642 .type = HDA_FIXUP_VERBS,
8643 .v.verbs = (const struct hda_verb[]) {
8644 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8645 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8646 { }
8647 },
8648 .chained = true,
8649 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8650 },
8651 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8652 .type = HDA_FIXUP_PINS,
8653 .v.pins = (const struct hda_pintbl[]) {
8654 /* Change the mic location from front to right, otherwise there are
8655 two front mics with the same name, pulseaudio can't handle them.
8656 This is just a temporary workaround, after applying this fixup,
8657 there will be one "Front Mic" and one "Mic" in this machine.
8658 */
8659 { 0x1a, 0x04a19040 },
8660 { }
8661 },
8662 },
8663 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8664 .type = HDA_FIXUP_PINS,
8665 .v.pins = (const struct hda_pintbl[]) {
8666 { 0x16, 0x0101102f }, /* Rear Headset HP */
8667 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8668 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8669 { 0x1b, 0x02011020 },
8670 { }
8671 },
8672 .chained = true,
8673 .chain_id = ALC225_FIXUP_S3_POP_NOISE
8674 },
8675 [ALC225_FIXUP_S3_POP_NOISE] = {
8676 .type = HDA_FIXUP_FUNC,
8677 .v.func = alc225_fixup_s3_pop_noise,
8678 .chained = true,
8679 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8680 },
8681 [ALC700_FIXUP_INTEL_REFERENCE] = {
8682 .type = HDA_FIXUP_VERBS,
8683 .v.verbs = (const struct hda_verb[]) {
8684 /* Enables internal speaker */
8685 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8686 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8687 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8688 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8689 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8690 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8691 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8692 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8693 {}
8694 }
8695 },
8696 [ALC274_FIXUP_DELL_BIND_DACS] = {
8697 .type = HDA_FIXUP_FUNC,
8698 .v.func = alc274_fixup_bind_dacs,
8699 .chained = true,
8700 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8701 },
8702 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8703 .type = HDA_FIXUP_PINS,
8704 .v.pins = (const struct hda_pintbl[]) {
8705 { 0x1b, 0x0401102f },
8706 { }
8707 },
8708 .chained = true,
8709 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
8710 },
8711 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
8712 .type = HDA_FIXUP_FUNC,
8713 .v.func = alc_fixup_tpt470_dock,
8714 .chained = true,
8715 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8716 },
8717 [ALC298_FIXUP_TPT470_DOCK] = {
8718 .type = HDA_FIXUP_FUNC,
8719 .v.func = alc_fixup_tpt470_dacs,
8720 .chained = true,
8721 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8722 },
8723 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8724 .type = HDA_FIXUP_PINS,
8725 .v.pins = (const struct hda_pintbl[]) {
8726 { 0x14, 0x0201101f },
8727 { }
8728 },
8729 .chained = true,
8730 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8731 },
8732 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
8733 .type = HDA_FIXUP_PINS,
8734 .v.pins = (const struct hda_pintbl[]) {
8735 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8736 { }
8737 },
8738 .chained = true,
8739 .chain_id = ALC269_FIXUP_HEADSET_MIC
8740 },
8741 [ALC295_FIXUP_HP_X360] = {
8742 .type = HDA_FIXUP_FUNC,
8743 .v.func = alc295_fixup_hp_top_speakers,
8744 .chained = true,
8745 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8746 },
8747 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8748 .type = HDA_FIXUP_PINS,
8749 .v.pins = (const struct hda_pintbl[]) {
8750 { 0x19, 0x0181313f},
8751 { }
8752 },
8753 .chained = true,
8754 .chain_id = ALC269_FIXUP_HEADSET_MIC
8755 },
8756 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8757 .type = HDA_FIXUP_FUNC,
8758 .v.func = alc285_fixup_invalidate_dacs,
8759 .chained = true,
8760 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8761 },
8762 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8763 .type = HDA_FIXUP_FUNC,
8764 .v.func = alc_fixup_auto_mute_via_amp,
8765 },
8766 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8767 .type = HDA_FIXUP_PINS,
8768 .v.pins = (const struct hda_pintbl[]) {
8769 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8770 { }
8771 },
8772 .chained = true,
8773 .chain_id = ALC269_FIXUP_HEADSET_MIC
8774 },
8775 [ALC294_FIXUP_ASUS_MIC] = {
8776 .type = HDA_FIXUP_PINS,
8777 .v.pins = (const struct hda_pintbl[]) {
8778 { 0x13, 0x90a60160 }, /* use as internal mic */
8779 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8780 { }
8781 },
8782 .chained = true,
8783 .chain_id = ALC269_FIXUP_HEADSET_MIC
8784 },
8785 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8786 .type = HDA_FIXUP_PINS,
8787 .v.pins = (const struct hda_pintbl[]) {
8788 { 0x19, 0x01a1103c }, /* use as headset mic */
8789 { }
8790 },
8791 .chained = true,
8792 .chain_id = ALC269_FIXUP_HEADSET_MIC
8793 },
8794 [ALC294_FIXUP_ASUS_SPK] = {
8795 .type = HDA_FIXUP_VERBS,
8796 .v.verbs = (const struct hda_verb[]) {
8797 /* Set EAPD high */
8798 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8799 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8800 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8801 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8802 { }
8803 },
8804 .chained = true,
8805 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8806 },
8807 [ALC295_FIXUP_CHROME_BOOK] = {
8808 .type = HDA_FIXUP_FUNC,
8809 .v.func = alc295_fixup_chromebook,
8810 .chained = true,
8811 .chain_id = ALC225_FIXUP_HEADSET_JACK
8812 },
8813 [ALC225_FIXUP_HEADSET_JACK] = {
8814 .type = HDA_FIXUP_FUNC,
8815 .v.func = alc_fixup_headset_jack,
8816 },
8817 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8818 .type = HDA_FIXUP_PINS,
8819 .v.pins = (const struct hda_pintbl[]) {
8820 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8821 { }
8822 },
8823 .chained = true,
8824 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8825 },
8826 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8827 .type = HDA_FIXUP_VERBS,
8828 .v.verbs = (const struct hda_verb[]) {
8829 /* Disable PCBEEP-IN passthrough */
8830 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8831 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8832 { }
8833 },
8834 .chained = true,
8835 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8836 },
8837 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8838 .type = HDA_FIXUP_PINS,
8839 .v.pins = (const struct hda_pintbl[]) {
8840 { 0x19, 0x03a11130 },
8841 { 0x1a, 0x90a60140 }, /* use as internal mic */
8842 { }
8843 },
8844 .chained = true,
8845 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8846 },
8847 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8848 .type = HDA_FIXUP_PINS,
8849 .v.pins = (const struct hda_pintbl[]) {
8850 { 0x16, 0x01011020 }, /* Rear Line out */
8851 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8852 { }
8853 },
8854 .chained = true,
8855 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8856 },
8857 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8858 .type = HDA_FIXUP_FUNC,
8859 .v.func = alc_fixup_auto_mute_via_amp,
8860 .chained = true,
8861 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8862 },
8863 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8864 .type = HDA_FIXUP_FUNC,
8865 .v.func = alc_fixup_disable_mic_vref,
8866 .chained = true,
8867 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8868 },
8869 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8870 .type = HDA_FIXUP_VERBS,
8871 .v.verbs = (const struct hda_verb[]) {
8872 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8873 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8874 { }
8875 },
8876 .chained = true,
8877 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8878 },
8879 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8880 .type = HDA_FIXUP_PINS,
8881 .v.pins = (const struct hda_pintbl[]) {
8882 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8883 { }
8884 },
8885 .chained = true,
8886 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8887 },
8888 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8889 .type = HDA_FIXUP_PINS,
8890 .v.pins = (const struct hda_pintbl[]) {
8891 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8892 { }
8893 },
8894 .chained = true,
8895 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8896 },
8897 [ALC255_FIXUP_PREDATOR_SUBWOOFER] = {
8898 .type = HDA_FIXUP_PINS,
8899 .v.pins = (const struct hda_pintbl[]) {
8900 { 0x17, 0x90170151 }, /* use as internal speaker (LFE) */
8901 { 0x1b, 0x90170152 } /* use as internal speaker (back) */
8902 }
8903 },
8904 [ALC299_FIXUP_PREDATOR_SPK] = {
8905 .type = HDA_FIXUP_PINS,
8906 .v.pins = (const struct hda_pintbl[]) {
8907 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8908 { }
8909 }
8910 },
8911 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8912 .type = HDA_FIXUP_PINS,
8913 .v.pins = (const struct hda_pintbl[]) {
8914 { 0x19, 0x04a11040 },
8915 { 0x21, 0x04211020 },
8916 { }
8917 },
8918 .chained = true,
8919 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8920 },
8921 [ALC289_FIXUP_DELL_SPK1] = {
8922 .type = HDA_FIXUP_PINS,
8923 .v.pins = (const struct hda_pintbl[]) {
8924 { 0x14, 0x90170140 },
8925 { }
8926 },
8927 .chained = true,
8928 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8929 },
8930 [ALC289_FIXUP_DELL_SPK2] = {
8931 .type = HDA_FIXUP_PINS,
8932 .v.pins = (const struct hda_pintbl[]) {
8933 { 0x17, 0x90170130 }, /* bass spk */
8934 { }
8935 },
8936 .chained = true,
8937 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8938 },
8939 [ALC289_FIXUP_DUAL_SPK] = {
8940 .type = HDA_FIXUP_FUNC,
8941 .v.func = alc285_fixup_speaker2_to_dac1,
8942 .chained = true,
8943 .chain_id = ALC289_FIXUP_DELL_SPK2
8944 },
8945 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
8946 .type = HDA_FIXUP_FUNC,
8947 .v.func = alc285_fixup_speaker2_to_dac1,
8948 .chained = true,
8949 .chain_id = ALC289_FIXUP_DELL_SPK1
8950 },
8951 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8952 .type = HDA_FIXUP_FUNC,
8953 .v.func = alc285_fixup_speaker2_to_dac1,
8954 .chained = true,
8955 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8956 },
8957 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8958 .type = HDA_FIXUP_FUNC,
8959 /* The GPIO must be pulled to initialize the AMP */
8960 .v.func = alc_fixup_gpio4,
8961 .chained = true,
8962 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8963 },
8964 [ALC294_FIXUP_ASUS_ALLY] = {
8965 .type = HDA_FIXUP_FUNC,
8966 .v.func = cs35l41_fixup_i2c_two,
8967 .chained = true,
8968 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8969 },
8970 [ALC294_FIXUP_ASUS_ALLY_PINS] = {
8971 .type = HDA_FIXUP_PINS,
8972 .v.pins = (const struct hda_pintbl[]) {
8973 { 0x19, 0x03a11050 },
8974 { 0x1a, 0x03a11c30 },
8975 { 0x21, 0x03211420 },
8976 { }
8977 },
8978 .chained = true,
8979 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8980 },
8981 [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
8982 .type = HDA_FIXUP_VERBS,
8983 .v.verbs = (const struct hda_verb[]) {
8984 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8985 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8986 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
8987 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
8988 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
8989 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
8990 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
8991 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
8992 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
8993 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
8994 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
8995 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
8996 { }
8997 },
8998 .chained = true,
8999 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
9000 },
9001 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
9002 .type = HDA_FIXUP_FUNC,
9003 .v.func = alc285_fixup_speaker2_to_dac1,
9004 },
9005 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
9006 .type = HDA_FIXUP_FUNC,
9007 .v.func = alc285_fixup_thinkpad_x1_gen7,
9008 .chained = true,
9009 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9010 },
9011 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
9012 .type = HDA_FIXUP_FUNC,
9013 .v.func = alc_fixup_headset_jack,
9014 .chained = true,
9015 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
9016 },
9017 [ALC294_FIXUP_ASUS_HPE] = {
9018 .type = HDA_FIXUP_VERBS,
9019 .v.verbs = (const struct hda_verb[]) {
9020 /* Set EAPD high */
9021 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9022 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
9023 { }
9024 },
9025 .chained = true,
9026 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9027 },
9028 [ALC294_FIXUP_ASUS_GX502_PINS] = {
9029 .type = HDA_FIXUP_PINS,
9030 .v.pins = (const struct hda_pintbl[]) {
9031 { 0x19, 0x03a11050 }, /* front HP mic */
9032 { 0x1a, 0x01a11830 }, /* rear external mic */
9033 { 0x21, 0x03211020 }, /* front HP out */
9034 { }
9035 },
9036 .chained = true,
9037 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
9038 },
9039 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
9040 .type = HDA_FIXUP_VERBS,
9041 .v.verbs = (const struct hda_verb[]) {
9042 /* set 0x15 to HP-OUT ctrl */
9043 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9044 /* unmute the 0x15 amp */
9045 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9046 { }
9047 },
9048 .chained = true,
9049 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
9050 },
9051 [ALC294_FIXUP_ASUS_GX502_HP] = {
9052 .type = HDA_FIXUP_FUNC,
9053 .v.func = alc294_fixup_gx502_hp,
9054 },
9055 [ALC294_FIXUP_ASUS_GU502_PINS] = {
9056 .type = HDA_FIXUP_PINS,
9057 .v.pins = (const struct hda_pintbl[]) {
9058 { 0x19, 0x01a11050 }, /* rear HP mic */
9059 { 0x1a, 0x01a11830 }, /* rear external mic */
9060 { 0x21, 0x012110f0 }, /* rear HP out */
9061 { }
9062 },
9063 .chained = true,
9064 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
9065 },
9066 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
9067 .type = HDA_FIXUP_VERBS,
9068 .v.verbs = (const struct hda_verb[]) {
9069 /* set 0x15 to HP-OUT ctrl */
9070 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9071 /* unmute the 0x15 amp */
9072 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9073 /* set 0x1b to HP-OUT */
9074 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
9075 { }
9076 },
9077 .chained = true,
9078 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
9079 },
9080 [ALC294_FIXUP_ASUS_GU502_HP] = {
9081 .type = HDA_FIXUP_FUNC,
9082 .v.func = alc294_fixup_gu502_hp,
9083 },
9084 [ALC294_FIXUP_ASUS_G513_PINS] = {
9085 .type = HDA_FIXUP_PINS,
9086 .v.pins = (const struct hda_pintbl[]) {
9087 { 0x19, 0x03a11050 }, /* front HP mic */
9088 { 0x1a, 0x03a11c30 }, /* rear external mic */
9089 { 0x21, 0x03211420 }, /* front HP out */
9090 { }
9091 },
9092 },
9093 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
9094 .type = HDA_FIXUP_PINS,
9095 .v.pins = (const struct hda_pintbl[]) {
9096 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
9097 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
9098 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
9099 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
9100 { 0x21, 0x03211420 },
9101 { }
9102 },
9103 },
9104 [ALC294_FIXUP_ASUS_COEF_1B] = {
9105 .type = HDA_FIXUP_VERBS,
9106 .v.verbs = (const struct hda_verb[]) {
9107 /* Set bit 10 to correct noisy output after reboot from
9108 * Windows 10 (due to pop noise reduction?)
9109 */
9110 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
9111 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
9112 { }
9113 },
9114 .chained = true,
9115 .chain_id = ALC289_FIXUP_ASUS_GA401,
9116 },
9117 [ALC285_FIXUP_HP_GPIO_LED] = {
9118 .type = HDA_FIXUP_FUNC,
9119 .v.func = alc285_fixup_hp_gpio_led,
9120 },
9121 [ALC285_FIXUP_HP_MUTE_LED] = {
9122 .type = HDA_FIXUP_FUNC,
9123 .v.func = alc285_fixup_hp_mute_led,
9124 },
9125 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
9126 .type = HDA_FIXUP_FUNC,
9127 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
9128 },
9129 [ALC285_FIXUP_HP_BEEP_MICMUTE_LED] = {
9130 .type = HDA_FIXUP_FUNC,
9131 .v.func = alc285_fixup_hp_beep,
9132 .chained = true,
9133 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9134 },
9135 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
9136 .type = HDA_FIXUP_FUNC,
9137 .v.func = alc236_fixup_hp_mute_led_coefbit2,
9138 },
9139 [ALC236_FIXUP_HP_GPIO_LED] = {
9140 .type = HDA_FIXUP_FUNC,
9141 .v.func = alc236_fixup_hp_gpio_led,
9142 },
9143 [ALC236_FIXUP_HP_MUTE_LED] = {
9144 .type = HDA_FIXUP_FUNC,
9145 .v.func = alc236_fixup_hp_mute_led,
9146 },
9147 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9148 .type = HDA_FIXUP_FUNC,
9149 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
9150 },
9151 [ALC236_FIXUP_LENOVO_INV_DMIC] = {
9152 .type = HDA_FIXUP_FUNC,
9153 .v.func = alc_fixup_inv_dmic,
9154 .chained = true,
9155 .chain_id = ALC283_FIXUP_INT_MIC,
9156 },
9157 [ALC295_FIXUP_HP_MUTE_LED_COEFBIT11] = {
9158 .type = HDA_FIXUP_FUNC,
9159 .v.func = alc295_fixup_hp_mute_led_coefbit11,
9160 },
9161 [ALC298_FIXUP_SAMSUNG_AMP] = {
9162 .type = HDA_FIXUP_FUNC,
9163 .v.func = alc298_fixup_samsung_amp,
9164 .chained = true,
9165 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9166 },
9167 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9168 .type = HDA_FIXUP_VERBS,
9169 .v.verbs = (const struct hda_verb[]) {
9170 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9171 { }
9172 },
9173 },
9174 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9175 .type = HDA_FIXUP_VERBS,
9176 .v.verbs = (const struct hda_verb[]) {
9177 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9178 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9179 { }
9180 },
9181 },
9182 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9183 .type = HDA_FIXUP_PINS,
9184 .v.pins = (const struct hda_pintbl[]) {
9185 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9186 { }
9187 },
9188 .chained = true,
9189 .chain_id = ALC269_FIXUP_HEADSET_MODE
9190 },
9191 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9192 .type = HDA_FIXUP_PINS,
9193 .v.pins = (const struct hda_pintbl[]) {
9194 { 0x14, 0x90100120 }, /* use as internal speaker */
9195 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9196 { 0x1a, 0x01011020 }, /* use as line out */
9197 { },
9198 },
9199 .chained = true,
9200 .chain_id = ALC269_FIXUP_HEADSET_MIC
9201 },
9202 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9203 .type = HDA_FIXUP_PINS,
9204 .v.pins = (const struct hda_pintbl[]) {
9205 { 0x18, 0x02a11030 }, /* use as headset mic */
9206 { }
9207 },
9208 .chained = true,
9209 .chain_id = ALC269_FIXUP_HEADSET_MIC
9210 },
9211 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9212 .type = HDA_FIXUP_PINS,
9213 .v.pins = (const struct hda_pintbl[]) {
9214 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9215 { }
9216 },
9217 .chained = true,
9218 .chain_id = ALC269_FIXUP_HEADSET_MIC
9219 },
9220 [ALC289_FIXUP_ASUS_GA401] = {
9221 .type = HDA_FIXUP_FUNC,
9222 .v.func = alc289_fixup_asus_ga401,
9223 .chained = true,
9224 .chain_id = ALC289_FIXUP_ASUS_GA502,
9225 },
9226 [ALC289_FIXUP_ASUS_GA502] = {
9227 .type = HDA_FIXUP_PINS,
9228 .v.pins = (const struct hda_pintbl[]) {
9229 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
9230 { }
9231 },
9232 },
9233 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9234 .type = HDA_FIXUP_PINS,
9235 .v.pins = (const struct hda_pintbl[]) {
9236 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9237 { }
9238 },
9239 .chained = true,
9240 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9241 },
9242 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9243 .type = HDA_FIXUP_FUNC,
9244 .v.func = alc285_fixup_hp_gpio_amp_init,
9245 .chained = true,
9246 .chain_id = ALC285_FIXUP_HP_GPIO_LED
9247 },
9248 [ALC269_FIXUP_CZC_B20] = {
9249 .type = HDA_FIXUP_PINS,
9250 .v.pins = (const struct hda_pintbl[]) {
9251 { 0x12, 0x411111f0 },
9252 { 0x14, 0x90170110 }, /* speaker */
9253 { 0x15, 0x032f1020 }, /* HP out */
9254 { 0x17, 0x411111f0 },
9255 { 0x18, 0x03ab1040 }, /* mic */
9256 { 0x19, 0xb7a7013f },
9257 { 0x1a, 0x0181305f },
9258 { 0x1b, 0x411111f0 },
9259 { 0x1d, 0x411111f0 },
9260 { 0x1e, 0x411111f0 },
9261 { }
9262 },
9263 .chain_id = ALC269_FIXUP_DMIC,
9264 },
9265 [ALC269_FIXUP_CZC_TMI] = {
9266 .type = HDA_FIXUP_PINS,
9267 .v.pins = (const struct hda_pintbl[]) {
9268 { 0x12, 0x4000c000 },
9269 { 0x14, 0x90170110 }, /* speaker */
9270 { 0x15, 0x0421401f }, /* HP out */
9271 { 0x17, 0x411111f0 },
9272 { 0x18, 0x04a19020 }, /* mic */
9273 { 0x19, 0x411111f0 },
9274 { 0x1a, 0x411111f0 },
9275 { 0x1b, 0x411111f0 },
9276 { 0x1d, 0x40448505 },
9277 { 0x1e, 0x411111f0 },
9278 { 0x20, 0x8000ffff },
9279 { }
9280 },
9281 .chain_id = ALC269_FIXUP_DMIC,
9282 },
9283 [ALC269_FIXUP_CZC_L101] = {
9284 .type = HDA_FIXUP_PINS,
9285 .v.pins = (const struct hda_pintbl[]) {
9286 { 0x12, 0x40000000 },
9287 { 0x14, 0x01014010 }, /* speaker */
9288 { 0x15, 0x411111f0 }, /* HP out */
9289 { 0x16, 0x411111f0 },
9290 { 0x18, 0x01a19020 }, /* mic */
9291 { 0x19, 0x02a19021 },
9292 { 0x1a, 0x0181302f },
9293 { 0x1b, 0x0221401f },
9294 { 0x1c, 0x411111f0 },
9295 { 0x1d, 0x4044c601 },
9296 { 0x1e, 0x411111f0 },
9297 { }
9298 },
9299 .chain_id = ALC269_FIXUP_DMIC,
9300 },
9301 [ALC269_FIXUP_LEMOTE_A1802] = {
9302 .type = HDA_FIXUP_PINS,
9303 .v.pins = (const struct hda_pintbl[]) {
9304 { 0x12, 0x40000000 },
9305 { 0x14, 0x90170110 }, /* speaker */
9306 { 0x17, 0x411111f0 },
9307 { 0x18, 0x03a19040 }, /* mic1 */
9308 { 0x19, 0x90a70130 }, /* mic2 */
9309 { 0x1a, 0x411111f0 },
9310 { 0x1b, 0x411111f0 },
9311 { 0x1d, 0x40489d2d },
9312 { 0x1e, 0x411111f0 },
9313 { 0x20, 0x0003ffff },
9314 { 0x21, 0x03214020 },
9315 { }
9316 },
9317 .chain_id = ALC269_FIXUP_DMIC,
9318 },
9319 [ALC269_FIXUP_LEMOTE_A190X] = {
9320 .type = HDA_FIXUP_PINS,
9321 .v.pins = (const struct hda_pintbl[]) {
9322 { 0x14, 0x99130110 }, /* speaker */
9323 { 0x15, 0x0121401f }, /* HP out */
9324 { 0x18, 0x01a19c20 }, /* rear mic */
9325 { 0x19, 0x99a3092f }, /* front mic */
9326 { 0x1b, 0x0201401f }, /* front lineout */
9327 { }
9328 },
9329 .chain_id = ALC269_FIXUP_DMIC,
9330 },
9331 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9332 .type = HDA_FIXUP_PINS,
9333 .v.pins = (const struct hda_pintbl[]) {
9334 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9335 { }
9336 },
9337 .chained = true,
9338 .chain_id = ALC269_FIXUP_HEADSET_MODE
9339 },
9340 [ALC256_FIXUP_INTEL_NUC10] = {
9341 .type = HDA_FIXUP_PINS,
9342 .v.pins = (const struct hda_pintbl[]) {
9343 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9344 { }
9345 },
9346 .chained = true,
9347 .chain_id = ALC269_FIXUP_HEADSET_MODE
9348 },
9349 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9350 .type = HDA_FIXUP_VERBS,
9351 .v.verbs = (const struct hda_verb[]) {
9352 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9353 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9354 { }
9355 },
9356 .chained = true,
9357 .chain_id = ALC289_FIXUP_ASUS_GA502
9358 },
9359 [ALC274_FIXUP_HP_MIC] = {
9360 .type = HDA_FIXUP_VERBS,
9361 .v.verbs = (const struct hda_verb[]) {
9362 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9363 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9364 { }
9365 },
9366 },
9367 [ALC274_FIXUP_HP_HEADSET_MIC] = {
9368 .type = HDA_FIXUP_FUNC,
9369 .v.func = alc274_fixup_hp_headset_mic,
9370 .chained = true,
9371 .chain_id = ALC274_FIXUP_HP_MIC
9372 },
9373 [ALC274_FIXUP_HP_ENVY_GPIO] = {
9374 .type = HDA_FIXUP_FUNC,
9375 .v.func = alc274_fixup_hp_envy_gpio,
9376 },
9377 [ALC256_FIXUP_ASUS_HPE] = {
9378 .type = HDA_FIXUP_VERBS,
9379 .v.verbs = (const struct hda_verb[]) {
9380 /* Set EAPD high */
9381 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9382 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9383 { }
9384 },
9385 .chained = true,
9386 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9387 },
9388 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9389 .type = HDA_FIXUP_FUNC,
9390 .v.func = alc_fixup_headset_jack,
9391 .chained = true,
9392 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9393 },
9394 [ALC287_FIXUP_HP_GPIO_LED] = {
9395 .type = HDA_FIXUP_FUNC,
9396 .v.func = alc287_fixup_hp_gpio_led,
9397 },
9398 [ALC256_FIXUP_HP_HEADSET_MIC] = {
9399 .type = HDA_FIXUP_FUNC,
9400 .v.func = alc274_fixup_hp_headset_mic,
9401 },
9402 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9403 .type = HDA_FIXUP_FUNC,
9404 .v.func = alc_fixup_no_int_mic,
9405 .chained = true,
9406 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9407 },
9408 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9409 .type = HDA_FIXUP_PINS,
9410 .v.pins = (const struct hda_pintbl[]) {
9411 { 0x1b, 0x411111f0 },
9412 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9413 { },
9414 },
9415 .chained = true,
9416 .chain_id = ALC269_FIXUP_HEADSET_MODE
9417 },
9418 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9419 .type = HDA_FIXUP_FUNC,
9420 .v.func = alc269_fixup_limit_int_mic_boost,
9421 .chained = true,
9422 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9423 },
9424 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
9425 .type = HDA_FIXUP_PINS,
9426 .v.pins = (const struct hda_pintbl[]) {
9427 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9428 { 0x1a, 0x90a1092f }, /* use as internal mic */
9429 { }
9430 },
9431 .chained = true,
9432 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9433 },
9434 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9435 .type = HDA_FIXUP_FUNC,
9436 .v.func = alc285_fixup_ideapad_s740_coef,
9437 .chained = true,
9438 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9439 },
9440 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9441 .type = HDA_FIXUP_FUNC,
9442 .v.func = alc269_fixup_limit_int_mic_boost,
9443 .chained = true,
9444 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9445 },
9446 [ALC295_FIXUP_ASUS_DACS] = {
9447 .type = HDA_FIXUP_FUNC,
9448 .v.func = alc295_fixup_asus_dacs,
9449 },
9450 [ALC295_FIXUP_HP_OMEN] = {
9451 .type = HDA_FIXUP_PINS,
9452 .v.pins = (const struct hda_pintbl[]) {
9453 { 0x12, 0xb7a60130 },
9454 { 0x13, 0x40000000 },
9455 { 0x14, 0x411111f0 },
9456 { 0x16, 0x411111f0 },
9457 { 0x17, 0x90170110 },
9458 { 0x18, 0x411111f0 },
9459 { 0x19, 0x02a11030 },
9460 { 0x1a, 0x411111f0 },
9461 { 0x1b, 0x04a19030 },
9462 { 0x1d, 0x40600001 },
9463 { 0x1e, 0x411111f0 },
9464 { 0x21, 0x03211020 },
9465 {}
9466 },
9467 .chained = true,
9468 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9469 },
9470 [ALC285_FIXUP_HP_SPECTRE_X360] = {
9471 .type = HDA_FIXUP_FUNC,
9472 .v.func = alc285_fixup_hp_spectre_x360,
9473 },
9474 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9475 .type = HDA_FIXUP_FUNC,
9476 .v.func = alc285_fixup_hp_spectre_x360_eb1
9477 },
9478 [ALC285_FIXUP_HP_SPECTRE_X360_DF1] = {
9479 .type = HDA_FIXUP_FUNC,
9480 .v.func = alc285_fixup_hp_spectre_x360_df1
9481 },
9482 [ALC285_FIXUP_HP_ENVY_X360] = {
9483 .type = HDA_FIXUP_FUNC,
9484 .v.func = alc285_fixup_hp_envy_x360,
9485 .chained = true,
9486 .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9487 },
9488 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9489 .type = HDA_FIXUP_FUNC,
9490 .v.func = alc285_fixup_ideapad_s740_coef,
9491 .chained = true,
9492 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9493 },
9494 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9495 .type = HDA_FIXUP_FUNC,
9496 .v.func = alc_fixup_no_shutup,
9497 .chained = true,
9498 .chain_id = ALC283_FIXUP_HEADSET_MIC,
9499 },
9500 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9501 .type = HDA_FIXUP_PINS,
9502 .v.pins = (const struct hda_pintbl[]) {
9503 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9504 { }
9505 },
9506 .chained = true,
9507 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9508 },
9509 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9510 .type = HDA_FIXUP_FUNC,
9511 .v.func = alc269_fixup_limit_int_mic_boost,
9512 .chained = true,
9513 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9514 },
9515 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9516 .type = HDA_FIXUP_FUNC,
9517 .v.func = alc285_fixup_ideapad_s740_coef,
9518 .chained = true,
9519 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9520 },
9521 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9522 .type = HDA_FIXUP_FUNC,
9523 .v.func = alc287_fixup_legion_15imhg05_speakers,
9524 .chained = true,
9525 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9526 },
9527 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9528 .type = HDA_FIXUP_VERBS,
9529 //.v.verbs = legion_15imhg05_coefs,
9530 .v.verbs = (const struct hda_verb[]) {
9531 // set left speaker Legion 7i.
9532 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9533 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9534
9535 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9536 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9537 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9538 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9539 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9540
9541 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9542 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9543 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9544 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9545 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9546
9547 // set right speaker Legion 7i.
9548 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9549 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9550
9551 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9552 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9553 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9554 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9555 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9556
9557 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9558 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9559 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9560 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9561 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9562 {}
9563 },
9564 .chained = true,
9565 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9566 },
9567 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9568 .type = HDA_FIXUP_FUNC,
9569 .v.func = alc287_fixup_legion_15imhg05_speakers,
9570 .chained = true,
9571 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9572 },
9573 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9574 .type = HDA_FIXUP_VERBS,
9575 .v.verbs = (const struct hda_verb[]) {
9576 // set left speaker Yoga 7i.
9577 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9578 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9579
9580 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9581 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9582 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9583 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9584 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9585
9586 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9587 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9588 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9589 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9590 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9591
9592 // set right speaker Yoga 7i.
9593 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9594 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9595
9596 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9597 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9598 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9599 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9600 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9601
9602 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9603 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9604 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9605 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9606 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9607 {}
9608 },
9609 .chained = true,
9610 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9611 },
9612 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
9613 .type = HDA_FIXUP_FUNC,
9614 .v.func = alc298_fixup_lenovo_c940_duet7,
9615 },
9616 [ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9617 .type = HDA_FIXUP_FUNC,
9618 .v.func = alc287_fixup_lenovo_14irp8_duetitl,
9619 },
9620 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9621 .type = HDA_FIXUP_VERBS,
9622 .v.verbs = (const struct hda_verb[]) {
9623 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9624 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9625 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9626 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9627 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9628 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9629 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9630 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9631 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9632 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9633 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9634 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9635 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9636 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9637 {}
9638 },
9639 .chained = true,
9640 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9641 },
9642 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9643 .type = HDA_FIXUP_FUNC,
9644 .v.func = alc256_fixup_set_coef_defaults,
9645 },
9646 [ALC245_FIXUP_HP_GPIO_LED] = {
9647 .type = HDA_FIXUP_FUNC,
9648 .v.func = alc245_fixup_hp_gpio_led,
9649 },
9650 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9651 .type = HDA_FIXUP_PINS,
9652 .v.pins = (const struct hda_pintbl[]) {
9653 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9654 { }
9655 },
9656 .chained = true,
9657 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9658 },
9659 [ALC233_FIXUP_NO_AUDIO_JACK] = {
9660 .type = HDA_FIXUP_FUNC,
9661 .v.func = alc233_fixup_no_audio_jack,
9662 },
9663 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9664 .type = HDA_FIXUP_FUNC,
9665 .v.func = alc256_fixup_mic_no_presence_and_resume,
9666 .chained = true,
9667 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9668 },
9669 [ALC287_FIXUP_LEGION_16ACHG6] = {
9670 .type = HDA_FIXUP_FUNC,
9671 .v.func = alc287_fixup_legion_16achg6_speakers,
9672 },
9673 [ALC287_FIXUP_CS35L41_I2C_2] = {
9674 .type = HDA_FIXUP_FUNC,
9675 .v.func = cs35l41_fixup_i2c_two,
9676 },
9677 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9678 .type = HDA_FIXUP_FUNC,
9679 .v.func = cs35l41_fixup_i2c_two,
9680 .chained = true,
9681 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9682 },
9683 [ALC245_FIXUP_CS35L41_SPI_2] = {
9684 .type = HDA_FIXUP_FUNC,
9685 .v.func = cs35l41_fixup_spi_two,
9686 },
9687 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9688 .type = HDA_FIXUP_FUNC,
9689 .v.func = cs35l41_fixup_spi_two,
9690 .chained = true,
9691 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9692 },
9693 [ALC245_FIXUP_CS35L41_SPI_4] = {
9694 .type = HDA_FIXUP_FUNC,
9695 .v.func = cs35l41_fixup_spi_four,
9696 },
9697 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9698 .type = HDA_FIXUP_FUNC,
9699 .v.func = cs35l41_fixup_spi_four,
9700 .chained = true,
9701 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9702 },
9703 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9704 .type = HDA_FIXUP_VERBS,
9705 .v.verbs = (const struct hda_verb[]) {
9706 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9707 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9708 { }
9709 },
9710 .chained = true,
9711 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9712 },
9713 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9714 .type = HDA_FIXUP_FUNC,
9715 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
9716 .chained = true,
9717 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9718 },
9719 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9720 .type = HDA_FIXUP_PINS,
9721 .v.pins = (const struct hda_pintbl[]) {
9722 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9723 { }
9724 },
9725 .chained = true,
9726 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9727 },
9728 [ALC287_FIXUP_LEGION_16ITHG6] = {
9729 .type = HDA_FIXUP_FUNC,
9730 .v.func = alc287_fixup_legion_16ithg6_speakers,
9731 },
9732 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9733 .type = HDA_FIXUP_VERBS,
9734 .v.verbs = (const struct hda_verb[]) {
9735 // enable left speaker
9736 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9737 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9738
9739 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9740 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9741 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9742 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9743 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9744
9745 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9746 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9747 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9748 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9749 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9750
9751 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9752 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9753 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9754 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9755 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9756
9757 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9758 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9759 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9760 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9761 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9762
9763 // enable right speaker
9764 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9765 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9766
9767 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9768 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9769 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9770 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9771 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9772
9773 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9774 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9775 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9776 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9777 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9778
9779 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9780 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9781 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9782 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9783 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9784
9785 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9786 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9787 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9788 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9789 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9790
9791 { },
9792 },
9793 },
9794 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9795 .type = HDA_FIXUP_FUNC,
9796 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9797 .chained = true,
9798 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9799 },
9800 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9801 .type = HDA_FIXUP_FUNC,
9802 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9803 .chained = true,
9804 .chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9805 },
9806 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9807 .type = HDA_FIXUP_FUNC,
9808 .v.func = alc295_fixup_dell_inspiron_top_speakers,
9809 .chained = true,
9810 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9811 },
9812 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
9813 .type = HDA_FIXUP_PINS,
9814 .v.func = alc1220_fixup_gb_dual_codecs,
9815 .chained = true,
9816 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9817 },
9818 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9819 .type = HDA_FIXUP_FUNC,
9820 .v.func = cs35l41_fixup_i2c_two,
9821 .chained = true,
9822 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9823 },
9824 [ALC287_FIXUP_TAS2781_I2C] = {
9825 .type = HDA_FIXUP_FUNC,
9826 .v.func = tas2781_fixup_i2c,
9827 .chained = true,
9828 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9829 },
9830 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9831 .type = HDA_FIXUP_FUNC,
9832 .v.func = alc245_fixup_hp_mute_led_coefbit,
9833 },
9834 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9835 .type = HDA_FIXUP_FUNC,
9836 .v.func = alc245_fixup_hp_mute_led_coefbit,
9837 .chained = true,
9838 .chain_id = ALC245_FIXUP_HP_GPIO_LED
9839 },
9840 [ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9841 .type = HDA_FIXUP_FUNC,
9842 .v.func = alc287_fixup_bind_dacs,
9843 .chained = true,
9844 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9845 },
9846 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9847 .type = HDA_FIXUP_FUNC,
9848 .v.func = alc287_fixup_bind_dacs,
9849 .chained = true,
9850 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9851 },
9852 [ALC2XX_FIXUP_HEADSET_MIC] = {
9853 .type = HDA_FIXUP_FUNC,
9854 .v.func = alc_fixup_headset_mic,
9855 },
9856 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9857 .type = HDA_FIXUP_FUNC,
9858 .v.func = cs35l41_fixup_spi_two,
9859 .chained = true,
9860 .chain_id = ALC289_FIXUP_DUAL_SPK
9861 },
9862 [ALC294_FIXUP_CS35L41_I2C_2] = {
9863 .type = HDA_FIXUP_FUNC,
9864 .v.func = cs35l41_fixup_i2c_two,
9865 },
9866 };
9867
9868 static const struct hda_quirk alc269_fixup_tbl[] = {
9869 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
9870 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9871 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
9872 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
9873 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9874 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9875 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
9876 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9877 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9878 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
9879 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9880 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
9881 SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9882 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
9883 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
9884 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
9885 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
9886 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9887 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9888 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9889 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9890 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
9891 SND_PCI_QUIRK(0x1025, 0x1177, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
9892 SND_PCI_QUIRK(0x1025, 0x1178, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
9893 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
9894 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
9895 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
9896 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
9897 SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9898 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9899 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9900 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9901 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
9902 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9903 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9904 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9905 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
9906 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
9907 SND_PCI_QUIRK(0x1025, 0x1360, "Acer Aspire A115", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9908 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9909 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9910 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9911 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
9912 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9913 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
9914 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
9915 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
9916 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
9917 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
9918 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9919 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
9920 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
9921 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9922 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9923 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9924 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9925 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9926 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
9927 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
9928 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
9929 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9930 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9931 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
9932 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9933 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
9934 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9935 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9936 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9937 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9938 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9939 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9940 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9941 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9942 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9943 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
9944 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
9945 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
9946 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
9947 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9948 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
9949 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
9950 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9951 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9952 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9953 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9954 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
9955 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
9956 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
9957 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9958 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9959 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9960 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9961 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9962 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9963 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9964 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
9965 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
9966 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
9967 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
9968 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9969 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9970 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
9971 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
9972 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9973 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9974 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9975 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9976 SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9977 SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9978 SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9979 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9980 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9981 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9982 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9983 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9984 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9985 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9986 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9987 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9988 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9989 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9990 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9991 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9992 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9993 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9994 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9995 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9996 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9997 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
9998 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
9999 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10000 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10001 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10002 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10003 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
10004 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10005 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10006 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10007 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10008 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10009 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10010 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10011 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10012 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10013 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10014 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10015 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10016 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10017 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
10018 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
10019 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10020 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10021 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10022 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10023 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10024 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10025 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10026 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10027 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
10028 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10029 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10030 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10031 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10032 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10033 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10034 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10035 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10036 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10037 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10038 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10039 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10040 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10041 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10042 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10043 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10044 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10045 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10046 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
10047 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10048 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10049 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10050 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10051 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10052 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10053 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
10054 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10055 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10056 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10057 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10058 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
10059 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
10060 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
10061 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10062 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10063 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10064 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10065 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10066 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10067 SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10068 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10069 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
10070 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10071 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
10072 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10073 SND_PCI_QUIRK(0x103c, 0x85c6, "HP Pavilion x360 Convertible 14-dy1xxx", ALC295_FIXUP_HP_MUTE_LED_COEFBIT11),
10074 SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
10075 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10076 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10077 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10078 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10079 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
10080 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10081 SND_PCI_QUIRK(0x103c, 0x863e, "HP Spectre x360 15-df1xxx", ALC285_FIXUP_HP_SPECTRE_X360_DF1),
10082 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10083 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
10084 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10085 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10086 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
10087 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
10088 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
10089 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10090 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10091 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10092 SND_PCI_QUIRK(0x103c, 0x8760, "HP EliteBook 8{4,5}5 G7", ALC285_FIXUP_HP_BEEP_MICMUTE_LED),
10093 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10094 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
10095 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10096 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10097 ALC285_FIXUP_HP_GPIO_AMP_INIT),
10098 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10099 ALC285_FIXUP_HP_GPIO_AMP_INIT),
10100 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10101 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10102 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10103 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10104 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
10105 SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10106 SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10107 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10108 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10109 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10110 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10111 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10112 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
10113 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10114 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10115 SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10116 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10117 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10118 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10119 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10120 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10121 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10122 SND_PCI_QUIRK(0x103c, 0x881e, "HP Laptop 15s-du3xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10123 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10124 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10125 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10126 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10127 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10128 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10129 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10130 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10131 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10132 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10133 SND_PCI_QUIRK(0x103c, 0x887c, "HP Laptop 14s-fq1xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10134 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10135 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
10136 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
10137 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
10138 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10139 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
10140 SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
10141 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
10142 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10143 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
10144 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10145 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10146 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10147 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10148 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10149 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10150 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10151 SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
10152 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10153 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10154 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10155 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10156 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
10157 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10158 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
10159 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10160 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
10161 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
10162 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10163 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
10164 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10165 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10166 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10167 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10168 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10169 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
10170 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10171 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10172 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10173 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10174 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10175 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10176 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
10177 SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
10178 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10179 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10180 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10181 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10182 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10183 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
10184 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10185 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10186 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10187 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10188 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10189 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10190 SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10191 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10192 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10193 SND_PCI_QUIRK(0x103c, 0x8b5f, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10194 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10195 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10196 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10197 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10198 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10199 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10200 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
10201 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10202 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10203 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
10204 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10205 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10206 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10207 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10208 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10209 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10210 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10211 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
10212 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10213 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10214 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10215 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10216 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10217 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10218 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10219 SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10220 SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10221 SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10222 SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10223 SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10224 SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10225 SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10226 SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10227 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10228 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10229 SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
10230 SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10231 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10232 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10233 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10234 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10235 SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10236 SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10237 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10238 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10239 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10240 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10241 SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED),
10242 SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10243 SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED),
10244 SND_PCI_QUIRK(0x103c, 0x8e18, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
10245 SND_PCI_QUIRK(0x103c, 0x8e19, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
10246 SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
10247 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10248 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
10249 SND_PCI_QUIRK(0x1043, 0x1054, "ASUS G614FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
10250 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10251 SND_PCI_QUIRK(0x1043, 0x1074, "ASUS G614PH/PM/PP", ALC287_FIXUP_CS35L41_I2C_2),
10252 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
10253 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10254 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10255 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
10256 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10257 SND_PCI_QUIRK(0x1043, 0x1194, "ASUS UM3406KA", ALC287_FIXUP_CS35L41_I2C_2),
10258 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10259 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10260 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10261 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10262 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10263 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10264 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10265 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10266 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10267 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10268 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10269 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10270 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10271 SND_PCI_QUIRK(0x1043, 0x1460, "Asus VivoBook 15", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10272 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10273 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10274 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10275 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10276 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10277 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
10278 SND_PCI_QUIRK(0x1043, 0x14f2, "ASUS VivoBook X515JA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10279 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
10280 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10281 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10282 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
10283 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10284 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10285 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10286 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10287 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10288 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10289 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10290 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10291 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
10292 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10293 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10294 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10295 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10296 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10297 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10298 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10299 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10300 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10301 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10302 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10303 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10304 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10305 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10306 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
10307 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10308 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10309 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10310 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10311 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10312 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10313 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10314 SND_PCI_QUIRK(0x1043, 0x1c80, "ASUS VivoBook TP401", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10315 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10316 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10317 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10318 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10319 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10320 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10321 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10322 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
10323 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10324 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10325 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10326 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10327 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10328 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10329 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10330 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10331 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10332 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10333 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10334 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10335 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10336 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10337 SND_PCI_QUIRK(0x1043, 0x1f63, "ASUS P5405CSA", ALC245_FIXUP_CS35L41_SPI_2),
10338 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10339 SND_PCI_QUIRK(0x1043, 0x1fb3, "ASUS ROG Flow Z13 GZ302EA", ALC287_FIXUP_CS35L41_I2C_2),
10340 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10341 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
10342 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10343 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10344 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10345 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10346 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10347 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10348 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10349 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10350 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10351 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10352 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10353 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10354 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10355 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10356 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10357 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10358 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10359 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10360 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10361 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10362 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10363 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10364 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10365 SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10366 SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10367 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10368 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10369 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10370 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10371 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10372 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10373 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10374 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10375 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10376 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10377 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10378 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10379 SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10380 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10381 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10382 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10383 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10384 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10385 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10386 SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10387 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10388 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10389 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10390 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10391 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10392 SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10393 SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10394 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10395 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10396 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10397 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10398 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10399 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10400 SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10401 SND_PCI_QUIRK(0x1558, 0x28c1, "Clevo V370VND", ALC2XX_FIXUP_HEADSET_MIC),
10402 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10403 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10404 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10405 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10406 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10407 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10408 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10409 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10410 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10411 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10412 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10413 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10414 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10415 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10416 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10417 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10418 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10419 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10420 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10421 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10422 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10423 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10424 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10425 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10426 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10427 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10428 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10429 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10430 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10431 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10432 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10433 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10434 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10435 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10436 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10437 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10438 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10439 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10440 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10441 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10442 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10443 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10444 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10445 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10446 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10447 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10448 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10449 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10450 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10451 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10452 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10453 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10454 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10455 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10456 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10457 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10458 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10459 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10460 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10461 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10462 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10463 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10464 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10465 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10466 SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10467 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10468 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10469 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10470 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10471 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10472 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10473 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10474 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10475 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10476 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10477 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10478 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10479 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10480 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10481 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10482 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10483 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10484 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10485 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10486 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10487 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10488 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10489 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10490 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10491 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10492 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10493 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10494 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10495 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10496 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10497 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10498 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10499 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10500 SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10501 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10502 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10503 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10504 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10505 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10506 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10507 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10508 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10509 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10510 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10511 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10512 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10513 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10514 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10515 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10516 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10517 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10518 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10519 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10520 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10521 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10522 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10523 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10524 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10525 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10526 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10527 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10528 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10529 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10530 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10531 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10532 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10533 SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
10534 SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
10535 SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
10536 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10537 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
10538 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10539 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10540 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10541 SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10542 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10543 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10544 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10545 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10546 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10547 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10548 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10549 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10550 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10551 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10552 SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10553 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10554 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10555 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10556 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10557 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10558 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10559 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10560 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10561 SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10562 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10563 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10564 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10565 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10566 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10567 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10568 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10569 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10570 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10571 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10572 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10573 SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10574 SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10575 SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10576 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10577 SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10578 SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
10579 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10580 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10581 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10582 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10583 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10584 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10585 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10586 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10587 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10588 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10589 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10590 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10591 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10592 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10593 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10594 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10595 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10596 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10597 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10598 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10599 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10600 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10601 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10602 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10603 SND_PCI_QUIRK(0x1849, 0x0269, "Positivo Master C6400", ALC269VB_FIXUP_ASUS_ZENBOOK),
10604 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10605 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10606 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10607 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10608 SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC),
10609 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10610 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10611 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10612 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10613 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10614 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10615 SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10616 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10617 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10618 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10619 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10620 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10621 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10622 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10623 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10624 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10625 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10626 SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10627 SND_PCI_QUIRK(0x1d05, 0x1409, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10628 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10629 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10630 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10631 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10632 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10633 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10634 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
10635 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10636 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10637 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
10638 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10639 SND_PCI_QUIRK(0x2782, 0x1701, "Infinix Y4 Max", ALC269VC_FIXUP_INFINIX_Y4_MAX),
10640 SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
10641 SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10642 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10643 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10644 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10645 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10646 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10647 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10648 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10649 SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10650
10651 #if 0
10652 /* Below is a quirk table taken from the old code.
10653 * Basically the device should work as is without the fixup table.
10654 * If BIOS doesn't give a proper info, enable the corresponding
10655 * fixup entry.
10656 */
10657 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10658 ALC269_FIXUP_AMIC),
10659 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10660 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10661 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10662 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10663 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10664 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10665 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10666 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10667 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10668 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10669 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10670 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10671 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10672 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10673 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10674 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10675 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10676 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10677 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10678 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10679 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10680 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10681 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10682 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10683 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10684 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10685 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10686 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10687 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10688 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10689 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10690 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10691 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10692 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10693 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10694 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10695 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10696 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10697 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10698 #endif
10699 {}
10700 };
10701
10702 static const struct hda_quirk alc269_fixup_vendor_tbl[] = {
10703 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10704 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10705 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10706 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10707 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10708 {}
10709 };
10710
10711 static const struct hda_model_fixup alc269_fixup_models[] = {
10712 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10713 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10714 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10715 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10716 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10717 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10718 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10719 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10720 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10721 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10722 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10723 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10724 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10725 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10726 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10727 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10728 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, .name = "dell-headset4-quiet"},
10729 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10730 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10731 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10732 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10733 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10734 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10735 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
10736 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10737 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
10738 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10739 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10740 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10741 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10742 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10743 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10744 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10745 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10746 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10747 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10748 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10749 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10750 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10751 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10752 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10753 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10754 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10755 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10756 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10757 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10758 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10759 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10760 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10761 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10762 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10763 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10764 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10765 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10766 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10767 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10768 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10769 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10770 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10771 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10772 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10773 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10774 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10775 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10776 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10777 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
10778 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
10779 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
10780 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
10781 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10782 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10783 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10784 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10785 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10786 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10787 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10788 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10789 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10790 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10791 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10792 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10793 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10794 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
10795 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10796 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10797 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
10798 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
10799 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
10800 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
10801 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10802 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10803 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10804 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10805 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10806 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10807 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10808 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10809 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10810 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10811 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10812 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10813 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10814 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10815 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10816 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10817 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
10818 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10819 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
10820 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
10821 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
10822 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
10823 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
10824 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
10825 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
10826 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
10827 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
10828 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
10829 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
10830 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
10831 {.id = ALC285_FIXUP_HP_SPECTRE_X360_DF1, .name = "alc285-hp-spectre-x360-df1"},
10832 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
10833 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
10834 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
10835 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
10836 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
10837 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
10838 {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
10839 {.id = ALC2XX_FIXUP_HEADSET_MIC, .name = "alc2xx-fixup-headset-mic"},
10840 {}
10841 };
10842 #define ALC225_STANDARD_PINS \
10843 {0x21, 0x04211020}
10844
10845 #define ALC256_STANDARD_PINS \
10846 {0x12, 0x90a60140}, \
10847 {0x14, 0x90170110}, \
10848 {0x21, 0x02211020}
10849
10850 #define ALC282_STANDARD_PINS \
10851 {0x14, 0x90170110}
10852
10853 #define ALC290_STANDARD_PINS \
10854 {0x12, 0x99a30130}
10855
10856 #define ALC292_STANDARD_PINS \
10857 {0x14, 0x90170110}, \
10858 {0x15, 0x0221401f}
10859
10860 #define ALC295_STANDARD_PINS \
10861 {0x12, 0xb7a60130}, \
10862 {0x14, 0x90170110}, \
10863 {0x21, 0x04211020}
10864
10865 #define ALC298_STANDARD_PINS \
10866 {0x12, 0x90a60130}, \
10867 {0x21, 0x03211020}
10868
10869 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
10870 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10871 {0x14, 0x01014020},
10872 {0x17, 0x90170110},
10873 {0x18, 0x02a11030},
10874 {0x19, 0x0181303F},
10875 {0x21, 0x0221102f}),
10876 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10877 {0x12, 0x90a601c0},
10878 {0x14, 0x90171120},
10879 {0x21, 0x02211030}),
10880 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10881 {0x14, 0x90170110},
10882 {0x1b, 0x90a70130},
10883 {0x21, 0x03211020}),
10884 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10885 {0x1a, 0x90a70130},
10886 {0x1b, 0x90170110},
10887 {0x21, 0x03211020}),
10888 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10889 ALC225_STANDARD_PINS,
10890 {0x12, 0xb7a60130},
10891 {0x14, 0x901701a0}),
10892 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10893 ALC225_STANDARD_PINS,
10894 {0x12, 0xb7a60130},
10895 {0x14, 0x901701b0}),
10896 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10897 ALC225_STANDARD_PINS,
10898 {0x12, 0xb7a60150},
10899 {0x14, 0x901701a0}),
10900 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10901 ALC225_STANDARD_PINS,
10902 {0x12, 0xb7a60150},
10903 {0x14, 0x901701b0}),
10904 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10905 ALC225_STANDARD_PINS,
10906 {0x12, 0xb7a60130},
10907 {0x1b, 0x90170110}),
10908 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10909 {0x1b, 0x01111010},
10910 {0x1e, 0x01451130},
10911 {0x21, 0x02211020}),
10912 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10913 {0x12, 0x90a60140},
10914 {0x14, 0x90170110},
10915 {0x19, 0x02a11030},
10916 {0x21, 0x02211020}),
10917 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10918 {0x14, 0x90170110},
10919 {0x19, 0x02a11030},
10920 {0x1a, 0x02a11040},
10921 {0x1b, 0x01014020},
10922 {0x21, 0x0221101f}),
10923 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10924 {0x14, 0x90170110},
10925 {0x19, 0x02a11030},
10926 {0x1a, 0x02a11040},
10927 {0x1b, 0x01011020},
10928 {0x21, 0x0221101f}),
10929 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10930 {0x14, 0x90170110},
10931 {0x19, 0x02a11020},
10932 {0x1a, 0x02a11030},
10933 {0x21, 0x0221101f}),
10934 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10935 {0x21, 0x02211010}),
10936 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10937 {0x14, 0x90170110},
10938 {0x19, 0x02a11020},
10939 {0x21, 0x02211030}),
10940 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
10941 {0x14, 0x90170110},
10942 {0x21, 0x02211020}),
10943 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10944 {0x14, 0x90170130},
10945 {0x21, 0x02211040}),
10946 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10947 {0x12, 0x90a60140},
10948 {0x14, 0x90170110},
10949 {0x21, 0x02211020}),
10950 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10951 {0x12, 0x90a60160},
10952 {0x14, 0x90170120},
10953 {0x21, 0x02211030}),
10954 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10955 {0x14, 0x90170110},
10956 {0x1b, 0x02011020},
10957 {0x21, 0x0221101f}),
10958 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10959 {0x14, 0x90170110},
10960 {0x1b, 0x01011020},
10961 {0x21, 0x0221101f}),
10962 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10963 {0x14, 0x90170130},
10964 {0x1b, 0x01014020},
10965 {0x21, 0x0221103f}),
10966 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10967 {0x14, 0x90170130},
10968 {0x1b, 0x01011020},
10969 {0x21, 0x0221103f}),
10970 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10971 {0x14, 0x90170130},
10972 {0x1b, 0x02011020},
10973 {0x21, 0x0221103f}),
10974 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10975 {0x14, 0x90170150},
10976 {0x1b, 0x02011020},
10977 {0x21, 0x0221105f}),
10978 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10979 {0x14, 0x90170110},
10980 {0x1b, 0x01014020},
10981 {0x21, 0x0221101f}),
10982 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10983 {0x12, 0x90a60160},
10984 {0x14, 0x90170120},
10985 {0x17, 0x90170140},
10986 {0x21, 0x0321102f}),
10987 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10988 {0x12, 0x90a60160},
10989 {0x14, 0x90170130},
10990 {0x21, 0x02211040}),
10991 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10992 {0x12, 0x90a60160},
10993 {0x14, 0x90170140},
10994 {0x21, 0x02211050}),
10995 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10996 {0x12, 0x90a60170},
10997 {0x14, 0x90170120},
10998 {0x21, 0x02211030}),
10999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11000 {0x12, 0x90a60170},
11001 {0x14, 0x90170130},
11002 {0x21, 0x02211040}),
11003 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11004 {0x12, 0x90a60170},
11005 {0x14, 0x90171130},
11006 {0x21, 0x02211040}),
11007 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11008 {0x12, 0x90a60170},
11009 {0x14, 0x90170140},
11010 {0x21, 0x02211050}),
11011 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11012 {0x12, 0x90a60180},
11013 {0x14, 0x90170130},
11014 {0x21, 0x02211040}),
11015 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11016 {0x12, 0x90a60180},
11017 {0x14, 0x90170120},
11018 {0x21, 0x02211030}),
11019 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11020 {0x1b, 0x01011020},
11021 {0x21, 0x02211010}),
11022 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11023 {0x14, 0x90170110},
11024 {0x1b, 0x90a70130},
11025 {0x21, 0x04211020}),
11026 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11027 {0x14, 0x90170110},
11028 {0x1b, 0x90a70130},
11029 {0x21, 0x03211020}),
11030 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11031 {0x12, 0x90a60130},
11032 {0x14, 0x90170110},
11033 {0x21, 0x03211020}),
11034 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11035 {0x12, 0x90a60130},
11036 {0x14, 0x90170110},
11037 {0x21, 0x04211020}),
11038 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11039 {0x1a, 0x90a70130},
11040 {0x1b, 0x90170110},
11041 {0x21, 0x03211020}),
11042 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11043 {0x14, 0x90170110},
11044 {0x19, 0x02a11020},
11045 {0x21, 0x0221101f}),
11046 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
11047 {0x17, 0x90170110},
11048 {0x19, 0x03a11030},
11049 {0x21, 0x03211020}),
11050 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
11051 {0x12, 0x90a60130},
11052 {0x14, 0x90170110},
11053 {0x15, 0x0421101f},
11054 {0x1a, 0x04a11020}),
11055 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
11056 {0x12, 0x90a60140},
11057 {0x14, 0x90170110},
11058 {0x15, 0x0421101f},
11059 {0x18, 0x02811030},
11060 {0x1a, 0x04a1103f},
11061 {0x1b, 0x02011020}),
11062 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11063 ALC282_STANDARD_PINS,
11064 {0x12, 0x99a30130},
11065 {0x19, 0x03a11020},
11066 {0x21, 0x0321101f}),
11067 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11068 ALC282_STANDARD_PINS,
11069 {0x12, 0x99a30130},
11070 {0x19, 0x03a11020},
11071 {0x21, 0x03211040}),
11072 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11073 ALC282_STANDARD_PINS,
11074 {0x12, 0x99a30130},
11075 {0x19, 0x03a11030},
11076 {0x21, 0x03211020}),
11077 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11078 ALC282_STANDARD_PINS,
11079 {0x12, 0x99a30130},
11080 {0x19, 0x04a11020},
11081 {0x21, 0x0421101f}),
11082 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
11083 ALC282_STANDARD_PINS,
11084 {0x12, 0x90a60140},
11085 {0x19, 0x04a11030},
11086 {0x21, 0x04211020}),
11087 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11088 ALC282_STANDARD_PINS,
11089 {0x12, 0x90a609c0},
11090 {0x18, 0x03a11830},
11091 {0x19, 0x04a19831},
11092 {0x1a, 0x0481303f},
11093 {0x1b, 0x04211020},
11094 {0x21, 0x0321101f}),
11095 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11096 ALC282_STANDARD_PINS,
11097 {0x12, 0x90a60940},
11098 {0x18, 0x03a11830},
11099 {0x19, 0x04a19831},
11100 {0x1a, 0x0481303f},
11101 {0x1b, 0x04211020},
11102 {0x21, 0x0321101f}),
11103 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11104 ALC282_STANDARD_PINS,
11105 {0x12, 0x90a60130},
11106 {0x21, 0x0321101f}),
11107 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11108 {0x12, 0x90a60160},
11109 {0x14, 0x90170120},
11110 {0x21, 0x02211030}),
11111 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11112 ALC282_STANDARD_PINS,
11113 {0x12, 0x90a60130},
11114 {0x19, 0x03a11020},
11115 {0x21, 0x0321101f}),
11116 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11117 {0x12, 0x90a60130},
11118 {0x14, 0x90170110},
11119 {0x19, 0x04a11040},
11120 {0x21, 0x04211020}),
11121 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11122 {0x14, 0x90170110},
11123 {0x19, 0x04a11040},
11124 {0x1d, 0x40600001},
11125 {0x21, 0x04211020}),
11126 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
11127 {0x14, 0x90170110},
11128 {0x19, 0x04a11040},
11129 {0x21, 0x04211020}),
11130 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11131 {0x14, 0x90170110},
11132 {0x17, 0x90170111},
11133 {0x19, 0x03a11030},
11134 {0x21, 0x03211020}),
11135 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11136 {0x17, 0x90170110},
11137 {0x19, 0x03a11030},
11138 {0x21, 0x03211020}),
11139 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11140 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11141 {0x19, 0x04a11040},
11142 {0x21, 0x04211020}),
11143 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11144 {0x12, 0x90a60130},
11145 {0x17, 0x90170110},
11146 {0x21, 0x02211020}),
11147 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
11148 {0x12, 0x90a60120},
11149 {0x14, 0x90170110},
11150 {0x21, 0x0321101f}),
11151 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11152 ALC290_STANDARD_PINS,
11153 {0x15, 0x04211040},
11154 {0x18, 0x90170112},
11155 {0x1a, 0x04a11020}),
11156 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11157 ALC290_STANDARD_PINS,
11158 {0x15, 0x04211040},
11159 {0x18, 0x90170110},
11160 {0x1a, 0x04a11020}),
11161 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11162 ALC290_STANDARD_PINS,
11163 {0x15, 0x0421101f},
11164 {0x1a, 0x04a11020}),
11165 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11166 ALC290_STANDARD_PINS,
11167 {0x15, 0x04211020},
11168 {0x1a, 0x04a11040}),
11169 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11170 ALC290_STANDARD_PINS,
11171 {0x14, 0x90170110},
11172 {0x15, 0x04211020},
11173 {0x1a, 0x04a11040}),
11174 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11175 ALC290_STANDARD_PINS,
11176 {0x14, 0x90170110},
11177 {0x15, 0x04211020},
11178 {0x1a, 0x04a11020}),
11179 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11180 ALC290_STANDARD_PINS,
11181 {0x14, 0x90170110},
11182 {0x15, 0x0421101f},
11183 {0x1a, 0x04a11020}),
11184 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11185 ALC292_STANDARD_PINS,
11186 {0x12, 0x90a60140},
11187 {0x16, 0x01014020},
11188 {0x19, 0x01a19030}),
11189 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11190 ALC292_STANDARD_PINS,
11191 {0x12, 0x90a60140},
11192 {0x16, 0x01014020},
11193 {0x18, 0x02a19031},
11194 {0x19, 0x01a1903e}),
11195 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
11196 ALC292_STANDARD_PINS,
11197 {0x12, 0x90a60140}),
11198 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11199 ALC292_STANDARD_PINS,
11200 {0x13, 0x90a60140},
11201 {0x16, 0x21014020},
11202 {0x19, 0x21a19030}),
11203 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11204 ALC292_STANDARD_PINS,
11205 {0x13, 0x90a60140}),
11206 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
11207 {0x17, 0x90170110},
11208 {0x21, 0x04211020}),
11209 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
11210 {0x14, 0x90170110},
11211 {0x1b, 0x90a70130},
11212 {0x21, 0x04211020}),
11213 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11214 {0x12, 0x90a60130},
11215 {0x17, 0x90170110},
11216 {0x21, 0x03211020}),
11217 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11218 {0x12, 0x90a60130},
11219 {0x17, 0x90170110},
11220 {0x21, 0x04211020}),
11221 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11222 {0x12, 0x90a60130},
11223 {0x17, 0x90170110},
11224 {0x21, 0x03211020}),
11225 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11226 {0x12, 0x90a60120},
11227 {0x17, 0x90170110},
11228 {0x21, 0x04211030}),
11229 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11230 {0x12, 0x90a60130},
11231 {0x17, 0x90170110},
11232 {0x21, 0x03211020}),
11233 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11234 {0x12, 0x90a60130},
11235 {0x17, 0x90170110},
11236 {0x21, 0x03211020}),
11237 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11238 ALC298_STANDARD_PINS,
11239 {0x17, 0x90170110}),
11240 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11241 ALC298_STANDARD_PINS,
11242 {0x17, 0x90170140}),
11243 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11244 ALC298_STANDARD_PINS,
11245 {0x17, 0x90170150}),
11246 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
11247 {0x12, 0xb7a60140},
11248 {0x13, 0xb7a60150},
11249 {0x17, 0x90170110},
11250 {0x1a, 0x03011020},
11251 {0x21, 0x03211030}),
11252 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
11253 {0x12, 0xb7a60140},
11254 {0x17, 0x90170110},
11255 {0x1a, 0x03a11030},
11256 {0x21, 0x03211020}),
11257 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11258 ALC225_STANDARD_PINS,
11259 {0x12, 0xb7a60130},
11260 {0x17, 0x90170110}),
11261 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
11262 {0x14, 0x01014010},
11263 {0x17, 0x90170120},
11264 {0x18, 0x02a11030},
11265 {0x19, 0x02a1103f},
11266 {0x21, 0x0221101f}),
11267 {}
11268 };
11269
11270 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
11271 * more machines, don't need to match all valid pins, just need to match
11272 * all the pins defined in the tbl. Just because of this reason, it is possible
11273 * that a single machine matches multiple tbls, so there is one limitation:
11274 * at most one tbl is allowed to define for the same vendor and same codec
11275 */
11276 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
11277 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
11278 {0x19, 0x40000000}),
11279 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11280 {0x19, 0x40000000},
11281 {0x1b, 0x40000000}),
11282 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
11283 {0x19, 0x40000000},
11284 {0x1b, 0x40000000}),
11285 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11286 {0x19, 0x40000000},
11287 {0x1a, 0x40000000}),
11288 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
11289 {0x19, 0x40000000},
11290 {0x1a, 0x40000000}),
11291 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
11292 {0x19, 0x40000000},
11293 {0x1a, 0x40000000}),
11294 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11295 {0x19, 0x40000000}),
11296 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1558, "Clevo", ALC2XX_FIXUP_HEADSET_MIC,
11297 {0x19, 0x40000000}),
11298 {}
11299 };
11300
alc269_fill_coef(struct hda_codec * codec)11301 static void alc269_fill_coef(struct hda_codec *codec)
11302 {
11303 struct alc_spec *spec = codec->spec;
11304 int val;
11305
11306 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11307 return;
11308
11309 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11310 alc_write_coef_idx(codec, 0xf, 0x960b);
11311 alc_write_coef_idx(codec, 0xe, 0x8817);
11312 }
11313
11314 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11315 alc_write_coef_idx(codec, 0xf, 0x960b);
11316 alc_write_coef_idx(codec, 0xe, 0x8814);
11317 }
11318
11319 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11320 /* Power up output pin */
11321 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11322 }
11323
11324 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11325 val = alc_read_coef_idx(codec, 0xd);
11326 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11327 /* Capless ramp up clock control */
11328 alc_write_coef_idx(codec, 0xd, val | (1<<10));
11329 }
11330 val = alc_read_coef_idx(codec, 0x17);
11331 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11332 /* Class D power on reset */
11333 alc_write_coef_idx(codec, 0x17, val | (1<<7));
11334 }
11335 }
11336
11337 /* HP */
11338 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11339 }
11340
11341 /*
11342 */
patch_alc269(struct hda_codec * codec)11343 static int patch_alc269(struct hda_codec *codec)
11344 {
11345 struct alc_spec *spec;
11346 int err;
11347
11348 err = alc_alloc_spec(codec, 0x0b);
11349 if (err < 0)
11350 return err;
11351
11352 spec = codec->spec;
11353 spec->gen.shared_mic_vref_pin = 0x18;
11354 codec->power_save_node = 0;
11355 spec->en_3kpull_low = true;
11356
11357 #ifdef CONFIG_PM
11358 codec->patch_ops.suspend = alc269_suspend;
11359 codec->patch_ops.resume = alc269_resume;
11360 #endif
11361 spec->shutup = alc_default_shutup;
11362 spec->init_hook = alc_default_init;
11363
11364 switch (codec->core.vendor_id) {
11365 case 0x10ec0269:
11366 spec->codec_variant = ALC269_TYPE_ALC269VA;
11367 switch (alc_get_coef0(codec) & 0x00f0) {
11368 case 0x0010:
11369 if (codec->bus->pci &&
11370 codec->bus->pci->subsystem_vendor == 0x1025 &&
11371 spec->cdefine.platform_type == 1)
11372 err = alc_codec_rename(codec, "ALC271X");
11373 spec->codec_variant = ALC269_TYPE_ALC269VB;
11374 break;
11375 case 0x0020:
11376 if (codec->bus->pci &&
11377 codec->bus->pci->subsystem_vendor == 0x17aa &&
11378 codec->bus->pci->subsystem_device == 0x21f3)
11379 err = alc_codec_rename(codec, "ALC3202");
11380 spec->codec_variant = ALC269_TYPE_ALC269VC;
11381 break;
11382 case 0x0030:
11383 spec->codec_variant = ALC269_TYPE_ALC269VD;
11384 break;
11385 default:
11386 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11387 }
11388 if (err < 0)
11389 goto error;
11390 spec->shutup = alc269_shutup;
11391 spec->init_hook = alc269_fill_coef;
11392 alc269_fill_coef(codec);
11393 break;
11394
11395 case 0x10ec0280:
11396 case 0x10ec0290:
11397 spec->codec_variant = ALC269_TYPE_ALC280;
11398 break;
11399 case 0x10ec0282:
11400 spec->codec_variant = ALC269_TYPE_ALC282;
11401 spec->shutup = alc282_shutup;
11402 spec->init_hook = alc282_init;
11403 break;
11404 case 0x10ec0233:
11405 case 0x10ec0283:
11406 spec->codec_variant = ALC269_TYPE_ALC283;
11407 spec->shutup = alc283_shutup;
11408 spec->init_hook = alc283_init;
11409 break;
11410 case 0x10ec0284:
11411 case 0x10ec0292:
11412 spec->codec_variant = ALC269_TYPE_ALC284;
11413 break;
11414 case 0x10ec0293:
11415 spec->codec_variant = ALC269_TYPE_ALC293;
11416 break;
11417 case 0x10ec0286:
11418 case 0x10ec0288:
11419 spec->codec_variant = ALC269_TYPE_ALC286;
11420 break;
11421 case 0x10ec0298:
11422 spec->codec_variant = ALC269_TYPE_ALC298;
11423 break;
11424 case 0x10ec0235:
11425 case 0x10ec0255:
11426 spec->codec_variant = ALC269_TYPE_ALC255;
11427 spec->shutup = alc256_shutup;
11428 spec->init_hook = alc256_init;
11429 break;
11430 case 0x10ec0230:
11431 case 0x10ec0236:
11432 case 0x10ec0256:
11433 case 0x19e58326:
11434 spec->codec_variant = ALC269_TYPE_ALC256;
11435 spec->shutup = alc256_shutup;
11436 spec->init_hook = alc256_init;
11437 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11438 if (codec->core.vendor_id == 0x10ec0236 &&
11439 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11440 spec->en_3kpull_low = false;
11441 break;
11442 case 0x10ec0257:
11443 spec->codec_variant = ALC269_TYPE_ALC257;
11444 spec->shutup = alc256_shutup;
11445 spec->init_hook = alc256_init;
11446 spec->gen.mixer_nid = 0;
11447 spec->en_3kpull_low = false;
11448 break;
11449 case 0x10ec0215:
11450 case 0x10ec0245:
11451 case 0x10ec0285:
11452 case 0x10ec0289:
11453 if (alc_get_coef0(codec) & 0x0010)
11454 spec->codec_variant = ALC269_TYPE_ALC245;
11455 else
11456 spec->codec_variant = ALC269_TYPE_ALC215;
11457 spec->shutup = alc225_shutup;
11458 spec->init_hook = alc225_init;
11459 spec->gen.mixer_nid = 0;
11460 break;
11461 case 0x10ec0225:
11462 case 0x10ec0295:
11463 case 0x10ec0299:
11464 spec->codec_variant = ALC269_TYPE_ALC225;
11465 spec->shutup = alc225_shutup;
11466 spec->init_hook = alc225_init;
11467 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11468 break;
11469 case 0x10ec0287:
11470 spec->codec_variant = ALC269_TYPE_ALC287;
11471 spec->shutup = alc225_shutup;
11472 spec->init_hook = alc225_init;
11473 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11474 break;
11475 case 0x10ec0234:
11476 case 0x10ec0274:
11477 case 0x10ec0294:
11478 spec->codec_variant = ALC269_TYPE_ALC294;
11479 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11480 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11481 spec->init_hook = alc294_init;
11482 break;
11483 case 0x10ec0300:
11484 spec->codec_variant = ALC269_TYPE_ALC300;
11485 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11486 break;
11487 case 0x10ec0222:
11488 case 0x10ec0623:
11489 spec->codec_variant = ALC269_TYPE_ALC623;
11490 spec->shutup = alc222_shutup;
11491 spec->init_hook = alc222_init;
11492 break;
11493 case 0x10ec0700:
11494 case 0x10ec0701:
11495 case 0x10ec0703:
11496 case 0x10ec0711:
11497 spec->codec_variant = ALC269_TYPE_ALC700;
11498 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11499 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11500 spec->init_hook = alc294_init;
11501 break;
11502
11503 }
11504
11505 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11506 spec->has_alc5505_dsp = 1;
11507 spec->init_hook = alc5505_dsp_init;
11508 }
11509
11510 alc_pre_init(codec);
11511
11512 snd_hda_pick_fixup(codec, alc269_fixup_models,
11513 alc269_fixup_tbl, alc269_fixups);
11514 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11515 * the quirk breaks the latter (bko#214101).
11516 * Clear the wrong entry.
11517 */
11518 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11519 codec->core.vendor_id == 0x10ec0294) {
11520 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11521 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11522 }
11523
11524 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11525 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11526 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
11527 alc269_fixups);
11528 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11529
11530 alc_auto_parse_customize_define(codec);
11531
11532 if (has_cdefine_beep(codec))
11533 spec->gen.beep_nid = 0x01;
11534
11535 /* automatic parse from the BIOS config */
11536 err = alc269_parse_auto_config(codec);
11537 if (err < 0)
11538 goto error;
11539
11540 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11541 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11542 if (err < 0)
11543 goto error;
11544 }
11545
11546 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11547
11548 return 0;
11549
11550 error:
11551 alc_free(codec);
11552 return err;
11553 }
11554
11555 /*
11556 * ALC861
11557 */
11558
alc861_parse_auto_config(struct hda_codec * codec)11559 static int alc861_parse_auto_config(struct hda_codec *codec)
11560 {
11561 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11562 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11563 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11564 }
11565
11566 /* Pin config fixes */
11567 enum {
11568 ALC861_FIXUP_FSC_AMILO_PI1505,
11569 ALC861_FIXUP_AMP_VREF_0F,
11570 ALC861_FIXUP_NO_JACK_DETECT,
11571 ALC861_FIXUP_ASUS_A6RP,
11572 ALC660_FIXUP_ASUS_W7J,
11573 };
11574
11575 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
alc861_fixup_asus_amp_vref_0f(struct hda_codec * codec,const struct hda_fixup * fix,int action)11576 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11577 const struct hda_fixup *fix, int action)
11578 {
11579 struct alc_spec *spec = codec->spec;
11580 unsigned int val;
11581
11582 if (action != HDA_FIXUP_ACT_INIT)
11583 return;
11584 val = snd_hda_codec_get_pin_target(codec, 0x0f);
11585 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11586 val |= AC_PINCTL_IN_EN;
11587 val |= AC_PINCTL_VREF_50;
11588 snd_hda_set_pin_ctl(codec, 0x0f, val);
11589 spec->gen.keep_vref_in_automute = 1;
11590 }
11591
11592 /* suppress the jack-detection */
alc_fixup_no_jack_detect(struct hda_codec * codec,const struct hda_fixup * fix,int action)11593 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11594 const struct hda_fixup *fix, int action)
11595 {
11596 if (action == HDA_FIXUP_ACT_PRE_PROBE)
11597 codec->no_jack_detect = 1;
11598 }
11599
11600 static const struct hda_fixup alc861_fixups[] = {
11601 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
11602 .type = HDA_FIXUP_PINS,
11603 .v.pins = (const struct hda_pintbl[]) {
11604 { 0x0b, 0x0221101f }, /* HP */
11605 { 0x0f, 0x90170310 }, /* speaker */
11606 { }
11607 }
11608 },
11609 [ALC861_FIXUP_AMP_VREF_0F] = {
11610 .type = HDA_FIXUP_FUNC,
11611 .v.func = alc861_fixup_asus_amp_vref_0f,
11612 },
11613 [ALC861_FIXUP_NO_JACK_DETECT] = {
11614 .type = HDA_FIXUP_FUNC,
11615 .v.func = alc_fixup_no_jack_detect,
11616 },
11617 [ALC861_FIXUP_ASUS_A6RP] = {
11618 .type = HDA_FIXUP_FUNC,
11619 .v.func = alc861_fixup_asus_amp_vref_0f,
11620 .chained = true,
11621 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11622 },
11623 [ALC660_FIXUP_ASUS_W7J] = {
11624 .type = HDA_FIXUP_VERBS,
11625 .v.verbs = (const struct hda_verb[]) {
11626 /* ASUS W7J needs a magic pin setup on unused NID 0x10
11627 * for enabling outputs
11628 */
11629 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11630 { }
11631 },
11632 }
11633 };
11634
11635 static const struct hda_quirk alc861_fixup_tbl[] = {
11636 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11637 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11638 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11639 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11640 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11641 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11642 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11643 {}
11644 };
11645
11646 /*
11647 */
patch_alc861(struct hda_codec * codec)11648 static int patch_alc861(struct hda_codec *codec)
11649 {
11650 struct alc_spec *spec;
11651 int err;
11652
11653 err = alc_alloc_spec(codec, 0x15);
11654 if (err < 0)
11655 return err;
11656
11657 spec = codec->spec;
11658 if (has_cdefine_beep(codec))
11659 spec->gen.beep_nid = 0x23;
11660
11661 #ifdef CONFIG_PM
11662 spec->power_hook = alc_power_eapd;
11663 #endif
11664
11665 alc_pre_init(codec);
11666
11667 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11668 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11669
11670 /* automatic parse from the BIOS config */
11671 err = alc861_parse_auto_config(codec);
11672 if (err < 0)
11673 goto error;
11674
11675 if (!spec->gen.no_analog) {
11676 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11677 if (err < 0)
11678 goto error;
11679 }
11680
11681 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11682
11683 return 0;
11684
11685 error:
11686 alc_free(codec);
11687 return err;
11688 }
11689
11690 /*
11691 * ALC861-VD support
11692 *
11693 * Based on ALC882
11694 *
11695 * In addition, an independent DAC
11696 */
alc861vd_parse_auto_config(struct hda_codec * codec)11697 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11698 {
11699 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11700 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11701 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11702 }
11703
11704 enum {
11705 ALC660VD_FIX_ASUS_GPIO1,
11706 ALC861VD_FIX_DALLAS,
11707 };
11708
11709 /* exclude VREF80 */
alc861vd_fixup_dallas(struct hda_codec * codec,const struct hda_fixup * fix,int action)11710 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11711 const struct hda_fixup *fix, int action)
11712 {
11713 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11714 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11715 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11716 }
11717 }
11718
11719 /* reset GPIO1 */
alc660vd_fixup_asus_gpio1(struct hda_codec * codec,const struct hda_fixup * fix,int action)11720 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11721 const struct hda_fixup *fix, int action)
11722 {
11723 struct alc_spec *spec = codec->spec;
11724
11725 if (action == HDA_FIXUP_ACT_PRE_PROBE)
11726 spec->gpio_mask |= 0x02;
11727 alc_fixup_gpio(codec, action, 0x01);
11728 }
11729
11730 static const struct hda_fixup alc861vd_fixups[] = {
11731 [ALC660VD_FIX_ASUS_GPIO1] = {
11732 .type = HDA_FIXUP_FUNC,
11733 .v.func = alc660vd_fixup_asus_gpio1,
11734 },
11735 [ALC861VD_FIX_DALLAS] = {
11736 .type = HDA_FIXUP_FUNC,
11737 .v.func = alc861vd_fixup_dallas,
11738 },
11739 };
11740
11741 static const struct hda_quirk alc861vd_fixup_tbl[] = {
11742 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
11743 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
11744 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
11745 {}
11746 };
11747
11748 /*
11749 */
patch_alc861vd(struct hda_codec * codec)11750 static int patch_alc861vd(struct hda_codec *codec)
11751 {
11752 struct alc_spec *spec;
11753 int err;
11754
11755 err = alc_alloc_spec(codec, 0x0b);
11756 if (err < 0)
11757 return err;
11758
11759 spec = codec->spec;
11760 if (has_cdefine_beep(codec))
11761 spec->gen.beep_nid = 0x23;
11762
11763 spec->shutup = alc_eapd_shutup;
11764
11765 alc_pre_init(codec);
11766
11767 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11768 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11769
11770 /* automatic parse from the BIOS config */
11771 err = alc861vd_parse_auto_config(codec);
11772 if (err < 0)
11773 goto error;
11774
11775 if (!spec->gen.no_analog) {
11776 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11777 if (err < 0)
11778 goto error;
11779 }
11780
11781 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11782
11783 return 0;
11784
11785 error:
11786 alc_free(codec);
11787 return err;
11788 }
11789
11790 /*
11791 * ALC662 support
11792 *
11793 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11794 * configuration. Each pin widget can choose any input DACs and a mixer.
11795 * Each ADC is connected from a mixer of all inputs. This makes possible
11796 * 6-channel independent captures.
11797 *
11798 * In addition, an independent DAC for the multi-playback (not used in this
11799 * driver yet).
11800 */
11801
11802 /*
11803 * BIOS auto configuration
11804 */
11805
alc662_parse_auto_config(struct hda_codec * codec)11806 static int alc662_parse_auto_config(struct hda_codec *codec)
11807 {
11808 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
11809 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11810 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11811 const hda_nid_t *ssids;
11812
11813 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11814 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11815 codec->core.vendor_id == 0x10ec0671)
11816 ssids = alc663_ssids;
11817 else
11818 ssids = alc662_ssids;
11819 return alc_parse_auto_config(codec, alc662_ignore, ssids);
11820 }
11821
alc272_fixup_mario(struct hda_codec * codec,const struct hda_fixup * fix,int action)11822 static void alc272_fixup_mario(struct hda_codec *codec,
11823 const struct hda_fixup *fix, int action)
11824 {
11825 if (action != HDA_FIXUP_ACT_PRE_PROBE)
11826 return;
11827 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11828 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11829 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11830 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11831 (0 << AC_AMPCAP_MUTE_SHIFT)))
11832 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
11833 }
11834
11835 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11836 { .channels = 2,
11837 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11838 { .channels = 4,
11839 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11840 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11841 { }
11842 };
11843
11844 /* override the 2.1 chmap */
alc_fixup_bass_chmap(struct hda_codec * codec,const struct hda_fixup * fix,int action)11845 static void alc_fixup_bass_chmap(struct hda_codec *codec,
11846 const struct hda_fixup *fix, int action)
11847 {
11848 if (action == HDA_FIXUP_ACT_BUILD) {
11849 struct alc_spec *spec = codec->spec;
11850 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
11851 }
11852 }
11853
11854 /* avoid D3 for keeping GPIO up */
gpio_led_power_filter(struct hda_codec * codec,hda_nid_t nid,unsigned int power_state)11855 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11856 hda_nid_t nid,
11857 unsigned int power_state)
11858 {
11859 struct alc_spec *spec = codec->spec;
11860 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
11861 return AC_PWRST_D0;
11862 return power_state;
11863 }
11864
alc662_fixup_led_gpio1(struct hda_codec * codec,const struct hda_fixup * fix,int action)11865 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11866 const struct hda_fixup *fix, int action)
11867 {
11868 struct alc_spec *spec = codec->spec;
11869
11870 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
11871 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11872 spec->mute_led_polarity = 1;
11873 codec->power_filter = gpio_led_power_filter;
11874 }
11875 }
11876
alc662_usi_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)11877 static void alc662_usi_automute_hook(struct hda_codec *codec,
11878 struct hda_jack_callback *jack)
11879 {
11880 struct alc_spec *spec = codec->spec;
11881 int vref;
11882 msleep(200);
11883 snd_hda_gen_hp_automute(codec, jack);
11884
11885 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11886 msleep(100);
11887 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11888 vref);
11889 }
11890
alc662_fixup_usi_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)11891 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11892 const struct hda_fixup *fix, int action)
11893 {
11894 struct alc_spec *spec = codec->spec;
11895 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11896 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11897 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11898 }
11899 }
11900
alc662_aspire_ethos_mute_speakers(struct hda_codec * codec,struct hda_jack_callback * cb)11901 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11902 struct hda_jack_callback *cb)
11903 {
11904 /* surround speakers at 0x1b already get muted automatically when
11905 * headphones are plugged in, but we have to mute/unmute the remaining
11906 * channels manually:
11907 * 0x15 - front left/front right
11908 * 0x18 - front center/ LFE
11909 */
11910 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11911 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11912 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11913 } else {
11914 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11915 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11916 }
11917 }
11918
alc662_fixup_aspire_ethos_hp(struct hda_codec * codec,const struct hda_fixup * fix,int action)11919 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11920 const struct hda_fixup *fix, int action)
11921 {
11922 /* Pin 0x1b: shared headphones jack and surround speakers */
11923 if (!is_jack_detectable(codec, 0x1b))
11924 return;
11925
11926 switch (action) {
11927 case HDA_FIXUP_ACT_PRE_PROBE:
11928 snd_hda_jack_detect_enable_callback(codec, 0x1b,
11929 alc662_aspire_ethos_mute_speakers);
11930 /* subwoofer needs an extra GPIO setting to become audible */
11931 alc_setup_gpio(codec, 0x02);
11932 break;
11933 case HDA_FIXUP_ACT_INIT:
11934 /* Make sure to start in a correct state, i.e. if
11935 * headphones have been plugged in before powering up the system
11936 */
11937 alc662_aspire_ethos_mute_speakers(codec, NULL);
11938 break;
11939 }
11940 }
11941
alc671_fixup_hp_headset_mic2(struct hda_codec * codec,const struct hda_fixup * fix,int action)11942 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11943 const struct hda_fixup *fix, int action)
11944 {
11945 struct alc_spec *spec = codec->spec;
11946
11947 static const struct hda_pintbl pincfgs[] = {
11948 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11949 { 0x1b, 0x0181304f },
11950 { }
11951 };
11952
11953 switch (action) {
11954 case HDA_FIXUP_ACT_PRE_PROBE:
11955 spec->gen.mixer_nid = 0;
11956 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11957 snd_hda_apply_pincfgs(codec, pincfgs);
11958 break;
11959 case HDA_FIXUP_ACT_INIT:
11960 alc_write_coef_idx(codec, 0x19, 0xa054);
11961 break;
11962 }
11963 }
11964
alc897_hp_automute_hook(struct hda_codec * codec,struct hda_jack_callback * jack)11965 static void alc897_hp_automute_hook(struct hda_codec *codec,
11966 struct hda_jack_callback *jack)
11967 {
11968 struct alc_spec *spec = codec->spec;
11969 int vref;
11970
11971 snd_hda_gen_hp_automute(codec, jack);
11972 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11973 snd_hda_set_pin_ctl(codec, 0x1b, vref);
11974 }
11975
alc897_fixup_lenovo_headset_mic(struct hda_codec * codec,const struct hda_fixup * fix,int action)11976 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11977 const struct hda_fixup *fix, int action)
11978 {
11979 struct alc_spec *spec = codec->spec;
11980 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11981 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11982 spec->no_shutup_pins = 1;
11983 }
11984 if (action == HDA_FIXUP_ACT_PROBE) {
11985 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
11986 }
11987 }
11988
alc897_fixup_lenovo_headset_mode(struct hda_codec * codec,const struct hda_fixup * fix,int action)11989 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11990 const struct hda_fixup *fix, int action)
11991 {
11992 struct alc_spec *spec = codec->spec;
11993
11994 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11995 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11996 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11997 }
11998 }
11999
12000 static const struct coef_fw alc668_coefs[] = {
12001 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
12002 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
12003 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
12004 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
12005 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
12006 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
12007 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
12008 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
12009 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
12010 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
12011 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
12012 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
12013 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
12014 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
12015 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
12016 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
12017 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
12018 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
12019 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
12020 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
12021 {}
12022 };
12023
alc668_restore_default_value(struct hda_codec * codec)12024 static void alc668_restore_default_value(struct hda_codec *codec)
12025 {
12026 alc_process_coef_fw(codec, alc668_coefs);
12027 }
12028
12029 enum {
12030 ALC662_FIXUP_ASPIRE,
12031 ALC662_FIXUP_LED_GPIO1,
12032 ALC662_FIXUP_IDEAPAD,
12033 ALC272_FIXUP_MARIO,
12034 ALC662_FIXUP_CZC_ET26,
12035 ALC662_FIXUP_CZC_P10T,
12036 ALC662_FIXUP_SKU_IGNORE,
12037 ALC662_FIXUP_HP_RP5800,
12038 ALC662_FIXUP_ASUS_MODE1,
12039 ALC662_FIXUP_ASUS_MODE2,
12040 ALC662_FIXUP_ASUS_MODE3,
12041 ALC662_FIXUP_ASUS_MODE4,
12042 ALC662_FIXUP_ASUS_MODE5,
12043 ALC662_FIXUP_ASUS_MODE6,
12044 ALC662_FIXUP_ASUS_MODE7,
12045 ALC662_FIXUP_ASUS_MODE8,
12046 ALC662_FIXUP_NO_JACK_DETECT,
12047 ALC662_FIXUP_ZOTAC_Z68,
12048 ALC662_FIXUP_INV_DMIC,
12049 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12050 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
12051 ALC662_FIXUP_HEADSET_MODE,
12052 ALC668_FIXUP_HEADSET_MODE,
12053 ALC662_FIXUP_BASS_MODE4_CHMAP,
12054 ALC662_FIXUP_BASS_16,
12055 ALC662_FIXUP_BASS_1A,
12056 ALC662_FIXUP_BASS_CHMAP,
12057 ALC668_FIXUP_AUTO_MUTE,
12058 ALC668_FIXUP_DELL_DISABLE_AAMIX,
12059 ALC668_FIXUP_DELL_XPS13,
12060 ALC662_FIXUP_ASUS_Nx50,
12061 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12062 ALC668_FIXUP_ASUS_Nx51,
12063 ALC668_FIXUP_MIC_COEF,
12064 ALC668_FIXUP_ASUS_G751,
12065 ALC891_FIXUP_HEADSET_MODE,
12066 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12067 ALC662_FIXUP_ACER_VERITON,
12068 ALC892_FIXUP_ASROCK_MOBO,
12069 ALC662_FIXUP_USI_FUNC,
12070 ALC662_FIXUP_USI_HEADSET_MODE,
12071 ALC662_FIXUP_LENOVO_MULTI_CODECS,
12072 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
12073 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
12074 ALC671_FIXUP_HP_HEADSET_MIC2,
12075 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
12076 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
12077 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12078 ALC668_FIXUP_HEADSET_MIC,
12079 ALC668_FIXUP_MIC_DET_COEF,
12080 ALC897_FIXUP_LENOVO_HEADSET_MIC,
12081 ALC897_FIXUP_HEADSET_MIC_PIN,
12082 ALC897_FIXUP_HP_HSMIC_VERB,
12083 ALC897_FIXUP_LENOVO_HEADSET_MODE,
12084 ALC897_FIXUP_HEADSET_MIC_PIN2,
12085 ALC897_FIXUP_UNIS_H3C_X500S,
12086 ALC897_FIXUP_HEADSET_MIC_PIN3,
12087 };
12088
12089 static const struct hda_fixup alc662_fixups[] = {
12090 [ALC662_FIXUP_ASPIRE] = {
12091 .type = HDA_FIXUP_PINS,
12092 .v.pins = (const struct hda_pintbl[]) {
12093 { 0x15, 0x99130112 }, /* subwoofer */
12094 { }
12095 }
12096 },
12097 [ALC662_FIXUP_LED_GPIO1] = {
12098 .type = HDA_FIXUP_FUNC,
12099 .v.func = alc662_fixup_led_gpio1,
12100 },
12101 [ALC662_FIXUP_IDEAPAD] = {
12102 .type = HDA_FIXUP_PINS,
12103 .v.pins = (const struct hda_pintbl[]) {
12104 { 0x17, 0x99130112 }, /* subwoofer */
12105 { }
12106 },
12107 .chained = true,
12108 .chain_id = ALC662_FIXUP_LED_GPIO1,
12109 },
12110 [ALC272_FIXUP_MARIO] = {
12111 .type = HDA_FIXUP_FUNC,
12112 .v.func = alc272_fixup_mario,
12113 },
12114 [ALC662_FIXUP_CZC_ET26] = {
12115 .type = HDA_FIXUP_PINS,
12116 .v.pins = (const struct hda_pintbl[]) {
12117 {0x12, 0x403cc000},
12118 {0x14, 0x90170110}, /* speaker */
12119 {0x15, 0x411111f0},
12120 {0x16, 0x411111f0},
12121 {0x18, 0x01a19030}, /* mic */
12122 {0x19, 0x90a7013f}, /* int-mic */
12123 {0x1a, 0x01014020},
12124 {0x1b, 0x0121401f},
12125 {0x1c, 0x411111f0},
12126 {0x1d, 0x411111f0},
12127 {0x1e, 0x40478e35},
12128 {}
12129 },
12130 .chained = true,
12131 .chain_id = ALC662_FIXUP_SKU_IGNORE
12132 },
12133 [ALC662_FIXUP_CZC_P10T] = {
12134 .type = HDA_FIXUP_VERBS,
12135 .v.verbs = (const struct hda_verb[]) {
12136 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12137 {}
12138 }
12139 },
12140 [ALC662_FIXUP_SKU_IGNORE] = {
12141 .type = HDA_FIXUP_FUNC,
12142 .v.func = alc_fixup_sku_ignore,
12143 },
12144 [ALC662_FIXUP_HP_RP5800] = {
12145 .type = HDA_FIXUP_PINS,
12146 .v.pins = (const struct hda_pintbl[]) {
12147 { 0x14, 0x0221201f }, /* HP out */
12148 { }
12149 },
12150 .chained = true,
12151 .chain_id = ALC662_FIXUP_SKU_IGNORE
12152 },
12153 [ALC662_FIXUP_ASUS_MODE1] = {
12154 .type = HDA_FIXUP_PINS,
12155 .v.pins = (const struct hda_pintbl[]) {
12156 { 0x14, 0x99130110 }, /* speaker */
12157 { 0x18, 0x01a19c20 }, /* mic */
12158 { 0x19, 0x99a3092f }, /* int-mic */
12159 { 0x21, 0x0121401f }, /* HP out */
12160 { }
12161 },
12162 .chained = true,
12163 .chain_id = ALC662_FIXUP_SKU_IGNORE
12164 },
12165 [ALC662_FIXUP_ASUS_MODE2] = {
12166 .type = HDA_FIXUP_PINS,
12167 .v.pins = (const struct hda_pintbl[]) {
12168 { 0x14, 0x99130110 }, /* speaker */
12169 { 0x18, 0x01a19820 }, /* mic */
12170 { 0x19, 0x99a3092f }, /* int-mic */
12171 { 0x1b, 0x0121401f }, /* HP out */
12172 { }
12173 },
12174 .chained = true,
12175 .chain_id = ALC662_FIXUP_SKU_IGNORE
12176 },
12177 [ALC662_FIXUP_ASUS_MODE3] = {
12178 .type = HDA_FIXUP_PINS,
12179 .v.pins = (const struct hda_pintbl[]) {
12180 { 0x14, 0x99130110 }, /* speaker */
12181 { 0x15, 0x0121441f }, /* HP */
12182 { 0x18, 0x01a19840 }, /* mic */
12183 { 0x19, 0x99a3094f }, /* int-mic */
12184 { 0x21, 0x01211420 }, /* HP2 */
12185 { }
12186 },
12187 .chained = true,
12188 .chain_id = ALC662_FIXUP_SKU_IGNORE
12189 },
12190 [ALC662_FIXUP_ASUS_MODE4] = {
12191 .type = HDA_FIXUP_PINS,
12192 .v.pins = (const struct hda_pintbl[]) {
12193 { 0x14, 0x99130110 }, /* speaker */
12194 { 0x16, 0x99130111 }, /* speaker */
12195 { 0x18, 0x01a19840 }, /* mic */
12196 { 0x19, 0x99a3094f }, /* int-mic */
12197 { 0x21, 0x0121441f }, /* HP */
12198 { }
12199 },
12200 .chained = true,
12201 .chain_id = ALC662_FIXUP_SKU_IGNORE
12202 },
12203 [ALC662_FIXUP_ASUS_MODE5] = {
12204 .type = HDA_FIXUP_PINS,
12205 .v.pins = (const struct hda_pintbl[]) {
12206 { 0x14, 0x99130110 }, /* speaker */
12207 { 0x15, 0x0121441f }, /* HP */
12208 { 0x16, 0x99130111 }, /* speaker */
12209 { 0x18, 0x01a19840 }, /* mic */
12210 { 0x19, 0x99a3094f }, /* int-mic */
12211 { }
12212 },
12213 .chained = true,
12214 .chain_id = ALC662_FIXUP_SKU_IGNORE
12215 },
12216 [ALC662_FIXUP_ASUS_MODE6] = {
12217 .type = HDA_FIXUP_PINS,
12218 .v.pins = (const struct hda_pintbl[]) {
12219 { 0x14, 0x99130110 }, /* speaker */
12220 { 0x15, 0x01211420 }, /* HP2 */
12221 { 0x18, 0x01a19840 }, /* mic */
12222 { 0x19, 0x99a3094f }, /* int-mic */
12223 { 0x1b, 0x0121441f }, /* HP */
12224 { }
12225 },
12226 .chained = true,
12227 .chain_id = ALC662_FIXUP_SKU_IGNORE
12228 },
12229 [ALC662_FIXUP_ASUS_MODE7] = {
12230 .type = HDA_FIXUP_PINS,
12231 .v.pins = (const struct hda_pintbl[]) {
12232 { 0x14, 0x99130110 }, /* speaker */
12233 { 0x17, 0x99130111 }, /* speaker */
12234 { 0x18, 0x01a19840 }, /* mic */
12235 { 0x19, 0x99a3094f }, /* int-mic */
12236 { 0x1b, 0x01214020 }, /* HP */
12237 { 0x21, 0x0121401f }, /* HP */
12238 { }
12239 },
12240 .chained = true,
12241 .chain_id = ALC662_FIXUP_SKU_IGNORE
12242 },
12243 [ALC662_FIXUP_ASUS_MODE8] = {
12244 .type = HDA_FIXUP_PINS,
12245 .v.pins = (const struct hda_pintbl[]) {
12246 { 0x14, 0x99130110 }, /* speaker */
12247 { 0x12, 0x99a30970 }, /* int-mic */
12248 { 0x15, 0x01214020 }, /* HP */
12249 { 0x17, 0x99130111 }, /* speaker */
12250 { 0x18, 0x01a19840 }, /* mic */
12251 { 0x21, 0x0121401f }, /* HP */
12252 { }
12253 },
12254 .chained = true,
12255 .chain_id = ALC662_FIXUP_SKU_IGNORE
12256 },
12257 [ALC662_FIXUP_NO_JACK_DETECT] = {
12258 .type = HDA_FIXUP_FUNC,
12259 .v.func = alc_fixup_no_jack_detect,
12260 },
12261 [ALC662_FIXUP_ZOTAC_Z68] = {
12262 .type = HDA_FIXUP_PINS,
12263 .v.pins = (const struct hda_pintbl[]) {
12264 { 0x1b, 0x02214020 }, /* Front HP */
12265 { }
12266 }
12267 },
12268 [ALC662_FIXUP_INV_DMIC] = {
12269 .type = HDA_FIXUP_FUNC,
12270 .v.func = alc_fixup_inv_dmic,
12271 },
12272 [ALC668_FIXUP_DELL_XPS13] = {
12273 .type = HDA_FIXUP_FUNC,
12274 .v.func = alc_fixup_dell_xps13,
12275 .chained = true,
12276 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
12277 },
12278 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
12279 .type = HDA_FIXUP_FUNC,
12280 .v.func = alc_fixup_disable_aamix,
12281 .chained = true,
12282 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12283 },
12284 [ALC668_FIXUP_AUTO_MUTE] = {
12285 .type = HDA_FIXUP_FUNC,
12286 .v.func = alc_fixup_auto_mute_via_amp,
12287 .chained = true,
12288 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12289 },
12290 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12291 .type = HDA_FIXUP_PINS,
12292 .v.pins = (const struct hda_pintbl[]) {
12293 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12294 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12295 { }
12296 },
12297 .chained = true,
12298 .chain_id = ALC662_FIXUP_HEADSET_MODE
12299 },
12300 [ALC662_FIXUP_HEADSET_MODE] = {
12301 .type = HDA_FIXUP_FUNC,
12302 .v.func = alc_fixup_headset_mode_alc662,
12303 },
12304 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12305 .type = HDA_FIXUP_PINS,
12306 .v.pins = (const struct hda_pintbl[]) {
12307 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12308 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12309 { }
12310 },
12311 .chained = true,
12312 .chain_id = ALC668_FIXUP_HEADSET_MODE
12313 },
12314 [ALC668_FIXUP_HEADSET_MODE] = {
12315 .type = HDA_FIXUP_FUNC,
12316 .v.func = alc_fixup_headset_mode_alc668,
12317 },
12318 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12319 .type = HDA_FIXUP_FUNC,
12320 .v.func = alc_fixup_bass_chmap,
12321 .chained = true,
12322 .chain_id = ALC662_FIXUP_ASUS_MODE4
12323 },
12324 [ALC662_FIXUP_BASS_16] = {
12325 .type = HDA_FIXUP_PINS,
12326 .v.pins = (const struct hda_pintbl[]) {
12327 {0x16, 0x80106111}, /* bass speaker */
12328 {}
12329 },
12330 .chained = true,
12331 .chain_id = ALC662_FIXUP_BASS_CHMAP,
12332 },
12333 [ALC662_FIXUP_BASS_1A] = {
12334 .type = HDA_FIXUP_PINS,
12335 .v.pins = (const struct hda_pintbl[]) {
12336 {0x1a, 0x80106111}, /* bass speaker */
12337 {}
12338 },
12339 .chained = true,
12340 .chain_id = ALC662_FIXUP_BASS_CHMAP,
12341 },
12342 [ALC662_FIXUP_BASS_CHMAP] = {
12343 .type = HDA_FIXUP_FUNC,
12344 .v.func = alc_fixup_bass_chmap,
12345 },
12346 [ALC662_FIXUP_ASUS_Nx50] = {
12347 .type = HDA_FIXUP_FUNC,
12348 .v.func = alc_fixup_auto_mute_via_amp,
12349 .chained = true,
12350 .chain_id = ALC662_FIXUP_BASS_1A
12351 },
12352 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12353 .type = HDA_FIXUP_FUNC,
12354 .v.func = alc_fixup_headset_mode_alc668,
12355 .chain_id = ALC662_FIXUP_BASS_CHMAP
12356 },
12357 [ALC668_FIXUP_ASUS_Nx51] = {
12358 .type = HDA_FIXUP_PINS,
12359 .v.pins = (const struct hda_pintbl[]) {
12360 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12361 { 0x1a, 0x90170151 }, /* bass speaker */
12362 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12363 {}
12364 },
12365 .chained = true,
12366 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12367 },
12368 [ALC668_FIXUP_MIC_COEF] = {
12369 .type = HDA_FIXUP_VERBS,
12370 .v.verbs = (const struct hda_verb[]) {
12371 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12372 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12373 {}
12374 },
12375 },
12376 [ALC668_FIXUP_ASUS_G751] = {
12377 .type = HDA_FIXUP_PINS,
12378 .v.pins = (const struct hda_pintbl[]) {
12379 { 0x16, 0x0421101f }, /* HP */
12380 {}
12381 },
12382 .chained = true,
12383 .chain_id = ALC668_FIXUP_MIC_COEF
12384 },
12385 [ALC891_FIXUP_HEADSET_MODE] = {
12386 .type = HDA_FIXUP_FUNC,
12387 .v.func = alc_fixup_headset_mode,
12388 },
12389 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12390 .type = HDA_FIXUP_PINS,
12391 .v.pins = (const struct hda_pintbl[]) {
12392 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12393 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12394 { }
12395 },
12396 .chained = true,
12397 .chain_id = ALC891_FIXUP_HEADSET_MODE
12398 },
12399 [ALC662_FIXUP_ACER_VERITON] = {
12400 .type = HDA_FIXUP_PINS,
12401 .v.pins = (const struct hda_pintbl[]) {
12402 { 0x15, 0x50170120 }, /* no internal speaker */
12403 { }
12404 }
12405 },
12406 [ALC892_FIXUP_ASROCK_MOBO] = {
12407 .type = HDA_FIXUP_PINS,
12408 .v.pins = (const struct hda_pintbl[]) {
12409 { 0x15, 0x40f000f0 }, /* disabled */
12410 { 0x16, 0x40f000f0 }, /* disabled */
12411 { }
12412 }
12413 },
12414 [ALC662_FIXUP_USI_FUNC] = {
12415 .type = HDA_FIXUP_FUNC,
12416 .v.func = alc662_fixup_usi_headset_mic,
12417 },
12418 [ALC662_FIXUP_USI_HEADSET_MODE] = {
12419 .type = HDA_FIXUP_PINS,
12420 .v.pins = (const struct hda_pintbl[]) {
12421 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12422 { 0x18, 0x01a1903d },
12423 { }
12424 },
12425 .chained = true,
12426 .chain_id = ALC662_FIXUP_USI_FUNC
12427 },
12428 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12429 .type = HDA_FIXUP_FUNC,
12430 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12431 },
12432 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12433 .type = HDA_FIXUP_FUNC,
12434 .v.func = alc662_fixup_aspire_ethos_hp,
12435 },
12436 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12437 .type = HDA_FIXUP_PINS,
12438 .v.pins = (const struct hda_pintbl[]) {
12439 { 0x15, 0x92130110 }, /* front speakers */
12440 { 0x18, 0x99130111 }, /* center/subwoofer */
12441 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
12442 { }
12443 },
12444 .chained = true,
12445 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12446 },
12447 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
12448 .type = HDA_FIXUP_FUNC,
12449 .v.func = alc671_fixup_hp_headset_mic2,
12450 },
12451 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12452 .type = HDA_FIXUP_PINS,
12453 .v.pins = (const struct hda_pintbl[]) {
12454 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12455 { }
12456 },
12457 .chained = true,
12458 .chain_id = ALC662_FIXUP_USI_FUNC
12459 },
12460 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12461 .type = HDA_FIXUP_PINS,
12462 .v.pins = (const struct hda_pintbl[]) {
12463 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12464 { 0x1b, 0x0221144f },
12465 { }
12466 },
12467 .chained = true,
12468 .chain_id = ALC662_FIXUP_USI_FUNC
12469 },
12470 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12471 .type = HDA_FIXUP_PINS,
12472 .v.pins = (const struct hda_pintbl[]) {
12473 { 0x1b, 0x04a1112c },
12474 { }
12475 },
12476 .chained = true,
12477 .chain_id = ALC668_FIXUP_HEADSET_MIC
12478 },
12479 [ALC668_FIXUP_HEADSET_MIC] = {
12480 .type = HDA_FIXUP_FUNC,
12481 .v.func = alc269_fixup_headset_mic,
12482 .chained = true,
12483 .chain_id = ALC668_FIXUP_MIC_DET_COEF
12484 },
12485 [ALC668_FIXUP_MIC_DET_COEF] = {
12486 .type = HDA_FIXUP_VERBS,
12487 .v.verbs = (const struct hda_verb[]) {
12488 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12489 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12490 {}
12491 },
12492 },
12493 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12494 .type = HDA_FIXUP_FUNC,
12495 .v.func = alc897_fixup_lenovo_headset_mic,
12496 },
12497 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
12498 .type = HDA_FIXUP_PINS,
12499 .v.pins = (const struct hda_pintbl[]) {
12500 { 0x1a, 0x03a11050 },
12501 { }
12502 },
12503 .chained = true,
12504 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12505 },
12506 [ALC897_FIXUP_HP_HSMIC_VERB] = {
12507 .type = HDA_FIXUP_PINS,
12508 .v.pins = (const struct hda_pintbl[]) {
12509 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12510 { }
12511 },
12512 },
12513 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12514 .type = HDA_FIXUP_FUNC,
12515 .v.func = alc897_fixup_lenovo_headset_mode,
12516 },
12517 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12518 .type = HDA_FIXUP_PINS,
12519 .v.pins = (const struct hda_pintbl[]) {
12520 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12521 { }
12522 },
12523 .chained = true,
12524 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12525 },
12526 [ALC897_FIXUP_UNIS_H3C_X500S] = {
12527 .type = HDA_FIXUP_VERBS,
12528 .v.verbs = (const struct hda_verb[]) {
12529 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12530 {}
12531 },
12532 },
12533 [ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12534 .type = HDA_FIXUP_PINS,
12535 .v.pins = (const struct hda_pintbl[]) {
12536 { 0x19, 0x03a11050 }, /* use as headset mic */
12537 { }
12538 },
12539 },
12540 };
12541
12542 static const struct hda_quirk alc662_fixup_tbl[] = {
12543 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12544 SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12545 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12546 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12547 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12548 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12549 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12550 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12551 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12552 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12553 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12554 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12555 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12556 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12557 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12558 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12559 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12560 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12561 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12562 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12563 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12564 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12565 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12566 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12567 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12568 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12569 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12570 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12571 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12572 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12573 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12574 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12575 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12576 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12577 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12578 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12579 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12580 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12581 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12582 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12583 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12584 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12585 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12586 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12587 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12588 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12589 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12590 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12591 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12592 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12593 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12594 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12595 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12596 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12597 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12598 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12599 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12600 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12601 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12602 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12603 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12604 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12605 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12606 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12607 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12608 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12609
12610 #if 0
12611 /* Below is a quirk table taken from the old code.
12612 * Basically the device should work as is without the fixup table.
12613 * If BIOS doesn't give a proper info, enable the corresponding
12614 * fixup entry.
12615 */
12616 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12617 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12618 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12619 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12620 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12621 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12622 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12623 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12624 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12625 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12626 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12627 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12628 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12629 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12630 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12631 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12632 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12633 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12634 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12635 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12636 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12637 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12638 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12639 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12640 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12641 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12642 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12643 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12644 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12645 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12646 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12647 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12648 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12649 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12650 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12651 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12652 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12653 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12654 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12655 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12656 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12657 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12658 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12659 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12660 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12661 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12662 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12663 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12664 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12665 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12666 #endif
12667 {}
12668 };
12669
12670 static const struct hda_model_fixup alc662_fixup_models[] = {
12671 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12672 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12673 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
12674 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12675 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12676 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12677 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12678 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12679 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12680 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12681 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12682 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12683 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12684 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12685 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12686 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12687 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12688 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12689 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12690 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12691 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12692 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12693 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12694 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12695 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12696 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12697 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12698 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12699 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12700 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12701 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12702 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12703 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12704 {}
12705 };
12706
12707 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12708 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12709 {0x17, 0x02211010},
12710 {0x18, 0x01a19030},
12711 {0x1a, 0x01813040},
12712 {0x21, 0x01014020}),
12713 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12714 {0x16, 0x01813030},
12715 {0x17, 0x02211010},
12716 {0x18, 0x01a19040},
12717 {0x21, 0x01014020}),
12718 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12719 {0x14, 0x01014010},
12720 {0x18, 0x01a19020},
12721 {0x1a, 0x0181302f},
12722 {0x1b, 0x0221401f}),
12723 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12724 {0x12, 0x99a30130},
12725 {0x14, 0x90170110},
12726 {0x15, 0x0321101f},
12727 {0x16, 0x03011020}),
12728 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12729 {0x12, 0x99a30140},
12730 {0x14, 0x90170110},
12731 {0x15, 0x0321101f},
12732 {0x16, 0x03011020}),
12733 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12734 {0x12, 0x99a30150},
12735 {0x14, 0x90170110},
12736 {0x15, 0x0321101f},
12737 {0x16, 0x03011020}),
12738 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12739 {0x14, 0x90170110},
12740 {0x15, 0x0321101f},
12741 {0x16, 0x03011020}),
12742 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12743 {0x12, 0x90a60130},
12744 {0x14, 0x90170110},
12745 {0x15, 0x0321101f}),
12746 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12747 {0x14, 0x01014010},
12748 {0x17, 0x90170150},
12749 {0x19, 0x02a11060},
12750 {0x1b, 0x01813030},
12751 {0x21, 0x02211020}),
12752 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12753 {0x14, 0x01014010},
12754 {0x18, 0x01a19040},
12755 {0x1b, 0x01813030},
12756 {0x21, 0x02211020}),
12757 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12758 {0x14, 0x01014020},
12759 {0x17, 0x90170110},
12760 {0x18, 0x01a19050},
12761 {0x1b, 0x01813040},
12762 {0x21, 0x02211030}),
12763 {}
12764 };
12765
12766 /*
12767 */
patch_alc662(struct hda_codec * codec)12768 static int patch_alc662(struct hda_codec *codec)
12769 {
12770 struct alc_spec *spec;
12771 int err;
12772
12773 err = alc_alloc_spec(codec, 0x0b);
12774 if (err < 0)
12775 return err;
12776
12777 spec = codec->spec;
12778
12779 spec->shutup = alc_eapd_shutup;
12780
12781 /* handle multiple HPs as is */
12782 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12783
12784 alc_fix_pll_init(codec, 0x20, 0x04, 15);
12785
12786 switch (codec->core.vendor_id) {
12787 case 0x10ec0668:
12788 spec->init_hook = alc668_restore_default_value;
12789 break;
12790 }
12791
12792 alc_pre_init(codec);
12793
12794 snd_hda_pick_fixup(codec, alc662_fixup_models,
12795 alc662_fixup_tbl, alc662_fixups);
12796 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
12797 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12798
12799 alc_auto_parse_customize_define(codec);
12800
12801 if (has_cdefine_beep(codec))
12802 spec->gen.beep_nid = 0x01;
12803
12804 if ((alc_get_coef0(codec) & (1 << 14)) &&
12805 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
12806 spec->cdefine.platform_type == 1) {
12807 err = alc_codec_rename(codec, "ALC272X");
12808 if (err < 0)
12809 goto error;
12810 }
12811
12812 /* automatic parse from the BIOS config */
12813 err = alc662_parse_auto_config(codec);
12814 if (err < 0)
12815 goto error;
12816
12817 if (!spec->gen.no_analog && spec->gen.beep_nid) {
12818 switch (codec->core.vendor_id) {
12819 case 0x10ec0662:
12820 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12821 break;
12822 case 0x10ec0272:
12823 case 0x10ec0663:
12824 case 0x10ec0665:
12825 case 0x10ec0668:
12826 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
12827 break;
12828 case 0x10ec0273:
12829 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
12830 break;
12831 }
12832 if (err < 0)
12833 goto error;
12834 }
12835
12836 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12837
12838 return 0;
12839
12840 error:
12841 alc_free(codec);
12842 return err;
12843 }
12844
12845 /*
12846 * ALC680 support
12847 */
12848
alc680_parse_auto_config(struct hda_codec * codec)12849 static int alc680_parse_auto_config(struct hda_codec *codec)
12850 {
12851 return alc_parse_auto_config(codec, NULL, NULL);
12852 }
12853
12854 /*
12855 */
patch_alc680(struct hda_codec * codec)12856 static int patch_alc680(struct hda_codec *codec)
12857 {
12858 int err;
12859
12860 /* ALC680 has no aa-loopback mixer */
12861 err = alc_alloc_spec(codec, 0);
12862 if (err < 0)
12863 return err;
12864
12865 /* automatic parse from the BIOS config */
12866 err = alc680_parse_auto_config(codec);
12867 if (err < 0) {
12868 alc_free(codec);
12869 return err;
12870 }
12871
12872 return 0;
12873 }
12874
12875 /*
12876 * patch entries
12877 */
12878 static const struct hda_device_id snd_hda_id_realtek[] = {
12879 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
12880 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
12881 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
12882 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
12883 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
12884 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12885 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
12886 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
12887 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
12888 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
12889 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
12890 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12891 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
12892 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
12893 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12894 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12895 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12896 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12897 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12898 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12899 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
12900 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
12901 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12902 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12903 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12904 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12905 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12906 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
12907 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
12908 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
12909 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
12910 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
12911 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
12912 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12913 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12914 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
12915 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
12916 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
12917 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
12918 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
12919 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
12920 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
12921 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12922 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12923 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12924 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12925 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12926 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12927 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12928 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12929 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12930 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12931 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12932 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12933 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12934 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
12935 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12936 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12937 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
12938 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
12939 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
12940 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12941 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12942 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12943 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12944 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12945 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12946 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12947 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12948 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12949 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12950 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
12951 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
12952 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12953 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
12954 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
12955 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
12956 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
12957 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
12958 {} /* terminator */
12959 };
12960 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
12961
12962 MODULE_LICENSE("GPL");
12963 MODULE_DESCRIPTION("Realtek HD-audio codec");
12964
12965 static struct hda_codec_driver realtek_driver = {
12966 .id = snd_hda_id_realtek,
12967 };
12968
12969 module_hda_codec_driver(realtek_driver);
12970