xref: /openbmc/linux/sound/pci/hda/patch_realtek.c (revision 2f49e05d)
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_jack.h"
28 #include "hda_generic.h"
29 #include "hda_component.h"
30 
31 /* keep halting ALC5505 DSP, for power saving */
32 #define HALT_REALTEK_ALC5505
33 
34 /* extra amp-initialization sequence types */
35 enum {
36 	ALC_INIT_UNDEFINED,
37 	ALC_INIT_NONE,
38 	ALC_INIT_DEFAULT,
39 };
40 
41 enum {
42 	ALC_HEADSET_MODE_UNKNOWN,
43 	ALC_HEADSET_MODE_UNPLUGGED,
44 	ALC_HEADSET_MODE_HEADSET,
45 	ALC_HEADSET_MODE_MIC,
46 	ALC_HEADSET_MODE_HEADPHONE,
47 };
48 
49 enum {
50 	ALC_HEADSET_TYPE_UNKNOWN,
51 	ALC_HEADSET_TYPE_CTIA,
52 	ALC_HEADSET_TYPE_OMTP,
53 };
54 
55 enum {
56 	ALC_KEY_MICMUTE_INDEX,
57 };
58 
59 struct alc_customize_define {
60 	unsigned int  sku_cfg;
61 	unsigned char port_connectivity;
62 	unsigned char check_sum;
63 	unsigned char customization;
64 	unsigned char external_amp;
65 	unsigned int  enable_pcbeep:1;
66 	unsigned int  platform_type:1;
67 	unsigned int  swap:1;
68 	unsigned int  override:1;
69 	unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
70 };
71 
72 struct alc_coef_led {
73 	unsigned int idx;
74 	unsigned int mask;
75 	unsigned int on;
76 	unsigned int off;
77 };
78 
79 struct alc_spec {
80 	struct hda_gen_spec gen; /* must be at head */
81 
82 	/* codec parameterization */
83 	struct alc_customize_define cdefine;
84 	unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 
86 	/* GPIO bits */
87 	unsigned int gpio_mask;
88 	unsigned int gpio_dir;
89 	unsigned int gpio_data;
90 	bool gpio_write_delay;	/* add a delay before writing gpio_data */
91 
92 	/* mute LED for HP laptops, see vref_mute_led_set() */
93 	int mute_led_polarity;
94 	int micmute_led_polarity;
95 	hda_nid_t mute_led_nid;
96 	hda_nid_t cap_mute_led_nid;
97 
98 	unsigned int gpio_mute_led_mask;
99 	unsigned int gpio_mic_led_mask;
100 	struct alc_coef_led mute_led_coef;
101 	struct alc_coef_led mic_led_coef;
102 	struct mutex coef_mutex;
103 
104 	hda_nid_t headset_mic_pin;
105 	hda_nid_t headphone_mic_pin;
106 	int current_headset_mode;
107 	int current_headset_type;
108 
109 	/* hooks */
110 	void (*init_hook)(struct hda_codec *codec);
111 #ifdef CONFIG_PM
112 	void (*power_hook)(struct hda_codec *codec);
113 #endif
114 	void (*shutup)(struct hda_codec *codec);
115 
116 	int init_amp;
117 	int codec_variant;	/* flag for other variants */
118 	unsigned int has_alc5505_dsp:1;
119 	unsigned int no_depop_delay:1;
120 	unsigned int done_hp_init:1;
121 	unsigned int no_shutup_pins:1;
122 	unsigned int ultra_low_power:1;
123 	unsigned int has_hs_key:1;
124 	unsigned int no_internal_mic_pin:1;
125 	unsigned int en_3kpull_low:1;
126 
127 	/* for PLL fix */
128 	hda_nid_t pll_nid;
129 	unsigned int pll_coef_idx, pll_coef_bit;
130 	unsigned int coef0;
131 	struct input_dev *kb_dev;
132 	u8 alc_mute_keycode_map[1];
133 
134 	/* component binding */
135 	struct component_match *match;
136 	struct hda_component comps[HDA_MAX_COMPONENTS];
137 };
138 
139 /*
140  * COEF access helper functions
141  */
142 
143 static void coef_mutex_lock(struct hda_codec *codec)
144 {
145 	struct alc_spec *spec = codec->spec;
146 
147 	snd_hda_power_up_pm(codec);
148 	mutex_lock(&spec->coef_mutex);
149 }
150 
151 static void coef_mutex_unlock(struct hda_codec *codec)
152 {
153 	struct alc_spec *spec = codec->spec;
154 
155 	mutex_unlock(&spec->coef_mutex);
156 	snd_hda_power_down_pm(codec);
157 }
158 
159 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
160 				 unsigned int coef_idx)
161 {
162 	unsigned int val;
163 
164 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
165 	val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
166 	return val;
167 }
168 
169 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
170 			       unsigned int coef_idx)
171 {
172 	unsigned int val;
173 
174 	coef_mutex_lock(codec);
175 	val = __alc_read_coefex_idx(codec, nid, coef_idx);
176 	coef_mutex_unlock(codec);
177 	return val;
178 }
179 
180 #define alc_read_coef_idx(codec, coef_idx) \
181 	alc_read_coefex_idx(codec, 0x20, coef_idx)
182 
183 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
184 				   unsigned int coef_idx, unsigned int coef_val)
185 {
186 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
187 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
188 }
189 
190 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
191 				 unsigned int coef_idx, unsigned int coef_val)
192 {
193 	coef_mutex_lock(codec);
194 	__alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
195 	coef_mutex_unlock(codec);
196 }
197 
198 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
199 	alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
200 
201 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
202 				    unsigned int coef_idx, unsigned int mask,
203 				    unsigned int bits_set)
204 {
205 	unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
206 
207 	if (val != -1)
208 		__alc_write_coefex_idx(codec, nid, coef_idx,
209 				       (val & ~mask) | bits_set);
210 }
211 
212 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
213 				  unsigned int coef_idx, unsigned int mask,
214 				  unsigned int bits_set)
215 {
216 	coef_mutex_lock(codec);
217 	__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
218 	coef_mutex_unlock(codec);
219 }
220 
221 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set)	\
222 	alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
223 
224 /* a special bypass for COEF 0; read the cached value at the second time */
225 static unsigned int alc_get_coef0(struct hda_codec *codec)
226 {
227 	struct alc_spec *spec = codec->spec;
228 
229 	if (!spec->coef0)
230 		spec->coef0 = alc_read_coef_idx(codec, 0);
231 	return spec->coef0;
232 }
233 
234 /* coef writes/updates batch */
235 struct coef_fw {
236 	unsigned char nid;
237 	unsigned char idx;
238 	unsigned short mask;
239 	unsigned short val;
240 };
241 
242 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
243 	{ .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
244 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
245 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
246 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
247 
248 static void alc_process_coef_fw(struct hda_codec *codec,
249 				const struct coef_fw *fw)
250 {
251 	coef_mutex_lock(codec);
252 	for (; fw->nid; fw++) {
253 		if (fw->mask == (unsigned short)-1)
254 			__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
255 		else
256 			__alc_update_coefex_idx(codec, fw->nid, fw->idx,
257 						fw->mask, fw->val);
258 	}
259 	coef_mutex_unlock(codec);
260 }
261 
262 /*
263  * GPIO setup tables, used in initialization
264  */
265 
266 /* Enable GPIO mask and set output */
267 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
268 {
269 	struct alc_spec *spec = codec->spec;
270 
271 	spec->gpio_mask |= mask;
272 	spec->gpio_dir |= mask;
273 	spec->gpio_data |= mask;
274 }
275 
276 static void alc_write_gpio_data(struct hda_codec *codec)
277 {
278 	struct alc_spec *spec = codec->spec;
279 
280 	snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
281 			    spec->gpio_data);
282 }
283 
284 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
285 				 bool on)
286 {
287 	struct alc_spec *spec = codec->spec;
288 	unsigned int oldval = spec->gpio_data;
289 
290 	if (on)
291 		spec->gpio_data |= mask;
292 	else
293 		spec->gpio_data &= ~mask;
294 	if (oldval != spec->gpio_data)
295 		alc_write_gpio_data(codec);
296 }
297 
298 static void alc_write_gpio(struct hda_codec *codec)
299 {
300 	struct alc_spec *spec = codec->spec;
301 
302 	if (!spec->gpio_mask)
303 		return;
304 
305 	snd_hda_codec_write(codec, codec->core.afg, 0,
306 			    AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
307 	snd_hda_codec_write(codec, codec->core.afg, 0,
308 			    AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
309 	if (spec->gpio_write_delay)
310 		msleep(1);
311 	alc_write_gpio_data(codec);
312 }
313 
314 static void alc_fixup_gpio(struct hda_codec *codec, int action,
315 			   unsigned int mask)
316 {
317 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
318 		alc_setup_gpio(codec, mask);
319 }
320 
321 static void alc_fixup_gpio1(struct hda_codec *codec,
322 			    const struct hda_fixup *fix, int action)
323 {
324 	alc_fixup_gpio(codec, action, 0x01);
325 }
326 
327 static void alc_fixup_gpio2(struct hda_codec *codec,
328 			    const struct hda_fixup *fix, int action)
329 {
330 	alc_fixup_gpio(codec, action, 0x02);
331 }
332 
333 static void alc_fixup_gpio3(struct hda_codec *codec,
334 			    const struct hda_fixup *fix, int action)
335 {
336 	alc_fixup_gpio(codec, action, 0x03);
337 }
338 
339 static void alc_fixup_gpio4(struct hda_codec *codec,
340 			    const struct hda_fixup *fix, int action)
341 {
342 	alc_fixup_gpio(codec, action, 0x04);
343 }
344 
345 static void alc_fixup_micmute_led(struct hda_codec *codec,
346 				  const struct hda_fixup *fix, int action)
347 {
348 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
349 		snd_hda_gen_add_micmute_led_cdev(codec, NULL);
350 }
351 
352 /*
353  * Fix hardware PLL issue
354  * On some codecs, the analog PLL gating control must be off while
355  * the default value is 1.
356  */
357 static void alc_fix_pll(struct hda_codec *codec)
358 {
359 	struct alc_spec *spec = codec->spec;
360 
361 	if (spec->pll_nid)
362 		alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
363 				      1 << spec->pll_coef_bit, 0);
364 }
365 
366 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
367 			     unsigned int coef_idx, unsigned int coef_bit)
368 {
369 	struct alc_spec *spec = codec->spec;
370 	spec->pll_nid = nid;
371 	spec->pll_coef_idx = coef_idx;
372 	spec->pll_coef_bit = coef_bit;
373 	alc_fix_pll(codec);
374 }
375 
376 /* update the master volume per volume-knob's unsol event */
377 static void alc_update_knob_master(struct hda_codec *codec,
378 				   struct hda_jack_callback *jack)
379 {
380 	unsigned int val;
381 	struct snd_kcontrol *kctl;
382 	struct snd_ctl_elem_value *uctl;
383 
384 	kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
385 	if (!kctl)
386 		return;
387 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
388 	if (!uctl)
389 		return;
390 	val = snd_hda_codec_read(codec, jack->nid, 0,
391 				 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
392 	val &= HDA_AMP_VOLMASK;
393 	uctl->value.integer.value[0] = val;
394 	uctl->value.integer.value[1] = val;
395 	kctl->put(kctl, uctl);
396 	kfree(uctl);
397 }
398 
399 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
400 {
401 	/* For some reason, the res given from ALC880 is broken.
402 	   Here we adjust it properly. */
403 	snd_hda_jack_unsol_event(codec, res >> 2);
404 }
405 
406 /* Change EAPD to verb control */
407 static void alc_fill_eapd_coef(struct hda_codec *codec)
408 {
409 	int coef;
410 
411 	coef = alc_get_coef0(codec);
412 
413 	switch (codec->core.vendor_id) {
414 	case 0x10ec0262:
415 		alc_update_coef_idx(codec, 0x7, 0, 1<<5);
416 		break;
417 	case 0x10ec0267:
418 	case 0x10ec0268:
419 		alc_update_coef_idx(codec, 0x7, 0, 1<<13);
420 		break;
421 	case 0x10ec0269:
422 		if ((coef & 0x00f0) == 0x0010)
423 			alc_update_coef_idx(codec, 0xd, 0, 1<<14);
424 		if ((coef & 0x00f0) == 0x0020)
425 			alc_update_coef_idx(codec, 0x4, 1<<15, 0);
426 		if ((coef & 0x00f0) == 0x0030)
427 			alc_update_coef_idx(codec, 0x10, 1<<9, 0);
428 		break;
429 	case 0x10ec0280:
430 	case 0x10ec0284:
431 	case 0x10ec0290:
432 	case 0x10ec0292:
433 		alc_update_coef_idx(codec, 0x4, 1<<15, 0);
434 		break;
435 	case 0x10ec0225:
436 	case 0x10ec0295:
437 	case 0x10ec0299:
438 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
439 		fallthrough;
440 	case 0x10ec0215:
441 	case 0x10ec0285:
442 	case 0x10ec0289:
443 		alc_update_coef_idx(codec, 0x36, 1<<13, 0);
444 		fallthrough;
445 	case 0x10ec0230:
446 	case 0x10ec0233:
447 	case 0x10ec0235:
448 	case 0x10ec0236:
449 	case 0x10ec0245:
450 	case 0x10ec0255:
451 	case 0x10ec0256:
452 	case 0x19e58326:
453 	case 0x10ec0257:
454 	case 0x10ec0282:
455 	case 0x10ec0283:
456 	case 0x10ec0286:
457 	case 0x10ec0288:
458 	case 0x10ec0298:
459 	case 0x10ec0300:
460 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
461 		break;
462 	case 0x10ec0275:
463 		alc_update_coef_idx(codec, 0xe, 0, 1<<0);
464 		break;
465 	case 0x10ec0287:
466 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
467 		alc_write_coef_idx(codec, 0x8, 0x4ab7);
468 		break;
469 	case 0x10ec0293:
470 		alc_update_coef_idx(codec, 0xa, 1<<13, 0);
471 		break;
472 	case 0x10ec0234:
473 	case 0x10ec0274:
474 	case 0x10ec0294:
475 	case 0x10ec0700:
476 	case 0x10ec0701:
477 	case 0x10ec0703:
478 	case 0x10ec0711:
479 		alc_update_coef_idx(codec, 0x10, 1<<15, 0);
480 		break;
481 	case 0x10ec0662:
482 		if ((coef & 0x00f0) == 0x0030)
483 			alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
484 		break;
485 	case 0x10ec0272:
486 	case 0x10ec0273:
487 	case 0x10ec0663:
488 	case 0x10ec0665:
489 	case 0x10ec0670:
490 	case 0x10ec0671:
491 	case 0x10ec0672:
492 		alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
493 		break;
494 	case 0x10ec0222:
495 	case 0x10ec0623:
496 		alc_update_coef_idx(codec, 0x19, 1<<13, 0);
497 		break;
498 	case 0x10ec0668:
499 		alc_update_coef_idx(codec, 0x7, 3<<13, 0);
500 		break;
501 	case 0x10ec0867:
502 		alc_update_coef_idx(codec, 0x4, 1<<10, 0);
503 		break;
504 	case 0x10ec0888:
505 		if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
506 			alc_update_coef_idx(codec, 0x7, 1<<5, 0);
507 		break;
508 	case 0x10ec0892:
509 	case 0x10ec0897:
510 		alc_update_coef_idx(codec, 0x7, 1<<5, 0);
511 		break;
512 	case 0x10ec0899:
513 	case 0x10ec0900:
514 	case 0x10ec0b00:
515 	case 0x10ec1168:
516 	case 0x10ec1220:
517 		alc_update_coef_idx(codec, 0x7, 1<<1, 0);
518 		break;
519 	}
520 }
521 
522 /* additional initialization for ALC888 variants */
523 static void alc888_coef_init(struct hda_codec *codec)
524 {
525 	switch (alc_get_coef0(codec) & 0x00f0) {
526 	/* alc888-VA */
527 	case 0x00:
528 	/* alc888-VB */
529 	case 0x10:
530 		alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
531 		break;
532 	}
533 }
534 
535 /* turn on/off EAPD control (only if available) */
536 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
537 {
538 	if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
539 		return;
540 	if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
541 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
542 				    on ? 2 : 0);
543 }
544 
545 /* turn on/off EAPD controls of the codec */
546 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
547 {
548 	/* We currently only handle front, HP */
549 	static const hda_nid_t pins[] = {
550 		0x0f, 0x10, 0x14, 0x15, 0x17, 0
551 	};
552 	const hda_nid_t *p;
553 	for (p = pins; *p; p++)
554 		set_eapd(codec, *p, on);
555 }
556 
557 static int find_ext_mic_pin(struct hda_codec *codec);
558 
559 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
560 {
561 	const struct hda_pincfg *pin;
562 	int mic_pin = find_ext_mic_pin(codec);
563 	int i;
564 
565 	/* don't shut up pins when unloading the driver; otherwise it breaks
566 	 * the default pin setup at the next load of the driver
567 	 */
568 	if (codec->bus->shutdown)
569 		return;
570 
571 	snd_array_for_each(&codec->init_pins, i, pin) {
572 		/* use read here for syncing after issuing each verb */
573 		if (pin->nid != mic_pin)
574 			snd_hda_codec_read(codec, pin->nid, 0,
575 					AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
576 	}
577 
578 	codec->pins_shutup = 1;
579 }
580 
581 static void alc_shutup_pins(struct hda_codec *codec)
582 {
583 	struct alc_spec *spec = codec->spec;
584 
585 	switch (codec->core.vendor_id) {
586 	case 0x10ec0236:
587 	case 0x10ec0256:
588 	case 0x19e58326:
589 	case 0x10ec0283:
590 	case 0x10ec0285:
591 	case 0x10ec0286:
592 	case 0x10ec0287:
593 	case 0x10ec0288:
594 	case 0x10ec0295:
595 	case 0x10ec0298:
596 		alc_headset_mic_no_shutup(codec);
597 		break;
598 	default:
599 		if (!spec->no_shutup_pins)
600 			snd_hda_shutup_pins(codec);
601 		break;
602 	}
603 }
604 
605 /* generic shutup callback;
606  * just turning off EAPD and a little pause for avoiding pop-noise
607  */
608 static void alc_eapd_shutup(struct hda_codec *codec)
609 {
610 	struct alc_spec *spec = codec->spec;
611 
612 	alc_auto_setup_eapd(codec, false);
613 	if (!spec->no_depop_delay)
614 		msleep(200);
615 	alc_shutup_pins(codec);
616 }
617 
618 /* generic EAPD initialization */
619 static void alc_auto_init_amp(struct hda_codec *codec, int type)
620 {
621 	alc_auto_setup_eapd(codec, true);
622 	alc_write_gpio(codec);
623 	switch (type) {
624 	case ALC_INIT_DEFAULT:
625 		switch (codec->core.vendor_id) {
626 		case 0x10ec0260:
627 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
628 			break;
629 		case 0x10ec0880:
630 		case 0x10ec0882:
631 		case 0x10ec0883:
632 		case 0x10ec0885:
633 			alc_update_coef_idx(codec, 7, 0, 0x2030);
634 			break;
635 		case 0x10ec0888:
636 			alc888_coef_init(codec);
637 			break;
638 		}
639 		break;
640 	}
641 }
642 
643 /* get a primary headphone pin if available */
644 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
645 {
646 	if (spec->gen.autocfg.hp_pins[0])
647 		return spec->gen.autocfg.hp_pins[0];
648 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
649 		return spec->gen.autocfg.line_out_pins[0];
650 	return 0;
651 }
652 
653 /*
654  * Realtek SSID verification
655  */
656 
657 /* Could be any non-zero and even value. When used as fixup, tells
658  * the driver to ignore any present sku defines.
659  */
660 #define ALC_FIXUP_SKU_IGNORE (2)
661 
662 static void alc_fixup_sku_ignore(struct hda_codec *codec,
663 				 const struct hda_fixup *fix, int action)
664 {
665 	struct alc_spec *spec = codec->spec;
666 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
667 		spec->cdefine.fixup = 1;
668 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
669 	}
670 }
671 
672 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
673 				    const struct hda_fixup *fix, int action)
674 {
675 	struct alc_spec *spec = codec->spec;
676 
677 	if (action == HDA_FIXUP_ACT_PROBE) {
678 		spec->no_depop_delay = 1;
679 		codec->depop_delay = 0;
680 	}
681 }
682 
683 static int alc_auto_parse_customize_define(struct hda_codec *codec)
684 {
685 	unsigned int ass, tmp, i;
686 	unsigned nid = 0;
687 	struct alc_spec *spec = codec->spec;
688 
689 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
690 
691 	if (spec->cdefine.fixup) {
692 		ass = spec->cdefine.sku_cfg;
693 		if (ass == ALC_FIXUP_SKU_IGNORE)
694 			return -1;
695 		goto do_sku;
696 	}
697 
698 	if (!codec->bus->pci)
699 		return -1;
700 	ass = codec->core.subsystem_id & 0xffff;
701 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
702 		goto do_sku;
703 
704 	nid = 0x1d;
705 	if (codec->core.vendor_id == 0x10ec0260)
706 		nid = 0x17;
707 	ass = snd_hda_codec_get_pincfg(codec, nid);
708 
709 	if (!(ass & 1)) {
710 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
711 			   codec->core.chip_name, ass);
712 		return -1;
713 	}
714 
715 	/* check sum */
716 	tmp = 0;
717 	for (i = 1; i < 16; i++) {
718 		if ((ass >> i) & 1)
719 			tmp++;
720 	}
721 	if (((ass >> 16) & 0xf) != tmp)
722 		return -1;
723 
724 	spec->cdefine.port_connectivity = ass >> 30;
725 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
726 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
727 	spec->cdefine.customization = ass >> 8;
728 do_sku:
729 	spec->cdefine.sku_cfg = ass;
730 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
731 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
732 	spec->cdefine.swap = (ass & 0x2) >> 1;
733 	spec->cdefine.override = ass & 0x1;
734 
735 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
736 		   nid, spec->cdefine.sku_cfg);
737 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
738 		   spec->cdefine.port_connectivity);
739 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
740 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
741 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
742 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
743 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
744 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
745 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
746 
747 	return 0;
748 }
749 
750 /* return the position of NID in the list, or -1 if not found */
751 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
752 {
753 	int i;
754 	for (i = 0; i < nums; i++)
755 		if (list[i] == nid)
756 			return i;
757 	return -1;
758 }
759 /* return true if the given NID is found in the list */
760 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
761 {
762 	return find_idx_in_nid_list(nid, list, nums) >= 0;
763 }
764 
765 /* check subsystem ID and set up device-specific initialization;
766  * return 1 if initialized, 0 if invalid SSID
767  */
768 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
769  *	31 ~ 16 :	Manufacture ID
770  *	15 ~ 8	:	SKU ID
771  *	7  ~ 0	:	Assembly ID
772  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
773  */
774 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
775 {
776 	unsigned int ass, tmp, i;
777 	unsigned nid;
778 	struct alc_spec *spec = codec->spec;
779 
780 	if (spec->cdefine.fixup) {
781 		ass = spec->cdefine.sku_cfg;
782 		if (ass == ALC_FIXUP_SKU_IGNORE)
783 			return 0;
784 		goto do_sku;
785 	}
786 
787 	ass = codec->core.subsystem_id & 0xffff;
788 	if (codec->bus->pci &&
789 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
790 		goto do_sku;
791 
792 	/* invalid SSID, check the special NID pin defcfg instead */
793 	/*
794 	 * 31~30	: port connectivity
795 	 * 29~21	: reserve
796 	 * 20		: PCBEEP input
797 	 * 19~16	: Check sum (15:1)
798 	 * 15~1		: Custom
799 	 * 0		: override
800 	*/
801 	nid = 0x1d;
802 	if (codec->core.vendor_id == 0x10ec0260)
803 		nid = 0x17;
804 	ass = snd_hda_codec_get_pincfg(codec, nid);
805 	codec_dbg(codec,
806 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
807 		   ass, nid);
808 	if (!(ass & 1))
809 		return 0;
810 	if ((ass >> 30) != 1)	/* no physical connection */
811 		return 0;
812 
813 	/* check sum */
814 	tmp = 0;
815 	for (i = 1; i < 16; i++) {
816 		if ((ass >> i) & 1)
817 			tmp++;
818 	}
819 	if (((ass >> 16) & 0xf) != tmp)
820 		return 0;
821 do_sku:
822 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
823 		   ass & 0xffff, codec->core.vendor_id);
824 	/*
825 	 * 0 : override
826 	 * 1 :	Swap Jack
827 	 * 2 : 0 --> Desktop, 1 --> Laptop
828 	 * 3~5 : External Amplifier control
829 	 * 7~6 : Reserved
830 	*/
831 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
832 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
833 		switch (tmp) {
834 		case 1:
835 			alc_setup_gpio(codec, 0x01);
836 			break;
837 		case 3:
838 			alc_setup_gpio(codec, 0x02);
839 			break;
840 		case 7:
841 			alc_setup_gpio(codec, 0x04);
842 			break;
843 		case 5:
844 		default:
845 			spec->init_amp = ALC_INIT_DEFAULT;
846 			break;
847 		}
848 	}
849 
850 	/* is laptop or Desktop and enable the function "Mute internal speaker
851 	 * when the external headphone out jack is plugged"
852 	 */
853 	if (!(ass & 0x8000))
854 		return 1;
855 	/*
856 	 * 10~8 : Jack location
857 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
858 	 * 14~13: Resvered
859 	 * 15   : 1 --> enable the function "Mute internal speaker
860 	 *	        when the external headphone out jack is plugged"
861 	 */
862 	if (!alc_get_hp_pin(spec)) {
863 		hda_nid_t nid;
864 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
865 		nid = ports[tmp];
866 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
867 				      spec->gen.autocfg.line_outs))
868 			return 1;
869 		spec->gen.autocfg.hp_pins[0] = nid;
870 	}
871 	return 1;
872 }
873 
874 /* Check the validity of ALC subsystem-id
875  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
876 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
877 {
878 	if (!alc_subsystem_id(codec, ports)) {
879 		struct alc_spec *spec = codec->spec;
880 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
881 			codec_dbg(codec,
882 				  "realtek: Enable default setup for auto mode as fallback\n");
883 			spec->init_amp = ALC_INIT_DEFAULT;
884 		}
885 	}
886 }
887 
888 /*
889  */
890 
891 static void alc_fixup_inv_dmic(struct hda_codec *codec,
892 			       const struct hda_fixup *fix, int action)
893 {
894 	struct alc_spec *spec = codec->spec;
895 
896 	spec->gen.inv_dmic_split = 1;
897 }
898 
899 
900 static int alc_build_controls(struct hda_codec *codec)
901 {
902 	int err;
903 
904 	err = snd_hda_gen_build_controls(codec);
905 	if (err < 0)
906 		return err;
907 
908 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
909 	return 0;
910 }
911 
912 
913 /*
914  * Common callbacks
915  */
916 
917 static void alc_pre_init(struct hda_codec *codec)
918 {
919 	alc_fill_eapd_coef(codec);
920 }
921 
922 #define is_s3_resume(codec) \
923 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
924 #define is_s4_resume(codec) \
925 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
926 
927 static int alc_init(struct hda_codec *codec)
928 {
929 	struct alc_spec *spec = codec->spec;
930 
931 	/* hibernation resume needs the full chip initialization */
932 	if (is_s4_resume(codec))
933 		alc_pre_init(codec);
934 
935 	if (spec->init_hook)
936 		spec->init_hook(codec);
937 
938 	spec->gen.skip_verbs = 1; /* applied in below */
939 	snd_hda_gen_init(codec);
940 	alc_fix_pll(codec);
941 	alc_auto_init_amp(codec, spec->init_amp);
942 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
943 
944 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
945 
946 	return 0;
947 }
948 
949 #define alc_free	snd_hda_gen_free
950 
951 #ifdef CONFIG_PM
952 static inline void alc_shutup(struct hda_codec *codec)
953 {
954 	struct alc_spec *spec = codec->spec;
955 
956 	if (!snd_hda_get_bool_hint(codec, "shutup"))
957 		return; /* disabled explicitly by hints */
958 
959 	if (spec && spec->shutup)
960 		spec->shutup(codec);
961 	else
962 		alc_shutup_pins(codec);
963 }
964 
965 static void alc_power_eapd(struct hda_codec *codec)
966 {
967 	alc_auto_setup_eapd(codec, false);
968 }
969 
970 static int alc_suspend(struct hda_codec *codec)
971 {
972 	struct alc_spec *spec = codec->spec;
973 	alc_shutup(codec);
974 	if (spec && spec->power_hook)
975 		spec->power_hook(codec);
976 	return 0;
977 }
978 
979 static int alc_resume(struct hda_codec *codec)
980 {
981 	struct alc_spec *spec = codec->spec;
982 
983 	if (!spec->no_depop_delay)
984 		msleep(150); /* to avoid pop noise */
985 	codec->patch_ops.init(codec);
986 	snd_hda_regmap_sync(codec);
987 	hda_call_check_power_status(codec, 0x01);
988 	return 0;
989 }
990 #endif
991 
992 /*
993  */
994 static const struct hda_codec_ops alc_patch_ops = {
995 	.build_controls = alc_build_controls,
996 	.build_pcms = snd_hda_gen_build_pcms,
997 	.init = alc_init,
998 	.free = alc_free,
999 	.unsol_event = snd_hda_jack_unsol_event,
1000 #ifdef CONFIG_PM
1001 	.resume = alc_resume,
1002 	.suspend = alc_suspend,
1003 	.check_power_status = snd_hda_gen_check_power_status,
1004 #endif
1005 };
1006 
1007 
1008 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1009 
1010 /*
1011  * Rename codecs appropriately from COEF value or subvendor id
1012  */
1013 struct alc_codec_rename_table {
1014 	unsigned int vendor_id;
1015 	unsigned short coef_mask;
1016 	unsigned short coef_bits;
1017 	const char *name;
1018 };
1019 
1020 struct alc_codec_rename_pci_table {
1021 	unsigned int codec_vendor_id;
1022 	unsigned short pci_subvendor;
1023 	unsigned short pci_subdevice;
1024 	const char *name;
1025 };
1026 
1027 static const struct alc_codec_rename_table rename_tbl[] = {
1028 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1029 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1030 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1031 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1032 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1033 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1034 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1035 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1036 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1037 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1038 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1039 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1040 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1041 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1042 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1043 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1044 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1045 	{ } /* terminator */
1046 };
1047 
1048 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1049 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1050 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1051 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1052 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1053 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1054 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1055 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1056 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1057 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1058 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1059 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1060 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1061 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1062 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1063 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1064 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1065 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1066 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1067 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1068 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1069 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1070 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1071 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1072 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1073 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1074 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1075 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1076 	{ } /* terminator */
1077 };
1078 
1079 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1080 {
1081 	const struct alc_codec_rename_table *p;
1082 	const struct alc_codec_rename_pci_table *q;
1083 
1084 	for (p = rename_tbl; p->vendor_id; p++) {
1085 		if (p->vendor_id != codec->core.vendor_id)
1086 			continue;
1087 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1088 			return alc_codec_rename(codec, p->name);
1089 	}
1090 
1091 	if (!codec->bus->pci)
1092 		return 0;
1093 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1094 		if (q->codec_vendor_id != codec->core.vendor_id)
1095 			continue;
1096 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1097 			continue;
1098 		if (!q->pci_subdevice ||
1099 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1100 			return alc_codec_rename(codec, q->name);
1101 	}
1102 
1103 	return 0;
1104 }
1105 
1106 
1107 /*
1108  * Digital-beep handlers
1109  */
1110 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1111 
1112 /* additional beep mixers; private_value will be overwritten */
1113 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1114 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1115 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1116 };
1117 
1118 /* set up and create beep controls */
1119 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1120 			int idx, int dir)
1121 {
1122 	struct snd_kcontrol_new *knew;
1123 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1124 	int i;
1125 
1126 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1127 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1128 					    &alc_beep_mixer[i]);
1129 		if (!knew)
1130 			return -ENOMEM;
1131 		knew->private_value = beep_amp;
1132 	}
1133 	return 0;
1134 }
1135 
1136 static const struct snd_pci_quirk beep_allow_list[] = {
1137 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1138 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1139 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1140 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1141 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1142 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1143 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1144 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1145 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1146 	/* denylist -- no beep available */
1147 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1148 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1149 	{}
1150 };
1151 
1152 static inline int has_cdefine_beep(struct hda_codec *codec)
1153 {
1154 	struct alc_spec *spec = codec->spec;
1155 	const struct snd_pci_quirk *q;
1156 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1157 	if (q)
1158 		return q->value;
1159 	return spec->cdefine.enable_pcbeep;
1160 }
1161 #else
1162 #define set_beep_amp(spec, nid, idx, dir)	0
1163 #define has_cdefine_beep(codec)		0
1164 #endif
1165 
1166 /* parse the BIOS configuration and set up the alc_spec */
1167 /* return 1 if successful, 0 if the proper config is not found,
1168  * or a negative error code
1169  */
1170 static int alc_parse_auto_config(struct hda_codec *codec,
1171 				 const hda_nid_t *ignore_nids,
1172 				 const hda_nid_t *ssid_nids)
1173 {
1174 	struct alc_spec *spec = codec->spec;
1175 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1176 	int err;
1177 
1178 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1179 				       spec->parse_flags);
1180 	if (err < 0)
1181 		return err;
1182 
1183 	if (ssid_nids)
1184 		alc_ssid_check(codec, ssid_nids);
1185 
1186 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1187 	if (err < 0)
1188 		return err;
1189 
1190 	return 1;
1191 }
1192 
1193 /* common preparation job for alc_spec */
1194 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1195 {
1196 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1197 	int err;
1198 
1199 	if (!spec)
1200 		return -ENOMEM;
1201 	codec->spec = spec;
1202 	snd_hda_gen_spec_init(&spec->gen);
1203 	spec->gen.mixer_nid = mixer_nid;
1204 	spec->gen.own_eapd_ctl = 1;
1205 	codec->single_adc_amp = 1;
1206 	/* FIXME: do we need this for all Realtek codec models? */
1207 	codec->spdif_status_reset = 1;
1208 	codec->forced_resume = 1;
1209 	codec->patch_ops = alc_patch_ops;
1210 	mutex_init(&spec->coef_mutex);
1211 
1212 	err = alc_codec_rename_from_preset(codec);
1213 	if (err < 0) {
1214 		kfree(spec);
1215 		return err;
1216 	}
1217 	return 0;
1218 }
1219 
1220 static int alc880_parse_auto_config(struct hda_codec *codec)
1221 {
1222 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1223 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1224 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1225 }
1226 
1227 /*
1228  * ALC880 fix-ups
1229  */
1230 enum {
1231 	ALC880_FIXUP_GPIO1,
1232 	ALC880_FIXUP_GPIO2,
1233 	ALC880_FIXUP_MEDION_RIM,
1234 	ALC880_FIXUP_LG,
1235 	ALC880_FIXUP_LG_LW25,
1236 	ALC880_FIXUP_W810,
1237 	ALC880_FIXUP_EAPD_COEF,
1238 	ALC880_FIXUP_TCL_S700,
1239 	ALC880_FIXUP_VOL_KNOB,
1240 	ALC880_FIXUP_FUJITSU,
1241 	ALC880_FIXUP_F1734,
1242 	ALC880_FIXUP_UNIWILL,
1243 	ALC880_FIXUP_UNIWILL_DIG,
1244 	ALC880_FIXUP_Z71V,
1245 	ALC880_FIXUP_ASUS_W5A,
1246 	ALC880_FIXUP_3ST_BASE,
1247 	ALC880_FIXUP_3ST,
1248 	ALC880_FIXUP_3ST_DIG,
1249 	ALC880_FIXUP_5ST_BASE,
1250 	ALC880_FIXUP_5ST,
1251 	ALC880_FIXUP_5ST_DIG,
1252 	ALC880_FIXUP_6ST_BASE,
1253 	ALC880_FIXUP_6ST,
1254 	ALC880_FIXUP_6ST_DIG,
1255 	ALC880_FIXUP_6ST_AUTOMUTE,
1256 };
1257 
1258 /* enable the volume-knob widget support on NID 0x21 */
1259 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1260 				  const struct hda_fixup *fix, int action)
1261 {
1262 	if (action == HDA_FIXUP_ACT_PROBE)
1263 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1264 						    alc_update_knob_master);
1265 }
1266 
1267 static const struct hda_fixup alc880_fixups[] = {
1268 	[ALC880_FIXUP_GPIO1] = {
1269 		.type = HDA_FIXUP_FUNC,
1270 		.v.func = alc_fixup_gpio1,
1271 	},
1272 	[ALC880_FIXUP_GPIO2] = {
1273 		.type = HDA_FIXUP_FUNC,
1274 		.v.func = alc_fixup_gpio2,
1275 	},
1276 	[ALC880_FIXUP_MEDION_RIM] = {
1277 		.type = HDA_FIXUP_VERBS,
1278 		.v.verbs = (const struct hda_verb[]) {
1279 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1280 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1281 			{ }
1282 		},
1283 		.chained = true,
1284 		.chain_id = ALC880_FIXUP_GPIO2,
1285 	},
1286 	[ALC880_FIXUP_LG] = {
1287 		.type = HDA_FIXUP_PINS,
1288 		.v.pins = (const struct hda_pintbl[]) {
1289 			/* disable bogus unused pins */
1290 			{ 0x16, 0x411111f0 },
1291 			{ 0x18, 0x411111f0 },
1292 			{ 0x1a, 0x411111f0 },
1293 			{ }
1294 		}
1295 	},
1296 	[ALC880_FIXUP_LG_LW25] = {
1297 		.type = HDA_FIXUP_PINS,
1298 		.v.pins = (const struct hda_pintbl[]) {
1299 			{ 0x1a, 0x0181344f }, /* line-in */
1300 			{ 0x1b, 0x0321403f }, /* headphone */
1301 			{ }
1302 		}
1303 	},
1304 	[ALC880_FIXUP_W810] = {
1305 		.type = HDA_FIXUP_PINS,
1306 		.v.pins = (const struct hda_pintbl[]) {
1307 			/* disable bogus unused pins */
1308 			{ 0x17, 0x411111f0 },
1309 			{ }
1310 		},
1311 		.chained = true,
1312 		.chain_id = ALC880_FIXUP_GPIO2,
1313 	},
1314 	[ALC880_FIXUP_EAPD_COEF] = {
1315 		.type = HDA_FIXUP_VERBS,
1316 		.v.verbs = (const struct hda_verb[]) {
1317 			/* change to EAPD mode */
1318 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1319 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1320 			{}
1321 		},
1322 	},
1323 	[ALC880_FIXUP_TCL_S700] = {
1324 		.type = HDA_FIXUP_VERBS,
1325 		.v.verbs = (const struct hda_verb[]) {
1326 			/* change to EAPD mode */
1327 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1328 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1329 			{}
1330 		},
1331 		.chained = true,
1332 		.chain_id = ALC880_FIXUP_GPIO2,
1333 	},
1334 	[ALC880_FIXUP_VOL_KNOB] = {
1335 		.type = HDA_FIXUP_FUNC,
1336 		.v.func = alc880_fixup_vol_knob,
1337 	},
1338 	[ALC880_FIXUP_FUJITSU] = {
1339 		/* override all pins as BIOS on old Amilo is broken */
1340 		.type = HDA_FIXUP_PINS,
1341 		.v.pins = (const struct hda_pintbl[]) {
1342 			{ 0x14, 0x0121401f }, /* HP */
1343 			{ 0x15, 0x99030120 }, /* speaker */
1344 			{ 0x16, 0x99030130 }, /* bass speaker */
1345 			{ 0x17, 0x411111f0 }, /* N/A */
1346 			{ 0x18, 0x411111f0 }, /* N/A */
1347 			{ 0x19, 0x01a19950 }, /* mic-in */
1348 			{ 0x1a, 0x411111f0 }, /* N/A */
1349 			{ 0x1b, 0x411111f0 }, /* N/A */
1350 			{ 0x1c, 0x411111f0 }, /* N/A */
1351 			{ 0x1d, 0x411111f0 }, /* N/A */
1352 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1353 			{ }
1354 		},
1355 		.chained = true,
1356 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1357 	},
1358 	[ALC880_FIXUP_F1734] = {
1359 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1360 		.type = HDA_FIXUP_PINS,
1361 		.v.pins = (const struct hda_pintbl[]) {
1362 			{ 0x14, 0x0121401f }, /* HP */
1363 			{ 0x15, 0x99030120 }, /* speaker */
1364 			{ 0x16, 0x411111f0 }, /* N/A */
1365 			{ 0x17, 0x411111f0 }, /* N/A */
1366 			{ 0x18, 0x411111f0 }, /* N/A */
1367 			{ 0x19, 0x01a19950 }, /* mic-in */
1368 			{ 0x1a, 0x411111f0 }, /* N/A */
1369 			{ 0x1b, 0x411111f0 }, /* N/A */
1370 			{ 0x1c, 0x411111f0 }, /* N/A */
1371 			{ 0x1d, 0x411111f0 }, /* N/A */
1372 			{ 0x1e, 0x411111f0 }, /* N/A */
1373 			{ }
1374 		},
1375 		.chained = true,
1376 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1377 	},
1378 	[ALC880_FIXUP_UNIWILL] = {
1379 		/* need to fix HP and speaker pins to be parsed correctly */
1380 		.type = HDA_FIXUP_PINS,
1381 		.v.pins = (const struct hda_pintbl[]) {
1382 			{ 0x14, 0x0121411f }, /* HP */
1383 			{ 0x15, 0x99030120 }, /* speaker */
1384 			{ 0x16, 0x99030130 }, /* bass speaker */
1385 			{ }
1386 		},
1387 	},
1388 	[ALC880_FIXUP_UNIWILL_DIG] = {
1389 		.type = HDA_FIXUP_PINS,
1390 		.v.pins = (const struct hda_pintbl[]) {
1391 			/* disable bogus unused pins */
1392 			{ 0x17, 0x411111f0 },
1393 			{ 0x19, 0x411111f0 },
1394 			{ 0x1b, 0x411111f0 },
1395 			{ 0x1f, 0x411111f0 },
1396 			{ }
1397 		}
1398 	},
1399 	[ALC880_FIXUP_Z71V] = {
1400 		.type = HDA_FIXUP_PINS,
1401 		.v.pins = (const struct hda_pintbl[]) {
1402 			/* set up the whole pins as BIOS is utterly broken */
1403 			{ 0x14, 0x99030120 }, /* speaker */
1404 			{ 0x15, 0x0121411f }, /* HP */
1405 			{ 0x16, 0x411111f0 }, /* N/A */
1406 			{ 0x17, 0x411111f0 }, /* N/A */
1407 			{ 0x18, 0x01a19950 }, /* mic-in */
1408 			{ 0x19, 0x411111f0 }, /* N/A */
1409 			{ 0x1a, 0x01813031 }, /* line-in */
1410 			{ 0x1b, 0x411111f0 }, /* N/A */
1411 			{ 0x1c, 0x411111f0 }, /* N/A */
1412 			{ 0x1d, 0x411111f0 }, /* N/A */
1413 			{ 0x1e, 0x0144111e }, /* SPDIF */
1414 			{ }
1415 		}
1416 	},
1417 	[ALC880_FIXUP_ASUS_W5A] = {
1418 		.type = HDA_FIXUP_PINS,
1419 		.v.pins = (const struct hda_pintbl[]) {
1420 			/* set up the whole pins as BIOS is utterly broken */
1421 			{ 0x14, 0x0121411f }, /* HP */
1422 			{ 0x15, 0x411111f0 }, /* N/A */
1423 			{ 0x16, 0x411111f0 }, /* N/A */
1424 			{ 0x17, 0x411111f0 }, /* N/A */
1425 			{ 0x18, 0x90a60160 }, /* mic */
1426 			{ 0x19, 0x411111f0 }, /* N/A */
1427 			{ 0x1a, 0x411111f0 }, /* N/A */
1428 			{ 0x1b, 0x411111f0 }, /* N/A */
1429 			{ 0x1c, 0x411111f0 }, /* N/A */
1430 			{ 0x1d, 0x411111f0 }, /* N/A */
1431 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1432 			{ }
1433 		},
1434 		.chained = true,
1435 		.chain_id = ALC880_FIXUP_GPIO1,
1436 	},
1437 	[ALC880_FIXUP_3ST_BASE] = {
1438 		.type = HDA_FIXUP_PINS,
1439 		.v.pins = (const struct hda_pintbl[]) {
1440 			{ 0x14, 0x01014010 }, /* line-out */
1441 			{ 0x15, 0x411111f0 }, /* N/A */
1442 			{ 0x16, 0x411111f0 }, /* N/A */
1443 			{ 0x17, 0x411111f0 }, /* N/A */
1444 			{ 0x18, 0x01a19c30 }, /* mic-in */
1445 			{ 0x19, 0x0121411f }, /* HP */
1446 			{ 0x1a, 0x01813031 }, /* line-in */
1447 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1448 			{ 0x1c, 0x411111f0 }, /* N/A */
1449 			{ 0x1d, 0x411111f0 }, /* N/A */
1450 			/* 0x1e is filled in below */
1451 			{ 0x1f, 0x411111f0 }, /* N/A */
1452 			{ }
1453 		}
1454 	},
1455 	[ALC880_FIXUP_3ST] = {
1456 		.type = HDA_FIXUP_PINS,
1457 		.v.pins = (const struct hda_pintbl[]) {
1458 			{ 0x1e, 0x411111f0 }, /* N/A */
1459 			{ }
1460 		},
1461 		.chained = true,
1462 		.chain_id = ALC880_FIXUP_3ST_BASE,
1463 	},
1464 	[ALC880_FIXUP_3ST_DIG] = {
1465 		.type = HDA_FIXUP_PINS,
1466 		.v.pins = (const struct hda_pintbl[]) {
1467 			{ 0x1e, 0x0144111e }, /* SPDIF */
1468 			{ }
1469 		},
1470 		.chained = true,
1471 		.chain_id = ALC880_FIXUP_3ST_BASE,
1472 	},
1473 	[ALC880_FIXUP_5ST_BASE] = {
1474 		.type = HDA_FIXUP_PINS,
1475 		.v.pins = (const struct hda_pintbl[]) {
1476 			{ 0x14, 0x01014010 }, /* front */
1477 			{ 0x15, 0x411111f0 }, /* N/A */
1478 			{ 0x16, 0x01011411 }, /* CLFE */
1479 			{ 0x17, 0x01016412 }, /* surr */
1480 			{ 0x18, 0x01a19c30 }, /* mic-in */
1481 			{ 0x19, 0x0121411f }, /* HP */
1482 			{ 0x1a, 0x01813031 }, /* line-in */
1483 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1484 			{ 0x1c, 0x411111f0 }, /* N/A */
1485 			{ 0x1d, 0x411111f0 }, /* N/A */
1486 			/* 0x1e is filled in below */
1487 			{ 0x1f, 0x411111f0 }, /* N/A */
1488 			{ }
1489 		}
1490 	},
1491 	[ALC880_FIXUP_5ST] = {
1492 		.type = HDA_FIXUP_PINS,
1493 		.v.pins = (const struct hda_pintbl[]) {
1494 			{ 0x1e, 0x411111f0 }, /* N/A */
1495 			{ }
1496 		},
1497 		.chained = true,
1498 		.chain_id = ALC880_FIXUP_5ST_BASE,
1499 	},
1500 	[ALC880_FIXUP_5ST_DIG] = {
1501 		.type = HDA_FIXUP_PINS,
1502 		.v.pins = (const struct hda_pintbl[]) {
1503 			{ 0x1e, 0x0144111e }, /* SPDIF */
1504 			{ }
1505 		},
1506 		.chained = true,
1507 		.chain_id = ALC880_FIXUP_5ST_BASE,
1508 	},
1509 	[ALC880_FIXUP_6ST_BASE] = {
1510 		.type = HDA_FIXUP_PINS,
1511 		.v.pins = (const struct hda_pintbl[]) {
1512 			{ 0x14, 0x01014010 }, /* front */
1513 			{ 0x15, 0x01016412 }, /* surr */
1514 			{ 0x16, 0x01011411 }, /* CLFE */
1515 			{ 0x17, 0x01012414 }, /* side */
1516 			{ 0x18, 0x01a19c30 }, /* mic-in */
1517 			{ 0x19, 0x02a19c40 }, /* front-mic */
1518 			{ 0x1a, 0x01813031 }, /* line-in */
1519 			{ 0x1b, 0x0121411f }, /* HP */
1520 			{ 0x1c, 0x411111f0 }, /* N/A */
1521 			{ 0x1d, 0x411111f0 }, /* N/A */
1522 			/* 0x1e is filled in below */
1523 			{ 0x1f, 0x411111f0 }, /* N/A */
1524 			{ }
1525 		}
1526 	},
1527 	[ALC880_FIXUP_6ST] = {
1528 		.type = HDA_FIXUP_PINS,
1529 		.v.pins = (const struct hda_pintbl[]) {
1530 			{ 0x1e, 0x411111f0 }, /* N/A */
1531 			{ }
1532 		},
1533 		.chained = true,
1534 		.chain_id = ALC880_FIXUP_6ST_BASE,
1535 	},
1536 	[ALC880_FIXUP_6ST_DIG] = {
1537 		.type = HDA_FIXUP_PINS,
1538 		.v.pins = (const struct hda_pintbl[]) {
1539 			{ 0x1e, 0x0144111e }, /* SPDIF */
1540 			{ }
1541 		},
1542 		.chained = true,
1543 		.chain_id = ALC880_FIXUP_6ST_BASE,
1544 	},
1545 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1546 		.type = HDA_FIXUP_PINS,
1547 		.v.pins = (const struct hda_pintbl[]) {
1548 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1549 			{ }
1550 		},
1551 		.chained_before = true,
1552 		.chain_id = ALC880_FIXUP_6ST_BASE,
1553 	},
1554 };
1555 
1556 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1557 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1558 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1559 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1560 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1561 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1562 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1563 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1564 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1565 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1566 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1567 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1568 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1569 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1570 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1571 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1572 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1573 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1574 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1575 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1576 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1577 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1578 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1579 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1580 
1581 	/* Below is the copied entries from alc880_quirks.c.
1582 	 * It's not quite sure whether BIOS sets the correct pin-config table
1583 	 * on these machines, thus they are kept to be compatible with
1584 	 * the old static quirks.  Once when it's confirmed to work without
1585 	 * these overrides, it'd be better to remove.
1586 	 */
1587 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1588 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1589 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1590 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1591 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1592 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1593 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1594 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1595 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1596 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1597 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1598 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1599 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1600 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1601 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1602 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1603 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1605 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1606 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1607 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1608 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1609 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1610 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1611 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1613 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1614 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1615 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1616 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1617 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1618 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1619 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1620 	/* default Intel */
1621 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1622 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1623 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1624 	{}
1625 };
1626 
1627 static const struct hda_model_fixup alc880_fixup_models[] = {
1628 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1629 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1630 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1631 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1632 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1633 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1634 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1635 	{}
1636 };
1637 
1638 
1639 /*
1640  * OK, here we have finally the patch for ALC880
1641  */
1642 static int patch_alc880(struct hda_codec *codec)
1643 {
1644 	struct alc_spec *spec;
1645 	int err;
1646 
1647 	err = alc_alloc_spec(codec, 0x0b);
1648 	if (err < 0)
1649 		return err;
1650 
1651 	spec = codec->spec;
1652 	spec->gen.need_dac_fix = 1;
1653 	spec->gen.beep_nid = 0x01;
1654 
1655 	codec->patch_ops.unsol_event = alc880_unsol_event;
1656 
1657 	alc_pre_init(codec);
1658 
1659 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1660 		       alc880_fixups);
1661 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1662 
1663 	/* automatic parse from the BIOS config */
1664 	err = alc880_parse_auto_config(codec);
1665 	if (err < 0)
1666 		goto error;
1667 
1668 	if (!spec->gen.no_analog) {
1669 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1670 		if (err < 0)
1671 			goto error;
1672 	}
1673 
1674 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1675 
1676 	return 0;
1677 
1678  error:
1679 	alc_free(codec);
1680 	return err;
1681 }
1682 
1683 
1684 /*
1685  * ALC260 support
1686  */
1687 static int alc260_parse_auto_config(struct hda_codec *codec)
1688 {
1689 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1690 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1691 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1692 }
1693 
1694 /*
1695  * Pin config fixes
1696  */
1697 enum {
1698 	ALC260_FIXUP_HP_DC5750,
1699 	ALC260_FIXUP_HP_PIN_0F,
1700 	ALC260_FIXUP_COEF,
1701 	ALC260_FIXUP_GPIO1,
1702 	ALC260_FIXUP_GPIO1_TOGGLE,
1703 	ALC260_FIXUP_REPLACER,
1704 	ALC260_FIXUP_HP_B1900,
1705 	ALC260_FIXUP_KN1,
1706 	ALC260_FIXUP_FSC_S7020,
1707 	ALC260_FIXUP_FSC_S7020_JWSE,
1708 	ALC260_FIXUP_VAIO_PINS,
1709 };
1710 
1711 static void alc260_gpio1_automute(struct hda_codec *codec)
1712 {
1713 	struct alc_spec *spec = codec->spec;
1714 
1715 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1716 }
1717 
1718 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1719 				      const struct hda_fixup *fix, int action)
1720 {
1721 	struct alc_spec *spec = codec->spec;
1722 	if (action == HDA_FIXUP_ACT_PROBE) {
1723 		/* although the machine has only one output pin, we need to
1724 		 * toggle GPIO1 according to the jack state
1725 		 */
1726 		spec->gen.automute_hook = alc260_gpio1_automute;
1727 		spec->gen.detect_hp = 1;
1728 		spec->gen.automute_speaker = 1;
1729 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1730 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1731 						    snd_hda_gen_hp_automute);
1732 		alc_setup_gpio(codec, 0x01);
1733 	}
1734 }
1735 
1736 static void alc260_fixup_kn1(struct hda_codec *codec,
1737 			     const struct hda_fixup *fix, int action)
1738 {
1739 	struct alc_spec *spec = codec->spec;
1740 	static const struct hda_pintbl pincfgs[] = {
1741 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1742 		{ 0x12, 0x90a60160 }, /* int mic */
1743 		{ 0x13, 0x02a19000 }, /* ext mic */
1744 		{ 0x18, 0x01446000 }, /* SPDIF out */
1745 		/* disable bogus I/O pins */
1746 		{ 0x10, 0x411111f0 },
1747 		{ 0x11, 0x411111f0 },
1748 		{ 0x14, 0x411111f0 },
1749 		{ 0x15, 0x411111f0 },
1750 		{ 0x16, 0x411111f0 },
1751 		{ 0x17, 0x411111f0 },
1752 		{ 0x19, 0x411111f0 },
1753 		{ }
1754 	};
1755 
1756 	switch (action) {
1757 	case HDA_FIXUP_ACT_PRE_PROBE:
1758 		snd_hda_apply_pincfgs(codec, pincfgs);
1759 		spec->init_amp = ALC_INIT_NONE;
1760 		break;
1761 	}
1762 }
1763 
1764 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1765 				   const struct hda_fixup *fix, int action)
1766 {
1767 	struct alc_spec *spec = codec->spec;
1768 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1769 		spec->init_amp = ALC_INIT_NONE;
1770 }
1771 
1772 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1773 				   const struct hda_fixup *fix, int action)
1774 {
1775 	struct alc_spec *spec = codec->spec;
1776 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1777 		spec->gen.add_jack_modes = 1;
1778 		spec->gen.hp_mic = 1;
1779 	}
1780 }
1781 
1782 static const struct hda_fixup alc260_fixups[] = {
1783 	[ALC260_FIXUP_HP_DC5750] = {
1784 		.type = HDA_FIXUP_PINS,
1785 		.v.pins = (const struct hda_pintbl[]) {
1786 			{ 0x11, 0x90130110 }, /* speaker */
1787 			{ }
1788 		}
1789 	},
1790 	[ALC260_FIXUP_HP_PIN_0F] = {
1791 		.type = HDA_FIXUP_PINS,
1792 		.v.pins = (const struct hda_pintbl[]) {
1793 			{ 0x0f, 0x01214000 }, /* HP */
1794 			{ }
1795 		}
1796 	},
1797 	[ALC260_FIXUP_COEF] = {
1798 		.type = HDA_FIXUP_VERBS,
1799 		.v.verbs = (const struct hda_verb[]) {
1800 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1801 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3040 },
1802 			{ }
1803 		},
1804 	},
1805 	[ALC260_FIXUP_GPIO1] = {
1806 		.type = HDA_FIXUP_FUNC,
1807 		.v.func = alc_fixup_gpio1,
1808 	},
1809 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1810 		.type = HDA_FIXUP_FUNC,
1811 		.v.func = alc260_fixup_gpio1_toggle,
1812 		.chained = true,
1813 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1814 	},
1815 	[ALC260_FIXUP_REPLACER] = {
1816 		.type = HDA_FIXUP_VERBS,
1817 		.v.verbs = (const struct hda_verb[]) {
1818 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1819 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1820 			{ }
1821 		},
1822 		.chained = true,
1823 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1824 	},
1825 	[ALC260_FIXUP_HP_B1900] = {
1826 		.type = HDA_FIXUP_FUNC,
1827 		.v.func = alc260_fixup_gpio1_toggle,
1828 		.chained = true,
1829 		.chain_id = ALC260_FIXUP_COEF,
1830 	},
1831 	[ALC260_FIXUP_KN1] = {
1832 		.type = HDA_FIXUP_FUNC,
1833 		.v.func = alc260_fixup_kn1,
1834 	},
1835 	[ALC260_FIXUP_FSC_S7020] = {
1836 		.type = HDA_FIXUP_FUNC,
1837 		.v.func = alc260_fixup_fsc_s7020,
1838 	},
1839 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1840 		.type = HDA_FIXUP_FUNC,
1841 		.v.func = alc260_fixup_fsc_s7020_jwse,
1842 		.chained = true,
1843 		.chain_id = ALC260_FIXUP_FSC_S7020,
1844 	},
1845 	[ALC260_FIXUP_VAIO_PINS] = {
1846 		.type = HDA_FIXUP_PINS,
1847 		.v.pins = (const struct hda_pintbl[]) {
1848 			/* Pin configs are missing completely on some VAIOs */
1849 			{ 0x0f, 0x01211020 },
1850 			{ 0x10, 0x0001003f },
1851 			{ 0x11, 0x411111f0 },
1852 			{ 0x12, 0x01a15930 },
1853 			{ 0x13, 0x411111f0 },
1854 			{ 0x14, 0x411111f0 },
1855 			{ 0x15, 0x411111f0 },
1856 			{ 0x16, 0x411111f0 },
1857 			{ 0x17, 0x411111f0 },
1858 			{ 0x18, 0x411111f0 },
1859 			{ 0x19, 0x411111f0 },
1860 			{ }
1861 		}
1862 	},
1863 };
1864 
1865 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1866 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1867 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1868 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1869 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1870 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1871 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1872 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1873 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1874 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1875 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1876 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1877 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1878 	{}
1879 };
1880 
1881 static const struct hda_model_fixup alc260_fixup_models[] = {
1882 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1883 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1884 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1885 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1886 	{}
1887 };
1888 
1889 /*
1890  */
1891 static int patch_alc260(struct hda_codec *codec)
1892 {
1893 	struct alc_spec *spec;
1894 	int err;
1895 
1896 	err = alc_alloc_spec(codec, 0x07);
1897 	if (err < 0)
1898 		return err;
1899 
1900 	spec = codec->spec;
1901 	/* as quite a few machines require HP amp for speaker outputs,
1902 	 * it's easier to enable it unconditionally; even if it's unneeded,
1903 	 * it's almost harmless.
1904 	 */
1905 	spec->gen.prefer_hp_amp = 1;
1906 	spec->gen.beep_nid = 0x01;
1907 
1908 	spec->shutup = alc_eapd_shutup;
1909 
1910 	alc_pre_init(codec);
1911 
1912 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1913 			   alc260_fixups);
1914 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1915 
1916 	/* automatic parse from the BIOS config */
1917 	err = alc260_parse_auto_config(codec);
1918 	if (err < 0)
1919 		goto error;
1920 
1921 	if (!spec->gen.no_analog) {
1922 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1923 		if (err < 0)
1924 			goto error;
1925 	}
1926 
1927 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1928 
1929 	return 0;
1930 
1931  error:
1932 	alc_free(codec);
1933 	return err;
1934 }
1935 
1936 
1937 /*
1938  * ALC882/883/885/888/889 support
1939  *
1940  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1941  * configuration.  Each pin widget can choose any input DACs and a mixer.
1942  * Each ADC is connected from a mixer of all inputs.  This makes possible
1943  * 6-channel independent captures.
1944  *
1945  * In addition, an independent DAC for the multi-playback (not used in this
1946  * driver yet).
1947  */
1948 
1949 /*
1950  * Pin config fixes
1951  */
1952 enum {
1953 	ALC882_FIXUP_ABIT_AW9D_MAX,
1954 	ALC882_FIXUP_LENOVO_Y530,
1955 	ALC882_FIXUP_PB_M5210,
1956 	ALC882_FIXUP_ACER_ASPIRE_7736,
1957 	ALC882_FIXUP_ASUS_W90V,
1958 	ALC889_FIXUP_CD,
1959 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1960 	ALC889_FIXUP_VAIO_TT,
1961 	ALC888_FIXUP_EEE1601,
1962 	ALC886_FIXUP_EAPD,
1963 	ALC882_FIXUP_EAPD,
1964 	ALC883_FIXUP_EAPD,
1965 	ALC883_FIXUP_ACER_EAPD,
1966 	ALC882_FIXUP_GPIO1,
1967 	ALC882_FIXUP_GPIO2,
1968 	ALC882_FIXUP_GPIO3,
1969 	ALC889_FIXUP_COEF,
1970 	ALC882_FIXUP_ASUS_W2JC,
1971 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1972 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1973 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1974 	ALC885_FIXUP_MACPRO_GPIO,
1975 	ALC889_FIXUP_DAC_ROUTE,
1976 	ALC889_FIXUP_MBP_VREF,
1977 	ALC889_FIXUP_IMAC91_VREF,
1978 	ALC889_FIXUP_MBA11_VREF,
1979 	ALC889_FIXUP_MBA21_VREF,
1980 	ALC889_FIXUP_MP11_VREF,
1981 	ALC889_FIXUP_MP41_VREF,
1982 	ALC882_FIXUP_INV_DMIC,
1983 	ALC882_FIXUP_NO_PRIMARY_HP,
1984 	ALC887_FIXUP_ASUS_BASS,
1985 	ALC887_FIXUP_BASS_CHMAP,
1986 	ALC1220_FIXUP_GB_DUAL_CODECS,
1987 	ALC1220_FIXUP_GB_X570,
1988 	ALC1220_FIXUP_CLEVO_P950,
1989 	ALC1220_FIXUP_CLEVO_PB51ED,
1990 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1991 	ALC887_FIXUP_ASUS_AUDIO,
1992 	ALC887_FIXUP_ASUS_HMIC,
1993 	ALCS1200A_FIXUP_MIC_VREF,
1994 	ALC888VD_FIXUP_MIC_100VREF,
1995 };
1996 
1997 static void alc889_fixup_coef(struct hda_codec *codec,
1998 			      const struct hda_fixup *fix, int action)
1999 {
2000 	if (action != HDA_FIXUP_ACT_INIT)
2001 		return;
2002 	alc_update_coef_idx(codec, 7, 0, 0x2030);
2003 }
2004 
2005 /* set up GPIO at initialization */
2006 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2007 				     const struct hda_fixup *fix, int action)
2008 {
2009 	struct alc_spec *spec = codec->spec;
2010 
2011 	spec->gpio_write_delay = true;
2012 	alc_fixup_gpio3(codec, fix, action);
2013 }
2014 
2015 /* Fix the connection of some pins for ALC889:
2016  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2017  * work correctly (bko#42740)
2018  */
2019 static void alc889_fixup_dac_route(struct hda_codec *codec,
2020 				   const struct hda_fixup *fix, int action)
2021 {
2022 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2023 		/* fake the connections during parsing the tree */
2024 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2025 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2026 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2027 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2028 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2029 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2030 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2031 		/* restore the connections */
2032 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2033 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2034 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2035 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2036 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2037 	}
2038 }
2039 
2040 /* Set VREF on HP pin */
2041 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2042 				  const struct hda_fixup *fix, int action)
2043 {
2044 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2045 	struct alc_spec *spec = codec->spec;
2046 	int i;
2047 
2048 	if (action != HDA_FIXUP_ACT_INIT)
2049 		return;
2050 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2051 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2052 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2053 			continue;
2054 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2055 		val |= AC_PINCTL_VREF_80;
2056 		snd_hda_set_pin_ctl(codec, nids[i], val);
2057 		spec->gen.keep_vref_in_automute = 1;
2058 		break;
2059 	}
2060 }
2061 
2062 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2063 				  const hda_nid_t *nids, int num_nids)
2064 {
2065 	struct alc_spec *spec = codec->spec;
2066 	int i;
2067 
2068 	for (i = 0; i < num_nids; i++) {
2069 		unsigned int val;
2070 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2071 		val |= AC_PINCTL_VREF_50;
2072 		snd_hda_set_pin_ctl(codec, nids[i], val);
2073 	}
2074 	spec->gen.keep_vref_in_automute = 1;
2075 }
2076 
2077 /* Set VREF on speaker pins on imac91 */
2078 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2079 				     const struct hda_fixup *fix, int action)
2080 {
2081 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2082 
2083 	if (action == HDA_FIXUP_ACT_INIT)
2084 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2085 }
2086 
2087 /* Set VREF on speaker pins on mba11 */
2088 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2089 				    const struct hda_fixup *fix, int action)
2090 {
2091 	static const hda_nid_t nids[] = { 0x18 };
2092 
2093 	if (action == HDA_FIXUP_ACT_INIT)
2094 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2095 }
2096 
2097 /* Set VREF on speaker pins on mba21 */
2098 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2099 				    const struct hda_fixup *fix, int action)
2100 {
2101 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2102 
2103 	if (action == HDA_FIXUP_ACT_INIT)
2104 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2105 }
2106 
2107 /* Don't take HP output as primary
2108  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2109  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2110  */
2111 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2112 				       const struct hda_fixup *fix, int action)
2113 {
2114 	struct alc_spec *spec = codec->spec;
2115 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2116 		spec->gen.no_primary_hp = 1;
2117 		spec->gen.no_multi_io = 1;
2118 	}
2119 }
2120 
2121 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2122 				 const struct hda_fixup *fix, int action);
2123 
2124 /* For dual-codec configuration, we need to disable some features to avoid
2125  * conflicts of kctls and PCM streams
2126  */
2127 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2128 				  const struct hda_fixup *fix, int action)
2129 {
2130 	struct alc_spec *spec = codec->spec;
2131 
2132 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2133 		return;
2134 	/* disable vmaster */
2135 	spec->gen.suppress_vmaster = 1;
2136 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2137 	spec->gen.suppress_auto_mute = 1;
2138 	spec->gen.suppress_auto_mic = 1;
2139 	/* disable aamix as well */
2140 	spec->gen.mixer_nid = 0;
2141 	/* add location prefix to avoid conflicts */
2142 	codec->force_pin_prefix = 1;
2143 }
2144 
2145 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2146 		       const char *newname)
2147 {
2148 	struct snd_kcontrol *kctl;
2149 
2150 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2151 	if (kctl)
2152 		snd_ctl_rename(codec->card, kctl, newname);
2153 }
2154 
2155 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2156 					 const struct hda_fixup *fix,
2157 					 int action)
2158 {
2159 	alc_fixup_dual_codecs(codec, fix, action);
2160 	switch (action) {
2161 	case HDA_FIXUP_ACT_PRE_PROBE:
2162 		/* override card longname to provide a unique UCM profile */
2163 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2164 		break;
2165 	case HDA_FIXUP_ACT_BUILD:
2166 		/* rename Capture controls depending on the codec */
2167 		rename_ctl(codec, "Capture Volume",
2168 			   codec->addr == 0 ?
2169 			   "Rear-Panel Capture Volume" :
2170 			   "Front-Panel Capture Volume");
2171 		rename_ctl(codec, "Capture Switch",
2172 			   codec->addr == 0 ?
2173 			   "Rear-Panel Capture Switch" :
2174 			   "Front-Panel Capture Switch");
2175 		break;
2176 	}
2177 }
2178 
2179 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2180 				     const struct hda_fixup *fix,
2181 				     int action)
2182 {
2183 	static const hda_nid_t conn1[] = { 0x0c };
2184 	static const struct coef_fw gb_x570_coefs[] = {
2185 		WRITE_COEF(0x07, 0x03c0),
2186 		WRITE_COEF(0x1a, 0x01c1),
2187 		WRITE_COEF(0x1b, 0x0202),
2188 		WRITE_COEF(0x43, 0x3005),
2189 		{}
2190 	};
2191 
2192 	switch (action) {
2193 	case HDA_FIXUP_ACT_PRE_PROBE:
2194 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2195 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2196 		break;
2197 	case HDA_FIXUP_ACT_INIT:
2198 		alc_process_coef_fw(codec, gb_x570_coefs);
2199 		break;
2200 	}
2201 }
2202 
2203 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2204 				     const struct hda_fixup *fix,
2205 				     int action)
2206 {
2207 	static const hda_nid_t conn1[] = { 0x0c };
2208 
2209 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2210 		return;
2211 
2212 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2213 	/* We therefore want to make sure 0x14 (front headphone) and
2214 	 * 0x1b (speakers) use the stereo DAC 0x02
2215 	 */
2216 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2217 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2218 }
2219 
2220 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2221 				const struct hda_fixup *fix, int action);
2222 
2223 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2224 				     const struct hda_fixup *fix,
2225 				     int action)
2226 {
2227 	alc1220_fixup_clevo_p950(codec, fix, action);
2228 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2229 }
2230 
2231 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2232 					 struct hda_jack_callback *jack)
2233 {
2234 	struct alc_spec *spec = codec->spec;
2235 	unsigned int vref;
2236 
2237 	snd_hda_gen_hp_automute(codec, jack);
2238 
2239 	if (spec->gen.hp_jack_present)
2240 		vref = AC_PINCTL_VREF_80;
2241 	else
2242 		vref = AC_PINCTL_VREF_HIZ;
2243 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2244 }
2245 
2246 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2247 				     const struct hda_fixup *fix, int action)
2248 {
2249 	struct alc_spec *spec = codec->spec;
2250 	if (action != HDA_FIXUP_ACT_PROBE)
2251 		return;
2252 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2253 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2254 }
2255 
2256 static const struct hda_fixup alc882_fixups[] = {
2257 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2258 		.type = HDA_FIXUP_PINS,
2259 		.v.pins = (const struct hda_pintbl[]) {
2260 			{ 0x15, 0x01080104 }, /* side */
2261 			{ 0x16, 0x01011012 }, /* rear */
2262 			{ 0x17, 0x01016011 }, /* clfe */
2263 			{ }
2264 		}
2265 	},
2266 	[ALC882_FIXUP_LENOVO_Y530] = {
2267 		.type = HDA_FIXUP_PINS,
2268 		.v.pins = (const struct hda_pintbl[]) {
2269 			{ 0x15, 0x99130112 }, /* rear int speakers */
2270 			{ 0x16, 0x99130111 }, /* subwoofer */
2271 			{ }
2272 		}
2273 	},
2274 	[ALC882_FIXUP_PB_M5210] = {
2275 		.type = HDA_FIXUP_PINCTLS,
2276 		.v.pins = (const struct hda_pintbl[]) {
2277 			{ 0x19, PIN_VREF50 },
2278 			{}
2279 		}
2280 	},
2281 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2282 		.type = HDA_FIXUP_FUNC,
2283 		.v.func = alc_fixup_sku_ignore,
2284 	},
2285 	[ALC882_FIXUP_ASUS_W90V] = {
2286 		.type = HDA_FIXUP_PINS,
2287 		.v.pins = (const struct hda_pintbl[]) {
2288 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2289 			{ }
2290 		}
2291 	},
2292 	[ALC889_FIXUP_CD] = {
2293 		.type = HDA_FIXUP_PINS,
2294 		.v.pins = (const struct hda_pintbl[]) {
2295 			{ 0x1c, 0x993301f0 }, /* CD */
2296 			{ }
2297 		}
2298 	},
2299 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2300 		.type = HDA_FIXUP_PINS,
2301 		.v.pins = (const struct hda_pintbl[]) {
2302 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2303 			{ }
2304 		},
2305 		.chained = true,
2306 		.chain_id = ALC889_FIXUP_CD,
2307 	},
2308 	[ALC889_FIXUP_VAIO_TT] = {
2309 		.type = HDA_FIXUP_PINS,
2310 		.v.pins = (const struct hda_pintbl[]) {
2311 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2312 			{ }
2313 		}
2314 	},
2315 	[ALC888_FIXUP_EEE1601] = {
2316 		.type = HDA_FIXUP_VERBS,
2317 		.v.verbs = (const struct hda_verb[]) {
2318 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2319 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2320 			{ }
2321 		}
2322 	},
2323 	[ALC886_FIXUP_EAPD] = {
2324 		.type = HDA_FIXUP_VERBS,
2325 		.v.verbs = (const struct hda_verb[]) {
2326 			/* change to EAPD mode */
2327 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2328 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2329 			{ }
2330 		}
2331 	},
2332 	[ALC882_FIXUP_EAPD] = {
2333 		.type = HDA_FIXUP_VERBS,
2334 		.v.verbs = (const struct hda_verb[]) {
2335 			/* change to EAPD mode */
2336 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2337 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2338 			{ }
2339 		}
2340 	},
2341 	[ALC883_FIXUP_EAPD] = {
2342 		.type = HDA_FIXUP_VERBS,
2343 		.v.verbs = (const struct hda_verb[]) {
2344 			/* change to EAPD mode */
2345 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2346 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2347 			{ }
2348 		}
2349 	},
2350 	[ALC883_FIXUP_ACER_EAPD] = {
2351 		.type = HDA_FIXUP_VERBS,
2352 		.v.verbs = (const struct hda_verb[]) {
2353 			/* eanable EAPD on Acer laptops */
2354 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2355 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2356 			{ }
2357 		}
2358 	},
2359 	[ALC882_FIXUP_GPIO1] = {
2360 		.type = HDA_FIXUP_FUNC,
2361 		.v.func = alc_fixup_gpio1,
2362 	},
2363 	[ALC882_FIXUP_GPIO2] = {
2364 		.type = HDA_FIXUP_FUNC,
2365 		.v.func = alc_fixup_gpio2,
2366 	},
2367 	[ALC882_FIXUP_GPIO3] = {
2368 		.type = HDA_FIXUP_FUNC,
2369 		.v.func = alc_fixup_gpio3,
2370 	},
2371 	[ALC882_FIXUP_ASUS_W2JC] = {
2372 		.type = HDA_FIXUP_FUNC,
2373 		.v.func = alc_fixup_gpio1,
2374 		.chained = true,
2375 		.chain_id = ALC882_FIXUP_EAPD,
2376 	},
2377 	[ALC889_FIXUP_COEF] = {
2378 		.type = HDA_FIXUP_FUNC,
2379 		.v.func = alc889_fixup_coef,
2380 	},
2381 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2382 		.type = HDA_FIXUP_PINS,
2383 		.v.pins = (const struct hda_pintbl[]) {
2384 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2385 			{ 0x17, 0x99130112 }, /* surround speaker */
2386 			{ }
2387 		},
2388 		.chained = true,
2389 		.chain_id = ALC882_FIXUP_GPIO1,
2390 	},
2391 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2392 		.type = HDA_FIXUP_PINS,
2393 		.v.pins = (const struct hda_pintbl[]) {
2394 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2395 			{ 0x1b, 0x99130112 }, /* surround speaker */
2396 			{ }
2397 		},
2398 		.chained = true,
2399 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2400 	},
2401 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2402 		/* additional init verbs for Acer Aspire 8930G */
2403 		.type = HDA_FIXUP_VERBS,
2404 		.v.verbs = (const struct hda_verb[]) {
2405 			/* Enable all DACs */
2406 			/* DAC DISABLE/MUTE 1? */
2407 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2408 			 *  apparently. Init=0x38 */
2409 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2410 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2411 			/* DAC DISABLE/MUTE 2? */
2412 			/*  some bit here disables the other DACs.
2413 			 *  Init=0x4900 */
2414 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2415 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2416 			/* DMIC fix
2417 			 * This laptop has a stereo digital microphone.
2418 			 * The mics are only 1cm apart which makes the stereo
2419 			 * useless. However, either the mic or the ALC889
2420 			 * makes the signal become a difference/sum signal
2421 			 * instead of standard stereo, which is annoying.
2422 			 * So instead we flip this bit which makes the
2423 			 * codec replicate the sum signal to both channels,
2424 			 * turning it into a normal mono mic.
2425 			 */
2426 			/* DMIC_CONTROL? Init value = 0x0001 */
2427 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2428 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2429 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2430 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2431 			{ }
2432 		},
2433 		.chained = true,
2434 		.chain_id = ALC882_FIXUP_GPIO1,
2435 	},
2436 	[ALC885_FIXUP_MACPRO_GPIO] = {
2437 		.type = HDA_FIXUP_FUNC,
2438 		.v.func = alc885_fixup_macpro_gpio,
2439 	},
2440 	[ALC889_FIXUP_DAC_ROUTE] = {
2441 		.type = HDA_FIXUP_FUNC,
2442 		.v.func = alc889_fixup_dac_route,
2443 	},
2444 	[ALC889_FIXUP_MBP_VREF] = {
2445 		.type = HDA_FIXUP_FUNC,
2446 		.v.func = alc889_fixup_mbp_vref,
2447 		.chained = true,
2448 		.chain_id = ALC882_FIXUP_GPIO1,
2449 	},
2450 	[ALC889_FIXUP_IMAC91_VREF] = {
2451 		.type = HDA_FIXUP_FUNC,
2452 		.v.func = alc889_fixup_imac91_vref,
2453 		.chained = true,
2454 		.chain_id = ALC882_FIXUP_GPIO1,
2455 	},
2456 	[ALC889_FIXUP_MBA11_VREF] = {
2457 		.type = HDA_FIXUP_FUNC,
2458 		.v.func = alc889_fixup_mba11_vref,
2459 		.chained = true,
2460 		.chain_id = ALC889_FIXUP_MBP_VREF,
2461 	},
2462 	[ALC889_FIXUP_MBA21_VREF] = {
2463 		.type = HDA_FIXUP_FUNC,
2464 		.v.func = alc889_fixup_mba21_vref,
2465 		.chained = true,
2466 		.chain_id = ALC889_FIXUP_MBP_VREF,
2467 	},
2468 	[ALC889_FIXUP_MP11_VREF] = {
2469 		.type = HDA_FIXUP_FUNC,
2470 		.v.func = alc889_fixup_mba11_vref,
2471 		.chained = true,
2472 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2473 	},
2474 	[ALC889_FIXUP_MP41_VREF] = {
2475 		.type = HDA_FIXUP_FUNC,
2476 		.v.func = alc889_fixup_mbp_vref,
2477 		.chained = true,
2478 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2479 	},
2480 	[ALC882_FIXUP_INV_DMIC] = {
2481 		.type = HDA_FIXUP_FUNC,
2482 		.v.func = alc_fixup_inv_dmic,
2483 	},
2484 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2485 		.type = HDA_FIXUP_FUNC,
2486 		.v.func = alc882_fixup_no_primary_hp,
2487 	},
2488 	[ALC887_FIXUP_ASUS_BASS] = {
2489 		.type = HDA_FIXUP_PINS,
2490 		.v.pins = (const struct hda_pintbl[]) {
2491 			{0x16, 0x99130130}, /* bass speaker */
2492 			{}
2493 		},
2494 		.chained = true,
2495 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2496 	},
2497 	[ALC887_FIXUP_BASS_CHMAP] = {
2498 		.type = HDA_FIXUP_FUNC,
2499 		.v.func = alc_fixup_bass_chmap,
2500 	},
2501 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2502 		.type = HDA_FIXUP_FUNC,
2503 		.v.func = alc1220_fixup_gb_dual_codecs,
2504 	},
2505 	[ALC1220_FIXUP_GB_X570] = {
2506 		.type = HDA_FIXUP_FUNC,
2507 		.v.func = alc1220_fixup_gb_x570,
2508 	},
2509 	[ALC1220_FIXUP_CLEVO_P950] = {
2510 		.type = HDA_FIXUP_FUNC,
2511 		.v.func = alc1220_fixup_clevo_p950,
2512 	},
2513 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2514 		.type = HDA_FIXUP_FUNC,
2515 		.v.func = alc1220_fixup_clevo_pb51ed,
2516 	},
2517 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2518 		.type = HDA_FIXUP_PINS,
2519 		.v.pins = (const struct hda_pintbl[]) {
2520 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2521 			{}
2522 		},
2523 		.chained = true,
2524 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2525 	},
2526 	[ALC887_FIXUP_ASUS_AUDIO] = {
2527 		.type = HDA_FIXUP_PINS,
2528 		.v.pins = (const struct hda_pintbl[]) {
2529 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2530 			{ 0x19, 0x22219420 },
2531 			{}
2532 		},
2533 	},
2534 	[ALC887_FIXUP_ASUS_HMIC] = {
2535 		.type = HDA_FIXUP_FUNC,
2536 		.v.func = alc887_fixup_asus_jack,
2537 		.chained = true,
2538 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2539 	},
2540 	[ALCS1200A_FIXUP_MIC_VREF] = {
2541 		.type = HDA_FIXUP_PINCTLS,
2542 		.v.pins = (const struct hda_pintbl[]) {
2543 			{ 0x18, PIN_VREF50 }, /* rear mic */
2544 			{ 0x19, PIN_VREF50 }, /* front mic */
2545 			{}
2546 		}
2547 	},
2548 	[ALC888VD_FIXUP_MIC_100VREF] = {
2549 		.type = HDA_FIXUP_PINCTLS,
2550 		.v.pins = (const struct hda_pintbl[]) {
2551 			{ 0x18, PIN_VREF100 }, /* headset mic */
2552 			{}
2553 		}
2554 	},
2555 };
2556 
2557 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2558 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2559 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2560 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2561 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2562 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2563 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2564 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2565 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2566 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2567 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2568 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2569 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2570 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2571 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2572 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2573 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2574 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2575 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2576 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2577 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2578 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2579 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2580 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2581 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2582 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2583 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2584 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2585 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2586 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2587 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2588 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2589 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2590 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2591 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2592 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2593 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2594 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2595 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2596 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2597 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2598 
2599 	/* All Apple entries are in codec SSIDs */
2600 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2601 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2602 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2603 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2604 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2605 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2606 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2607 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2608 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2609 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2610 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2611 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2612 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2613 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2614 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2615 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2616 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2617 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2618 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2619 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2620 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2621 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2622 
2623 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2624 	SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2625 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2626 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2627 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2628 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2629 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2630 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2631 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2632 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2633 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2634 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2635 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2636 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2637 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2638 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2639 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2640 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2641 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2642 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2643 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2644 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2645 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2646 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2647 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2648 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2649 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2650 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2651 	SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2653 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2654 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2660 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2661 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2662 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2663 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2664 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2665 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2666 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2667 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2668 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2669 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2670 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2671 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2672 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2673 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2674 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2675 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2676 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2677 	{}
2678 };
2679 
2680 static const struct hda_model_fixup alc882_fixup_models[] = {
2681 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2682 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2683 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2684 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2685 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2686 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2687 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2688 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2689 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2690 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2691 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2692 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2693 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2694 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2695 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2696 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2697 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2698 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2699 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2700 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2701 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2702 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2703 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2704 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2705 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2706 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2707 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2708 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2709 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2710 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2711 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2712 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2713 	{}
2714 };
2715 
2716 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2717 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2718 		{0x14, 0x01014010},
2719 		{0x15, 0x01011012},
2720 		{0x16, 0x01016011},
2721 		{0x18, 0x01a19040},
2722 		{0x19, 0x02a19050},
2723 		{0x1a, 0x0181304f},
2724 		{0x1b, 0x0221401f},
2725 		{0x1e, 0x01456130}),
2726 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2727 		{0x14, 0x01015010},
2728 		{0x15, 0x01011012},
2729 		{0x16, 0x01011011},
2730 		{0x18, 0x01a11040},
2731 		{0x19, 0x02a19050},
2732 		{0x1a, 0x0181104f},
2733 		{0x1b, 0x0221401f},
2734 		{0x1e, 0x01451130}),
2735 	{}
2736 };
2737 
2738 /*
2739  * BIOS auto configuration
2740  */
2741 /* almost identical with ALC880 parser... */
2742 static int alc882_parse_auto_config(struct hda_codec *codec)
2743 {
2744 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2745 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2746 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2747 }
2748 
2749 /*
2750  */
2751 static int patch_alc882(struct hda_codec *codec)
2752 {
2753 	struct alc_spec *spec;
2754 	int err;
2755 
2756 	err = alc_alloc_spec(codec, 0x0b);
2757 	if (err < 0)
2758 		return err;
2759 
2760 	spec = codec->spec;
2761 
2762 	switch (codec->core.vendor_id) {
2763 	case 0x10ec0882:
2764 	case 0x10ec0885:
2765 	case 0x10ec0900:
2766 	case 0x10ec0b00:
2767 	case 0x10ec1220:
2768 		break;
2769 	default:
2770 		/* ALC883 and variants */
2771 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2772 		break;
2773 	}
2774 
2775 	alc_pre_init(codec);
2776 
2777 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2778 		       alc882_fixups);
2779 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2780 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2781 
2782 	alc_auto_parse_customize_define(codec);
2783 
2784 	if (has_cdefine_beep(codec))
2785 		spec->gen.beep_nid = 0x01;
2786 
2787 	/* automatic parse from the BIOS config */
2788 	err = alc882_parse_auto_config(codec);
2789 	if (err < 0)
2790 		goto error;
2791 
2792 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2793 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2794 		if (err < 0)
2795 			goto error;
2796 	}
2797 
2798 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2799 
2800 	return 0;
2801 
2802  error:
2803 	alc_free(codec);
2804 	return err;
2805 }
2806 
2807 
2808 /*
2809  * ALC262 support
2810  */
2811 static int alc262_parse_auto_config(struct hda_codec *codec)
2812 {
2813 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2814 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2815 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2816 }
2817 
2818 /*
2819  * Pin config fixes
2820  */
2821 enum {
2822 	ALC262_FIXUP_FSC_H270,
2823 	ALC262_FIXUP_FSC_S7110,
2824 	ALC262_FIXUP_HP_Z200,
2825 	ALC262_FIXUP_TYAN,
2826 	ALC262_FIXUP_LENOVO_3000,
2827 	ALC262_FIXUP_BENQ,
2828 	ALC262_FIXUP_BENQ_T31,
2829 	ALC262_FIXUP_INV_DMIC,
2830 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2831 };
2832 
2833 static const struct hda_fixup alc262_fixups[] = {
2834 	[ALC262_FIXUP_FSC_H270] = {
2835 		.type = HDA_FIXUP_PINS,
2836 		.v.pins = (const struct hda_pintbl[]) {
2837 			{ 0x14, 0x99130110 }, /* speaker */
2838 			{ 0x15, 0x0221142f }, /* front HP */
2839 			{ 0x1b, 0x0121141f }, /* rear HP */
2840 			{ }
2841 		}
2842 	},
2843 	[ALC262_FIXUP_FSC_S7110] = {
2844 		.type = HDA_FIXUP_PINS,
2845 		.v.pins = (const struct hda_pintbl[]) {
2846 			{ 0x15, 0x90170110 }, /* speaker */
2847 			{ }
2848 		},
2849 		.chained = true,
2850 		.chain_id = ALC262_FIXUP_BENQ,
2851 	},
2852 	[ALC262_FIXUP_HP_Z200] = {
2853 		.type = HDA_FIXUP_PINS,
2854 		.v.pins = (const struct hda_pintbl[]) {
2855 			{ 0x16, 0x99130120 }, /* internal speaker */
2856 			{ }
2857 		}
2858 	},
2859 	[ALC262_FIXUP_TYAN] = {
2860 		.type = HDA_FIXUP_PINS,
2861 		.v.pins = (const struct hda_pintbl[]) {
2862 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2863 			{ }
2864 		}
2865 	},
2866 	[ALC262_FIXUP_LENOVO_3000] = {
2867 		.type = HDA_FIXUP_PINCTLS,
2868 		.v.pins = (const struct hda_pintbl[]) {
2869 			{ 0x19, PIN_VREF50 },
2870 			{}
2871 		},
2872 		.chained = true,
2873 		.chain_id = ALC262_FIXUP_BENQ,
2874 	},
2875 	[ALC262_FIXUP_BENQ] = {
2876 		.type = HDA_FIXUP_VERBS,
2877 		.v.verbs = (const struct hda_verb[]) {
2878 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2879 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2880 			{}
2881 		}
2882 	},
2883 	[ALC262_FIXUP_BENQ_T31] = {
2884 		.type = HDA_FIXUP_VERBS,
2885 		.v.verbs = (const struct hda_verb[]) {
2886 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2887 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2888 			{}
2889 		}
2890 	},
2891 	[ALC262_FIXUP_INV_DMIC] = {
2892 		.type = HDA_FIXUP_FUNC,
2893 		.v.func = alc_fixup_inv_dmic,
2894 	},
2895 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2896 		.type = HDA_FIXUP_FUNC,
2897 		.v.func = alc_fixup_no_depop_delay,
2898 	},
2899 };
2900 
2901 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2902 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2903 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2904 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2905 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2906 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2907 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2908 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2909 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2910 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2911 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2912 	{}
2913 };
2914 
2915 static const struct hda_model_fixup alc262_fixup_models[] = {
2916 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2917 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2918 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2919 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2920 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2921 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2922 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2923 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2924 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2925 	{}
2926 };
2927 
2928 /*
2929  */
2930 static int patch_alc262(struct hda_codec *codec)
2931 {
2932 	struct alc_spec *spec;
2933 	int err;
2934 
2935 	err = alc_alloc_spec(codec, 0x0b);
2936 	if (err < 0)
2937 		return err;
2938 
2939 	spec = codec->spec;
2940 	spec->gen.shared_mic_vref_pin = 0x18;
2941 
2942 	spec->shutup = alc_eapd_shutup;
2943 
2944 #if 0
2945 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2946 	 * under-run
2947 	 */
2948 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2949 #endif
2950 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2951 
2952 	alc_pre_init(codec);
2953 
2954 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2955 		       alc262_fixups);
2956 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2957 
2958 	alc_auto_parse_customize_define(codec);
2959 
2960 	if (has_cdefine_beep(codec))
2961 		spec->gen.beep_nid = 0x01;
2962 
2963 	/* automatic parse from the BIOS config */
2964 	err = alc262_parse_auto_config(codec);
2965 	if (err < 0)
2966 		goto error;
2967 
2968 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2969 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2970 		if (err < 0)
2971 			goto error;
2972 	}
2973 
2974 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2975 
2976 	return 0;
2977 
2978  error:
2979 	alc_free(codec);
2980 	return err;
2981 }
2982 
2983 /*
2984  *  ALC268
2985  */
2986 /* bind Beep switches of both NID 0x0f and 0x10 */
2987 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2988 				  struct snd_ctl_elem_value *ucontrol)
2989 {
2990 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2991 	unsigned long pval;
2992 	int err;
2993 
2994 	mutex_lock(&codec->control_mutex);
2995 	pval = kcontrol->private_value;
2996 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
2997 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2998 	if (err >= 0) {
2999 		kcontrol->private_value = (pval & ~0xff) | 0x10;
3000 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3001 	}
3002 	kcontrol->private_value = pval;
3003 	mutex_unlock(&codec->control_mutex);
3004 	return err;
3005 }
3006 
3007 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3008 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3009 	{
3010 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3011 		.name = "Beep Playback Switch",
3012 		.subdevice = HDA_SUBDEV_AMP_FLAG,
3013 		.info = snd_hda_mixer_amp_switch_info,
3014 		.get = snd_hda_mixer_amp_switch_get,
3015 		.put = alc268_beep_switch_put,
3016 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3017 	},
3018 };
3019 
3020 /* set PCBEEP vol = 0, mute connections */
3021 static const struct hda_verb alc268_beep_init_verbs[] = {
3022 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3023 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3024 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3025 	{ }
3026 };
3027 
3028 enum {
3029 	ALC268_FIXUP_INV_DMIC,
3030 	ALC268_FIXUP_HP_EAPD,
3031 	ALC268_FIXUP_SPDIF,
3032 };
3033 
3034 static const struct hda_fixup alc268_fixups[] = {
3035 	[ALC268_FIXUP_INV_DMIC] = {
3036 		.type = HDA_FIXUP_FUNC,
3037 		.v.func = alc_fixup_inv_dmic,
3038 	},
3039 	[ALC268_FIXUP_HP_EAPD] = {
3040 		.type = HDA_FIXUP_VERBS,
3041 		.v.verbs = (const struct hda_verb[]) {
3042 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3043 			{}
3044 		}
3045 	},
3046 	[ALC268_FIXUP_SPDIF] = {
3047 		.type = HDA_FIXUP_PINS,
3048 		.v.pins = (const struct hda_pintbl[]) {
3049 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3050 			{}
3051 		}
3052 	},
3053 };
3054 
3055 static const struct hda_model_fixup alc268_fixup_models[] = {
3056 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3057 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3058 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3059 	{}
3060 };
3061 
3062 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3063 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3064 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3065 	/* below is codec SSID since multiple Toshiba laptops have the
3066 	 * same PCI SSID 1179:ff00
3067 	 */
3068 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3069 	{}
3070 };
3071 
3072 /*
3073  * BIOS auto configuration
3074  */
3075 static int alc268_parse_auto_config(struct hda_codec *codec)
3076 {
3077 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3078 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3079 }
3080 
3081 /*
3082  */
3083 static int patch_alc268(struct hda_codec *codec)
3084 {
3085 	struct alc_spec *spec;
3086 	int i, err;
3087 
3088 	/* ALC268 has no aa-loopback mixer */
3089 	err = alc_alloc_spec(codec, 0);
3090 	if (err < 0)
3091 		return err;
3092 
3093 	spec = codec->spec;
3094 	if (has_cdefine_beep(codec))
3095 		spec->gen.beep_nid = 0x01;
3096 
3097 	spec->shutup = alc_eapd_shutup;
3098 
3099 	alc_pre_init(codec);
3100 
3101 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3102 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3103 
3104 	/* automatic parse from the BIOS config */
3105 	err = alc268_parse_auto_config(codec);
3106 	if (err < 0)
3107 		goto error;
3108 
3109 	if (err > 0 && !spec->gen.no_analog &&
3110 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3111 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3112 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3113 						  &alc268_beep_mixer[i])) {
3114 				err = -ENOMEM;
3115 				goto error;
3116 			}
3117 		}
3118 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3119 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3120 			/* override the amp caps for beep generator */
3121 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3122 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3123 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3124 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3125 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3126 	}
3127 
3128 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3129 
3130 	return 0;
3131 
3132  error:
3133 	alc_free(codec);
3134 	return err;
3135 }
3136 
3137 /*
3138  * ALC269
3139  */
3140 
3141 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3142 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3143 };
3144 
3145 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3146 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3147 };
3148 
3149 /* different alc269-variants */
3150 enum {
3151 	ALC269_TYPE_ALC269VA,
3152 	ALC269_TYPE_ALC269VB,
3153 	ALC269_TYPE_ALC269VC,
3154 	ALC269_TYPE_ALC269VD,
3155 	ALC269_TYPE_ALC280,
3156 	ALC269_TYPE_ALC282,
3157 	ALC269_TYPE_ALC283,
3158 	ALC269_TYPE_ALC284,
3159 	ALC269_TYPE_ALC293,
3160 	ALC269_TYPE_ALC286,
3161 	ALC269_TYPE_ALC298,
3162 	ALC269_TYPE_ALC255,
3163 	ALC269_TYPE_ALC256,
3164 	ALC269_TYPE_ALC257,
3165 	ALC269_TYPE_ALC215,
3166 	ALC269_TYPE_ALC225,
3167 	ALC269_TYPE_ALC245,
3168 	ALC269_TYPE_ALC287,
3169 	ALC269_TYPE_ALC294,
3170 	ALC269_TYPE_ALC300,
3171 	ALC269_TYPE_ALC623,
3172 	ALC269_TYPE_ALC700,
3173 };
3174 
3175 /*
3176  * BIOS auto configuration
3177  */
3178 static int alc269_parse_auto_config(struct hda_codec *codec)
3179 {
3180 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3181 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3182 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3183 	struct alc_spec *spec = codec->spec;
3184 	const hda_nid_t *ssids;
3185 
3186 	switch (spec->codec_variant) {
3187 	case ALC269_TYPE_ALC269VA:
3188 	case ALC269_TYPE_ALC269VC:
3189 	case ALC269_TYPE_ALC280:
3190 	case ALC269_TYPE_ALC284:
3191 	case ALC269_TYPE_ALC293:
3192 		ssids = alc269va_ssids;
3193 		break;
3194 	case ALC269_TYPE_ALC269VB:
3195 	case ALC269_TYPE_ALC269VD:
3196 	case ALC269_TYPE_ALC282:
3197 	case ALC269_TYPE_ALC283:
3198 	case ALC269_TYPE_ALC286:
3199 	case ALC269_TYPE_ALC298:
3200 	case ALC269_TYPE_ALC255:
3201 	case ALC269_TYPE_ALC256:
3202 	case ALC269_TYPE_ALC257:
3203 	case ALC269_TYPE_ALC215:
3204 	case ALC269_TYPE_ALC225:
3205 	case ALC269_TYPE_ALC245:
3206 	case ALC269_TYPE_ALC287:
3207 	case ALC269_TYPE_ALC294:
3208 	case ALC269_TYPE_ALC300:
3209 	case ALC269_TYPE_ALC623:
3210 	case ALC269_TYPE_ALC700:
3211 		ssids = alc269_ssids;
3212 		break;
3213 	default:
3214 		ssids = alc269_ssids;
3215 		break;
3216 	}
3217 
3218 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3219 }
3220 
3221 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3222 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3223 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3224 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3225 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3226 	{}
3227 };
3228 
3229 static void alc_headset_btn_callback(struct hda_codec *codec,
3230 				     struct hda_jack_callback *jack)
3231 {
3232 	int report = 0;
3233 
3234 	if (jack->unsol_res & (7 << 13))
3235 		report |= SND_JACK_BTN_0;
3236 
3237 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3238 		report |= SND_JACK_BTN_1;
3239 
3240 	/* Volume up key */
3241 	if (jack->unsol_res & (7 << 23))
3242 		report |= SND_JACK_BTN_2;
3243 
3244 	/* Volume down key */
3245 	if (jack->unsol_res & (7 << 10))
3246 		report |= SND_JACK_BTN_3;
3247 
3248 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3249 }
3250 
3251 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3252 {
3253 	struct alc_spec *spec = codec->spec;
3254 
3255 	if (!spec->has_hs_key)
3256 		return;
3257 
3258 	switch (codec->core.vendor_id) {
3259 	case 0x10ec0215:
3260 	case 0x10ec0225:
3261 	case 0x10ec0285:
3262 	case 0x10ec0287:
3263 	case 0x10ec0295:
3264 	case 0x10ec0289:
3265 	case 0x10ec0299:
3266 		alc_write_coef_idx(codec, 0x48, 0x0);
3267 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3268 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3269 		break;
3270 	case 0x10ec0230:
3271 	case 0x10ec0236:
3272 	case 0x10ec0256:
3273 	case 0x10ec0257:
3274 	case 0x19e58326:
3275 		alc_write_coef_idx(codec, 0x48, 0x0);
3276 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3277 		break;
3278 	}
3279 }
3280 
3281 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3282 {
3283 	struct alc_spec *spec = codec->spec;
3284 
3285 	if (!spec->has_hs_key)
3286 		return;
3287 
3288 	switch (codec->core.vendor_id) {
3289 	case 0x10ec0215:
3290 	case 0x10ec0225:
3291 	case 0x10ec0285:
3292 	case 0x10ec0287:
3293 	case 0x10ec0295:
3294 	case 0x10ec0289:
3295 	case 0x10ec0299:
3296 		alc_write_coef_idx(codec, 0x48, 0xd011);
3297 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3298 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3299 		break;
3300 	case 0x10ec0230:
3301 	case 0x10ec0236:
3302 	case 0x10ec0256:
3303 	case 0x10ec0257:
3304 	case 0x19e58326:
3305 		alc_write_coef_idx(codec, 0x48, 0xd011);
3306 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3307 		break;
3308 	}
3309 }
3310 
3311 static void alc_fixup_headset_jack(struct hda_codec *codec,
3312 				    const struct hda_fixup *fix, int action)
3313 {
3314 	struct alc_spec *spec = codec->spec;
3315 	hda_nid_t hp_pin;
3316 
3317 	switch (action) {
3318 	case HDA_FIXUP_ACT_PRE_PROBE:
3319 		spec->has_hs_key = 1;
3320 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3321 						    alc_headset_btn_callback);
3322 		break;
3323 	case HDA_FIXUP_ACT_BUILD:
3324 		hp_pin = alc_get_hp_pin(spec);
3325 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3326 							alc_headset_btn_keymap,
3327 							hp_pin))
3328 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3329 					      false, SND_JACK_HEADSET,
3330 					      alc_headset_btn_keymap);
3331 
3332 		alc_enable_headset_jack_key(codec);
3333 		break;
3334 	}
3335 }
3336 
3337 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3338 {
3339 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3340 }
3341 
3342 static void alc269_shutup(struct hda_codec *codec)
3343 {
3344 	struct alc_spec *spec = codec->spec;
3345 
3346 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3347 		alc269vb_toggle_power_output(codec, 0);
3348 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3349 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3350 		msleep(150);
3351 	}
3352 	alc_shutup_pins(codec);
3353 }
3354 
3355 static const struct coef_fw alc282_coefs[] = {
3356 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3357 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3358 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3359 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3360 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3361 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3362 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3363 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3364 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3365 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3366 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3367 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3368 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3369 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3370 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3371 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3372 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3373 	WRITE_COEF(0x63, 0x2902), /* PLL */
3374 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3375 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3376 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3377 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3378 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3379 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3380 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3381 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3382 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3383 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3384 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3385 	{}
3386 };
3387 
3388 static void alc282_restore_default_value(struct hda_codec *codec)
3389 {
3390 	alc_process_coef_fw(codec, alc282_coefs);
3391 }
3392 
3393 static void alc282_init(struct hda_codec *codec)
3394 {
3395 	struct alc_spec *spec = codec->spec;
3396 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3397 	bool hp_pin_sense;
3398 	int coef78;
3399 
3400 	alc282_restore_default_value(codec);
3401 
3402 	if (!hp_pin)
3403 		return;
3404 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3405 	coef78 = alc_read_coef_idx(codec, 0x78);
3406 
3407 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3408 	/* Headphone capless set to high power mode */
3409 	alc_write_coef_idx(codec, 0x78, 0x9004);
3410 
3411 	if (hp_pin_sense)
3412 		msleep(2);
3413 
3414 	snd_hda_codec_write(codec, hp_pin, 0,
3415 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3416 
3417 	if (hp_pin_sense)
3418 		msleep(85);
3419 
3420 	snd_hda_codec_write(codec, hp_pin, 0,
3421 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3422 
3423 	if (hp_pin_sense)
3424 		msleep(100);
3425 
3426 	/* Headphone capless set to normal mode */
3427 	alc_write_coef_idx(codec, 0x78, coef78);
3428 }
3429 
3430 static void alc282_shutup(struct hda_codec *codec)
3431 {
3432 	struct alc_spec *spec = codec->spec;
3433 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3434 	bool hp_pin_sense;
3435 	int coef78;
3436 
3437 	if (!hp_pin) {
3438 		alc269_shutup(codec);
3439 		return;
3440 	}
3441 
3442 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3443 	coef78 = alc_read_coef_idx(codec, 0x78);
3444 	alc_write_coef_idx(codec, 0x78, 0x9004);
3445 
3446 	if (hp_pin_sense)
3447 		msleep(2);
3448 
3449 	snd_hda_codec_write(codec, hp_pin, 0,
3450 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3451 
3452 	if (hp_pin_sense)
3453 		msleep(85);
3454 
3455 	if (!spec->no_shutup_pins)
3456 		snd_hda_codec_write(codec, hp_pin, 0,
3457 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3458 
3459 	if (hp_pin_sense)
3460 		msleep(100);
3461 
3462 	alc_auto_setup_eapd(codec, false);
3463 	alc_shutup_pins(codec);
3464 	alc_write_coef_idx(codec, 0x78, coef78);
3465 }
3466 
3467 static const struct coef_fw alc283_coefs[] = {
3468 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3469 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3470 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3471 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3472 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3473 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3474 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3475 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3476 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3477 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3478 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3479 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3480 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3481 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3482 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3483 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3484 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3485 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3486 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3487 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3488 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3489 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3490 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3491 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3492 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3493 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3494 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3495 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3496 	WRITE_COEF(0x49, 0x0), /* test mode */
3497 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3498 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3499 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3500 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3501 	{}
3502 };
3503 
3504 static void alc283_restore_default_value(struct hda_codec *codec)
3505 {
3506 	alc_process_coef_fw(codec, alc283_coefs);
3507 }
3508 
3509 static void alc283_init(struct hda_codec *codec)
3510 {
3511 	struct alc_spec *spec = codec->spec;
3512 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3513 	bool hp_pin_sense;
3514 
3515 	alc283_restore_default_value(codec);
3516 
3517 	if (!hp_pin)
3518 		return;
3519 
3520 	msleep(30);
3521 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3522 
3523 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3524 	/* Headphone capless set to high power mode */
3525 	alc_write_coef_idx(codec, 0x43, 0x9004);
3526 
3527 	snd_hda_codec_write(codec, hp_pin, 0,
3528 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3529 
3530 	if (hp_pin_sense)
3531 		msleep(85);
3532 
3533 	snd_hda_codec_write(codec, hp_pin, 0,
3534 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3535 
3536 	if (hp_pin_sense)
3537 		msleep(85);
3538 	/* Index 0x46 Combo jack auto switch control 2 */
3539 	/* 3k pull low control for Headset jack. */
3540 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3541 	/* Headphone capless set to normal mode */
3542 	alc_write_coef_idx(codec, 0x43, 0x9614);
3543 }
3544 
3545 static void alc283_shutup(struct hda_codec *codec)
3546 {
3547 	struct alc_spec *spec = codec->spec;
3548 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3549 	bool hp_pin_sense;
3550 
3551 	if (!hp_pin) {
3552 		alc269_shutup(codec);
3553 		return;
3554 	}
3555 
3556 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3557 
3558 	alc_write_coef_idx(codec, 0x43, 0x9004);
3559 
3560 	/*depop hp during suspend*/
3561 	alc_write_coef_idx(codec, 0x06, 0x2100);
3562 
3563 	snd_hda_codec_write(codec, hp_pin, 0,
3564 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3565 
3566 	if (hp_pin_sense)
3567 		msleep(100);
3568 
3569 	if (!spec->no_shutup_pins)
3570 		snd_hda_codec_write(codec, hp_pin, 0,
3571 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3572 
3573 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3574 
3575 	if (hp_pin_sense)
3576 		msleep(100);
3577 	alc_auto_setup_eapd(codec, false);
3578 	alc_shutup_pins(codec);
3579 	alc_write_coef_idx(codec, 0x43, 0x9614);
3580 }
3581 
3582 static void alc256_init(struct hda_codec *codec)
3583 {
3584 	struct alc_spec *spec = codec->spec;
3585 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3586 	bool hp_pin_sense;
3587 
3588 	if (spec->ultra_low_power) {
3589 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3590 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3591 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3592 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3593 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3594 		msleep(30);
3595 	}
3596 
3597 	if (!hp_pin)
3598 		hp_pin = 0x21;
3599 
3600 	msleep(30);
3601 
3602 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3603 
3604 	if (hp_pin_sense)
3605 		msleep(2);
3606 
3607 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3608 
3609 	snd_hda_codec_write(codec, hp_pin, 0,
3610 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3611 
3612 	if (hp_pin_sense || spec->ultra_low_power)
3613 		msleep(85);
3614 
3615 	snd_hda_codec_write(codec, hp_pin, 0,
3616 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3617 
3618 	if (hp_pin_sense || spec->ultra_low_power)
3619 		msleep(100);
3620 
3621 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3622 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3623 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3624 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3625 	/*
3626 	 * Expose headphone mic (or possibly Line In on some machines) instead
3627 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3628 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3629 	 * this register.
3630 	 */
3631 	alc_write_coef_idx(codec, 0x36, 0x5757);
3632 }
3633 
3634 static void alc256_shutup(struct hda_codec *codec)
3635 {
3636 	struct alc_spec *spec = codec->spec;
3637 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3638 	bool hp_pin_sense;
3639 
3640 	if (!hp_pin)
3641 		hp_pin = 0x21;
3642 
3643 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3644 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3645 
3646 	if (hp_pin_sense)
3647 		msleep(2);
3648 
3649 	snd_hda_codec_write(codec, hp_pin, 0,
3650 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3651 
3652 	if (hp_pin_sense || spec->ultra_low_power)
3653 		msleep(85);
3654 
3655 	/* 3k pull low control for Headset jack. */
3656 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3657 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3658 	 * when booting with headset plugged. So skip setting it for the codec alc257
3659 	 */
3660 	if (spec->en_3kpull_low)
3661 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3662 
3663 	if (!spec->no_shutup_pins)
3664 		snd_hda_codec_write(codec, hp_pin, 0,
3665 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3666 
3667 	if (hp_pin_sense || spec->ultra_low_power)
3668 		msleep(100);
3669 
3670 	alc_auto_setup_eapd(codec, false);
3671 	alc_shutup_pins(codec);
3672 	if (spec->ultra_low_power) {
3673 		msleep(50);
3674 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3675 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3676 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3677 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3678 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3679 		msleep(30);
3680 	}
3681 }
3682 
3683 static void alc285_hp_init(struct hda_codec *codec)
3684 {
3685 	struct alc_spec *spec = codec->spec;
3686 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3687 	int i, val;
3688 	int coef38, coef0d, coef36;
3689 
3690 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3691 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3692 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3693 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3694 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3695 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3696 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3697 
3698 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3699 
3700 	if (hp_pin)
3701 		snd_hda_codec_write(codec, hp_pin, 0,
3702 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3703 
3704 	msleep(130);
3705 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3706 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3707 
3708 	if (hp_pin)
3709 		snd_hda_codec_write(codec, hp_pin, 0,
3710 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3711 	msleep(10);
3712 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3713 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3714 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3715 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3716 
3717 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3718 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3719 	for (i = 0; i < 20 && val & 0x8000; i++) {
3720 		msleep(50);
3721 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3722 	} /* Wait for depop procedure finish  */
3723 
3724 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3725 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3726 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3727 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3728 
3729 	msleep(50);
3730 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3731 }
3732 
3733 static void alc225_init(struct hda_codec *codec)
3734 {
3735 	struct alc_spec *spec = codec->spec;
3736 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3737 	bool hp1_pin_sense, hp2_pin_sense;
3738 
3739 	if (spec->ultra_low_power) {
3740 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3741 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3742 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3743 		msleep(30);
3744 	}
3745 
3746 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3747 		spec->codec_variant != ALC269_TYPE_ALC245)
3748 		/* required only at boot or S3 and S4 resume time */
3749 		if (!spec->done_hp_init ||
3750 			is_s3_resume(codec) ||
3751 			is_s4_resume(codec)) {
3752 			alc285_hp_init(codec);
3753 			spec->done_hp_init = true;
3754 		}
3755 
3756 	if (!hp_pin)
3757 		hp_pin = 0x21;
3758 	msleep(30);
3759 
3760 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3761 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3762 
3763 	if (hp1_pin_sense || hp2_pin_sense)
3764 		msleep(2);
3765 
3766 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3767 
3768 	if (hp1_pin_sense || spec->ultra_low_power)
3769 		snd_hda_codec_write(codec, hp_pin, 0,
3770 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3771 	if (hp2_pin_sense)
3772 		snd_hda_codec_write(codec, 0x16, 0,
3773 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3774 
3775 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3776 		msleep(85);
3777 
3778 	if (hp1_pin_sense || spec->ultra_low_power)
3779 		snd_hda_codec_write(codec, hp_pin, 0,
3780 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3781 	if (hp2_pin_sense)
3782 		snd_hda_codec_write(codec, 0x16, 0,
3783 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3784 
3785 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3786 		msleep(100);
3787 
3788 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3789 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3790 }
3791 
3792 static void alc225_shutup(struct hda_codec *codec)
3793 {
3794 	struct alc_spec *spec = codec->spec;
3795 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3796 	bool hp1_pin_sense, hp2_pin_sense;
3797 
3798 	if (!hp_pin)
3799 		hp_pin = 0x21;
3800 
3801 	alc_disable_headset_jack_key(codec);
3802 	/* 3k pull low control for Headset jack. */
3803 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3804 
3805 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3806 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3807 
3808 	if (hp1_pin_sense || hp2_pin_sense)
3809 		msleep(2);
3810 
3811 	if (hp1_pin_sense || spec->ultra_low_power)
3812 		snd_hda_codec_write(codec, hp_pin, 0,
3813 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3814 	if (hp2_pin_sense)
3815 		snd_hda_codec_write(codec, 0x16, 0,
3816 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3817 
3818 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3819 		msleep(85);
3820 
3821 	if (hp1_pin_sense || spec->ultra_low_power)
3822 		snd_hda_codec_write(codec, hp_pin, 0,
3823 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3824 	if (hp2_pin_sense)
3825 		snd_hda_codec_write(codec, 0x16, 0,
3826 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3827 
3828 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3829 		msleep(100);
3830 
3831 	alc_auto_setup_eapd(codec, false);
3832 	alc_shutup_pins(codec);
3833 	if (spec->ultra_low_power) {
3834 		msleep(50);
3835 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3836 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3837 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3838 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3839 		msleep(30);
3840 	}
3841 
3842 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3843 	alc_enable_headset_jack_key(codec);
3844 }
3845 
3846 static void alc_default_init(struct hda_codec *codec)
3847 {
3848 	struct alc_spec *spec = codec->spec;
3849 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3850 	bool hp_pin_sense;
3851 
3852 	if (!hp_pin)
3853 		return;
3854 
3855 	msleep(30);
3856 
3857 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3858 
3859 	if (hp_pin_sense)
3860 		msleep(2);
3861 
3862 	snd_hda_codec_write(codec, hp_pin, 0,
3863 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3864 
3865 	if (hp_pin_sense)
3866 		msleep(85);
3867 
3868 	snd_hda_codec_write(codec, hp_pin, 0,
3869 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3870 
3871 	if (hp_pin_sense)
3872 		msleep(100);
3873 }
3874 
3875 static void alc_default_shutup(struct hda_codec *codec)
3876 {
3877 	struct alc_spec *spec = codec->spec;
3878 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3879 	bool hp_pin_sense;
3880 
3881 	if (!hp_pin) {
3882 		alc269_shutup(codec);
3883 		return;
3884 	}
3885 
3886 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3887 
3888 	if (hp_pin_sense)
3889 		msleep(2);
3890 
3891 	snd_hda_codec_write(codec, hp_pin, 0,
3892 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3893 
3894 	if (hp_pin_sense)
3895 		msleep(85);
3896 
3897 	if (!spec->no_shutup_pins)
3898 		snd_hda_codec_write(codec, hp_pin, 0,
3899 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3900 
3901 	if (hp_pin_sense)
3902 		msleep(100);
3903 
3904 	alc_auto_setup_eapd(codec, false);
3905 	alc_shutup_pins(codec);
3906 }
3907 
3908 static void alc294_hp_init(struct hda_codec *codec)
3909 {
3910 	struct alc_spec *spec = codec->spec;
3911 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3912 	int i, val;
3913 
3914 	if (!hp_pin)
3915 		return;
3916 
3917 	snd_hda_codec_write(codec, hp_pin, 0,
3918 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3919 
3920 	msleep(100);
3921 
3922 	if (!spec->no_shutup_pins)
3923 		snd_hda_codec_write(codec, hp_pin, 0,
3924 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3925 
3926 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3927 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3928 
3929 	/* Wait for depop procedure finish  */
3930 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3931 	for (i = 0; i < 20 && val & 0x0080; i++) {
3932 		msleep(50);
3933 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3934 	}
3935 	/* Set HP depop to auto mode */
3936 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3937 	msleep(50);
3938 }
3939 
3940 static void alc294_init(struct hda_codec *codec)
3941 {
3942 	struct alc_spec *spec = codec->spec;
3943 
3944 	/* required only at boot or S4 resume time */
3945 	if (!spec->done_hp_init ||
3946 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3947 		alc294_hp_init(codec);
3948 		spec->done_hp_init = true;
3949 	}
3950 	alc_default_init(codec);
3951 }
3952 
3953 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3954 			     unsigned int val)
3955 {
3956 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3957 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3958 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3959 }
3960 
3961 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3962 {
3963 	unsigned int val;
3964 
3965 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3966 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3967 		& 0xffff;
3968 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3969 		<< 16;
3970 	return val;
3971 }
3972 
3973 static void alc5505_dsp_halt(struct hda_codec *codec)
3974 {
3975 	unsigned int val;
3976 
3977 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3978 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3979 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3980 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3981 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3982 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3983 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3984 	val = alc5505_coef_get(codec, 0x6220);
3985 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3986 }
3987 
3988 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3989 {
3990 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
3991 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3992 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3993 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3994 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
3995 	alc5505_coef_set(codec, 0x880c, 0x00000004);
3996 }
3997 
3998 static void alc5505_dsp_init(struct hda_codec *codec)
3999 {
4000 	unsigned int val;
4001 
4002 	alc5505_dsp_halt(codec);
4003 	alc5505_dsp_back_from_halt(codec);
4004 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4005 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
4006 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4007 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4008 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4009 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4010 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4011 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4012 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
4013 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
4014 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4015 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4016 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4017 
4018 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4019 	if (val <= 3)
4020 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4021 	else
4022 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4023 
4024 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4025 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4026 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4027 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4028 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4029 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4030 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4031 
4032 #ifdef HALT_REALTEK_ALC5505
4033 	alc5505_dsp_halt(codec);
4034 #endif
4035 }
4036 
4037 #ifdef HALT_REALTEK_ALC5505
4038 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4039 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4040 #else
4041 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4042 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4043 #endif
4044 
4045 #ifdef CONFIG_PM
4046 static int alc269_suspend(struct hda_codec *codec)
4047 {
4048 	struct alc_spec *spec = codec->spec;
4049 
4050 	if (spec->has_alc5505_dsp)
4051 		alc5505_dsp_suspend(codec);
4052 
4053 	return alc_suspend(codec);
4054 }
4055 
4056 static int alc269_resume(struct hda_codec *codec)
4057 {
4058 	struct alc_spec *spec = codec->spec;
4059 
4060 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4061 		alc269vb_toggle_power_output(codec, 0);
4062 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4063 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4064 		msleep(150);
4065 	}
4066 
4067 	codec->patch_ops.init(codec);
4068 
4069 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4070 		alc269vb_toggle_power_output(codec, 1);
4071 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4072 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4073 		msleep(200);
4074 	}
4075 
4076 	snd_hda_regmap_sync(codec);
4077 	hda_call_check_power_status(codec, 0x01);
4078 
4079 	/* on some machine, the BIOS will clear the codec gpio data when enter
4080 	 * suspend, and won't restore the data after resume, so we restore it
4081 	 * in the driver.
4082 	 */
4083 	if (spec->gpio_data)
4084 		alc_write_gpio_data(codec);
4085 
4086 	if (spec->has_alc5505_dsp)
4087 		alc5505_dsp_resume(codec);
4088 
4089 	return 0;
4090 }
4091 #endif /* CONFIG_PM */
4092 
4093 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4094 						 const struct hda_fixup *fix, int action)
4095 {
4096 	struct alc_spec *spec = codec->spec;
4097 
4098 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4099 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4100 }
4101 
4102 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4103 						 const struct hda_fixup *fix,
4104 						 int action)
4105 {
4106 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4107 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4108 
4109 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4110 		snd_hda_codec_set_pincfg(codec, 0x19,
4111 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4112 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4113 }
4114 
4115 static void alc269_fixup_hweq(struct hda_codec *codec,
4116 			       const struct hda_fixup *fix, int action)
4117 {
4118 	if (action == HDA_FIXUP_ACT_INIT)
4119 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4120 }
4121 
4122 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4123 				       const struct hda_fixup *fix, int action)
4124 {
4125 	struct alc_spec *spec = codec->spec;
4126 
4127 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4128 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4129 }
4130 
4131 static void alc271_fixup_dmic(struct hda_codec *codec,
4132 			      const struct hda_fixup *fix, int action)
4133 {
4134 	static const struct hda_verb verbs[] = {
4135 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4136 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4137 		{}
4138 	};
4139 	unsigned int cfg;
4140 
4141 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4142 	    strcmp(codec->core.chip_name, "ALC269VB"))
4143 		return;
4144 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4145 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4146 		snd_hda_sequence_write(codec, verbs);
4147 }
4148 
4149 /* Fix the speaker amp after resume, etc */
4150 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4151 					  const struct hda_fixup *fix,
4152 					  int action)
4153 {
4154 	if (action == HDA_FIXUP_ACT_INIT)
4155 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4156 }
4157 
4158 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4159 				 const struct hda_fixup *fix, int action)
4160 {
4161 	struct alc_spec *spec = codec->spec;
4162 
4163 	if (action != HDA_FIXUP_ACT_PROBE)
4164 		return;
4165 
4166 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4167 	 * fix the sample rate of analog I/O to 44.1kHz
4168 	 */
4169 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4170 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4171 }
4172 
4173 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4174 				     const struct hda_fixup *fix, int action)
4175 {
4176 	/* The digital-mic unit sends PDM (differential signal) instead of
4177 	 * the standard PCM, thus you can't record a valid mono stream as is.
4178 	 * Below is a workaround specific to ALC269 to control the dmic
4179 	 * signal source as mono.
4180 	 */
4181 	if (action == HDA_FIXUP_ACT_INIT)
4182 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4183 }
4184 
4185 static void alc269_quanta_automute(struct hda_codec *codec)
4186 {
4187 	snd_hda_gen_update_outputs(codec);
4188 
4189 	alc_write_coef_idx(codec, 0x0c, 0x680);
4190 	alc_write_coef_idx(codec, 0x0c, 0x480);
4191 }
4192 
4193 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4194 				     const struct hda_fixup *fix, int action)
4195 {
4196 	struct alc_spec *spec = codec->spec;
4197 	if (action != HDA_FIXUP_ACT_PROBE)
4198 		return;
4199 	spec->gen.automute_hook = alc269_quanta_automute;
4200 }
4201 
4202 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4203 					 struct hda_jack_callback *jack)
4204 {
4205 	struct alc_spec *spec = codec->spec;
4206 	int vref;
4207 	msleep(200);
4208 	snd_hda_gen_hp_automute(codec, jack);
4209 
4210 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4211 	msleep(100);
4212 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4213 			    vref);
4214 	msleep(500);
4215 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4216 			    vref);
4217 }
4218 
4219 /*
4220  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4221  */
4222 struct hda_alc298_mbxinit {
4223 	unsigned char value_0x23;
4224 	unsigned char value_0x25;
4225 };
4226 
4227 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4228 					 const struct hda_alc298_mbxinit *initval,
4229 					 bool first)
4230 {
4231 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4232 	alc_write_coef_idx(codec, 0x26, 0xb000);
4233 
4234 	if (first)
4235 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4236 
4237 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4238 	alc_write_coef_idx(codec, 0x26, 0xf000);
4239 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4240 
4241 	if (initval->value_0x23 != 0x1e)
4242 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4243 
4244 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4245 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4246 }
4247 
4248 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4249 					   const struct hda_fixup *fix,
4250 					   int action)
4251 {
4252 	/* Initialization magic */
4253 	static const struct hda_alc298_mbxinit dac_init[] = {
4254 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4255 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4256 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4257 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4258 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4259 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4260 		{0x2f, 0x00},
4261 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4262 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4263 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4264 		{}
4265 	};
4266 	const struct hda_alc298_mbxinit *seq;
4267 
4268 	if (action != HDA_FIXUP_ACT_INIT)
4269 		return;
4270 
4271 	/* Start */
4272 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4273 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4274 	alc_write_coef_idx(codec, 0x26, 0xf000);
4275 	alc_write_coef_idx(codec, 0x22, 0x31);
4276 	alc_write_coef_idx(codec, 0x23, 0x0b);
4277 	alc_write_coef_idx(codec, 0x25, 0x00);
4278 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4279 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4280 
4281 	for (seq = dac_init; seq->value_0x23; seq++)
4282 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4283 }
4284 
4285 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4286 				     const struct hda_fixup *fix, int action)
4287 {
4288 	struct alc_spec *spec = codec->spec;
4289 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4290 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4291 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4292 	}
4293 }
4294 
4295 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4296 				bool polarity, bool on)
4297 {
4298 	unsigned int pinval;
4299 
4300 	if (!pin)
4301 		return;
4302 	if (polarity)
4303 		on = !on;
4304 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4305 	pinval &= ~AC_PINCTL_VREFEN;
4306 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4307 	/* temporarily power up/down for setting VREF */
4308 	snd_hda_power_up_pm(codec);
4309 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4310 	snd_hda_power_down_pm(codec);
4311 }
4312 
4313 /* update mute-LED according to the speaker mute state via mic VREF pin */
4314 static int vref_mute_led_set(struct led_classdev *led_cdev,
4315 			     enum led_brightness brightness)
4316 {
4317 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4318 	struct alc_spec *spec = codec->spec;
4319 
4320 	alc_update_vref_led(codec, spec->mute_led_nid,
4321 			    spec->mute_led_polarity, brightness);
4322 	return 0;
4323 }
4324 
4325 /* Make sure the led works even in runtime suspend */
4326 static unsigned int led_power_filter(struct hda_codec *codec,
4327 						  hda_nid_t nid,
4328 						  unsigned int power_state)
4329 {
4330 	struct alc_spec *spec = codec->spec;
4331 
4332 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4333 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4334 		return power_state;
4335 
4336 	/* Set pin ctl again, it might have just been set to 0 */
4337 	snd_hda_set_pin_ctl(codec, nid,
4338 			    snd_hda_codec_get_pin_target(codec, nid));
4339 
4340 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4341 }
4342 
4343 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4344 				     const struct hda_fixup *fix, int action)
4345 {
4346 	struct alc_spec *spec = codec->spec;
4347 	const struct dmi_device *dev = NULL;
4348 
4349 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4350 		return;
4351 
4352 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4353 		int pol, pin;
4354 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4355 			continue;
4356 		if (pin < 0x0a || pin >= 0x10)
4357 			break;
4358 		spec->mute_led_polarity = pol;
4359 		spec->mute_led_nid = pin - 0x0a + 0x18;
4360 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4361 		codec->power_filter = led_power_filter;
4362 		codec_dbg(codec,
4363 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4364 			   spec->mute_led_polarity);
4365 		break;
4366 	}
4367 }
4368 
4369 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4370 					  const struct hda_fixup *fix,
4371 					  int action, hda_nid_t pin)
4372 {
4373 	struct alc_spec *spec = codec->spec;
4374 
4375 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4376 		spec->mute_led_polarity = 0;
4377 		spec->mute_led_nid = pin;
4378 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4379 		codec->power_filter = led_power_filter;
4380 	}
4381 }
4382 
4383 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4384 				const struct hda_fixup *fix, int action)
4385 {
4386 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4387 }
4388 
4389 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4390 				const struct hda_fixup *fix, int action)
4391 {
4392 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4393 }
4394 
4395 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4396 				const struct hda_fixup *fix, int action)
4397 {
4398 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4399 }
4400 
4401 /* update LED status via GPIO */
4402 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4403 				int polarity, bool enabled)
4404 {
4405 	if (polarity)
4406 		enabled = !enabled;
4407 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4408 }
4409 
4410 /* turn on/off mute LED via GPIO per vmaster hook */
4411 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4412 			     enum led_brightness brightness)
4413 {
4414 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4415 	struct alc_spec *spec = codec->spec;
4416 
4417 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4418 			    spec->mute_led_polarity, !brightness);
4419 	return 0;
4420 }
4421 
4422 /* turn on/off mic-mute LED via GPIO per capture hook */
4423 static int micmute_led_set(struct led_classdev *led_cdev,
4424 			   enum led_brightness brightness)
4425 {
4426 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4427 	struct alc_spec *spec = codec->spec;
4428 
4429 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4430 			    spec->micmute_led_polarity, !brightness);
4431 	return 0;
4432 }
4433 
4434 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4435 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4436 				  int action,
4437 				  unsigned int mute_mask,
4438 				  unsigned int micmute_mask)
4439 {
4440 	struct alc_spec *spec = codec->spec;
4441 
4442 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4443 
4444 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4445 		return;
4446 	if (mute_mask) {
4447 		spec->gpio_mute_led_mask = mute_mask;
4448 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4449 	}
4450 	if (micmute_mask) {
4451 		spec->gpio_mic_led_mask = micmute_mask;
4452 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4453 	}
4454 }
4455 
4456 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4457 				const struct hda_fixup *fix, int action)
4458 {
4459 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4460 }
4461 
4462 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4463 				const struct hda_fixup *fix, int action)
4464 {
4465 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4466 }
4467 
4468 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4469 				const struct hda_fixup *fix, int action)
4470 {
4471 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4472 }
4473 
4474 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4475 				const struct hda_fixup *fix, int action)
4476 {
4477 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4478 }
4479 
4480 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4481 				const struct hda_fixup *fix, int action)
4482 {
4483 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4484 }
4485 
4486 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4487 				const struct hda_fixup *fix, int action)
4488 {
4489 	struct alc_spec *spec = codec->spec;
4490 
4491 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4492 		spec->micmute_led_polarity = 1;
4493 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4494 }
4495 
4496 /* turn on/off mic-mute LED per capture hook via VREF change */
4497 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4498 				enum led_brightness brightness)
4499 {
4500 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4501 	struct alc_spec *spec = codec->spec;
4502 
4503 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4504 			    spec->micmute_led_polarity, brightness);
4505 	return 0;
4506 }
4507 
4508 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4509 				const struct hda_fixup *fix, int action)
4510 {
4511 	struct alc_spec *spec = codec->spec;
4512 
4513 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4514 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4515 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4516 		 * enable headphone amp
4517 		 */
4518 		spec->gpio_mask |= 0x10;
4519 		spec->gpio_dir |= 0x10;
4520 		spec->cap_mute_led_nid = 0x18;
4521 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4522 		codec->power_filter = led_power_filter;
4523 	}
4524 }
4525 
4526 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4527 				   const struct hda_fixup *fix, int action)
4528 {
4529 	struct alc_spec *spec = codec->spec;
4530 
4531 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4532 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4533 		spec->cap_mute_led_nid = 0x18;
4534 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4535 		codec->power_filter = led_power_filter;
4536 	}
4537 }
4538 
4539 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4540  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4541  */
4542 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4543 				     const struct hda_fixup *fix, int action)
4544 {
4545 	struct alc_spec *spec = codec->spec;
4546 
4547 	switch (action) {
4548 	case HDA_FIXUP_ACT_PRE_PROBE:
4549 		spec->gpio_mask |= 0x01;
4550 		spec->gpio_dir |= 0x01;
4551 		break;
4552 	case HDA_FIXUP_ACT_INIT:
4553 		/* need to toggle GPIO to enable the amp */
4554 		alc_update_gpio_data(codec, 0x01, true);
4555 		msleep(100);
4556 		alc_update_gpio_data(codec, 0x01, false);
4557 		break;
4558 	}
4559 }
4560 
4561 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4562 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4563 				    struct hda_codec *codec,
4564 				    struct snd_pcm_substream *substream,
4565 				    int action)
4566 {
4567 	switch (action) {
4568 	case HDA_GEN_PCM_ACT_PREPARE:
4569 		alc_update_gpio_data(codec, 0x04, true);
4570 		break;
4571 	case HDA_GEN_PCM_ACT_CLEANUP:
4572 		alc_update_gpio_data(codec, 0x04, false);
4573 		break;
4574 	}
4575 }
4576 
4577 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4578 				      const struct hda_fixup *fix,
4579 				      int action)
4580 {
4581 	struct alc_spec *spec = codec->spec;
4582 
4583 	if (action == HDA_FIXUP_ACT_PROBE) {
4584 		spec->gpio_mask |= 0x04;
4585 		spec->gpio_dir |= 0x04;
4586 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4587 	}
4588 }
4589 
4590 static void alc_update_coef_led(struct hda_codec *codec,
4591 				struct alc_coef_led *led,
4592 				bool polarity, bool on)
4593 {
4594 	if (polarity)
4595 		on = !on;
4596 	/* temporarily power up/down for setting COEF bit */
4597 	alc_update_coef_idx(codec, led->idx, led->mask,
4598 			    on ? led->on : led->off);
4599 }
4600 
4601 /* update mute-LED according to the speaker mute state via COEF bit */
4602 static int coef_mute_led_set(struct led_classdev *led_cdev,
4603 			     enum led_brightness brightness)
4604 {
4605 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4606 	struct alc_spec *spec = codec->spec;
4607 
4608 	alc_update_coef_led(codec, &spec->mute_led_coef,
4609 			    spec->mute_led_polarity, brightness);
4610 	return 0;
4611 }
4612 
4613 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4614 					  const struct hda_fixup *fix,
4615 					  int action)
4616 {
4617 	struct alc_spec *spec = codec->spec;
4618 
4619 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4620 		spec->mute_led_polarity = 0;
4621 		spec->mute_led_coef.idx = 0x0b;
4622 		spec->mute_led_coef.mask = 1 << 3;
4623 		spec->mute_led_coef.on = 1 << 3;
4624 		spec->mute_led_coef.off = 0;
4625 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4626 	}
4627 }
4628 
4629 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4630 					  const struct hda_fixup *fix,
4631 					  int action)
4632 {
4633 	struct alc_spec *spec = codec->spec;
4634 
4635 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4636 		spec->mute_led_polarity = 0;
4637 		spec->mute_led_coef.idx = 0x34;
4638 		spec->mute_led_coef.mask = 1 << 5;
4639 		spec->mute_led_coef.on = 0;
4640 		spec->mute_led_coef.off = 1 << 5;
4641 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4642 	}
4643 }
4644 
4645 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4646 					  const struct hda_fixup *fix, int action)
4647 {
4648 	struct alc_spec *spec = codec->spec;
4649 
4650 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4651 		spec->mute_led_polarity = 0;
4652 		spec->mute_led_coef.idx = 0x07;
4653 		spec->mute_led_coef.mask = 1;
4654 		spec->mute_led_coef.on = 1;
4655 		spec->mute_led_coef.off = 0;
4656 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4657 	}
4658 }
4659 
4660 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4661 					  const struct hda_fixup *fix,
4662 					  int action)
4663 {
4664 	struct alc_spec *spec = codec->spec;
4665 
4666 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4667 		spec->mute_led_polarity = 0;
4668 		spec->mute_led_coef.idx = 0x0b;
4669 		spec->mute_led_coef.mask = 3 << 2;
4670 		spec->mute_led_coef.on = 2 << 2;
4671 		spec->mute_led_coef.off = 1 << 2;
4672 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4673 	}
4674 }
4675 
4676 /* turn on/off mic-mute LED per capture hook by coef bit */
4677 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4678 				enum led_brightness brightness)
4679 {
4680 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4681 	struct alc_spec *spec = codec->spec;
4682 
4683 	alc_update_coef_led(codec, &spec->mic_led_coef,
4684 			    spec->micmute_led_polarity, brightness);
4685 	return 0;
4686 }
4687 
4688 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4689 				const struct hda_fixup *fix, int action)
4690 {
4691 	struct alc_spec *spec = codec->spec;
4692 
4693 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4694 		spec->mic_led_coef.idx = 0x19;
4695 		spec->mic_led_coef.mask = 1 << 13;
4696 		spec->mic_led_coef.on = 1 << 13;
4697 		spec->mic_led_coef.off = 0;
4698 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4699 	}
4700 }
4701 
4702 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4703 				const struct hda_fixup *fix, int action)
4704 {
4705 	struct alc_spec *spec = codec->spec;
4706 
4707 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4708 		spec->micmute_led_polarity = 1;
4709 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4710 }
4711 
4712 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4713 				const struct hda_fixup *fix, int action)
4714 {
4715 	struct alc_spec *spec = codec->spec;
4716 
4717 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4718 		spec->mic_led_coef.idx = 0x35;
4719 		spec->mic_led_coef.mask = 3 << 2;
4720 		spec->mic_led_coef.on = 2 << 2;
4721 		spec->mic_led_coef.off = 1 << 2;
4722 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4723 	}
4724 }
4725 
4726 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4727 				const struct hda_fixup *fix, int action)
4728 {
4729 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4730 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4731 }
4732 
4733 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4734 				const struct hda_fixup *fix, int action)
4735 {
4736 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4737 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4738 }
4739 
4740 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4741 				const struct hda_fixup *fix, int action)
4742 {
4743 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4744 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4745 }
4746 
4747 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4748 				const struct hda_fixup *fix, int action)
4749 {
4750 	struct alc_spec *spec = codec->spec;
4751 
4752 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4753 		spec->cap_mute_led_nid = 0x1a;
4754 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4755 		codec->power_filter = led_power_filter;
4756 	}
4757 }
4758 
4759 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4760 				const struct hda_fixup *fix, int action)
4761 {
4762 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4763 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4764 }
4765 
4766 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4767 						  const unsigned short coefs[2])
4768 {
4769 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4770 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4771 	alc_write_coef_idx(codec, 0x26, 0xb011);
4772 }
4773 
4774 struct alc298_samsung_amp_desc {
4775 	unsigned char nid;
4776 	unsigned short init_seq[2][2];
4777 };
4778 
4779 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4780 				     const struct hda_fixup *fix, int action)
4781 {
4782 	int i, j;
4783 	static const unsigned short init_seq[][2] = {
4784 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4785 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4786 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4787 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4788 	};
4789 	static const struct alc298_samsung_amp_desc amps[] = {
4790 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4791 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4792 	};
4793 
4794 	if (action != HDA_FIXUP_ACT_INIT)
4795 		return;
4796 
4797 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4798 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4799 
4800 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4801 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4802 
4803 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4804 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4805 	}
4806 }
4807 
4808 #if IS_REACHABLE(CONFIG_INPUT)
4809 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4810 				   struct hda_jack_callback *event)
4811 {
4812 	struct alc_spec *spec = codec->spec;
4813 
4814 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4815 	   send both key on and key off event for every interrupt. */
4816 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4817 	input_sync(spec->kb_dev);
4818 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4819 	input_sync(spec->kb_dev);
4820 }
4821 
4822 static int alc_register_micmute_input_device(struct hda_codec *codec)
4823 {
4824 	struct alc_spec *spec = codec->spec;
4825 	int i;
4826 
4827 	spec->kb_dev = input_allocate_device();
4828 	if (!spec->kb_dev) {
4829 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4830 		return -ENOMEM;
4831 	}
4832 
4833 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4834 
4835 	spec->kb_dev->name = "Microphone Mute Button";
4836 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4837 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4838 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4839 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4840 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4841 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4842 
4843 	if (input_register_device(spec->kb_dev)) {
4844 		codec_err(codec, "input_register_device failed\n");
4845 		input_free_device(spec->kb_dev);
4846 		spec->kb_dev = NULL;
4847 		return -ENOMEM;
4848 	}
4849 
4850 	return 0;
4851 }
4852 
4853 /* GPIO1 = set according to SKU external amp
4854  * GPIO2 = mic mute hotkey
4855  * GPIO3 = mute LED
4856  * GPIO4 = mic mute LED
4857  */
4858 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4859 					     const struct hda_fixup *fix, int action)
4860 {
4861 	struct alc_spec *spec = codec->spec;
4862 
4863 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4864 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4865 		spec->init_amp = ALC_INIT_DEFAULT;
4866 		if (alc_register_micmute_input_device(codec) != 0)
4867 			return;
4868 
4869 		spec->gpio_mask |= 0x06;
4870 		spec->gpio_dir |= 0x02;
4871 		spec->gpio_data |= 0x02;
4872 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4873 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4874 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4875 						    gpio2_mic_hotkey_event);
4876 		return;
4877 	}
4878 
4879 	if (!spec->kb_dev)
4880 		return;
4881 
4882 	switch (action) {
4883 	case HDA_FIXUP_ACT_FREE:
4884 		input_unregister_device(spec->kb_dev);
4885 		spec->kb_dev = NULL;
4886 	}
4887 }
4888 
4889 /* Line2 = mic mute hotkey
4890  * GPIO2 = mic mute LED
4891  */
4892 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4893 					     const struct hda_fixup *fix, int action)
4894 {
4895 	struct alc_spec *spec = codec->spec;
4896 
4897 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4898 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4899 		spec->init_amp = ALC_INIT_DEFAULT;
4900 		if (alc_register_micmute_input_device(codec) != 0)
4901 			return;
4902 
4903 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
4904 						    gpio2_mic_hotkey_event);
4905 		return;
4906 	}
4907 
4908 	if (!spec->kb_dev)
4909 		return;
4910 
4911 	switch (action) {
4912 	case HDA_FIXUP_ACT_FREE:
4913 		input_unregister_device(spec->kb_dev);
4914 		spec->kb_dev = NULL;
4915 	}
4916 }
4917 #else /* INPUT */
4918 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
4919 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
4920 #endif /* INPUT */
4921 
4922 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4923 				const struct hda_fixup *fix, int action)
4924 {
4925 	struct alc_spec *spec = codec->spec;
4926 
4927 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4928 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4929 		spec->cap_mute_led_nid = 0x18;
4930 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4931 	}
4932 }
4933 
4934 static const struct coef_fw alc225_pre_hsmode[] = {
4935 	UPDATE_COEF(0x4a, 1<<8, 0),
4936 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4937 	UPDATE_COEF(0x63, 3<<14, 3<<14),
4938 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
4939 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
4940 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4941 	UPDATE_COEF(0x4a, 3<<10, 0),
4942 	{}
4943 };
4944 
4945 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4946 {
4947 	struct alc_spec *spec = codec->spec;
4948 	static const struct coef_fw coef0255[] = {
4949 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4950 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4951 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4952 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4953 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4954 		{}
4955 	};
4956 	static const struct coef_fw coef0256[] = {
4957 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4958 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4959 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4960 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4961 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4962 		{}
4963 	};
4964 	static const struct coef_fw coef0233[] = {
4965 		WRITE_COEF(0x1b, 0x0c0b),
4966 		WRITE_COEF(0x45, 0xc429),
4967 		UPDATE_COEF(0x35, 0x4000, 0),
4968 		WRITE_COEF(0x06, 0x2104),
4969 		WRITE_COEF(0x1a, 0x0001),
4970 		WRITE_COEF(0x26, 0x0004),
4971 		WRITE_COEF(0x32, 0x42a3),
4972 		{}
4973 	};
4974 	static const struct coef_fw coef0288[] = {
4975 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4976 		UPDATE_COEF(0x50, 0x2000, 0x2000),
4977 		UPDATE_COEF(0x56, 0x0006, 0x0006),
4978 		UPDATE_COEF(0x66, 0x0008, 0),
4979 		UPDATE_COEF(0x67, 0x2000, 0),
4980 		{}
4981 	};
4982 	static const struct coef_fw coef0298[] = {
4983 		UPDATE_COEF(0x19, 0x1300, 0x0300),
4984 		{}
4985 	};
4986 	static const struct coef_fw coef0292[] = {
4987 		WRITE_COEF(0x76, 0x000e),
4988 		WRITE_COEF(0x6c, 0x2400),
4989 		WRITE_COEF(0x18, 0x7308),
4990 		WRITE_COEF(0x6b, 0xc429),
4991 		{}
4992 	};
4993 	static const struct coef_fw coef0293[] = {
4994 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4995 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4996 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4997 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4998 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4999 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5000 		{}
5001 	};
5002 	static const struct coef_fw coef0668[] = {
5003 		WRITE_COEF(0x15, 0x0d40),
5004 		WRITE_COEF(0xb7, 0x802b),
5005 		{}
5006 	};
5007 	static const struct coef_fw coef0225[] = {
5008 		UPDATE_COEF(0x63, 3<<14, 0),
5009 		{}
5010 	};
5011 	static const struct coef_fw coef0274[] = {
5012 		UPDATE_COEF(0x4a, 0x0100, 0),
5013 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5014 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
5015 		UPDATE_COEF(0x4a, 0x0010, 0),
5016 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5017 		WRITE_COEF(0x45, 0x5289),
5018 		UPDATE_COEF(0x4a, 0x0c00, 0),
5019 		{}
5020 	};
5021 
5022 	if (spec->no_internal_mic_pin) {
5023 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5024 		return;
5025 	}
5026 
5027 	switch (codec->core.vendor_id) {
5028 	case 0x10ec0255:
5029 		alc_process_coef_fw(codec, coef0255);
5030 		break;
5031 	case 0x10ec0230:
5032 	case 0x10ec0236:
5033 	case 0x10ec0256:
5034 	case 0x19e58326:
5035 		alc_process_coef_fw(codec, coef0256);
5036 		break;
5037 	case 0x10ec0234:
5038 	case 0x10ec0274:
5039 	case 0x10ec0294:
5040 		alc_process_coef_fw(codec, coef0274);
5041 		break;
5042 	case 0x10ec0233:
5043 	case 0x10ec0283:
5044 		alc_process_coef_fw(codec, coef0233);
5045 		break;
5046 	case 0x10ec0286:
5047 	case 0x10ec0288:
5048 		alc_process_coef_fw(codec, coef0288);
5049 		break;
5050 	case 0x10ec0298:
5051 		alc_process_coef_fw(codec, coef0298);
5052 		alc_process_coef_fw(codec, coef0288);
5053 		break;
5054 	case 0x10ec0292:
5055 		alc_process_coef_fw(codec, coef0292);
5056 		break;
5057 	case 0x10ec0293:
5058 		alc_process_coef_fw(codec, coef0293);
5059 		break;
5060 	case 0x10ec0668:
5061 		alc_process_coef_fw(codec, coef0668);
5062 		break;
5063 	case 0x10ec0215:
5064 	case 0x10ec0225:
5065 	case 0x10ec0285:
5066 	case 0x10ec0295:
5067 	case 0x10ec0289:
5068 	case 0x10ec0299:
5069 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5070 		alc_process_coef_fw(codec, coef0225);
5071 		break;
5072 	case 0x10ec0867:
5073 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5074 		break;
5075 	}
5076 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5077 }
5078 
5079 
5080 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5081 				    hda_nid_t mic_pin)
5082 {
5083 	static const struct coef_fw coef0255[] = {
5084 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5085 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5086 		{}
5087 	};
5088 	static const struct coef_fw coef0256[] = {
5089 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5090 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5091 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5092 		{}
5093 	};
5094 	static const struct coef_fw coef0233[] = {
5095 		UPDATE_COEF(0x35, 0, 1<<14),
5096 		WRITE_COEF(0x06, 0x2100),
5097 		WRITE_COEF(0x1a, 0x0021),
5098 		WRITE_COEF(0x26, 0x008c),
5099 		{}
5100 	};
5101 	static const struct coef_fw coef0288[] = {
5102 		UPDATE_COEF(0x4f, 0x00c0, 0),
5103 		UPDATE_COEF(0x50, 0x2000, 0),
5104 		UPDATE_COEF(0x56, 0x0006, 0),
5105 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5106 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5107 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5108 		{}
5109 	};
5110 	static const struct coef_fw coef0292[] = {
5111 		WRITE_COEF(0x19, 0xa208),
5112 		WRITE_COEF(0x2e, 0xacf0),
5113 		{}
5114 	};
5115 	static const struct coef_fw coef0293[] = {
5116 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5117 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5118 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5119 		{}
5120 	};
5121 	static const struct coef_fw coef0688[] = {
5122 		WRITE_COEF(0xb7, 0x802b),
5123 		WRITE_COEF(0xb5, 0x1040),
5124 		UPDATE_COEF(0xc3, 0, 1<<12),
5125 		{}
5126 	};
5127 	static const struct coef_fw coef0225[] = {
5128 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5129 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5130 		UPDATE_COEF(0x63, 3<<14, 0),
5131 		{}
5132 	};
5133 	static const struct coef_fw coef0274[] = {
5134 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5135 		UPDATE_COEF(0x4a, 0x0010, 0),
5136 		UPDATE_COEF(0x6b, 0xf000, 0),
5137 		{}
5138 	};
5139 
5140 	switch (codec->core.vendor_id) {
5141 	case 0x10ec0255:
5142 		alc_write_coef_idx(codec, 0x45, 0xc489);
5143 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5144 		alc_process_coef_fw(codec, coef0255);
5145 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5146 		break;
5147 	case 0x10ec0230:
5148 	case 0x10ec0236:
5149 	case 0x10ec0256:
5150 	case 0x19e58326:
5151 		alc_write_coef_idx(codec, 0x45, 0xc489);
5152 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5153 		alc_process_coef_fw(codec, coef0256);
5154 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5155 		break;
5156 	case 0x10ec0234:
5157 	case 0x10ec0274:
5158 	case 0x10ec0294:
5159 		alc_write_coef_idx(codec, 0x45, 0x4689);
5160 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5161 		alc_process_coef_fw(codec, coef0274);
5162 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5163 		break;
5164 	case 0x10ec0233:
5165 	case 0x10ec0283:
5166 		alc_write_coef_idx(codec, 0x45, 0xc429);
5167 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5168 		alc_process_coef_fw(codec, coef0233);
5169 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5170 		break;
5171 	case 0x10ec0286:
5172 	case 0x10ec0288:
5173 	case 0x10ec0298:
5174 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5175 		alc_process_coef_fw(codec, coef0288);
5176 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5177 		break;
5178 	case 0x10ec0292:
5179 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5180 		alc_process_coef_fw(codec, coef0292);
5181 		break;
5182 	case 0x10ec0293:
5183 		/* Set to TRS mode */
5184 		alc_write_coef_idx(codec, 0x45, 0xc429);
5185 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5186 		alc_process_coef_fw(codec, coef0293);
5187 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5188 		break;
5189 	case 0x10ec0867:
5190 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5191 		fallthrough;
5192 	case 0x10ec0221:
5193 	case 0x10ec0662:
5194 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5195 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5196 		break;
5197 	case 0x10ec0668:
5198 		alc_write_coef_idx(codec, 0x11, 0x0001);
5199 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5200 		alc_process_coef_fw(codec, coef0688);
5201 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5202 		break;
5203 	case 0x10ec0215:
5204 	case 0x10ec0225:
5205 	case 0x10ec0285:
5206 	case 0x10ec0295:
5207 	case 0x10ec0289:
5208 	case 0x10ec0299:
5209 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5210 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5211 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5212 		alc_process_coef_fw(codec, coef0225);
5213 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5214 		break;
5215 	}
5216 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5217 }
5218 
5219 static void alc_headset_mode_default(struct hda_codec *codec)
5220 {
5221 	static const struct coef_fw coef0225[] = {
5222 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5223 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5224 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5225 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5226 		UPDATE_COEF(0x63, 3<<14, 0),
5227 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5228 		{}
5229 	};
5230 	static const struct coef_fw coef0255[] = {
5231 		WRITE_COEF(0x45, 0xc089),
5232 		WRITE_COEF(0x45, 0xc489),
5233 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5234 		WRITE_COEF(0x49, 0x0049),
5235 		{}
5236 	};
5237 	static const struct coef_fw coef0256[] = {
5238 		WRITE_COEF(0x45, 0xc489),
5239 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5240 		WRITE_COEF(0x49, 0x0049),
5241 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5242 		WRITE_COEF(0x06, 0x6100),
5243 		{}
5244 	};
5245 	static const struct coef_fw coef0233[] = {
5246 		WRITE_COEF(0x06, 0x2100),
5247 		WRITE_COEF(0x32, 0x4ea3),
5248 		{}
5249 	};
5250 	static const struct coef_fw coef0288[] = {
5251 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5252 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5253 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5254 		UPDATE_COEF(0x66, 0x0008, 0),
5255 		UPDATE_COEF(0x67, 0x2000, 0),
5256 		{}
5257 	};
5258 	static const struct coef_fw coef0292[] = {
5259 		WRITE_COEF(0x76, 0x000e),
5260 		WRITE_COEF(0x6c, 0x2400),
5261 		WRITE_COEF(0x6b, 0xc429),
5262 		WRITE_COEF(0x18, 0x7308),
5263 		{}
5264 	};
5265 	static const struct coef_fw coef0293[] = {
5266 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5267 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5268 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5269 		{}
5270 	};
5271 	static const struct coef_fw coef0688[] = {
5272 		WRITE_COEF(0x11, 0x0041),
5273 		WRITE_COEF(0x15, 0x0d40),
5274 		WRITE_COEF(0xb7, 0x802b),
5275 		{}
5276 	};
5277 	static const struct coef_fw coef0274[] = {
5278 		WRITE_COEF(0x45, 0x4289),
5279 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5280 		UPDATE_COEF(0x6b, 0x0f00, 0),
5281 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5282 		{}
5283 	};
5284 
5285 	switch (codec->core.vendor_id) {
5286 	case 0x10ec0215:
5287 	case 0x10ec0225:
5288 	case 0x10ec0285:
5289 	case 0x10ec0295:
5290 	case 0x10ec0289:
5291 	case 0x10ec0299:
5292 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5293 		alc_process_coef_fw(codec, coef0225);
5294 		break;
5295 	case 0x10ec0255:
5296 		alc_process_coef_fw(codec, coef0255);
5297 		break;
5298 	case 0x10ec0230:
5299 	case 0x10ec0236:
5300 	case 0x10ec0256:
5301 	case 0x19e58326:
5302 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5303 		alc_write_coef_idx(codec, 0x45, 0xc089);
5304 		msleep(50);
5305 		alc_process_coef_fw(codec, coef0256);
5306 		break;
5307 	case 0x10ec0234:
5308 	case 0x10ec0274:
5309 	case 0x10ec0294:
5310 		alc_process_coef_fw(codec, coef0274);
5311 		break;
5312 	case 0x10ec0233:
5313 	case 0x10ec0283:
5314 		alc_process_coef_fw(codec, coef0233);
5315 		break;
5316 	case 0x10ec0286:
5317 	case 0x10ec0288:
5318 	case 0x10ec0298:
5319 		alc_process_coef_fw(codec, coef0288);
5320 		break;
5321 	case 0x10ec0292:
5322 		alc_process_coef_fw(codec, coef0292);
5323 		break;
5324 	case 0x10ec0293:
5325 		alc_process_coef_fw(codec, coef0293);
5326 		break;
5327 	case 0x10ec0668:
5328 		alc_process_coef_fw(codec, coef0688);
5329 		break;
5330 	case 0x10ec0867:
5331 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5332 		break;
5333 	}
5334 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5335 }
5336 
5337 /* Iphone type */
5338 static void alc_headset_mode_ctia(struct hda_codec *codec)
5339 {
5340 	int val;
5341 
5342 	static const struct coef_fw coef0255[] = {
5343 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5344 		WRITE_COEF(0x1b, 0x0c2b),
5345 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5346 		{}
5347 	};
5348 	static const struct coef_fw coef0256[] = {
5349 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5350 		WRITE_COEF(0x1b, 0x0e6b),
5351 		{}
5352 	};
5353 	static const struct coef_fw coef0233[] = {
5354 		WRITE_COEF(0x45, 0xd429),
5355 		WRITE_COEF(0x1b, 0x0c2b),
5356 		WRITE_COEF(0x32, 0x4ea3),
5357 		{}
5358 	};
5359 	static const struct coef_fw coef0288[] = {
5360 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5361 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5362 		UPDATE_COEF(0x66, 0x0008, 0),
5363 		UPDATE_COEF(0x67, 0x2000, 0),
5364 		{}
5365 	};
5366 	static const struct coef_fw coef0292[] = {
5367 		WRITE_COEF(0x6b, 0xd429),
5368 		WRITE_COEF(0x76, 0x0008),
5369 		WRITE_COEF(0x18, 0x7388),
5370 		{}
5371 	};
5372 	static const struct coef_fw coef0293[] = {
5373 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5374 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5375 		{}
5376 	};
5377 	static const struct coef_fw coef0688[] = {
5378 		WRITE_COEF(0x11, 0x0001),
5379 		WRITE_COEF(0x15, 0x0d60),
5380 		WRITE_COEF(0xc3, 0x0000),
5381 		{}
5382 	};
5383 	static const struct coef_fw coef0225_1[] = {
5384 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5385 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5386 		{}
5387 	};
5388 	static const struct coef_fw coef0225_2[] = {
5389 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5390 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5391 		{}
5392 	};
5393 
5394 	switch (codec->core.vendor_id) {
5395 	case 0x10ec0255:
5396 		alc_process_coef_fw(codec, coef0255);
5397 		break;
5398 	case 0x10ec0230:
5399 	case 0x10ec0236:
5400 	case 0x10ec0256:
5401 	case 0x19e58326:
5402 		alc_process_coef_fw(codec, coef0256);
5403 		break;
5404 	case 0x10ec0234:
5405 	case 0x10ec0274:
5406 	case 0x10ec0294:
5407 		alc_write_coef_idx(codec, 0x45, 0xd689);
5408 		break;
5409 	case 0x10ec0233:
5410 	case 0x10ec0283:
5411 		alc_process_coef_fw(codec, coef0233);
5412 		break;
5413 	case 0x10ec0298:
5414 		val = alc_read_coef_idx(codec, 0x50);
5415 		if (val & (1 << 12)) {
5416 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5417 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5418 			msleep(300);
5419 		} else {
5420 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5421 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5422 			msleep(300);
5423 		}
5424 		break;
5425 	case 0x10ec0286:
5426 	case 0x10ec0288:
5427 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5428 		msleep(300);
5429 		alc_process_coef_fw(codec, coef0288);
5430 		break;
5431 	case 0x10ec0292:
5432 		alc_process_coef_fw(codec, coef0292);
5433 		break;
5434 	case 0x10ec0293:
5435 		alc_process_coef_fw(codec, coef0293);
5436 		break;
5437 	case 0x10ec0668:
5438 		alc_process_coef_fw(codec, coef0688);
5439 		break;
5440 	case 0x10ec0215:
5441 	case 0x10ec0225:
5442 	case 0x10ec0285:
5443 	case 0x10ec0295:
5444 	case 0x10ec0289:
5445 	case 0x10ec0299:
5446 		val = alc_read_coef_idx(codec, 0x45);
5447 		if (val & (1 << 9))
5448 			alc_process_coef_fw(codec, coef0225_2);
5449 		else
5450 			alc_process_coef_fw(codec, coef0225_1);
5451 		break;
5452 	case 0x10ec0867:
5453 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5454 		break;
5455 	}
5456 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5457 }
5458 
5459 /* Nokia type */
5460 static void alc_headset_mode_omtp(struct hda_codec *codec)
5461 {
5462 	static const struct coef_fw coef0255[] = {
5463 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5464 		WRITE_COEF(0x1b, 0x0c2b),
5465 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5466 		{}
5467 	};
5468 	static const struct coef_fw coef0256[] = {
5469 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5470 		WRITE_COEF(0x1b, 0x0e6b),
5471 		{}
5472 	};
5473 	static const struct coef_fw coef0233[] = {
5474 		WRITE_COEF(0x45, 0xe429),
5475 		WRITE_COEF(0x1b, 0x0c2b),
5476 		WRITE_COEF(0x32, 0x4ea3),
5477 		{}
5478 	};
5479 	static const struct coef_fw coef0288[] = {
5480 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5481 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5482 		UPDATE_COEF(0x66, 0x0008, 0),
5483 		UPDATE_COEF(0x67, 0x2000, 0),
5484 		{}
5485 	};
5486 	static const struct coef_fw coef0292[] = {
5487 		WRITE_COEF(0x6b, 0xe429),
5488 		WRITE_COEF(0x76, 0x0008),
5489 		WRITE_COEF(0x18, 0x7388),
5490 		{}
5491 	};
5492 	static const struct coef_fw coef0293[] = {
5493 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5494 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5495 		{}
5496 	};
5497 	static const struct coef_fw coef0688[] = {
5498 		WRITE_COEF(0x11, 0x0001),
5499 		WRITE_COEF(0x15, 0x0d50),
5500 		WRITE_COEF(0xc3, 0x0000),
5501 		{}
5502 	};
5503 	static const struct coef_fw coef0225[] = {
5504 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5505 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5506 		{}
5507 	};
5508 
5509 	switch (codec->core.vendor_id) {
5510 	case 0x10ec0255:
5511 		alc_process_coef_fw(codec, coef0255);
5512 		break;
5513 	case 0x10ec0230:
5514 	case 0x10ec0236:
5515 	case 0x10ec0256:
5516 	case 0x19e58326:
5517 		alc_process_coef_fw(codec, coef0256);
5518 		break;
5519 	case 0x10ec0234:
5520 	case 0x10ec0274:
5521 	case 0x10ec0294:
5522 		alc_write_coef_idx(codec, 0x45, 0xe689);
5523 		break;
5524 	case 0x10ec0233:
5525 	case 0x10ec0283:
5526 		alc_process_coef_fw(codec, coef0233);
5527 		break;
5528 	case 0x10ec0298:
5529 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5530 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5531 		msleep(300);
5532 		break;
5533 	case 0x10ec0286:
5534 	case 0x10ec0288:
5535 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5536 		msleep(300);
5537 		alc_process_coef_fw(codec, coef0288);
5538 		break;
5539 	case 0x10ec0292:
5540 		alc_process_coef_fw(codec, coef0292);
5541 		break;
5542 	case 0x10ec0293:
5543 		alc_process_coef_fw(codec, coef0293);
5544 		break;
5545 	case 0x10ec0668:
5546 		alc_process_coef_fw(codec, coef0688);
5547 		break;
5548 	case 0x10ec0215:
5549 	case 0x10ec0225:
5550 	case 0x10ec0285:
5551 	case 0x10ec0295:
5552 	case 0x10ec0289:
5553 	case 0x10ec0299:
5554 		alc_process_coef_fw(codec, coef0225);
5555 		break;
5556 	}
5557 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5558 }
5559 
5560 static void alc_determine_headset_type(struct hda_codec *codec)
5561 {
5562 	int val;
5563 	bool is_ctia = false;
5564 	struct alc_spec *spec = codec->spec;
5565 	static const struct coef_fw coef0255[] = {
5566 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5567 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5568  conteol) */
5569 		{}
5570 	};
5571 	static const struct coef_fw coef0288[] = {
5572 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5573 		{}
5574 	};
5575 	static const struct coef_fw coef0298[] = {
5576 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5577 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5578 		UPDATE_COEF(0x66, 0x0008, 0),
5579 		UPDATE_COEF(0x67, 0x2000, 0),
5580 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5581 		{}
5582 	};
5583 	static const struct coef_fw coef0293[] = {
5584 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5585 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5586 		{}
5587 	};
5588 	static const struct coef_fw coef0688[] = {
5589 		WRITE_COEF(0x11, 0x0001),
5590 		WRITE_COEF(0xb7, 0x802b),
5591 		WRITE_COEF(0x15, 0x0d60),
5592 		WRITE_COEF(0xc3, 0x0c00),
5593 		{}
5594 	};
5595 	static const struct coef_fw coef0274[] = {
5596 		UPDATE_COEF(0x4a, 0x0010, 0),
5597 		UPDATE_COEF(0x4a, 0x8000, 0),
5598 		WRITE_COEF(0x45, 0xd289),
5599 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5600 		{}
5601 	};
5602 
5603 	if (spec->no_internal_mic_pin) {
5604 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5605 		return;
5606 	}
5607 
5608 	switch (codec->core.vendor_id) {
5609 	case 0x10ec0255:
5610 		alc_process_coef_fw(codec, coef0255);
5611 		msleep(300);
5612 		val = alc_read_coef_idx(codec, 0x46);
5613 		is_ctia = (val & 0x0070) == 0x0070;
5614 		break;
5615 	case 0x10ec0230:
5616 	case 0x10ec0236:
5617 	case 0x10ec0256:
5618 	case 0x19e58326:
5619 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5620 		alc_write_coef_idx(codec, 0x06, 0x6104);
5621 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5622 
5623 		snd_hda_codec_write(codec, 0x21, 0,
5624 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5625 		msleep(80);
5626 		snd_hda_codec_write(codec, 0x21, 0,
5627 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5628 
5629 		alc_process_coef_fw(codec, coef0255);
5630 		msleep(300);
5631 		val = alc_read_coef_idx(codec, 0x46);
5632 		is_ctia = (val & 0x0070) == 0x0070;
5633 
5634 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5635 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5636 
5637 		snd_hda_codec_write(codec, 0x21, 0,
5638 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5639 		msleep(80);
5640 		snd_hda_codec_write(codec, 0x21, 0,
5641 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5642 		break;
5643 	case 0x10ec0234:
5644 	case 0x10ec0274:
5645 	case 0x10ec0294:
5646 		alc_process_coef_fw(codec, coef0274);
5647 		msleep(850);
5648 		val = alc_read_coef_idx(codec, 0x46);
5649 		is_ctia = (val & 0x00f0) == 0x00f0;
5650 		break;
5651 	case 0x10ec0233:
5652 	case 0x10ec0283:
5653 		alc_write_coef_idx(codec, 0x45, 0xd029);
5654 		msleep(300);
5655 		val = alc_read_coef_idx(codec, 0x46);
5656 		is_ctia = (val & 0x0070) == 0x0070;
5657 		break;
5658 	case 0x10ec0298:
5659 		snd_hda_codec_write(codec, 0x21, 0,
5660 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5661 		msleep(100);
5662 		snd_hda_codec_write(codec, 0x21, 0,
5663 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5664 		msleep(200);
5665 
5666 		val = alc_read_coef_idx(codec, 0x50);
5667 		if (val & (1 << 12)) {
5668 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5669 			alc_process_coef_fw(codec, coef0288);
5670 			msleep(350);
5671 			val = alc_read_coef_idx(codec, 0x50);
5672 			is_ctia = (val & 0x0070) == 0x0070;
5673 		} else {
5674 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5675 			alc_process_coef_fw(codec, coef0288);
5676 			msleep(350);
5677 			val = alc_read_coef_idx(codec, 0x50);
5678 			is_ctia = (val & 0x0070) == 0x0070;
5679 		}
5680 		alc_process_coef_fw(codec, coef0298);
5681 		snd_hda_codec_write(codec, 0x21, 0,
5682 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5683 		msleep(75);
5684 		snd_hda_codec_write(codec, 0x21, 0,
5685 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5686 		break;
5687 	case 0x10ec0286:
5688 	case 0x10ec0288:
5689 		alc_process_coef_fw(codec, coef0288);
5690 		msleep(350);
5691 		val = alc_read_coef_idx(codec, 0x50);
5692 		is_ctia = (val & 0x0070) == 0x0070;
5693 		break;
5694 	case 0x10ec0292:
5695 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5696 		msleep(300);
5697 		val = alc_read_coef_idx(codec, 0x6c);
5698 		is_ctia = (val & 0x001c) == 0x001c;
5699 		break;
5700 	case 0x10ec0293:
5701 		alc_process_coef_fw(codec, coef0293);
5702 		msleep(300);
5703 		val = alc_read_coef_idx(codec, 0x46);
5704 		is_ctia = (val & 0x0070) == 0x0070;
5705 		break;
5706 	case 0x10ec0668:
5707 		alc_process_coef_fw(codec, coef0688);
5708 		msleep(300);
5709 		val = alc_read_coef_idx(codec, 0xbe);
5710 		is_ctia = (val & 0x1c02) == 0x1c02;
5711 		break;
5712 	case 0x10ec0215:
5713 	case 0x10ec0225:
5714 	case 0x10ec0285:
5715 	case 0x10ec0295:
5716 	case 0x10ec0289:
5717 	case 0x10ec0299:
5718 		snd_hda_codec_write(codec, 0x21, 0,
5719 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5720 		msleep(80);
5721 		snd_hda_codec_write(codec, 0x21, 0,
5722 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5723 
5724 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5725 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5726 		val = alc_read_coef_idx(codec, 0x45);
5727 		if (val & (1 << 9)) {
5728 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5729 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5730 			msleep(800);
5731 			val = alc_read_coef_idx(codec, 0x46);
5732 			is_ctia = (val & 0x00f0) == 0x00f0;
5733 		} else {
5734 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5735 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5736 			msleep(800);
5737 			val = alc_read_coef_idx(codec, 0x46);
5738 			is_ctia = (val & 0x00f0) == 0x00f0;
5739 		}
5740 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5741 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5742 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5743 
5744 		snd_hda_codec_write(codec, 0x21, 0,
5745 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5746 		msleep(80);
5747 		snd_hda_codec_write(codec, 0x21, 0,
5748 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5749 		break;
5750 	case 0x10ec0867:
5751 		is_ctia = true;
5752 		break;
5753 	}
5754 
5755 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5756 		    is_ctia ? "yes" : "no");
5757 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5758 }
5759 
5760 static void alc_update_headset_mode(struct hda_codec *codec)
5761 {
5762 	struct alc_spec *spec = codec->spec;
5763 
5764 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5765 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5766 
5767 	int new_headset_mode;
5768 
5769 	if (!snd_hda_jack_detect(codec, hp_pin))
5770 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5771 	else if (mux_pin == spec->headset_mic_pin)
5772 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5773 	else if (mux_pin == spec->headphone_mic_pin)
5774 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5775 	else
5776 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5777 
5778 	if (new_headset_mode == spec->current_headset_mode) {
5779 		snd_hda_gen_update_outputs(codec);
5780 		return;
5781 	}
5782 
5783 	switch (new_headset_mode) {
5784 	case ALC_HEADSET_MODE_UNPLUGGED:
5785 		alc_headset_mode_unplugged(codec);
5786 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5787 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5788 		spec->gen.hp_jack_present = false;
5789 		break;
5790 	case ALC_HEADSET_MODE_HEADSET:
5791 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5792 			alc_determine_headset_type(codec);
5793 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5794 			alc_headset_mode_ctia(codec);
5795 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5796 			alc_headset_mode_omtp(codec);
5797 		spec->gen.hp_jack_present = true;
5798 		break;
5799 	case ALC_HEADSET_MODE_MIC:
5800 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5801 		spec->gen.hp_jack_present = false;
5802 		break;
5803 	case ALC_HEADSET_MODE_HEADPHONE:
5804 		alc_headset_mode_default(codec);
5805 		spec->gen.hp_jack_present = true;
5806 		break;
5807 	}
5808 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5809 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5810 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5811 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5812 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5813 						  PIN_VREFHIZ);
5814 	}
5815 	spec->current_headset_mode = new_headset_mode;
5816 
5817 	snd_hda_gen_update_outputs(codec);
5818 }
5819 
5820 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5821 					 struct snd_kcontrol *kcontrol,
5822 					 struct snd_ctl_elem_value *ucontrol)
5823 {
5824 	alc_update_headset_mode(codec);
5825 }
5826 
5827 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5828 				       struct hda_jack_callback *jack)
5829 {
5830 	snd_hda_gen_hp_automute(codec, jack);
5831 	alc_update_headset_mode(codec);
5832 }
5833 
5834 static void alc_probe_headset_mode(struct hda_codec *codec)
5835 {
5836 	int i;
5837 	struct alc_spec *spec = codec->spec;
5838 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5839 
5840 	/* Find mic pins */
5841 	for (i = 0; i < cfg->num_inputs; i++) {
5842 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5843 			spec->headset_mic_pin = cfg->inputs[i].pin;
5844 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5845 			spec->headphone_mic_pin = cfg->inputs[i].pin;
5846 	}
5847 
5848 	WARN_ON(spec->gen.cap_sync_hook);
5849 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5850 	spec->gen.automute_hook = alc_update_headset_mode;
5851 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5852 }
5853 
5854 static void alc_fixup_headset_mode(struct hda_codec *codec,
5855 				const struct hda_fixup *fix, int action)
5856 {
5857 	struct alc_spec *spec = codec->spec;
5858 
5859 	switch (action) {
5860 	case HDA_FIXUP_ACT_PRE_PROBE:
5861 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5862 		break;
5863 	case HDA_FIXUP_ACT_PROBE:
5864 		alc_probe_headset_mode(codec);
5865 		break;
5866 	case HDA_FIXUP_ACT_INIT:
5867 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
5868 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5869 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5870 		}
5871 		alc_update_headset_mode(codec);
5872 		break;
5873 	}
5874 }
5875 
5876 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5877 				const struct hda_fixup *fix, int action)
5878 {
5879 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5880 		struct alc_spec *spec = codec->spec;
5881 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5882 	}
5883 	else
5884 		alc_fixup_headset_mode(codec, fix, action);
5885 }
5886 
5887 static void alc255_set_default_jack_type(struct hda_codec *codec)
5888 {
5889 	/* Set to iphone type */
5890 	static const struct coef_fw alc255fw[] = {
5891 		WRITE_COEF(0x1b, 0x880b),
5892 		WRITE_COEF(0x45, 0xd089),
5893 		WRITE_COEF(0x1b, 0x080b),
5894 		WRITE_COEF(0x46, 0x0004),
5895 		WRITE_COEF(0x1b, 0x0c0b),
5896 		{}
5897 	};
5898 	static const struct coef_fw alc256fw[] = {
5899 		WRITE_COEF(0x1b, 0x884b),
5900 		WRITE_COEF(0x45, 0xd089),
5901 		WRITE_COEF(0x1b, 0x084b),
5902 		WRITE_COEF(0x46, 0x0004),
5903 		WRITE_COEF(0x1b, 0x0c4b),
5904 		{}
5905 	};
5906 	switch (codec->core.vendor_id) {
5907 	case 0x10ec0255:
5908 		alc_process_coef_fw(codec, alc255fw);
5909 		break;
5910 	case 0x10ec0230:
5911 	case 0x10ec0236:
5912 	case 0x10ec0256:
5913 	case 0x19e58326:
5914 		alc_process_coef_fw(codec, alc256fw);
5915 		break;
5916 	}
5917 	msleep(30);
5918 }
5919 
5920 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5921 				const struct hda_fixup *fix, int action)
5922 {
5923 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5924 		alc255_set_default_jack_type(codec);
5925 	}
5926 	alc_fixup_headset_mode(codec, fix, action);
5927 }
5928 
5929 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5930 				const struct hda_fixup *fix, int action)
5931 {
5932 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5933 		struct alc_spec *spec = codec->spec;
5934 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5935 		alc255_set_default_jack_type(codec);
5936 	}
5937 	else
5938 		alc_fixup_headset_mode(codec, fix, action);
5939 }
5940 
5941 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5942 				       struct hda_jack_callback *jack)
5943 {
5944 	struct alc_spec *spec = codec->spec;
5945 
5946 	alc_update_headset_jack_cb(codec, jack);
5947 	/* Headset Mic enable or disable, only for Dell Dino */
5948 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5949 }
5950 
5951 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5952 				const struct hda_fixup *fix, int action)
5953 {
5954 	alc_fixup_headset_mode(codec, fix, action);
5955 	if (action == HDA_FIXUP_ACT_PROBE) {
5956 		struct alc_spec *spec = codec->spec;
5957 		/* toggled via hp_automute_hook */
5958 		spec->gpio_mask |= 0x40;
5959 		spec->gpio_dir |= 0x40;
5960 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5961 	}
5962 }
5963 
5964 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5965 					const struct hda_fixup *fix, int action)
5966 {
5967 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5968 		struct alc_spec *spec = codec->spec;
5969 		spec->gen.auto_mute_via_amp = 1;
5970 	}
5971 }
5972 
5973 static void alc_fixup_no_shutup(struct hda_codec *codec,
5974 				const struct hda_fixup *fix, int action)
5975 {
5976 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5977 		struct alc_spec *spec = codec->spec;
5978 		spec->no_shutup_pins = 1;
5979 	}
5980 }
5981 
5982 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5983 				    const struct hda_fixup *fix, int action)
5984 {
5985 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5986 		struct alc_spec *spec = codec->spec;
5987 		/* Disable AA-loopback as it causes white noise */
5988 		spec->gen.mixer_nid = 0;
5989 	}
5990 }
5991 
5992 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5993 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5994 				  const struct hda_fixup *fix, int action)
5995 {
5996 	static const struct hda_pintbl pincfgs[] = {
5997 		{ 0x16, 0x21211010 }, /* dock headphone */
5998 		{ 0x19, 0x21a11010 }, /* dock mic */
5999 		{ }
6000 	};
6001 	struct alc_spec *spec = codec->spec;
6002 
6003 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6004 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6005 		codec->power_save_node = 0; /* avoid click noises */
6006 		snd_hda_apply_pincfgs(codec, pincfgs);
6007 	}
6008 }
6009 
6010 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6011 				  const struct hda_fixup *fix, int action)
6012 {
6013 	static const struct hda_pintbl pincfgs[] = {
6014 		{ 0x17, 0x21211010 }, /* dock headphone */
6015 		{ 0x19, 0x21a11010 }, /* dock mic */
6016 		{ }
6017 	};
6018 	struct alc_spec *spec = codec->spec;
6019 
6020 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6021 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6022 		snd_hda_apply_pincfgs(codec, pincfgs);
6023 	} else if (action == HDA_FIXUP_ACT_INIT) {
6024 		/* Enable DOCK device */
6025 		snd_hda_codec_write(codec, 0x17, 0,
6026 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6027 		/* Enable DOCK device */
6028 		snd_hda_codec_write(codec, 0x19, 0,
6029 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6030 	}
6031 }
6032 
6033 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6034 				  const struct hda_fixup *fix, int action)
6035 {
6036 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6037 	 * the speaker output becomes too low by some reason on Thinkpads with
6038 	 * ALC298 codec
6039 	 */
6040 	static const hda_nid_t preferred_pairs[] = {
6041 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6042 		0
6043 	};
6044 	struct alc_spec *spec = codec->spec;
6045 
6046 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6047 		spec->gen.preferred_dacs = preferred_pairs;
6048 }
6049 
6050 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6051 				   const struct hda_fixup *fix, int action)
6052 {
6053 	static const hda_nid_t preferred_pairs[] = {
6054 		0x17, 0x02, 0x21, 0x03, 0
6055 	};
6056 	struct alc_spec *spec = codec->spec;
6057 
6058 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6059 		spec->gen.preferred_dacs = preferred_pairs;
6060 }
6061 
6062 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6063 {
6064 	struct alc_spec *spec = codec->spec;
6065 	int hp_pin = alc_get_hp_pin(spec);
6066 
6067 	/* Prevent pop noises when headphones are plugged in */
6068 	snd_hda_codec_write(codec, hp_pin, 0,
6069 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6070 	msleep(20);
6071 }
6072 
6073 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6074 				const struct hda_fixup *fix, int action)
6075 {
6076 	struct alc_spec *spec = codec->spec;
6077 	struct hda_input_mux *imux = &spec->gen.input_mux;
6078 	int i;
6079 
6080 	switch (action) {
6081 	case HDA_FIXUP_ACT_PRE_PROBE:
6082 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6083 		 * it causes a click noise at start up
6084 		 */
6085 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6086 		spec->shutup = alc_shutup_dell_xps13;
6087 		break;
6088 	case HDA_FIXUP_ACT_PROBE:
6089 		/* Make the internal mic the default input source. */
6090 		for (i = 0; i < imux->num_items; i++) {
6091 			if (spec->gen.imux_pins[i] == 0x12) {
6092 				spec->gen.cur_mux[0] = i;
6093 				break;
6094 			}
6095 		}
6096 		break;
6097 	}
6098 }
6099 
6100 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6101 				const struct hda_fixup *fix, int action)
6102 {
6103 	struct alc_spec *spec = codec->spec;
6104 
6105 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6106 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6107 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6108 
6109 		/* Disable boost for mic-in permanently. (This code is only called
6110 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6111 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6112 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6113 	} else
6114 		alc_fixup_headset_mode(codec, fix, action);
6115 }
6116 
6117 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6118 				const struct hda_fixup *fix, int action)
6119 {
6120 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6121 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6122 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6123 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6124 	}
6125 	alc_fixup_headset_mode(codec, fix, action);
6126 }
6127 
6128 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6129 static int find_ext_mic_pin(struct hda_codec *codec)
6130 {
6131 	struct alc_spec *spec = codec->spec;
6132 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6133 	hda_nid_t nid;
6134 	unsigned int defcfg;
6135 	int i;
6136 
6137 	for (i = 0; i < cfg->num_inputs; i++) {
6138 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6139 			continue;
6140 		nid = cfg->inputs[i].pin;
6141 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6142 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6143 			continue;
6144 		return nid;
6145 	}
6146 
6147 	return 0;
6148 }
6149 
6150 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6151 				    const struct hda_fixup *fix,
6152 				    int action)
6153 {
6154 	struct alc_spec *spec = codec->spec;
6155 
6156 	if (action == HDA_FIXUP_ACT_PROBE) {
6157 		int mic_pin = find_ext_mic_pin(codec);
6158 		int hp_pin = alc_get_hp_pin(spec);
6159 
6160 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6161 			return;
6162 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6163 	}
6164 }
6165 
6166 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6167 					     const struct hda_fixup *fix,
6168 					     int action)
6169 {
6170 	struct alc_spec *spec = codec->spec;
6171 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6172 	int i;
6173 
6174 	/* The mic boosts on level 2 and 3 are too noisy
6175 	   on the internal mic input.
6176 	   Therefore limit the boost to 0 or 1. */
6177 
6178 	if (action != HDA_FIXUP_ACT_PROBE)
6179 		return;
6180 
6181 	for (i = 0; i < cfg->num_inputs; i++) {
6182 		hda_nid_t nid = cfg->inputs[i].pin;
6183 		unsigned int defcfg;
6184 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6185 			continue;
6186 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6187 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6188 			continue;
6189 
6190 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6191 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6192 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6193 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6194 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6195 	}
6196 }
6197 
6198 static void alc283_hp_automute_hook(struct hda_codec *codec,
6199 				    struct hda_jack_callback *jack)
6200 {
6201 	struct alc_spec *spec = codec->spec;
6202 	int vref;
6203 
6204 	msleep(200);
6205 	snd_hda_gen_hp_automute(codec, jack);
6206 
6207 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6208 
6209 	msleep(600);
6210 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6211 			    vref);
6212 }
6213 
6214 static void alc283_fixup_chromebook(struct hda_codec *codec,
6215 				    const struct hda_fixup *fix, int action)
6216 {
6217 	struct alc_spec *spec = codec->spec;
6218 
6219 	switch (action) {
6220 	case HDA_FIXUP_ACT_PRE_PROBE:
6221 		snd_hda_override_wcaps(codec, 0x03, 0);
6222 		/* Disable AA-loopback as it causes white noise */
6223 		spec->gen.mixer_nid = 0;
6224 		break;
6225 	case HDA_FIXUP_ACT_INIT:
6226 		/* MIC2-VREF control */
6227 		/* Set to manual mode */
6228 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6229 		/* Enable Line1 input control by verb */
6230 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6231 		break;
6232 	}
6233 }
6234 
6235 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6236 				    const struct hda_fixup *fix, int action)
6237 {
6238 	struct alc_spec *spec = codec->spec;
6239 
6240 	switch (action) {
6241 	case HDA_FIXUP_ACT_PRE_PROBE:
6242 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6243 		break;
6244 	case HDA_FIXUP_ACT_INIT:
6245 		/* MIC2-VREF control */
6246 		/* Set to manual mode */
6247 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6248 		break;
6249 	}
6250 }
6251 
6252 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6253 static void asus_tx300_automute(struct hda_codec *codec)
6254 {
6255 	struct alc_spec *spec = codec->spec;
6256 	snd_hda_gen_update_outputs(codec);
6257 	if (snd_hda_jack_detect(codec, 0x1b))
6258 		spec->gen.mute_bits |= (1ULL << 0x14);
6259 }
6260 
6261 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6262 				    const struct hda_fixup *fix, int action)
6263 {
6264 	struct alc_spec *spec = codec->spec;
6265 	static const struct hda_pintbl dock_pins[] = {
6266 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6267 		{}
6268 	};
6269 
6270 	switch (action) {
6271 	case HDA_FIXUP_ACT_PRE_PROBE:
6272 		spec->init_amp = ALC_INIT_DEFAULT;
6273 		/* TX300 needs to set up GPIO2 for the speaker amp */
6274 		alc_setup_gpio(codec, 0x04);
6275 		snd_hda_apply_pincfgs(codec, dock_pins);
6276 		spec->gen.auto_mute_via_amp = 1;
6277 		spec->gen.automute_hook = asus_tx300_automute;
6278 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6279 						    snd_hda_gen_hp_automute);
6280 		break;
6281 	case HDA_FIXUP_ACT_PROBE:
6282 		spec->init_amp = ALC_INIT_DEFAULT;
6283 		break;
6284 	case HDA_FIXUP_ACT_BUILD:
6285 		/* this is a bit tricky; give more sane names for the main
6286 		 * (tablet) speaker and the dock speaker, respectively
6287 		 */
6288 		rename_ctl(codec, "Speaker Playback Switch",
6289 			   "Dock Speaker Playback Switch");
6290 		rename_ctl(codec, "Bass Speaker Playback Switch",
6291 			   "Speaker Playback Switch");
6292 		break;
6293 	}
6294 }
6295 
6296 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6297 				       const struct hda_fixup *fix, int action)
6298 {
6299 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6300 		/* DAC node 0x03 is giving mono output. We therefore want to
6301 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6302 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6303 		static const hda_nid_t conn1[] = { 0x0c };
6304 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6305 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6306 	}
6307 }
6308 
6309 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6310 					const struct hda_fixup *fix, int action)
6311 {
6312 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6313 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6314 		   we can't adjust the speaker's volume since this node does not has
6315 		   Amp-out capability. we change the speaker's route to:
6316 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6317 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6318 		   speaker's volume now. */
6319 
6320 		static const hda_nid_t conn1[] = { 0x0c };
6321 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6322 	}
6323 }
6324 
6325 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6326 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6327 				      const struct hda_fixup *fix, int action)
6328 {
6329 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6330 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6331 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6332 	}
6333 }
6334 
6335 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6336 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6337 					  const struct hda_fixup *fix, int action)
6338 {
6339 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6340 		static const hda_nid_t conn[] = { 0x02 };
6341 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6342 	}
6343 }
6344 
6345 /* Hook to update amp GPIO4 for automute */
6346 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6347 					  struct hda_jack_callback *jack)
6348 {
6349 	struct alc_spec *spec = codec->spec;
6350 
6351 	snd_hda_gen_hp_automute(codec, jack);
6352 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6353 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6354 			    !spec->gen.hp_jack_present);
6355 }
6356 
6357 /* Manage GPIOs for HP EliteBook Folio 9480m.
6358  *
6359  * GPIO4 is the headphone amplifier power control
6360  * GPIO3 is the audio output mute indicator LED
6361  */
6362 
6363 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6364 				  const struct hda_fixup *fix,
6365 				  int action)
6366 {
6367 	struct alc_spec *spec = codec->spec;
6368 
6369 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6370 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6371 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6372 		spec->gpio_mask |= 0x10;
6373 		spec->gpio_dir |= 0x10;
6374 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6375 	}
6376 }
6377 
6378 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6379 				   const struct hda_fixup *fix,
6380 				   int action)
6381 {
6382 	struct alc_spec *spec = codec->spec;
6383 
6384 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6385 		spec->gpio_mask |= 0x04;
6386 		spec->gpio_dir |= 0x04;
6387 		/* set data bit low */
6388 	}
6389 }
6390 
6391 /* Quirk for Thinkpad X1 7th and 8th Gen
6392  * The following fixed routing needed
6393  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6394  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6395  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6396  */
6397 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6398 					  const struct hda_fixup *fix, int action)
6399 {
6400 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6401 	static const hda_nid_t preferred_pairs[] = {
6402 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6403 	};
6404 	struct alc_spec *spec = codec->spec;
6405 
6406 	switch (action) {
6407 	case HDA_FIXUP_ACT_PRE_PROBE:
6408 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6409 		spec->gen.preferred_dacs = preferred_pairs;
6410 		break;
6411 	case HDA_FIXUP_ACT_BUILD:
6412 		/* The generic parser creates somewhat unintuitive volume ctls
6413 		 * with the fixed routing above, and the shared DAC2 may be
6414 		 * confusing for PA.
6415 		 * Rename those to unique names so that PA doesn't touch them
6416 		 * and use only Master volume.
6417 		 */
6418 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6419 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6420 		break;
6421 	}
6422 }
6423 
6424 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6425 					 const struct hda_fixup *fix,
6426 					 int action)
6427 {
6428 	alc_fixup_dual_codecs(codec, fix, action);
6429 	switch (action) {
6430 	case HDA_FIXUP_ACT_PRE_PROBE:
6431 		/* override card longname to provide a unique UCM profile */
6432 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6433 		break;
6434 	case HDA_FIXUP_ACT_BUILD:
6435 		/* rename Capture controls depending on the codec */
6436 		rename_ctl(codec, "Capture Volume",
6437 			   codec->addr == 0 ?
6438 			   "Rear-Panel Capture Volume" :
6439 			   "Front-Panel Capture Volume");
6440 		rename_ctl(codec, "Capture Switch",
6441 			   codec->addr == 0 ?
6442 			   "Rear-Panel Capture Switch" :
6443 			   "Front-Panel Capture Switch");
6444 		break;
6445 	}
6446 }
6447 
6448 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6449 				      const struct hda_fixup *fix, int action)
6450 {
6451 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6452 		return;
6453 
6454 	codec->power_save_node = 1;
6455 }
6456 
6457 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6458 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6459 				    const struct hda_fixup *fix, int action)
6460 {
6461 	struct alc_spec *spec = codec->spec;
6462 	static const hda_nid_t preferred_pairs[] = {
6463 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6464 		0
6465 	};
6466 
6467 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6468 		return;
6469 
6470 	spec->gen.preferred_dacs = preferred_pairs;
6471 	spec->gen.auto_mute_via_amp = 1;
6472 	codec->power_save_node = 0;
6473 }
6474 
6475 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6476 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6477 				    const struct hda_fixup *fix, int action)
6478 {
6479 	static const hda_nid_t preferred_pairs[] = {
6480 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6481 	};
6482 	struct alc_spec *spec = codec->spec;
6483 
6484 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6485 		spec->gen.preferred_dacs = preferred_pairs;
6486 		spec->gen.obey_preferred_dacs = 1;
6487 	}
6488 }
6489 
6490 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6491 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6492 			      const struct hda_fixup *fix, int action)
6493 {
6494 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6495 		return;
6496 
6497 	snd_hda_override_wcaps(codec, 0x03, 0);
6498 }
6499 
6500 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6501 {
6502 	switch (codec->core.vendor_id) {
6503 	case 0x10ec0274:
6504 	case 0x10ec0294:
6505 	case 0x10ec0225:
6506 	case 0x10ec0295:
6507 	case 0x10ec0299:
6508 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6509 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6510 		break;
6511 	case 0x10ec0230:
6512 	case 0x10ec0235:
6513 	case 0x10ec0236:
6514 	case 0x10ec0255:
6515 	case 0x10ec0256:
6516 	case 0x10ec0257:
6517 	case 0x19e58326:
6518 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6519 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6520 		break;
6521 	}
6522 }
6523 
6524 static void alc295_fixup_chromebook(struct hda_codec *codec,
6525 				    const struct hda_fixup *fix, int action)
6526 {
6527 	struct alc_spec *spec = codec->spec;
6528 
6529 	switch (action) {
6530 	case HDA_FIXUP_ACT_PRE_PROBE:
6531 		spec->ultra_low_power = true;
6532 		break;
6533 	case HDA_FIXUP_ACT_INIT:
6534 		alc_combo_jack_hp_jd_restart(codec);
6535 		break;
6536 	}
6537 }
6538 
6539 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6540 				  const struct hda_fixup *fix, int action)
6541 {
6542 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6543 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6544 }
6545 
6546 
6547 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6548 					struct hda_jack_callback *cb)
6549 {
6550 	/* The Windows driver sets the codec up in a very different way where
6551 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6552 	 */
6553 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6554 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6555 	else
6556 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6557 }
6558 
6559 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6560 					const struct hda_fixup *fix, int action)
6561 {
6562 	/* Pin 0x21: headphones/headset mic */
6563 	if (!is_jack_detectable(codec, 0x21))
6564 		return;
6565 
6566 	switch (action) {
6567 	case HDA_FIXUP_ACT_PRE_PROBE:
6568 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6569 				alc294_gx502_toggle_output);
6570 		break;
6571 	case HDA_FIXUP_ACT_INIT:
6572 		/* Make sure to start in a correct state, i.e. if
6573 		 * headphones have been plugged in before powering up the system
6574 		 */
6575 		alc294_gx502_toggle_output(codec, NULL);
6576 		break;
6577 	}
6578 }
6579 
6580 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6581 				       struct hda_jack_callback *cb)
6582 {
6583 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6584 	 * responsible from changes between speakers and headphones
6585 	 */
6586 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6587 		alc_write_coef_idx(codec, 0x10, 0x8420);
6588 	else
6589 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6590 }
6591 
6592 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6593 				  const struct hda_fixup *fix, int action)
6594 {
6595 	if (!is_jack_detectable(codec, 0x21))
6596 		return;
6597 
6598 	switch (action) {
6599 	case HDA_FIXUP_ACT_PRE_PROBE:
6600 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6601 				alc294_gu502_toggle_output);
6602 		break;
6603 	case HDA_FIXUP_ACT_INIT:
6604 		alc294_gu502_toggle_output(codec, NULL);
6605 		break;
6606 	}
6607 }
6608 
6609 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6610 			      const struct hda_fixup *fix, int action)
6611 {
6612 	if (action != HDA_FIXUP_ACT_INIT)
6613 		return;
6614 
6615 	msleep(100);
6616 	alc_write_coef_idx(codec, 0x65, 0x0);
6617 }
6618 
6619 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6620 				    const struct hda_fixup *fix, int action)
6621 {
6622 	switch (action) {
6623 	case HDA_FIXUP_ACT_INIT:
6624 		alc_combo_jack_hp_jd_restart(codec);
6625 		break;
6626 	}
6627 }
6628 
6629 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6630 				    const struct hda_fixup *fix, int action)
6631 {
6632 	struct alc_spec *spec = codec->spec;
6633 
6634 	switch (action) {
6635 	case HDA_FIXUP_ACT_PRE_PROBE:
6636 		/* Mic RING SLEEVE swap for combo jack */
6637 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6638 		spec->no_internal_mic_pin = true;
6639 		break;
6640 	case HDA_FIXUP_ACT_INIT:
6641 		alc_combo_jack_hp_jd_restart(codec);
6642 		break;
6643 	}
6644 }
6645 
6646 /* GPIO1 = amplifier on/off
6647  * GPIO3 = mic mute LED
6648  */
6649 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6650 					  const struct hda_fixup *fix, int action)
6651 {
6652 	static const hda_nid_t conn[] = { 0x02 };
6653 
6654 	struct alc_spec *spec = codec->spec;
6655 	static const struct hda_pintbl pincfgs[] = {
6656 		{ 0x14, 0x90170110 },  /* front/high speakers */
6657 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6658 		{ }
6659 	};
6660 
6661 	//enable micmute led
6662 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6663 
6664 	switch (action) {
6665 	case HDA_FIXUP_ACT_PRE_PROBE:
6666 		spec->micmute_led_polarity = 1;
6667 		/* needed for amp of back speakers */
6668 		spec->gpio_mask |= 0x01;
6669 		spec->gpio_dir |= 0x01;
6670 		snd_hda_apply_pincfgs(codec, pincfgs);
6671 		/* share DAC to have unified volume control */
6672 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6673 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6674 		break;
6675 	case HDA_FIXUP_ACT_INIT:
6676 		/* need to toggle GPIO to enable the amp of back speakers */
6677 		alc_update_gpio_data(codec, 0x01, true);
6678 		msleep(100);
6679 		alc_update_gpio_data(codec, 0x01, false);
6680 		break;
6681 	}
6682 }
6683 
6684 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6685 					  const struct hda_fixup *fix, int action)
6686 {
6687 	static const hda_nid_t conn[] = { 0x02 };
6688 	static const struct hda_pintbl pincfgs[] = {
6689 		{ 0x14, 0x90170110 },  /* rear speaker */
6690 		{ }
6691 	};
6692 
6693 	switch (action) {
6694 	case HDA_FIXUP_ACT_PRE_PROBE:
6695 		snd_hda_apply_pincfgs(codec, pincfgs);
6696 		/* force front speaker to DAC1 */
6697 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6698 		break;
6699 	}
6700 }
6701 
6702 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6703 				      const struct hda_fixup *fix,
6704 				      int action)
6705 {
6706 	static const struct coef_fw coefs[] = {
6707 		WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6708 		WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6709 		WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6710 		WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6711 		WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6712 		WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6713 		WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6714 		WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6715 		WRITE_COEF(0x6e, 0x1005), { }
6716 	};
6717 
6718 	static const struct hda_pintbl pincfgs[] = {
6719 		{ 0x12, 0xb7a60130 },  /* Internal microphone*/
6720 		{ 0x14, 0x90170150 },  /* B&O soundbar speakers */
6721 		{ 0x17, 0x90170153 },  /* Side speakers */
6722 		{ 0x19, 0x03a11040 },  /* Headset microphone */
6723 		{ }
6724 	};
6725 
6726 	switch (action) {
6727 	case HDA_FIXUP_ACT_PRE_PROBE:
6728 		snd_hda_apply_pincfgs(codec, pincfgs);
6729 
6730 		/* Fixes volume control problem for side speakers */
6731 		alc295_fixup_disable_dac3(codec, fix, action);
6732 
6733 		/* Fixes no sound from headset speaker */
6734 		snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6735 
6736 		/* Auto-enable headset mic when plugged */
6737 		snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6738 
6739 		/* Headset mic volume enhancement */
6740 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6741 		break;
6742 	case HDA_FIXUP_ACT_INIT:
6743 		alc_process_coef_fw(codec, coefs);
6744 		break;
6745 	case HDA_FIXUP_ACT_BUILD:
6746 		rename_ctl(codec, "Bass Speaker Playback Volume",
6747 			   "B&O-Tuned Playback Volume");
6748 		rename_ctl(codec, "Front Playback Switch",
6749 			   "B&O Soundbar Playback Switch");
6750 		rename_ctl(codec, "Bass Speaker Playback Switch",
6751 			   "Side Speaker Playback Switch");
6752 		break;
6753 	}
6754 }
6755 
6756 /* for hda_fixup_thinkpad_acpi() */
6757 #include "thinkpad_helper.c"
6758 
6759 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6760 				    const struct hda_fixup *fix, int action)
6761 {
6762 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6763 	hda_fixup_thinkpad_acpi(codec, fix, action);
6764 }
6765 
6766 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6767 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6768 						  const struct hda_fixup *fix,
6769 						  int action)
6770 {
6771 	struct alc_spec *spec = codec->spec;
6772 
6773 	switch (action) {
6774 	case HDA_FIXUP_ACT_PRE_PROBE:
6775 		spec->gen.suppress_auto_mute = 1;
6776 		break;
6777 	}
6778 }
6779 
6780 static int comp_bind(struct device *dev)
6781 {
6782 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6783 	struct alc_spec *spec = cdc->spec;
6784 
6785 	return component_bind_all(dev, spec->comps);
6786 }
6787 
6788 static void comp_unbind(struct device *dev)
6789 {
6790 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6791 	struct alc_spec *spec = cdc->spec;
6792 
6793 	component_unbind_all(dev, spec->comps);
6794 }
6795 
6796 static const struct component_master_ops comp_master_ops = {
6797 	.bind = comp_bind,
6798 	.unbind = comp_unbind,
6799 };
6800 
6801 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6802 				       struct snd_pcm_substream *sub, int action)
6803 {
6804 	struct alc_spec *spec = cdc->spec;
6805 	int i;
6806 
6807 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6808 		if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
6809 			spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
6810 	}
6811 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6812 		if (spec->comps[i].dev && spec->comps[i].playback_hook)
6813 			spec->comps[i].playback_hook(spec->comps[i].dev, action);
6814 	}
6815 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6816 		if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
6817 			spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
6818 	}
6819 }
6820 
6821 struct scodec_dev_name {
6822 	const char *bus;
6823 	const char *hid;
6824 	int index;
6825 };
6826 
6827 /* match the device name in a slightly relaxed manner */
6828 static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6829 {
6830 	struct scodec_dev_name *p = data;
6831 	const char *d = dev_name(dev);
6832 	int n = strlen(p->bus);
6833 	char tmp[32];
6834 
6835 	/* check the bus name */
6836 	if (strncmp(d, p->bus, n))
6837 		return 0;
6838 	/* skip the bus number */
6839 	if (isdigit(d[n]))
6840 		n++;
6841 	/* the rest must be exact matching */
6842 	snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6843 	return !strcmp(d + n, tmp);
6844 }
6845 
6846 static int comp_match_tas2781_dev_name(struct device *dev,
6847 	void *data)
6848 {
6849 	struct scodec_dev_name *p = data;
6850 	const char *d = dev_name(dev);
6851 	int n = strlen(p->bus);
6852 	char tmp[32];
6853 
6854 	/* check the bus name */
6855 	if (strncmp(d, p->bus, n))
6856 		return 0;
6857 	/* skip the bus number */
6858 	if (isdigit(d[n]))
6859 		n++;
6860 	/* the rest must be exact matching */
6861 	snprintf(tmp, sizeof(tmp), "-%s:00", p->hid);
6862 
6863 	return !strcmp(d + n, tmp);
6864 }
6865 
6866 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6867 				  const char *hid, int count)
6868 {
6869 	struct device *dev = hda_codec_dev(cdc);
6870 	struct alc_spec *spec = cdc->spec;
6871 	struct scodec_dev_name *rec;
6872 	int ret, i;
6873 
6874 	switch (action) {
6875 	case HDA_FIXUP_ACT_PRE_PROBE:
6876 		for (i = 0; i < count; i++) {
6877 			rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6878 			if (!rec)
6879 				return;
6880 			rec->bus = bus;
6881 			rec->hid = hid;
6882 			rec->index = i;
6883 			spec->comps[i].codec = cdc;
6884 			component_match_add(dev, &spec->match,
6885 					    comp_match_cs35l41_dev_name, rec);
6886 		}
6887 		ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6888 		if (ret)
6889 			codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6890 		else
6891 			spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6892 		break;
6893 	case HDA_FIXUP_ACT_FREE:
6894 		component_master_del(dev, &comp_master_ops);
6895 		break;
6896 	}
6897 }
6898 
6899 static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
6900 	const char *bus, const char *hid)
6901 {
6902 	struct device *dev = hda_codec_dev(cdc);
6903 	struct alc_spec *spec = cdc->spec;
6904 	struct scodec_dev_name *rec;
6905 	int ret;
6906 
6907 	switch (action) {
6908 	case HDA_FIXUP_ACT_PRE_PROBE:
6909 		rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6910 		if (!rec)
6911 			return;
6912 		rec->bus = bus;
6913 		rec->hid = hid;
6914 		rec->index = 0;
6915 		spec->comps[0].codec = cdc;
6916 		component_match_add(dev, &spec->match,
6917 			comp_match_tas2781_dev_name, rec);
6918 		ret = component_master_add_with_match(dev, &comp_master_ops,
6919 			spec->match);
6920 		if (ret)
6921 			codec_err(cdc,
6922 				"Fail to register component aggregator %d\n",
6923 				ret);
6924 		else
6925 			spec->gen.pcm_playback_hook =
6926 				comp_generic_playback_hook;
6927 		break;
6928 	case HDA_FIXUP_ACT_FREE:
6929 		component_master_del(dev, &comp_master_ops);
6930 		break;
6931 	}
6932 }
6933 
6934 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6935 {
6936 	cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6937 }
6938 
6939 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6940 {
6941 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
6942 }
6943 
6944 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6945 {
6946 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
6947 }
6948 
6949 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6950 						 int action)
6951 {
6952 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
6953 }
6954 
6955 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6956 						 int action)
6957 {
6958 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6959 }
6960 
6961 static void tas2781_fixup_i2c(struct hda_codec *cdc,
6962 	const struct hda_fixup *fix, int action)
6963 {
6964 	 tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
6965 }
6966 
6967 /* for alc295_fixup_hp_top_speakers */
6968 #include "hp_x360_helper.c"
6969 
6970 /* for alc285_fixup_ideapad_s740_coef() */
6971 #include "ideapad_s740_helper.c"
6972 
6973 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6974 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6975 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6976 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6977 	{}
6978 };
6979 
6980 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6981 					   const struct hda_fixup *fix,
6982 					   int action)
6983 {
6984 	/*
6985 	 * A certain other OS sets these coeffs to different values. On at least
6986 	 * one TongFang barebone these settings might survive even a cold
6987 	 * reboot. So to restore a clean slate the values are explicitly reset
6988 	 * to default here. Without this, the external microphone is always in a
6989 	 * plugged-in state, while the internal microphone is always in an
6990 	 * unplugged state, breaking the ability to use the internal microphone.
6991 	 */
6992 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6993 }
6994 
6995 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6996 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6997 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6998 	WRITE_COEF(0x49, 0x0149),
6999 	{}
7000 };
7001 
7002 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7003 				       const struct hda_fixup *fix,
7004 				       int action)
7005 {
7006 	/*
7007 	 * The audio jack input and output is not detected on the ASRock NUC Box
7008 	 * 1100 series when cold booting without this fix. Warm rebooting from a
7009 	 * certain other OS makes the audio functional, as COEF settings are
7010 	 * preserved in this case. This fix sets these altered COEF values as
7011 	 * the default.
7012 	 */
7013 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7014 }
7015 
7016 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7017 						    const struct hda_fixup *fix,
7018 						    int action)
7019 {
7020 	/*
7021 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7022 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7023 	 * needs an additional quirk for sound working after suspend and resume.
7024 	 */
7025 	if (codec->core.vendor_id == 0x10ec0256) {
7026 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7027 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7028 	} else {
7029 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7030 	}
7031 }
7032 
7033 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7034 						  const struct hda_fixup *fix,
7035 						  int action)
7036 {
7037 	struct alc_spec *spec = codec->spec;
7038 	struct hda_input_mux *imux = &spec->gen.input_mux;
7039 	int i;
7040 
7041 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
7042 
7043 	switch (action) {
7044 	case HDA_FIXUP_ACT_PRE_PROBE:
7045 		/**
7046 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7047 		 * to Hi-Z to avoid pop noises at startup and when plugging and
7048 		 * unplugging headphones.
7049 		 */
7050 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7051 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7052 		break;
7053 	case HDA_FIXUP_ACT_PROBE:
7054 		/**
7055 		 * Make the internal mic (0x12) the default input source to
7056 		 * prevent pop noises on cold boot.
7057 		 */
7058 		for (i = 0; i < imux->num_items; i++) {
7059 			if (spec->gen.imux_pins[i] == 0x12) {
7060 				spec->gen.cur_mux[0] = i;
7061 				break;
7062 			}
7063 		}
7064 		break;
7065 	}
7066 }
7067 
7068 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7069 					  const struct hda_fixup *fix, int action)
7070 {
7071 	/*
7072 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7073 	 * unconnected.
7074 	 */
7075 	static const struct hda_pintbl pincfgs[] = {
7076 		{ 0x17, 0x90170121 },
7077 		{ }
7078 	};
7079 	/*
7080 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7081 	 * DAC 0x02 and 0x03 would be fine.
7082 	 */
7083 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7084 	/*
7085 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7086 	 * Headphones (0x21) are connected to DAC 0x03.
7087 	 */
7088 	static const hda_nid_t preferred_pairs[] = {
7089 		0x14, 0x02,
7090 		0x17, 0x02,
7091 		0x21, 0x03,
7092 		0
7093 	};
7094 	struct alc_spec *spec = codec->spec;
7095 
7096 	switch (action) {
7097 	case HDA_FIXUP_ACT_PRE_PROBE:
7098 		snd_hda_apply_pincfgs(codec, pincfgs);
7099 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7100 		spec->gen.preferred_dacs = preferred_pairs;
7101 		break;
7102 	}
7103 }
7104 
7105 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7106 					  const struct hda_fixup *fix, int action)
7107 {
7108 	static const struct hda_pintbl pincfgs[] = {
7109 		{ 0x14, 0x90170151 },
7110 		{ 0x17, 0x90170150 },
7111 		{ }
7112 	};
7113 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7114 	static const hda_nid_t preferred_pairs[] = {
7115 		0x14, 0x02,
7116 		0x17, 0x03,
7117 		0x21, 0x02,
7118 		0
7119 	};
7120 	struct alc_spec *spec = codec->spec;
7121 
7122 	alc_fixup_no_shutup(codec, fix, action);
7123 
7124 	switch (action) {
7125 	case HDA_FIXUP_ACT_PRE_PROBE:
7126 		snd_hda_apply_pincfgs(codec, pincfgs);
7127 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7128 		spec->gen.preferred_dacs = preferred_pairs;
7129 		break;
7130 	}
7131 }
7132 
7133 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7134 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7135 				    const struct hda_fixup *fix, int action)
7136 {
7137 	struct alc_spec *spec = codec->spec;
7138 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7139 	static const hda_nid_t preferred_pairs[] = {
7140 		0x17, 0x02, 0x21, 0x03, 0
7141 	};
7142 
7143 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7144 		return;
7145 
7146 	snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7147 	spec->gen.preferred_dacs = preferred_pairs;
7148 	spec->gen.auto_mute_via_amp = 1;
7149 	if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7150 		snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7151 					0x0); /* Make sure 0x14 was disable */
7152 	}
7153 }
7154 /* Fix none verb table of Headset Mic pin */
7155 static void alc_fixup_headset_mic(struct hda_codec *codec,
7156 				   const struct hda_fixup *fix, int action)
7157 {
7158 	struct alc_spec *spec = codec->spec;
7159 	static const struct hda_pintbl pincfgs[] = {
7160 		{ 0x19, 0x03a1103c },
7161 		{ }
7162 	};
7163 
7164 	switch (action) {
7165 	case HDA_FIXUP_ACT_PRE_PROBE:
7166 		snd_hda_apply_pincfgs(codec, pincfgs);
7167 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7168 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7169 		break;
7170 	}
7171 }
7172 
7173 
7174 enum {
7175 	ALC269_FIXUP_GPIO2,
7176 	ALC269_FIXUP_SONY_VAIO,
7177 	ALC275_FIXUP_SONY_VAIO_GPIO2,
7178 	ALC269_FIXUP_DELL_M101Z,
7179 	ALC269_FIXUP_SKU_IGNORE,
7180 	ALC269_FIXUP_ASUS_G73JW,
7181 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
7182 	ALC269_FIXUP_ASUS_N7601ZM,
7183 	ALC269_FIXUP_LENOVO_EAPD,
7184 	ALC275_FIXUP_SONY_HWEQ,
7185 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
7186 	ALC271_FIXUP_DMIC,
7187 	ALC269_FIXUP_PCM_44K,
7188 	ALC269_FIXUP_STEREO_DMIC,
7189 	ALC269_FIXUP_HEADSET_MIC,
7190 	ALC269_FIXUP_QUANTA_MUTE,
7191 	ALC269_FIXUP_LIFEBOOK,
7192 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
7193 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
7194 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7195 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7196 	ALC269_FIXUP_AMIC,
7197 	ALC269_FIXUP_DMIC,
7198 	ALC269VB_FIXUP_AMIC,
7199 	ALC269VB_FIXUP_DMIC,
7200 	ALC269_FIXUP_HP_MUTE_LED,
7201 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
7202 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
7203 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
7204 	ALC269_FIXUP_HP_GPIO_LED,
7205 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
7206 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
7207 	ALC269_FIXUP_INV_DMIC,
7208 	ALC269_FIXUP_LENOVO_DOCK,
7209 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7210 	ALC269_FIXUP_NO_SHUTUP,
7211 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7212 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7213 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7214 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7215 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7216 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7217 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7218 	ALC269_FIXUP_HEADSET_MODE,
7219 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7220 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7221 	ALC269_FIXUP_ASUS_X101_FUNC,
7222 	ALC269_FIXUP_ASUS_X101_VERB,
7223 	ALC269_FIXUP_ASUS_X101,
7224 	ALC271_FIXUP_AMIC_MIC2,
7225 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7226 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7227 	ALC269_FIXUP_ACER_AC700,
7228 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7229 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7230 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7231 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7232 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7233 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7234 	ALC283_FIXUP_CHROME_BOOK,
7235 	ALC283_FIXUP_SENSE_COMBO_JACK,
7236 	ALC282_FIXUP_ASUS_TX300,
7237 	ALC283_FIXUP_INT_MIC,
7238 	ALC290_FIXUP_MONO_SPEAKERS,
7239 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7240 	ALC290_FIXUP_SUBWOOFER,
7241 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7242 	ALC269_FIXUP_THINKPAD_ACPI,
7243 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7244 	ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7245 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7246 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7247 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7248 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7249 	ALC255_FIXUP_HEADSET_MODE,
7250 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7251 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7252 	ALC292_FIXUP_TPT440_DOCK,
7253 	ALC292_FIXUP_TPT440,
7254 	ALC283_FIXUP_HEADSET_MIC,
7255 	ALC255_FIXUP_MIC_MUTE_LED,
7256 	ALC282_FIXUP_ASPIRE_V5_PINS,
7257 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7258 	ALC280_FIXUP_HP_GPIO4,
7259 	ALC286_FIXUP_HP_GPIO_LED,
7260 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7261 	ALC280_FIXUP_HP_DOCK_PINS,
7262 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7263 	ALC280_FIXUP_HP_9480M,
7264 	ALC245_FIXUP_HP_X360_AMP,
7265 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7266 	ALC285_FIXUP_HP_ENVY_X360,
7267 	ALC288_FIXUP_DELL_HEADSET_MODE,
7268 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7269 	ALC288_FIXUP_DELL_XPS_13,
7270 	ALC288_FIXUP_DISABLE_AAMIX,
7271 	ALC292_FIXUP_DELL_E7X_AAMIX,
7272 	ALC292_FIXUP_DELL_E7X,
7273 	ALC292_FIXUP_DISABLE_AAMIX,
7274 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7275 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7276 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7277 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7278 	ALC275_FIXUP_DELL_XPS,
7279 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7280 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7281 	ALC255_FIXUP_DELL_SPK_NOISE,
7282 	ALC225_FIXUP_DISABLE_MIC_VREF,
7283 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7284 	ALC295_FIXUP_DISABLE_DAC3,
7285 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7286 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7287 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7288 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7289 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7290 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7291 	ALC280_FIXUP_HP_HEADSET_MIC,
7292 	ALC221_FIXUP_HP_FRONT_MIC,
7293 	ALC292_FIXUP_TPT460,
7294 	ALC298_FIXUP_SPK_VOLUME,
7295 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7296 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7297 	ALC269_FIXUP_ATIV_BOOK_8,
7298 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7299 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7300 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7301 	ALC256_FIXUP_ASUS_MIC,
7302 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7303 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7304 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7305 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7306 	ALC233_FIXUP_ACER_HEADSET_MIC,
7307 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7308 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7309 	ALC225_FIXUP_S3_POP_NOISE,
7310 	ALC700_FIXUP_INTEL_REFERENCE,
7311 	ALC274_FIXUP_DELL_BIND_DACS,
7312 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7313 	ALC298_FIXUP_TPT470_DOCK_FIX,
7314 	ALC298_FIXUP_TPT470_DOCK,
7315 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7316 	ALC255_FIXUP_DELL_HEADSET_MIC,
7317 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7318 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7319 	ALC295_FIXUP_HP_X360,
7320 	ALC221_FIXUP_HP_HEADSET_MIC,
7321 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7322 	ALC295_FIXUP_HP_AUTO_MUTE,
7323 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7324 	ALC294_FIXUP_ASUS_MIC,
7325 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7326 	ALC294_FIXUP_ASUS_SPK,
7327 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7328 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7329 	ALC255_FIXUP_ACER_HEADSET_MIC,
7330 	ALC295_FIXUP_CHROME_BOOK,
7331 	ALC225_FIXUP_HEADSET_JACK,
7332 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7333 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7334 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7335 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7336 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7337 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7338 	ALC299_FIXUP_PREDATOR_SPK,
7339 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7340 	ALC289_FIXUP_DELL_SPK1,
7341 	ALC289_FIXUP_DELL_SPK2,
7342 	ALC289_FIXUP_DUAL_SPK,
7343 	ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7344 	ALC294_FIXUP_SPK2_TO_DAC1,
7345 	ALC294_FIXUP_ASUS_DUAL_SPK,
7346 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7347 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7348 	ALC294_FIXUP_ASUS_ALLY,
7349 	ALC294_FIXUP_ASUS_ALLY_PINS,
7350 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7351 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7352 	ALC294_FIXUP_ASUS_HPE,
7353 	ALC294_FIXUP_ASUS_COEF_1B,
7354 	ALC294_FIXUP_ASUS_GX502_HP,
7355 	ALC294_FIXUP_ASUS_GX502_PINS,
7356 	ALC294_FIXUP_ASUS_GX502_VERBS,
7357 	ALC294_FIXUP_ASUS_GU502_HP,
7358 	ALC294_FIXUP_ASUS_GU502_PINS,
7359 	ALC294_FIXUP_ASUS_GU502_VERBS,
7360 	ALC294_FIXUP_ASUS_G513_PINS,
7361 	ALC285_FIXUP_ASUS_G533Z_PINS,
7362 	ALC285_FIXUP_HP_GPIO_LED,
7363 	ALC285_FIXUP_HP_MUTE_LED,
7364 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7365 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7366 	ALC236_FIXUP_HP_GPIO_LED,
7367 	ALC236_FIXUP_HP_MUTE_LED,
7368 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7369 	ALC236_FIXUP_LENOVO_INV_DMIC,
7370 	ALC298_FIXUP_SAMSUNG_AMP,
7371 	ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7372 	ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7373 	ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7374 	ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7375 	ALC269VC_FIXUP_ACER_HEADSET_MIC,
7376 	ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7377 	ALC289_FIXUP_ASUS_GA401,
7378 	ALC289_FIXUP_ASUS_GA502,
7379 	ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7380 	ALC285_FIXUP_HP_GPIO_AMP_INIT,
7381 	ALC269_FIXUP_CZC_B20,
7382 	ALC269_FIXUP_CZC_TMI,
7383 	ALC269_FIXUP_CZC_L101,
7384 	ALC269_FIXUP_LEMOTE_A1802,
7385 	ALC269_FIXUP_LEMOTE_A190X,
7386 	ALC256_FIXUP_INTEL_NUC8_RUGGED,
7387 	ALC233_FIXUP_INTEL_NUC8_DMIC,
7388 	ALC233_FIXUP_INTEL_NUC8_BOOST,
7389 	ALC256_FIXUP_INTEL_NUC10,
7390 	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7391 	ALC274_FIXUP_HP_MIC,
7392 	ALC274_FIXUP_HP_HEADSET_MIC,
7393 	ALC274_FIXUP_HP_ENVY_GPIO,
7394 	ALC256_FIXUP_ASUS_HPE,
7395 	ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7396 	ALC287_FIXUP_HP_GPIO_LED,
7397 	ALC256_FIXUP_HP_HEADSET_MIC,
7398 	ALC245_FIXUP_HP_GPIO_LED,
7399 	ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7400 	ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7401 	ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7402 	ALC256_FIXUP_ACER_HEADSET_MIC,
7403 	ALC285_FIXUP_IDEAPAD_S740_COEF,
7404 	ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7405 	ALC295_FIXUP_ASUS_DACS,
7406 	ALC295_FIXUP_HP_OMEN,
7407 	ALC285_FIXUP_HP_SPECTRE_X360,
7408 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7409 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7410 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7411 	ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7412 	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7413 	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7414 	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7415 	ALC298_FIXUP_LENOVO_C940_DUET7,
7416 	ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
7417 	ALC287_FIXUP_13S_GEN2_SPEAKERS,
7418 	ALC256_FIXUP_SET_COEF_DEFAULTS,
7419 	ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7420 	ALC233_FIXUP_NO_AUDIO_JACK,
7421 	ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7422 	ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7423 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7424 	ALC287_FIXUP_LEGION_16ACHG6,
7425 	ALC287_FIXUP_CS35L41_I2C_2,
7426 	ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7427 	ALC245_FIXUP_CS35L41_SPI_2,
7428 	ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7429 	ALC245_FIXUP_CS35L41_SPI_4,
7430 	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7431 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7432 	ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7433 	ALC287_FIXUP_LEGION_16ITHG6,
7434 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7435 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7436 	ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
7437 	ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7438 	ALC236_FIXUP_DELL_DUAL_CODECS,
7439 	ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
7440 	ALC287_FIXUP_TAS2781_I2C,
7441 	ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
7442 	ALC245_FIXUP_HP_X360_MUTE_LEDS,
7443 	ALC287_FIXUP_THINKPAD_I2S_SPK,
7444 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
7445 	ALC2XX_FIXUP_HEADSET_MIC,
7446 	ALC289_FIXUP_DELL_CS35L41_SPI_2,
7447 	ALC294_FIXUP_CS35L41_I2C_2,
7448 };
7449 
7450 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7451  * both have the very same PCI SSID, and we need to apply different fixups
7452  * depending on the codec ID
7453  */
7454 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7455 					   const struct hda_fixup *fix,
7456 					   int action)
7457 {
7458 	int id;
7459 
7460 	if (codec->core.vendor_id == 0x10ec0298)
7461 		id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7462 	else
7463 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7464 	__snd_hda_apply_fixup(codec, id, action, 0);
7465 }
7466 
7467 /* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
7468  * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
7469  * so we need to apply a different fixup in this case. The only DuetITL codec
7470  * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
7471  * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
7472  * have matched correctly by their codecs.
7473  */
7474 static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
7475 					      const struct hda_fixup *fix,
7476 					      int action)
7477 {
7478 	int id;
7479 
7480 	if (codec->core.subsystem_id == 0x17aa3802)
7481 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
7482 	else
7483 		id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
7484 	__snd_hda_apply_fixup(codec, id, action, 0);
7485 }
7486 
7487 static const struct hda_fixup alc269_fixups[] = {
7488 	[ALC269_FIXUP_GPIO2] = {
7489 		.type = HDA_FIXUP_FUNC,
7490 		.v.func = alc_fixup_gpio2,
7491 	},
7492 	[ALC269_FIXUP_SONY_VAIO] = {
7493 		.type = HDA_FIXUP_PINCTLS,
7494 		.v.pins = (const struct hda_pintbl[]) {
7495 			{0x19, PIN_VREFGRD},
7496 			{}
7497 		}
7498 	},
7499 	[ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7500 		.type = HDA_FIXUP_FUNC,
7501 		.v.func = alc275_fixup_gpio4_off,
7502 		.chained = true,
7503 		.chain_id = ALC269_FIXUP_SONY_VAIO
7504 	},
7505 	[ALC269_FIXUP_DELL_M101Z] = {
7506 		.type = HDA_FIXUP_VERBS,
7507 		.v.verbs = (const struct hda_verb[]) {
7508 			/* Enables internal speaker */
7509 			{0x20, AC_VERB_SET_COEF_INDEX, 13},
7510 			{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7511 			{}
7512 		}
7513 	},
7514 	[ALC269_FIXUP_SKU_IGNORE] = {
7515 		.type = HDA_FIXUP_FUNC,
7516 		.v.func = alc_fixup_sku_ignore,
7517 	},
7518 	[ALC269_FIXUP_ASUS_G73JW] = {
7519 		.type = HDA_FIXUP_PINS,
7520 		.v.pins = (const struct hda_pintbl[]) {
7521 			{ 0x17, 0x99130111 }, /* subwoofer */
7522 			{ }
7523 		}
7524 	},
7525 	[ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7526 		.type = HDA_FIXUP_PINS,
7527 		.v.pins = (const struct hda_pintbl[]) {
7528 			{ 0x19, 0x03A11050 },
7529 			{ 0x1a, 0x03A11C30 },
7530 			{ 0x21, 0x03211420 },
7531 			{ }
7532 		}
7533 	},
7534 	[ALC269_FIXUP_ASUS_N7601ZM] = {
7535 		.type = HDA_FIXUP_VERBS,
7536 		.v.verbs = (const struct hda_verb[]) {
7537 			{0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7538 			{0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7539 			{0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7540 			{0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7541 			{0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7542 			{0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7543 			{ }
7544 		},
7545 		.chained = true,
7546 		.chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7547 	},
7548 	[ALC269_FIXUP_LENOVO_EAPD] = {
7549 		.type = HDA_FIXUP_VERBS,
7550 		.v.verbs = (const struct hda_verb[]) {
7551 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7552 			{}
7553 		}
7554 	},
7555 	[ALC275_FIXUP_SONY_HWEQ] = {
7556 		.type = HDA_FIXUP_FUNC,
7557 		.v.func = alc269_fixup_hweq,
7558 		.chained = true,
7559 		.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7560 	},
7561 	[ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7562 		.type = HDA_FIXUP_FUNC,
7563 		.v.func = alc_fixup_disable_aamix,
7564 		.chained = true,
7565 		.chain_id = ALC269_FIXUP_SONY_VAIO
7566 	},
7567 	[ALC271_FIXUP_DMIC] = {
7568 		.type = HDA_FIXUP_FUNC,
7569 		.v.func = alc271_fixup_dmic,
7570 	},
7571 	[ALC269_FIXUP_PCM_44K] = {
7572 		.type = HDA_FIXUP_FUNC,
7573 		.v.func = alc269_fixup_pcm_44k,
7574 		.chained = true,
7575 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7576 	},
7577 	[ALC269_FIXUP_STEREO_DMIC] = {
7578 		.type = HDA_FIXUP_FUNC,
7579 		.v.func = alc269_fixup_stereo_dmic,
7580 	},
7581 	[ALC269_FIXUP_HEADSET_MIC] = {
7582 		.type = HDA_FIXUP_FUNC,
7583 		.v.func = alc269_fixup_headset_mic,
7584 	},
7585 	[ALC269_FIXUP_QUANTA_MUTE] = {
7586 		.type = HDA_FIXUP_FUNC,
7587 		.v.func = alc269_fixup_quanta_mute,
7588 	},
7589 	[ALC269_FIXUP_LIFEBOOK] = {
7590 		.type = HDA_FIXUP_PINS,
7591 		.v.pins = (const struct hda_pintbl[]) {
7592 			{ 0x1a, 0x2101103f }, /* dock line-out */
7593 			{ 0x1b, 0x23a11040 }, /* dock mic-in */
7594 			{ }
7595 		},
7596 		.chained = true,
7597 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7598 	},
7599 	[ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7600 		.type = HDA_FIXUP_PINS,
7601 		.v.pins = (const struct hda_pintbl[]) {
7602 			{ 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7603 			{ }
7604 		},
7605 	},
7606 	[ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7607 		.type = HDA_FIXUP_PINS,
7608 		.v.pins = (const struct hda_pintbl[]) {
7609 			{ 0x21, 0x0221102f }, /* HP out */
7610 			{ }
7611 		},
7612 	},
7613 	[ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7614 		.type = HDA_FIXUP_FUNC,
7615 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7616 	},
7617 	[ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7618 		.type = HDA_FIXUP_FUNC,
7619 		.v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7620 	},
7621 	[ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7622 		.type = HDA_FIXUP_PINS,
7623 		.v.pins = (const struct hda_pintbl[]) {
7624 			{ 0x18, 0x03a19020 }, /* headset mic */
7625 			{ 0x1b, 0x90170150 }, /* speaker */
7626 			{ }
7627 		},
7628 	},
7629 	[ALC269_FIXUP_AMIC] = {
7630 		.type = HDA_FIXUP_PINS,
7631 		.v.pins = (const struct hda_pintbl[]) {
7632 			{ 0x14, 0x99130110 }, /* speaker */
7633 			{ 0x15, 0x0121401f }, /* HP out */
7634 			{ 0x18, 0x01a19c20 }, /* mic */
7635 			{ 0x19, 0x99a3092f }, /* int-mic */
7636 			{ }
7637 		},
7638 	},
7639 	[ALC269_FIXUP_DMIC] = {
7640 		.type = HDA_FIXUP_PINS,
7641 		.v.pins = (const struct hda_pintbl[]) {
7642 			{ 0x12, 0x99a3092f }, /* int-mic */
7643 			{ 0x14, 0x99130110 }, /* speaker */
7644 			{ 0x15, 0x0121401f }, /* HP out */
7645 			{ 0x18, 0x01a19c20 }, /* mic */
7646 			{ }
7647 		},
7648 	},
7649 	[ALC269VB_FIXUP_AMIC] = {
7650 		.type = HDA_FIXUP_PINS,
7651 		.v.pins = (const struct hda_pintbl[]) {
7652 			{ 0x14, 0x99130110 }, /* speaker */
7653 			{ 0x18, 0x01a19c20 }, /* mic */
7654 			{ 0x19, 0x99a3092f }, /* int-mic */
7655 			{ 0x21, 0x0121401f }, /* HP out */
7656 			{ }
7657 		},
7658 	},
7659 	[ALC269VB_FIXUP_DMIC] = {
7660 		.type = HDA_FIXUP_PINS,
7661 		.v.pins = (const struct hda_pintbl[]) {
7662 			{ 0x12, 0x99a3092f }, /* int-mic */
7663 			{ 0x14, 0x99130110 }, /* speaker */
7664 			{ 0x18, 0x01a19c20 }, /* mic */
7665 			{ 0x21, 0x0121401f }, /* HP out */
7666 			{ }
7667 		},
7668 	},
7669 	[ALC269_FIXUP_HP_MUTE_LED] = {
7670 		.type = HDA_FIXUP_FUNC,
7671 		.v.func = alc269_fixup_hp_mute_led,
7672 	},
7673 	[ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7674 		.type = HDA_FIXUP_FUNC,
7675 		.v.func = alc269_fixup_hp_mute_led_mic1,
7676 	},
7677 	[ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7678 		.type = HDA_FIXUP_FUNC,
7679 		.v.func = alc269_fixup_hp_mute_led_mic2,
7680 	},
7681 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7682 		.type = HDA_FIXUP_FUNC,
7683 		.v.func = alc269_fixup_hp_mute_led_mic3,
7684 		.chained = true,
7685 		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7686 	},
7687 	[ALC269_FIXUP_HP_GPIO_LED] = {
7688 		.type = HDA_FIXUP_FUNC,
7689 		.v.func = alc269_fixup_hp_gpio_led,
7690 	},
7691 	[ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7692 		.type = HDA_FIXUP_FUNC,
7693 		.v.func = alc269_fixup_hp_gpio_mic1_led,
7694 	},
7695 	[ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7696 		.type = HDA_FIXUP_FUNC,
7697 		.v.func = alc269_fixup_hp_line1_mic1_led,
7698 	},
7699 	[ALC269_FIXUP_INV_DMIC] = {
7700 		.type = HDA_FIXUP_FUNC,
7701 		.v.func = alc_fixup_inv_dmic,
7702 	},
7703 	[ALC269_FIXUP_NO_SHUTUP] = {
7704 		.type = HDA_FIXUP_FUNC,
7705 		.v.func = alc_fixup_no_shutup,
7706 	},
7707 	[ALC269_FIXUP_LENOVO_DOCK] = {
7708 		.type = HDA_FIXUP_PINS,
7709 		.v.pins = (const struct hda_pintbl[]) {
7710 			{ 0x19, 0x23a11040 }, /* dock mic */
7711 			{ 0x1b, 0x2121103f }, /* dock headphone */
7712 			{ }
7713 		},
7714 		.chained = true,
7715 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7716 	},
7717 	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7718 		.type = HDA_FIXUP_FUNC,
7719 		.v.func = alc269_fixup_limit_int_mic_boost,
7720 		.chained = true,
7721 		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
7722 	},
7723 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7724 		.type = HDA_FIXUP_FUNC,
7725 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7726 		.chained = true,
7727 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7728 	},
7729 	[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7730 		.type = HDA_FIXUP_PINS,
7731 		.v.pins = (const struct hda_pintbl[]) {
7732 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7733 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7734 			{ }
7735 		},
7736 		.chained = true,
7737 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7738 	},
7739 	[ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7740 		.type = HDA_FIXUP_PINS,
7741 		.v.pins = (const struct hda_pintbl[]) {
7742 			{ 0x16, 0x21014020 }, /* dock line out */
7743 			{ 0x19, 0x21a19030 }, /* dock mic */
7744 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7745 			{ }
7746 		},
7747 		.chained = true,
7748 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7749 	},
7750 	[ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7751 		.type = HDA_FIXUP_PINS,
7752 		.v.pins = (const struct hda_pintbl[]) {
7753 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7754 			{ }
7755 		},
7756 		.chained = true,
7757 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7758 	},
7759 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7760 		.type = HDA_FIXUP_PINS,
7761 		.v.pins = (const struct hda_pintbl[]) {
7762 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7763 			{ 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7764 			{ }
7765 		},
7766 		.chained = true,
7767 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7768 	},
7769 	[ALC269_FIXUP_HEADSET_MODE] = {
7770 		.type = HDA_FIXUP_FUNC,
7771 		.v.func = alc_fixup_headset_mode,
7772 		.chained = true,
7773 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7774 	},
7775 	[ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7776 		.type = HDA_FIXUP_FUNC,
7777 		.v.func = alc_fixup_headset_mode_no_hp_mic,
7778 	},
7779 	[ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7780 		.type = HDA_FIXUP_PINS,
7781 		.v.pins = (const struct hda_pintbl[]) {
7782 			{ 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7783 			{ }
7784 		},
7785 		.chained = true,
7786 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
7787 	},
7788 	[ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7789 		.type = HDA_FIXUP_PINS,
7790 		.v.pins = (const struct hda_pintbl[]) {
7791 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7792 			{ }
7793 		},
7794 		.chained = true,
7795 		.chain_id = ALC269_FIXUP_HEADSET_MIC
7796 	},
7797 	[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7798 		.type = HDA_FIXUP_PINS,
7799 		.v.pins = (const struct hda_pintbl[]) {
7800 			{0x12, 0x90a60130},
7801 			{0x13, 0x40000000},
7802 			{0x14, 0x90170110},
7803 			{0x18, 0x411111f0},
7804 			{0x19, 0x04a11040},
7805 			{0x1a, 0x411111f0},
7806 			{0x1b, 0x90170112},
7807 			{0x1d, 0x40759a05},
7808 			{0x1e, 0x411111f0},
7809 			{0x21, 0x04211020},
7810 			{ }
7811 		},
7812 		.chained = true,
7813 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7814 	},
7815 	[ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7816 		.type = HDA_FIXUP_FUNC,
7817 		.v.func = alc298_fixup_huawei_mbx_stereo,
7818 		.chained = true,
7819 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7820 	},
7821 	[ALC269_FIXUP_ASUS_X101_FUNC] = {
7822 		.type = HDA_FIXUP_FUNC,
7823 		.v.func = alc269_fixup_x101_headset_mic,
7824 	},
7825 	[ALC269_FIXUP_ASUS_X101_VERB] = {
7826 		.type = HDA_FIXUP_VERBS,
7827 		.v.verbs = (const struct hda_verb[]) {
7828 			{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7829 			{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7830 			{0x20, AC_VERB_SET_PROC_COEF,  0x0310},
7831 			{ }
7832 		},
7833 		.chained = true,
7834 		.chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7835 	},
7836 	[ALC269_FIXUP_ASUS_X101] = {
7837 		.type = HDA_FIXUP_PINS,
7838 		.v.pins = (const struct hda_pintbl[]) {
7839 			{ 0x18, 0x04a1182c }, /* Headset mic */
7840 			{ }
7841 		},
7842 		.chained = true,
7843 		.chain_id = ALC269_FIXUP_ASUS_X101_VERB
7844 	},
7845 	[ALC271_FIXUP_AMIC_MIC2] = {
7846 		.type = HDA_FIXUP_PINS,
7847 		.v.pins = (const struct hda_pintbl[]) {
7848 			{ 0x14, 0x99130110 }, /* speaker */
7849 			{ 0x19, 0x01a19c20 }, /* mic */
7850 			{ 0x1b, 0x99a7012f }, /* int-mic */
7851 			{ 0x21, 0x0121401f }, /* HP out */
7852 			{ }
7853 		},
7854 	},
7855 	[ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7856 		.type = HDA_FIXUP_FUNC,
7857 		.v.func = alc271_hp_gate_mic_jack,
7858 		.chained = true,
7859 		.chain_id = ALC271_FIXUP_AMIC_MIC2,
7860 	},
7861 	[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7862 		.type = HDA_FIXUP_FUNC,
7863 		.v.func = alc269_fixup_limit_int_mic_boost,
7864 		.chained = true,
7865 		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7866 	},
7867 	[ALC269_FIXUP_ACER_AC700] = {
7868 		.type = HDA_FIXUP_PINS,
7869 		.v.pins = (const struct hda_pintbl[]) {
7870 			{ 0x12, 0x99a3092f }, /* int-mic */
7871 			{ 0x14, 0x99130110 }, /* speaker */
7872 			{ 0x18, 0x03a11c20 }, /* mic */
7873 			{ 0x1e, 0x0346101e }, /* SPDIF1 */
7874 			{ 0x21, 0x0321101f }, /* HP out */
7875 			{ }
7876 		},
7877 		.chained = true,
7878 		.chain_id = ALC271_FIXUP_DMIC,
7879 	},
7880 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7881 		.type = HDA_FIXUP_FUNC,
7882 		.v.func = alc269_fixup_limit_int_mic_boost,
7883 		.chained = true,
7884 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7885 	},
7886 	[ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7887 		.type = HDA_FIXUP_FUNC,
7888 		.v.func = alc269_fixup_limit_int_mic_boost,
7889 		.chained = true,
7890 		.chain_id = ALC269VB_FIXUP_DMIC,
7891 	},
7892 	[ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7893 		.type = HDA_FIXUP_VERBS,
7894 		.v.verbs = (const struct hda_verb[]) {
7895 			/* class-D output amp +5dB */
7896 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7897 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7898 			{}
7899 		},
7900 		.chained = true,
7901 		.chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7902 	},
7903 	[ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7904 		.type = HDA_FIXUP_PINS,
7905 		.v.pins = (const struct hda_pintbl[]) {
7906 			{ 0x18, 0x01a110f0 },  /* use as headset mic */
7907 			{ }
7908 		},
7909 		.chained = true,
7910 		.chain_id = ALC269_FIXUP_HEADSET_MIC
7911 	},
7912 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7913 		.type = HDA_FIXUP_FUNC,
7914 		.v.func = alc269_fixup_limit_int_mic_boost,
7915 		.chained = true,
7916 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7917 	},
7918 	[ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7919 		.type = HDA_FIXUP_PINS,
7920 		.v.pins = (const struct hda_pintbl[]) {
7921 			{ 0x12, 0x99a3092f }, /* int-mic */
7922 			{ 0x18, 0x03a11d20 }, /* mic */
7923 			{ 0x19, 0x411111f0 }, /* Unused bogus pin */
7924 			{ }
7925 		},
7926 	},
7927 	[ALC283_FIXUP_CHROME_BOOK] = {
7928 		.type = HDA_FIXUP_FUNC,
7929 		.v.func = alc283_fixup_chromebook,
7930 	},
7931 	[ALC283_FIXUP_SENSE_COMBO_JACK] = {
7932 		.type = HDA_FIXUP_FUNC,
7933 		.v.func = alc283_fixup_sense_combo_jack,
7934 		.chained = true,
7935 		.chain_id = ALC283_FIXUP_CHROME_BOOK,
7936 	},
7937 	[ALC282_FIXUP_ASUS_TX300] = {
7938 		.type = HDA_FIXUP_FUNC,
7939 		.v.func = alc282_fixup_asus_tx300,
7940 	},
7941 	[ALC283_FIXUP_INT_MIC] = {
7942 		.type = HDA_FIXUP_VERBS,
7943 		.v.verbs = (const struct hda_verb[]) {
7944 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7945 			{0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7946 			{ }
7947 		},
7948 		.chained = true,
7949 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7950 	},
7951 	[ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7952 		.type = HDA_FIXUP_PINS,
7953 		.v.pins = (const struct hda_pintbl[]) {
7954 			{ 0x17, 0x90170112 }, /* subwoofer */
7955 			{ }
7956 		},
7957 		.chained = true,
7958 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7959 	},
7960 	[ALC290_FIXUP_SUBWOOFER] = {
7961 		.type = HDA_FIXUP_PINS,
7962 		.v.pins = (const struct hda_pintbl[]) {
7963 			{ 0x17, 0x90170112 }, /* subwoofer */
7964 			{ }
7965 		},
7966 		.chained = true,
7967 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7968 	},
7969 	[ALC290_FIXUP_MONO_SPEAKERS] = {
7970 		.type = HDA_FIXUP_FUNC,
7971 		.v.func = alc290_fixup_mono_speakers,
7972 	},
7973 	[ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7974 		.type = HDA_FIXUP_FUNC,
7975 		.v.func = alc290_fixup_mono_speakers,
7976 		.chained = true,
7977 		.chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7978 	},
7979 	[ALC269_FIXUP_THINKPAD_ACPI] = {
7980 		.type = HDA_FIXUP_FUNC,
7981 		.v.func = alc_fixup_thinkpad_acpi,
7982 		.chained = true,
7983 		.chain_id = ALC269_FIXUP_SKU_IGNORE,
7984 	},
7985 	[ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7986 		.type = HDA_FIXUP_FUNC,
7987 		.v.func = alc_fixup_inv_dmic,
7988 		.chained = true,
7989 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7990 	},
7991 	[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7992 		.type = HDA_FIXUP_PINS,
7993 		.v.pins = (const struct hda_pintbl[]) {
7994 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7995 			{ }
7996 		},
7997 		.chained = true,
7998 		.chain_id = ALC255_FIXUP_HEADSET_MODE
7999 	},
8000 	[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8001 		.type = HDA_FIXUP_PINS,
8002 		.v.pins = (const struct hda_pintbl[]) {
8003 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8004 			{ }
8005 		},
8006 		.chained = true,
8007 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8008 	},
8009 	[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8010 		.type = HDA_FIXUP_PINS,
8011 		.v.pins = (const struct hda_pintbl[]) {
8012 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8013 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8014 			{ }
8015 		},
8016 		.chained = true,
8017 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8018 	},
8019 	[ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8020 		.type = HDA_FIXUP_PINS,
8021 		.v.pins = (const struct hda_pintbl[]) {
8022 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8023 			{ }
8024 		},
8025 		.chained = true,
8026 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8027 	},
8028 	[ALC255_FIXUP_HEADSET_MODE] = {
8029 		.type = HDA_FIXUP_FUNC,
8030 		.v.func = alc_fixup_headset_mode_alc255,
8031 		.chained = true,
8032 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8033 	},
8034 	[ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8035 		.type = HDA_FIXUP_FUNC,
8036 		.v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8037 	},
8038 	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8039 		.type = HDA_FIXUP_PINS,
8040 		.v.pins = (const struct hda_pintbl[]) {
8041 			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8042 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8043 			{ }
8044 		},
8045 		.chained = true,
8046 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8047 	},
8048 	[ALC292_FIXUP_TPT440_DOCK] = {
8049 		.type = HDA_FIXUP_FUNC,
8050 		.v.func = alc_fixup_tpt440_dock,
8051 		.chained = true,
8052 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8053 	},
8054 	[ALC292_FIXUP_TPT440] = {
8055 		.type = HDA_FIXUP_FUNC,
8056 		.v.func = alc_fixup_disable_aamix,
8057 		.chained = true,
8058 		.chain_id = ALC292_FIXUP_TPT440_DOCK,
8059 	},
8060 	[ALC283_FIXUP_HEADSET_MIC] = {
8061 		.type = HDA_FIXUP_PINS,
8062 		.v.pins = (const struct hda_pintbl[]) {
8063 			{ 0x19, 0x04a110f0 },
8064 			{ },
8065 		},
8066 	},
8067 	[ALC255_FIXUP_MIC_MUTE_LED] = {
8068 		.type = HDA_FIXUP_FUNC,
8069 		.v.func = alc_fixup_micmute_led,
8070 	},
8071 	[ALC282_FIXUP_ASPIRE_V5_PINS] = {
8072 		.type = HDA_FIXUP_PINS,
8073 		.v.pins = (const struct hda_pintbl[]) {
8074 			{ 0x12, 0x90a60130 },
8075 			{ 0x14, 0x90170110 },
8076 			{ 0x17, 0x40000008 },
8077 			{ 0x18, 0x411111f0 },
8078 			{ 0x19, 0x01a1913c },
8079 			{ 0x1a, 0x411111f0 },
8080 			{ 0x1b, 0x411111f0 },
8081 			{ 0x1d, 0x40f89b2d },
8082 			{ 0x1e, 0x411111f0 },
8083 			{ 0x21, 0x0321101f },
8084 			{ },
8085 		},
8086 	},
8087 	[ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8088 		.type = HDA_FIXUP_FUNC,
8089 		.v.func = alc269vb_fixup_aspire_e1_coef,
8090 	},
8091 	[ALC280_FIXUP_HP_GPIO4] = {
8092 		.type = HDA_FIXUP_FUNC,
8093 		.v.func = alc280_fixup_hp_gpio4,
8094 	},
8095 	[ALC286_FIXUP_HP_GPIO_LED] = {
8096 		.type = HDA_FIXUP_FUNC,
8097 		.v.func = alc286_fixup_hp_gpio_led,
8098 	},
8099 	[ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8100 		.type = HDA_FIXUP_FUNC,
8101 		.v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8102 	},
8103 	[ALC280_FIXUP_HP_DOCK_PINS] = {
8104 		.type = HDA_FIXUP_PINS,
8105 		.v.pins = (const struct hda_pintbl[]) {
8106 			{ 0x1b, 0x21011020 }, /* line-out */
8107 			{ 0x1a, 0x01a1903c }, /* headset mic */
8108 			{ 0x18, 0x2181103f }, /* line-in */
8109 			{ },
8110 		},
8111 		.chained = true,
8112 		.chain_id = ALC280_FIXUP_HP_GPIO4
8113 	},
8114 	[ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8115 		.type = HDA_FIXUP_PINS,
8116 		.v.pins = (const struct hda_pintbl[]) {
8117 			{ 0x1b, 0x21011020 }, /* line-out */
8118 			{ 0x18, 0x2181103f }, /* line-in */
8119 			{ },
8120 		},
8121 		.chained = true,
8122 		.chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8123 	},
8124 	[ALC280_FIXUP_HP_9480M] = {
8125 		.type = HDA_FIXUP_FUNC,
8126 		.v.func = alc280_fixup_hp_9480m,
8127 	},
8128 	[ALC245_FIXUP_HP_X360_AMP] = {
8129 		.type = HDA_FIXUP_FUNC,
8130 		.v.func = alc245_fixup_hp_x360_amp,
8131 		.chained = true,
8132 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
8133 	},
8134 	[ALC288_FIXUP_DELL_HEADSET_MODE] = {
8135 		.type = HDA_FIXUP_FUNC,
8136 		.v.func = alc_fixup_headset_mode_dell_alc288,
8137 		.chained = true,
8138 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8139 	},
8140 	[ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8141 		.type = HDA_FIXUP_PINS,
8142 		.v.pins = (const struct hda_pintbl[]) {
8143 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8144 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8145 			{ }
8146 		},
8147 		.chained = true,
8148 		.chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8149 	},
8150 	[ALC288_FIXUP_DISABLE_AAMIX] = {
8151 		.type = HDA_FIXUP_FUNC,
8152 		.v.func = alc_fixup_disable_aamix,
8153 		.chained = true,
8154 		.chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
8155 	},
8156 	[ALC288_FIXUP_DELL_XPS_13] = {
8157 		.type = HDA_FIXUP_FUNC,
8158 		.v.func = alc_fixup_dell_xps13,
8159 		.chained = true,
8160 		.chain_id = ALC288_FIXUP_DISABLE_AAMIX
8161 	},
8162 	[ALC292_FIXUP_DISABLE_AAMIX] = {
8163 		.type = HDA_FIXUP_FUNC,
8164 		.v.func = alc_fixup_disable_aamix,
8165 		.chained = true,
8166 		.chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8167 	},
8168 	[ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8169 		.type = HDA_FIXUP_FUNC,
8170 		.v.func = alc_fixup_disable_aamix,
8171 		.chained = true,
8172 		.chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8173 	},
8174 	[ALC292_FIXUP_DELL_E7X_AAMIX] = {
8175 		.type = HDA_FIXUP_FUNC,
8176 		.v.func = alc_fixup_dell_xps13,
8177 		.chained = true,
8178 		.chain_id = ALC292_FIXUP_DISABLE_AAMIX
8179 	},
8180 	[ALC292_FIXUP_DELL_E7X] = {
8181 		.type = HDA_FIXUP_FUNC,
8182 		.v.func = alc_fixup_micmute_led,
8183 		/* micmute fixup must be applied at last */
8184 		.chained_before = true,
8185 		.chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8186 	},
8187 	[ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8188 		.type = HDA_FIXUP_PINS,
8189 		.v.pins = (const struct hda_pintbl[]) {
8190 			{ 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8191 			{ }
8192 		},
8193 		.chained_before = true,
8194 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8195 	},
8196 	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8197 		.type = HDA_FIXUP_PINS,
8198 		.v.pins = (const struct hda_pintbl[]) {
8199 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8200 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8201 			{ }
8202 		},
8203 		.chained = true,
8204 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8205 	},
8206 	[ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8207 		.type = HDA_FIXUP_PINS,
8208 		.v.pins = (const struct hda_pintbl[]) {
8209 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8210 			{ }
8211 		},
8212 		.chained = true,
8213 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8214 	},
8215 	[ALC275_FIXUP_DELL_XPS] = {
8216 		.type = HDA_FIXUP_VERBS,
8217 		.v.verbs = (const struct hda_verb[]) {
8218 			/* Enables internal speaker */
8219 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8220 			{0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8221 			{0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8222 			{0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8223 			{}
8224 		}
8225 	},
8226 	[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8227 		.type = HDA_FIXUP_FUNC,
8228 		.v.func = alc_fixup_disable_aamix,
8229 		.chained = true,
8230 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8231 	},
8232 	[ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8233 		.type = HDA_FIXUP_FUNC,
8234 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8235 	},
8236 	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8237 		.type = HDA_FIXUP_FUNC,
8238 		.v.func = alc_fixup_inv_dmic,
8239 		.chained = true,
8240 		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8241 	},
8242 	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8243 		.type = HDA_FIXUP_FUNC,
8244 		.v.func = alc269_fixup_limit_int_mic_boost
8245 	},
8246 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
8247 		.type = HDA_FIXUP_FUNC,
8248 		.v.func = alc_fixup_disable_aamix,
8249 		.chained = true,
8250 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8251 	},
8252 	[ALC225_FIXUP_DISABLE_MIC_VREF] = {
8253 		.type = HDA_FIXUP_FUNC,
8254 		.v.func = alc_fixup_disable_mic_vref,
8255 		.chained = true,
8256 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8257 	},
8258 	[ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8259 		.type = HDA_FIXUP_VERBS,
8260 		.v.verbs = (const struct hda_verb[]) {
8261 			/* Disable pass-through path for FRONT 14h */
8262 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8263 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8264 			{}
8265 		},
8266 		.chained = true,
8267 		.chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8268 	},
8269 	[ALC280_FIXUP_HP_HEADSET_MIC] = {
8270 		.type = HDA_FIXUP_FUNC,
8271 		.v.func = alc_fixup_disable_aamix,
8272 		.chained = true,
8273 		.chain_id = ALC269_FIXUP_HEADSET_MIC,
8274 	},
8275 	[ALC221_FIXUP_HP_FRONT_MIC] = {
8276 		.type = HDA_FIXUP_PINS,
8277 		.v.pins = (const struct hda_pintbl[]) {
8278 			{ 0x19, 0x02a19020 }, /* Front Mic */
8279 			{ }
8280 		},
8281 	},
8282 	[ALC292_FIXUP_TPT460] = {
8283 		.type = HDA_FIXUP_FUNC,
8284 		.v.func = alc_fixup_tpt440_dock,
8285 		.chained = true,
8286 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8287 	},
8288 	[ALC298_FIXUP_SPK_VOLUME] = {
8289 		.type = HDA_FIXUP_FUNC,
8290 		.v.func = alc298_fixup_speaker_volume,
8291 		.chained = true,
8292 		.chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8293 	},
8294 	[ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8295 		.type = HDA_FIXUP_FUNC,
8296 		.v.func = alc298_fixup_speaker_volume,
8297 	},
8298 	[ALC295_FIXUP_DISABLE_DAC3] = {
8299 		.type = HDA_FIXUP_FUNC,
8300 		.v.func = alc295_fixup_disable_dac3,
8301 	},
8302 	[ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8303 		.type = HDA_FIXUP_FUNC,
8304 		.v.func = alc285_fixup_speaker2_to_dac1,
8305 		.chained = true,
8306 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8307 	},
8308 	[ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8309 		.type = HDA_FIXUP_FUNC,
8310 		.v.func = alc285_fixup_speaker2_to_dac1,
8311 		.chained = true,
8312 		.chain_id = ALC245_FIXUP_CS35L41_SPI_2
8313 	},
8314 	[ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8315 		.type = HDA_FIXUP_PINS,
8316 		.v.pins = (const struct hda_pintbl[]) {
8317 			{ 0x19, 0x03a11050 },
8318 			{ 0x1b, 0x03a11c30 },
8319 			{ }
8320 		},
8321 		.chained = true,
8322 		.chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8323 	},
8324 	[ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8325 		.type = HDA_FIXUP_PINS,
8326 		.v.pins = (const struct hda_pintbl[]) {
8327 			{ 0x14, 0x90170120 },
8328 			{ }
8329 		},
8330 		.chained = true,
8331 		.chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8332 	},
8333 	[ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8334 		.type = HDA_FIXUP_FUNC,
8335 		.v.func = alc285_fixup_speaker2_to_dac1,
8336 		.chained = true,
8337 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2
8338 	},
8339 	[ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8340 		.type = HDA_FIXUP_PINS,
8341 		.v.pins = (const struct hda_pintbl[]) {
8342 			{ 0x19, 0x03a11050 },
8343 			{ 0x1b, 0x03a11c30 },
8344 			{ }
8345 		},
8346 		.chained = true,
8347 		.chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8348 	},
8349 	[ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8350 		.type = HDA_FIXUP_PINS,
8351 		.v.pins = (const struct hda_pintbl[]) {
8352 			{ 0x1b, 0x90170151 },
8353 			{ }
8354 		},
8355 		.chained = true,
8356 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8357 	},
8358 	[ALC269_FIXUP_ATIV_BOOK_8] = {
8359 		.type = HDA_FIXUP_FUNC,
8360 		.v.func = alc_fixup_auto_mute_via_amp,
8361 		.chained = true,
8362 		.chain_id = ALC269_FIXUP_NO_SHUTUP
8363 	},
8364 	[ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8365 		.type = HDA_FIXUP_PINS,
8366 		.v.pins = (const struct hda_pintbl[]) {
8367 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8368 			{ 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8369 			{ }
8370 		},
8371 		.chained = true,
8372 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8373 	},
8374 	[ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8375 		.type = HDA_FIXUP_PINS,
8376 		.v.pins = (const struct hda_pintbl[]) {
8377 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8378 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8379 			{ }
8380 		},
8381 		.chained = true,
8382 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8383 	},
8384 	[ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8385 		.type = HDA_FIXUP_FUNC,
8386 		.v.func = alc_fixup_headset_mode,
8387 	},
8388 	[ALC256_FIXUP_ASUS_MIC] = {
8389 		.type = HDA_FIXUP_PINS,
8390 		.v.pins = (const struct hda_pintbl[]) {
8391 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8392 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8393 			{ }
8394 		},
8395 		.chained = true,
8396 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8397 	},
8398 	[ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8399 		.type = HDA_FIXUP_FUNC,
8400 		/* Set up GPIO2 for the speaker amp */
8401 		.v.func = alc_fixup_gpio4,
8402 	},
8403 	[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8404 		.type = HDA_FIXUP_PINS,
8405 		.v.pins = (const struct hda_pintbl[]) {
8406 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8407 			{ }
8408 		},
8409 		.chained = true,
8410 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8411 	},
8412 	[ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8413 		.type = HDA_FIXUP_VERBS,
8414 		.v.verbs = (const struct hda_verb[]) {
8415 			/* Enables internal speaker */
8416 			{0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8417 			{0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8418 			{}
8419 		},
8420 		.chained = true,
8421 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8422 	},
8423 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8424 		.type = HDA_FIXUP_FUNC,
8425 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8426 		.chained = true,
8427 		.chain_id = ALC269_FIXUP_GPIO2
8428 	},
8429 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
8430 		.type = HDA_FIXUP_VERBS,
8431 		.v.verbs = (const struct hda_verb[]) {
8432 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8433 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8434 			{ }
8435 		},
8436 		.chained = true,
8437 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8438 	},
8439 	[ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8440 		.type = HDA_FIXUP_PINS,
8441 		.v.pins = (const struct hda_pintbl[]) {
8442 			/* Change the mic location from front to right, otherwise there are
8443 			   two front mics with the same name, pulseaudio can't handle them.
8444 			   This is just a temporary workaround, after applying this fixup,
8445 			   there will be one "Front Mic" and one "Mic" in this machine.
8446 			 */
8447 			{ 0x1a, 0x04a19040 },
8448 			{ }
8449 		},
8450 	},
8451 	[ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8452 		.type = HDA_FIXUP_PINS,
8453 		.v.pins = (const struct hda_pintbl[]) {
8454 			{ 0x16, 0x0101102f }, /* Rear Headset HP */
8455 			{ 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8456 			{ 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8457 			{ 0x1b, 0x02011020 },
8458 			{ }
8459 		},
8460 		.chained = true,
8461 		.chain_id = ALC225_FIXUP_S3_POP_NOISE
8462 	},
8463 	[ALC225_FIXUP_S3_POP_NOISE] = {
8464 		.type = HDA_FIXUP_FUNC,
8465 		.v.func = alc225_fixup_s3_pop_noise,
8466 		.chained = true,
8467 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8468 	},
8469 	[ALC700_FIXUP_INTEL_REFERENCE] = {
8470 		.type = HDA_FIXUP_VERBS,
8471 		.v.verbs = (const struct hda_verb[]) {
8472 			/* Enables internal speaker */
8473 			{0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8474 			{0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8475 			{0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8476 			{0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8477 			{0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8478 			{0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8479 			{0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8480 			{0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8481 			{}
8482 		}
8483 	},
8484 	[ALC274_FIXUP_DELL_BIND_DACS] = {
8485 		.type = HDA_FIXUP_FUNC,
8486 		.v.func = alc274_fixup_bind_dacs,
8487 		.chained = true,
8488 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8489 	},
8490 	[ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8491 		.type = HDA_FIXUP_PINS,
8492 		.v.pins = (const struct hda_pintbl[]) {
8493 			{ 0x1b, 0x0401102f },
8494 			{ }
8495 		},
8496 		.chained = true,
8497 		.chain_id = ALC274_FIXUP_DELL_BIND_DACS
8498 	},
8499 	[ALC298_FIXUP_TPT470_DOCK_FIX] = {
8500 		.type = HDA_FIXUP_FUNC,
8501 		.v.func = alc_fixup_tpt470_dock,
8502 		.chained = true,
8503 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8504 	},
8505 	[ALC298_FIXUP_TPT470_DOCK] = {
8506 		.type = HDA_FIXUP_FUNC,
8507 		.v.func = alc_fixup_tpt470_dacs,
8508 		.chained = true,
8509 		.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8510 	},
8511 	[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8512 		.type = HDA_FIXUP_PINS,
8513 		.v.pins = (const struct hda_pintbl[]) {
8514 			{ 0x14, 0x0201101f },
8515 			{ }
8516 		},
8517 		.chained = true,
8518 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8519 	},
8520 	[ALC255_FIXUP_DELL_HEADSET_MIC] = {
8521 		.type = HDA_FIXUP_PINS,
8522 		.v.pins = (const struct hda_pintbl[]) {
8523 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8524 			{ }
8525 		},
8526 		.chained = true,
8527 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8528 	},
8529 	[ALC295_FIXUP_HP_X360] = {
8530 		.type = HDA_FIXUP_FUNC,
8531 		.v.func = alc295_fixup_hp_top_speakers,
8532 		.chained = true,
8533 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8534 	},
8535 	[ALC221_FIXUP_HP_HEADSET_MIC] = {
8536 		.type = HDA_FIXUP_PINS,
8537 		.v.pins = (const struct hda_pintbl[]) {
8538 			{ 0x19, 0x0181313f},
8539 			{ }
8540 		},
8541 		.chained = true,
8542 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8543 	},
8544 	[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8545 		.type = HDA_FIXUP_FUNC,
8546 		.v.func = alc285_fixup_invalidate_dacs,
8547 		.chained = true,
8548 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8549 	},
8550 	[ALC295_FIXUP_HP_AUTO_MUTE] = {
8551 		.type = HDA_FIXUP_FUNC,
8552 		.v.func = alc_fixup_auto_mute_via_amp,
8553 	},
8554 	[ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8555 		.type = HDA_FIXUP_PINS,
8556 		.v.pins = (const struct hda_pintbl[]) {
8557 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8558 			{ }
8559 		},
8560 		.chained = true,
8561 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8562 	},
8563 	[ALC294_FIXUP_ASUS_MIC] = {
8564 		.type = HDA_FIXUP_PINS,
8565 		.v.pins = (const struct hda_pintbl[]) {
8566 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8567 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8568 			{ }
8569 		},
8570 		.chained = true,
8571 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8572 	},
8573 	[ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8574 		.type = HDA_FIXUP_PINS,
8575 		.v.pins = (const struct hda_pintbl[]) {
8576 			{ 0x19, 0x01a1103c }, /* use as headset mic */
8577 			{ }
8578 		},
8579 		.chained = true,
8580 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8581 	},
8582 	[ALC294_FIXUP_ASUS_SPK] = {
8583 		.type = HDA_FIXUP_VERBS,
8584 		.v.verbs = (const struct hda_verb[]) {
8585 			/* Set EAPD high */
8586 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8587 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8588 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8589 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8590 			{ }
8591 		},
8592 		.chained = true,
8593 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8594 	},
8595 	[ALC295_FIXUP_CHROME_BOOK] = {
8596 		.type = HDA_FIXUP_FUNC,
8597 		.v.func = alc295_fixup_chromebook,
8598 		.chained = true,
8599 		.chain_id = ALC225_FIXUP_HEADSET_JACK
8600 	},
8601 	[ALC225_FIXUP_HEADSET_JACK] = {
8602 		.type = HDA_FIXUP_FUNC,
8603 		.v.func = alc_fixup_headset_jack,
8604 	},
8605 	[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8606 		.type = HDA_FIXUP_PINS,
8607 		.v.pins = (const struct hda_pintbl[]) {
8608 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8609 			{ }
8610 		},
8611 		.chained = true,
8612 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8613 	},
8614 	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8615 		.type = HDA_FIXUP_VERBS,
8616 		.v.verbs = (const struct hda_verb[]) {
8617 			/* Disable PCBEEP-IN passthrough */
8618 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8619 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8620 			{ }
8621 		},
8622 		.chained = true,
8623 		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8624 	},
8625 	[ALC255_FIXUP_ACER_HEADSET_MIC] = {
8626 		.type = HDA_FIXUP_PINS,
8627 		.v.pins = (const struct hda_pintbl[]) {
8628 			{ 0x19, 0x03a11130 },
8629 			{ 0x1a, 0x90a60140 }, /* use as internal mic */
8630 			{ }
8631 		},
8632 		.chained = true,
8633 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8634 	},
8635 	[ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8636 		.type = HDA_FIXUP_PINS,
8637 		.v.pins = (const struct hda_pintbl[]) {
8638 			{ 0x16, 0x01011020 }, /* Rear Line out */
8639 			{ 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8640 			{ }
8641 		},
8642 		.chained = true,
8643 		.chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8644 	},
8645 	[ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8646 		.type = HDA_FIXUP_FUNC,
8647 		.v.func = alc_fixup_auto_mute_via_amp,
8648 		.chained = true,
8649 		.chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8650 	},
8651 	[ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8652 		.type = HDA_FIXUP_FUNC,
8653 		.v.func = alc_fixup_disable_mic_vref,
8654 		.chained = true,
8655 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8656 	},
8657 	[ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8658 		.type = HDA_FIXUP_VERBS,
8659 		.v.verbs = (const struct hda_verb[]) {
8660 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8661 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8662 			{ }
8663 		},
8664 		.chained = true,
8665 		.chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8666 	},
8667 	[ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8668 		.type = HDA_FIXUP_PINS,
8669 		.v.pins = (const struct hda_pintbl[]) {
8670 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8671 			{ }
8672 		},
8673 		.chained = true,
8674 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8675 	},
8676 	[ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8677 		.type = HDA_FIXUP_PINS,
8678 		.v.pins = (const struct hda_pintbl[]) {
8679 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8680 			{ }
8681 		},
8682 		.chained = true,
8683 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8684 	},
8685 	[ALC299_FIXUP_PREDATOR_SPK] = {
8686 		.type = HDA_FIXUP_PINS,
8687 		.v.pins = (const struct hda_pintbl[]) {
8688 			{ 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8689 			{ }
8690 		}
8691 	},
8692 	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8693 		.type = HDA_FIXUP_PINS,
8694 		.v.pins = (const struct hda_pintbl[]) {
8695 			{ 0x19, 0x04a11040 },
8696 			{ 0x21, 0x04211020 },
8697 			{ }
8698 		},
8699 		.chained = true,
8700 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8701 	},
8702 	[ALC289_FIXUP_DELL_SPK1] = {
8703 		.type = HDA_FIXUP_PINS,
8704 		.v.pins = (const struct hda_pintbl[]) {
8705 			{ 0x14, 0x90170140 },
8706 			{ }
8707 		},
8708 		.chained = true,
8709 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8710 	},
8711 	[ALC289_FIXUP_DELL_SPK2] = {
8712 		.type = HDA_FIXUP_PINS,
8713 		.v.pins = (const struct hda_pintbl[]) {
8714 			{ 0x17, 0x90170130 }, /* bass spk */
8715 			{ }
8716 		},
8717 		.chained = true,
8718 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8719 	},
8720 	[ALC289_FIXUP_DUAL_SPK] = {
8721 		.type = HDA_FIXUP_FUNC,
8722 		.v.func = alc285_fixup_speaker2_to_dac1,
8723 		.chained = true,
8724 		.chain_id = ALC289_FIXUP_DELL_SPK2
8725 	},
8726 	[ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
8727 		.type = HDA_FIXUP_FUNC,
8728 		.v.func = alc285_fixup_speaker2_to_dac1,
8729 		.chained = true,
8730 		.chain_id = ALC289_FIXUP_DELL_SPK1
8731 	},
8732 	[ALC294_FIXUP_SPK2_TO_DAC1] = {
8733 		.type = HDA_FIXUP_FUNC,
8734 		.v.func = alc285_fixup_speaker2_to_dac1,
8735 		.chained = true,
8736 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8737 	},
8738 	[ALC294_FIXUP_ASUS_DUAL_SPK] = {
8739 		.type = HDA_FIXUP_FUNC,
8740 		/* The GPIO must be pulled to initialize the AMP */
8741 		.v.func = alc_fixup_gpio4,
8742 		.chained = true,
8743 		.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8744 	},
8745 	[ALC294_FIXUP_ASUS_ALLY] = {
8746 		.type = HDA_FIXUP_FUNC,
8747 		.v.func = cs35l41_fixup_i2c_two,
8748 		.chained = true,
8749 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8750 	},
8751 	[ALC294_FIXUP_ASUS_ALLY_PINS] = {
8752 		.type = HDA_FIXUP_PINS,
8753 		.v.pins = (const struct hda_pintbl[]) {
8754 			{ 0x19, 0x03a11050 },
8755 			{ 0x1a, 0x03a11c30 },
8756 			{ 0x21, 0x03211420 },
8757 			{ }
8758 		},
8759 		.chained = true,
8760 		.chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8761 	},
8762 	[ALC294_FIXUP_ASUS_ALLY_VERBS] = {
8763 		.type = HDA_FIXUP_VERBS,
8764 		.v.verbs = (const struct hda_verb[]) {
8765 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8766 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8767 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
8768 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
8769 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
8770 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
8771 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
8772 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
8773 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
8774 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
8775 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
8776 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
8777 			{ }
8778 		},
8779 		.chained = true,
8780 		.chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
8781 	},
8782 	[ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
8783 		.type = HDA_FIXUP_FUNC,
8784 		.v.func = alc285_fixup_speaker2_to_dac1,
8785 	},
8786 	[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8787 		.type = HDA_FIXUP_FUNC,
8788 		.v.func = alc285_fixup_thinkpad_x1_gen7,
8789 		.chained = true,
8790 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8791 	},
8792 	[ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8793 		.type = HDA_FIXUP_FUNC,
8794 		.v.func = alc_fixup_headset_jack,
8795 		.chained = true,
8796 		.chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8797 	},
8798 	[ALC294_FIXUP_ASUS_HPE] = {
8799 		.type = HDA_FIXUP_VERBS,
8800 		.v.verbs = (const struct hda_verb[]) {
8801 			/* Set EAPD high */
8802 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8803 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8804 			{ }
8805 		},
8806 		.chained = true,
8807 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8808 	},
8809 	[ALC294_FIXUP_ASUS_GX502_PINS] = {
8810 		.type = HDA_FIXUP_PINS,
8811 		.v.pins = (const struct hda_pintbl[]) {
8812 			{ 0x19, 0x03a11050 }, /* front HP mic */
8813 			{ 0x1a, 0x01a11830 }, /* rear external mic */
8814 			{ 0x21, 0x03211020 }, /* front HP out */
8815 			{ }
8816 		},
8817 		.chained = true,
8818 		.chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8819 	},
8820 	[ALC294_FIXUP_ASUS_GX502_VERBS] = {
8821 		.type = HDA_FIXUP_VERBS,
8822 		.v.verbs = (const struct hda_verb[]) {
8823 			/* set 0x15 to HP-OUT ctrl */
8824 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8825 			/* unmute the 0x15 amp */
8826 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8827 			{ }
8828 		},
8829 		.chained = true,
8830 		.chain_id = ALC294_FIXUP_ASUS_GX502_HP
8831 	},
8832 	[ALC294_FIXUP_ASUS_GX502_HP] = {
8833 		.type = HDA_FIXUP_FUNC,
8834 		.v.func = alc294_fixup_gx502_hp,
8835 	},
8836 	[ALC294_FIXUP_ASUS_GU502_PINS] = {
8837 		.type = HDA_FIXUP_PINS,
8838 		.v.pins = (const struct hda_pintbl[]) {
8839 			{ 0x19, 0x01a11050 }, /* rear HP mic */
8840 			{ 0x1a, 0x01a11830 }, /* rear external mic */
8841 			{ 0x21, 0x012110f0 }, /* rear HP out */
8842 			{ }
8843 		},
8844 		.chained = true,
8845 		.chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8846 	},
8847 	[ALC294_FIXUP_ASUS_GU502_VERBS] = {
8848 		.type = HDA_FIXUP_VERBS,
8849 		.v.verbs = (const struct hda_verb[]) {
8850 			/* set 0x15 to HP-OUT ctrl */
8851 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8852 			/* unmute the 0x15 amp */
8853 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8854 			/* set 0x1b to HP-OUT */
8855 			{ 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8856 			{ }
8857 		},
8858 		.chained = true,
8859 		.chain_id = ALC294_FIXUP_ASUS_GU502_HP
8860 	},
8861 	[ALC294_FIXUP_ASUS_GU502_HP] = {
8862 		.type = HDA_FIXUP_FUNC,
8863 		.v.func = alc294_fixup_gu502_hp,
8864 	},
8865 	 [ALC294_FIXUP_ASUS_G513_PINS] = {
8866 		.type = HDA_FIXUP_PINS,
8867 		.v.pins = (const struct hda_pintbl[]) {
8868 				{ 0x19, 0x03a11050 }, /* front HP mic */
8869 				{ 0x1a, 0x03a11c30 }, /* rear external mic */
8870 				{ 0x21, 0x03211420 }, /* front HP out */
8871 				{ }
8872 		},
8873 	},
8874 	[ALC285_FIXUP_ASUS_G533Z_PINS] = {
8875 		.type = HDA_FIXUP_PINS,
8876 		.v.pins = (const struct hda_pintbl[]) {
8877 			{ 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8878 			{ 0x19, 0x03a19020 }, /* Mic Boost Volume */
8879 			{ 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8880 			{ 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8881 			{ 0x21, 0x03211420 },
8882 			{ }
8883 		},
8884 	},
8885 	[ALC294_FIXUP_ASUS_COEF_1B] = {
8886 		.type = HDA_FIXUP_VERBS,
8887 		.v.verbs = (const struct hda_verb[]) {
8888 			/* Set bit 10 to correct noisy output after reboot from
8889 			 * Windows 10 (due to pop noise reduction?)
8890 			 */
8891 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8892 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8893 			{ }
8894 		},
8895 		.chained = true,
8896 		.chain_id = ALC289_FIXUP_ASUS_GA401,
8897 	},
8898 	[ALC285_FIXUP_HP_GPIO_LED] = {
8899 		.type = HDA_FIXUP_FUNC,
8900 		.v.func = alc285_fixup_hp_gpio_led,
8901 	},
8902 	[ALC285_FIXUP_HP_MUTE_LED] = {
8903 		.type = HDA_FIXUP_FUNC,
8904 		.v.func = alc285_fixup_hp_mute_led,
8905 	},
8906 	[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8907 		.type = HDA_FIXUP_FUNC,
8908 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
8909 	},
8910 	[ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
8911 	    .type = HDA_FIXUP_FUNC,
8912 	    .v.func = alc236_fixup_hp_mute_led_coefbit2,
8913 	},
8914 	[ALC236_FIXUP_HP_GPIO_LED] = {
8915 		.type = HDA_FIXUP_FUNC,
8916 		.v.func = alc236_fixup_hp_gpio_led,
8917 	},
8918 	[ALC236_FIXUP_HP_MUTE_LED] = {
8919 		.type = HDA_FIXUP_FUNC,
8920 		.v.func = alc236_fixup_hp_mute_led,
8921 	},
8922 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8923 		.type = HDA_FIXUP_FUNC,
8924 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
8925 	},
8926 	[ALC236_FIXUP_LENOVO_INV_DMIC] = {
8927 		.type = HDA_FIXUP_FUNC,
8928 		.v.func = alc_fixup_inv_dmic,
8929 		.chained = true,
8930 		.chain_id = ALC283_FIXUP_INT_MIC,
8931 	},
8932 	[ALC298_FIXUP_SAMSUNG_AMP] = {
8933 		.type = HDA_FIXUP_FUNC,
8934 		.v.func = alc298_fixup_samsung_amp,
8935 		.chained = true,
8936 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8937 	},
8938 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8939 		.type = HDA_FIXUP_VERBS,
8940 		.v.verbs = (const struct hda_verb[]) {
8941 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8942 			{ }
8943 		},
8944 	},
8945 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8946 		.type = HDA_FIXUP_VERBS,
8947 		.v.verbs = (const struct hda_verb[]) {
8948 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8949 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8950 			{ }
8951 		},
8952 	},
8953 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8954 		.type = HDA_FIXUP_PINS,
8955 		.v.pins = (const struct hda_pintbl[]) {
8956 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8957 			{ }
8958 		},
8959 		.chained = true,
8960 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8961 	},
8962 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8963 		.type = HDA_FIXUP_PINS,
8964 		.v.pins = (const struct hda_pintbl[]) {
8965 			{ 0x14, 0x90100120 }, /* use as internal speaker */
8966 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8967 			{ 0x1a, 0x01011020 }, /* use as line out */
8968 			{ },
8969 		},
8970 		.chained = true,
8971 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8972 	},
8973 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8974 		.type = HDA_FIXUP_PINS,
8975 		.v.pins = (const struct hda_pintbl[]) {
8976 			{ 0x18, 0x02a11030 }, /* use as headset mic */
8977 			{ }
8978 		},
8979 		.chained = true,
8980 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8981 	},
8982 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8983 		.type = HDA_FIXUP_PINS,
8984 		.v.pins = (const struct hda_pintbl[]) {
8985 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8986 			{ }
8987 		},
8988 		.chained = true,
8989 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8990 	},
8991 	[ALC289_FIXUP_ASUS_GA401] = {
8992 		.type = HDA_FIXUP_FUNC,
8993 		.v.func = alc289_fixup_asus_ga401,
8994 		.chained = true,
8995 		.chain_id = ALC289_FIXUP_ASUS_GA502,
8996 	},
8997 	[ALC289_FIXUP_ASUS_GA502] = {
8998 		.type = HDA_FIXUP_PINS,
8999 		.v.pins = (const struct hda_pintbl[]) {
9000 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
9001 			{ }
9002 		},
9003 	},
9004 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9005 		.type = HDA_FIXUP_PINS,
9006 		.v.pins = (const struct hda_pintbl[]) {
9007 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9008 			{ }
9009 		},
9010 		.chained = true,
9011 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9012 	},
9013 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9014 		.type = HDA_FIXUP_FUNC,
9015 		.v.func = alc285_fixup_hp_gpio_amp_init,
9016 		.chained = true,
9017 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
9018 	},
9019 	[ALC269_FIXUP_CZC_B20] = {
9020 		.type = HDA_FIXUP_PINS,
9021 		.v.pins = (const struct hda_pintbl[]) {
9022 			{ 0x12, 0x411111f0 },
9023 			{ 0x14, 0x90170110 }, /* speaker */
9024 			{ 0x15, 0x032f1020 }, /* HP out */
9025 			{ 0x17, 0x411111f0 },
9026 			{ 0x18, 0x03ab1040 }, /* mic */
9027 			{ 0x19, 0xb7a7013f },
9028 			{ 0x1a, 0x0181305f },
9029 			{ 0x1b, 0x411111f0 },
9030 			{ 0x1d, 0x411111f0 },
9031 			{ 0x1e, 0x411111f0 },
9032 			{ }
9033 		},
9034 		.chain_id = ALC269_FIXUP_DMIC,
9035 	},
9036 	[ALC269_FIXUP_CZC_TMI] = {
9037 		.type = HDA_FIXUP_PINS,
9038 		.v.pins = (const struct hda_pintbl[]) {
9039 			{ 0x12, 0x4000c000 },
9040 			{ 0x14, 0x90170110 }, /* speaker */
9041 			{ 0x15, 0x0421401f }, /* HP out */
9042 			{ 0x17, 0x411111f0 },
9043 			{ 0x18, 0x04a19020 }, /* mic */
9044 			{ 0x19, 0x411111f0 },
9045 			{ 0x1a, 0x411111f0 },
9046 			{ 0x1b, 0x411111f0 },
9047 			{ 0x1d, 0x40448505 },
9048 			{ 0x1e, 0x411111f0 },
9049 			{ 0x20, 0x8000ffff },
9050 			{ }
9051 		},
9052 		.chain_id = ALC269_FIXUP_DMIC,
9053 	},
9054 	[ALC269_FIXUP_CZC_L101] = {
9055 		.type = HDA_FIXUP_PINS,
9056 		.v.pins = (const struct hda_pintbl[]) {
9057 			{ 0x12, 0x40000000 },
9058 			{ 0x14, 0x01014010 }, /* speaker */
9059 			{ 0x15, 0x411111f0 }, /* HP out */
9060 			{ 0x16, 0x411111f0 },
9061 			{ 0x18, 0x01a19020 }, /* mic */
9062 			{ 0x19, 0x02a19021 },
9063 			{ 0x1a, 0x0181302f },
9064 			{ 0x1b, 0x0221401f },
9065 			{ 0x1c, 0x411111f0 },
9066 			{ 0x1d, 0x4044c601 },
9067 			{ 0x1e, 0x411111f0 },
9068 			{ }
9069 		},
9070 		.chain_id = ALC269_FIXUP_DMIC,
9071 	},
9072 	[ALC269_FIXUP_LEMOTE_A1802] = {
9073 		.type = HDA_FIXUP_PINS,
9074 		.v.pins = (const struct hda_pintbl[]) {
9075 			{ 0x12, 0x40000000 },
9076 			{ 0x14, 0x90170110 }, /* speaker */
9077 			{ 0x17, 0x411111f0 },
9078 			{ 0x18, 0x03a19040 }, /* mic1 */
9079 			{ 0x19, 0x90a70130 }, /* mic2 */
9080 			{ 0x1a, 0x411111f0 },
9081 			{ 0x1b, 0x411111f0 },
9082 			{ 0x1d, 0x40489d2d },
9083 			{ 0x1e, 0x411111f0 },
9084 			{ 0x20, 0x0003ffff },
9085 			{ 0x21, 0x03214020 },
9086 			{ }
9087 		},
9088 		.chain_id = ALC269_FIXUP_DMIC,
9089 	},
9090 	[ALC269_FIXUP_LEMOTE_A190X] = {
9091 		.type = HDA_FIXUP_PINS,
9092 		.v.pins = (const struct hda_pintbl[]) {
9093 			{ 0x14, 0x99130110 }, /* speaker */
9094 			{ 0x15, 0x0121401f }, /* HP out */
9095 			{ 0x18, 0x01a19c20 }, /* rear  mic */
9096 			{ 0x19, 0x99a3092f }, /* front mic */
9097 			{ 0x1b, 0x0201401f }, /* front lineout */
9098 			{ }
9099 		},
9100 		.chain_id = ALC269_FIXUP_DMIC,
9101 	},
9102 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9103 		.type = HDA_FIXUP_PINS,
9104 		.v.pins = (const struct hda_pintbl[]) {
9105 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9106 			{ }
9107 		},
9108 		.chained = true,
9109 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9110 	},
9111 	[ALC256_FIXUP_INTEL_NUC10] = {
9112 		.type = HDA_FIXUP_PINS,
9113 		.v.pins = (const struct hda_pintbl[]) {
9114 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9115 			{ }
9116 		},
9117 		.chained = true,
9118 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9119 	},
9120 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9121 		.type = HDA_FIXUP_VERBS,
9122 		.v.verbs = (const struct hda_verb[]) {
9123 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9124 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9125 			{ }
9126 		},
9127 		.chained = true,
9128 		.chain_id = ALC289_FIXUP_ASUS_GA502
9129 	},
9130 	[ALC274_FIXUP_HP_MIC] = {
9131 		.type = HDA_FIXUP_VERBS,
9132 		.v.verbs = (const struct hda_verb[]) {
9133 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9134 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9135 			{ }
9136 		},
9137 	},
9138 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
9139 		.type = HDA_FIXUP_FUNC,
9140 		.v.func = alc274_fixup_hp_headset_mic,
9141 		.chained = true,
9142 		.chain_id = ALC274_FIXUP_HP_MIC
9143 	},
9144 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
9145 		.type = HDA_FIXUP_FUNC,
9146 		.v.func = alc274_fixup_hp_envy_gpio,
9147 	},
9148 	[ALC256_FIXUP_ASUS_HPE] = {
9149 		.type = HDA_FIXUP_VERBS,
9150 		.v.verbs = (const struct hda_verb[]) {
9151 			/* Set EAPD high */
9152 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9153 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9154 			{ }
9155 		},
9156 		.chained = true,
9157 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9158 	},
9159 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9160 		.type = HDA_FIXUP_FUNC,
9161 		.v.func = alc_fixup_headset_jack,
9162 		.chained = true,
9163 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9164 	},
9165 	[ALC287_FIXUP_HP_GPIO_LED] = {
9166 		.type = HDA_FIXUP_FUNC,
9167 		.v.func = alc287_fixup_hp_gpio_led,
9168 	},
9169 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
9170 		.type = HDA_FIXUP_FUNC,
9171 		.v.func = alc274_fixup_hp_headset_mic,
9172 	},
9173 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9174 		.type = HDA_FIXUP_FUNC,
9175 		.v.func = alc_fixup_no_int_mic,
9176 		.chained = true,
9177 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9178 	},
9179 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9180 		.type = HDA_FIXUP_PINS,
9181 		.v.pins = (const struct hda_pintbl[]) {
9182 			{ 0x1b, 0x411111f0 },
9183 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9184 			{ },
9185 		},
9186 		.chained = true,
9187 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9188 	},
9189 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9190 		.type = HDA_FIXUP_FUNC,
9191 		.v.func = alc269_fixup_limit_int_mic_boost,
9192 		.chained = true,
9193 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9194 	},
9195 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
9196 		.type = HDA_FIXUP_PINS,
9197 		.v.pins = (const struct hda_pintbl[]) {
9198 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9199 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
9200 			{ }
9201 		},
9202 		.chained = true,
9203 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9204 	},
9205 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9206 		.type = HDA_FIXUP_FUNC,
9207 		.v.func = alc285_fixup_ideapad_s740_coef,
9208 		.chained = true,
9209 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9210 	},
9211 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9212 		.type = HDA_FIXUP_FUNC,
9213 		.v.func = alc269_fixup_limit_int_mic_boost,
9214 		.chained = true,
9215 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9216 	},
9217 	[ALC295_FIXUP_ASUS_DACS] = {
9218 		.type = HDA_FIXUP_FUNC,
9219 		.v.func = alc295_fixup_asus_dacs,
9220 	},
9221 	[ALC295_FIXUP_HP_OMEN] = {
9222 		.type = HDA_FIXUP_PINS,
9223 		.v.pins = (const struct hda_pintbl[]) {
9224 			{ 0x12, 0xb7a60130 },
9225 			{ 0x13, 0x40000000 },
9226 			{ 0x14, 0x411111f0 },
9227 			{ 0x16, 0x411111f0 },
9228 			{ 0x17, 0x90170110 },
9229 			{ 0x18, 0x411111f0 },
9230 			{ 0x19, 0x02a11030 },
9231 			{ 0x1a, 0x411111f0 },
9232 			{ 0x1b, 0x04a19030 },
9233 			{ 0x1d, 0x40600001 },
9234 			{ 0x1e, 0x411111f0 },
9235 			{ 0x21, 0x03211020 },
9236 			{}
9237 		},
9238 		.chained = true,
9239 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9240 	},
9241 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
9242 		.type = HDA_FIXUP_FUNC,
9243 		.v.func = alc285_fixup_hp_spectre_x360,
9244 	},
9245 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9246 		.type = HDA_FIXUP_FUNC,
9247 		.v.func = alc285_fixup_hp_spectre_x360_eb1
9248 	},
9249 	[ALC285_FIXUP_HP_ENVY_X360] = {
9250 		.type = HDA_FIXUP_FUNC,
9251 		.v.func = alc285_fixup_hp_envy_x360,
9252 		.chained = true,
9253 		.chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9254 	},
9255 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9256 		.type = HDA_FIXUP_FUNC,
9257 		.v.func = alc285_fixup_ideapad_s740_coef,
9258 		.chained = true,
9259 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9260 	},
9261 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9262 		.type = HDA_FIXUP_FUNC,
9263 		.v.func = alc_fixup_no_shutup,
9264 		.chained = true,
9265 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
9266 	},
9267 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9268 		.type = HDA_FIXUP_PINS,
9269 		.v.pins = (const struct hda_pintbl[]) {
9270 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9271 			{ }
9272 		},
9273 		.chained = true,
9274 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9275 	},
9276 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9277 		.type = HDA_FIXUP_FUNC,
9278 		.v.func = alc269_fixup_limit_int_mic_boost,
9279 		.chained = true,
9280 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9281 	},
9282 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9283 		.type = HDA_FIXUP_FUNC,
9284 		.v.func = alc285_fixup_ideapad_s740_coef,
9285 		.chained = true,
9286 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9287 	},
9288 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9289 		.type = HDA_FIXUP_FUNC,
9290 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9291 		.chained = true,
9292 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9293 	},
9294 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9295 		.type = HDA_FIXUP_VERBS,
9296 		//.v.verbs = legion_15imhg05_coefs,
9297 		.v.verbs = (const struct hda_verb[]) {
9298 			 // set left speaker Legion 7i.
9299 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9300 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9301 
9302 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9303 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9304 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9305 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9306 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9307 
9308 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9309 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9310 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9311 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9312 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9313 
9314 			 // set right speaker Legion 7i.
9315 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9316 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9317 
9318 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9319 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9320 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9321 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9322 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9323 
9324 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9325 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9326 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9327 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9328 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9329 			 {}
9330 		},
9331 		.chained = true,
9332 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9333 	},
9334 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9335 		.type = HDA_FIXUP_FUNC,
9336 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9337 		.chained = true,
9338 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9339 	},
9340 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9341 		.type = HDA_FIXUP_VERBS,
9342 		.v.verbs = (const struct hda_verb[]) {
9343 			 // set left speaker Yoga 7i.
9344 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9345 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9346 
9347 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9348 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9349 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9350 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9351 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9352 
9353 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9354 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9355 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9356 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9357 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9358 
9359 			 // set right speaker Yoga 7i.
9360 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9361 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9362 
9363 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9364 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9365 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9366 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9367 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9368 
9369 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9370 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9371 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9372 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9373 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9374 			 {}
9375 		},
9376 		.chained = true,
9377 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9378 	},
9379 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9380 		.type = HDA_FIXUP_FUNC,
9381 		.v.func = alc298_fixup_lenovo_c940_duet7,
9382 	},
9383 	[ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9384 		.type = HDA_FIXUP_FUNC,
9385 		.v.func = alc287_fixup_lenovo_14irp8_duetitl,
9386 	},
9387 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9388 		.type = HDA_FIXUP_VERBS,
9389 		.v.verbs = (const struct hda_verb[]) {
9390 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9391 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9392 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9393 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9394 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9395 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9396 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9397 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9398 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9399 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9400 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9401 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9402 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9403 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9404 			{}
9405 		},
9406 		.chained = true,
9407 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9408 	},
9409 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9410 		.type = HDA_FIXUP_FUNC,
9411 		.v.func = alc256_fixup_set_coef_defaults,
9412 	},
9413 	[ALC245_FIXUP_HP_GPIO_LED] = {
9414 		.type = HDA_FIXUP_FUNC,
9415 		.v.func = alc245_fixup_hp_gpio_led,
9416 	},
9417 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9418 		.type = HDA_FIXUP_PINS,
9419 		.v.pins = (const struct hda_pintbl[]) {
9420 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9421 			{ }
9422 		},
9423 		.chained = true,
9424 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9425 	},
9426 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9427 		.type = HDA_FIXUP_FUNC,
9428 		.v.func = alc233_fixup_no_audio_jack,
9429 	},
9430 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9431 		.type = HDA_FIXUP_FUNC,
9432 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9433 		.chained = true,
9434 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9435 	},
9436 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9437 		.type = HDA_FIXUP_FUNC,
9438 		.v.func = alc287_fixup_legion_16achg6_speakers,
9439 	},
9440 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9441 		.type = HDA_FIXUP_FUNC,
9442 		.v.func = cs35l41_fixup_i2c_two,
9443 	},
9444 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9445 		.type = HDA_FIXUP_FUNC,
9446 		.v.func = cs35l41_fixup_i2c_two,
9447 		.chained = true,
9448 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9449 	},
9450 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9451 		.type = HDA_FIXUP_FUNC,
9452 		.v.func = cs35l41_fixup_spi_two,
9453 	},
9454 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9455 		.type = HDA_FIXUP_FUNC,
9456 		.v.func = cs35l41_fixup_spi_two,
9457 		.chained = true,
9458 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9459 	},
9460 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9461 		.type = HDA_FIXUP_FUNC,
9462 		.v.func = cs35l41_fixup_spi_four,
9463 	},
9464 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9465 		.type = HDA_FIXUP_FUNC,
9466 		.v.func = cs35l41_fixup_spi_four,
9467 		.chained = true,
9468 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9469 	},
9470 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9471 		.type = HDA_FIXUP_VERBS,
9472 		.v.verbs = (const struct hda_verb[]) {
9473 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9474 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9475 			 { }
9476 		},
9477 		.chained = true,
9478 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9479 	},
9480 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9481 		.type = HDA_FIXUP_FUNC,
9482 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9483 		.chained = true,
9484 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9485 	},
9486 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9487 		.type = HDA_FIXUP_PINS,
9488 		.v.pins = (const struct hda_pintbl[]) {
9489 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9490 			{ }
9491 		},
9492 		.chained = true,
9493 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9494 	},
9495 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9496 		.type = HDA_FIXUP_FUNC,
9497 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9498 	},
9499 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9500 		.type = HDA_FIXUP_VERBS,
9501 		.v.verbs = (const struct hda_verb[]) {
9502 			// enable left speaker
9503 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9504 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9505 
9506 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9507 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9508 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9509 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9510 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9511 
9512 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9513 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9514 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9515 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9516 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9517 
9518 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9519 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9520 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9521 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9522 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9523 
9524 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9525 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9526 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9527 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9528 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9529 
9530 			// enable right speaker
9531 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9532 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9533 
9534 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9535 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9536 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9537 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9538 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9539 
9540 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9541 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9542 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9543 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9544 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9545 
9546 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9547 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9548 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9549 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9550 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9551 
9552 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9553 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9554 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9555 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9556 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9557 
9558 			{ },
9559 		},
9560 	},
9561 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9562 		.type = HDA_FIXUP_FUNC,
9563 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9564 		.chained = true,
9565 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9566 	},
9567 	[ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9568 		.type = HDA_FIXUP_FUNC,
9569 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9570 		.chained = true,
9571 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9572 	},
9573 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9574 		.type = HDA_FIXUP_FUNC,
9575 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9576 		.chained = true,
9577 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9578 	},
9579 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9580 		.type = HDA_FIXUP_PINS,
9581 		.v.func = alc1220_fixup_gb_dual_codecs,
9582 		.chained = true,
9583 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9584 	},
9585 	[ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9586 		.type = HDA_FIXUP_FUNC,
9587 		.v.func = cs35l41_fixup_i2c_two,
9588 		.chained = true,
9589 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9590 	},
9591 	[ALC287_FIXUP_TAS2781_I2C] = {
9592 		.type = HDA_FIXUP_FUNC,
9593 		.v.func = tas2781_fixup_i2c,
9594 		.chained = true,
9595 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9596 	},
9597 	[ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9598 		.type = HDA_FIXUP_FUNC,
9599 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9600 	},
9601 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9602 		.type = HDA_FIXUP_FUNC,
9603 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9604 		.chained = true,
9605 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
9606 	},
9607 	[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9608 		.type = HDA_FIXUP_FUNC,
9609 		.v.func = alc287_fixup_bind_dacs,
9610 		.chained = true,
9611 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9612 	},
9613 	[ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9614 		.type = HDA_FIXUP_FUNC,
9615 		.v.func = alc287_fixup_bind_dacs,
9616 		.chained = true,
9617 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9618 	},
9619 	[ALC2XX_FIXUP_HEADSET_MIC] = {
9620 		.type = HDA_FIXUP_FUNC,
9621 		.v.func = alc_fixup_headset_mic,
9622 	},
9623 	[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9624 		.type = HDA_FIXUP_FUNC,
9625 		.v.func = cs35l41_fixup_spi_two,
9626 		.chained = true,
9627 		.chain_id = ALC289_FIXUP_DUAL_SPK
9628 	},
9629 	[ALC294_FIXUP_CS35L41_I2C_2] = {
9630 		.type = HDA_FIXUP_FUNC,
9631 		.v.func = cs35l41_fixup_i2c_two,
9632 	},
9633 };
9634 
9635 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
9636 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
9637 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9638 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
9639 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
9640 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9641 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9642 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
9643 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9644 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9645 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
9646 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9647 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
9648 	SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9649 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
9650 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
9651 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
9652 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
9653 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9654 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9655 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9656 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9657 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
9658 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
9659 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
9660 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
9661 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
9662 	SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9663 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9664 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9665 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9666 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
9667 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9668 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9669 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9670 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
9671 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
9672 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9673 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9674 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9675 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
9676 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9677 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
9678 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
9679 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
9680 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
9681 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
9682 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9683 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
9684 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
9685 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9686 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9687 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9688 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9689 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9690 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
9691 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
9692 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
9693 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9694 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9695 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
9696 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9697 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
9698 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9699 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9700 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9701 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9702 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9703 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9704 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9705 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9706 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9707 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
9708 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
9709 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
9710 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
9711 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9712 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
9713 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
9714 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9715 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9716 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9717 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9718 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
9719 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
9720 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
9721 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9722 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9723 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9724 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9725 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9726 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9727 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9728 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
9729 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
9730 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
9731 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
9732 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9733 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9734 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
9735 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
9736 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9737 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9738 	SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9739 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9740 	SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9741 	SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9742 	SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9743 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9744 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9745 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9746 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9747 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9748 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9749 	SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9750 	SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9751 	SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9752 	SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9753 	SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9754 	SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9755 	SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9756 	SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9757 	SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9758 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9759 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9760 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9761 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
9762 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
9763 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9764 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9765 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9766 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9767 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9768 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9769 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9770 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9771 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9772 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9773 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9774 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9775 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9776 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9777 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9778 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9779 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9780 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9781 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
9782 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
9783 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9784 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9785 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9786 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9787 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9788 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9789 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9790 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9791 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9792 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9793 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9794 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9795 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9796 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9797 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9798 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9799 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9800 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9801 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9802 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9803 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9804 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9805 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9806 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9807 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9808 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9809 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9810 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9811 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9812 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9813 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9814 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9815 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9816 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9817 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
9818 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9819 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9820 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9821 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9822 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
9823 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
9824 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
9825 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9826 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9827 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9828 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9829 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9830 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9831 	SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9832 	SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9833 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
9834 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9835 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
9836 	SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9837 	SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
9838 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9839 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9840 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9841 	SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9842 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
9843 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9844 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9845 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
9846 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9847 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9848 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9849 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9850 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9851 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9852 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9853 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9854 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9855 	SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
9856 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9857 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9858 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9859 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9860 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9861 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9862 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9863 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9864 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9865 	SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9866 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9867 	SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9868 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9869 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9870 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9871 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9872 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9873 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9874 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9875 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9876 	SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9877 	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9878 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9879 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9880 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9881 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9882 	SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9883 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9884 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9885 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9886 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9887 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9888 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9889 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9890 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9891 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9892 	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9893 	SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
9894 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9895 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9896 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9897 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9898 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9899 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
9900 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9901 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
9902 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9903 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9904 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9905 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9906 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9907 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9908 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9909 	SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
9910 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9911 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9912 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9913 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9914 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9915 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9916 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
9917 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9918 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
9919 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9920 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9921 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
9922 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9923 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9924 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9925 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9926 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9927 	SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
9928 	SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9929 	SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
9930 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9931 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9932 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9933 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9934 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9935 	SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
9936 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9937 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9938 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9939 	SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9940 	SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9941 	SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
9942 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9943 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9944 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9945 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9946 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9947 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9948 	SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9949 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9950 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9951 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9952 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9953 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9954 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9955 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9956 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9957 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
9958 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9959 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9960 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
9961 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9962 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
9963 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9964 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9965 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9966 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9967 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9968 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
9969 	SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9970 	SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9971 	SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9972 	SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9973 	SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9974 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9975 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9976 	SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9977 	SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9978 	SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9979 	SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9980 	SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9981 	SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9982 	SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9983 	SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
9984 	SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
9985 	SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
9986 	SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
9987 	SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
9988 	SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
9989 	SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
9990 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9991 	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9992 	SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
9993 	SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
9994 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9995 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9996 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9997 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9998 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9999 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10000 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
10001 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10002 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10003 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
10004 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10005 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10006 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10007 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10008 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10009 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10010 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10011 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10012 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10013 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10014 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10015 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10016 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10017 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650P", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10018 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10019 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10020 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10021 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10022 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10023 	SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA", ALC287_FIXUP_CS35L41_I2C_2),
10024 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10025 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10026 	SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10027 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10028 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10029 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10030 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10031 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10032 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
10033 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10034 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10035 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10036 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10037 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10038 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10039 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10040 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10041 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10042 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10043 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
10044 	SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10045 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10046 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10047 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10048 	SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
10049 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10050 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10051 	SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10052 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10053 	SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10054 	SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10055 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10056 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10057 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10058 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10059 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10060 	SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS ROG Strix G17 2023 (G713PV)", ALC287_FIXUP_CS35L41_I2C_2),
10061 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10062 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10063 	SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10064 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10065 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10066 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10067 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10068 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10069 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10070 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10071 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10072 	SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10073 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10074 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10075 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10076 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10077 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10078 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10079 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
10080 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10081 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10082 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10083 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10084 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10085 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10086 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10087 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10088 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10089 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10090 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10091 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10092 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10093 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10094 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10095 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10096 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10097 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10098 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10099 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10100 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10101 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10102 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10103 	SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10104 	SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10105 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10106 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10107 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10108 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10109 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10110 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10111 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10112 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10113 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10114 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10115 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10116 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10117 	SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10118 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10119 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10120 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10121 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10122 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10123 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10124 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10125 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10126 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10127 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10128 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10129 	SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10130 	SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10131 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10132 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10133 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10134 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10135 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10136 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10137 	SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10138 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10139 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10140 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10141 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10142 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10143 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10144 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10145 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10146 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10147 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10148 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10149 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10150 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10151 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10152 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10153 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10154 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10155 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10156 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10157 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10158 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10159 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10160 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10161 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10162 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10163 	SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10164 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10165 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10166 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10167 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10168 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10169 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10170 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10171 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10172 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10173 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10174 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10175 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10176 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10177 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10178 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10179 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10180 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10181 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10182 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10183 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10184 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10185 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10186 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10187 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10188 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10189 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10190 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10191 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10192 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10193 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10194 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10195 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10196 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10197 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10198 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10199 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10200 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10201 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10202 	SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10203 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10204 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10205 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10206 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10207 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10208 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10209 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10210 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10211 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10212 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10213 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10214 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10215 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10216 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10217 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10218 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10219 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10220 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10221 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10222 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10223 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10224 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10225 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10226 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10227 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10228 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10229 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10230 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10231 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10232 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10233 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10234 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10235 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10236 	SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10237 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10238 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10239 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10240 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10241 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10242 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10243 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10244 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10245 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10246 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10247 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10248 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10249 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10250 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10251 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10252 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10253 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10254 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10255 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10256 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10257 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10258 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10259 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10260 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10261 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10262 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10263 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10264 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10265 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10266 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10267 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10268 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10269 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10270 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
10271 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10272 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10273 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10274 	SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10275 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10276 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10277 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10278 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10279 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10280 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10281 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10282 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10283 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10284 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10285 	SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10286 	SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10287 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10288 	SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10289 	SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10290 	SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10291 	SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10292 	SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10293 	SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10294 	SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10295 	SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10296 	SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10297 	SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10298 	SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10299 	SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10300 	SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10301 	SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10302 	SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10303 	SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10304 	SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10305 	SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10306 	SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10307 	SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10308 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10309 	SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
10310 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10311 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10312 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10313 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10314 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10315 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10316 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10317 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10318 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10319 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10320 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10321 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10322 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10323 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10324 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10325 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10326 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10327 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10328 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10329 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10330 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10331 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10332 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10333 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10334 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10335 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10336 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10337 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10338 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10339 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10340 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10341 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10342 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10343 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10344 	SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10345 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10346 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10347 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10348 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10349 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10350 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10351 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10352 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10353 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10354 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10355 	SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10356 	SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10357 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10358 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10359 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10360 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10361 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10362 	SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10363 	SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10364 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10365 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10366 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10367 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10368 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10369 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10370 	SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10371 	SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10372 
10373 #if 0
10374 	/* Below is a quirk table taken from the old code.
10375 	 * Basically the device should work as is without the fixup table.
10376 	 * If BIOS doesn't give a proper info, enable the corresponding
10377 	 * fixup entry.
10378 	 */
10379 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10380 		      ALC269_FIXUP_AMIC),
10381 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10382 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10383 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10384 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10385 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10386 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10387 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10388 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10389 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10390 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10391 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10392 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10393 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10394 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10395 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10396 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10397 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10398 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10399 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10400 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10401 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10402 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10403 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10404 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10405 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10406 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10407 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10408 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10409 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10410 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10411 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10412 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10413 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10414 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10415 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10416 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10417 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10418 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10419 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10420 #endif
10421 	{}
10422 };
10423 
10424 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10425 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10426 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10427 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10428 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10429 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10430 	{}
10431 };
10432 
10433 static const struct hda_model_fixup alc269_fixup_models[] = {
10434 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10435 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10436 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10437 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10438 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10439 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10440 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10441 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10442 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10443 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10444 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10445 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10446 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10447 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10448 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10449 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10450 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10451 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10452 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10453 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10454 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10455 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10456 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
10457 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10458 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
10459 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10460 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10461 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10462 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10463 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10464 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10465 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10466 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10467 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10468 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10469 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10470 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10471 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10472 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10473 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10474 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10475 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10476 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10477 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10478 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10479 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10480 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10481 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10482 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10483 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10484 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10485 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10486 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10487 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10488 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10489 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10490 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10491 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10492 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10493 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10494 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10495 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10496 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10497 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10498 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
10499 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
10500 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
10501 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
10502 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10503 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10504 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10505 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10506 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10507 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10508 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10509 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10510 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10511 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10512 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10513 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10514 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10515 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
10516 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10517 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10518 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
10519 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
10520 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
10521 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
10522 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10523 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10524 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10525 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10526 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10527 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10528 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10529 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10530 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10531 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10532 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10533 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10534 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10535 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10536 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10537 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10538 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
10539 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10540 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
10541 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
10542 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
10543 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
10544 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
10545 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
10546 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
10547 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
10548 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
10549 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
10550 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
10551 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
10552 	{.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
10553 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
10554 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
10555 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
10556 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
10557 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
10558 	{.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
10559 	{}
10560 };
10561 #define ALC225_STANDARD_PINS \
10562 	{0x21, 0x04211020}
10563 
10564 #define ALC256_STANDARD_PINS \
10565 	{0x12, 0x90a60140}, \
10566 	{0x14, 0x90170110}, \
10567 	{0x21, 0x02211020}
10568 
10569 #define ALC282_STANDARD_PINS \
10570 	{0x14, 0x90170110}
10571 
10572 #define ALC290_STANDARD_PINS \
10573 	{0x12, 0x99a30130}
10574 
10575 #define ALC292_STANDARD_PINS \
10576 	{0x14, 0x90170110}, \
10577 	{0x15, 0x0221401f}
10578 
10579 #define ALC295_STANDARD_PINS \
10580 	{0x12, 0xb7a60130}, \
10581 	{0x14, 0x90170110}, \
10582 	{0x21, 0x04211020}
10583 
10584 #define ALC298_STANDARD_PINS \
10585 	{0x12, 0x90a60130}, \
10586 	{0x21, 0x03211020}
10587 
10588 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
10589 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10590 		{0x14, 0x01014020},
10591 		{0x17, 0x90170110},
10592 		{0x18, 0x02a11030},
10593 		{0x19, 0x0181303F},
10594 		{0x21, 0x0221102f}),
10595 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10596 		{0x12, 0x90a601c0},
10597 		{0x14, 0x90171120},
10598 		{0x21, 0x02211030}),
10599 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10600 		{0x14, 0x90170110},
10601 		{0x1b, 0x90a70130},
10602 		{0x21, 0x03211020}),
10603 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10604 		{0x1a, 0x90a70130},
10605 		{0x1b, 0x90170110},
10606 		{0x21, 0x03211020}),
10607 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10608 		ALC225_STANDARD_PINS,
10609 		{0x12, 0xb7a60130},
10610 		{0x14, 0x901701a0}),
10611 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10612 		ALC225_STANDARD_PINS,
10613 		{0x12, 0xb7a60130},
10614 		{0x14, 0x901701b0}),
10615 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10616 		ALC225_STANDARD_PINS,
10617 		{0x12, 0xb7a60150},
10618 		{0x14, 0x901701a0}),
10619 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10620 		ALC225_STANDARD_PINS,
10621 		{0x12, 0xb7a60150},
10622 		{0x14, 0x901701b0}),
10623 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10624 		ALC225_STANDARD_PINS,
10625 		{0x12, 0xb7a60130},
10626 		{0x1b, 0x90170110}),
10627 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10628 		{0x1b, 0x01111010},
10629 		{0x1e, 0x01451130},
10630 		{0x21, 0x02211020}),
10631 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10632 		{0x12, 0x90a60140},
10633 		{0x14, 0x90170110},
10634 		{0x19, 0x02a11030},
10635 		{0x21, 0x02211020}),
10636 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10637 		{0x14, 0x90170110},
10638 		{0x19, 0x02a11030},
10639 		{0x1a, 0x02a11040},
10640 		{0x1b, 0x01014020},
10641 		{0x21, 0x0221101f}),
10642 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10643 		{0x14, 0x90170110},
10644 		{0x19, 0x02a11030},
10645 		{0x1a, 0x02a11040},
10646 		{0x1b, 0x01011020},
10647 		{0x21, 0x0221101f}),
10648 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10649 		{0x14, 0x90170110},
10650 		{0x19, 0x02a11020},
10651 		{0x1a, 0x02a11030},
10652 		{0x21, 0x0221101f}),
10653 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10654 		{0x21, 0x02211010}),
10655 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10656 		{0x14, 0x90170110},
10657 		{0x19, 0x02a11020},
10658 		{0x21, 0x02211030}),
10659 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
10660 		{0x14, 0x90170110},
10661 		{0x21, 0x02211020}),
10662 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10663 		{0x14, 0x90170130},
10664 		{0x21, 0x02211040}),
10665 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10666 		{0x12, 0x90a60140},
10667 		{0x14, 0x90170110},
10668 		{0x21, 0x02211020}),
10669 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10670 		{0x12, 0x90a60160},
10671 		{0x14, 0x90170120},
10672 		{0x21, 0x02211030}),
10673 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10674 		{0x14, 0x90170110},
10675 		{0x1b, 0x02011020},
10676 		{0x21, 0x0221101f}),
10677 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10678 		{0x14, 0x90170110},
10679 		{0x1b, 0x01011020},
10680 		{0x21, 0x0221101f}),
10681 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10682 		{0x14, 0x90170130},
10683 		{0x1b, 0x01014020},
10684 		{0x21, 0x0221103f}),
10685 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10686 		{0x14, 0x90170130},
10687 		{0x1b, 0x01011020},
10688 		{0x21, 0x0221103f}),
10689 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10690 		{0x14, 0x90170130},
10691 		{0x1b, 0x02011020},
10692 		{0x21, 0x0221103f}),
10693 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10694 		{0x14, 0x90170150},
10695 		{0x1b, 0x02011020},
10696 		{0x21, 0x0221105f}),
10697 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10698 		{0x14, 0x90170110},
10699 		{0x1b, 0x01014020},
10700 		{0x21, 0x0221101f}),
10701 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10702 		{0x12, 0x90a60160},
10703 		{0x14, 0x90170120},
10704 		{0x17, 0x90170140},
10705 		{0x21, 0x0321102f}),
10706 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10707 		{0x12, 0x90a60160},
10708 		{0x14, 0x90170130},
10709 		{0x21, 0x02211040}),
10710 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10711 		{0x12, 0x90a60160},
10712 		{0x14, 0x90170140},
10713 		{0x21, 0x02211050}),
10714 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10715 		{0x12, 0x90a60170},
10716 		{0x14, 0x90170120},
10717 		{0x21, 0x02211030}),
10718 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10719 		{0x12, 0x90a60170},
10720 		{0x14, 0x90170130},
10721 		{0x21, 0x02211040}),
10722 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10723 		{0x12, 0x90a60170},
10724 		{0x14, 0x90171130},
10725 		{0x21, 0x02211040}),
10726 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10727 		{0x12, 0x90a60170},
10728 		{0x14, 0x90170140},
10729 		{0x21, 0x02211050}),
10730 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10731 		{0x12, 0x90a60180},
10732 		{0x14, 0x90170130},
10733 		{0x21, 0x02211040}),
10734 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10735 		{0x12, 0x90a60180},
10736 		{0x14, 0x90170120},
10737 		{0x21, 0x02211030}),
10738 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10739 		{0x1b, 0x01011020},
10740 		{0x21, 0x02211010}),
10741 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10742 		{0x14, 0x90170110},
10743 		{0x1b, 0x90a70130},
10744 		{0x21, 0x04211020}),
10745 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10746 		{0x14, 0x90170110},
10747 		{0x1b, 0x90a70130},
10748 		{0x21, 0x03211020}),
10749 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10750 		{0x12, 0x90a60130},
10751 		{0x14, 0x90170110},
10752 		{0x21, 0x03211020}),
10753 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10754 		{0x12, 0x90a60130},
10755 		{0x14, 0x90170110},
10756 		{0x21, 0x04211020}),
10757 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10758 		{0x1a, 0x90a70130},
10759 		{0x1b, 0x90170110},
10760 		{0x21, 0x03211020}),
10761        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10762 		{0x14, 0x90170110},
10763 		{0x19, 0x02a11020},
10764 		{0x21, 0x0221101f}),
10765        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10766 		{0x17, 0x90170110},
10767 		{0x19, 0x03a11030},
10768 		{0x21, 0x03211020}),
10769 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10770 		{0x12, 0x90a60130},
10771 		{0x14, 0x90170110},
10772 		{0x15, 0x0421101f},
10773 		{0x1a, 0x04a11020}),
10774 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10775 		{0x12, 0x90a60140},
10776 		{0x14, 0x90170110},
10777 		{0x15, 0x0421101f},
10778 		{0x18, 0x02811030},
10779 		{0x1a, 0x04a1103f},
10780 		{0x1b, 0x02011020}),
10781 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10782 		ALC282_STANDARD_PINS,
10783 		{0x12, 0x99a30130},
10784 		{0x19, 0x03a11020},
10785 		{0x21, 0x0321101f}),
10786 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10787 		ALC282_STANDARD_PINS,
10788 		{0x12, 0x99a30130},
10789 		{0x19, 0x03a11020},
10790 		{0x21, 0x03211040}),
10791 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10792 		ALC282_STANDARD_PINS,
10793 		{0x12, 0x99a30130},
10794 		{0x19, 0x03a11030},
10795 		{0x21, 0x03211020}),
10796 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10797 		ALC282_STANDARD_PINS,
10798 		{0x12, 0x99a30130},
10799 		{0x19, 0x04a11020},
10800 		{0x21, 0x0421101f}),
10801 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
10802 		ALC282_STANDARD_PINS,
10803 		{0x12, 0x90a60140},
10804 		{0x19, 0x04a11030},
10805 		{0x21, 0x04211020}),
10806 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10807 		ALC282_STANDARD_PINS,
10808 		{0x12, 0x90a609c0},
10809 		{0x18, 0x03a11830},
10810 		{0x19, 0x04a19831},
10811 		{0x1a, 0x0481303f},
10812 		{0x1b, 0x04211020},
10813 		{0x21, 0x0321101f}),
10814 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10815 		ALC282_STANDARD_PINS,
10816 		{0x12, 0x90a60940},
10817 		{0x18, 0x03a11830},
10818 		{0x19, 0x04a19831},
10819 		{0x1a, 0x0481303f},
10820 		{0x1b, 0x04211020},
10821 		{0x21, 0x0321101f}),
10822 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10823 		ALC282_STANDARD_PINS,
10824 		{0x12, 0x90a60130},
10825 		{0x21, 0x0321101f}),
10826 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10827 		{0x12, 0x90a60160},
10828 		{0x14, 0x90170120},
10829 		{0x21, 0x02211030}),
10830 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10831 		ALC282_STANDARD_PINS,
10832 		{0x12, 0x90a60130},
10833 		{0x19, 0x03a11020},
10834 		{0x21, 0x0321101f}),
10835 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10836 		{0x12, 0x90a60130},
10837 		{0x14, 0x90170110},
10838 		{0x19, 0x04a11040},
10839 		{0x21, 0x04211020}),
10840 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10841 		{0x14, 0x90170110},
10842 		{0x19, 0x04a11040},
10843 		{0x1d, 0x40600001},
10844 		{0x21, 0x04211020}),
10845 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
10846 		{0x14, 0x90170110},
10847 		{0x19, 0x04a11040},
10848 		{0x21, 0x04211020}),
10849 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10850 		{0x14, 0x90170110},
10851 		{0x17, 0x90170111},
10852 		{0x19, 0x03a11030},
10853 		{0x21, 0x03211020}),
10854 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10855 		{0x17, 0x90170110},
10856 		{0x19, 0x03a11030},
10857 		{0x21, 0x03211020}),
10858 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10859 		{0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
10860 		{0x19, 0x04a11040},
10861 		{0x21, 0x04211020}),
10862 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10863 		{0x12, 0x90a60130},
10864 		{0x17, 0x90170110},
10865 		{0x21, 0x02211020}),
10866 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
10867 		{0x12, 0x90a60120},
10868 		{0x14, 0x90170110},
10869 		{0x21, 0x0321101f}),
10870 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10871 		ALC290_STANDARD_PINS,
10872 		{0x15, 0x04211040},
10873 		{0x18, 0x90170112},
10874 		{0x1a, 0x04a11020}),
10875 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10876 		ALC290_STANDARD_PINS,
10877 		{0x15, 0x04211040},
10878 		{0x18, 0x90170110},
10879 		{0x1a, 0x04a11020}),
10880 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10881 		ALC290_STANDARD_PINS,
10882 		{0x15, 0x0421101f},
10883 		{0x1a, 0x04a11020}),
10884 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10885 		ALC290_STANDARD_PINS,
10886 		{0x15, 0x04211020},
10887 		{0x1a, 0x04a11040}),
10888 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10889 		ALC290_STANDARD_PINS,
10890 		{0x14, 0x90170110},
10891 		{0x15, 0x04211020},
10892 		{0x1a, 0x04a11040}),
10893 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10894 		ALC290_STANDARD_PINS,
10895 		{0x14, 0x90170110},
10896 		{0x15, 0x04211020},
10897 		{0x1a, 0x04a11020}),
10898 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10899 		ALC290_STANDARD_PINS,
10900 		{0x14, 0x90170110},
10901 		{0x15, 0x0421101f},
10902 		{0x1a, 0x04a11020}),
10903 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10904 		ALC292_STANDARD_PINS,
10905 		{0x12, 0x90a60140},
10906 		{0x16, 0x01014020},
10907 		{0x19, 0x01a19030}),
10908 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10909 		ALC292_STANDARD_PINS,
10910 		{0x12, 0x90a60140},
10911 		{0x16, 0x01014020},
10912 		{0x18, 0x02a19031},
10913 		{0x19, 0x01a1903e}),
10914 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
10915 		ALC292_STANDARD_PINS,
10916 		{0x12, 0x90a60140}),
10917 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10918 		ALC292_STANDARD_PINS,
10919 		{0x13, 0x90a60140},
10920 		{0x16, 0x21014020},
10921 		{0x19, 0x21a19030}),
10922 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10923 		ALC292_STANDARD_PINS,
10924 		{0x13, 0x90a60140}),
10925 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10926 		{0x17, 0x90170110},
10927 		{0x21, 0x04211020}),
10928 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10929 		{0x14, 0x90170110},
10930 		{0x1b, 0x90a70130},
10931 		{0x21, 0x04211020}),
10932 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10933 		{0x12, 0x90a60130},
10934 		{0x17, 0x90170110},
10935 		{0x21, 0x03211020}),
10936 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10937 		{0x12, 0x90a60130},
10938 		{0x17, 0x90170110},
10939 		{0x21, 0x04211020}),
10940 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10941 		{0x12, 0x90a60130},
10942 		{0x17, 0x90170110},
10943 		{0x21, 0x03211020}),
10944 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10945 		{0x12, 0x90a60120},
10946 		{0x17, 0x90170110},
10947 		{0x21, 0x04211030}),
10948 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10949 		{0x12, 0x90a60130},
10950 		{0x17, 0x90170110},
10951 		{0x21, 0x03211020}),
10952 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10953 		{0x12, 0x90a60130},
10954 		{0x17, 0x90170110},
10955 		{0x21, 0x03211020}),
10956 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10957 		ALC298_STANDARD_PINS,
10958 		{0x17, 0x90170110}),
10959 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10960 		ALC298_STANDARD_PINS,
10961 		{0x17, 0x90170140}),
10962 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10963 		ALC298_STANDARD_PINS,
10964 		{0x17, 0x90170150}),
10965 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10966 		{0x12, 0xb7a60140},
10967 		{0x13, 0xb7a60150},
10968 		{0x17, 0x90170110},
10969 		{0x1a, 0x03011020},
10970 		{0x21, 0x03211030}),
10971 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10972 		{0x12, 0xb7a60140},
10973 		{0x17, 0x90170110},
10974 		{0x1a, 0x03a11030},
10975 		{0x21, 0x03211020}),
10976 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10977 		ALC225_STANDARD_PINS,
10978 		{0x12, 0xb7a60130},
10979 		{0x17, 0x90170110}),
10980 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10981 		{0x14, 0x01014010},
10982 		{0x17, 0x90170120},
10983 		{0x18, 0x02a11030},
10984 		{0x19, 0x02a1103f},
10985 		{0x21, 0x0221101f}),
10986 	{}
10987 };
10988 
10989 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10990  * more machines, don't need to match all valid pins, just need to match
10991  * all the pins defined in the tbl. Just because of this reason, it is possible
10992  * that a single machine matches multiple tbls, so there is one limitation:
10993  *   at most one tbl is allowed to define for the same vendor and same codec
10994  */
10995 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10996 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
10997 		{0x19, 0x40000000}),
10998 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10999 		{0x19, 0x40000000},
11000 		{0x1b, 0x40000000}),
11001 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11002 		{0x19, 0x40000000},
11003 		{0x1b, 0x40000000}),
11004 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11005 		{0x19, 0x40000000},
11006 		{0x1a, 0x40000000}),
11007 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11008 		{0x19, 0x40000000},
11009 		{0x1a, 0x40000000}),
11010 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11011 		{0x19, 0x40000000},
11012 		{0x1a, 0x40000000}),
11013 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11014 		{0x19, 0x40000000}),
11015 	{}
11016 };
11017 
11018 static void alc269_fill_coef(struct hda_codec *codec)
11019 {
11020 	struct alc_spec *spec = codec->spec;
11021 	int val;
11022 
11023 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11024 		return;
11025 
11026 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11027 		alc_write_coef_idx(codec, 0xf, 0x960b);
11028 		alc_write_coef_idx(codec, 0xe, 0x8817);
11029 	}
11030 
11031 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11032 		alc_write_coef_idx(codec, 0xf, 0x960b);
11033 		alc_write_coef_idx(codec, 0xe, 0x8814);
11034 	}
11035 
11036 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11037 		/* Power up output pin */
11038 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11039 	}
11040 
11041 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11042 		val = alc_read_coef_idx(codec, 0xd);
11043 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11044 			/* Capless ramp up clock control */
11045 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
11046 		}
11047 		val = alc_read_coef_idx(codec, 0x17);
11048 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11049 			/* Class D power on reset */
11050 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
11051 		}
11052 	}
11053 
11054 	/* HP */
11055 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11056 }
11057 
11058 /*
11059  */
11060 static int patch_alc269(struct hda_codec *codec)
11061 {
11062 	struct alc_spec *spec;
11063 	int err;
11064 
11065 	err = alc_alloc_spec(codec, 0x0b);
11066 	if (err < 0)
11067 		return err;
11068 
11069 	spec = codec->spec;
11070 	spec->gen.shared_mic_vref_pin = 0x18;
11071 	codec->power_save_node = 0;
11072 	spec->en_3kpull_low = true;
11073 
11074 #ifdef CONFIG_PM
11075 	codec->patch_ops.suspend = alc269_suspend;
11076 	codec->patch_ops.resume = alc269_resume;
11077 #endif
11078 	spec->shutup = alc_default_shutup;
11079 	spec->init_hook = alc_default_init;
11080 
11081 	switch (codec->core.vendor_id) {
11082 	case 0x10ec0269:
11083 		spec->codec_variant = ALC269_TYPE_ALC269VA;
11084 		switch (alc_get_coef0(codec) & 0x00f0) {
11085 		case 0x0010:
11086 			if (codec->bus->pci &&
11087 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
11088 			    spec->cdefine.platform_type == 1)
11089 				err = alc_codec_rename(codec, "ALC271X");
11090 			spec->codec_variant = ALC269_TYPE_ALC269VB;
11091 			break;
11092 		case 0x0020:
11093 			if (codec->bus->pci &&
11094 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
11095 			    codec->bus->pci->subsystem_device == 0x21f3)
11096 				err = alc_codec_rename(codec, "ALC3202");
11097 			spec->codec_variant = ALC269_TYPE_ALC269VC;
11098 			break;
11099 		case 0x0030:
11100 			spec->codec_variant = ALC269_TYPE_ALC269VD;
11101 			break;
11102 		default:
11103 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
11104 		}
11105 		if (err < 0)
11106 			goto error;
11107 		spec->shutup = alc269_shutup;
11108 		spec->init_hook = alc269_fill_coef;
11109 		alc269_fill_coef(codec);
11110 		break;
11111 
11112 	case 0x10ec0280:
11113 	case 0x10ec0290:
11114 		spec->codec_variant = ALC269_TYPE_ALC280;
11115 		break;
11116 	case 0x10ec0282:
11117 		spec->codec_variant = ALC269_TYPE_ALC282;
11118 		spec->shutup = alc282_shutup;
11119 		spec->init_hook = alc282_init;
11120 		break;
11121 	case 0x10ec0233:
11122 	case 0x10ec0283:
11123 		spec->codec_variant = ALC269_TYPE_ALC283;
11124 		spec->shutup = alc283_shutup;
11125 		spec->init_hook = alc283_init;
11126 		break;
11127 	case 0x10ec0284:
11128 	case 0x10ec0292:
11129 		spec->codec_variant = ALC269_TYPE_ALC284;
11130 		break;
11131 	case 0x10ec0293:
11132 		spec->codec_variant = ALC269_TYPE_ALC293;
11133 		break;
11134 	case 0x10ec0286:
11135 	case 0x10ec0288:
11136 		spec->codec_variant = ALC269_TYPE_ALC286;
11137 		break;
11138 	case 0x10ec0298:
11139 		spec->codec_variant = ALC269_TYPE_ALC298;
11140 		break;
11141 	case 0x10ec0235:
11142 	case 0x10ec0255:
11143 		spec->codec_variant = ALC269_TYPE_ALC255;
11144 		spec->shutup = alc256_shutup;
11145 		spec->init_hook = alc256_init;
11146 		break;
11147 	case 0x10ec0230:
11148 	case 0x10ec0236:
11149 	case 0x10ec0256:
11150 	case 0x19e58326:
11151 		spec->codec_variant = ALC269_TYPE_ALC256;
11152 		spec->shutup = alc256_shutup;
11153 		spec->init_hook = alc256_init;
11154 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11155 		if (codec->core.vendor_id == 0x10ec0236 &&
11156 		    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11157 			spec->en_3kpull_low = false;
11158 		break;
11159 	case 0x10ec0257:
11160 		spec->codec_variant = ALC269_TYPE_ALC257;
11161 		spec->shutup = alc256_shutup;
11162 		spec->init_hook = alc256_init;
11163 		spec->gen.mixer_nid = 0;
11164 		spec->en_3kpull_low = false;
11165 		break;
11166 	case 0x10ec0215:
11167 	case 0x10ec0245:
11168 	case 0x10ec0285:
11169 	case 0x10ec0289:
11170 		if (alc_get_coef0(codec) & 0x0010)
11171 			spec->codec_variant = ALC269_TYPE_ALC245;
11172 		else
11173 			spec->codec_variant = ALC269_TYPE_ALC215;
11174 		spec->shutup = alc225_shutup;
11175 		spec->init_hook = alc225_init;
11176 		spec->gen.mixer_nid = 0;
11177 		break;
11178 	case 0x10ec0225:
11179 	case 0x10ec0295:
11180 	case 0x10ec0299:
11181 		spec->codec_variant = ALC269_TYPE_ALC225;
11182 		spec->shutup = alc225_shutup;
11183 		spec->init_hook = alc225_init;
11184 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11185 		break;
11186 	case 0x10ec0287:
11187 		spec->codec_variant = ALC269_TYPE_ALC287;
11188 		spec->shutup = alc225_shutup;
11189 		spec->init_hook = alc225_init;
11190 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11191 		break;
11192 	case 0x10ec0234:
11193 	case 0x10ec0274:
11194 	case 0x10ec0294:
11195 		spec->codec_variant = ALC269_TYPE_ALC294;
11196 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11197 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11198 		spec->init_hook = alc294_init;
11199 		break;
11200 	case 0x10ec0300:
11201 		spec->codec_variant = ALC269_TYPE_ALC300;
11202 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11203 		break;
11204 	case 0x10ec0623:
11205 		spec->codec_variant = ALC269_TYPE_ALC623;
11206 		break;
11207 	case 0x10ec0700:
11208 	case 0x10ec0701:
11209 	case 0x10ec0703:
11210 	case 0x10ec0711:
11211 		spec->codec_variant = ALC269_TYPE_ALC700;
11212 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11213 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11214 		spec->init_hook = alc294_init;
11215 		break;
11216 
11217 	}
11218 
11219 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11220 		spec->has_alc5505_dsp = 1;
11221 		spec->init_hook = alc5505_dsp_init;
11222 	}
11223 
11224 	alc_pre_init(codec);
11225 
11226 	snd_hda_pick_fixup(codec, alc269_fixup_models,
11227 		       alc269_fixup_tbl, alc269_fixups);
11228 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11229 	 * the quirk breaks the latter (bko#214101).
11230 	 * Clear the wrong entry.
11231 	 */
11232 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11233 	    codec->core.vendor_id == 0x10ec0294) {
11234 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11235 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11236 	}
11237 
11238 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11239 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11240 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
11241 			   alc269_fixups);
11242 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11243 
11244 	alc_auto_parse_customize_define(codec);
11245 
11246 	if (has_cdefine_beep(codec))
11247 		spec->gen.beep_nid = 0x01;
11248 
11249 	/* automatic parse from the BIOS config */
11250 	err = alc269_parse_auto_config(codec);
11251 	if (err < 0)
11252 		goto error;
11253 
11254 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11255 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11256 		if (err < 0)
11257 			goto error;
11258 	}
11259 
11260 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11261 
11262 	return 0;
11263 
11264  error:
11265 	alc_free(codec);
11266 	return err;
11267 }
11268 
11269 /*
11270  * ALC861
11271  */
11272 
11273 static int alc861_parse_auto_config(struct hda_codec *codec)
11274 {
11275 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11276 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11277 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11278 }
11279 
11280 /* Pin config fixes */
11281 enum {
11282 	ALC861_FIXUP_FSC_AMILO_PI1505,
11283 	ALC861_FIXUP_AMP_VREF_0F,
11284 	ALC861_FIXUP_NO_JACK_DETECT,
11285 	ALC861_FIXUP_ASUS_A6RP,
11286 	ALC660_FIXUP_ASUS_W7J,
11287 };
11288 
11289 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11290 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11291 			const struct hda_fixup *fix, int action)
11292 {
11293 	struct alc_spec *spec = codec->spec;
11294 	unsigned int val;
11295 
11296 	if (action != HDA_FIXUP_ACT_INIT)
11297 		return;
11298 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
11299 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11300 		val |= AC_PINCTL_IN_EN;
11301 	val |= AC_PINCTL_VREF_50;
11302 	snd_hda_set_pin_ctl(codec, 0x0f, val);
11303 	spec->gen.keep_vref_in_automute = 1;
11304 }
11305 
11306 /* suppress the jack-detection */
11307 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11308 				     const struct hda_fixup *fix, int action)
11309 {
11310 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11311 		codec->no_jack_detect = 1;
11312 }
11313 
11314 static const struct hda_fixup alc861_fixups[] = {
11315 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
11316 		.type = HDA_FIXUP_PINS,
11317 		.v.pins = (const struct hda_pintbl[]) {
11318 			{ 0x0b, 0x0221101f }, /* HP */
11319 			{ 0x0f, 0x90170310 }, /* speaker */
11320 			{ }
11321 		}
11322 	},
11323 	[ALC861_FIXUP_AMP_VREF_0F] = {
11324 		.type = HDA_FIXUP_FUNC,
11325 		.v.func = alc861_fixup_asus_amp_vref_0f,
11326 	},
11327 	[ALC861_FIXUP_NO_JACK_DETECT] = {
11328 		.type = HDA_FIXUP_FUNC,
11329 		.v.func = alc_fixup_no_jack_detect,
11330 	},
11331 	[ALC861_FIXUP_ASUS_A6RP] = {
11332 		.type = HDA_FIXUP_FUNC,
11333 		.v.func = alc861_fixup_asus_amp_vref_0f,
11334 		.chained = true,
11335 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11336 	},
11337 	[ALC660_FIXUP_ASUS_W7J] = {
11338 		.type = HDA_FIXUP_VERBS,
11339 		.v.verbs = (const struct hda_verb[]) {
11340 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
11341 			 * for enabling outputs
11342 			 */
11343 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11344 			{ }
11345 		},
11346 	}
11347 };
11348 
11349 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
11350 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11351 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11352 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11353 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11354 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11355 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11356 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11357 	{}
11358 };
11359 
11360 /*
11361  */
11362 static int patch_alc861(struct hda_codec *codec)
11363 {
11364 	struct alc_spec *spec;
11365 	int err;
11366 
11367 	err = alc_alloc_spec(codec, 0x15);
11368 	if (err < 0)
11369 		return err;
11370 
11371 	spec = codec->spec;
11372 	if (has_cdefine_beep(codec))
11373 		spec->gen.beep_nid = 0x23;
11374 
11375 #ifdef CONFIG_PM
11376 	spec->power_hook = alc_power_eapd;
11377 #endif
11378 
11379 	alc_pre_init(codec);
11380 
11381 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11382 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11383 
11384 	/* automatic parse from the BIOS config */
11385 	err = alc861_parse_auto_config(codec);
11386 	if (err < 0)
11387 		goto error;
11388 
11389 	if (!spec->gen.no_analog) {
11390 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11391 		if (err < 0)
11392 			goto error;
11393 	}
11394 
11395 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11396 
11397 	return 0;
11398 
11399  error:
11400 	alc_free(codec);
11401 	return err;
11402 }
11403 
11404 /*
11405  * ALC861-VD support
11406  *
11407  * Based on ALC882
11408  *
11409  * In addition, an independent DAC
11410  */
11411 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11412 {
11413 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11414 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11415 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11416 }
11417 
11418 enum {
11419 	ALC660VD_FIX_ASUS_GPIO1,
11420 	ALC861VD_FIX_DALLAS,
11421 };
11422 
11423 /* exclude VREF80 */
11424 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11425 				  const struct hda_fixup *fix, int action)
11426 {
11427 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11428 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11429 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11430 	}
11431 }
11432 
11433 /* reset GPIO1 */
11434 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11435 				      const struct hda_fixup *fix, int action)
11436 {
11437 	struct alc_spec *spec = codec->spec;
11438 
11439 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11440 		spec->gpio_mask |= 0x02;
11441 	alc_fixup_gpio(codec, action, 0x01);
11442 }
11443 
11444 static const struct hda_fixup alc861vd_fixups[] = {
11445 	[ALC660VD_FIX_ASUS_GPIO1] = {
11446 		.type = HDA_FIXUP_FUNC,
11447 		.v.func = alc660vd_fixup_asus_gpio1,
11448 	},
11449 	[ALC861VD_FIX_DALLAS] = {
11450 		.type = HDA_FIXUP_FUNC,
11451 		.v.func = alc861vd_fixup_dallas,
11452 	},
11453 };
11454 
11455 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
11456 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
11457 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
11458 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
11459 	{}
11460 };
11461 
11462 /*
11463  */
11464 static int patch_alc861vd(struct hda_codec *codec)
11465 {
11466 	struct alc_spec *spec;
11467 	int err;
11468 
11469 	err = alc_alloc_spec(codec, 0x0b);
11470 	if (err < 0)
11471 		return err;
11472 
11473 	spec = codec->spec;
11474 	if (has_cdefine_beep(codec))
11475 		spec->gen.beep_nid = 0x23;
11476 
11477 	spec->shutup = alc_eapd_shutup;
11478 
11479 	alc_pre_init(codec);
11480 
11481 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11482 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11483 
11484 	/* automatic parse from the BIOS config */
11485 	err = alc861vd_parse_auto_config(codec);
11486 	if (err < 0)
11487 		goto error;
11488 
11489 	if (!spec->gen.no_analog) {
11490 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11491 		if (err < 0)
11492 			goto error;
11493 	}
11494 
11495 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11496 
11497 	return 0;
11498 
11499  error:
11500 	alc_free(codec);
11501 	return err;
11502 }
11503 
11504 /*
11505  * ALC662 support
11506  *
11507  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11508  * configuration.  Each pin widget can choose any input DACs and a mixer.
11509  * Each ADC is connected from a mixer of all inputs.  This makes possible
11510  * 6-channel independent captures.
11511  *
11512  * In addition, an independent DAC for the multi-playback (not used in this
11513  * driver yet).
11514  */
11515 
11516 /*
11517  * BIOS auto configuration
11518  */
11519 
11520 static int alc662_parse_auto_config(struct hda_codec *codec)
11521 {
11522 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
11523 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11524 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11525 	const hda_nid_t *ssids;
11526 
11527 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11528 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11529 	    codec->core.vendor_id == 0x10ec0671)
11530 		ssids = alc663_ssids;
11531 	else
11532 		ssids = alc662_ssids;
11533 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
11534 }
11535 
11536 static void alc272_fixup_mario(struct hda_codec *codec,
11537 			       const struct hda_fixup *fix, int action)
11538 {
11539 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
11540 		return;
11541 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11542 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11543 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11544 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11545 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
11546 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
11547 }
11548 
11549 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11550 	{ .channels = 2,
11551 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11552 	{ .channels = 4,
11553 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11554 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11555 	{ }
11556 };
11557 
11558 /* override the 2.1 chmap */
11559 static void alc_fixup_bass_chmap(struct hda_codec *codec,
11560 				    const struct hda_fixup *fix, int action)
11561 {
11562 	if (action == HDA_FIXUP_ACT_BUILD) {
11563 		struct alc_spec *spec = codec->spec;
11564 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
11565 	}
11566 }
11567 
11568 /* avoid D3 for keeping GPIO up */
11569 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11570 					  hda_nid_t nid,
11571 					  unsigned int power_state)
11572 {
11573 	struct alc_spec *spec = codec->spec;
11574 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
11575 		return AC_PWRST_D0;
11576 	return power_state;
11577 }
11578 
11579 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11580 				   const struct hda_fixup *fix, int action)
11581 {
11582 	struct alc_spec *spec = codec->spec;
11583 
11584 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
11585 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11586 		spec->mute_led_polarity = 1;
11587 		codec->power_filter = gpio_led_power_filter;
11588 	}
11589 }
11590 
11591 static void alc662_usi_automute_hook(struct hda_codec *codec,
11592 					 struct hda_jack_callback *jack)
11593 {
11594 	struct alc_spec *spec = codec->spec;
11595 	int vref;
11596 	msleep(200);
11597 	snd_hda_gen_hp_automute(codec, jack);
11598 
11599 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11600 	msleep(100);
11601 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11602 			    vref);
11603 }
11604 
11605 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11606 				     const struct hda_fixup *fix, int action)
11607 {
11608 	struct alc_spec *spec = codec->spec;
11609 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11610 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11611 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11612 	}
11613 }
11614 
11615 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11616 					struct hda_jack_callback *cb)
11617 {
11618 	/* surround speakers at 0x1b already get muted automatically when
11619 	 * headphones are plugged in, but we have to mute/unmute the remaining
11620 	 * channels manually:
11621 	 * 0x15 - front left/front right
11622 	 * 0x18 - front center/ LFE
11623 	 */
11624 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11625 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11626 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11627 	} else {
11628 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11629 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11630 	}
11631 }
11632 
11633 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11634 					const struct hda_fixup *fix, int action)
11635 {
11636     /* Pin 0x1b: shared headphones jack and surround speakers */
11637 	if (!is_jack_detectable(codec, 0x1b))
11638 		return;
11639 
11640 	switch (action) {
11641 	case HDA_FIXUP_ACT_PRE_PROBE:
11642 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
11643 				alc662_aspire_ethos_mute_speakers);
11644 		/* subwoofer needs an extra GPIO setting to become audible */
11645 		alc_setup_gpio(codec, 0x02);
11646 		break;
11647 	case HDA_FIXUP_ACT_INIT:
11648 		/* Make sure to start in a correct state, i.e. if
11649 		 * headphones have been plugged in before powering up the system
11650 		 */
11651 		alc662_aspire_ethos_mute_speakers(codec, NULL);
11652 		break;
11653 	}
11654 }
11655 
11656 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11657 					     const struct hda_fixup *fix, int action)
11658 {
11659 	struct alc_spec *spec = codec->spec;
11660 
11661 	static const struct hda_pintbl pincfgs[] = {
11662 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11663 		{ 0x1b, 0x0181304f },
11664 		{ }
11665 	};
11666 
11667 	switch (action) {
11668 	case HDA_FIXUP_ACT_PRE_PROBE:
11669 		spec->gen.mixer_nid = 0;
11670 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11671 		snd_hda_apply_pincfgs(codec, pincfgs);
11672 		break;
11673 	case HDA_FIXUP_ACT_INIT:
11674 		alc_write_coef_idx(codec, 0x19, 0xa054);
11675 		break;
11676 	}
11677 }
11678 
11679 static void alc897_hp_automute_hook(struct hda_codec *codec,
11680 					 struct hda_jack_callback *jack)
11681 {
11682 	struct alc_spec *spec = codec->spec;
11683 	int vref;
11684 
11685 	snd_hda_gen_hp_automute(codec, jack);
11686 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11687 	snd_hda_set_pin_ctl(codec, 0x1b, vref);
11688 }
11689 
11690 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11691 				     const struct hda_fixup *fix, int action)
11692 {
11693 	struct alc_spec *spec = codec->spec;
11694 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11695 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11696 		spec->no_shutup_pins = 1;
11697 	}
11698 	if (action == HDA_FIXUP_ACT_PROBE) {
11699 		snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
11700 	}
11701 }
11702 
11703 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11704 				     const struct hda_fixup *fix, int action)
11705 {
11706 	struct alc_spec *spec = codec->spec;
11707 
11708 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11709 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11710 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11711 	}
11712 }
11713 
11714 static const struct coef_fw alc668_coefs[] = {
11715 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
11716 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
11717 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
11718 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11719 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11720 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11721 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
11722 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
11723 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11724 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11725 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11726 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11727 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
11728 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11729 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
11730 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
11731 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11732 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11733 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11734 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11735 	{}
11736 };
11737 
11738 static void alc668_restore_default_value(struct hda_codec *codec)
11739 {
11740 	alc_process_coef_fw(codec, alc668_coefs);
11741 }
11742 
11743 enum {
11744 	ALC662_FIXUP_ASPIRE,
11745 	ALC662_FIXUP_LED_GPIO1,
11746 	ALC662_FIXUP_IDEAPAD,
11747 	ALC272_FIXUP_MARIO,
11748 	ALC662_FIXUP_CZC_ET26,
11749 	ALC662_FIXUP_CZC_P10T,
11750 	ALC662_FIXUP_SKU_IGNORE,
11751 	ALC662_FIXUP_HP_RP5800,
11752 	ALC662_FIXUP_ASUS_MODE1,
11753 	ALC662_FIXUP_ASUS_MODE2,
11754 	ALC662_FIXUP_ASUS_MODE3,
11755 	ALC662_FIXUP_ASUS_MODE4,
11756 	ALC662_FIXUP_ASUS_MODE5,
11757 	ALC662_FIXUP_ASUS_MODE6,
11758 	ALC662_FIXUP_ASUS_MODE7,
11759 	ALC662_FIXUP_ASUS_MODE8,
11760 	ALC662_FIXUP_NO_JACK_DETECT,
11761 	ALC662_FIXUP_ZOTAC_Z68,
11762 	ALC662_FIXUP_INV_DMIC,
11763 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11764 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
11765 	ALC662_FIXUP_HEADSET_MODE,
11766 	ALC668_FIXUP_HEADSET_MODE,
11767 	ALC662_FIXUP_BASS_MODE4_CHMAP,
11768 	ALC662_FIXUP_BASS_16,
11769 	ALC662_FIXUP_BASS_1A,
11770 	ALC662_FIXUP_BASS_CHMAP,
11771 	ALC668_FIXUP_AUTO_MUTE,
11772 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
11773 	ALC668_FIXUP_DELL_XPS13,
11774 	ALC662_FIXUP_ASUS_Nx50,
11775 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11776 	ALC668_FIXUP_ASUS_Nx51,
11777 	ALC668_FIXUP_MIC_COEF,
11778 	ALC668_FIXUP_ASUS_G751,
11779 	ALC891_FIXUP_HEADSET_MODE,
11780 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11781 	ALC662_FIXUP_ACER_VERITON,
11782 	ALC892_FIXUP_ASROCK_MOBO,
11783 	ALC662_FIXUP_USI_FUNC,
11784 	ALC662_FIXUP_USI_HEADSET_MODE,
11785 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
11786 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
11787 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
11788 	ALC671_FIXUP_HP_HEADSET_MIC2,
11789 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
11790 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
11791 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11792 	ALC668_FIXUP_HEADSET_MIC,
11793 	ALC668_FIXUP_MIC_DET_COEF,
11794 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
11795 	ALC897_FIXUP_HEADSET_MIC_PIN,
11796 	ALC897_FIXUP_HP_HSMIC_VERB,
11797 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
11798 	ALC897_FIXUP_HEADSET_MIC_PIN2,
11799 	ALC897_FIXUP_UNIS_H3C_X500S,
11800 	ALC897_FIXUP_HEADSET_MIC_PIN3,
11801 };
11802 
11803 static const struct hda_fixup alc662_fixups[] = {
11804 	[ALC662_FIXUP_ASPIRE] = {
11805 		.type = HDA_FIXUP_PINS,
11806 		.v.pins = (const struct hda_pintbl[]) {
11807 			{ 0x15, 0x99130112 }, /* subwoofer */
11808 			{ }
11809 		}
11810 	},
11811 	[ALC662_FIXUP_LED_GPIO1] = {
11812 		.type = HDA_FIXUP_FUNC,
11813 		.v.func = alc662_fixup_led_gpio1,
11814 	},
11815 	[ALC662_FIXUP_IDEAPAD] = {
11816 		.type = HDA_FIXUP_PINS,
11817 		.v.pins = (const struct hda_pintbl[]) {
11818 			{ 0x17, 0x99130112 }, /* subwoofer */
11819 			{ }
11820 		},
11821 		.chained = true,
11822 		.chain_id = ALC662_FIXUP_LED_GPIO1,
11823 	},
11824 	[ALC272_FIXUP_MARIO] = {
11825 		.type = HDA_FIXUP_FUNC,
11826 		.v.func = alc272_fixup_mario,
11827 	},
11828 	[ALC662_FIXUP_CZC_ET26] = {
11829 		.type = HDA_FIXUP_PINS,
11830 		.v.pins = (const struct hda_pintbl[]) {
11831 			{0x12, 0x403cc000},
11832 			{0x14, 0x90170110}, /* speaker */
11833 			{0x15, 0x411111f0},
11834 			{0x16, 0x411111f0},
11835 			{0x18, 0x01a19030}, /* mic */
11836 			{0x19, 0x90a7013f}, /* int-mic */
11837 			{0x1a, 0x01014020},
11838 			{0x1b, 0x0121401f},
11839 			{0x1c, 0x411111f0},
11840 			{0x1d, 0x411111f0},
11841 			{0x1e, 0x40478e35},
11842 			{}
11843 		},
11844 		.chained = true,
11845 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11846 	},
11847 	[ALC662_FIXUP_CZC_P10T] = {
11848 		.type = HDA_FIXUP_VERBS,
11849 		.v.verbs = (const struct hda_verb[]) {
11850 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11851 			{}
11852 		}
11853 	},
11854 	[ALC662_FIXUP_SKU_IGNORE] = {
11855 		.type = HDA_FIXUP_FUNC,
11856 		.v.func = alc_fixup_sku_ignore,
11857 	},
11858 	[ALC662_FIXUP_HP_RP5800] = {
11859 		.type = HDA_FIXUP_PINS,
11860 		.v.pins = (const struct hda_pintbl[]) {
11861 			{ 0x14, 0x0221201f }, /* HP out */
11862 			{ }
11863 		},
11864 		.chained = true,
11865 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11866 	},
11867 	[ALC662_FIXUP_ASUS_MODE1] = {
11868 		.type = HDA_FIXUP_PINS,
11869 		.v.pins = (const struct hda_pintbl[]) {
11870 			{ 0x14, 0x99130110 }, /* speaker */
11871 			{ 0x18, 0x01a19c20 }, /* mic */
11872 			{ 0x19, 0x99a3092f }, /* int-mic */
11873 			{ 0x21, 0x0121401f }, /* HP out */
11874 			{ }
11875 		},
11876 		.chained = true,
11877 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11878 	},
11879 	[ALC662_FIXUP_ASUS_MODE2] = {
11880 		.type = HDA_FIXUP_PINS,
11881 		.v.pins = (const struct hda_pintbl[]) {
11882 			{ 0x14, 0x99130110 }, /* speaker */
11883 			{ 0x18, 0x01a19820 }, /* mic */
11884 			{ 0x19, 0x99a3092f }, /* int-mic */
11885 			{ 0x1b, 0x0121401f }, /* HP out */
11886 			{ }
11887 		},
11888 		.chained = true,
11889 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11890 	},
11891 	[ALC662_FIXUP_ASUS_MODE3] = {
11892 		.type = HDA_FIXUP_PINS,
11893 		.v.pins = (const struct hda_pintbl[]) {
11894 			{ 0x14, 0x99130110 }, /* speaker */
11895 			{ 0x15, 0x0121441f }, /* HP */
11896 			{ 0x18, 0x01a19840 }, /* mic */
11897 			{ 0x19, 0x99a3094f }, /* int-mic */
11898 			{ 0x21, 0x01211420 }, /* HP2 */
11899 			{ }
11900 		},
11901 		.chained = true,
11902 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11903 	},
11904 	[ALC662_FIXUP_ASUS_MODE4] = {
11905 		.type = HDA_FIXUP_PINS,
11906 		.v.pins = (const struct hda_pintbl[]) {
11907 			{ 0x14, 0x99130110 }, /* speaker */
11908 			{ 0x16, 0x99130111 }, /* speaker */
11909 			{ 0x18, 0x01a19840 }, /* mic */
11910 			{ 0x19, 0x99a3094f }, /* int-mic */
11911 			{ 0x21, 0x0121441f }, /* HP */
11912 			{ }
11913 		},
11914 		.chained = true,
11915 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11916 	},
11917 	[ALC662_FIXUP_ASUS_MODE5] = {
11918 		.type = HDA_FIXUP_PINS,
11919 		.v.pins = (const struct hda_pintbl[]) {
11920 			{ 0x14, 0x99130110 }, /* speaker */
11921 			{ 0x15, 0x0121441f }, /* HP */
11922 			{ 0x16, 0x99130111 }, /* speaker */
11923 			{ 0x18, 0x01a19840 }, /* mic */
11924 			{ 0x19, 0x99a3094f }, /* int-mic */
11925 			{ }
11926 		},
11927 		.chained = true,
11928 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11929 	},
11930 	[ALC662_FIXUP_ASUS_MODE6] = {
11931 		.type = HDA_FIXUP_PINS,
11932 		.v.pins = (const struct hda_pintbl[]) {
11933 			{ 0x14, 0x99130110 }, /* speaker */
11934 			{ 0x15, 0x01211420 }, /* HP2 */
11935 			{ 0x18, 0x01a19840 }, /* mic */
11936 			{ 0x19, 0x99a3094f }, /* int-mic */
11937 			{ 0x1b, 0x0121441f }, /* HP */
11938 			{ }
11939 		},
11940 		.chained = true,
11941 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11942 	},
11943 	[ALC662_FIXUP_ASUS_MODE7] = {
11944 		.type = HDA_FIXUP_PINS,
11945 		.v.pins = (const struct hda_pintbl[]) {
11946 			{ 0x14, 0x99130110 }, /* speaker */
11947 			{ 0x17, 0x99130111 }, /* speaker */
11948 			{ 0x18, 0x01a19840 }, /* mic */
11949 			{ 0x19, 0x99a3094f }, /* int-mic */
11950 			{ 0x1b, 0x01214020 }, /* HP */
11951 			{ 0x21, 0x0121401f }, /* HP */
11952 			{ }
11953 		},
11954 		.chained = true,
11955 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11956 	},
11957 	[ALC662_FIXUP_ASUS_MODE8] = {
11958 		.type = HDA_FIXUP_PINS,
11959 		.v.pins = (const struct hda_pintbl[]) {
11960 			{ 0x14, 0x99130110 }, /* speaker */
11961 			{ 0x12, 0x99a30970 }, /* int-mic */
11962 			{ 0x15, 0x01214020 }, /* HP */
11963 			{ 0x17, 0x99130111 }, /* speaker */
11964 			{ 0x18, 0x01a19840 }, /* mic */
11965 			{ 0x21, 0x0121401f }, /* HP */
11966 			{ }
11967 		},
11968 		.chained = true,
11969 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11970 	},
11971 	[ALC662_FIXUP_NO_JACK_DETECT] = {
11972 		.type = HDA_FIXUP_FUNC,
11973 		.v.func = alc_fixup_no_jack_detect,
11974 	},
11975 	[ALC662_FIXUP_ZOTAC_Z68] = {
11976 		.type = HDA_FIXUP_PINS,
11977 		.v.pins = (const struct hda_pintbl[]) {
11978 			{ 0x1b, 0x02214020 }, /* Front HP */
11979 			{ }
11980 		}
11981 	},
11982 	[ALC662_FIXUP_INV_DMIC] = {
11983 		.type = HDA_FIXUP_FUNC,
11984 		.v.func = alc_fixup_inv_dmic,
11985 	},
11986 	[ALC668_FIXUP_DELL_XPS13] = {
11987 		.type = HDA_FIXUP_FUNC,
11988 		.v.func = alc_fixup_dell_xps13,
11989 		.chained = true,
11990 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11991 	},
11992 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11993 		.type = HDA_FIXUP_FUNC,
11994 		.v.func = alc_fixup_disable_aamix,
11995 		.chained = true,
11996 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11997 	},
11998 	[ALC668_FIXUP_AUTO_MUTE] = {
11999 		.type = HDA_FIXUP_FUNC,
12000 		.v.func = alc_fixup_auto_mute_via_amp,
12001 		.chained = true,
12002 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12003 	},
12004 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12005 		.type = HDA_FIXUP_PINS,
12006 		.v.pins = (const struct hda_pintbl[]) {
12007 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12008 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12009 			{ }
12010 		},
12011 		.chained = true,
12012 		.chain_id = ALC662_FIXUP_HEADSET_MODE
12013 	},
12014 	[ALC662_FIXUP_HEADSET_MODE] = {
12015 		.type = HDA_FIXUP_FUNC,
12016 		.v.func = alc_fixup_headset_mode_alc662,
12017 	},
12018 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12019 		.type = HDA_FIXUP_PINS,
12020 		.v.pins = (const struct hda_pintbl[]) {
12021 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12022 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12023 			{ }
12024 		},
12025 		.chained = true,
12026 		.chain_id = ALC668_FIXUP_HEADSET_MODE
12027 	},
12028 	[ALC668_FIXUP_HEADSET_MODE] = {
12029 		.type = HDA_FIXUP_FUNC,
12030 		.v.func = alc_fixup_headset_mode_alc668,
12031 	},
12032 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12033 		.type = HDA_FIXUP_FUNC,
12034 		.v.func = alc_fixup_bass_chmap,
12035 		.chained = true,
12036 		.chain_id = ALC662_FIXUP_ASUS_MODE4
12037 	},
12038 	[ALC662_FIXUP_BASS_16] = {
12039 		.type = HDA_FIXUP_PINS,
12040 		.v.pins = (const struct hda_pintbl[]) {
12041 			{0x16, 0x80106111}, /* bass speaker */
12042 			{}
12043 		},
12044 		.chained = true,
12045 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12046 	},
12047 	[ALC662_FIXUP_BASS_1A] = {
12048 		.type = HDA_FIXUP_PINS,
12049 		.v.pins = (const struct hda_pintbl[]) {
12050 			{0x1a, 0x80106111}, /* bass speaker */
12051 			{}
12052 		},
12053 		.chained = true,
12054 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12055 	},
12056 	[ALC662_FIXUP_BASS_CHMAP] = {
12057 		.type = HDA_FIXUP_FUNC,
12058 		.v.func = alc_fixup_bass_chmap,
12059 	},
12060 	[ALC662_FIXUP_ASUS_Nx50] = {
12061 		.type = HDA_FIXUP_FUNC,
12062 		.v.func = alc_fixup_auto_mute_via_amp,
12063 		.chained = true,
12064 		.chain_id = ALC662_FIXUP_BASS_1A
12065 	},
12066 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12067 		.type = HDA_FIXUP_FUNC,
12068 		.v.func = alc_fixup_headset_mode_alc668,
12069 		.chain_id = ALC662_FIXUP_BASS_CHMAP
12070 	},
12071 	[ALC668_FIXUP_ASUS_Nx51] = {
12072 		.type = HDA_FIXUP_PINS,
12073 		.v.pins = (const struct hda_pintbl[]) {
12074 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12075 			{ 0x1a, 0x90170151 }, /* bass speaker */
12076 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12077 			{}
12078 		},
12079 		.chained = true,
12080 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12081 	},
12082 	[ALC668_FIXUP_MIC_COEF] = {
12083 		.type = HDA_FIXUP_VERBS,
12084 		.v.verbs = (const struct hda_verb[]) {
12085 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12086 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12087 			{}
12088 		},
12089 	},
12090 	[ALC668_FIXUP_ASUS_G751] = {
12091 		.type = HDA_FIXUP_PINS,
12092 		.v.pins = (const struct hda_pintbl[]) {
12093 			{ 0x16, 0x0421101f }, /* HP */
12094 			{}
12095 		},
12096 		.chained = true,
12097 		.chain_id = ALC668_FIXUP_MIC_COEF
12098 	},
12099 	[ALC891_FIXUP_HEADSET_MODE] = {
12100 		.type = HDA_FIXUP_FUNC,
12101 		.v.func = alc_fixup_headset_mode,
12102 	},
12103 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12104 		.type = HDA_FIXUP_PINS,
12105 		.v.pins = (const struct hda_pintbl[]) {
12106 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12107 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12108 			{ }
12109 		},
12110 		.chained = true,
12111 		.chain_id = ALC891_FIXUP_HEADSET_MODE
12112 	},
12113 	[ALC662_FIXUP_ACER_VERITON] = {
12114 		.type = HDA_FIXUP_PINS,
12115 		.v.pins = (const struct hda_pintbl[]) {
12116 			{ 0x15, 0x50170120 }, /* no internal speaker */
12117 			{ }
12118 		}
12119 	},
12120 	[ALC892_FIXUP_ASROCK_MOBO] = {
12121 		.type = HDA_FIXUP_PINS,
12122 		.v.pins = (const struct hda_pintbl[]) {
12123 			{ 0x15, 0x40f000f0 }, /* disabled */
12124 			{ 0x16, 0x40f000f0 }, /* disabled */
12125 			{ }
12126 		}
12127 	},
12128 	[ALC662_FIXUP_USI_FUNC] = {
12129 		.type = HDA_FIXUP_FUNC,
12130 		.v.func = alc662_fixup_usi_headset_mic,
12131 	},
12132 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
12133 		.type = HDA_FIXUP_PINS,
12134 		.v.pins = (const struct hda_pintbl[]) {
12135 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12136 			{ 0x18, 0x01a1903d },
12137 			{ }
12138 		},
12139 		.chained = true,
12140 		.chain_id = ALC662_FIXUP_USI_FUNC
12141 	},
12142 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12143 		.type = HDA_FIXUP_FUNC,
12144 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12145 	},
12146 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12147 		.type = HDA_FIXUP_FUNC,
12148 		.v.func = alc662_fixup_aspire_ethos_hp,
12149 	},
12150 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12151 		.type = HDA_FIXUP_PINS,
12152 		.v.pins = (const struct hda_pintbl[]) {
12153 			{ 0x15, 0x92130110 }, /* front speakers */
12154 			{ 0x18, 0x99130111 }, /* center/subwoofer */
12155 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
12156 			{ }
12157 		},
12158 		.chained = true,
12159 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12160 	},
12161 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
12162 		.type = HDA_FIXUP_FUNC,
12163 		.v.func = alc671_fixup_hp_headset_mic2,
12164 	},
12165 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12166 		.type = HDA_FIXUP_PINS,
12167 		.v.pins = (const struct hda_pintbl[]) {
12168 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12169 			{ }
12170 		},
12171 		.chained = true,
12172 		.chain_id = ALC662_FIXUP_USI_FUNC
12173 	},
12174 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12175 		.type = HDA_FIXUP_PINS,
12176 		.v.pins = (const struct hda_pintbl[]) {
12177 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12178 			{ 0x1b, 0x0221144f },
12179 			{ }
12180 		},
12181 		.chained = true,
12182 		.chain_id = ALC662_FIXUP_USI_FUNC
12183 	},
12184 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12185 		.type = HDA_FIXUP_PINS,
12186 		.v.pins = (const struct hda_pintbl[]) {
12187 			{ 0x1b, 0x04a1112c },
12188 			{ }
12189 		},
12190 		.chained = true,
12191 		.chain_id = ALC668_FIXUP_HEADSET_MIC
12192 	},
12193 	[ALC668_FIXUP_HEADSET_MIC] = {
12194 		.type = HDA_FIXUP_FUNC,
12195 		.v.func = alc269_fixup_headset_mic,
12196 		.chained = true,
12197 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
12198 	},
12199 	[ALC668_FIXUP_MIC_DET_COEF] = {
12200 		.type = HDA_FIXUP_VERBS,
12201 		.v.verbs = (const struct hda_verb[]) {
12202 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12203 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12204 			{}
12205 		},
12206 	},
12207 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12208 		.type = HDA_FIXUP_FUNC,
12209 		.v.func = alc897_fixup_lenovo_headset_mic,
12210 	},
12211 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
12212 		.type = HDA_FIXUP_PINS,
12213 		.v.pins = (const struct hda_pintbl[]) {
12214 			{ 0x1a, 0x03a11050 },
12215 			{ }
12216 		},
12217 		.chained = true,
12218 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12219 	},
12220 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
12221 		.type = HDA_FIXUP_PINS,
12222 		.v.pins = (const struct hda_pintbl[]) {
12223 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12224 			{ }
12225 		},
12226 	},
12227 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12228 		.type = HDA_FIXUP_FUNC,
12229 		.v.func = alc897_fixup_lenovo_headset_mode,
12230 	},
12231 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12232 		.type = HDA_FIXUP_PINS,
12233 		.v.pins = (const struct hda_pintbl[]) {
12234 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12235 			{ }
12236 		},
12237 		.chained = true,
12238 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12239 	},
12240 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
12241 		.type = HDA_FIXUP_VERBS,
12242 		.v.verbs = (const struct hda_verb[]) {
12243 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12244 			{}
12245 		},
12246 	},
12247 	[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12248 		.type = HDA_FIXUP_PINS,
12249 		.v.pins = (const struct hda_pintbl[]) {
12250 			{ 0x19, 0x03a11050 }, /* use as headset mic */
12251 			{ }
12252 		},
12253 	},
12254 };
12255 
12256 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
12257 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12258 	SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12259 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12260 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12261 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12262 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12263 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12264 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12265 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12266 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12267 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12268 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12269 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12270 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12271 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12272 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12273 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12274 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12275 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12276 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12277 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12278 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12279 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12280 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12281 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12282 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12283 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12284 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12285 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12286 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12287 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12288 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12289 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12290 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12291 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12292 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12293 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12294 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12295 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12296 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12297 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12298 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12299 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12300 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12301 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12302 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12303 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12304 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12305 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12306 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12307 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12308 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12309 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12310 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12311 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12312 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12313 	SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12314 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12315 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12316 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12317 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12318 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12319 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12320 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12321 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12322 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12323 
12324 #if 0
12325 	/* Below is a quirk table taken from the old code.
12326 	 * Basically the device should work as is without the fixup table.
12327 	 * If BIOS doesn't give a proper info, enable the corresponding
12328 	 * fixup entry.
12329 	 */
12330 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12331 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12332 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12333 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12334 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12335 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12336 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12337 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12338 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12339 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12340 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12341 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12342 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12343 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12344 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12345 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12346 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12347 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12348 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12349 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12350 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12351 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12352 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12353 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12354 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12355 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12356 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12357 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12358 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12359 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12360 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12361 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12362 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12363 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12364 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12365 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12366 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12367 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12368 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12369 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12370 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12371 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12372 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12373 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12374 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12375 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12376 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12377 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12378 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12379 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12380 #endif
12381 	{}
12382 };
12383 
12384 static const struct hda_model_fixup alc662_fixup_models[] = {
12385 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12386 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12387 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
12388 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12389 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12390 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12391 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12392 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12393 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12394 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12395 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12396 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12397 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12398 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12399 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12400 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12401 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12402 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12403 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12404 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12405 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12406 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12407 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12408 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12409 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12410 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12411 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12412 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12413 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12414 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12415 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12416 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12417 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12418 	{}
12419 };
12420 
12421 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12422 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12423 		{0x17, 0x02211010},
12424 		{0x18, 0x01a19030},
12425 		{0x1a, 0x01813040},
12426 		{0x21, 0x01014020}),
12427 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12428 		{0x16, 0x01813030},
12429 		{0x17, 0x02211010},
12430 		{0x18, 0x01a19040},
12431 		{0x21, 0x01014020}),
12432 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12433 		{0x14, 0x01014010},
12434 		{0x18, 0x01a19020},
12435 		{0x1a, 0x0181302f},
12436 		{0x1b, 0x0221401f}),
12437 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12438 		{0x12, 0x99a30130},
12439 		{0x14, 0x90170110},
12440 		{0x15, 0x0321101f},
12441 		{0x16, 0x03011020}),
12442 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12443 		{0x12, 0x99a30140},
12444 		{0x14, 0x90170110},
12445 		{0x15, 0x0321101f},
12446 		{0x16, 0x03011020}),
12447 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12448 		{0x12, 0x99a30150},
12449 		{0x14, 0x90170110},
12450 		{0x15, 0x0321101f},
12451 		{0x16, 0x03011020}),
12452 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12453 		{0x14, 0x90170110},
12454 		{0x15, 0x0321101f},
12455 		{0x16, 0x03011020}),
12456 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12457 		{0x12, 0x90a60130},
12458 		{0x14, 0x90170110},
12459 		{0x15, 0x0321101f}),
12460 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12461 		{0x14, 0x01014010},
12462 		{0x17, 0x90170150},
12463 		{0x19, 0x02a11060},
12464 		{0x1b, 0x01813030},
12465 		{0x21, 0x02211020}),
12466 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12467 		{0x14, 0x01014010},
12468 		{0x18, 0x01a19040},
12469 		{0x1b, 0x01813030},
12470 		{0x21, 0x02211020}),
12471 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12472 		{0x14, 0x01014020},
12473 		{0x17, 0x90170110},
12474 		{0x18, 0x01a19050},
12475 		{0x1b, 0x01813040},
12476 		{0x21, 0x02211030}),
12477 	{}
12478 };
12479 
12480 /*
12481  */
12482 static int patch_alc662(struct hda_codec *codec)
12483 {
12484 	struct alc_spec *spec;
12485 	int err;
12486 
12487 	err = alc_alloc_spec(codec, 0x0b);
12488 	if (err < 0)
12489 		return err;
12490 
12491 	spec = codec->spec;
12492 
12493 	spec->shutup = alc_eapd_shutup;
12494 
12495 	/* handle multiple HPs as is */
12496 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12497 
12498 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
12499 
12500 	switch (codec->core.vendor_id) {
12501 	case 0x10ec0668:
12502 		spec->init_hook = alc668_restore_default_value;
12503 		break;
12504 	}
12505 
12506 	alc_pre_init(codec);
12507 
12508 	snd_hda_pick_fixup(codec, alc662_fixup_models,
12509 		       alc662_fixup_tbl, alc662_fixups);
12510 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
12511 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12512 
12513 	alc_auto_parse_customize_define(codec);
12514 
12515 	if (has_cdefine_beep(codec))
12516 		spec->gen.beep_nid = 0x01;
12517 
12518 	if ((alc_get_coef0(codec) & (1 << 14)) &&
12519 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
12520 	    spec->cdefine.platform_type == 1) {
12521 		err = alc_codec_rename(codec, "ALC272X");
12522 		if (err < 0)
12523 			goto error;
12524 	}
12525 
12526 	/* automatic parse from the BIOS config */
12527 	err = alc662_parse_auto_config(codec);
12528 	if (err < 0)
12529 		goto error;
12530 
12531 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
12532 		switch (codec->core.vendor_id) {
12533 		case 0x10ec0662:
12534 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12535 			break;
12536 		case 0x10ec0272:
12537 		case 0x10ec0663:
12538 		case 0x10ec0665:
12539 		case 0x10ec0668:
12540 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
12541 			break;
12542 		case 0x10ec0273:
12543 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
12544 			break;
12545 		}
12546 		if (err < 0)
12547 			goto error;
12548 	}
12549 
12550 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12551 
12552 	return 0;
12553 
12554  error:
12555 	alc_free(codec);
12556 	return err;
12557 }
12558 
12559 /*
12560  * ALC680 support
12561  */
12562 
12563 static int alc680_parse_auto_config(struct hda_codec *codec)
12564 {
12565 	return alc_parse_auto_config(codec, NULL, NULL);
12566 }
12567 
12568 /*
12569  */
12570 static int patch_alc680(struct hda_codec *codec)
12571 {
12572 	int err;
12573 
12574 	/* ALC680 has no aa-loopback mixer */
12575 	err = alc_alloc_spec(codec, 0);
12576 	if (err < 0)
12577 		return err;
12578 
12579 	/* automatic parse from the BIOS config */
12580 	err = alc680_parse_auto_config(codec);
12581 	if (err < 0) {
12582 		alc_free(codec);
12583 		return err;
12584 	}
12585 
12586 	return 0;
12587 }
12588 
12589 /*
12590  * patch entries
12591  */
12592 static const struct hda_device_id snd_hda_id_realtek[] = {
12593 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
12594 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
12595 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
12596 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
12597 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
12598 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12599 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
12600 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
12601 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
12602 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
12603 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
12604 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12605 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
12606 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
12607 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12608 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12609 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12610 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12611 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12612 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12613 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
12614 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
12615 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12616 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12617 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12618 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12619 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12620 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
12621 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
12622 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
12623 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
12624 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
12625 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
12626 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12627 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12628 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
12629 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
12630 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
12631 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
12632 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
12633 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
12634 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
12635 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12636 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12637 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12638 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12639 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12640 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12641 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12642 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12643 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12644 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12645 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12646 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12647 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12648 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
12649 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12650 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12651 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
12652 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
12653 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
12654 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12655 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12656 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12657 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12658 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12659 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12660 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12661 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12662 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12663 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12664 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
12665 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
12666 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12667 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
12668 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
12669 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
12670 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
12671 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
12672 	{} /* terminator */
12673 };
12674 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
12675 
12676 MODULE_LICENSE("GPL");
12677 MODULE_DESCRIPTION("Realtek HD-audio codec");
12678 
12679 static struct hda_codec_driver realtek_driver = {
12680 	.id = snd_hda_id_realtek,
12681 };
12682 
12683 module_hda_codec_driver(realtek_driver);
12684