xref: /openbmc/linux/sound/pci/hda/patch_realtek.c (revision 80d0624d)
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 0x10ec0257:
589 	case 0x19e58326:
590 	case 0x10ec0283:
591 	case 0x10ec0285:
592 	case 0x10ec0286:
593 	case 0x10ec0287:
594 	case 0x10ec0288:
595 	case 0x10ec0295:
596 	case 0x10ec0298:
597 		alc_headset_mic_no_shutup(codec);
598 		break;
599 	default:
600 		if (!spec->no_shutup_pins)
601 			snd_hda_shutup_pins(codec);
602 		break;
603 	}
604 }
605 
606 /* generic shutup callback;
607  * just turning off EAPD and a little pause for avoiding pop-noise
608  */
609 static void alc_eapd_shutup(struct hda_codec *codec)
610 {
611 	struct alc_spec *spec = codec->spec;
612 
613 	alc_auto_setup_eapd(codec, false);
614 	if (!spec->no_depop_delay)
615 		msleep(200);
616 	alc_shutup_pins(codec);
617 }
618 
619 /* generic EAPD initialization */
620 static void alc_auto_init_amp(struct hda_codec *codec, int type)
621 {
622 	alc_auto_setup_eapd(codec, true);
623 	alc_write_gpio(codec);
624 	switch (type) {
625 	case ALC_INIT_DEFAULT:
626 		switch (codec->core.vendor_id) {
627 		case 0x10ec0260:
628 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
629 			break;
630 		case 0x10ec0880:
631 		case 0x10ec0882:
632 		case 0x10ec0883:
633 		case 0x10ec0885:
634 			alc_update_coef_idx(codec, 7, 0, 0x2030);
635 			break;
636 		case 0x10ec0888:
637 			alc888_coef_init(codec);
638 			break;
639 		}
640 		break;
641 	}
642 }
643 
644 /* get a primary headphone pin if available */
645 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
646 {
647 	if (spec->gen.autocfg.hp_pins[0])
648 		return spec->gen.autocfg.hp_pins[0];
649 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
650 		return spec->gen.autocfg.line_out_pins[0];
651 	return 0;
652 }
653 
654 /*
655  * Realtek SSID verification
656  */
657 
658 /* Could be any non-zero and even value. When used as fixup, tells
659  * the driver to ignore any present sku defines.
660  */
661 #define ALC_FIXUP_SKU_IGNORE (2)
662 
663 static void alc_fixup_sku_ignore(struct hda_codec *codec,
664 				 const struct hda_fixup *fix, int action)
665 {
666 	struct alc_spec *spec = codec->spec;
667 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
668 		spec->cdefine.fixup = 1;
669 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
670 	}
671 }
672 
673 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
674 				    const struct hda_fixup *fix, int action)
675 {
676 	struct alc_spec *spec = codec->spec;
677 
678 	if (action == HDA_FIXUP_ACT_PROBE) {
679 		spec->no_depop_delay = 1;
680 		codec->depop_delay = 0;
681 	}
682 }
683 
684 static int alc_auto_parse_customize_define(struct hda_codec *codec)
685 {
686 	unsigned int ass, tmp, i;
687 	unsigned nid = 0;
688 	struct alc_spec *spec = codec->spec;
689 
690 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
691 
692 	if (spec->cdefine.fixup) {
693 		ass = spec->cdefine.sku_cfg;
694 		if (ass == ALC_FIXUP_SKU_IGNORE)
695 			return -1;
696 		goto do_sku;
697 	}
698 
699 	if (!codec->bus->pci)
700 		return -1;
701 	ass = codec->core.subsystem_id & 0xffff;
702 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
703 		goto do_sku;
704 
705 	nid = 0x1d;
706 	if (codec->core.vendor_id == 0x10ec0260)
707 		nid = 0x17;
708 	ass = snd_hda_codec_get_pincfg(codec, nid);
709 
710 	if (!(ass & 1)) {
711 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
712 			   codec->core.chip_name, ass);
713 		return -1;
714 	}
715 
716 	/* check sum */
717 	tmp = 0;
718 	for (i = 1; i < 16; i++) {
719 		if ((ass >> i) & 1)
720 			tmp++;
721 	}
722 	if (((ass >> 16) & 0xf) != tmp)
723 		return -1;
724 
725 	spec->cdefine.port_connectivity = ass >> 30;
726 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
727 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
728 	spec->cdefine.customization = ass >> 8;
729 do_sku:
730 	spec->cdefine.sku_cfg = ass;
731 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
732 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
733 	spec->cdefine.swap = (ass & 0x2) >> 1;
734 	spec->cdefine.override = ass & 0x1;
735 
736 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
737 		   nid, spec->cdefine.sku_cfg);
738 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
739 		   spec->cdefine.port_connectivity);
740 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
741 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
742 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
743 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
744 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
745 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
746 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
747 
748 	return 0;
749 }
750 
751 /* return the position of NID in the list, or -1 if not found */
752 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
753 {
754 	int i;
755 	for (i = 0; i < nums; i++)
756 		if (list[i] == nid)
757 			return i;
758 	return -1;
759 }
760 /* return true if the given NID is found in the list */
761 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
762 {
763 	return find_idx_in_nid_list(nid, list, nums) >= 0;
764 }
765 
766 /* check subsystem ID and set up device-specific initialization;
767  * return 1 if initialized, 0 if invalid SSID
768  */
769 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
770  *	31 ~ 16 :	Manufacture ID
771  *	15 ~ 8	:	SKU ID
772  *	7  ~ 0	:	Assembly ID
773  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
774  */
775 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
776 {
777 	unsigned int ass, tmp, i;
778 	unsigned nid;
779 	struct alc_spec *spec = codec->spec;
780 
781 	if (spec->cdefine.fixup) {
782 		ass = spec->cdefine.sku_cfg;
783 		if (ass == ALC_FIXUP_SKU_IGNORE)
784 			return 0;
785 		goto do_sku;
786 	}
787 
788 	ass = codec->core.subsystem_id & 0xffff;
789 	if (codec->bus->pci &&
790 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
791 		goto do_sku;
792 
793 	/* invalid SSID, check the special NID pin defcfg instead */
794 	/*
795 	 * 31~30	: port connectivity
796 	 * 29~21	: reserve
797 	 * 20		: PCBEEP input
798 	 * 19~16	: Check sum (15:1)
799 	 * 15~1		: Custom
800 	 * 0		: override
801 	*/
802 	nid = 0x1d;
803 	if (codec->core.vendor_id == 0x10ec0260)
804 		nid = 0x17;
805 	ass = snd_hda_codec_get_pincfg(codec, nid);
806 	codec_dbg(codec,
807 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
808 		   ass, nid);
809 	if (!(ass & 1))
810 		return 0;
811 	if ((ass >> 30) != 1)	/* no physical connection */
812 		return 0;
813 
814 	/* check sum */
815 	tmp = 0;
816 	for (i = 1; i < 16; i++) {
817 		if ((ass >> i) & 1)
818 			tmp++;
819 	}
820 	if (((ass >> 16) & 0xf) != tmp)
821 		return 0;
822 do_sku:
823 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
824 		   ass & 0xffff, codec->core.vendor_id);
825 	/*
826 	 * 0 : override
827 	 * 1 :	Swap Jack
828 	 * 2 : 0 --> Desktop, 1 --> Laptop
829 	 * 3~5 : External Amplifier control
830 	 * 7~6 : Reserved
831 	*/
832 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
833 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
834 		switch (tmp) {
835 		case 1:
836 			alc_setup_gpio(codec, 0x01);
837 			break;
838 		case 3:
839 			alc_setup_gpio(codec, 0x02);
840 			break;
841 		case 7:
842 			alc_setup_gpio(codec, 0x04);
843 			break;
844 		case 5:
845 		default:
846 			spec->init_amp = ALC_INIT_DEFAULT;
847 			break;
848 		}
849 	}
850 
851 	/* is laptop or Desktop and enable the function "Mute internal speaker
852 	 * when the external headphone out jack is plugged"
853 	 */
854 	if (!(ass & 0x8000))
855 		return 1;
856 	/*
857 	 * 10~8 : Jack location
858 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
859 	 * 14~13: Resvered
860 	 * 15   : 1 --> enable the function "Mute internal speaker
861 	 *	        when the external headphone out jack is plugged"
862 	 */
863 	if (!alc_get_hp_pin(spec)) {
864 		hda_nid_t nid;
865 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
866 		nid = ports[tmp];
867 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
868 				      spec->gen.autocfg.line_outs))
869 			return 1;
870 		spec->gen.autocfg.hp_pins[0] = nid;
871 	}
872 	return 1;
873 }
874 
875 /* Check the validity of ALC subsystem-id
876  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
877 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
878 {
879 	if (!alc_subsystem_id(codec, ports)) {
880 		struct alc_spec *spec = codec->spec;
881 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
882 			codec_dbg(codec,
883 				  "realtek: Enable default setup for auto mode as fallback\n");
884 			spec->init_amp = ALC_INIT_DEFAULT;
885 		}
886 	}
887 }
888 
889 /*
890  */
891 
892 static void alc_fixup_inv_dmic(struct hda_codec *codec,
893 			       const struct hda_fixup *fix, int action)
894 {
895 	struct alc_spec *spec = codec->spec;
896 
897 	spec->gen.inv_dmic_split = 1;
898 }
899 
900 
901 static int alc_build_controls(struct hda_codec *codec)
902 {
903 	int err;
904 
905 	err = snd_hda_gen_build_controls(codec);
906 	if (err < 0)
907 		return err;
908 
909 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
910 	return 0;
911 }
912 
913 
914 /*
915  * Common callbacks
916  */
917 
918 static void alc_pre_init(struct hda_codec *codec)
919 {
920 	alc_fill_eapd_coef(codec);
921 }
922 
923 #define is_s3_resume(codec) \
924 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
925 #define is_s4_resume(codec) \
926 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
927 
928 static int alc_init(struct hda_codec *codec)
929 {
930 	struct alc_spec *spec = codec->spec;
931 
932 	/* hibernation resume needs the full chip initialization */
933 	if (is_s4_resume(codec))
934 		alc_pre_init(codec);
935 
936 	if (spec->init_hook)
937 		spec->init_hook(codec);
938 
939 	spec->gen.skip_verbs = 1; /* applied in below */
940 	snd_hda_gen_init(codec);
941 	alc_fix_pll(codec);
942 	alc_auto_init_amp(codec, spec->init_amp);
943 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
944 
945 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
946 
947 	return 0;
948 }
949 
950 #define alc_free	snd_hda_gen_free
951 
952 #ifdef CONFIG_PM
953 static inline void alc_shutup(struct hda_codec *codec)
954 {
955 	struct alc_spec *spec = codec->spec;
956 
957 	if (!snd_hda_get_bool_hint(codec, "shutup"))
958 		return; /* disabled explicitly by hints */
959 
960 	if (spec && spec->shutup)
961 		spec->shutup(codec);
962 	else
963 		alc_shutup_pins(codec);
964 }
965 
966 static void alc_power_eapd(struct hda_codec *codec)
967 {
968 	alc_auto_setup_eapd(codec, false);
969 }
970 
971 static int alc_suspend(struct hda_codec *codec)
972 {
973 	struct alc_spec *spec = codec->spec;
974 	alc_shutup(codec);
975 	if (spec && spec->power_hook)
976 		spec->power_hook(codec);
977 	return 0;
978 }
979 
980 static int alc_resume(struct hda_codec *codec)
981 {
982 	struct alc_spec *spec = codec->spec;
983 
984 	if (!spec->no_depop_delay)
985 		msleep(150); /* to avoid pop noise */
986 	codec->patch_ops.init(codec);
987 	snd_hda_regmap_sync(codec);
988 	hda_call_check_power_status(codec, 0x01);
989 	return 0;
990 }
991 #endif
992 
993 /*
994  */
995 static const struct hda_codec_ops alc_patch_ops = {
996 	.build_controls = alc_build_controls,
997 	.build_pcms = snd_hda_gen_build_pcms,
998 	.init = alc_init,
999 	.free = alc_free,
1000 	.unsol_event = snd_hda_jack_unsol_event,
1001 #ifdef CONFIG_PM
1002 	.resume = alc_resume,
1003 	.suspend = alc_suspend,
1004 	.check_power_status = snd_hda_gen_check_power_status,
1005 #endif
1006 };
1007 
1008 
1009 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1010 
1011 /*
1012  * Rename codecs appropriately from COEF value or subvendor id
1013  */
1014 struct alc_codec_rename_table {
1015 	unsigned int vendor_id;
1016 	unsigned short coef_mask;
1017 	unsigned short coef_bits;
1018 	const char *name;
1019 };
1020 
1021 struct alc_codec_rename_pci_table {
1022 	unsigned int codec_vendor_id;
1023 	unsigned short pci_subvendor;
1024 	unsigned short pci_subdevice;
1025 	const char *name;
1026 };
1027 
1028 static const struct alc_codec_rename_table rename_tbl[] = {
1029 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1030 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1031 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1032 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1033 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1034 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1035 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1036 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1037 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1038 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1039 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1040 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1041 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1042 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1043 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1044 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1045 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1046 	{ } /* terminator */
1047 };
1048 
1049 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1050 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1051 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1052 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1053 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1054 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1055 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1056 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1057 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1058 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1059 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1060 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1061 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1062 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1063 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1064 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1065 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1066 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1067 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1068 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1069 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1070 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1071 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1072 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1073 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1074 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1075 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1076 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1077 	{ } /* terminator */
1078 };
1079 
1080 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1081 {
1082 	const struct alc_codec_rename_table *p;
1083 	const struct alc_codec_rename_pci_table *q;
1084 
1085 	for (p = rename_tbl; p->vendor_id; p++) {
1086 		if (p->vendor_id != codec->core.vendor_id)
1087 			continue;
1088 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1089 			return alc_codec_rename(codec, p->name);
1090 	}
1091 
1092 	if (!codec->bus->pci)
1093 		return 0;
1094 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1095 		if (q->codec_vendor_id != codec->core.vendor_id)
1096 			continue;
1097 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1098 			continue;
1099 		if (!q->pci_subdevice ||
1100 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1101 			return alc_codec_rename(codec, q->name);
1102 	}
1103 
1104 	return 0;
1105 }
1106 
1107 
1108 /*
1109  * Digital-beep handlers
1110  */
1111 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1112 
1113 /* additional beep mixers; private_value will be overwritten */
1114 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1115 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1116 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1117 };
1118 
1119 /* set up and create beep controls */
1120 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1121 			int idx, int dir)
1122 {
1123 	struct snd_kcontrol_new *knew;
1124 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1125 	int i;
1126 
1127 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1128 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1129 					    &alc_beep_mixer[i]);
1130 		if (!knew)
1131 			return -ENOMEM;
1132 		knew->private_value = beep_amp;
1133 	}
1134 	return 0;
1135 }
1136 
1137 static const struct snd_pci_quirk beep_allow_list[] = {
1138 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1139 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1140 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1141 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1142 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1143 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1144 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1145 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1146 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1147 	/* denylist -- no beep available */
1148 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1149 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1150 	{}
1151 };
1152 
1153 static inline int has_cdefine_beep(struct hda_codec *codec)
1154 {
1155 	struct alc_spec *spec = codec->spec;
1156 	const struct snd_pci_quirk *q;
1157 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1158 	if (q)
1159 		return q->value;
1160 	return spec->cdefine.enable_pcbeep;
1161 }
1162 #else
1163 #define set_beep_amp(spec, nid, idx, dir)	0
1164 #define has_cdefine_beep(codec)		0
1165 #endif
1166 
1167 /* parse the BIOS configuration and set up the alc_spec */
1168 /* return 1 if successful, 0 if the proper config is not found,
1169  * or a negative error code
1170  */
1171 static int alc_parse_auto_config(struct hda_codec *codec,
1172 				 const hda_nid_t *ignore_nids,
1173 				 const hda_nid_t *ssid_nids)
1174 {
1175 	struct alc_spec *spec = codec->spec;
1176 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1177 	int err;
1178 
1179 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1180 				       spec->parse_flags);
1181 	if (err < 0)
1182 		return err;
1183 
1184 	if (ssid_nids)
1185 		alc_ssid_check(codec, ssid_nids);
1186 
1187 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1188 	if (err < 0)
1189 		return err;
1190 
1191 	return 1;
1192 }
1193 
1194 /* common preparation job for alc_spec */
1195 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1196 {
1197 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1198 	int err;
1199 
1200 	if (!spec)
1201 		return -ENOMEM;
1202 	codec->spec = spec;
1203 	snd_hda_gen_spec_init(&spec->gen);
1204 	spec->gen.mixer_nid = mixer_nid;
1205 	spec->gen.own_eapd_ctl = 1;
1206 	codec->single_adc_amp = 1;
1207 	/* FIXME: do we need this for all Realtek codec models? */
1208 	codec->spdif_status_reset = 1;
1209 	codec->forced_resume = 1;
1210 	codec->patch_ops = alc_patch_ops;
1211 	mutex_init(&spec->coef_mutex);
1212 
1213 	err = alc_codec_rename_from_preset(codec);
1214 	if (err < 0) {
1215 		kfree(spec);
1216 		return err;
1217 	}
1218 	return 0;
1219 }
1220 
1221 static int alc880_parse_auto_config(struct hda_codec *codec)
1222 {
1223 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1224 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1225 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1226 }
1227 
1228 /*
1229  * ALC880 fix-ups
1230  */
1231 enum {
1232 	ALC880_FIXUP_GPIO1,
1233 	ALC880_FIXUP_GPIO2,
1234 	ALC880_FIXUP_MEDION_RIM,
1235 	ALC880_FIXUP_LG,
1236 	ALC880_FIXUP_LG_LW25,
1237 	ALC880_FIXUP_W810,
1238 	ALC880_FIXUP_EAPD_COEF,
1239 	ALC880_FIXUP_TCL_S700,
1240 	ALC880_FIXUP_VOL_KNOB,
1241 	ALC880_FIXUP_FUJITSU,
1242 	ALC880_FIXUP_F1734,
1243 	ALC880_FIXUP_UNIWILL,
1244 	ALC880_FIXUP_UNIWILL_DIG,
1245 	ALC880_FIXUP_Z71V,
1246 	ALC880_FIXUP_ASUS_W5A,
1247 	ALC880_FIXUP_3ST_BASE,
1248 	ALC880_FIXUP_3ST,
1249 	ALC880_FIXUP_3ST_DIG,
1250 	ALC880_FIXUP_5ST_BASE,
1251 	ALC880_FIXUP_5ST,
1252 	ALC880_FIXUP_5ST_DIG,
1253 	ALC880_FIXUP_6ST_BASE,
1254 	ALC880_FIXUP_6ST,
1255 	ALC880_FIXUP_6ST_DIG,
1256 	ALC880_FIXUP_6ST_AUTOMUTE,
1257 };
1258 
1259 /* enable the volume-knob widget support on NID 0x21 */
1260 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1261 				  const struct hda_fixup *fix, int action)
1262 {
1263 	if (action == HDA_FIXUP_ACT_PROBE)
1264 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1265 						    alc_update_knob_master);
1266 }
1267 
1268 static const struct hda_fixup alc880_fixups[] = {
1269 	[ALC880_FIXUP_GPIO1] = {
1270 		.type = HDA_FIXUP_FUNC,
1271 		.v.func = alc_fixup_gpio1,
1272 	},
1273 	[ALC880_FIXUP_GPIO2] = {
1274 		.type = HDA_FIXUP_FUNC,
1275 		.v.func = alc_fixup_gpio2,
1276 	},
1277 	[ALC880_FIXUP_MEDION_RIM] = {
1278 		.type = HDA_FIXUP_VERBS,
1279 		.v.verbs = (const struct hda_verb[]) {
1280 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1281 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1282 			{ }
1283 		},
1284 		.chained = true,
1285 		.chain_id = ALC880_FIXUP_GPIO2,
1286 	},
1287 	[ALC880_FIXUP_LG] = {
1288 		.type = HDA_FIXUP_PINS,
1289 		.v.pins = (const struct hda_pintbl[]) {
1290 			/* disable bogus unused pins */
1291 			{ 0x16, 0x411111f0 },
1292 			{ 0x18, 0x411111f0 },
1293 			{ 0x1a, 0x411111f0 },
1294 			{ }
1295 		}
1296 	},
1297 	[ALC880_FIXUP_LG_LW25] = {
1298 		.type = HDA_FIXUP_PINS,
1299 		.v.pins = (const struct hda_pintbl[]) {
1300 			{ 0x1a, 0x0181344f }, /* line-in */
1301 			{ 0x1b, 0x0321403f }, /* headphone */
1302 			{ }
1303 		}
1304 	},
1305 	[ALC880_FIXUP_W810] = {
1306 		.type = HDA_FIXUP_PINS,
1307 		.v.pins = (const struct hda_pintbl[]) {
1308 			/* disable bogus unused pins */
1309 			{ 0x17, 0x411111f0 },
1310 			{ }
1311 		},
1312 		.chained = true,
1313 		.chain_id = ALC880_FIXUP_GPIO2,
1314 	},
1315 	[ALC880_FIXUP_EAPD_COEF] = {
1316 		.type = HDA_FIXUP_VERBS,
1317 		.v.verbs = (const struct hda_verb[]) {
1318 			/* change to EAPD mode */
1319 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1320 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1321 			{}
1322 		},
1323 	},
1324 	[ALC880_FIXUP_TCL_S700] = {
1325 		.type = HDA_FIXUP_VERBS,
1326 		.v.verbs = (const struct hda_verb[]) {
1327 			/* change to EAPD mode */
1328 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1329 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1330 			{}
1331 		},
1332 		.chained = true,
1333 		.chain_id = ALC880_FIXUP_GPIO2,
1334 	},
1335 	[ALC880_FIXUP_VOL_KNOB] = {
1336 		.type = HDA_FIXUP_FUNC,
1337 		.v.func = alc880_fixup_vol_knob,
1338 	},
1339 	[ALC880_FIXUP_FUJITSU] = {
1340 		/* override all pins as BIOS on old Amilo is broken */
1341 		.type = HDA_FIXUP_PINS,
1342 		.v.pins = (const struct hda_pintbl[]) {
1343 			{ 0x14, 0x0121401f }, /* HP */
1344 			{ 0x15, 0x99030120 }, /* speaker */
1345 			{ 0x16, 0x99030130 }, /* bass speaker */
1346 			{ 0x17, 0x411111f0 }, /* N/A */
1347 			{ 0x18, 0x411111f0 }, /* N/A */
1348 			{ 0x19, 0x01a19950 }, /* mic-in */
1349 			{ 0x1a, 0x411111f0 }, /* N/A */
1350 			{ 0x1b, 0x411111f0 }, /* N/A */
1351 			{ 0x1c, 0x411111f0 }, /* N/A */
1352 			{ 0x1d, 0x411111f0 }, /* N/A */
1353 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1354 			{ }
1355 		},
1356 		.chained = true,
1357 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1358 	},
1359 	[ALC880_FIXUP_F1734] = {
1360 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1361 		.type = HDA_FIXUP_PINS,
1362 		.v.pins = (const struct hda_pintbl[]) {
1363 			{ 0x14, 0x0121401f }, /* HP */
1364 			{ 0x15, 0x99030120 }, /* speaker */
1365 			{ 0x16, 0x411111f0 }, /* N/A */
1366 			{ 0x17, 0x411111f0 }, /* N/A */
1367 			{ 0x18, 0x411111f0 }, /* N/A */
1368 			{ 0x19, 0x01a19950 }, /* mic-in */
1369 			{ 0x1a, 0x411111f0 }, /* N/A */
1370 			{ 0x1b, 0x411111f0 }, /* N/A */
1371 			{ 0x1c, 0x411111f0 }, /* N/A */
1372 			{ 0x1d, 0x411111f0 }, /* N/A */
1373 			{ 0x1e, 0x411111f0 }, /* N/A */
1374 			{ }
1375 		},
1376 		.chained = true,
1377 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1378 	},
1379 	[ALC880_FIXUP_UNIWILL] = {
1380 		/* need to fix HP and speaker pins to be parsed correctly */
1381 		.type = HDA_FIXUP_PINS,
1382 		.v.pins = (const struct hda_pintbl[]) {
1383 			{ 0x14, 0x0121411f }, /* HP */
1384 			{ 0x15, 0x99030120 }, /* speaker */
1385 			{ 0x16, 0x99030130 }, /* bass speaker */
1386 			{ }
1387 		},
1388 	},
1389 	[ALC880_FIXUP_UNIWILL_DIG] = {
1390 		.type = HDA_FIXUP_PINS,
1391 		.v.pins = (const struct hda_pintbl[]) {
1392 			/* disable bogus unused pins */
1393 			{ 0x17, 0x411111f0 },
1394 			{ 0x19, 0x411111f0 },
1395 			{ 0x1b, 0x411111f0 },
1396 			{ 0x1f, 0x411111f0 },
1397 			{ }
1398 		}
1399 	},
1400 	[ALC880_FIXUP_Z71V] = {
1401 		.type = HDA_FIXUP_PINS,
1402 		.v.pins = (const struct hda_pintbl[]) {
1403 			/* set up the whole pins as BIOS is utterly broken */
1404 			{ 0x14, 0x99030120 }, /* speaker */
1405 			{ 0x15, 0x0121411f }, /* HP */
1406 			{ 0x16, 0x411111f0 }, /* N/A */
1407 			{ 0x17, 0x411111f0 }, /* N/A */
1408 			{ 0x18, 0x01a19950 }, /* mic-in */
1409 			{ 0x19, 0x411111f0 }, /* N/A */
1410 			{ 0x1a, 0x01813031 }, /* line-in */
1411 			{ 0x1b, 0x411111f0 }, /* N/A */
1412 			{ 0x1c, 0x411111f0 }, /* N/A */
1413 			{ 0x1d, 0x411111f0 }, /* N/A */
1414 			{ 0x1e, 0x0144111e }, /* SPDIF */
1415 			{ }
1416 		}
1417 	},
1418 	[ALC880_FIXUP_ASUS_W5A] = {
1419 		.type = HDA_FIXUP_PINS,
1420 		.v.pins = (const struct hda_pintbl[]) {
1421 			/* set up the whole pins as BIOS is utterly broken */
1422 			{ 0x14, 0x0121411f }, /* HP */
1423 			{ 0x15, 0x411111f0 }, /* N/A */
1424 			{ 0x16, 0x411111f0 }, /* N/A */
1425 			{ 0x17, 0x411111f0 }, /* N/A */
1426 			{ 0x18, 0x90a60160 }, /* mic */
1427 			{ 0x19, 0x411111f0 }, /* N/A */
1428 			{ 0x1a, 0x411111f0 }, /* N/A */
1429 			{ 0x1b, 0x411111f0 }, /* N/A */
1430 			{ 0x1c, 0x411111f0 }, /* N/A */
1431 			{ 0x1d, 0x411111f0 }, /* N/A */
1432 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1433 			{ }
1434 		},
1435 		.chained = true,
1436 		.chain_id = ALC880_FIXUP_GPIO1,
1437 	},
1438 	[ALC880_FIXUP_3ST_BASE] = {
1439 		.type = HDA_FIXUP_PINS,
1440 		.v.pins = (const struct hda_pintbl[]) {
1441 			{ 0x14, 0x01014010 }, /* line-out */
1442 			{ 0x15, 0x411111f0 }, /* N/A */
1443 			{ 0x16, 0x411111f0 }, /* N/A */
1444 			{ 0x17, 0x411111f0 }, /* N/A */
1445 			{ 0x18, 0x01a19c30 }, /* mic-in */
1446 			{ 0x19, 0x0121411f }, /* HP */
1447 			{ 0x1a, 0x01813031 }, /* line-in */
1448 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1449 			{ 0x1c, 0x411111f0 }, /* N/A */
1450 			{ 0x1d, 0x411111f0 }, /* N/A */
1451 			/* 0x1e is filled in below */
1452 			{ 0x1f, 0x411111f0 }, /* N/A */
1453 			{ }
1454 		}
1455 	},
1456 	[ALC880_FIXUP_3ST] = {
1457 		.type = HDA_FIXUP_PINS,
1458 		.v.pins = (const struct hda_pintbl[]) {
1459 			{ 0x1e, 0x411111f0 }, /* N/A */
1460 			{ }
1461 		},
1462 		.chained = true,
1463 		.chain_id = ALC880_FIXUP_3ST_BASE,
1464 	},
1465 	[ALC880_FIXUP_3ST_DIG] = {
1466 		.type = HDA_FIXUP_PINS,
1467 		.v.pins = (const struct hda_pintbl[]) {
1468 			{ 0x1e, 0x0144111e }, /* SPDIF */
1469 			{ }
1470 		},
1471 		.chained = true,
1472 		.chain_id = ALC880_FIXUP_3ST_BASE,
1473 	},
1474 	[ALC880_FIXUP_5ST_BASE] = {
1475 		.type = HDA_FIXUP_PINS,
1476 		.v.pins = (const struct hda_pintbl[]) {
1477 			{ 0x14, 0x01014010 }, /* front */
1478 			{ 0x15, 0x411111f0 }, /* N/A */
1479 			{ 0x16, 0x01011411 }, /* CLFE */
1480 			{ 0x17, 0x01016412 }, /* surr */
1481 			{ 0x18, 0x01a19c30 }, /* mic-in */
1482 			{ 0x19, 0x0121411f }, /* HP */
1483 			{ 0x1a, 0x01813031 }, /* line-in */
1484 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1485 			{ 0x1c, 0x411111f0 }, /* N/A */
1486 			{ 0x1d, 0x411111f0 }, /* N/A */
1487 			/* 0x1e is filled in below */
1488 			{ 0x1f, 0x411111f0 }, /* N/A */
1489 			{ }
1490 		}
1491 	},
1492 	[ALC880_FIXUP_5ST] = {
1493 		.type = HDA_FIXUP_PINS,
1494 		.v.pins = (const struct hda_pintbl[]) {
1495 			{ 0x1e, 0x411111f0 }, /* N/A */
1496 			{ }
1497 		},
1498 		.chained = true,
1499 		.chain_id = ALC880_FIXUP_5ST_BASE,
1500 	},
1501 	[ALC880_FIXUP_5ST_DIG] = {
1502 		.type = HDA_FIXUP_PINS,
1503 		.v.pins = (const struct hda_pintbl[]) {
1504 			{ 0x1e, 0x0144111e }, /* SPDIF */
1505 			{ }
1506 		},
1507 		.chained = true,
1508 		.chain_id = ALC880_FIXUP_5ST_BASE,
1509 	},
1510 	[ALC880_FIXUP_6ST_BASE] = {
1511 		.type = HDA_FIXUP_PINS,
1512 		.v.pins = (const struct hda_pintbl[]) {
1513 			{ 0x14, 0x01014010 }, /* front */
1514 			{ 0x15, 0x01016412 }, /* surr */
1515 			{ 0x16, 0x01011411 }, /* CLFE */
1516 			{ 0x17, 0x01012414 }, /* side */
1517 			{ 0x18, 0x01a19c30 }, /* mic-in */
1518 			{ 0x19, 0x02a19c40 }, /* front-mic */
1519 			{ 0x1a, 0x01813031 }, /* line-in */
1520 			{ 0x1b, 0x0121411f }, /* HP */
1521 			{ 0x1c, 0x411111f0 }, /* N/A */
1522 			{ 0x1d, 0x411111f0 }, /* N/A */
1523 			/* 0x1e is filled in below */
1524 			{ 0x1f, 0x411111f0 }, /* N/A */
1525 			{ }
1526 		}
1527 	},
1528 	[ALC880_FIXUP_6ST] = {
1529 		.type = HDA_FIXUP_PINS,
1530 		.v.pins = (const struct hda_pintbl[]) {
1531 			{ 0x1e, 0x411111f0 }, /* N/A */
1532 			{ }
1533 		},
1534 		.chained = true,
1535 		.chain_id = ALC880_FIXUP_6ST_BASE,
1536 	},
1537 	[ALC880_FIXUP_6ST_DIG] = {
1538 		.type = HDA_FIXUP_PINS,
1539 		.v.pins = (const struct hda_pintbl[]) {
1540 			{ 0x1e, 0x0144111e }, /* SPDIF */
1541 			{ }
1542 		},
1543 		.chained = true,
1544 		.chain_id = ALC880_FIXUP_6ST_BASE,
1545 	},
1546 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1547 		.type = HDA_FIXUP_PINS,
1548 		.v.pins = (const struct hda_pintbl[]) {
1549 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1550 			{ }
1551 		},
1552 		.chained_before = true,
1553 		.chain_id = ALC880_FIXUP_6ST_BASE,
1554 	},
1555 };
1556 
1557 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1558 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1559 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1560 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1561 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1562 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1563 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1564 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1565 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1566 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1567 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1568 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1569 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1570 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1571 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1572 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1573 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1574 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1575 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1576 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1577 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1578 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1579 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1580 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1581 
1582 	/* Below is the copied entries from alc880_quirks.c.
1583 	 * It's not quite sure whether BIOS sets the correct pin-config table
1584 	 * on these machines, thus they are kept to be compatible with
1585 	 * the old static quirks.  Once when it's confirmed to work without
1586 	 * these overrides, it'd be better to remove.
1587 	 */
1588 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1589 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1590 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1591 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1592 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1593 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1594 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1595 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1596 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1597 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1598 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1599 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1600 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1601 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1602 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1603 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1605 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1606 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1607 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1608 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1609 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1610 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1611 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1613 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1615 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1616 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1617 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1618 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1619 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1620 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1621 	/* default Intel */
1622 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1623 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1624 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1625 	{}
1626 };
1627 
1628 static const struct hda_model_fixup alc880_fixup_models[] = {
1629 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1630 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1631 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1632 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1633 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1634 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1635 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1636 	{}
1637 };
1638 
1639 
1640 /*
1641  * OK, here we have finally the patch for ALC880
1642  */
1643 static int patch_alc880(struct hda_codec *codec)
1644 {
1645 	struct alc_spec *spec;
1646 	int err;
1647 
1648 	err = alc_alloc_spec(codec, 0x0b);
1649 	if (err < 0)
1650 		return err;
1651 
1652 	spec = codec->spec;
1653 	spec->gen.need_dac_fix = 1;
1654 	spec->gen.beep_nid = 0x01;
1655 
1656 	codec->patch_ops.unsol_event = alc880_unsol_event;
1657 
1658 	alc_pre_init(codec);
1659 
1660 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1661 		       alc880_fixups);
1662 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1663 
1664 	/* automatic parse from the BIOS config */
1665 	err = alc880_parse_auto_config(codec);
1666 	if (err < 0)
1667 		goto error;
1668 
1669 	if (!spec->gen.no_analog) {
1670 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1671 		if (err < 0)
1672 			goto error;
1673 	}
1674 
1675 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1676 
1677 	return 0;
1678 
1679  error:
1680 	alc_free(codec);
1681 	return err;
1682 }
1683 
1684 
1685 /*
1686  * ALC260 support
1687  */
1688 static int alc260_parse_auto_config(struct hda_codec *codec)
1689 {
1690 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1691 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1692 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1693 }
1694 
1695 /*
1696  * Pin config fixes
1697  */
1698 enum {
1699 	ALC260_FIXUP_HP_DC5750,
1700 	ALC260_FIXUP_HP_PIN_0F,
1701 	ALC260_FIXUP_COEF,
1702 	ALC260_FIXUP_GPIO1,
1703 	ALC260_FIXUP_GPIO1_TOGGLE,
1704 	ALC260_FIXUP_REPLACER,
1705 	ALC260_FIXUP_HP_B1900,
1706 	ALC260_FIXUP_KN1,
1707 	ALC260_FIXUP_FSC_S7020,
1708 	ALC260_FIXUP_FSC_S7020_JWSE,
1709 	ALC260_FIXUP_VAIO_PINS,
1710 };
1711 
1712 static void alc260_gpio1_automute(struct hda_codec *codec)
1713 {
1714 	struct alc_spec *spec = codec->spec;
1715 
1716 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1717 }
1718 
1719 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1720 				      const struct hda_fixup *fix, int action)
1721 {
1722 	struct alc_spec *spec = codec->spec;
1723 	if (action == HDA_FIXUP_ACT_PROBE) {
1724 		/* although the machine has only one output pin, we need to
1725 		 * toggle GPIO1 according to the jack state
1726 		 */
1727 		spec->gen.automute_hook = alc260_gpio1_automute;
1728 		spec->gen.detect_hp = 1;
1729 		spec->gen.automute_speaker = 1;
1730 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1731 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1732 						    snd_hda_gen_hp_automute);
1733 		alc_setup_gpio(codec, 0x01);
1734 	}
1735 }
1736 
1737 static void alc260_fixup_kn1(struct hda_codec *codec,
1738 			     const struct hda_fixup *fix, int action)
1739 {
1740 	struct alc_spec *spec = codec->spec;
1741 	static const struct hda_pintbl pincfgs[] = {
1742 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1743 		{ 0x12, 0x90a60160 }, /* int mic */
1744 		{ 0x13, 0x02a19000 }, /* ext mic */
1745 		{ 0x18, 0x01446000 }, /* SPDIF out */
1746 		/* disable bogus I/O pins */
1747 		{ 0x10, 0x411111f0 },
1748 		{ 0x11, 0x411111f0 },
1749 		{ 0x14, 0x411111f0 },
1750 		{ 0x15, 0x411111f0 },
1751 		{ 0x16, 0x411111f0 },
1752 		{ 0x17, 0x411111f0 },
1753 		{ 0x19, 0x411111f0 },
1754 		{ }
1755 	};
1756 
1757 	switch (action) {
1758 	case HDA_FIXUP_ACT_PRE_PROBE:
1759 		snd_hda_apply_pincfgs(codec, pincfgs);
1760 		spec->init_amp = ALC_INIT_NONE;
1761 		break;
1762 	}
1763 }
1764 
1765 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1766 				   const struct hda_fixup *fix, int action)
1767 {
1768 	struct alc_spec *spec = codec->spec;
1769 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1770 		spec->init_amp = ALC_INIT_NONE;
1771 }
1772 
1773 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1774 				   const struct hda_fixup *fix, int action)
1775 {
1776 	struct alc_spec *spec = codec->spec;
1777 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1778 		spec->gen.add_jack_modes = 1;
1779 		spec->gen.hp_mic = 1;
1780 	}
1781 }
1782 
1783 static const struct hda_fixup alc260_fixups[] = {
1784 	[ALC260_FIXUP_HP_DC5750] = {
1785 		.type = HDA_FIXUP_PINS,
1786 		.v.pins = (const struct hda_pintbl[]) {
1787 			{ 0x11, 0x90130110 }, /* speaker */
1788 			{ }
1789 		}
1790 	},
1791 	[ALC260_FIXUP_HP_PIN_0F] = {
1792 		.type = HDA_FIXUP_PINS,
1793 		.v.pins = (const struct hda_pintbl[]) {
1794 			{ 0x0f, 0x01214000 }, /* HP */
1795 			{ }
1796 		}
1797 	},
1798 	[ALC260_FIXUP_COEF] = {
1799 		.type = HDA_FIXUP_VERBS,
1800 		.v.verbs = (const struct hda_verb[]) {
1801 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1802 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3040 },
1803 			{ }
1804 		},
1805 	},
1806 	[ALC260_FIXUP_GPIO1] = {
1807 		.type = HDA_FIXUP_FUNC,
1808 		.v.func = alc_fixup_gpio1,
1809 	},
1810 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1811 		.type = HDA_FIXUP_FUNC,
1812 		.v.func = alc260_fixup_gpio1_toggle,
1813 		.chained = true,
1814 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1815 	},
1816 	[ALC260_FIXUP_REPLACER] = {
1817 		.type = HDA_FIXUP_VERBS,
1818 		.v.verbs = (const struct hda_verb[]) {
1819 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1820 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1821 			{ }
1822 		},
1823 		.chained = true,
1824 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1825 	},
1826 	[ALC260_FIXUP_HP_B1900] = {
1827 		.type = HDA_FIXUP_FUNC,
1828 		.v.func = alc260_fixup_gpio1_toggle,
1829 		.chained = true,
1830 		.chain_id = ALC260_FIXUP_COEF,
1831 	},
1832 	[ALC260_FIXUP_KN1] = {
1833 		.type = HDA_FIXUP_FUNC,
1834 		.v.func = alc260_fixup_kn1,
1835 	},
1836 	[ALC260_FIXUP_FSC_S7020] = {
1837 		.type = HDA_FIXUP_FUNC,
1838 		.v.func = alc260_fixup_fsc_s7020,
1839 	},
1840 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1841 		.type = HDA_FIXUP_FUNC,
1842 		.v.func = alc260_fixup_fsc_s7020_jwse,
1843 		.chained = true,
1844 		.chain_id = ALC260_FIXUP_FSC_S7020,
1845 	},
1846 	[ALC260_FIXUP_VAIO_PINS] = {
1847 		.type = HDA_FIXUP_PINS,
1848 		.v.pins = (const struct hda_pintbl[]) {
1849 			/* Pin configs are missing completely on some VAIOs */
1850 			{ 0x0f, 0x01211020 },
1851 			{ 0x10, 0x0001003f },
1852 			{ 0x11, 0x411111f0 },
1853 			{ 0x12, 0x01a15930 },
1854 			{ 0x13, 0x411111f0 },
1855 			{ 0x14, 0x411111f0 },
1856 			{ 0x15, 0x411111f0 },
1857 			{ 0x16, 0x411111f0 },
1858 			{ 0x17, 0x411111f0 },
1859 			{ 0x18, 0x411111f0 },
1860 			{ 0x19, 0x411111f0 },
1861 			{ }
1862 		}
1863 	},
1864 };
1865 
1866 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1867 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1868 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1869 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1870 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1871 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1872 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1873 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1874 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1875 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1876 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1877 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1878 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1879 	{}
1880 };
1881 
1882 static const struct hda_model_fixup alc260_fixup_models[] = {
1883 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1884 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1885 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1886 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1887 	{}
1888 };
1889 
1890 /*
1891  */
1892 static int patch_alc260(struct hda_codec *codec)
1893 {
1894 	struct alc_spec *spec;
1895 	int err;
1896 
1897 	err = alc_alloc_spec(codec, 0x07);
1898 	if (err < 0)
1899 		return err;
1900 
1901 	spec = codec->spec;
1902 	/* as quite a few machines require HP amp for speaker outputs,
1903 	 * it's easier to enable it unconditionally; even if it's unneeded,
1904 	 * it's almost harmless.
1905 	 */
1906 	spec->gen.prefer_hp_amp = 1;
1907 	spec->gen.beep_nid = 0x01;
1908 
1909 	spec->shutup = alc_eapd_shutup;
1910 
1911 	alc_pre_init(codec);
1912 
1913 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1914 			   alc260_fixups);
1915 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1916 
1917 	/* automatic parse from the BIOS config */
1918 	err = alc260_parse_auto_config(codec);
1919 	if (err < 0)
1920 		goto error;
1921 
1922 	if (!spec->gen.no_analog) {
1923 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1924 		if (err < 0)
1925 			goto error;
1926 	}
1927 
1928 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1929 
1930 	return 0;
1931 
1932  error:
1933 	alc_free(codec);
1934 	return err;
1935 }
1936 
1937 
1938 /*
1939  * ALC882/883/885/888/889 support
1940  *
1941  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1942  * configuration.  Each pin widget can choose any input DACs and a mixer.
1943  * Each ADC is connected from a mixer of all inputs.  This makes possible
1944  * 6-channel independent captures.
1945  *
1946  * In addition, an independent DAC for the multi-playback (not used in this
1947  * driver yet).
1948  */
1949 
1950 /*
1951  * Pin config fixes
1952  */
1953 enum {
1954 	ALC882_FIXUP_ABIT_AW9D_MAX,
1955 	ALC882_FIXUP_LENOVO_Y530,
1956 	ALC882_FIXUP_PB_M5210,
1957 	ALC882_FIXUP_ACER_ASPIRE_7736,
1958 	ALC882_FIXUP_ASUS_W90V,
1959 	ALC889_FIXUP_CD,
1960 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1961 	ALC889_FIXUP_VAIO_TT,
1962 	ALC888_FIXUP_EEE1601,
1963 	ALC886_FIXUP_EAPD,
1964 	ALC882_FIXUP_EAPD,
1965 	ALC883_FIXUP_EAPD,
1966 	ALC883_FIXUP_ACER_EAPD,
1967 	ALC882_FIXUP_GPIO1,
1968 	ALC882_FIXUP_GPIO2,
1969 	ALC882_FIXUP_GPIO3,
1970 	ALC889_FIXUP_COEF,
1971 	ALC882_FIXUP_ASUS_W2JC,
1972 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1973 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1974 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1975 	ALC885_FIXUP_MACPRO_GPIO,
1976 	ALC889_FIXUP_DAC_ROUTE,
1977 	ALC889_FIXUP_MBP_VREF,
1978 	ALC889_FIXUP_IMAC91_VREF,
1979 	ALC889_FIXUP_MBA11_VREF,
1980 	ALC889_FIXUP_MBA21_VREF,
1981 	ALC889_FIXUP_MP11_VREF,
1982 	ALC889_FIXUP_MP41_VREF,
1983 	ALC882_FIXUP_INV_DMIC,
1984 	ALC882_FIXUP_NO_PRIMARY_HP,
1985 	ALC887_FIXUP_ASUS_BASS,
1986 	ALC887_FIXUP_BASS_CHMAP,
1987 	ALC1220_FIXUP_GB_DUAL_CODECS,
1988 	ALC1220_FIXUP_GB_X570,
1989 	ALC1220_FIXUP_CLEVO_P950,
1990 	ALC1220_FIXUP_CLEVO_PB51ED,
1991 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1992 	ALC887_FIXUP_ASUS_AUDIO,
1993 	ALC887_FIXUP_ASUS_HMIC,
1994 	ALCS1200A_FIXUP_MIC_VREF,
1995 	ALC888VD_FIXUP_MIC_100VREF,
1996 };
1997 
1998 static void alc889_fixup_coef(struct hda_codec *codec,
1999 			      const struct hda_fixup *fix, int action)
2000 {
2001 	if (action != HDA_FIXUP_ACT_INIT)
2002 		return;
2003 	alc_update_coef_idx(codec, 7, 0, 0x2030);
2004 }
2005 
2006 /* set up GPIO at initialization */
2007 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2008 				     const struct hda_fixup *fix, int action)
2009 {
2010 	struct alc_spec *spec = codec->spec;
2011 
2012 	spec->gpio_write_delay = true;
2013 	alc_fixup_gpio3(codec, fix, action);
2014 }
2015 
2016 /* Fix the connection of some pins for ALC889:
2017  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2018  * work correctly (bko#42740)
2019  */
2020 static void alc889_fixup_dac_route(struct hda_codec *codec,
2021 				   const struct hda_fixup *fix, int action)
2022 {
2023 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2024 		/* fake the connections during parsing the tree */
2025 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2026 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2027 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2028 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2029 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2030 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2031 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2032 		/* restore the connections */
2033 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2034 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2035 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2036 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2037 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2038 	}
2039 }
2040 
2041 /* Set VREF on HP pin */
2042 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2043 				  const struct hda_fixup *fix, int action)
2044 {
2045 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2046 	struct alc_spec *spec = codec->spec;
2047 	int i;
2048 
2049 	if (action != HDA_FIXUP_ACT_INIT)
2050 		return;
2051 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2052 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2053 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2054 			continue;
2055 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2056 		val |= AC_PINCTL_VREF_80;
2057 		snd_hda_set_pin_ctl(codec, nids[i], val);
2058 		spec->gen.keep_vref_in_automute = 1;
2059 		break;
2060 	}
2061 }
2062 
2063 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2064 				  const hda_nid_t *nids, int num_nids)
2065 {
2066 	struct alc_spec *spec = codec->spec;
2067 	int i;
2068 
2069 	for (i = 0; i < num_nids; i++) {
2070 		unsigned int val;
2071 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2072 		val |= AC_PINCTL_VREF_50;
2073 		snd_hda_set_pin_ctl(codec, nids[i], val);
2074 	}
2075 	spec->gen.keep_vref_in_automute = 1;
2076 }
2077 
2078 /* Set VREF on speaker pins on imac91 */
2079 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2080 				     const struct hda_fixup *fix, int action)
2081 {
2082 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2083 
2084 	if (action == HDA_FIXUP_ACT_INIT)
2085 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2086 }
2087 
2088 /* Set VREF on speaker pins on mba11 */
2089 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2090 				    const struct hda_fixup *fix, int action)
2091 {
2092 	static const hda_nid_t nids[] = { 0x18 };
2093 
2094 	if (action == HDA_FIXUP_ACT_INIT)
2095 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2096 }
2097 
2098 /* Set VREF on speaker pins on mba21 */
2099 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2100 				    const struct hda_fixup *fix, int action)
2101 {
2102 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2103 
2104 	if (action == HDA_FIXUP_ACT_INIT)
2105 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2106 }
2107 
2108 /* Don't take HP output as primary
2109  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2110  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2111  */
2112 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2113 				       const struct hda_fixup *fix, int action)
2114 {
2115 	struct alc_spec *spec = codec->spec;
2116 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2117 		spec->gen.no_primary_hp = 1;
2118 		spec->gen.no_multi_io = 1;
2119 	}
2120 }
2121 
2122 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2123 				 const struct hda_fixup *fix, int action);
2124 
2125 /* For dual-codec configuration, we need to disable some features to avoid
2126  * conflicts of kctls and PCM streams
2127  */
2128 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2129 				  const struct hda_fixup *fix, int action)
2130 {
2131 	struct alc_spec *spec = codec->spec;
2132 
2133 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2134 		return;
2135 	/* disable vmaster */
2136 	spec->gen.suppress_vmaster = 1;
2137 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2138 	spec->gen.suppress_auto_mute = 1;
2139 	spec->gen.suppress_auto_mic = 1;
2140 	/* disable aamix as well */
2141 	spec->gen.mixer_nid = 0;
2142 	/* add location prefix to avoid conflicts */
2143 	codec->force_pin_prefix = 1;
2144 }
2145 
2146 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2147 		       const char *newname)
2148 {
2149 	struct snd_kcontrol *kctl;
2150 
2151 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2152 	if (kctl)
2153 		snd_ctl_rename(codec->card, kctl, newname);
2154 }
2155 
2156 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2157 					 const struct hda_fixup *fix,
2158 					 int action)
2159 {
2160 	alc_fixup_dual_codecs(codec, fix, action);
2161 	switch (action) {
2162 	case HDA_FIXUP_ACT_PRE_PROBE:
2163 		/* override card longname to provide a unique UCM profile */
2164 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2165 		break;
2166 	case HDA_FIXUP_ACT_BUILD:
2167 		/* rename Capture controls depending on the codec */
2168 		rename_ctl(codec, "Capture Volume",
2169 			   codec->addr == 0 ?
2170 			   "Rear-Panel Capture Volume" :
2171 			   "Front-Panel Capture Volume");
2172 		rename_ctl(codec, "Capture Switch",
2173 			   codec->addr == 0 ?
2174 			   "Rear-Panel Capture Switch" :
2175 			   "Front-Panel Capture Switch");
2176 		break;
2177 	}
2178 }
2179 
2180 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2181 				     const struct hda_fixup *fix,
2182 				     int action)
2183 {
2184 	static const hda_nid_t conn1[] = { 0x0c };
2185 	static const struct coef_fw gb_x570_coefs[] = {
2186 		WRITE_COEF(0x07, 0x03c0),
2187 		WRITE_COEF(0x1a, 0x01c1),
2188 		WRITE_COEF(0x1b, 0x0202),
2189 		WRITE_COEF(0x43, 0x3005),
2190 		{}
2191 	};
2192 
2193 	switch (action) {
2194 	case HDA_FIXUP_ACT_PRE_PROBE:
2195 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2196 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2197 		break;
2198 	case HDA_FIXUP_ACT_INIT:
2199 		alc_process_coef_fw(codec, gb_x570_coefs);
2200 		break;
2201 	}
2202 }
2203 
2204 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2205 				     const struct hda_fixup *fix,
2206 				     int action)
2207 {
2208 	static const hda_nid_t conn1[] = { 0x0c };
2209 
2210 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2211 		return;
2212 
2213 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2214 	/* We therefore want to make sure 0x14 (front headphone) and
2215 	 * 0x1b (speakers) use the stereo DAC 0x02
2216 	 */
2217 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2218 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2219 }
2220 
2221 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2222 				const struct hda_fixup *fix, int action);
2223 
2224 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2225 				     const struct hda_fixup *fix,
2226 				     int action)
2227 {
2228 	alc1220_fixup_clevo_p950(codec, fix, action);
2229 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2230 }
2231 
2232 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2233 					 struct hda_jack_callback *jack)
2234 {
2235 	struct alc_spec *spec = codec->spec;
2236 	unsigned int vref;
2237 
2238 	snd_hda_gen_hp_automute(codec, jack);
2239 
2240 	if (spec->gen.hp_jack_present)
2241 		vref = AC_PINCTL_VREF_80;
2242 	else
2243 		vref = AC_PINCTL_VREF_HIZ;
2244 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2245 }
2246 
2247 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2248 				     const struct hda_fixup *fix, int action)
2249 {
2250 	struct alc_spec *spec = codec->spec;
2251 	if (action != HDA_FIXUP_ACT_PROBE)
2252 		return;
2253 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2254 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2255 }
2256 
2257 static const struct hda_fixup alc882_fixups[] = {
2258 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2259 		.type = HDA_FIXUP_PINS,
2260 		.v.pins = (const struct hda_pintbl[]) {
2261 			{ 0x15, 0x01080104 }, /* side */
2262 			{ 0x16, 0x01011012 }, /* rear */
2263 			{ 0x17, 0x01016011 }, /* clfe */
2264 			{ }
2265 		}
2266 	},
2267 	[ALC882_FIXUP_LENOVO_Y530] = {
2268 		.type = HDA_FIXUP_PINS,
2269 		.v.pins = (const struct hda_pintbl[]) {
2270 			{ 0x15, 0x99130112 }, /* rear int speakers */
2271 			{ 0x16, 0x99130111 }, /* subwoofer */
2272 			{ }
2273 		}
2274 	},
2275 	[ALC882_FIXUP_PB_M5210] = {
2276 		.type = HDA_FIXUP_PINCTLS,
2277 		.v.pins = (const struct hda_pintbl[]) {
2278 			{ 0x19, PIN_VREF50 },
2279 			{}
2280 		}
2281 	},
2282 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2283 		.type = HDA_FIXUP_FUNC,
2284 		.v.func = alc_fixup_sku_ignore,
2285 	},
2286 	[ALC882_FIXUP_ASUS_W90V] = {
2287 		.type = HDA_FIXUP_PINS,
2288 		.v.pins = (const struct hda_pintbl[]) {
2289 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2290 			{ }
2291 		}
2292 	},
2293 	[ALC889_FIXUP_CD] = {
2294 		.type = HDA_FIXUP_PINS,
2295 		.v.pins = (const struct hda_pintbl[]) {
2296 			{ 0x1c, 0x993301f0 }, /* CD */
2297 			{ }
2298 		}
2299 	},
2300 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2301 		.type = HDA_FIXUP_PINS,
2302 		.v.pins = (const struct hda_pintbl[]) {
2303 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2304 			{ }
2305 		},
2306 		.chained = true,
2307 		.chain_id = ALC889_FIXUP_CD,
2308 	},
2309 	[ALC889_FIXUP_VAIO_TT] = {
2310 		.type = HDA_FIXUP_PINS,
2311 		.v.pins = (const struct hda_pintbl[]) {
2312 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2313 			{ }
2314 		}
2315 	},
2316 	[ALC888_FIXUP_EEE1601] = {
2317 		.type = HDA_FIXUP_VERBS,
2318 		.v.verbs = (const struct hda_verb[]) {
2319 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2320 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2321 			{ }
2322 		}
2323 	},
2324 	[ALC886_FIXUP_EAPD] = {
2325 		.type = HDA_FIXUP_VERBS,
2326 		.v.verbs = (const struct hda_verb[]) {
2327 			/* change to EAPD mode */
2328 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2329 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2330 			{ }
2331 		}
2332 	},
2333 	[ALC882_FIXUP_EAPD] = {
2334 		.type = HDA_FIXUP_VERBS,
2335 		.v.verbs = (const struct hda_verb[]) {
2336 			/* change to EAPD mode */
2337 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2338 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2339 			{ }
2340 		}
2341 	},
2342 	[ALC883_FIXUP_EAPD] = {
2343 		.type = HDA_FIXUP_VERBS,
2344 		.v.verbs = (const struct hda_verb[]) {
2345 			/* change to EAPD mode */
2346 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2347 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2348 			{ }
2349 		}
2350 	},
2351 	[ALC883_FIXUP_ACER_EAPD] = {
2352 		.type = HDA_FIXUP_VERBS,
2353 		.v.verbs = (const struct hda_verb[]) {
2354 			/* eanable EAPD on Acer laptops */
2355 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2356 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2357 			{ }
2358 		}
2359 	},
2360 	[ALC882_FIXUP_GPIO1] = {
2361 		.type = HDA_FIXUP_FUNC,
2362 		.v.func = alc_fixup_gpio1,
2363 	},
2364 	[ALC882_FIXUP_GPIO2] = {
2365 		.type = HDA_FIXUP_FUNC,
2366 		.v.func = alc_fixup_gpio2,
2367 	},
2368 	[ALC882_FIXUP_GPIO3] = {
2369 		.type = HDA_FIXUP_FUNC,
2370 		.v.func = alc_fixup_gpio3,
2371 	},
2372 	[ALC882_FIXUP_ASUS_W2JC] = {
2373 		.type = HDA_FIXUP_FUNC,
2374 		.v.func = alc_fixup_gpio1,
2375 		.chained = true,
2376 		.chain_id = ALC882_FIXUP_EAPD,
2377 	},
2378 	[ALC889_FIXUP_COEF] = {
2379 		.type = HDA_FIXUP_FUNC,
2380 		.v.func = alc889_fixup_coef,
2381 	},
2382 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2383 		.type = HDA_FIXUP_PINS,
2384 		.v.pins = (const struct hda_pintbl[]) {
2385 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2386 			{ 0x17, 0x99130112 }, /* surround speaker */
2387 			{ }
2388 		},
2389 		.chained = true,
2390 		.chain_id = ALC882_FIXUP_GPIO1,
2391 	},
2392 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2393 		.type = HDA_FIXUP_PINS,
2394 		.v.pins = (const struct hda_pintbl[]) {
2395 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2396 			{ 0x1b, 0x99130112 }, /* surround speaker */
2397 			{ }
2398 		},
2399 		.chained = true,
2400 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2401 	},
2402 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2403 		/* additional init verbs for Acer Aspire 8930G */
2404 		.type = HDA_FIXUP_VERBS,
2405 		.v.verbs = (const struct hda_verb[]) {
2406 			/* Enable all DACs */
2407 			/* DAC DISABLE/MUTE 1? */
2408 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2409 			 *  apparently. Init=0x38 */
2410 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2411 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2412 			/* DAC DISABLE/MUTE 2? */
2413 			/*  some bit here disables the other DACs.
2414 			 *  Init=0x4900 */
2415 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2416 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2417 			/* DMIC fix
2418 			 * This laptop has a stereo digital microphone.
2419 			 * The mics are only 1cm apart which makes the stereo
2420 			 * useless. However, either the mic or the ALC889
2421 			 * makes the signal become a difference/sum signal
2422 			 * instead of standard stereo, which is annoying.
2423 			 * So instead we flip this bit which makes the
2424 			 * codec replicate the sum signal to both channels,
2425 			 * turning it into a normal mono mic.
2426 			 */
2427 			/* DMIC_CONTROL? Init value = 0x0001 */
2428 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2429 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2430 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2431 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2432 			{ }
2433 		},
2434 		.chained = true,
2435 		.chain_id = ALC882_FIXUP_GPIO1,
2436 	},
2437 	[ALC885_FIXUP_MACPRO_GPIO] = {
2438 		.type = HDA_FIXUP_FUNC,
2439 		.v.func = alc885_fixup_macpro_gpio,
2440 	},
2441 	[ALC889_FIXUP_DAC_ROUTE] = {
2442 		.type = HDA_FIXUP_FUNC,
2443 		.v.func = alc889_fixup_dac_route,
2444 	},
2445 	[ALC889_FIXUP_MBP_VREF] = {
2446 		.type = HDA_FIXUP_FUNC,
2447 		.v.func = alc889_fixup_mbp_vref,
2448 		.chained = true,
2449 		.chain_id = ALC882_FIXUP_GPIO1,
2450 	},
2451 	[ALC889_FIXUP_IMAC91_VREF] = {
2452 		.type = HDA_FIXUP_FUNC,
2453 		.v.func = alc889_fixup_imac91_vref,
2454 		.chained = true,
2455 		.chain_id = ALC882_FIXUP_GPIO1,
2456 	},
2457 	[ALC889_FIXUP_MBA11_VREF] = {
2458 		.type = HDA_FIXUP_FUNC,
2459 		.v.func = alc889_fixup_mba11_vref,
2460 		.chained = true,
2461 		.chain_id = ALC889_FIXUP_MBP_VREF,
2462 	},
2463 	[ALC889_FIXUP_MBA21_VREF] = {
2464 		.type = HDA_FIXUP_FUNC,
2465 		.v.func = alc889_fixup_mba21_vref,
2466 		.chained = true,
2467 		.chain_id = ALC889_FIXUP_MBP_VREF,
2468 	},
2469 	[ALC889_FIXUP_MP11_VREF] = {
2470 		.type = HDA_FIXUP_FUNC,
2471 		.v.func = alc889_fixup_mba11_vref,
2472 		.chained = true,
2473 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2474 	},
2475 	[ALC889_FIXUP_MP41_VREF] = {
2476 		.type = HDA_FIXUP_FUNC,
2477 		.v.func = alc889_fixup_mbp_vref,
2478 		.chained = true,
2479 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2480 	},
2481 	[ALC882_FIXUP_INV_DMIC] = {
2482 		.type = HDA_FIXUP_FUNC,
2483 		.v.func = alc_fixup_inv_dmic,
2484 	},
2485 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2486 		.type = HDA_FIXUP_FUNC,
2487 		.v.func = alc882_fixup_no_primary_hp,
2488 	},
2489 	[ALC887_FIXUP_ASUS_BASS] = {
2490 		.type = HDA_FIXUP_PINS,
2491 		.v.pins = (const struct hda_pintbl[]) {
2492 			{0x16, 0x99130130}, /* bass speaker */
2493 			{}
2494 		},
2495 		.chained = true,
2496 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2497 	},
2498 	[ALC887_FIXUP_BASS_CHMAP] = {
2499 		.type = HDA_FIXUP_FUNC,
2500 		.v.func = alc_fixup_bass_chmap,
2501 	},
2502 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2503 		.type = HDA_FIXUP_FUNC,
2504 		.v.func = alc1220_fixup_gb_dual_codecs,
2505 	},
2506 	[ALC1220_FIXUP_GB_X570] = {
2507 		.type = HDA_FIXUP_FUNC,
2508 		.v.func = alc1220_fixup_gb_x570,
2509 	},
2510 	[ALC1220_FIXUP_CLEVO_P950] = {
2511 		.type = HDA_FIXUP_FUNC,
2512 		.v.func = alc1220_fixup_clevo_p950,
2513 	},
2514 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2515 		.type = HDA_FIXUP_FUNC,
2516 		.v.func = alc1220_fixup_clevo_pb51ed,
2517 	},
2518 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2519 		.type = HDA_FIXUP_PINS,
2520 		.v.pins = (const struct hda_pintbl[]) {
2521 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2522 			{}
2523 		},
2524 		.chained = true,
2525 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2526 	},
2527 	[ALC887_FIXUP_ASUS_AUDIO] = {
2528 		.type = HDA_FIXUP_PINS,
2529 		.v.pins = (const struct hda_pintbl[]) {
2530 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2531 			{ 0x19, 0x22219420 },
2532 			{}
2533 		},
2534 	},
2535 	[ALC887_FIXUP_ASUS_HMIC] = {
2536 		.type = HDA_FIXUP_FUNC,
2537 		.v.func = alc887_fixup_asus_jack,
2538 		.chained = true,
2539 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2540 	},
2541 	[ALCS1200A_FIXUP_MIC_VREF] = {
2542 		.type = HDA_FIXUP_PINCTLS,
2543 		.v.pins = (const struct hda_pintbl[]) {
2544 			{ 0x18, PIN_VREF50 }, /* rear mic */
2545 			{ 0x19, PIN_VREF50 }, /* front mic */
2546 			{}
2547 		}
2548 	},
2549 	[ALC888VD_FIXUP_MIC_100VREF] = {
2550 		.type = HDA_FIXUP_PINCTLS,
2551 		.v.pins = (const struct hda_pintbl[]) {
2552 			{ 0x18, PIN_VREF100 }, /* headset mic */
2553 			{}
2554 		}
2555 	},
2556 };
2557 
2558 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2559 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2560 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2561 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2562 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2563 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2564 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2565 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2566 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2567 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2568 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2569 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2570 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2571 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2572 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2573 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2574 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2575 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2576 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2577 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2578 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2579 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2580 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2581 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2582 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2583 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2584 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2585 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2586 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2587 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2588 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2589 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2590 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2591 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2592 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2593 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2594 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2595 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2596 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2597 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2598 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2599 
2600 	/* All Apple entries are in codec SSIDs */
2601 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2602 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2603 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2604 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2605 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2606 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2607 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2608 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2609 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2610 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2611 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2612 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2613 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2614 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2615 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2616 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2617 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2618 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2619 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2620 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2621 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2622 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2623 
2624 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2625 	SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2626 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2627 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2628 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2629 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2630 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2631 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2632 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2633 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2634 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2635 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2636 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2637 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2638 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2639 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2640 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2641 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2642 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2643 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2644 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2645 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2646 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2647 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2648 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2649 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2650 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2651 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 	SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2653 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2654 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2660 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2661 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2662 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2663 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2664 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2665 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2666 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2667 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2668 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2669 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2670 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2671 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2672 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2673 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2674 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2675 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2676 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2677 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2678 	{}
2679 };
2680 
2681 static const struct hda_model_fixup alc882_fixup_models[] = {
2682 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2683 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2684 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2685 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2686 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2687 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2688 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2689 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2690 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2691 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2692 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2693 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2694 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2695 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2696 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2697 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2698 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2699 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2700 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2701 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2702 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2703 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2704 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2705 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2706 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2707 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2708 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2709 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2710 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2711 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2712 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2713 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2714 	{}
2715 };
2716 
2717 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2718 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2719 		{0x14, 0x01014010},
2720 		{0x15, 0x01011012},
2721 		{0x16, 0x01016011},
2722 		{0x18, 0x01a19040},
2723 		{0x19, 0x02a19050},
2724 		{0x1a, 0x0181304f},
2725 		{0x1b, 0x0221401f},
2726 		{0x1e, 0x01456130}),
2727 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2728 		{0x14, 0x01015010},
2729 		{0x15, 0x01011012},
2730 		{0x16, 0x01011011},
2731 		{0x18, 0x01a11040},
2732 		{0x19, 0x02a19050},
2733 		{0x1a, 0x0181104f},
2734 		{0x1b, 0x0221401f},
2735 		{0x1e, 0x01451130}),
2736 	{}
2737 };
2738 
2739 /*
2740  * BIOS auto configuration
2741  */
2742 /* almost identical with ALC880 parser... */
2743 static int alc882_parse_auto_config(struct hda_codec *codec)
2744 {
2745 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2746 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2747 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2748 }
2749 
2750 /*
2751  */
2752 static int patch_alc882(struct hda_codec *codec)
2753 {
2754 	struct alc_spec *spec;
2755 	int err;
2756 
2757 	err = alc_alloc_spec(codec, 0x0b);
2758 	if (err < 0)
2759 		return err;
2760 
2761 	spec = codec->spec;
2762 
2763 	switch (codec->core.vendor_id) {
2764 	case 0x10ec0882:
2765 	case 0x10ec0885:
2766 	case 0x10ec0900:
2767 	case 0x10ec0b00:
2768 	case 0x10ec1220:
2769 		break;
2770 	default:
2771 		/* ALC883 and variants */
2772 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2773 		break;
2774 	}
2775 
2776 	alc_pre_init(codec);
2777 
2778 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2779 		       alc882_fixups);
2780 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2781 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2782 
2783 	alc_auto_parse_customize_define(codec);
2784 
2785 	if (has_cdefine_beep(codec))
2786 		spec->gen.beep_nid = 0x01;
2787 
2788 	/* automatic parse from the BIOS config */
2789 	err = alc882_parse_auto_config(codec);
2790 	if (err < 0)
2791 		goto error;
2792 
2793 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2794 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2795 		if (err < 0)
2796 			goto error;
2797 	}
2798 
2799 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2800 
2801 	return 0;
2802 
2803  error:
2804 	alc_free(codec);
2805 	return err;
2806 }
2807 
2808 
2809 /*
2810  * ALC262 support
2811  */
2812 static int alc262_parse_auto_config(struct hda_codec *codec)
2813 {
2814 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2815 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2816 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2817 }
2818 
2819 /*
2820  * Pin config fixes
2821  */
2822 enum {
2823 	ALC262_FIXUP_FSC_H270,
2824 	ALC262_FIXUP_FSC_S7110,
2825 	ALC262_FIXUP_HP_Z200,
2826 	ALC262_FIXUP_TYAN,
2827 	ALC262_FIXUP_LENOVO_3000,
2828 	ALC262_FIXUP_BENQ,
2829 	ALC262_FIXUP_BENQ_T31,
2830 	ALC262_FIXUP_INV_DMIC,
2831 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2832 };
2833 
2834 static const struct hda_fixup alc262_fixups[] = {
2835 	[ALC262_FIXUP_FSC_H270] = {
2836 		.type = HDA_FIXUP_PINS,
2837 		.v.pins = (const struct hda_pintbl[]) {
2838 			{ 0x14, 0x99130110 }, /* speaker */
2839 			{ 0x15, 0x0221142f }, /* front HP */
2840 			{ 0x1b, 0x0121141f }, /* rear HP */
2841 			{ }
2842 		}
2843 	},
2844 	[ALC262_FIXUP_FSC_S7110] = {
2845 		.type = HDA_FIXUP_PINS,
2846 		.v.pins = (const struct hda_pintbl[]) {
2847 			{ 0x15, 0x90170110 }, /* speaker */
2848 			{ }
2849 		},
2850 		.chained = true,
2851 		.chain_id = ALC262_FIXUP_BENQ,
2852 	},
2853 	[ALC262_FIXUP_HP_Z200] = {
2854 		.type = HDA_FIXUP_PINS,
2855 		.v.pins = (const struct hda_pintbl[]) {
2856 			{ 0x16, 0x99130120 }, /* internal speaker */
2857 			{ }
2858 		}
2859 	},
2860 	[ALC262_FIXUP_TYAN] = {
2861 		.type = HDA_FIXUP_PINS,
2862 		.v.pins = (const struct hda_pintbl[]) {
2863 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2864 			{ }
2865 		}
2866 	},
2867 	[ALC262_FIXUP_LENOVO_3000] = {
2868 		.type = HDA_FIXUP_PINCTLS,
2869 		.v.pins = (const struct hda_pintbl[]) {
2870 			{ 0x19, PIN_VREF50 },
2871 			{}
2872 		},
2873 		.chained = true,
2874 		.chain_id = ALC262_FIXUP_BENQ,
2875 	},
2876 	[ALC262_FIXUP_BENQ] = {
2877 		.type = HDA_FIXUP_VERBS,
2878 		.v.verbs = (const struct hda_verb[]) {
2879 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2880 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2881 			{}
2882 		}
2883 	},
2884 	[ALC262_FIXUP_BENQ_T31] = {
2885 		.type = HDA_FIXUP_VERBS,
2886 		.v.verbs = (const struct hda_verb[]) {
2887 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2888 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2889 			{}
2890 		}
2891 	},
2892 	[ALC262_FIXUP_INV_DMIC] = {
2893 		.type = HDA_FIXUP_FUNC,
2894 		.v.func = alc_fixup_inv_dmic,
2895 	},
2896 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2897 		.type = HDA_FIXUP_FUNC,
2898 		.v.func = alc_fixup_no_depop_delay,
2899 	},
2900 };
2901 
2902 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2903 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2904 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2905 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2906 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2907 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2908 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2909 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2910 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2911 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2912 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2913 	{}
2914 };
2915 
2916 static const struct hda_model_fixup alc262_fixup_models[] = {
2917 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2918 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2919 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2920 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2921 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2922 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2923 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2924 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2925 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2926 	{}
2927 };
2928 
2929 /*
2930  */
2931 static int patch_alc262(struct hda_codec *codec)
2932 {
2933 	struct alc_spec *spec;
2934 	int err;
2935 
2936 	err = alc_alloc_spec(codec, 0x0b);
2937 	if (err < 0)
2938 		return err;
2939 
2940 	spec = codec->spec;
2941 	spec->gen.shared_mic_vref_pin = 0x18;
2942 
2943 	spec->shutup = alc_eapd_shutup;
2944 
2945 #if 0
2946 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2947 	 * under-run
2948 	 */
2949 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2950 #endif
2951 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2952 
2953 	alc_pre_init(codec);
2954 
2955 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2956 		       alc262_fixups);
2957 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2958 
2959 	alc_auto_parse_customize_define(codec);
2960 
2961 	if (has_cdefine_beep(codec))
2962 		spec->gen.beep_nid = 0x01;
2963 
2964 	/* automatic parse from the BIOS config */
2965 	err = alc262_parse_auto_config(codec);
2966 	if (err < 0)
2967 		goto error;
2968 
2969 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2970 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2971 		if (err < 0)
2972 			goto error;
2973 	}
2974 
2975 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2976 
2977 	return 0;
2978 
2979  error:
2980 	alc_free(codec);
2981 	return err;
2982 }
2983 
2984 /*
2985  *  ALC268
2986  */
2987 /* bind Beep switches of both NID 0x0f and 0x10 */
2988 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2989 				  struct snd_ctl_elem_value *ucontrol)
2990 {
2991 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2992 	unsigned long pval;
2993 	int err;
2994 
2995 	mutex_lock(&codec->control_mutex);
2996 	pval = kcontrol->private_value;
2997 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
2998 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2999 	if (err >= 0) {
3000 		kcontrol->private_value = (pval & ~0xff) | 0x10;
3001 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3002 	}
3003 	kcontrol->private_value = pval;
3004 	mutex_unlock(&codec->control_mutex);
3005 	return err;
3006 }
3007 
3008 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3009 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3010 	{
3011 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3012 		.name = "Beep Playback Switch",
3013 		.subdevice = HDA_SUBDEV_AMP_FLAG,
3014 		.info = snd_hda_mixer_amp_switch_info,
3015 		.get = snd_hda_mixer_amp_switch_get,
3016 		.put = alc268_beep_switch_put,
3017 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3018 	},
3019 };
3020 
3021 /* set PCBEEP vol = 0, mute connections */
3022 static const struct hda_verb alc268_beep_init_verbs[] = {
3023 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3024 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3025 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3026 	{ }
3027 };
3028 
3029 enum {
3030 	ALC268_FIXUP_INV_DMIC,
3031 	ALC268_FIXUP_HP_EAPD,
3032 	ALC268_FIXUP_SPDIF,
3033 };
3034 
3035 static const struct hda_fixup alc268_fixups[] = {
3036 	[ALC268_FIXUP_INV_DMIC] = {
3037 		.type = HDA_FIXUP_FUNC,
3038 		.v.func = alc_fixup_inv_dmic,
3039 	},
3040 	[ALC268_FIXUP_HP_EAPD] = {
3041 		.type = HDA_FIXUP_VERBS,
3042 		.v.verbs = (const struct hda_verb[]) {
3043 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3044 			{}
3045 		}
3046 	},
3047 	[ALC268_FIXUP_SPDIF] = {
3048 		.type = HDA_FIXUP_PINS,
3049 		.v.pins = (const struct hda_pintbl[]) {
3050 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3051 			{}
3052 		}
3053 	},
3054 };
3055 
3056 static const struct hda_model_fixup alc268_fixup_models[] = {
3057 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3058 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3059 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3060 	{}
3061 };
3062 
3063 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3064 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3065 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3066 	/* below is codec SSID since multiple Toshiba laptops have the
3067 	 * same PCI SSID 1179:ff00
3068 	 */
3069 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3070 	{}
3071 };
3072 
3073 /*
3074  * BIOS auto configuration
3075  */
3076 static int alc268_parse_auto_config(struct hda_codec *codec)
3077 {
3078 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3079 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3080 }
3081 
3082 /*
3083  */
3084 static int patch_alc268(struct hda_codec *codec)
3085 {
3086 	struct alc_spec *spec;
3087 	int i, err;
3088 
3089 	/* ALC268 has no aa-loopback mixer */
3090 	err = alc_alloc_spec(codec, 0);
3091 	if (err < 0)
3092 		return err;
3093 
3094 	spec = codec->spec;
3095 	if (has_cdefine_beep(codec))
3096 		spec->gen.beep_nid = 0x01;
3097 
3098 	spec->shutup = alc_eapd_shutup;
3099 
3100 	alc_pre_init(codec);
3101 
3102 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3103 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3104 
3105 	/* automatic parse from the BIOS config */
3106 	err = alc268_parse_auto_config(codec);
3107 	if (err < 0)
3108 		goto error;
3109 
3110 	if (err > 0 && !spec->gen.no_analog &&
3111 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3112 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3113 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3114 						  &alc268_beep_mixer[i])) {
3115 				err = -ENOMEM;
3116 				goto error;
3117 			}
3118 		}
3119 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3120 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3121 			/* override the amp caps for beep generator */
3122 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3123 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3124 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3125 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3126 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3127 	}
3128 
3129 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3130 
3131 	return 0;
3132 
3133  error:
3134 	alc_free(codec);
3135 	return err;
3136 }
3137 
3138 /*
3139  * ALC269
3140  */
3141 
3142 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3143 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3144 };
3145 
3146 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3147 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3148 };
3149 
3150 /* different alc269-variants */
3151 enum {
3152 	ALC269_TYPE_ALC269VA,
3153 	ALC269_TYPE_ALC269VB,
3154 	ALC269_TYPE_ALC269VC,
3155 	ALC269_TYPE_ALC269VD,
3156 	ALC269_TYPE_ALC280,
3157 	ALC269_TYPE_ALC282,
3158 	ALC269_TYPE_ALC283,
3159 	ALC269_TYPE_ALC284,
3160 	ALC269_TYPE_ALC293,
3161 	ALC269_TYPE_ALC286,
3162 	ALC269_TYPE_ALC298,
3163 	ALC269_TYPE_ALC255,
3164 	ALC269_TYPE_ALC256,
3165 	ALC269_TYPE_ALC257,
3166 	ALC269_TYPE_ALC215,
3167 	ALC269_TYPE_ALC225,
3168 	ALC269_TYPE_ALC245,
3169 	ALC269_TYPE_ALC287,
3170 	ALC269_TYPE_ALC294,
3171 	ALC269_TYPE_ALC300,
3172 	ALC269_TYPE_ALC623,
3173 	ALC269_TYPE_ALC700,
3174 };
3175 
3176 /*
3177  * BIOS auto configuration
3178  */
3179 static int alc269_parse_auto_config(struct hda_codec *codec)
3180 {
3181 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3182 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3183 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3184 	struct alc_spec *spec = codec->spec;
3185 	const hda_nid_t *ssids;
3186 
3187 	switch (spec->codec_variant) {
3188 	case ALC269_TYPE_ALC269VA:
3189 	case ALC269_TYPE_ALC269VC:
3190 	case ALC269_TYPE_ALC280:
3191 	case ALC269_TYPE_ALC284:
3192 	case ALC269_TYPE_ALC293:
3193 		ssids = alc269va_ssids;
3194 		break;
3195 	case ALC269_TYPE_ALC269VB:
3196 	case ALC269_TYPE_ALC269VD:
3197 	case ALC269_TYPE_ALC282:
3198 	case ALC269_TYPE_ALC283:
3199 	case ALC269_TYPE_ALC286:
3200 	case ALC269_TYPE_ALC298:
3201 	case ALC269_TYPE_ALC255:
3202 	case ALC269_TYPE_ALC256:
3203 	case ALC269_TYPE_ALC257:
3204 	case ALC269_TYPE_ALC215:
3205 	case ALC269_TYPE_ALC225:
3206 	case ALC269_TYPE_ALC245:
3207 	case ALC269_TYPE_ALC287:
3208 	case ALC269_TYPE_ALC294:
3209 	case ALC269_TYPE_ALC300:
3210 	case ALC269_TYPE_ALC623:
3211 	case ALC269_TYPE_ALC700:
3212 		ssids = alc269_ssids;
3213 		break;
3214 	default:
3215 		ssids = alc269_ssids;
3216 		break;
3217 	}
3218 
3219 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3220 }
3221 
3222 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3223 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3224 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3225 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3226 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3227 	{}
3228 };
3229 
3230 static void alc_headset_btn_callback(struct hda_codec *codec,
3231 				     struct hda_jack_callback *jack)
3232 {
3233 	int report = 0;
3234 
3235 	if (jack->unsol_res & (7 << 13))
3236 		report |= SND_JACK_BTN_0;
3237 
3238 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3239 		report |= SND_JACK_BTN_1;
3240 
3241 	/* Volume up key */
3242 	if (jack->unsol_res & (7 << 23))
3243 		report |= SND_JACK_BTN_2;
3244 
3245 	/* Volume down key */
3246 	if (jack->unsol_res & (7 << 10))
3247 		report |= SND_JACK_BTN_3;
3248 
3249 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3250 }
3251 
3252 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3253 {
3254 	struct alc_spec *spec = codec->spec;
3255 
3256 	if (!spec->has_hs_key)
3257 		return;
3258 
3259 	switch (codec->core.vendor_id) {
3260 	case 0x10ec0215:
3261 	case 0x10ec0225:
3262 	case 0x10ec0285:
3263 	case 0x10ec0287:
3264 	case 0x10ec0295:
3265 	case 0x10ec0289:
3266 	case 0x10ec0299:
3267 		alc_write_coef_idx(codec, 0x48, 0x0);
3268 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3269 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3270 		break;
3271 	case 0x10ec0230:
3272 	case 0x10ec0236:
3273 	case 0x10ec0256:
3274 	case 0x10ec0257:
3275 	case 0x19e58326:
3276 		alc_write_coef_idx(codec, 0x48, 0x0);
3277 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3278 		break;
3279 	}
3280 }
3281 
3282 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3283 {
3284 	struct alc_spec *spec = codec->spec;
3285 
3286 	if (!spec->has_hs_key)
3287 		return;
3288 
3289 	switch (codec->core.vendor_id) {
3290 	case 0x10ec0215:
3291 	case 0x10ec0225:
3292 	case 0x10ec0285:
3293 	case 0x10ec0287:
3294 	case 0x10ec0295:
3295 	case 0x10ec0289:
3296 	case 0x10ec0299:
3297 		alc_write_coef_idx(codec, 0x48, 0xd011);
3298 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3299 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3300 		break;
3301 	case 0x10ec0230:
3302 	case 0x10ec0236:
3303 	case 0x10ec0256:
3304 	case 0x10ec0257:
3305 	case 0x19e58326:
3306 		alc_write_coef_idx(codec, 0x48, 0xd011);
3307 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3308 		break;
3309 	}
3310 }
3311 
3312 static void alc_fixup_headset_jack(struct hda_codec *codec,
3313 				    const struct hda_fixup *fix, int action)
3314 {
3315 	struct alc_spec *spec = codec->spec;
3316 	hda_nid_t hp_pin;
3317 
3318 	switch (action) {
3319 	case HDA_FIXUP_ACT_PRE_PROBE:
3320 		spec->has_hs_key = 1;
3321 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3322 						    alc_headset_btn_callback);
3323 		break;
3324 	case HDA_FIXUP_ACT_BUILD:
3325 		hp_pin = alc_get_hp_pin(spec);
3326 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3327 							alc_headset_btn_keymap,
3328 							hp_pin))
3329 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3330 					      false, SND_JACK_HEADSET,
3331 					      alc_headset_btn_keymap);
3332 
3333 		alc_enable_headset_jack_key(codec);
3334 		break;
3335 	}
3336 }
3337 
3338 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3339 {
3340 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3341 }
3342 
3343 static void alc269_shutup(struct hda_codec *codec)
3344 {
3345 	struct alc_spec *spec = codec->spec;
3346 
3347 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3348 		alc269vb_toggle_power_output(codec, 0);
3349 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3350 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3351 		msleep(150);
3352 	}
3353 	alc_shutup_pins(codec);
3354 }
3355 
3356 static const struct coef_fw alc282_coefs[] = {
3357 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3358 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3359 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3360 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3361 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3362 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3363 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3364 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3365 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3366 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3367 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3368 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3369 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3370 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3371 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3372 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3373 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3374 	WRITE_COEF(0x63, 0x2902), /* PLL */
3375 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3376 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3377 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3378 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3379 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3380 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3381 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3382 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3383 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3384 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3385 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3386 	{}
3387 };
3388 
3389 static void alc282_restore_default_value(struct hda_codec *codec)
3390 {
3391 	alc_process_coef_fw(codec, alc282_coefs);
3392 }
3393 
3394 static void alc282_init(struct hda_codec *codec)
3395 {
3396 	struct alc_spec *spec = codec->spec;
3397 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3398 	bool hp_pin_sense;
3399 	int coef78;
3400 
3401 	alc282_restore_default_value(codec);
3402 
3403 	if (!hp_pin)
3404 		return;
3405 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3406 	coef78 = alc_read_coef_idx(codec, 0x78);
3407 
3408 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3409 	/* Headphone capless set to high power mode */
3410 	alc_write_coef_idx(codec, 0x78, 0x9004);
3411 
3412 	if (hp_pin_sense)
3413 		msleep(2);
3414 
3415 	snd_hda_codec_write(codec, hp_pin, 0,
3416 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3417 
3418 	if (hp_pin_sense)
3419 		msleep(85);
3420 
3421 	snd_hda_codec_write(codec, hp_pin, 0,
3422 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3423 
3424 	if (hp_pin_sense)
3425 		msleep(100);
3426 
3427 	/* Headphone capless set to normal mode */
3428 	alc_write_coef_idx(codec, 0x78, coef78);
3429 }
3430 
3431 static void alc282_shutup(struct hda_codec *codec)
3432 {
3433 	struct alc_spec *spec = codec->spec;
3434 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3435 	bool hp_pin_sense;
3436 	int coef78;
3437 
3438 	if (!hp_pin) {
3439 		alc269_shutup(codec);
3440 		return;
3441 	}
3442 
3443 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3444 	coef78 = alc_read_coef_idx(codec, 0x78);
3445 	alc_write_coef_idx(codec, 0x78, 0x9004);
3446 
3447 	if (hp_pin_sense)
3448 		msleep(2);
3449 
3450 	snd_hda_codec_write(codec, hp_pin, 0,
3451 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3452 
3453 	if (hp_pin_sense)
3454 		msleep(85);
3455 
3456 	if (!spec->no_shutup_pins)
3457 		snd_hda_codec_write(codec, hp_pin, 0,
3458 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3459 
3460 	if (hp_pin_sense)
3461 		msleep(100);
3462 
3463 	alc_auto_setup_eapd(codec, false);
3464 	alc_shutup_pins(codec);
3465 	alc_write_coef_idx(codec, 0x78, coef78);
3466 }
3467 
3468 static const struct coef_fw alc283_coefs[] = {
3469 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3470 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3471 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3472 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3473 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3474 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3475 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3476 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3477 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3478 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3479 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3480 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3481 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3482 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3483 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3484 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3485 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3486 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3487 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3488 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3489 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3490 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3491 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3492 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3493 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3494 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3495 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3496 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3497 	WRITE_COEF(0x49, 0x0), /* test mode */
3498 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3499 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3500 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3501 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3502 	{}
3503 };
3504 
3505 static void alc283_restore_default_value(struct hda_codec *codec)
3506 {
3507 	alc_process_coef_fw(codec, alc283_coefs);
3508 }
3509 
3510 static void alc283_init(struct hda_codec *codec)
3511 {
3512 	struct alc_spec *spec = codec->spec;
3513 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3514 	bool hp_pin_sense;
3515 
3516 	alc283_restore_default_value(codec);
3517 
3518 	if (!hp_pin)
3519 		return;
3520 
3521 	msleep(30);
3522 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3523 
3524 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3525 	/* Headphone capless set to high power mode */
3526 	alc_write_coef_idx(codec, 0x43, 0x9004);
3527 
3528 	snd_hda_codec_write(codec, hp_pin, 0,
3529 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3530 
3531 	if (hp_pin_sense)
3532 		msleep(85);
3533 
3534 	snd_hda_codec_write(codec, hp_pin, 0,
3535 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3536 
3537 	if (hp_pin_sense)
3538 		msleep(85);
3539 	/* Index 0x46 Combo jack auto switch control 2 */
3540 	/* 3k pull low control for Headset jack. */
3541 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3542 	/* Headphone capless set to normal mode */
3543 	alc_write_coef_idx(codec, 0x43, 0x9614);
3544 }
3545 
3546 static void alc283_shutup(struct hda_codec *codec)
3547 {
3548 	struct alc_spec *spec = codec->spec;
3549 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3550 	bool hp_pin_sense;
3551 
3552 	if (!hp_pin) {
3553 		alc269_shutup(codec);
3554 		return;
3555 	}
3556 
3557 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3558 
3559 	alc_write_coef_idx(codec, 0x43, 0x9004);
3560 
3561 	/*depop hp during suspend*/
3562 	alc_write_coef_idx(codec, 0x06, 0x2100);
3563 
3564 	snd_hda_codec_write(codec, hp_pin, 0,
3565 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3566 
3567 	if (hp_pin_sense)
3568 		msleep(100);
3569 
3570 	if (!spec->no_shutup_pins)
3571 		snd_hda_codec_write(codec, hp_pin, 0,
3572 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3573 
3574 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3575 
3576 	if (hp_pin_sense)
3577 		msleep(100);
3578 	alc_auto_setup_eapd(codec, false);
3579 	alc_shutup_pins(codec);
3580 	alc_write_coef_idx(codec, 0x43, 0x9614);
3581 }
3582 
3583 static void alc256_init(struct hda_codec *codec)
3584 {
3585 	struct alc_spec *spec = codec->spec;
3586 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3587 	bool hp_pin_sense;
3588 
3589 	if (spec->ultra_low_power) {
3590 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3591 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3592 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3593 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3594 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3595 		msleep(30);
3596 	}
3597 
3598 	if (!hp_pin)
3599 		hp_pin = 0x21;
3600 
3601 	msleep(30);
3602 
3603 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3604 
3605 	if (hp_pin_sense)
3606 		msleep(2);
3607 
3608 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3609 
3610 	snd_hda_codec_write(codec, hp_pin, 0,
3611 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3612 
3613 	if (hp_pin_sense || spec->ultra_low_power)
3614 		msleep(85);
3615 
3616 	snd_hda_codec_write(codec, hp_pin, 0,
3617 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3618 
3619 	if (hp_pin_sense || spec->ultra_low_power)
3620 		msleep(100);
3621 
3622 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3623 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3624 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3625 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3626 	/*
3627 	 * Expose headphone mic (or possibly Line In on some machines) instead
3628 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3629 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3630 	 * this register.
3631 	 */
3632 	alc_write_coef_idx(codec, 0x36, 0x5757);
3633 }
3634 
3635 static void alc256_shutup(struct hda_codec *codec)
3636 {
3637 	struct alc_spec *spec = codec->spec;
3638 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3639 	bool hp_pin_sense;
3640 
3641 	if (!hp_pin)
3642 		hp_pin = 0x21;
3643 
3644 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3645 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3646 
3647 	if (hp_pin_sense)
3648 		msleep(2);
3649 
3650 	snd_hda_codec_write(codec, hp_pin, 0,
3651 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3652 
3653 	if (hp_pin_sense || spec->ultra_low_power)
3654 		msleep(85);
3655 
3656 	/* 3k pull low control for Headset jack. */
3657 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3658 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3659 	 * when booting with headset plugged. So skip setting it for the codec alc257
3660 	 */
3661 	if (spec->en_3kpull_low)
3662 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3663 
3664 	if (!spec->no_shutup_pins)
3665 		snd_hda_codec_write(codec, hp_pin, 0,
3666 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3667 
3668 	if (hp_pin_sense || spec->ultra_low_power)
3669 		msleep(100);
3670 
3671 	alc_auto_setup_eapd(codec, false);
3672 	alc_shutup_pins(codec);
3673 	if (spec->ultra_low_power) {
3674 		msleep(50);
3675 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3676 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3677 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3678 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3679 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3680 		msleep(30);
3681 	}
3682 }
3683 
3684 static void alc285_hp_init(struct hda_codec *codec)
3685 {
3686 	struct alc_spec *spec = codec->spec;
3687 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3688 	int i, val;
3689 	int coef38, coef0d, coef36;
3690 
3691 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3692 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3693 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3694 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3695 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3696 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3697 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3698 
3699 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3700 
3701 	if (hp_pin)
3702 		snd_hda_codec_write(codec, hp_pin, 0,
3703 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3704 
3705 	msleep(130);
3706 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3707 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3708 
3709 	if (hp_pin)
3710 		snd_hda_codec_write(codec, hp_pin, 0,
3711 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3712 	msleep(10);
3713 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3714 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3715 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3716 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3717 
3718 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3719 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3720 	for (i = 0; i < 20 && val & 0x8000; i++) {
3721 		msleep(50);
3722 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3723 	} /* Wait for depop procedure finish  */
3724 
3725 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3726 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3727 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3728 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3729 
3730 	msleep(50);
3731 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3732 }
3733 
3734 static void alc225_init(struct hda_codec *codec)
3735 {
3736 	struct alc_spec *spec = codec->spec;
3737 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3738 	bool hp1_pin_sense, hp2_pin_sense;
3739 
3740 	if (spec->ultra_low_power) {
3741 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3742 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3743 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3744 		msleep(30);
3745 	}
3746 
3747 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3748 		spec->codec_variant != ALC269_TYPE_ALC245)
3749 		/* required only at boot or S3 and S4 resume time */
3750 		if (!spec->done_hp_init ||
3751 			is_s3_resume(codec) ||
3752 			is_s4_resume(codec)) {
3753 			alc285_hp_init(codec);
3754 			spec->done_hp_init = true;
3755 		}
3756 
3757 	if (!hp_pin)
3758 		hp_pin = 0x21;
3759 	msleep(30);
3760 
3761 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3762 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3763 
3764 	if (hp1_pin_sense || hp2_pin_sense)
3765 		msleep(2);
3766 
3767 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3768 
3769 	if (hp1_pin_sense || spec->ultra_low_power)
3770 		snd_hda_codec_write(codec, hp_pin, 0,
3771 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3772 	if (hp2_pin_sense)
3773 		snd_hda_codec_write(codec, 0x16, 0,
3774 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3775 
3776 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3777 		msleep(85);
3778 
3779 	if (hp1_pin_sense || spec->ultra_low_power)
3780 		snd_hda_codec_write(codec, hp_pin, 0,
3781 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3782 	if (hp2_pin_sense)
3783 		snd_hda_codec_write(codec, 0x16, 0,
3784 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3785 
3786 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3787 		msleep(100);
3788 
3789 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3790 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3791 }
3792 
3793 static void alc225_shutup(struct hda_codec *codec)
3794 {
3795 	struct alc_spec *spec = codec->spec;
3796 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3797 	bool hp1_pin_sense, hp2_pin_sense;
3798 
3799 	if (!hp_pin)
3800 		hp_pin = 0x21;
3801 
3802 	alc_disable_headset_jack_key(codec);
3803 	/* 3k pull low control for Headset jack. */
3804 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3805 
3806 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3807 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3808 
3809 	if (hp1_pin_sense || hp2_pin_sense)
3810 		msleep(2);
3811 
3812 	if (hp1_pin_sense || spec->ultra_low_power)
3813 		snd_hda_codec_write(codec, hp_pin, 0,
3814 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3815 	if (hp2_pin_sense)
3816 		snd_hda_codec_write(codec, 0x16, 0,
3817 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3818 
3819 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3820 		msleep(85);
3821 
3822 	if (hp1_pin_sense || spec->ultra_low_power)
3823 		snd_hda_codec_write(codec, hp_pin, 0,
3824 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3825 	if (hp2_pin_sense)
3826 		snd_hda_codec_write(codec, 0x16, 0,
3827 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3828 
3829 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3830 		msleep(100);
3831 
3832 	alc_auto_setup_eapd(codec, false);
3833 	alc_shutup_pins(codec);
3834 	if (spec->ultra_low_power) {
3835 		msleep(50);
3836 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3837 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3838 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3839 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3840 		msleep(30);
3841 	}
3842 
3843 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3844 	alc_enable_headset_jack_key(codec);
3845 }
3846 
3847 static void alc_default_init(struct hda_codec *codec)
3848 {
3849 	struct alc_spec *spec = codec->spec;
3850 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3851 	bool hp_pin_sense;
3852 
3853 	if (!hp_pin)
3854 		return;
3855 
3856 	msleep(30);
3857 
3858 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3859 
3860 	if (hp_pin_sense)
3861 		msleep(2);
3862 
3863 	snd_hda_codec_write(codec, hp_pin, 0,
3864 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3865 
3866 	if (hp_pin_sense)
3867 		msleep(85);
3868 
3869 	snd_hda_codec_write(codec, hp_pin, 0,
3870 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3871 
3872 	if (hp_pin_sense)
3873 		msleep(100);
3874 }
3875 
3876 static void alc_default_shutup(struct hda_codec *codec)
3877 {
3878 	struct alc_spec *spec = codec->spec;
3879 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3880 	bool hp_pin_sense;
3881 
3882 	if (!hp_pin) {
3883 		alc269_shutup(codec);
3884 		return;
3885 	}
3886 
3887 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3888 
3889 	if (hp_pin_sense)
3890 		msleep(2);
3891 
3892 	snd_hda_codec_write(codec, hp_pin, 0,
3893 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3894 
3895 	if (hp_pin_sense)
3896 		msleep(85);
3897 
3898 	if (!spec->no_shutup_pins)
3899 		snd_hda_codec_write(codec, hp_pin, 0,
3900 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3901 
3902 	if (hp_pin_sense)
3903 		msleep(100);
3904 
3905 	alc_auto_setup_eapd(codec, false);
3906 	alc_shutup_pins(codec);
3907 }
3908 
3909 static void alc294_hp_init(struct hda_codec *codec)
3910 {
3911 	struct alc_spec *spec = codec->spec;
3912 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3913 	int i, val;
3914 
3915 	if (!hp_pin)
3916 		return;
3917 
3918 	snd_hda_codec_write(codec, hp_pin, 0,
3919 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3920 
3921 	msleep(100);
3922 
3923 	if (!spec->no_shutup_pins)
3924 		snd_hda_codec_write(codec, hp_pin, 0,
3925 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3926 
3927 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3928 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3929 
3930 	/* Wait for depop procedure finish  */
3931 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3932 	for (i = 0; i < 20 && val & 0x0080; i++) {
3933 		msleep(50);
3934 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3935 	}
3936 	/* Set HP depop to auto mode */
3937 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3938 	msleep(50);
3939 }
3940 
3941 static void alc294_init(struct hda_codec *codec)
3942 {
3943 	struct alc_spec *spec = codec->spec;
3944 
3945 	/* required only at boot or S4 resume time */
3946 	if (!spec->done_hp_init ||
3947 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3948 		alc294_hp_init(codec);
3949 		spec->done_hp_init = true;
3950 	}
3951 	alc_default_init(codec);
3952 }
3953 
3954 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3955 			     unsigned int val)
3956 {
3957 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3958 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3959 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3960 }
3961 
3962 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3963 {
3964 	unsigned int val;
3965 
3966 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3967 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3968 		& 0xffff;
3969 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3970 		<< 16;
3971 	return val;
3972 }
3973 
3974 static void alc5505_dsp_halt(struct hda_codec *codec)
3975 {
3976 	unsigned int val;
3977 
3978 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3979 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3980 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3981 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3982 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3983 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3984 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3985 	val = alc5505_coef_get(codec, 0x6220);
3986 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3987 }
3988 
3989 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3990 {
3991 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
3992 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3993 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3994 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3995 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
3996 	alc5505_coef_set(codec, 0x880c, 0x00000004);
3997 }
3998 
3999 static void alc5505_dsp_init(struct hda_codec *codec)
4000 {
4001 	unsigned int val;
4002 
4003 	alc5505_dsp_halt(codec);
4004 	alc5505_dsp_back_from_halt(codec);
4005 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4006 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
4007 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4008 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4009 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4010 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4011 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4012 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4013 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
4014 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
4015 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4016 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4017 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4018 
4019 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4020 	if (val <= 3)
4021 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4022 	else
4023 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4024 
4025 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4026 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4027 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4028 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4029 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4030 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4031 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4032 
4033 #ifdef HALT_REALTEK_ALC5505
4034 	alc5505_dsp_halt(codec);
4035 #endif
4036 }
4037 
4038 #ifdef HALT_REALTEK_ALC5505
4039 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4040 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4041 #else
4042 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4043 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4044 #endif
4045 
4046 #ifdef CONFIG_PM
4047 static int alc269_suspend(struct hda_codec *codec)
4048 {
4049 	struct alc_spec *spec = codec->spec;
4050 
4051 	if (spec->has_alc5505_dsp)
4052 		alc5505_dsp_suspend(codec);
4053 
4054 	return alc_suspend(codec);
4055 }
4056 
4057 static int alc269_resume(struct hda_codec *codec)
4058 {
4059 	struct alc_spec *spec = codec->spec;
4060 
4061 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4062 		alc269vb_toggle_power_output(codec, 0);
4063 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4064 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4065 		msleep(150);
4066 	}
4067 
4068 	codec->patch_ops.init(codec);
4069 
4070 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4071 		alc269vb_toggle_power_output(codec, 1);
4072 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4073 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4074 		msleep(200);
4075 	}
4076 
4077 	snd_hda_regmap_sync(codec);
4078 	hda_call_check_power_status(codec, 0x01);
4079 
4080 	/* on some machine, the BIOS will clear the codec gpio data when enter
4081 	 * suspend, and won't restore the data after resume, so we restore it
4082 	 * in the driver.
4083 	 */
4084 	if (spec->gpio_data)
4085 		alc_write_gpio_data(codec);
4086 
4087 	if (spec->has_alc5505_dsp)
4088 		alc5505_dsp_resume(codec);
4089 
4090 	return 0;
4091 }
4092 #endif /* CONFIG_PM */
4093 
4094 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4095 						 const struct hda_fixup *fix, int action)
4096 {
4097 	struct alc_spec *spec = codec->spec;
4098 
4099 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4100 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4101 }
4102 
4103 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4104 						 const struct hda_fixup *fix,
4105 						 int action)
4106 {
4107 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4108 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4109 
4110 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4111 		snd_hda_codec_set_pincfg(codec, 0x19,
4112 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4113 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4114 }
4115 
4116 static void alc269_fixup_hweq(struct hda_codec *codec,
4117 			       const struct hda_fixup *fix, int action)
4118 {
4119 	if (action == HDA_FIXUP_ACT_INIT)
4120 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4121 }
4122 
4123 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4124 				       const struct hda_fixup *fix, int action)
4125 {
4126 	struct alc_spec *spec = codec->spec;
4127 
4128 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4129 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4130 }
4131 
4132 static void alc271_fixup_dmic(struct hda_codec *codec,
4133 			      const struct hda_fixup *fix, int action)
4134 {
4135 	static const struct hda_verb verbs[] = {
4136 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4137 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4138 		{}
4139 	};
4140 	unsigned int cfg;
4141 
4142 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4143 	    strcmp(codec->core.chip_name, "ALC269VB"))
4144 		return;
4145 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4146 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4147 		snd_hda_sequence_write(codec, verbs);
4148 }
4149 
4150 /* Fix the speaker amp after resume, etc */
4151 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4152 					  const struct hda_fixup *fix,
4153 					  int action)
4154 {
4155 	if (action == HDA_FIXUP_ACT_INIT)
4156 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4157 }
4158 
4159 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4160 				 const struct hda_fixup *fix, int action)
4161 {
4162 	struct alc_spec *spec = codec->spec;
4163 
4164 	if (action != HDA_FIXUP_ACT_PROBE)
4165 		return;
4166 
4167 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4168 	 * fix the sample rate of analog I/O to 44.1kHz
4169 	 */
4170 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4171 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4172 }
4173 
4174 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4175 				     const struct hda_fixup *fix, int action)
4176 {
4177 	/* The digital-mic unit sends PDM (differential signal) instead of
4178 	 * the standard PCM, thus you can't record a valid mono stream as is.
4179 	 * Below is a workaround specific to ALC269 to control the dmic
4180 	 * signal source as mono.
4181 	 */
4182 	if (action == HDA_FIXUP_ACT_INIT)
4183 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4184 }
4185 
4186 static void alc269_quanta_automute(struct hda_codec *codec)
4187 {
4188 	snd_hda_gen_update_outputs(codec);
4189 
4190 	alc_write_coef_idx(codec, 0x0c, 0x680);
4191 	alc_write_coef_idx(codec, 0x0c, 0x480);
4192 }
4193 
4194 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4195 				     const struct hda_fixup *fix, int action)
4196 {
4197 	struct alc_spec *spec = codec->spec;
4198 	if (action != HDA_FIXUP_ACT_PROBE)
4199 		return;
4200 	spec->gen.automute_hook = alc269_quanta_automute;
4201 }
4202 
4203 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4204 					 struct hda_jack_callback *jack)
4205 {
4206 	struct alc_spec *spec = codec->spec;
4207 	int vref;
4208 	msleep(200);
4209 	snd_hda_gen_hp_automute(codec, jack);
4210 
4211 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4212 	msleep(100);
4213 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4214 			    vref);
4215 	msleep(500);
4216 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4217 			    vref);
4218 }
4219 
4220 /*
4221  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4222  */
4223 struct hda_alc298_mbxinit {
4224 	unsigned char value_0x23;
4225 	unsigned char value_0x25;
4226 };
4227 
4228 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4229 					 const struct hda_alc298_mbxinit *initval,
4230 					 bool first)
4231 {
4232 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4233 	alc_write_coef_idx(codec, 0x26, 0xb000);
4234 
4235 	if (first)
4236 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4237 
4238 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4239 	alc_write_coef_idx(codec, 0x26, 0xf000);
4240 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4241 
4242 	if (initval->value_0x23 != 0x1e)
4243 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4244 
4245 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4246 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4247 }
4248 
4249 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4250 					   const struct hda_fixup *fix,
4251 					   int action)
4252 {
4253 	/* Initialization magic */
4254 	static const struct hda_alc298_mbxinit dac_init[] = {
4255 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4256 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4257 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4258 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4259 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4260 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4261 		{0x2f, 0x00},
4262 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4263 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4264 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4265 		{}
4266 	};
4267 	const struct hda_alc298_mbxinit *seq;
4268 
4269 	if (action != HDA_FIXUP_ACT_INIT)
4270 		return;
4271 
4272 	/* Start */
4273 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4274 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4275 	alc_write_coef_idx(codec, 0x26, 0xf000);
4276 	alc_write_coef_idx(codec, 0x22, 0x31);
4277 	alc_write_coef_idx(codec, 0x23, 0x0b);
4278 	alc_write_coef_idx(codec, 0x25, 0x00);
4279 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4280 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4281 
4282 	for (seq = dac_init; seq->value_0x23; seq++)
4283 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4284 }
4285 
4286 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4287 				     const struct hda_fixup *fix, int action)
4288 {
4289 	struct alc_spec *spec = codec->spec;
4290 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4291 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4292 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4293 	}
4294 }
4295 
4296 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4297 				bool polarity, bool on)
4298 {
4299 	unsigned int pinval;
4300 
4301 	if (!pin)
4302 		return;
4303 	if (polarity)
4304 		on = !on;
4305 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4306 	pinval &= ~AC_PINCTL_VREFEN;
4307 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4308 	/* temporarily power up/down for setting VREF */
4309 	snd_hda_power_up_pm(codec);
4310 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4311 	snd_hda_power_down_pm(codec);
4312 }
4313 
4314 /* update mute-LED according to the speaker mute state via mic VREF pin */
4315 static int vref_mute_led_set(struct led_classdev *led_cdev,
4316 			     enum led_brightness brightness)
4317 {
4318 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4319 	struct alc_spec *spec = codec->spec;
4320 
4321 	alc_update_vref_led(codec, spec->mute_led_nid,
4322 			    spec->mute_led_polarity, brightness);
4323 	return 0;
4324 }
4325 
4326 /* Make sure the led works even in runtime suspend */
4327 static unsigned int led_power_filter(struct hda_codec *codec,
4328 						  hda_nid_t nid,
4329 						  unsigned int power_state)
4330 {
4331 	struct alc_spec *spec = codec->spec;
4332 
4333 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4334 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4335 		return power_state;
4336 
4337 	/* Set pin ctl again, it might have just been set to 0 */
4338 	snd_hda_set_pin_ctl(codec, nid,
4339 			    snd_hda_codec_get_pin_target(codec, nid));
4340 
4341 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4342 }
4343 
4344 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4345 				     const struct hda_fixup *fix, int action)
4346 {
4347 	struct alc_spec *spec = codec->spec;
4348 	const struct dmi_device *dev = NULL;
4349 
4350 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4351 		return;
4352 
4353 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4354 		int pol, pin;
4355 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4356 			continue;
4357 		if (pin < 0x0a || pin >= 0x10)
4358 			break;
4359 		spec->mute_led_polarity = pol;
4360 		spec->mute_led_nid = pin - 0x0a + 0x18;
4361 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4362 		codec->power_filter = led_power_filter;
4363 		codec_dbg(codec,
4364 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4365 			   spec->mute_led_polarity);
4366 		break;
4367 	}
4368 }
4369 
4370 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4371 					  const struct hda_fixup *fix,
4372 					  int action, hda_nid_t pin)
4373 {
4374 	struct alc_spec *spec = codec->spec;
4375 
4376 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4377 		spec->mute_led_polarity = 0;
4378 		spec->mute_led_nid = pin;
4379 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4380 		codec->power_filter = led_power_filter;
4381 	}
4382 }
4383 
4384 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4385 				const struct hda_fixup *fix, int action)
4386 {
4387 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4388 }
4389 
4390 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4391 				const struct hda_fixup *fix, int action)
4392 {
4393 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4394 }
4395 
4396 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4397 				const struct hda_fixup *fix, int action)
4398 {
4399 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4400 }
4401 
4402 /* update LED status via GPIO */
4403 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4404 				int polarity, bool enabled)
4405 {
4406 	if (polarity)
4407 		enabled = !enabled;
4408 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4409 }
4410 
4411 /* turn on/off mute LED via GPIO per vmaster hook */
4412 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4413 			     enum led_brightness brightness)
4414 {
4415 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4416 	struct alc_spec *spec = codec->spec;
4417 
4418 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4419 			    spec->mute_led_polarity, !brightness);
4420 	return 0;
4421 }
4422 
4423 /* turn on/off mic-mute LED via GPIO per capture hook */
4424 static int micmute_led_set(struct led_classdev *led_cdev,
4425 			   enum led_brightness brightness)
4426 {
4427 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4428 	struct alc_spec *spec = codec->spec;
4429 
4430 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4431 			    spec->micmute_led_polarity, !brightness);
4432 	return 0;
4433 }
4434 
4435 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4436 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4437 				  int action,
4438 				  unsigned int mute_mask,
4439 				  unsigned int micmute_mask)
4440 {
4441 	struct alc_spec *spec = codec->spec;
4442 
4443 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4444 
4445 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4446 		return;
4447 	if (mute_mask) {
4448 		spec->gpio_mute_led_mask = mute_mask;
4449 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4450 	}
4451 	if (micmute_mask) {
4452 		spec->gpio_mic_led_mask = micmute_mask;
4453 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4454 	}
4455 }
4456 
4457 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4458 				const struct hda_fixup *fix, int action)
4459 {
4460 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4461 }
4462 
4463 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4464 				const struct hda_fixup *fix, int action)
4465 {
4466 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4467 }
4468 
4469 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4470 				const struct hda_fixup *fix, int action)
4471 {
4472 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4473 }
4474 
4475 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4476 				const struct hda_fixup *fix, int action)
4477 {
4478 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4479 }
4480 
4481 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4482 				const struct hda_fixup *fix, int action)
4483 {
4484 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4485 }
4486 
4487 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4488 				const struct hda_fixup *fix, int action)
4489 {
4490 	struct alc_spec *spec = codec->spec;
4491 
4492 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4493 		spec->micmute_led_polarity = 1;
4494 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4495 }
4496 
4497 /* turn on/off mic-mute LED per capture hook via VREF change */
4498 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4499 				enum led_brightness brightness)
4500 {
4501 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4502 	struct alc_spec *spec = codec->spec;
4503 
4504 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4505 			    spec->micmute_led_polarity, brightness);
4506 	return 0;
4507 }
4508 
4509 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4510 				const struct hda_fixup *fix, int action)
4511 {
4512 	struct alc_spec *spec = codec->spec;
4513 
4514 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4515 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4516 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4517 		 * enable headphone amp
4518 		 */
4519 		spec->gpio_mask |= 0x10;
4520 		spec->gpio_dir |= 0x10;
4521 		spec->cap_mute_led_nid = 0x18;
4522 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4523 		codec->power_filter = led_power_filter;
4524 	}
4525 }
4526 
4527 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4528 				   const struct hda_fixup *fix, int action)
4529 {
4530 	struct alc_spec *spec = codec->spec;
4531 
4532 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4533 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4534 		spec->cap_mute_led_nid = 0x18;
4535 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4536 		codec->power_filter = led_power_filter;
4537 	}
4538 }
4539 
4540 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4541  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4542  */
4543 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4544 				     const struct hda_fixup *fix, int action)
4545 {
4546 	struct alc_spec *spec = codec->spec;
4547 
4548 	switch (action) {
4549 	case HDA_FIXUP_ACT_PRE_PROBE:
4550 		spec->gpio_mask |= 0x01;
4551 		spec->gpio_dir |= 0x01;
4552 		break;
4553 	case HDA_FIXUP_ACT_INIT:
4554 		/* need to toggle GPIO to enable the amp */
4555 		alc_update_gpio_data(codec, 0x01, true);
4556 		msleep(100);
4557 		alc_update_gpio_data(codec, 0x01, false);
4558 		break;
4559 	}
4560 }
4561 
4562 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4563 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4564 				    struct hda_codec *codec,
4565 				    struct snd_pcm_substream *substream,
4566 				    int action)
4567 {
4568 	switch (action) {
4569 	case HDA_GEN_PCM_ACT_PREPARE:
4570 		alc_update_gpio_data(codec, 0x04, true);
4571 		break;
4572 	case HDA_GEN_PCM_ACT_CLEANUP:
4573 		alc_update_gpio_data(codec, 0x04, false);
4574 		break;
4575 	}
4576 }
4577 
4578 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4579 				      const struct hda_fixup *fix,
4580 				      int action)
4581 {
4582 	struct alc_spec *spec = codec->spec;
4583 
4584 	if (action == HDA_FIXUP_ACT_PROBE) {
4585 		spec->gpio_mask |= 0x04;
4586 		spec->gpio_dir |= 0x04;
4587 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4588 	}
4589 }
4590 
4591 static void alc_update_coef_led(struct hda_codec *codec,
4592 				struct alc_coef_led *led,
4593 				bool polarity, bool on)
4594 {
4595 	if (polarity)
4596 		on = !on;
4597 	/* temporarily power up/down for setting COEF bit */
4598 	alc_update_coef_idx(codec, led->idx, led->mask,
4599 			    on ? led->on : led->off);
4600 }
4601 
4602 /* update mute-LED according to the speaker mute state via COEF bit */
4603 static int coef_mute_led_set(struct led_classdev *led_cdev,
4604 			     enum led_brightness brightness)
4605 {
4606 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4607 	struct alc_spec *spec = codec->spec;
4608 
4609 	alc_update_coef_led(codec, &spec->mute_led_coef,
4610 			    spec->mute_led_polarity, brightness);
4611 	return 0;
4612 }
4613 
4614 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4615 					  const struct hda_fixup *fix,
4616 					  int action)
4617 {
4618 	struct alc_spec *spec = codec->spec;
4619 
4620 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4621 		spec->mute_led_polarity = 0;
4622 		spec->mute_led_coef.idx = 0x0b;
4623 		spec->mute_led_coef.mask = 1 << 3;
4624 		spec->mute_led_coef.on = 1 << 3;
4625 		spec->mute_led_coef.off = 0;
4626 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4627 	}
4628 }
4629 
4630 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4631 					  const struct hda_fixup *fix,
4632 					  int action)
4633 {
4634 	struct alc_spec *spec = codec->spec;
4635 
4636 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4637 		spec->mute_led_polarity = 0;
4638 		spec->mute_led_coef.idx = 0x34;
4639 		spec->mute_led_coef.mask = 1 << 5;
4640 		spec->mute_led_coef.on = 0;
4641 		spec->mute_led_coef.off = 1 << 5;
4642 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4643 	}
4644 }
4645 
4646 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4647 					  const struct hda_fixup *fix, int action)
4648 {
4649 	struct alc_spec *spec = codec->spec;
4650 
4651 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4652 		spec->mute_led_polarity = 0;
4653 		spec->mute_led_coef.idx = 0x07;
4654 		spec->mute_led_coef.mask = 1;
4655 		spec->mute_led_coef.on = 1;
4656 		spec->mute_led_coef.off = 0;
4657 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4658 	}
4659 }
4660 
4661 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4662 					  const struct hda_fixup *fix,
4663 					  int action)
4664 {
4665 	struct alc_spec *spec = codec->spec;
4666 
4667 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4668 		spec->mute_led_polarity = 0;
4669 		spec->mute_led_coef.idx = 0x0b;
4670 		spec->mute_led_coef.mask = 3 << 2;
4671 		spec->mute_led_coef.on = 2 << 2;
4672 		spec->mute_led_coef.off = 1 << 2;
4673 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4674 	}
4675 }
4676 
4677 /* turn on/off mic-mute LED per capture hook by coef bit */
4678 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4679 				enum led_brightness brightness)
4680 {
4681 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4682 	struct alc_spec *spec = codec->spec;
4683 
4684 	alc_update_coef_led(codec, &spec->mic_led_coef,
4685 			    spec->micmute_led_polarity, brightness);
4686 	return 0;
4687 }
4688 
4689 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4690 				const struct hda_fixup *fix, int action)
4691 {
4692 	struct alc_spec *spec = codec->spec;
4693 
4694 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4695 		spec->mic_led_coef.idx = 0x19;
4696 		spec->mic_led_coef.mask = 1 << 13;
4697 		spec->mic_led_coef.on = 1 << 13;
4698 		spec->mic_led_coef.off = 0;
4699 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4700 	}
4701 }
4702 
4703 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4704 				const struct hda_fixup *fix, int action)
4705 {
4706 	struct alc_spec *spec = codec->spec;
4707 
4708 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4709 		spec->micmute_led_polarity = 1;
4710 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4711 }
4712 
4713 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4714 				const struct hda_fixup *fix, int action)
4715 {
4716 	struct alc_spec *spec = codec->spec;
4717 
4718 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4719 		spec->mic_led_coef.idx = 0x35;
4720 		spec->mic_led_coef.mask = 3 << 2;
4721 		spec->mic_led_coef.on = 2 << 2;
4722 		spec->mic_led_coef.off = 1 << 2;
4723 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4724 	}
4725 }
4726 
4727 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4728 				const struct hda_fixup *fix, int action)
4729 {
4730 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4731 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4732 }
4733 
4734 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4735 				const struct hda_fixup *fix, int action)
4736 {
4737 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4738 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4739 }
4740 
4741 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4742 				const struct hda_fixup *fix, int action)
4743 {
4744 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4745 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4746 }
4747 
4748 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4749 				const struct hda_fixup *fix, int action)
4750 {
4751 	struct alc_spec *spec = codec->spec;
4752 
4753 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4754 		spec->cap_mute_led_nid = 0x1a;
4755 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4756 		codec->power_filter = led_power_filter;
4757 	}
4758 }
4759 
4760 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4761 				const struct hda_fixup *fix, int action)
4762 {
4763 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4764 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4765 }
4766 
4767 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4768 						  const unsigned short coefs[2])
4769 {
4770 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4771 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4772 	alc_write_coef_idx(codec, 0x26, 0xb011);
4773 }
4774 
4775 struct alc298_samsung_amp_desc {
4776 	unsigned char nid;
4777 	unsigned short init_seq[2][2];
4778 };
4779 
4780 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4781 				     const struct hda_fixup *fix, int action)
4782 {
4783 	int i, j;
4784 	static const unsigned short init_seq[][2] = {
4785 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4786 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4787 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4788 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4789 	};
4790 	static const struct alc298_samsung_amp_desc amps[] = {
4791 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4792 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4793 	};
4794 
4795 	if (action != HDA_FIXUP_ACT_INIT)
4796 		return;
4797 
4798 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4799 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4800 
4801 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4802 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4803 
4804 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4805 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4806 	}
4807 }
4808 
4809 #if IS_REACHABLE(CONFIG_INPUT)
4810 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4811 				   struct hda_jack_callback *event)
4812 {
4813 	struct alc_spec *spec = codec->spec;
4814 
4815 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4816 	   send both key on and key off event for every interrupt. */
4817 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4818 	input_sync(spec->kb_dev);
4819 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4820 	input_sync(spec->kb_dev);
4821 }
4822 
4823 static int alc_register_micmute_input_device(struct hda_codec *codec)
4824 {
4825 	struct alc_spec *spec = codec->spec;
4826 	int i;
4827 
4828 	spec->kb_dev = input_allocate_device();
4829 	if (!spec->kb_dev) {
4830 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4831 		return -ENOMEM;
4832 	}
4833 
4834 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4835 
4836 	spec->kb_dev->name = "Microphone Mute Button";
4837 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4838 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4839 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4840 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4841 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4842 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4843 
4844 	if (input_register_device(spec->kb_dev)) {
4845 		codec_err(codec, "input_register_device failed\n");
4846 		input_free_device(spec->kb_dev);
4847 		spec->kb_dev = NULL;
4848 		return -ENOMEM;
4849 	}
4850 
4851 	return 0;
4852 }
4853 
4854 /* GPIO1 = set according to SKU external amp
4855  * GPIO2 = mic mute hotkey
4856  * GPIO3 = mute LED
4857  * GPIO4 = mic mute LED
4858  */
4859 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4860 					     const struct hda_fixup *fix, int action)
4861 {
4862 	struct alc_spec *spec = codec->spec;
4863 
4864 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4865 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4866 		spec->init_amp = ALC_INIT_DEFAULT;
4867 		if (alc_register_micmute_input_device(codec) != 0)
4868 			return;
4869 
4870 		spec->gpio_mask |= 0x06;
4871 		spec->gpio_dir |= 0x02;
4872 		spec->gpio_data |= 0x02;
4873 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4874 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4875 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4876 						    gpio2_mic_hotkey_event);
4877 		return;
4878 	}
4879 
4880 	if (!spec->kb_dev)
4881 		return;
4882 
4883 	switch (action) {
4884 	case HDA_FIXUP_ACT_FREE:
4885 		input_unregister_device(spec->kb_dev);
4886 		spec->kb_dev = NULL;
4887 	}
4888 }
4889 
4890 /* Line2 = mic mute hotkey
4891  * GPIO2 = mic mute LED
4892  */
4893 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4894 					     const struct hda_fixup *fix, int action)
4895 {
4896 	struct alc_spec *spec = codec->spec;
4897 
4898 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4899 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4900 		spec->init_amp = ALC_INIT_DEFAULT;
4901 		if (alc_register_micmute_input_device(codec) != 0)
4902 			return;
4903 
4904 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
4905 						    gpio2_mic_hotkey_event);
4906 		return;
4907 	}
4908 
4909 	if (!spec->kb_dev)
4910 		return;
4911 
4912 	switch (action) {
4913 	case HDA_FIXUP_ACT_FREE:
4914 		input_unregister_device(spec->kb_dev);
4915 		spec->kb_dev = NULL;
4916 	}
4917 }
4918 #else /* INPUT */
4919 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
4920 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
4921 #endif /* INPUT */
4922 
4923 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4924 				const struct hda_fixup *fix, int action)
4925 {
4926 	struct alc_spec *spec = codec->spec;
4927 
4928 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4929 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4930 		spec->cap_mute_led_nid = 0x18;
4931 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4932 	}
4933 }
4934 
4935 static const struct coef_fw alc225_pre_hsmode[] = {
4936 	UPDATE_COEF(0x4a, 1<<8, 0),
4937 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4938 	UPDATE_COEF(0x63, 3<<14, 3<<14),
4939 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
4940 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
4941 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4942 	UPDATE_COEF(0x4a, 3<<10, 0),
4943 	{}
4944 };
4945 
4946 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4947 {
4948 	struct alc_spec *spec = codec->spec;
4949 	static const struct coef_fw coef0255[] = {
4950 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4951 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4952 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4953 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4954 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4955 		{}
4956 	};
4957 	static const struct coef_fw coef0256[] = {
4958 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4959 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4960 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4961 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4962 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4963 		{}
4964 	};
4965 	static const struct coef_fw coef0233[] = {
4966 		WRITE_COEF(0x1b, 0x0c0b),
4967 		WRITE_COEF(0x45, 0xc429),
4968 		UPDATE_COEF(0x35, 0x4000, 0),
4969 		WRITE_COEF(0x06, 0x2104),
4970 		WRITE_COEF(0x1a, 0x0001),
4971 		WRITE_COEF(0x26, 0x0004),
4972 		WRITE_COEF(0x32, 0x42a3),
4973 		{}
4974 	};
4975 	static const struct coef_fw coef0288[] = {
4976 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4977 		UPDATE_COEF(0x50, 0x2000, 0x2000),
4978 		UPDATE_COEF(0x56, 0x0006, 0x0006),
4979 		UPDATE_COEF(0x66, 0x0008, 0),
4980 		UPDATE_COEF(0x67, 0x2000, 0),
4981 		{}
4982 	};
4983 	static const struct coef_fw coef0298[] = {
4984 		UPDATE_COEF(0x19, 0x1300, 0x0300),
4985 		{}
4986 	};
4987 	static const struct coef_fw coef0292[] = {
4988 		WRITE_COEF(0x76, 0x000e),
4989 		WRITE_COEF(0x6c, 0x2400),
4990 		WRITE_COEF(0x18, 0x7308),
4991 		WRITE_COEF(0x6b, 0xc429),
4992 		{}
4993 	};
4994 	static const struct coef_fw coef0293[] = {
4995 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4996 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4997 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4998 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4999 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5000 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5001 		{}
5002 	};
5003 	static const struct coef_fw coef0668[] = {
5004 		WRITE_COEF(0x15, 0x0d40),
5005 		WRITE_COEF(0xb7, 0x802b),
5006 		{}
5007 	};
5008 	static const struct coef_fw coef0225[] = {
5009 		UPDATE_COEF(0x63, 3<<14, 0),
5010 		{}
5011 	};
5012 	static const struct coef_fw coef0274[] = {
5013 		UPDATE_COEF(0x4a, 0x0100, 0),
5014 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5015 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
5016 		UPDATE_COEF(0x4a, 0x0010, 0),
5017 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5018 		WRITE_COEF(0x45, 0x5289),
5019 		UPDATE_COEF(0x4a, 0x0c00, 0),
5020 		{}
5021 	};
5022 
5023 	if (spec->no_internal_mic_pin) {
5024 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5025 		return;
5026 	}
5027 
5028 	switch (codec->core.vendor_id) {
5029 	case 0x10ec0255:
5030 		alc_process_coef_fw(codec, coef0255);
5031 		break;
5032 	case 0x10ec0230:
5033 	case 0x10ec0236:
5034 	case 0x10ec0256:
5035 	case 0x19e58326:
5036 		alc_process_coef_fw(codec, coef0256);
5037 		break;
5038 	case 0x10ec0234:
5039 	case 0x10ec0274:
5040 	case 0x10ec0294:
5041 		alc_process_coef_fw(codec, coef0274);
5042 		break;
5043 	case 0x10ec0233:
5044 	case 0x10ec0283:
5045 		alc_process_coef_fw(codec, coef0233);
5046 		break;
5047 	case 0x10ec0286:
5048 	case 0x10ec0288:
5049 		alc_process_coef_fw(codec, coef0288);
5050 		break;
5051 	case 0x10ec0298:
5052 		alc_process_coef_fw(codec, coef0298);
5053 		alc_process_coef_fw(codec, coef0288);
5054 		break;
5055 	case 0x10ec0292:
5056 		alc_process_coef_fw(codec, coef0292);
5057 		break;
5058 	case 0x10ec0293:
5059 		alc_process_coef_fw(codec, coef0293);
5060 		break;
5061 	case 0x10ec0668:
5062 		alc_process_coef_fw(codec, coef0668);
5063 		break;
5064 	case 0x10ec0215:
5065 	case 0x10ec0225:
5066 	case 0x10ec0285:
5067 	case 0x10ec0295:
5068 	case 0x10ec0289:
5069 	case 0x10ec0299:
5070 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5071 		alc_process_coef_fw(codec, coef0225);
5072 		break;
5073 	case 0x10ec0867:
5074 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5075 		break;
5076 	}
5077 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5078 }
5079 
5080 
5081 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5082 				    hda_nid_t mic_pin)
5083 {
5084 	static const struct coef_fw coef0255[] = {
5085 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5086 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5087 		{}
5088 	};
5089 	static const struct coef_fw coef0256[] = {
5090 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5091 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5092 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5093 		{}
5094 	};
5095 	static const struct coef_fw coef0233[] = {
5096 		UPDATE_COEF(0x35, 0, 1<<14),
5097 		WRITE_COEF(0x06, 0x2100),
5098 		WRITE_COEF(0x1a, 0x0021),
5099 		WRITE_COEF(0x26, 0x008c),
5100 		{}
5101 	};
5102 	static const struct coef_fw coef0288[] = {
5103 		UPDATE_COEF(0x4f, 0x00c0, 0),
5104 		UPDATE_COEF(0x50, 0x2000, 0),
5105 		UPDATE_COEF(0x56, 0x0006, 0),
5106 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5107 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5108 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5109 		{}
5110 	};
5111 	static const struct coef_fw coef0292[] = {
5112 		WRITE_COEF(0x19, 0xa208),
5113 		WRITE_COEF(0x2e, 0xacf0),
5114 		{}
5115 	};
5116 	static const struct coef_fw coef0293[] = {
5117 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5118 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5119 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5120 		{}
5121 	};
5122 	static const struct coef_fw coef0688[] = {
5123 		WRITE_COEF(0xb7, 0x802b),
5124 		WRITE_COEF(0xb5, 0x1040),
5125 		UPDATE_COEF(0xc3, 0, 1<<12),
5126 		{}
5127 	};
5128 	static const struct coef_fw coef0225[] = {
5129 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5130 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5131 		UPDATE_COEF(0x63, 3<<14, 0),
5132 		{}
5133 	};
5134 	static const struct coef_fw coef0274[] = {
5135 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5136 		UPDATE_COEF(0x4a, 0x0010, 0),
5137 		UPDATE_COEF(0x6b, 0xf000, 0),
5138 		{}
5139 	};
5140 
5141 	switch (codec->core.vendor_id) {
5142 	case 0x10ec0255:
5143 		alc_write_coef_idx(codec, 0x45, 0xc489);
5144 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5145 		alc_process_coef_fw(codec, coef0255);
5146 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5147 		break;
5148 	case 0x10ec0230:
5149 	case 0x10ec0236:
5150 	case 0x10ec0256:
5151 	case 0x19e58326:
5152 		alc_write_coef_idx(codec, 0x45, 0xc489);
5153 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5154 		alc_process_coef_fw(codec, coef0256);
5155 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5156 		break;
5157 	case 0x10ec0234:
5158 	case 0x10ec0274:
5159 	case 0x10ec0294:
5160 		alc_write_coef_idx(codec, 0x45, 0x4689);
5161 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5162 		alc_process_coef_fw(codec, coef0274);
5163 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5164 		break;
5165 	case 0x10ec0233:
5166 	case 0x10ec0283:
5167 		alc_write_coef_idx(codec, 0x45, 0xc429);
5168 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5169 		alc_process_coef_fw(codec, coef0233);
5170 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5171 		break;
5172 	case 0x10ec0286:
5173 	case 0x10ec0288:
5174 	case 0x10ec0298:
5175 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5176 		alc_process_coef_fw(codec, coef0288);
5177 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5178 		break;
5179 	case 0x10ec0292:
5180 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5181 		alc_process_coef_fw(codec, coef0292);
5182 		break;
5183 	case 0x10ec0293:
5184 		/* Set to TRS mode */
5185 		alc_write_coef_idx(codec, 0x45, 0xc429);
5186 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5187 		alc_process_coef_fw(codec, coef0293);
5188 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5189 		break;
5190 	case 0x10ec0867:
5191 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5192 		fallthrough;
5193 	case 0x10ec0221:
5194 	case 0x10ec0662:
5195 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5196 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5197 		break;
5198 	case 0x10ec0668:
5199 		alc_write_coef_idx(codec, 0x11, 0x0001);
5200 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5201 		alc_process_coef_fw(codec, coef0688);
5202 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5203 		break;
5204 	case 0x10ec0215:
5205 	case 0x10ec0225:
5206 	case 0x10ec0285:
5207 	case 0x10ec0295:
5208 	case 0x10ec0289:
5209 	case 0x10ec0299:
5210 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5211 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5212 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5213 		alc_process_coef_fw(codec, coef0225);
5214 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5215 		break;
5216 	}
5217 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5218 }
5219 
5220 static void alc_headset_mode_default(struct hda_codec *codec)
5221 {
5222 	static const struct coef_fw coef0225[] = {
5223 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5224 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5225 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5226 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5227 		UPDATE_COEF(0x63, 3<<14, 0),
5228 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5229 		{}
5230 	};
5231 	static const struct coef_fw coef0255[] = {
5232 		WRITE_COEF(0x45, 0xc089),
5233 		WRITE_COEF(0x45, 0xc489),
5234 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5235 		WRITE_COEF(0x49, 0x0049),
5236 		{}
5237 	};
5238 	static const struct coef_fw coef0256[] = {
5239 		WRITE_COEF(0x45, 0xc489),
5240 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5241 		WRITE_COEF(0x49, 0x0049),
5242 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5243 		WRITE_COEF(0x06, 0x6100),
5244 		{}
5245 	};
5246 	static const struct coef_fw coef0233[] = {
5247 		WRITE_COEF(0x06, 0x2100),
5248 		WRITE_COEF(0x32, 0x4ea3),
5249 		{}
5250 	};
5251 	static const struct coef_fw coef0288[] = {
5252 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5253 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5254 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5255 		UPDATE_COEF(0x66, 0x0008, 0),
5256 		UPDATE_COEF(0x67, 0x2000, 0),
5257 		{}
5258 	};
5259 	static const struct coef_fw coef0292[] = {
5260 		WRITE_COEF(0x76, 0x000e),
5261 		WRITE_COEF(0x6c, 0x2400),
5262 		WRITE_COEF(0x6b, 0xc429),
5263 		WRITE_COEF(0x18, 0x7308),
5264 		{}
5265 	};
5266 	static const struct coef_fw coef0293[] = {
5267 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5268 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5269 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5270 		{}
5271 	};
5272 	static const struct coef_fw coef0688[] = {
5273 		WRITE_COEF(0x11, 0x0041),
5274 		WRITE_COEF(0x15, 0x0d40),
5275 		WRITE_COEF(0xb7, 0x802b),
5276 		{}
5277 	};
5278 	static const struct coef_fw coef0274[] = {
5279 		WRITE_COEF(0x45, 0x4289),
5280 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5281 		UPDATE_COEF(0x6b, 0x0f00, 0),
5282 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5283 		{}
5284 	};
5285 
5286 	switch (codec->core.vendor_id) {
5287 	case 0x10ec0215:
5288 	case 0x10ec0225:
5289 	case 0x10ec0285:
5290 	case 0x10ec0295:
5291 	case 0x10ec0289:
5292 	case 0x10ec0299:
5293 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5294 		alc_process_coef_fw(codec, coef0225);
5295 		break;
5296 	case 0x10ec0255:
5297 		alc_process_coef_fw(codec, coef0255);
5298 		break;
5299 	case 0x10ec0230:
5300 	case 0x10ec0236:
5301 	case 0x10ec0256:
5302 	case 0x19e58326:
5303 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5304 		alc_write_coef_idx(codec, 0x45, 0xc089);
5305 		msleep(50);
5306 		alc_process_coef_fw(codec, coef0256);
5307 		break;
5308 	case 0x10ec0234:
5309 	case 0x10ec0274:
5310 	case 0x10ec0294:
5311 		alc_process_coef_fw(codec, coef0274);
5312 		break;
5313 	case 0x10ec0233:
5314 	case 0x10ec0283:
5315 		alc_process_coef_fw(codec, coef0233);
5316 		break;
5317 	case 0x10ec0286:
5318 	case 0x10ec0288:
5319 	case 0x10ec0298:
5320 		alc_process_coef_fw(codec, coef0288);
5321 		break;
5322 	case 0x10ec0292:
5323 		alc_process_coef_fw(codec, coef0292);
5324 		break;
5325 	case 0x10ec0293:
5326 		alc_process_coef_fw(codec, coef0293);
5327 		break;
5328 	case 0x10ec0668:
5329 		alc_process_coef_fw(codec, coef0688);
5330 		break;
5331 	case 0x10ec0867:
5332 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5333 		break;
5334 	}
5335 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5336 }
5337 
5338 /* Iphone type */
5339 static void alc_headset_mode_ctia(struct hda_codec *codec)
5340 {
5341 	int val;
5342 
5343 	static const struct coef_fw coef0255[] = {
5344 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5345 		WRITE_COEF(0x1b, 0x0c2b),
5346 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5347 		{}
5348 	};
5349 	static const struct coef_fw coef0256[] = {
5350 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5351 		WRITE_COEF(0x1b, 0x0e6b),
5352 		{}
5353 	};
5354 	static const struct coef_fw coef0233[] = {
5355 		WRITE_COEF(0x45, 0xd429),
5356 		WRITE_COEF(0x1b, 0x0c2b),
5357 		WRITE_COEF(0x32, 0x4ea3),
5358 		{}
5359 	};
5360 	static const struct coef_fw coef0288[] = {
5361 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5362 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5363 		UPDATE_COEF(0x66, 0x0008, 0),
5364 		UPDATE_COEF(0x67, 0x2000, 0),
5365 		{}
5366 	};
5367 	static const struct coef_fw coef0292[] = {
5368 		WRITE_COEF(0x6b, 0xd429),
5369 		WRITE_COEF(0x76, 0x0008),
5370 		WRITE_COEF(0x18, 0x7388),
5371 		{}
5372 	};
5373 	static const struct coef_fw coef0293[] = {
5374 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5375 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5376 		{}
5377 	};
5378 	static const struct coef_fw coef0688[] = {
5379 		WRITE_COEF(0x11, 0x0001),
5380 		WRITE_COEF(0x15, 0x0d60),
5381 		WRITE_COEF(0xc3, 0x0000),
5382 		{}
5383 	};
5384 	static const struct coef_fw coef0225_1[] = {
5385 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5386 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5387 		{}
5388 	};
5389 	static const struct coef_fw coef0225_2[] = {
5390 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5391 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5392 		{}
5393 	};
5394 
5395 	switch (codec->core.vendor_id) {
5396 	case 0x10ec0255:
5397 		alc_process_coef_fw(codec, coef0255);
5398 		break;
5399 	case 0x10ec0230:
5400 	case 0x10ec0236:
5401 	case 0x10ec0256:
5402 	case 0x19e58326:
5403 		alc_process_coef_fw(codec, coef0256);
5404 		break;
5405 	case 0x10ec0234:
5406 	case 0x10ec0274:
5407 	case 0x10ec0294:
5408 		alc_write_coef_idx(codec, 0x45, 0xd689);
5409 		break;
5410 	case 0x10ec0233:
5411 	case 0x10ec0283:
5412 		alc_process_coef_fw(codec, coef0233);
5413 		break;
5414 	case 0x10ec0298:
5415 		val = alc_read_coef_idx(codec, 0x50);
5416 		if (val & (1 << 12)) {
5417 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5418 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5419 			msleep(300);
5420 		} else {
5421 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5422 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5423 			msleep(300);
5424 		}
5425 		break;
5426 	case 0x10ec0286:
5427 	case 0x10ec0288:
5428 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5429 		msleep(300);
5430 		alc_process_coef_fw(codec, coef0288);
5431 		break;
5432 	case 0x10ec0292:
5433 		alc_process_coef_fw(codec, coef0292);
5434 		break;
5435 	case 0x10ec0293:
5436 		alc_process_coef_fw(codec, coef0293);
5437 		break;
5438 	case 0x10ec0668:
5439 		alc_process_coef_fw(codec, coef0688);
5440 		break;
5441 	case 0x10ec0215:
5442 	case 0x10ec0225:
5443 	case 0x10ec0285:
5444 	case 0x10ec0295:
5445 	case 0x10ec0289:
5446 	case 0x10ec0299:
5447 		val = alc_read_coef_idx(codec, 0x45);
5448 		if (val & (1 << 9))
5449 			alc_process_coef_fw(codec, coef0225_2);
5450 		else
5451 			alc_process_coef_fw(codec, coef0225_1);
5452 		break;
5453 	case 0x10ec0867:
5454 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5455 		break;
5456 	}
5457 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5458 }
5459 
5460 /* Nokia type */
5461 static void alc_headset_mode_omtp(struct hda_codec *codec)
5462 {
5463 	static const struct coef_fw coef0255[] = {
5464 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5465 		WRITE_COEF(0x1b, 0x0c2b),
5466 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5467 		{}
5468 	};
5469 	static const struct coef_fw coef0256[] = {
5470 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5471 		WRITE_COEF(0x1b, 0x0e6b),
5472 		{}
5473 	};
5474 	static const struct coef_fw coef0233[] = {
5475 		WRITE_COEF(0x45, 0xe429),
5476 		WRITE_COEF(0x1b, 0x0c2b),
5477 		WRITE_COEF(0x32, 0x4ea3),
5478 		{}
5479 	};
5480 	static const struct coef_fw coef0288[] = {
5481 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5482 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5483 		UPDATE_COEF(0x66, 0x0008, 0),
5484 		UPDATE_COEF(0x67, 0x2000, 0),
5485 		{}
5486 	};
5487 	static const struct coef_fw coef0292[] = {
5488 		WRITE_COEF(0x6b, 0xe429),
5489 		WRITE_COEF(0x76, 0x0008),
5490 		WRITE_COEF(0x18, 0x7388),
5491 		{}
5492 	};
5493 	static const struct coef_fw coef0293[] = {
5494 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5495 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5496 		{}
5497 	};
5498 	static const struct coef_fw coef0688[] = {
5499 		WRITE_COEF(0x11, 0x0001),
5500 		WRITE_COEF(0x15, 0x0d50),
5501 		WRITE_COEF(0xc3, 0x0000),
5502 		{}
5503 	};
5504 	static const struct coef_fw coef0225[] = {
5505 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5506 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5507 		{}
5508 	};
5509 
5510 	switch (codec->core.vendor_id) {
5511 	case 0x10ec0255:
5512 		alc_process_coef_fw(codec, coef0255);
5513 		break;
5514 	case 0x10ec0230:
5515 	case 0x10ec0236:
5516 	case 0x10ec0256:
5517 	case 0x19e58326:
5518 		alc_process_coef_fw(codec, coef0256);
5519 		break;
5520 	case 0x10ec0234:
5521 	case 0x10ec0274:
5522 	case 0x10ec0294:
5523 		alc_write_coef_idx(codec, 0x45, 0xe689);
5524 		break;
5525 	case 0x10ec0233:
5526 	case 0x10ec0283:
5527 		alc_process_coef_fw(codec, coef0233);
5528 		break;
5529 	case 0x10ec0298:
5530 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5531 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5532 		msleep(300);
5533 		break;
5534 	case 0x10ec0286:
5535 	case 0x10ec0288:
5536 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5537 		msleep(300);
5538 		alc_process_coef_fw(codec, coef0288);
5539 		break;
5540 	case 0x10ec0292:
5541 		alc_process_coef_fw(codec, coef0292);
5542 		break;
5543 	case 0x10ec0293:
5544 		alc_process_coef_fw(codec, coef0293);
5545 		break;
5546 	case 0x10ec0668:
5547 		alc_process_coef_fw(codec, coef0688);
5548 		break;
5549 	case 0x10ec0215:
5550 	case 0x10ec0225:
5551 	case 0x10ec0285:
5552 	case 0x10ec0295:
5553 	case 0x10ec0289:
5554 	case 0x10ec0299:
5555 		alc_process_coef_fw(codec, coef0225);
5556 		break;
5557 	}
5558 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5559 }
5560 
5561 static void alc_determine_headset_type(struct hda_codec *codec)
5562 {
5563 	int val;
5564 	bool is_ctia = false;
5565 	struct alc_spec *spec = codec->spec;
5566 	static const struct coef_fw coef0255[] = {
5567 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5568 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5569  conteol) */
5570 		{}
5571 	};
5572 	static const struct coef_fw coef0288[] = {
5573 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5574 		{}
5575 	};
5576 	static const struct coef_fw coef0298[] = {
5577 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5578 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5579 		UPDATE_COEF(0x66, 0x0008, 0),
5580 		UPDATE_COEF(0x67, 0x2000, 0),
5581 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5582 		{}
5583 	};
5584 	static const struct coef_fw coef0293[] = {
5585 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5586 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5587 		{}
5588 	};
5589 	static const struct coef_fw coef0688[] = {
5590 		WRITE_COEF(0x11, 0x0001),
5591 		WRITE_COEF(0xb7, 0x802b),
5592 		WRITE_COEF(0x15, 0x0d60),
5593 		WRITE_COEF(0xc3, 0x0c00),
5594 		{}
5595 	};
5596 	static const struct coef_fw coef0274[] = {
5597 		UPDATE_COEF(0x4a, 0x0010, 0),
5598 		UPDATE_COEF(0x4a, 0x8000, 0),
5599 		WRITE_COEF(0x45, 0xd289),
5600 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5601 		{}
5602 	};
5603 
5604 	if (spec->no_internal_mic_pin) {
5605 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5606 		return;
5607 	}
5608 
5609 	switch (codec->core.vendor_id) {
5610 	case 0x10ec0255:
5611 		alc_process_coef_fw(codec, coef0255);
5612 		msleep(300);
5613 		val = alc_read_coef_idx(codec, 0x46);
5614 		is_ctia = (val & 0x0070) == 0x0070;
5615 		break;
5616 	case 0x10ec0230:
5617 	case 0x10ec0236:
5618 	case 0x10ec0256:
5619 	case 0x19e58326:
5620 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5621 		alc_write_coef_idx(codec, 0x06, 0x6104);
5622 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5623 
5624 		snd_hda_codec_write(codec, 0x21, 0,
5625 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5626 		msleep(80);
5627 		snd_hda_codec_write(codec, 0x21, 0,
5628 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5629 
5630 		alc_process_coef_fw(codec, coef0255);
5631 		msleep(300);
5632 		val = alc_read_coef_idx(codec, 0x46);
5633 		is_ctia = (val & 0x0070) == 0x0070;
5634 
5635 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5636 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5637 
5638 		snd_hda_codec_write(codec, 0x21, 0,
5639 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5640 		msleep(80);
5641 		snd_hda_codec_write(codec, 0x21, 0,
5642 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5643 		break;
5644 	case 0x10ec0234:
5645 	case 0x10ec0274:
5646 	case 0x10ec0294:
5647 		alc_process_coef_fw(codec, coef0274);
5648 		msleep(850);
5649 		val = alc_read_coef_idx(codec, 0x46);
5650 		is_ctia = (val & 0x00f0) == 0x00f0;
5651 		break;
5652 	case 0x10ec0233:
5653 	case 0x10ec0283:
5654 		alc_write_coef_idx(codec, 0x45, 0xd029);
5655 		msleep(300);
5656 		val = alc_read_coef_idx(codec, 0x46);
5657 		is_ctia = (val & 0x0070) == 0x0070;
5658 		break;
5659 	case 0x10ec0298:
5660 		snd_hda_codec_write(codec, 0x21, 0,
5661 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5662 		msleep(100);
5663 		snd_hda_codec_write(codec, 0x21, 0,
5664 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5665 		msleep(200);
5666 
5667 		val = alc_read_coef_idx(codec, 0x50);
5668 		if (val & (1 << 12)) {
5669 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5670 			alc_process_coef_fw(codec, coef0288);
5671 			msleep(350);
5672 			val = alc_read_coef_idx(codec, 0x50);
5673 			is_ctia = (val & 0x0070) == 0x0070;
5674 		} else {
5675 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5676 			alc_process_coef_fw(codec, coef0288);
5677 			msleep(350);
5678 			val = alc_read_coef_idx(codec, 0x50);
5679 			is_ctia = (val & 0x0070) == 0x0070;
5680 		}
5681 		alc_process_coef_fw(codec, coef0298);
5682 		snd_hda_codec_write(codec, 0x21, 0,
5683 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5684 		msleep(75);
5685 		snd_hda_codec_write(codec, 0x21, 0,
5686 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5687 		break;
5688 	case 0x10ec0286:
5689 	case 0x10ec0288:
5690 		alc_process_coef_fw(codec, coef0288);
5691 		msleep(350);
5692 		val = alc_read_coef_idx(codec, 0x50);
5693 		is_ctia = (val & 0x0070) == 0x0070;
5694 		break;
5695 	case 0x10ec0292:
5696 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5697 		msleep(300);
5698 		val = alc_read_coef_idx(codec, 0x6c);
5699 		is_ctia = (val & 0x001c) == 0x001c;
5700 		break;
5701 	case 0x10ec0293:
5702 		alc_process_coef_fw(codec, coef0293);
5703 		msleep(300);
5704 		val = alc_read_coef_idx(codec, 0x46);
5705 		is_ctia = (val & 0x0070) == 0x0070;
5706 		break;
5707 	case 0x10ec0668:
5708 		alc_process_coef_fw(codec, coef0688);
5709 		msleep(300);
5710 		val = alc_read_coef_idx(codec, 0xbe);
5711 		is_ctia = (val & 0x1c02) == 0x1c02;
5712 		break;
5713 	case 0x10ec0215:
5714 	case 0x10ec0225:
5715 	case 0x10ec0285:
5716 	case 0x10ec0295:
5717 	case 0x10ec0289:
5718 	case 0x10ec0299:
5719 		snd_hda_codec_write(codec, 0x21, 0,
5720 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5721 		msleep(80);
5722 		snd_hda_codec_write(codec, 0x21, 0,
5723 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5724 
5725 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5726 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5727 		val = alc_read_coef_idx(codec, 0x45);
5728 		if (val & (1 << 9)) {
5729 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5730 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5731 			msleep(800);
5732 			val = alc_read_coef_idx(codec, 0x46);
5733 			is_ctia = (val & 0x00f0) == 0x00f0;
5734 		} else {
5735 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5736 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5737 			msleep(800);
5738 			val = alc_read_coef_idx(codec, 0x46);
5739 			is_ctia = (val & 0x00f0) == 0x00f0;
5740 		}
5741 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5742 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5743 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5744 
5745 		snd_hda_codec_write(codec, 0x21, 0,
5746 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5747 		msleep(80);
5748 		snd_hda_codec_write(codec, 0x21, 0,
5749 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5750 		break;
5751 	case 0x10ec0867:
5752 		is_ctia = true;
5753 		break;
5754 	}
5755 
5756 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5757 		    is_ctia ? "yes" : "no");
5758 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5759 }
5760 
5761 static void alc_update_headset_mode(struct hda_codec *codec)
5762 {
5763 	struct alc_spec *spec = codec->spec;
5764 
5765 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5766 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5767 
5768 	int new_headset_mode;
5769 
5770 	if (!snd_hda_jack_detect(codec, hp_pin))
5771 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5772 	else if (mux_pin == spec->headset_mic_pin)
5773 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5774 	else if (mux_pin == spec->headphone_mic_pin)
5775 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5776 	else
5777 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5778 
5779 	if (new_headset_mode == spec->current_headset_mode) {
5780 		snd_hda_gen_update_outputs(codec);
5781 		return;
5782 	}
5783 
5784 	switch (new_headset_mode) {
5785 	case ALC_HEADSET_MODE_UNPLUGGED:
5786 		alc_headset_mode_unplugged(codec);
5787 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5788 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5789 		spec->gen.hp_jack_present = false;
5790 		break;
5791 	case ALC_HEADSET_MODE_HEADSET:
5792 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5793 			alc_determine_headset_type(codec);
5794 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5795 			alc_headset_mode_ctia(codec);
5796 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5797 			alc_headset_mode_omtp(codec);
5798 		spec->gen.hp_jack_present = true;
5799 		break;
5800 	case ALC_HEADSET_MODE_MIC:
5801 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5802 		spec->gen.hp_jack_present = false;
5803 		break;
5804 	case ALC_HEADSET_MODE_HEADPHONE:
5805 		alc_headset_mode_default(codec);
5806 		spec->gen.hp_jack_present = true;
5807 		break;
5808 	}
5809 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5810 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5811 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5812 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5813 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5814 						  PIN_VREFHIZ);
5815 	}
5816 	spec->current_headset_mode = new_headset_mode;
5817 
5818 	snd_hda_gen_update_outputs(codec);
5819 }
5820 
5821 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5822 					 struct snd_kcontrol *kcontrol,
5823 					 struct snd_ctl_elem_value *ucontrol)
5824 {
5825 	alc_update_headset_mode(codec);
5826 }
5827 
5828 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5829 				       struct hda_jack_callback *jack)
5830 {
5831 	snd_hda_gen_hp_automute(codec, jack);
5832 	alc_update_headset_mode(codec);
5833 }
5834 
5835 static void alc_probe_headset_mode(struct hda_codec *codec)
5836 {
5837 	int i;
5838 	struct alc_spec *spec = codec->spec;
5839 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5840 
5841 	/* Find mic pins */
5842 	for (i = 0; i < cfg->num_inputs; i++) {
5843 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5844 			spec->headset_mic_pin = cfg->inputs[i].pin;
5845 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5846 			spec->headphone_mic_pin = cfg->inputs[i].pin;
5847 	}
5848 
5849 	WARN_ON(spec->gen.cap_sync_hook);
5850 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5851 	spec->gen.automute_hook = alc_update_headset_mode;
5852 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5853 }
5854 
5855 static void alc_fixup_headset_mode(struct hda_codec *codec,
5856 				const struct hda_fixup *fix, int action)
5857 {
5858 	struct alc_spec *spec = codec->spec;
5859 
5860 	switch (action) {
5861 	case HDA_FIXUP_ACT_PRE_PROBE:
5862 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5863 		break;
5864 	case HDA_FIXUP_ACT_PROBE:
5865 		alc_probe_headset_mode(codec);
5866 		break;
5867 	case HDA_FIXUP_ACT_INIT:
5868 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
5869 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5870 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5871 		}
5872 		alc_update_headset_mode(codec);
5873 		break;
5874 	}
5875 }
5876 
5877 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5878 				const struct hda_fixup *fix, int action)
5879 {
5880 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5881 		struct alc_spec *spec = codec->spec;
5882 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5883 	}
5884 	else
5885 		alc_fixup_headset_mode(codec, fix, action);
5886 }
5887 
5888 static void alc255_set_default_jack_type(struct hda_codec *codec)
5889 {
5890 	/* Set to iphone type */
5891 	static const struct coef_fw alc255fw[] = {
5892 		WRITE_COEF(0x1b, 0x880b),
5893 		WRITE_COEF(0x45, 0xd089),
5894 		WRITE_COEF(0x1b, 0x080b),
5895 		WRITE_COEF(0x46, 0x0004),
5896 		WRITE_COEF(0x1b, 0x0c0b),
5897 		{}
5898 	};
5899 	static const struct coef_fw alc256fw[] = {
5900 		WRITE_COEF(0x1b, 0x884b),
5901 		WRITE_COEF(0x45, 0xd089),
5902 		WRITE_COEF(0x1b, 0x084b),
5903 		WRITE_COEF(0x46, 0x0004),
5904 		WRITE_COEF(0x1b, 0x0c4b),
5905 		{}
5906 	};
5907 	switch (codec->core.vendor_id) {
5908 	case 0x10ec0255:
5909 		alc_process_coef_fw(codec, alc255fw);
5910 		break;
5911 	case 0x10ec0230:
5912 	case 0x10ec0236:
5913 	case 0x10ec0256:
5914 	case 0x19e58326:
5915 		alc_process_coef_fw(codec, alc256fw);
5916 		break;
5917 	}
5918 	msleep(30);
5919 }
5920 
5921 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5922 				const struct hda_fixup *fix, int action)
5923 {
5924 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5925 		alc255_set_default_jack_type(codec);
5926 	}
5927 	alc_fixup_headset_mode(codec, fix, action);
5928 }
5929 
5930 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5931 				const struct hda_fixup *fix, int action)
5932 {
5933 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5934 		struct alc_spec *spec = codec->spec;
5935 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5936 		alc255_set_default_jack_type(codec);
5937 	}
5938 	else
5939 		alc_fixup_headset_mode(codec, fix, action);
5940 }
5941 
5942 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5943 				       struct hda_jack_callback *jack)
5944 {
5945 	struct alc_spec *spec = codec->spec;
5946 
5947 	alc_update_headset_jack_cb(codec, jack);
5948 	/* Headset Mic enable or disable, only for Dell Dino */
5949 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5950 }
5951 
5952 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5953 				const struct hda_fixup *fix, int action)
5954 {
5955 	alc_fixup_headset_mode(codec, fix, action);
5956 	if (action == HDA_FIXUP_ACT_PROBE) {
5957 		struct alc_spec *spec = codec->spec;
5958 		/* toggled via hp_automute_hook */
5959 		spec->gpio_mask |= 0x40;
5960 		spec->gpio_dir |= 0x40;
5961 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5962 	}
5963 }
5964 
5965 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5966 					const struct hda_fixup *fix, int action)
5967 {
5968 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5969 		struct alc_spec *spec = codec->spec;
5970 		spec->gen.auto_mute_via_amp = 1;
5971 	}
5972 }
5973 
5974 static void alc_fixup_no_shutup(struct hda_codec *codec,
5975 				const struct hda_fixup *fix, int action)
5976 {
5977 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5978 		struct alc_spec *spec = codec->spec;
5979 		spec->no_shutup_pins = 1;
5980 	}
5981 }
5982 
5983 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5984 				    const struct hda_fixup *fix, int action)
5985 {
5986 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5987 		struct alc_spec *spec = codec->spec;
5988 		/* Disable AA-loopback as it causes white noise */
5989 		spec->gen.mixer_nid = 0;
5990 	}
5991 }
5992 
5993 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5994 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5995 				  const struct hda_fixup *fix, int action)
5996 {
5997 	static const struct hda_pintbl pincfgs[] = {
5998 		{ 0x16, 0x21211010 }, /* dock headphone */
5999 		{ 0x19, 0x21a11010 }, /* dock mic */
6000 		{ }
6001 	};
6002 	struct alc_spec *spec = codec->spec;
6003 
6004 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6005 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6006 		codec->power_save_node = 0; /* avoid click noises */
6007 		snd_hda_apply_pincfgs(codec, pincfgs);
6008 	}
6009 }
6010 
6011 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6012 				  const struct hda_fixup *fix, int action)
6013 {
6014 	static const struct hda_pintbl pincfgs[] = {
6015 		{ 0x17, 0x21211010 }, /* dock headphone */
6016 		{ 0x19, 0x21a11010 }, /* dock mic */
6017 		{ }
6018 	};
6019 	struct alc_spec *spec = codec->spec;
6020 
6021 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6022 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6023 		snd_hda_apply_pincfgs(codec, pincfgs);
6024 	} else if (action == HDA_FIXUP_ACT_INIT) {
6025 		/* Enable DOCK device */
6026 		snd_hda_codec_write(codec, 0x17, 0,
6027 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6028 		/* Enable DOCK device */
6029 		snd_hda_codec_write(codec, 0x19, 0,
6030 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6031 	}
6032 }
6033 
6034 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6035 				  const struct hda_fixup *fix, int action)
6036 {
6037 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6038 	 * the speaker output becomes too low by some reason on Thinkpads with
6039 	 * ALC298 codec
6040 	 */
6041 	static const hda_nid_t preferred_pairs[] = {
6042 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6043 		0
6044 	};
6045 	struct alc_spec *spec = codec->spec;
6046 
6047 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6048 		spec->gen.preferred_dacs = preferred_pairs;
6049 }
6050 
6051 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6052 				   const struct hda_fixup *fix, int action)
6053 {
6054 	static const hda_nid_t preferred_pairs[] = {
6055 		0x17, 0x02, 0x21, 0x03, 0
6056 	};
6057 	struct alc_spec *spec = codec->spec;
6058 
6059 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6060 		spec->gen.preferred_dacs = preferred_pairs;
6061 }
6062 
6063 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6064 {
6065 	struct alc_spec *spec = codec->spec;
6066 	int hp_pin = alc_get_hp_pin(spec);
6067 
6068 	/* Prevent pop noises when headphones are plugged in */
6069 	snd_hda_codec_write(codec, hp_pin, 0,
6070 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6071 	msleep(20);
6072 }
6073 
6074 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6075 				const struct hda_fixup *fix, int action)
6076 {
6077 	struct alc_spec *spec = codec->spec;
6078 	struct hda_input_mux *imux = &spec->gen.input_mux;
6079 	int i;
6080 
6081 	switch (action) {
6082 	case HDA_FIXUP_ACT_PRE_PROBE:
6083 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6084 		 * it causes a click noise at start up
6085 		 */
6086 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6087 		spec->shutup = alc_shutup_dell_xps13;
6088 		break;
6089 	case HDA_FIXUP_ACT_PROBE:
6090 		/* Make the internal mic the default input source. */
6091 		for (i = 0; i < imux->num_items; i++) {
6092 			if (spec->gen.imux_pins[i] == 0x12) {
6093 				spec->gen.cur_mux[0] = i;
6094 				break;
6095 			}
6096 		}
6097 		break;
6098 	}
6099 }
6100 
6101 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6102 				const struct hda_fixup *fix, int action)
6103 {
6104 	struct alc_spec *spec = codec->spec;
6105 
6106 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6107 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6108 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6109 
6110 		/* Disable boost for mic-in permanently. (This code is only called
6111 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6112 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6113 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6114 	} else
6115 		alc_fixup_headset_mode(codec, fix, action);
6116 }
6117 
6118 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6119 				const struct hda_fixup *fix, int action)
6120 {
6121 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6122 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6123 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6124 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6125 	}
6126 	alc_fixup_headset_mode(codec, fix, action);
6127 }
6128 
6129 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6130 static int find_ext_mic_pin(struct hda_codec *codec)
6131 {
6132 	struct alc_spec *spec = codec->spec;
6133 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6134 	hda_nid_t nid;
6135 	unsigned int defcfg;
6136 	int i;
6137 
6138 	for (i = 0; i < cfg->num_inputs; i++) {
6139 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6140 			continue;
6141 		nid = cfg->inputs[i].pin;
6142 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6143 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6144 			continue;
6145 		return nid;
6146 	}
6147 
6148 	return 0;
6149 }
6150 
6151 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6152 				    const struct hda_fixup *fix,
6153 				    int action)
6154 {
6155 	struct alc_spec *spec = codec->spec;
6156 
6157 	if (action == HDA_FIXUP_ACT_PROBE) {
6158 		int mic_pin = find_ext_mic_pin(codec);
6159 		int hp_pin = alc_get_hp_pin(spec);
6160 
6161 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6162 			return;
6163 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6164 	}
6165 }
6166 
6167 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6168 					     const struct hda_fixup *fix,
6169 					     int action)
6170 {
6171 	struct alc_spec *spec = codec->spec;
6172 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6173 	int i;
6174 
6175 	/* The mic boosts on level 2 and 3 are too noisy
6176 	   on the internal mic input.
6177 	   Therefore limit the boost to 0 or 1. */
6178 
6179 	if (action != HDA_FIXUP_ACT_PROBE)
6180 		return;
6181 
6182 	for (i = 0; i < cfg->num_inputs; i++) {
6183 		hda_nid_t nid = cfg->inputs[i].pin;
6184 		unsigned int defcfg;
6185 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6186 			continue;
6187 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6188 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6189 			continue;
6190 
6191 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6192 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6193 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6194 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6195 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6196 	}
6197 }
6198 
6199 static void alc283_hp_automute_hook(struct hda_codec *codec,
6200 				    struct hda_jack_callback *jack)
6201 {
6202 	struct alc_spec *spec = codec->spec;
6203 	int vref;
6204 
6205 	msleep(200);
6206 	snd_hda_gen_hp_automute(codec, jack);
6207 
6208 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6209 
6210 	msleep(600);
6211 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6212 			    vref);
6213 }
6214 
6215 static void alc283_fixup_chromebook(struct hda_codec *codec,
6216 				    const struct hda_fixup *fix, int action)
6217 {
6218 	struct alc_spec *spec = codec->spec;
6219 
6220 	switch (action) {
6221 	case HDA_FIXUP_ACT_PRE_PROBE:
6222 		snd_hda_override_wcaps(codec, 0x03, 0);
6223 		/* Disable AA-loopback as it causes white noise */
6224 		spec->gen.mixer_nid = 0;
6225 		break;
6226 	case HDA_FIXUP_ACT_INIT:
6227 		/* MIC2-VREF control */
6228 		/* Set to manual mode */
6229 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6230 		/* Enable Line1 input control by verb */
6231 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6232 		break;
6233 	}
6234 }
6235 
6236 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6237 				    const struct hda_fixup *fix, int action)
6238 {
6239 	struct alc_spec *spec = codec->spec;
6240 
6241 	switch (action) {
6242 	case HDA_FIXUP_ACT_PRE_PROBE:
6243 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6244 		break;
6245 	case HDA_FIXUP_ACT_INIT:
6246 		/* MIC2-VREF control */
6247 		/* Set to manual mode */
6248 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6249 		break;
6250 	}
6251 }
6252 
6253 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6254 static void asus_tx300_automute(struct hda_codec *codec)
6255 {
6256 	struct alc_spec *spec = codec->spec;
6257 	snd_hda_gen_update_outputs(codec);
6258 	if (snd_hda_jack_detect(codec, 0x1b))
6259 		spec->gen.mute_bits |= (1ULL << 0x14);
6260 }
6261 
6262 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6263 				    const struct hda_fixup *fix, int action)
6264 {
6265 	struct alc_spec *spec = codec->spec;
6266 	static const struct hda_pintbl dock_pins[] = {
6267 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6268 		{}
6269 	};
6270 
6271 	switch (action) {
6272 	case HDA_FIXUP_ACT_PRE_PROBE:
6273 		spec->init_amp = ALC_INIT_DEFAULT;
6274 		/* TX300 needs to set up GPIO2 for the speaker amp */
6275 		alc_setup_gpio(codec, 0x04);
6276 		snd_hda_apply_pincfgs(codec, dock_pins);
6277 		spec->gen.auto_mute_via_amp = 1;
6278 		spec->gen.automute_hook = asus_tx300_automute;
6279 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6280 						    snd_hda_gen_hp_automute);
6281 		break;
6282 	case HDA_FIXUP_ACT_PROBE:
6283 		spec->init_amp = ALC_INIT_DEFAULT;
6284 		break;
6285 	case HDA_FIXUP_ACT_BUILD:
6286 		/* this is a bit tricky; give more sane names for the main
6287 		 * (tablet) speaker and the dock speaker, respectively
6288 		 */
6289 		rename_ctl(codec, "Speaker Playback Switch",
6290 			   "Dock Speaker Playback Switch");
6291 		rename_ctl(codec, "Bass Speaker Playback Switch",
6292 			   "Speaker Playback Switch");
6293 		break;
6294 	}
6295 }
6296 
6297 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6298 				       const struct hda_fixup *fix, int action)
6299 {
6300 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6301 		/* DAC node 0x03 is giving mono output. We therefore want to
6302 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6303 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6304 		static const hda_nid_t conn1[] = { 0x0c };
6305 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6306 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6307 	}
6308 }
6309 
6310 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6311 					const struct hda_fixup *fix, int action)
6312 {
6313 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6314 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6315 		   we can't adjust the speaker's volume since this node does not has
6316 		   Amp-out capability. we change the speaker's route to:
6317 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6318 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6319 		   speaker's volume now. */
6320 
6321 		static const hda_nid_t conn1[] = { 0x0c };
6322 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6323 	}
6324 }
6325 
6326 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6327 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6328 				      const struct hda_fixup *fix, int action)
6329 {
6330 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6331 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6332 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6333 	}
6334 }
6335 
6336 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6337 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6338 					  const struct hda_fixup *fix, int action)
6339 {
6340 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6341 		static const hda_nid_t conn[] = { 0x02 };
6342 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6343 	}
6344 }
6345 
6346 /* Hook to update amp GPIO4 for automute */
6347 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6348 					  struct hda_jack_callback *jack)
6349 {
6350 	struct alc_spec *spec = codec->spec;
6351 
6352 	snd_hda_gen_hp_automute(codec, jack);
6353 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6354 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6355 			    !spec->gen.hp_jack_present);
6356 }
6357 
6358 /* Manage GPIOs for HP EliteBook Folio 9480m.
6359  *
6360  * GPIO4 is the headphone amplifier power control
6361  * GPIO3 is the audio output mute indicator LED
6362  */
6363 
6364 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6365 				  const struct hda_fixup *fix,
6366 				  int action)
6367 {
6368 	struct alc_spec *spec = codec->spec;
6369 
6370 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6371 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6372 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6373 		spec->gpio_mask |= 0x10;
6374 		spec->gpio_dir |= 0x10;
6375 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6376 	}
6377 }
6378 
6379 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6380 				   const struct hda_fixup *fix,
6381 				   int action)
6382 {
6383 	struct alc_spec *spec = codec->spec;
6384 
6385 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6386 		spec->gpio_mask |= 0x04;
6387 		spec->gpio_dir |= 0x04;
6388 		/* set data bit low */
6389 	}
6390 }
6391 
6392 /* Quirk for Thinkpad X1 7th and 8th Gen
6393  * The following fixed routing needed
6394  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6395  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6396  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6397  */
6398 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6399 					  const struct hda_fixup *fix, int action)
6400 {
6401 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6402 	static const hda_nid_t preferred_pairs[] = {
6403 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6404 	};
6405 	struct alc_spec *spec = codec->spec;
6406 
6407 	switch (action) {
6408 	case HDA_FIXUP_ACT_PRE_PROBE:
6409 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6410 		spec->gen.preferred_dacs = preferred_pairs;
6411 		break;
6412 	case HDA_FIXUP_ACT_BUILD:
6413 		/* The generic parser creates somewhat unintuitive volume ctls
6414 		 * with the fixed routing above, and the shared DAC2 may be
6415 		 * confusing for PA.
6416 		 * Rename those to unique names so that PA doesn't touch them
6417 		 * and use only Master volume.
6418 		 */
6419 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6420 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6421 		break;
6422 	}
6423 }
6424 
6425 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6426 					 const struct hda_fixup *fix,
6427 					 int action)
6428 {
6429 	alc_fixup_dual_codecs(codec, fix, action);
6430 	switch (action) {
6431 	case HDA_FIXUP_ACT_PRE_PROBE:
6432 		/* override card longname to provide a unique UCM profile */
6433 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6434 		break;
6435 	case HDA_FIXUP_ACT_BUILD:
6436 		/* rename Capture controls depending on the codec */
6437 		rename_ctl(codec, "Capture Volume",
6438 			   codec->addr == 0 ?
6439 			   "Rear-Panel Capture Volume" :
6440 			   "Front-Panel Capture Volume");
6441 		rename_ctl(codec, "Capture Switch",
6442 			   codec->addr == 0 ?
6443 			   "Rear-Panel Capture Switch" :
6444 			   "Front-Panel Capture Switch");
6445 		break;
6446 	}
6447 }
6448 
6449 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6450 				      const struct hda_fixup *fix, int action)
6451 {
6452 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6453 		return;
6454 
6455 	codec->power_save_node = 1;
6456 }
6457 
6458 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6459 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6460 				    const struct hda_fixup *fix, int action)
6461 {
6462 	struct alc_spec *spec = codec->spec;
6463 	static const hda_nid_t preferred_pairs[] = {
6464 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6465 		0
6466 	};
6467 
6468 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6469 		return;
6470 
6471 	spec->gen.preferred_dacs = preferred_pairs;
6472 	spec->gen.auto_mute_via_amp = 1;
6473 	codec->power_save_node = 0;
6474 }
6475 
6476 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6477 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6478 				    const struct hda_fixup *fix, int action)
6479 {
6480 	static const hda_nid_t preferred_pairs[] = {
6481 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6482 	};
6483 	struct alc_spec *spec = codec->spec;
6484 
6485 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6486 		spec->gen.preferred_dacs = preferred_pairs;
6487 		spec->gen.obey_preferred_dacs = 1;
6488 	}
6489 }
6490 
6491 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6492 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6493 			      const struct hda_fixup *fix, int action)
6494 {
6495 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6496 		return;
6497 
6498 	snd_hda_override_wcaps(codec, 0x03, 0);
6499 }
6500 
6501 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6502 {
6503 	switch (codec->core.vendor_id) {
6504 	case 0x10ec0274:
6505 	case 0x10ec0294:
6506 	case 0x10ec0225:
6507 	case 0x10ec0295:
6508 	case 0x10ec0299:
6509 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6510 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6511 		break;
6512 	case 0x10ec0230:
6513 	case 0x10ec0235:
6514 	case 0x10ec0236:
6515 	case 0x10ec0255:
6516 	case 0x10ec0256:
6517 	case 0x10ec0257:
6518 	case 0x19e58326:
6519 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6520 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6521 		break;
6522 	}
6523 }
6524 
6525 static void alc295_fixup_chromebook(struct hda_codec *codec,
6526 				    const struct hda_fixup *fix, int action)
6527 {
6528 	struct alc_spec *spec = codec->spec;
6529 
6530 	switch (action) {
6531 	case HDA_FIXUP_ACT_PRE_PROBE:
6532 		spec->ultra_low_power = true;
6533 		break;
6534 	case HDA_FIXUP_ACT_INIT:
6535 		alc_combo_jack_hp_jd_restart(codec);
6536 		break;
6537 	}
6538 }
6539 
6540 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6541 				  const struct hda_fixup *fix, int action)
6542 {
6543 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6544 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6545 }
6546 
6547 
6548 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6549 					struct hda_jack_callback *cb)
6550 {
6551 	/* The Windows driver sets the codec up in a very different way where
6552 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6553 	 */
6554 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6555 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6556 	else
6557 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6558 }
6559 
6560 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6561 					const struct hda_fixup *fix, int action)
6562 {
6563 	/* Pin 0x21: headphones/headset mic */
6564 	if (!is_jack_detectable(codec, 0x21))
6565 		return;
6566 
6567 	switch (action) {
6568 	case HDA_FIXUP_ACT_PRE_PROBE:
6569 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6570 				alc294_gx502_toggle_output);
6571 		break;
6572 	case HDA_FIXUP_ACT_INIT:
6573 		/* Make sure to start in a correct state, i.e. if
6574 		 * headphones have been plugged in before powering up the system
6575 		 */
6576 		alc294_gx502_toggle_output(codec, NULL);
6577 		break;
6578 	}
6579 }
6580 
6581 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6582 				       struct hda_jack_callback *cb)
6583 {
6584 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6585 	 * responsible from changes between speakers and headphones
6586 	 */
6587 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6588 		alc_write_coef_idx(codec, 0x10, 0x8420);
6589 	else
6590 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6591 }
6592 
6593 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6594 				  const struct hda_fixup *fix, int action)
6595 {
6596 	if (!is_jack_detectable(codec, 0x21))
6597 		return;
6598 
6599 	switch (action) {
6600 	case HDA_FIXUP_ACT_PRE_PROBE:
6601 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6602 				alc294_gu502_toggle_output);
6603 		break;
6604 	case HDA_FIXUP_ACT_INIT:
6605 		alc294_gu502_toggle_output(codec, NULL);
6606 		break;
6607 	}
6608 }
6609 
6610 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6611 			      const struct hda_fixup *fix, int action)
6612 {
6613 	if (action != HDA_FIXUP_ACT_INIT)
6614 		return;
6615 
6616 	msleep(100);
6617 	alc_write_coef_idx(codec, 0x65, 0x0);
6618 }
6619 
6620 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6621 				    const struct hda_fixup *fix, int action)
6622 {
6623 	switch (action) {
6624 	case HDA_FIXUP_ACT_INIT:
6625 		alc_combo_jack_hp_jd_restart(codec);
6626 		break;
6627 	}
6628 }
6629 
6630 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6631 				    const struct hda_fixup *fix, int action)
6632 {
6633 	struct alc_spec *spec = codec->spec;
6634 
6635 	switch (action) {
6636 	case HDA_FIXUP_ACT_PRE_PROBE:
6637 		/* Mic RING SLEEVE swap for combo jack */
6638 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6639 		spec->no_internal_mic_pin = true;
6640 		break;
6641 	case HDA_FIXUP_ACT_INIT:
6642 		alc_combo_jack_hp_jd_restart(codec);
6643 		break;
6644 	}
6645 }
6646 
6647 /* GPIO1 = amplifier on/off
6648  * GPIO3 = mic mute LED
6649  */
6650 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6651 					  const struct hda_fixup *fix, int action)
6652 {
6653 	static const hda_nid_t conn[] = { 0x02 };
6654 
6655 	struct alc_spec *spec = codec->spec;
6656 	static const struct hda_pintbl pincfgs[] = {
6657 		{ 0x14, 0x90170110 },  /* front/high speakers */
6658 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6659 		{ }
6660 	};
6661 
6662 	//enable micmute led
6663 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6664 
6665 	switch (action) {
6666 	case HDA_FIXUP_ACT_PRE_PROBE:
6667 		spec->micmute_led_polarity = 1;
6668 		/* needed for amp of back speakers */
6669 		spec->gpio_mask |= 0x01;
6670 		spec->gpio_dir |= 0x01;
6671 		snd_hda_apply_pincfgs(codec, pincfgs);
6672 		/* share DAC to have unified volume control */
6673 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6674 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6675 		break;
6676 	case HDA_FIXUP_ACT_INIT:
6677 		/* need to toggle GPIO to enable the amp of back speakers */
6678 		alc_update_gpio_data(codec, 0x01, true);
6679 		msleep(100);
6680 		alc_update_gpio_data(codec, 0x01, false);
6681 		break;
6682 	}
6683 }
6684 
6685 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6686 					  const struct hda_fixup *fix, int action)
6687 {
6688 	static const hda_nid_t conn[] = { 0x02 };
6689 	static const struct hda_pintbl pincfgs[] = {
6690 		{ 0x14, 0x90170110 },  /* rear speaker */
6691 		{ }
6692 	};
6693 
6694 	switch (action) {
6695 	case HDA_FIXUP_ACT_PRE_PROBE:
6696 		snd_hda_apply_pincfgs(codec, pincfgs);
6697 		/* force front speaker to DAC1 */
6698 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6699 		break;
6700 	}
6701 }
6702 
6703 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6704 				      const struct hda_fixup *fix,
6705 				      int action)
6706 {
6707 	static const struct coef_fw coefs[] = {
6708 		WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6709 		WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6710 		WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6711 		WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6712 		WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6713 		WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6714 		WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6715 		WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6716 		WRITE_COEF(0x6e, 0x1005), { }
6717 	};
6718 
6719 	static const struct hda_pintbl pincfgs[] = {
6720 		{ 0x12, 0xb7a60130 },  /* Internal microphone*/
6721 		{ 0x14, 0x90170150 },  /* B&O soundbar speakers */
6722 		{ 0x17, 0x90170153 },  /* Side speakers */
6723 		{ 0x19, 0x03a11040 },  /* Headset microphone */
6724 		{ }
6725 	};
6726 
6727 	switch (action) {
6728 	case HDA_FIXUP_ACT_PRE_PROBE:
6729 		snd_hda_apply_pincfgs(codec, pincfgs);
6730 
6731 		/* Fixes volume control problem for side speakers */
6732 		alc295_fixup_disable_dac3(codec, fix, action);
6733 
6734 		/* Fixes no sound from headset speaker */
6735 		snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6736 
6737 		/* Auto-enable headset mic when plugged */
6738 		snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6739 
6740 		/* Headset mic volume enhancement */
6741 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6742 		break;
6743 	case HDA_FIXUP_ACT_INIT:
6744 		alc_process_coef_fw(codec, coefs);
6745 		break;
6746 	case HDA_FIXUP_ACT_BUILD:
6747 		rename_ctl(codec, "Bass Speaker Playback Volume",
6748 			   "B&O-Tuned Playback Volume");
6749 		rename_ctl(codec, "Front Playback Switch",
6750 			   "B&O Soundbar Playback Switch");
6751 		rename_ctl(codec, "Bass Speaker Playback Switch",
6752 			   "Side Speaker Playback Switch");
6753 		break;
6754 	}
6755 }
6756 
6757 /* for hda_fixup_thinkpad_acpi() */
6758 #include "thinkpad_helper.c"
6759 
6760 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6761 				    const struct hda_fixup *fix, int action)
6762 {
6763 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6764 	hda_fixup_thinkpad_acpi(codec, fix, action);
6765 }
6766 
6767 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6768 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6769 						  const struct hda_fixup *fix,
6770 						  int action)
6771 {
6772 	struct alc_spec *spec = codec->spec;
6773 
6774 	switch (action) {
6775 	case HDA_FIXUP_ACT_PRE_PROBE:
6776 		spec->gen.suppress_auto_mute = 1;
6777 		break;
6778 	}
6779 }
6780 
6781 static int comp_bind(struct device *dev)
6782 {
6783 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6784 	struct alc_spec *spec = cdc->spec;
6785 
6786 	return component_bind_all(dev, spec->comps);
6787 }
6788 
6789 static void comp_unbind(struct device *dev)
6790 {
6791 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6792 	struct alc_spec *spec = cdc->spec;
6793 
6794 	component_unbind_all(dev, spec->comps);
6795 }
6796 
6797 static const struct component_master_ops comp_master_ops = {
6798 	.bind = comp_bind,
6799 	.unbind = comp_unbind,
6800 };
6801 
6802 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6803 				       struct snd_pcm_substream *sub, int action)
6804 {
6805 	struct alc_spec *spec = cdc->spec;
6806 	int i;
6807 
6808 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6809 		if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
6810 			spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
6811 	}
6812 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6813 		if (spec->comps[i].dev && spec->comps[i].playback_hook)
6814 			spec->comps[i].playback_hook(spec->comps[i].dev, action);
6815 	}
6816 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6817 		if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
6818 			spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
6819 	}
6820 }
6821 
6822 struct scodec_dev_name {
6823 	const char *bus;
6824 	const char *hid;
6825 	int index;
6826 };
6827 
6828 /* match the device name in a slightly relaxed manner */
6829 static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6830 {
6831 	struct scodec_dev_name *p = data;
6832 	const char *d = dev_name(dev);
6833 	int n = strlen(p->bus);
6834 	char tmp[32];
6835 
6836 	/* check the bus name */
6837 	if (strncmp(d, p->bus, n))
6838 		return 0;
6839 	/* skip the bus number */
6840 	if (isdigit(d[n]))
6841 		n++;
6842 	/* the rest must be exact matching */
6843 	snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6844 	return !strcmp(d + n, tmp);
6845 }
6846 
6847 static int comp_match_tas2781_dev_name(struct device *dev,
6848 	void *data)
6849 {
6850 	struct scodec_dev_name *p = data;
6851 	const char *d = dev_name(dev);
6852 	int n = strlen(p->bus);
6853 	char tmp[32];
6854 
6855 	/* check the bus name */
6856 	if (strncmp(d, p->bus, n))
6857 		return 0;
6858 	/* skip the bus number */
6859 	if (isdigit(d[n]))
6860 		n++;
6861 	/* the rest must be exact matching */
6862 	snprintf(tmp, sizeof(tmp), "-%s:00", p->hid);
6863 
6864 	return !strcmp(d + n, tmp);
6865 }
6866 
6867 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6868 				  const char *hid, int count)
6869 {
6870 	struct device *dev = hda_codec_dev(cdc);
6871 	struct alc_spec *spec = cdc->spec;
6872 	struct scodec_dev_name *rec;
6873 	int ret, i;
6874 
6875 	switch (action) {
6876 	case HDA_FIXUP_ACT_PRE_PROBE:
6877 		for (i = 0; i < count; i++) {
6878 			rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6879 			if (!rec)
6880 				return;
6881 			rec->bus = bus;
6882 			rec->hid = hid;
6883 			rec->index = i;
6884 			spec->comps[i].codec = cdc;
6885 			component_match_add(dev, &spec->match,
6886 					    comp_match_cs35l41_dev_name, rec);
6887 		}
6888 		ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6889 		if (ret)
6890 			codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6891 		else
6892 			spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6893 		break;
6894 	case HDA_FIXUP_ACT_FREE:
6895 		component_master_del(dev, &comp_master_ops);
6896 		break;
6897 	}
6898 }
6899 
6900 static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
6901 	const char *bus, const char *hid)
6902 {
6903 	struct device *dev = hda_codec_dev(cdc);
6904 	struct alc_spec *spec = cdc->spec;
6905 	struct scodec_dev_name *rec;
6906 	int ret;
6907 
6908 	switch (action) {
6909 	case HDA_FIXUP_ACT_PRE_PROBE:
6910 		rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6911 		if (!rec)
6912 			return;
6913 		rec->bus = bus;
6914 		rec->hid = hid;
6915 		rec->index = 0;
6916 		spec->comps[0].codec = cdc;
6917 		component_match_add(dev, &spec->match,
6918 			comp_match_tas2781_dev_name, rec);
6919 		ret = component_master_add_with_match(dev, &comp_master_ops,
6920 			spec->match);
6921 		if (ret)
6922 			codec_err(cdc,
6923 				"Fail to register component aggregator %d\n",
6924 				ret);
6925 		else
6926 			spec->gen.pcm_playback_hook =
6927 				comp_generic_playback_hook;
6928 		break;
6929 	case HDA_FIXUP_ACT_FREE:
6930 		component_master_del(dev, &comp_master_ops);
6931 		break;
6932 	}
6933 }
6934 
6935 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6936 {
6937 	cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6938 }
6939 
6940 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6941 {
6942 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
6943 }
6944 
6945 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6946 {
6947 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
6948 }
6949 
6950 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6951 						 int action)
6952 {
6953 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
6954 }
6955 
6956 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6957 						 int action)
6958 {
6959 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6960 }
6961 
6962 static void tas2781_fixup_i2c(struct hda_codec *cdc,
6963 	const struct hda_fixup *fix, int action)
6964 {
6965 	 tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
6966 }
6967 
6968 /* for alc295_fixup_hp_top_speakers */
6969 #include "hp_x360_helper.c"
6970 
6971 /* for alc285_fixup_ideapad_s740_coef() */
6972 #include "ideapad_s740_helper.c"
6973 
6974 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6975 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6976 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6977 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6978 	{}
6979 };
6980 
6981 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6982 					   const struct hda_fixup *fix,
6983 					   int action)
6984 {
6985 	/*
6986 	 * A certain other OS sets these coeffs to different values. On at least
6987 	 * one TongFang barebone these settings might survive even a cold
6988 	 * reboot. So to restore a clean slate the values are explicitly reset
6989 	 * to default here. Without this, the external microphone is always in a
6990 	 * plugged-in state, while the internal microphone is always in an
6991 	 * unplugged state, breaking the ability to use the internal microphone.
6992 	 */
6993 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6994 }
6995 
6996 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6997 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6998 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6999 	WRITE_COEF(0x49, 0x0149),
7000 	{}
7001 };
7002 
7003 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7004 				       const struct hda_fixup *fix,
7005 				       int action)
7006 {
7007 	/*
7008 	 * The audio jack input and output is not detected on the ASRock NUC Box
7009 	 * 1100 series when cold booting without this fix. Warm rebooting from a
7010 	 * certain other OS makes the audio functional, as COEF settings are
7011 	 * preserved in this case. This fix sets these altered COEF values as
7012 	 * the default.
7013 	 */
7014 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7015 }
7016 
7017 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7018 						    const struct hda_fixup *fix,
7019 						    int action)
7020 {
7021 	/*
7022 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7023 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7024 	 * needs an additional quirk for sound working after suspend and resume.
7025 	 */
7026 	if (codec->core.vendor_id == 0x10ec0256) {
7027 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7028 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7029 	} else {
7030 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7031 	}
7032 }
7033 
7034 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7035 						  const struct hda_fixup *fix,
7036 						  int action)
7037 {
7038 	struct alc_spec *spec = codec->spec;
7039 	struct hda_input_mux *imux = &spec->gen.input_mux;
7040 	int i;
7041 
7042 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
7043 
7044 	switch (action) {
7045 	case HDA_FIXUP_ACT_PRE_PROBE:
7046 		/**
7047 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7048 		 * to Hi-Z to avoid pop noises at startup and when plugging and
7049 		 * unplugging headphones.
7050 		 */
7051 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7052 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7053 		break;
7054 	case HDA_FIXUP_ACT_PROBE:
7055 		/**
7056 		 * Make the internal mic (0x12) the default input source to
7057 		 * prevent pop noises on cold boot.
7058 		 */
7059 		for (i = 0; i < imux->num_items; i++) {
7060 			if (spec->gen.imux_pins[i] == 0x12) {
7061 				spec->gen.cur_mux[0] = i;
7062 				break;
7063 			}
7064 		}
7065 		break;
7066 	}
7067 }
7068 
7069 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7070 					  const struct hda_fixup *fix, int action)
7071 {
7072 	/*
7073 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7074 	 * unconnected.
7075 	 */
7076 	static const struct hda_pintbl pincfgs[] = {
7077 		{ 0x17, 0x90170121 },
7078 		{ }
7079 	};
7080 	/*
7081 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7082 	 * DAC 0x02 and 0x03 would be fine.
7083 	 */
7084 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7085 	/*
7086 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7087 	 * Headphones (0x21) are connected to DAC 0x03.
7088 	 */
7089 	static const hda_nid_t preferred_pairs[] = {
7090 		0x14, 0x02,
7091 		0x17, 0x02,
7092 		0x21, 0x03,
7093 		0
7094 	};
7095 	struct alc_spec *spec = codec->spec;
7096 
7097 	switch (action) {
7098 	case HDA_FIXUP_ACT_PRE_PROBE:
7099 		snd_hda_apply_pincfgs(codec, pincfgs);
7100 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7101 		spec->gen.preferred_dacs = preferred_pairs;
7102 		break;
7103 	}
7104 }
7105 
7106 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7107 					  const struct hda_fixup *fix, int action)
7108 {
7109 	static const struct hda_pintbl pincfgs[] = {
7110 		{ 0x14, 0x90170151 },
7111 		{ 0x17, 0x90170150 },
7112 		{ }
7113 	};
7114 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7115 	static const hda_nid_t preferred_pairs[] = {
7116 		0x14, 0x02,
7117 		0x17, 0x03,
7118 		0x21, 0x02,
7119 		0
7120 	};
7121 	struct alc_spec *spec = codec->spec;
7122 
7123 	alc_fixup_no_shutup(codec, fix, action);
7124 
7125 	switch (action) {
7126 	case HDA_FIXUP_ACT_PRE_PROBE:
7127 		snd_hda_apply_pincfgs(codec, pincfgs);
7128 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7129 		spec->gen.preferred_dacs = preferred_pairs;
7130 		break;
7131 	}
7132 }
7133 
7134 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7135 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7136 				    const struct hda_fixup *fix, int action)
7137 {
7138 	struct alc_spec *spec = codec->spec;
7139 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7140 	static const hda_nid_t preferred_pairs[] = {
7141 		0x17, 0x02, 0x21, 0x03, 0
7142 	};
7143 
7144 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7145 		return;
7146 
7147 	snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7148 	spec->gen.preferred_dacs = preferred_pairs;
7149 	spec->gen.auto_mute_via_amp = 1;
7150 	if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7151 		snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7152 					0x0); /* Make sure 0x14 was disable */
7153 	}
7154 }
7155 /* Fix none verb table of Headset Mic pin */
7156 static void alc_fixup_headset_mic(struct hda_codec *codec,
7157 				   const struct hda_fixup *fix, int action)
7158 {
7159 	struct alc_spec *spec = codec->spec;
7160 	static const struct hda_pintbl pincfgs[] = {
7161 		{ 0x19, 0x03a1103c },
7162 		{ }
7163 	};
7164 
7165 	switch (action) {
7166 	case HDA_FIXUP_ACT_PRE_PROBE:
7167 		snd_hda_apply_pincfgs(codec, pincfgs);
7168 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7169 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7170 		break;
7171 	}
7172 }
7173 
7174 
7175 enum {
7176 	ALC269_FIXUP_GPIO2,
7177 	ALC269_FIXUP_SONY_VAIO,
7178 	ALC275_FIXUP_SONY_VAIO_GPIO2,
7179 	ALC269_FIXUP_DELL_M101Z,
7180 	ALC269_FIXUP_SKU_IGNORE,
7181 	ALC269_FIXUP_ASUS_G73JW,
7182 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
7183 	ALC269_FIXUP_ASUS_N7601ZM,
7184 	ALC269_FIXUP_LENOVO_EAPD,
7185 	ALC275_FIXUP_SONY_HWEQ,
7186 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
7187 	ALC271_FIXUP_DMIC,
7188 	ALC269_FIXUP_PCM_44K,
7189 	ALC269_FIXUP_STEREO_DMIC,
7190 	ALC269_FIXUP_HEADSET_MIC,
7191 	ALC269_FIXUP_QUANTA_MUTE,
7192 	ALC269_FIXUP_LIFEBOOK,
7193 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
7194 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
7195 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7196 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7197 	ALC269_FIXUP_AMIC,
7198 	ALC269_FIXUP_DMIC,
7199 	ALC269VB_FIXUP_AMIC,
7200 	ALC269VB_FIXUP_DMIC,
7201 	ALC269_FIXUP_HP_MUTE_LED,
7202 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
7203 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
7204 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
7205 	ALC269_FIXUP_HP_GPIO_LED,
7206 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
7207 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
7208 	ALC269_FIXUP_INV_DMIC,
7209 	ALC269_FIXUP_LENOVO_DOCK,
7210 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7211 	ALC269_FIXUP_NO_SHUTUP,
7212 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7213 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7214 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7215 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7216 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7217 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7218 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7219 	ALC269_FIXUP_HEADSET_MODE,
7220 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7221 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7222 	ALC269_FIXUP_ASUS_X101_FUNC,
7223 	ALC269_FIXUP_ASUS_X101_VERB,
7224 	ALC269_FIXUP_ASUS_X101,
7225 	ALC271_FIXUP_AMIC_MIC2,
7226 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7227 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7228 	ALC269_FIXUP_ACER_AC700,
7229 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7230 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7231 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7232 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7233 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7234 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7235 	ALC283_FIXUP_CHROME_BOOK,
7236 	ALC283_FIXUP_SENSE_COMBO_JACK,
7237 	ALC282_FIXUP_ASUS_TX300,
7238 	ALC283_FIXUP_INT_MIC,
7239 	ALC290_FIXUP_MONO_SPEAKERS,
7240 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7241 	ALC290_FIXUP_SUBWOOFER,
7242 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7243 	ALC269_FIXUP_THINKPAD_ACPI,
7244 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7245 	ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7246 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7247 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7248 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7249 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7250 	ALC255_FIXUP_HEADSET_MODE,
7251 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7252 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7253 	ALC292_FIXUP_TPT440_DOCK,
7254 	ALC292_FIXUP_TPT440,
7255 	ALC283_FIXUP_HEADSET_MIC,
7256 	ALC255_FIXUP_MIC_MUTE_LED,
7257 	ALC282_FIXUP_ASPIRE_V5_PINS,
7258 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7259 	ALC280_FIXUP_HP_GPIO4,
7260 	ALC286_FIXUP_HP_GPIO_LED,
7261 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7262 	ALC280_FIXUP_HP_DOCK_PINS,
7263 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7264 	ALC280_FIXUP_HP_9480M,
7265 	ALC245_FIXUP_HP_X360_AMP,
7266 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7267 	ALC285_FIXUP_HP_ENVY_X360,
7268 	ALC288_FIXUP_DELL_HEADSET_MODE,
7269 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7270 	ALC288_FIXUP_DELL_XPS_13,
7271 	ALC288_FIXUP_DISABLE_AAMIX,
7272 	ALC292_FIXUP_DELL_E7X_AAMIX,
7273 	ALC292_FIXUP_DELL_E7X,
7274 	ALC292_FIXUP_DISABLE_AAMIX,
7275 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7276 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7277 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7278 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7279 	ALC275_FIXUP_DELL_XPS,
7280 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7281 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7282 	ALC255_FIXUP_DELL_SPK_NOISE,
7283 	ALC225_FIXUP_DISABLE_MIC_VREF,
7284 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7285 	ALC295_FIXUP_DISABLE_DAC3,
7286 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7287 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7288 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7289 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7290 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7291 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7292 	ALC280_FIXUP_HP_HEADSET_MIC,
7293 	ALC221_FIXUP_HP_FRONT_MIC,
7294 	ALC292_FIXUP_TPT460,
7295 	ALC298_FIXUP_SPK_VOLUME,
7296 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7297 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7298 	ALC269_FIXUP_ATIV_BOOK_8,
7299 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7300 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7301 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7302 	ALC256_FIXUP_ASUS_MIC,
7303 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7304 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7305 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7306 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7307 	ALC233_FIXUP_ACER_HEADSET_MIC,
7308 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7309 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7310 	ALC225_FIXUP_S3_POP_NOISE,
7311 	ALC700_FIXUP_INTEL_REFERENCE,
7312 	ALC274_FIXUP_DELL_BIND_DACS,
7313 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7314 	ALC298_FIXUP_TPT470_DOCK_FIX,
7315 	ALC298_FIXUP_TPT470_DOCK,
7316 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7317 	ALC255_FIXUP_DELL_HEADSET_MIC,
7318 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7319 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7320 	ALC295_FIXUP_HP_X360,
7321 	ALC221_FIXUP_HP_HEADSET_MIC,
7322 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7323 	ALC295_FIXUP_HP_AUTO_MUTE,
7324 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7325 	ALC294_FIXUP_ASUS_MIC,
7326 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7327 	ALC294_FIXUP_ASUS_SPK,
7328 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7329 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7330 	ALC255_FIXUP_ACER_HEADSET_MIC,
7331 	ALC295_FIXUP_CHROME_BOOK,
7332 	ALC225_FIXUP_HEADSET_JACK,
7333 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7334 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7335 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7336 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7337 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7338 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7339 	ALC299_FIXUP_PREDATOR_SPK,
7340 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7341 	ALC289_FIXUP_DELL_SPK1,
7342 	ALC289_FIXUP_DELL_SPK2,
7343 	ALC289_FIXUP_DUAL_SPK,
7344 	ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7345 	ALC294_FIXUP_SPK2_TO_DAC1,
7346 	ALC294_FIXUP_ASUS_DUAL_SPK,
7347 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7348 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7349 	ALC294_FIXUP_ASUS_ALLY,
7350 	ALC294_FIXUP_ASUS_ALLY_PINS,
7351 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7352 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7353 	ALC294_FIXUP_ASUS_HPE,
7354 	ALC294_FIXUP_ASUS_COEF_1B,
7355 	ALC294_FIXUP_ASUS_GX502_HP,
7356 	ALC294_FIXUP_ASUS_GX502_PINS,
7357 	ALC294_FIXUP_ASUS_GX502_VERBS,
7358 	ALC294_FIXUP_ASUS_GU502_HP,
7359 	ALC294_FIXUP_ASUS_GU502_PINS,
7360 	ALC294_FIXUP_ASUS_GU502_VERBS,
7361 	ALC294_FIXUP_ASUS_G513_PINS,
7362 	ALC285_FIXUP_ASUS_G533Z_PINS,
7363 	ALC285_FIXUP_HP_GPIO_LED,
7364 	ALC285_FIXUP_HP_MUTE_LED,
7365 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7366 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7367 	ALC236_FIXUP_HP_GPIO_LED,
7368 	ALC236_FIXUP_HP_MUTE_LED,
7369 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
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 	[ALC298_FIXUP_SAMSUNG_AMP] = {
8927 		.type = HDA_FIXUP_FUNC,
8928 		.v.func = alc298_fixup_samsung_amp,
8929 		.chained = true,
8930 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8931 	},
8932 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8933 		.type = HDA_FIXUP_VERBS,
8934 		.v.verbs = (const struct hda_verb[]) {
8935 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8936 			{ }
8937 		},
8938 	},
8939 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8940 		.type = HDA_FIXUP_VERBS,
8941 		.v.verbs = (const struct hda_verb[]) {
8942 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8943 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8944 			{ }
8945 		},
8946 	},
8947 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8948 		.type = HDA_FIXUP_PINS,
8949 		.v.pins = (const struct hda_pintbl[]) {
8950 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8951 			{ }
8952 		},
8953 		.chained = true,
8954 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8955 	},
8956 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8957 		.type = HDA_FIXUP_PINS,
8958 		.v.pins = (const struct hda_pintbl[]) {
8959 			{ 0x14, 0x90100120 }, /* use as internal speaker */
8960 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8961 			{ 0x1a, 0x01011020 }, /* use as line out */
8962 			{ },
8963 		},
8964 		.chained = true,
8965 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8966 	},
8967 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8968 		.type = HDA_FIXUP_PINS,
8969 		.v.pins = (const struct hda_pintbl[]) {
8970 			{ 0x18, 0x02a11030 }, /* use as headset mic */
8971 			{ }
8972 		},
8973 		.chained = true,
8974 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8975 	},
8976 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8977 		.type = HDA_FIXUP_PINS,
8978 		.v.pins = (const struct hda_pintbl[]) {
8979 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8980 			{ }
8981 		},
8982 		.chained = true,
8983 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8984 	},
8985 	[ALC289_FIXUP_ASUS_GA401] = {
8986 		.type = HDA_FIXUP_FUNC,
8987 		.v.func = alc289_fixup_asus_ga401,
8988 		.chained = true,
8989 		.chain_id = ALC289_FIXUP_ASUS_GA502,
8990 	},
8991 	[ALC289_FIXUP_ASUS_GA502] = {
8992 		.type = HDA_FIXUP_PINS,
8993 		.v.pins = (const struct hda_pintbl[]) {
8994 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8995 			{ }
8996 		},
8997 	},
8998 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8999 		.type = HDA_FIXUP_PINS,
9000 		.v.pins = (const struct hda_pintbl[]) {
9001 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9002 			{ }
9003 		},
9004 		.chained = true,
9005 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9006 	},
9007 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9008 		.type = HDA_FIXUP_FUNC,
9009 		.v.func = alc285_fixup_hp_gpio_amp_init,
9010 		.chained = true,
9011 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
9012 	},
9013 	[ALC269_FIXUP_CZC_B20] = {
9014 		.type = HDA_FIXUP_PINS,
9015 		.v.pins = (const struct hda_pintbl[]) {
9016 			{ 0x12, 0x411111f0 },
9017 			{ 0x14, 0x90170110 }, /* speaker */
9018 			{ 0x15, 0x032f1020 }, /* HP out */
9019 			{ 0x17, 0x411111f0 },
9020 			{ 0x18, 0x03ab1040 }, /* mic */
9021 			{ 0x19, 0xb7a7013f },
9022 			{ 0x1a, 0x0181305f },
9023 			{ 0x1b, 0x411111f0 },
9024 			{ 0x1d, 0x411111f0 },
9025 			{ 0x1e, 0x411111f0 },
9026 			{ }
9027 		},
9028 		.chain_id = ALC269_FIXUP_DMIC,
9029 	},
9030 	[ALC269_FIXUP_CZC_TMI] = {
9031 		.type = HDA_FIXUP_PINS,
9032 		.v.pins = (const struct hda_pintbl[]) {
9033 			{ 0x12, 0x4000c000 },
9034 			{ 0x14, 0x90170110 }, /* speaker */
9035 			{ 0x15, 0x0421401f }, /* HP out */
9036 			{ 0x17, 0x411111f0 },
9037 			{ 0x18, 0x04a19020 }, /* mic */
9038 			{ 0x19, 0x411111f0 },
9039 			{ 0x1a, 0x411111f0 },
9040 			{ 0x1b, 0x411111f0 },
9041 			{ 0x1d, 0x40448505 },
9042 			{ 0x1e, 0x411111f0 },
9043 			{ 0x20, 0x8000ffff },
9044 			{ }
9045 		},
9046 		.chain_id = ALC269_FIXUP_DMIC,
9047 	},
9048 	[ALC269_FIXUP_CZC_L101] = {
9049 		.type = HDA_FIXUP_PINS,
9050 		.v.pins = (const struct hda_pintbl[]) {
9051 			{ 0x12, 0x40000000 },
9052 			{ 0x14, 0x01014010 }, /* speaker */
9053 			{ 0x15, 0x411111f0 }, /* HP out */
9054 			{ 0x16, 0x411111f0 },
9055 			{ 0x18, 0x01a19020 }, /* mic */
9056 			{ 0x19, 0x02a19021 },
9057 			{ 0x1a, 0x0181302f },
9058 			{ 0x1b, 0x0221401f },
9059 			{ 0x1c, 0x411111f0 },
9060 			{ 0x1d, 0x4044c601 },
9061 			{ 0x1e, 0x411111f0 },
9062 			{ }
9063 		},
9064 		.chain_id = ALC269_FIXUP_DMIC,
9065 	},
9066 	[ALC269_FIXUP_LEMOTE_A1802] = {
9067 		.type = HDA_FIXUP_PINS,
9068 		.v.pins = (const struct hda_pintbl[]) {
9069 			{ 0x12, 0x40000000 },
9070 			{ 0x14, 0x90170110 }, /* speaker */
9071 			{ 0x17, 0x411111f0 },
9072 			{ 0x18, 0x03a19040 }, /* mic1 */
9073 			{ 0x19, 0x90a70130 }, /* mic2 */
9074 			{ 0x1a, 0x411111f0 },
9075 			{ 0x1b, 0x411111f0 },
9076 			{ 0x1d, 0x40489d2d },
9077 			{ 0x1e, 0x411111f0 },
9078 			{ 0x20, 0x0003ffff },
9079 			{ 0x21, 0x03214020 },
9080 			{ }
9081 		},
9082 		.chain_id = ALC269_FIXUP_DMIC,
9083 	},
9084 	[ALC269_FIXUP_LEMOTE_A190X] = {
9085 		.type = HDA_FIXUP_PINS,
9086 		.v.pins = (const struct hda_pintbl[]) {
9087 			{ 0x14, 0x99130110 }, /* speaker */
9088 			{ 0x15, 0x0121401f }, /* HP out */
9089 			{ 0x18, 0x01a19c20 }, /* rear  mic */
9090 			{ 0x19, 0x99a3092f }, /* front mic */
9091 			{ 0x1b, 0x0201401f }, /* front lineout */
9092 			{ }
9093 		},
9094 		.chain_id = ALC269_FIXUP_DMIC,
9095 	},
9096 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9097 		.type = HDA_FIXUP_PINS,
9098 		.v.pins = (const struct hda_pintbl[]) {
9099 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9100 			{ }
9101 		},
9102 		.chained = true,
9103 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9104 	},
9105 	[ALC256_FIXUP_INTEL_NUC10] = {
9106 		.type = HDA_FIXUP_PINS,
9107 		.v.pins = (const struct hda_pintbl[]) {
9108 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9109 			{ }
9110 		},
9111 		.chained = true,
9112 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9113 	},
9114 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9115 		.type = HDA_FIXUP_VERBS,
9116 		.v.verbs = (const struct hda_verb[]) {
9117 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9118 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9119 			{ }
9120 		},
9121 		.chained = true,
9122 		.chain_id = ALC289_FIXUP_ASUS_GA502
9123 	},
9124 	[ALC274_FIXUP_HP_MIC] = {
9125 		.type = HDA_FIXUP_VERBS,
9126 		.v.verbs = (const struct hda_verb[]) {
9127 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9128 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9129 			{ }
9130 		},
9131 	},
9132 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
9133 		.type = HDA_FIXUP_FUNC,
9134 		.v.func = alc274_fixup_hp_headset_mic,
9135 		.chained = true,
9136 		.chain_id = ALC274_FIXUP_HP_MIC
9137 	},
9138 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
9139 		.type = HDA_FIXUP_FUNC,
9140 		.v.func = alc274_fixup_hp_envy_gpio,
9141 	},
9142 	[ALC256_FIXUP_ASUS_HPE] = {
9143 		.type = HDA_FIXUP_VERBS,
9144 		.v.verbs = (const struct hda_verb[]) {
9145 			/* Set EAPD high */
9146 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9147 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9148 			{ }
9149 		},
9150 		.chained = true,
9151 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9152 	},
9153 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9154 		.type = HDA_FIXUP_FUNC,
9155 		.v.func = alc_fixup_headset_jack,
9156 		.chained = true,
9157 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9158 	},
9159 	[ALC287_FIXUP_HP_GPIO_LED] = {
9160 		.type = HDA_FIXUP_FUNC,
9161 		.v.func = alc287_fixup_hp_gpio_led,
9162 	},
9163 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
9164 		.type = HDA_FIXUP_FUNC,
9165 		.v.func = alc274_fixup_hp_headset_mic,
9166 	},
9167 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9168 		.type = HDA_FIXUP_FUNC,
9169 		.v.func = alc_fixup_no_int_mic,
9170 		.chained = true,
9171 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9172 	},
9173 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9174 		.type = HDA_FIXUP_PINS,
9175 		.v.pins = (const struct hda_pintbl[]) {
9176 			{ 0x1b, 0x411111f0 },
9177 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9178 			{ },
9179 		},
9180 		.chained = true,
9181 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9182 	},
9183 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9184 		.type = HDA_FIXUP_FUNC,
9185 		.v.func = alc269_fixup_limit_int_mic_boost,
9186 		.chained = true,
9187 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9188 	},
9189 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
9190 		.type = HDA_FIXUP_PINS,
9191 		.v.pins = (const struct hda_pintbl[]) {
9192 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9193 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
9194 			{ }
9195 		},
9196 		.chained = true,
9197 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9198 	},
9199 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9200 		.type = HDA_FIXUP_FUNC,
9201 		.v.func = alc285_fixup_ideapad_s740_coef,
9202 		.chained = true,
9203 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9204 	},
9205 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9206 		.type = HDA_FIXUP_FUNC,
9207 		.v.func = alc269_fixup_limit_int_mic_boost,
9208 		.chained = true,
9209 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9210 	},
9211 	[ALC295_FIXUP_ASUS_DACS] = {
9212 		.type = HDA_FIXUP_FUNC,
9213 		.v.func = alc295_fixup_asus_dacs,
9214 	},
9215 	[ALC295_FIXUP_HP_OMEN] = {
9216 		.type = HDA_FIXUP_PINS,
9217 		.v.pins = (const struct hda_pintbl[]) {
9218 			{ 0x12, 0xb7a60130 },
9219 			{ 0x13, 0x40000000 },
9220 			{ 0x14, 0x411111f0 },
9221 			{ 0x16, 0x411111f0 },
9222 			{ 0x17, 0x90170110 },
9223 			{ 0x18, 0x411111f0 },
9224 			{ 0x19, 0x02a11030 },
9225 			{ 0x1a, 0x411111f0 },
9226 			{ 0x1b, 0x04a19030 },
9227 			{ 0x1d, 0x40600001 },
9228 			{ 0x1e, 0x411111f0 },
9229 			{ 0x21, 0x03211020 },
9230 			{}
9231 		},
9232 		.chained = true,
9233 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9234 	},
9235 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
9236 		.type = HDA_FIXUP_FUNC,
9237 		.v.func = alc285_fixup_hp_spectre_x360,
9238 	},
9239 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9240 		.type = HDA_FIXUP_FUNC,
9241 		.v.func = alc285_fixup_hp_spectre_x360_eb1
9242 	},
9243 	[ALC285_FIXUP_HP_ENVY_X360] = {
9244 		.type = HDA_FIXUP_FUNC,
9245 		.v.func = alc285_fixup_hp_envy_x360,
9246 		.chained = true,
9247 		.chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9248 	},
9249 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9250 		.type = HDA_FIXUP_FUNC,
9251 		.v.func = alc285_fixup_ideapad_s740_coef,
9252 		.chained = true,
9253 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9254 	},
9255 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9256 		.type = HDA_FIXUP_FUNC,
9257 		.v.func = alc_fixup_no_shutup,
9258 		.chained = true,
9259 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
9260 	},
9261 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9262 		.type = HDA_FIXUP_PINS,
9263 		.v.pins = (const struct hda_pintbl[]) {
9264 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9265 			{ }
9266 		},
9267 		.chained = true,
9268 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9269 	},
9270 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9271 		.type = HDA_FIXUP_FUNC,
9272 		.v.func = alc269_fixup_limit_int_mic_boost,
9273 		.chained = true,
9274 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9275 	},
9276 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9277 		.type = HDA_FIXUP_FUNC,
9278 		.v.func = alc285_fixup_ideapad_s740_coef,
9279 		.chained = true,
9280 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9281 	},
9282 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9283 		.type = HDA_FIXUP_FUNC,
9284 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9285 		.chained = true,
9286 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9287 	},
9288 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9289 		.type = HDA_FIXUP_VERBS,
9290 		//.v.verbs = legion_15imhg05_coefs,
9291 		.v.verbs = (const struct hda_verb[]) {
9292 			 // set left speaker Legion 7i.
9293 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9294 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9295 
9296 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9297 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9298 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9299 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9300 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9301 
9302 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9303 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9304 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9305 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9306 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9307 
9308 			 // set right speaker Legion 7i.
9309 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9310 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9311 
9312 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9313 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9314 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9315 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9316 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9317 
9318 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9319 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9320 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9321 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9322 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9323 			 {}
9324 		},
9325 		.chained = true,
9326 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9327 	},
9328 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9329 		.type = HDA_FIXUP_FUNC,
9330 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9331 		.chained = true,
9332 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9333 	},
9334 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9335 		.type = HDA_FIXUP_VERBS,
9336 		.v.verbs = (const struct hda_verb[]) {
9337 			 // set left speaker Yoga 7i.
9338 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9339 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9340 
9341 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9342 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9343 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9344 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9345 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9346 
9347 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9348 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9349 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9350 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9351 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9352 
9353 			 // set right speaker Yoga 7i.
9354 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9355 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9356 
9357 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9358 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9359 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9360 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9361 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9362 
9363 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9364 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9365 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9366 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9367 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9368 			 {}
9369 		},
9370 		.chained = true,
9371 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9372 	},
9373 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9374 		.type = HDA_FIXUP_FUNC,
9375 		.v.func = alc298_fixup_lenovo_c940_duet7,
9376 	},
9377 	[ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9378 		.type = HDA_FIXUP_FUNC,
9379 		.v.func = alc287_fixup_lenovo_14irp8_duetitl,
9380 	},
9381 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9382 		.type = HDA_FIXUP_VERBS,
9383 		.v.verbs = (const struct hda_verb[]) {
9384 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9385 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9386 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9387 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9388 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9389 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9390 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9391 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9392 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9393 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9394 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9395 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9396 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9397 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9398 			{}
9399 		},
9400 		.chained = true,
9401 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9402 	},
9403 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9404 		.type = HDA_FIXUP_FUNC,
9405 		.v.func = alc256_fixup_set_coef_defaults,
9406 	},
9407 	[ALC245_FIXUP_HP_GPIO_LED] = {
9408 		.type = HDA_FIXUP_FUNC,
9409 		.v.func = alc245_fixup_hp_gpio_led,
9410 	},
9411 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9412 		.type = HDA_FIXUP_PINS,
9413 		.v.pins = (const struct hda_pintbl[]) {
9414 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9415 			{ }
9416 		},
9417 		.chained = true,
9418 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9419 	},
9420 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9421 		.type = HDA_FIXUP_FUNC,
9422 		.v.func = alc233_fixup_no_audio_jack,
9423 	},
9424 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9425 		.type = HDA_FIXUP_FUNC,
9426 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9427 		.chained = true,
9428 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9429 	},
9430 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9431 		.type = HDA_FIXUP_FUNC,
9432 		.v.func = alc287_fixup_legion_16achg6_speakers,
9433 	},
9434 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9435 		.type = HDA_FIXUP_FUNC,
9436 		.v.func = cs35l41_fixup_i2c_two,
9437 	},
9438 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9439 		.type = HDA_FIXUP_FUNC,
9440 		.v.func = cs35l41_fixup_i2c_two,
9441 		.chained = true,
9442 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9443 	},
9444 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9445 		.type = HDA_FIXUP_FUNC,
9446 		.v.func = cs35l41_fixup_spi_two,
9447 	},
9448 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9449 		.type = HDA_FIXUP_FUNC,
9450 		.v.func = cs35l41_fixup_spi_two,
9451 		.chained = true,
9452 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9453 	},
9454 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9455 		.type = HDA_FIXUP_FUNC,
9456 		.v.func = cs35l41_fixup_spi_four,
9457 	},
9458 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9459 		.type = HDA_FIXUP_FUNC,
9460 		.v.func = cs35l41_fixup_spi_four,
9461 		.chained = true,
9462 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9463 	},
9464 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9465 		.type = HDA_FIXUP_VERBS,
9466 		.v.verbs = (const struct hda_verb[]) {
9467 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9468 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9469 			 { }
9470 		},
9471 		.chained = true,
9472 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9473 	},
9474 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9475 		.type = HDA_FIXUP_FUNC,
9476 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9477 		.chained = true,
9478 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9479 	},
9480 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9481 		.type = HDA_FIXUP_PINS,
9482 		.v.pins = (const struct hda_pintbl[]) {
9483 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9484 			{ }
9485 		},
9486 		.chained = true,
9487 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9488 	},
9489 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9490 		.type = HDA_FIXUP_FUNC,
9491 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9492 	},
9493 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9494 		.type = HDA_FIXUP_VERBS,
9495 		.v.verbs = (const struct hda_verb[]) {
9496 			// enable left speaker
9497 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9498 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9499 
9500 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9501 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9502 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9503 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9504 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9505 
9506 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9507 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9508 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9509 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9510 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9511 
9512 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9513 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9514 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9515 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9516 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9517 
9518 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9519 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9520 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9521 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9522 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9523 
9524 			// enable right speaker
9525 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9526 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9527 
9528 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9529 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9530 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9531 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9532 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9533 
9534 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9535 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9536 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9537 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9538 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9539 
9540 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9541 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9542 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9543 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9544 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9545 
9546 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9547 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9548 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9549 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9550 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9551 
9552 			{ },
9553 		},
9554 	},
9555 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9556 		.type = HDA_FIXUP_FUNC,
9557 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9558 		.chained = true,
9559 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9560 	},
9561 	[ALC287_FIXUP_YOGA9_14IMH9_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_CS35L41_I2C_2,
9566 	},
9567 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9568 		.type = HDA_FIXUP_FUNC,
9569 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9570 		.chained = true,
9571 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9572 	},
9573 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9574 		.type = HDA_FIXUP_PINS,
9575 		.v.func = alc1220_fixup_gb_dual_codecs,
9576 		.chained = true,
9577 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9578 	},
9579 	[ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9580 		.type = HDA_FIXUP_FUNC,
9581 		.v.func = cs35l41_fixup_i2c_two,
9582 		.chained = true,
9583 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9584 	},
9585 	[ALC287_FIXUP_TAS2781_I2C] = {
9586 		.type = HDA_FIXUP_FUNC,
9587 		.v.func = tas2781_fixup_i2c,
9588 		.chained = true,
9589 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9590 	},
9591 	[ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9592 		.type = HDA_FIXUP_FUNC,
9593 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9594 	},
9595 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9596 		.type = HDA_FIXUP_FUNC,
9597 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9598 		.chained = true,
9599 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
9600 	},
9601 	[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9602 		.type = HDA_FIXUP_FUNC,
9603 		.v.func = alc287_fixup_bind_dacs,
9604 		.chained = true,
9605 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9606 	},
9607 	[ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9608 		.type = HDA_FIXUP_FUNC,
9609 		.v.func = alc287_fixup_bind_dacs,
9610 		.chained = true,
9611 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9612 	},
9613 	[ALC2XX_FIXUP_HEADSET_MIC] = {
9614 		.type = HDA_FIXUP_FUNC,
9615 		.v.func = alc_fixup_headset_mic,
9616 	},
9617 	[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9618 		.type = HDA_FIXUP_FUNC,
9619 		.v.func = cs35l41_fixup_spi_two,
9620 		.chained = true,
9621 		.chain_id = ALC289_FIXUP_DUAL_SPK
9622 	},
9623 	[ALC294_FIXUP_CS35L41_I2C_2] = {
9624 		.type = HDA_FIXUP_FUNC,
9625 		.v.func = cs35l41_fixup_i2c_two,
9626 	},
9627 };
9628 
9629 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
9630 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
9631 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9632 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
9633 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
9634 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9635 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9636 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
9637 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9638 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9639 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
9640 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9641 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
9642 	SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9643 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
9644 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
9645 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
9646 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
9647 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9648 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9649 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9650 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9651 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
9652 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
9653 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
9654 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
9655 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
9656 	SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9657 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9658 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9659 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9660 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
9661 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9662 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9663 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9664 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
9665 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
9666 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9667 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9668 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9669 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
9670 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9671 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
9672 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
9673 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
9674 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
9675 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
9676 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9677 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
9678 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
9679 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9680 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9681 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9682 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9683 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9684 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
9685 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
9686 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
9687 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9688 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9689 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
9690 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9691 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
9692 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9693 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9694 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9695 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9696 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9697 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9698 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9699 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9700 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9701 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
9702 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
9703 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
9704 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
9705 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9706 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
9707 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
9708 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9709 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9710 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9711 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9712 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
9713 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
9714 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
9715 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9716 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9717 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9718 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9719 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9720 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9721 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9722 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
9723 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
9724 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
9725 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
9726 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9727 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9728 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
9729 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
9730 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9731 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9732 	SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9733 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9734 	SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9735 	SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9736 	SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9737 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9738 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9739 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9740 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9741 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9742 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9743 	SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9744 	SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9745 	SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9746 	SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9747 	SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9748 	SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9749 	SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9750 	SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9751 	SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9752 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9753 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9754 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9755 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
9756 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
9757 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9758 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9759 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9760 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9761 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9762 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9763 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9764 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9765 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9766 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9767 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9768 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9769 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9770 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9771 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9772 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9773 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9774 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9775 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
9776 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
9777 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9778 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9779 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9780 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9781 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9782 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9783 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9784 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9785 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9786 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9787 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9788 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9789 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9790 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9791 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9792 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9793 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9794 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9795 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9796 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9797 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9798 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9799 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9800 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9801 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9802 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9803 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9804 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9805 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9806 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9807 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9808 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9809 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9810 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9811 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
9812 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9813 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9814 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9815 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9816 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
9817 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
9818 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
9819 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9820 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9821 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9822 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9823 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9824 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9825 	SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9826 	SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9827 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
9828 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9829 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
9830 	SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9831 	SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
9832 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9833 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9834 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9835 	SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9836 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
9837 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9838 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9839 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
9840 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9841 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9842 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9843 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9844 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9845 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9846 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9847 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9848 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9849 	SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
9850 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9851 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9852 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9853 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9854 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9855 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9856 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9857 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9858 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9859 	SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9860 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9861 	SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9862 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9863 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9864 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9865 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9866 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9867 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9868 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9869 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9870 	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9871 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9872 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9873 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9874 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9875 	SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9876 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9877 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9878 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9879 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9880 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9881 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9882 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9883 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9884 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9885 	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9886 	SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
9887 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9888 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9889 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9890 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9891 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9892 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
9893 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9894 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
9895 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9896 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9897 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9898 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9899 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9900 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9901 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9902 	SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
9903 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9904 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9905 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9906 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9907 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9908 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9909 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
9910 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9911 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
9912 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9913 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9914 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
9915 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9916 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9917 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9918 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9919 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9920 	SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
9921 	SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9922 	SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
9923 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9924 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9925 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9926 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9927 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9928 	SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
9929 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9930 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9931 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9932 	SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9933 	SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9934 	SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
9935 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9936 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9937 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9938 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9939 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9940 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9941 	SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9942 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9943 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9944 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9945 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9946 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9947 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9948 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9949 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9950 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
9951 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9952 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9953 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
9954 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9955 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
9956 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9957 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9958 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9959 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9960 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9961 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
9962 	SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9963 	SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9964 	SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9965 	SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9966 	SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9967 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9968 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9969 	SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9970 	SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9971 	SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9972 	SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9973 	SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9974 	SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9975 	SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9976 	SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
9977 	SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
9978 	SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
9979 	SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
9980 	SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
9981 	SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
9982 	SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
9983 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9984 	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9985 	SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
9986 	SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
9987 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9988 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9989 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9990 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9991 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9992 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9993 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9994 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9995 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9996 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
9997 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9998 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9999 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10000 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10001 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10002 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10003 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10004 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10005 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10006 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10007 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10008 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10009 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10010 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650P", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10011 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10012 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10013 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10014 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10015 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10016 	SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA", ALC287_FIXUP_CS35L41_I2C_2),
10017 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301V", ALC285_FIXUP_ASUS_HEADSET_MIC),
10018 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10019 	SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10020 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10021 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10022 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10023 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10024 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10025 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
10026 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10027 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10028 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10029 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10030 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10031 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10032 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10033 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10034 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10035 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10036 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
10037 	SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10038 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10039 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10040 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10041 	SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
10042 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10043 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10044 	SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10045 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10046 	SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10047 	SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10048 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10049 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10050 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10051 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10052 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10053 	SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS ROG Strix G17 2023 (G713PV)", ALC287_FIXUP_CS35L41_I2C_2),
10054 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10055 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10056 	SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10057 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10058 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10059 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10060 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10061 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10062 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10063 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10064 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10065 	SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10066 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10067 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10068 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10069 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10070 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10071 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10072 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
10073 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10074 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10075 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10076 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10077 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10078 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10079 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10080 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10081 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10082 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10083 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10084 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10085 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10086 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10087 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10088 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10089 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10090 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10091 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10092 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10093 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10094 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10095 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10096 	SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10097 	SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10098 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10099 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10100 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10101 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10102 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10103 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10104 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10105 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10106 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10107 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10108 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10109 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10110 	SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10111 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10112 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10113 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10114 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10115 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10116 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10117 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10118 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10119 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10120 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10121 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10122 	SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10123 	SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10124 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10125 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10126 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10127 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10128 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10129 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10130 	SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10131 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10132 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10133 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10134 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10135 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10136 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10137 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10138 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10139 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10140 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10141 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10142 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10143 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10144 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10145 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10146 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10147 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10148 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10149 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10150 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10151 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10152 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10153 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10154 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10155 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10156 	SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10157 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10158 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10159 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10160 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10161 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10162 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10163 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10164 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10165 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10166 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10167 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10168 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10169 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10170 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10171 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10172 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10173 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10174 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10175 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10176 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10177 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10178 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10179 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10180 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10181 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10182 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10183 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10184 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10185 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10186 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10187 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10188 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10189 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10190 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10191 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10192 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10193 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10194 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10195 	SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10196 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10197 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10198 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10199 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10200 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10201 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10202 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10203 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10204 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10205 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10206 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10207 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10208 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10209 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10210 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10211 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10212 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10213 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10214 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10215 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10216 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10217 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10218 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10219 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10220 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10221 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10222 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10223 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10224 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10225 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10226 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10227 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10228 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10229 	SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10230 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10231 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10232 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10233 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10234 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10235 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10236 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10237 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10238 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10239 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10240 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10241 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10242 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10243 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10244 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10245 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10246 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10247 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10248 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10249 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10250 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10251 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10252 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10253 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10254 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10255 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10256 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10257 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10258 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10259 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10260 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10261 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10262 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10263 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
10264 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10265 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10266 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10267 	SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10268 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10269 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10270 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10271 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10272 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10273 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10274 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10275 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10276 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10277 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10278 	SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10279 	SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10280 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10281 	SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10282 	SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10283 	SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10284 	SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10285 	SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10286 	SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10287 	SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10288 	SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10289 	SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10290 	SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10291 	SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10292 	SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10293 	SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10294 	SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10295 	SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10296 	SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10297 	SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10298 	SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10299 	SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10300 	SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10301 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10302 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10303 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10304 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10305 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10306 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10307 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10308 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10309 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10310 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10311 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10312 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10313 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10314 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10315 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10316 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10317 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10318 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10319 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10320 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10321 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10322 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10323 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10324 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10325 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10326 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10327 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10328 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10329 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10330 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10331 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10332 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10333 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10334 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10335 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10336 	SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10337 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10338 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10339 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10340 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10341 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10342 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10343 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10344 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10345 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10346 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10347 	SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10348 	SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10349 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10350 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10351 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10352 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10353 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10354 	SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10355 	SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10356 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10357 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10358 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10359 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10360 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10361 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10362 	SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10363 	SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10364 
10365 #if 0
10366 	/* Below is a quirk table taken from the old code.
10367 	 * Basically the device should work as is without the fixup table.
10368 	 * If BIOS doesn't give a proper info, enable the corresponding
10369 	 * fixup entry.
10370 	 */
10371 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10372 		      ALC269_FIXUP_AMIC),
10373 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10374 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10375 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10376 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10377 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10378 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10379 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10380 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10381 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10382 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10383 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10384 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10385 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10386 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10387 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10388 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10389 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10390 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10391 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10392 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10393 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10394 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10395 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10396 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10397 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10398 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10399 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10400 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10401 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10402 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10403 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10404 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10405 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10406 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10407 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10408 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10409 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10410 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10411 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10412 #endif
10413 	{}
10414 };
10415 
10416 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10417 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10418 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10419 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10420 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10421 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10422 	{}
10423 };
10424 
10425 static const struct hda_model_fixup alc269_fixup_models[] = {
10426 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10427 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10428 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10429 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10430 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10431 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10432 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10433 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10434 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10435 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10436 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10437 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10438 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10439 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10440 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10441 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10442 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10443 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10444 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10445 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10446 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10447 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10448 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
10449 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10450 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
10451 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10452 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10453 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10454 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10455 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10456 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10457 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10458 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10459 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10460 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10461 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10462 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10463 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10464 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10465 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10466 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10467 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10468 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10469 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10470 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10471 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10472 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10473 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10474 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10475 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10476 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10477 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10478 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10479 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10480 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10481 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10482 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10483 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10484 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10485 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10486 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10487 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10488 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10489 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10490 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
10491 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
10492 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
10493 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
10494 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10495 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10496 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10497 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10498 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10499 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10500 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10501 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10502 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10503 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10504 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10505 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10506 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10507 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
10508 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10509 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10510 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
10511 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
10512 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
10513 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
10514 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10515 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10516 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10517 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10518 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10519 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10520 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10521 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10522 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10523 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10524 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10525 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10526 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10527 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10528 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10529 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10530 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
10531 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10532 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
10533 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
10534 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
10535 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
10536 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
10537 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
10538 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
10539 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
10540 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
10541 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
10542 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
10543 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
10544 	{.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
10545 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
10546 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
10547 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
10548 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
10549 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
10550 	{}
10551 };
10552 #define ALC225_STANDARD_PINS \
10553 	{0x21, 0x04211020}
10554 
10555 #define ALC256_STANDARD_PINS \
10556 	{0x12, 0x90a60140}, \
10557 	{0x14, 0x90170110}, \
10558 	{0x21, 0x02211020}
10559 
10560 #define ALC282_STANDARD_PINS \
10561 	{0x14, 0x90170110}
10562 
10563 #define ALC290_STANDARD_PINS \
10564 	{0x12, 0x99a30130}
10565 
10566 #define ALC292_STANDARD_PINS \
10567 	{0x14, 0x90170110}, \
10568 	{0x15, 0x0221401f}
10569 
10570 #define ALC295_STANDARD_PINS \
10571 	{0x12, 0xb7a60130}, \
10572 	{0x14, 0x90170110}, \
10573 	{0x21, 0x04211020}
10574 
10575 #define ALC298_STANDARD_PINS \
10576 	{0x12, 0x90a60130}, \
10577 	{0x21, 0x03211020}
10578 
10579 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
10580 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10581 		{0x14, 0x01014020},
10582 		{0x17, 0x90170110},
10583 		{0x18, 0x02a11030},
10584 		{0x19, 0x0181303F},
10585 		{0x21, 0x0221102f}),
10586 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10587 		{0x12, 0x90a601c0},
10588 		{0x14, 0x90171120},
10589 		{0x21, 0x02211030}),
10590 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10591 		{0x14, 0x90170110},
10592 		{0x1b, 0x90a70130},
10593 		{0x21, 0x03211020}),
10594 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10595 		{0x1a, 0x90a70130},
10596 		{0x1b, 0x90170110},
10597 		{0x21, 0x03211020}),
10598 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10599 		ALC225_STANDARD_PINS,
10600 		{0x12, 0xb7a60130},
10601 		{0x14, 0x901701a0}),
10602 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10603 		ALC225_STANDARD_PINS,
10604 		{0x12, 0xb7a60130},
10605 		{0x14, 0x901701b0}),
10606 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10607 		ALC225_STANDARD_PINS,
10608 		{0x12, 0xb7a60150},
10609 		{0x14, 0x901701a0}),
10610 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10611 		ALC225_STANDARD_PINS,
10612 		{0x12, 0xb7a60150},
10613 		{0x14, 0x901701b0}),
10614 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10615 		ALC225_STANDARD_PINS,
10616 		{0x12, 0xb7a60130},
10617 		{0x1b, 0x90170110}),
10618 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10619 		{0x1b, 0x01111010},
10620 		{0x1e, 0x01451130},
10621 		{0x21, 0x02211020}),
10622 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10623 		{0x12, 0x90a60140},
10624 		{0x14, 0x90170110},
10625 		{0x19, 0x02a11030},
10626 		{0x21, 0x02211020}),
10627 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10628 		{0x14, 0x90170110},
10629 		{0x19, 0x02a11030},
10630 		{0x1a, 0x02a11040},
10631 		{0x1b, 0x01014020},
10632 		{0x21, 0x0221101f}),
10633 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10634 		{0x14, 0x90170110},
10635 		{0x19, 0x02a11030},
10636 		{0x1a, 0x02a11040},
10637 		{0x1b, 0x01011020},
10638 		{0x21, 0x0221101f}),
10639 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10640 		{0x14, 0x90170110},
10641 		{0x19, 0x02a11020},
10642 		{0x1a, 0x02a11030},
10643 		{0x21, 0x0221101f}),
10644 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10645 		{0x21, 0x02211010}),
10646 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10647 		{0x14, 0x90170110},
10648 		{0x19, 0x02a11020},
10649 		{0x21, 0x02211030}),
10650 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
10651 		{0x14, 0x90170110},
10652 		{0x21, 0x02211020}),
10653 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10654 		{0x14, 0x90170130},
10655 		{0x21, 0x02211040}),
10656 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10657 		{0x12, 0x90a60140},
10658 		{0x14, 0x90170110},
10659 		{0x21, 0x02211020}),
10660 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10661 		{0x12, 0x90a60160},
10662 		{0x14, 0x90170120},
10663 		{0x21, 0x02211030}),
10664 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10665 		{0x14, 0x90170110},
10666 		{0x1b, 0x02011020},
10667 		{0x21, 0x0221101f}),
10668 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10669 		{0x14, 0x90170110},
10670 		{0x1b, 0x01011020},
10671 		{0x21, 0x0221101f}),
10672 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10673 		{0x14, 0x90170130},
10674 		{0x1b, 0x01014020},
10675 		{0x21, 0x0221103f}),
10676 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10677 		{0x14, 0x90170130},
10678 		{0x1b, 0x01011020},
10679 		{0x21, 0x0221103f}),
10680 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10681 		{0x14, 0x90170130},
10682 		{0x1b, 0x02011020},
10683 		{0x21, 0x0221103f}),
10684 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10685 		{0x14, 0x90170150},
10686 		{0x1b, 0x02011020},
10687 		{0x21, 0x0221105f}),
10688 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10689 		{0x14, 0x90170110},
10690 		{0x1b, 0x01014020},
10691 		{0x21, 0x0221101f}),
10692 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10693 		{0x12, 0x90a60160},
10694 		{0x14, 0x90170120},
10695 		{0x17, 0x90170140},
10696 		{0x21, 0x0321102f}),
10697 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10698 		{0x12, 0x90a60160},
10699 		{0x14, 0x90170130},
10700 		{0x21, 0x02211040}),
10701 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10702 		{0x12, 0x90a60160},
10703 		{0x14, 0x90170140},
10704 		{0x21, 0x02211050}),
10705 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10706 		{0x12, 0x90a60170},
10707 		{0x14, 0x90170120},
10708 		{0x21, 0x02211030}),
10709 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10710 		{0x12, 0x90a60170},
10711 		{0x14, 0x90170130},
10712 		{0x21, 0x02211040}),
10713 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10714 		{0x12, 0x90a60170},
10715 		{0x14, 0x90171130},
10716 		{0x21, 0x02211040}),
10717 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10718 		{0x12, 0x90a60170},
10719 		{0x14, 0x90170140},
10720 		{0x21, 0x02211050}),
10721 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10722 		{0x12, 0x90a60180},
10723 		{0x14, 0x90170130},
10724 		{0x21, 0x02211040}),
10725 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10726 		{0x12, 0x90a60180},
10727 		{0x14, 0x90170120},
10728 		{0x21, 0x02211030}),
10729 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10730 		{0x1b, 0x01011020},
10731 		{0x21, 0x02211010}),
10732 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10733 		{0x14, 0x90170110},
10734 		{0x1b, 0x90a70130},
10735 		{0x21, 0x04211020}),
10736 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10737 		{0x14, 0x90170110},
10738 		{0x1b, 0x90a70130},
10739 		{0x21, 0x03211020}),
10740 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10741 		{0x12, 0x90a60130},
10742 		{0x14, 0x90170110},
10743 		{0x21, 0x03211020}),
10744 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10745 		{0x12, 0x90a60130},
10746 		{0x14, 0x90170110},
10747 		{0x21, 0x04211020}),
10748 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10749 		{0x1a, 0x90a70130},
10750 		{0x1b, 0x90170110},
10751 		{0x21, 0x03211020}),
10752        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10753 		{0x14, 0x90170110},
10754 		{0x19, 0x02a11020},
10755 		{0x21, 0x0221101f}),
10756        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10757 		{0x17, 0x90170110},
10758 		{0x19, 0x03a11030},
10759 		{0x21, 0x03211020}),
10760 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10761 		{0x12, 0x90a60130},
10762 		{0x14, 0x90170110},
10763 		{0x15, 0x0421101f},
10764 		{0x1a, 0x04a11020}),
10765 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10766 		{0x12, 0x90a60140},
10767 		{0x14, 0x90170110},
10768 		{0x15, 0x0421101f},
10769 		{0x18, 0x02811030},
10770 		{0x1a, 0x04a1103f},
10771 		{0x1b, 0x02011020}),
10772 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10773 		ALC282_STANDARD_PINS,
10774 		{0x12, 0x99a30130},
10775 		{0x19, 0x03a11020},
10776 		{0x21, 0x0321101f}),
10777 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10778 		ALC282_STANDARD_PINS,
10779 		{0x12, 0x99a30130},
10780 		{0x19, 0x03a11020},
10781 		{0x21, 0x03211040}),
10782 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10783 		ALC282_STANDARD_PINS,
10784 		{0x12, 0x99a30130},
10785 		{0x19, 0x03a11030},
10786 		{0x21, 0x03211020}),
10787 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10788 		ALC282_STANDARD_PINS,
10789 		{0x12, 0x99a30130},
10790 		{0x19, 0x04a11020},
10791 		{0x21, 0x0421101f}),
10792 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
10793 		ALC282_STANDARD_PINS,
10794 		{0x12, 0x90a60140},
10795 		{0x19, 0x04a11030},
10796 		{0x21, 0x04211020}),
10797 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10798 		ALC282_STANDARD_PINS,
10799 		{0x12, 0x90a609c0},
10800 		{0x18, 0x03a11830},
10801 		{0x19, 0x04a19831},
10802 		{0x1a, 0x0481303f},
10803 		{0x1b, 0x04211020},
10804 		{0x21, 0x0321101f}),
10805 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10806 		ALC282_STANDARD_PINS,
10807 		{0x12, 0x90a60940},
10808 		{0x18, 0x03a11830},
10809 		{0x19, 0x04a19831},
10810 		{0x1a, 0x0481303f},
10811 		{0x1b, 0x04211020},
10812 		{0x21, 0x0321101f}),
10813 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10814 		ALC282_STANDARD_PINS,
10815 		{0x12, 0x90a60130},
10816 		{0x21, 0x0321101f}),
10817 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10818 		{0x12, 0x90a60160},
10819 		{0x14, 0x90170120},
10820 		{0x21, 0x02211030}),
10821 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10822 		ALC282_STANDARD_PINS,
10823 		{0x12, 0x90a60130},
10824 		{0x19, 0x03a11020},
10825 		{0x21, 0x0321101f}),
10826 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10827 		{0x12, 0x90a60130},
10828 		{0x14, 0x90170110},
10829 		{0x19, 0x04a11040},
10830 		{0x21, 0x04211020}),
10831 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10832 		{0x14, 0x90170110},
10833 		{0x19, 0x04a11040},
10834 		{0x1d, 0x40600001},
10835 		{0x21, 0x04211020}),
10836 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
10837 		{0x14, 0x90170110},
10838 		{0x19, 0x04a11040},
10839 		{0x21, 0x04211020}),
10840 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10841 		{0x14, 0x90170110},
10842 		{0x17, 0x90170111},
10843 		{0x19, 0x03a11030},
10844 		{0x21, 0x03211020}),
10845 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10846 		{0x17, 0x90170110},
10847 		{0x19, 0x03a11030},
10848 		{0x21, 0x03211020}),
10849 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10850 		{0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
10851 		{0x19, 0x04a11040},
10852 		{0x21, 0x04211020}),
10853 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10854 		{0x12, 0x90a60130},
10855 		{0x17, 0x90170110},
10856 		{0x21, 0x02211020}),
10857 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
10858 		{0x12, 0x90a60120},
10859 		{0x14, 0x90170110},
10860 		{0x21, 0x0321101f}),
10861 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10862 		ALC290_STANDARD_PINS,
10863 		{0x15, 0x04211040},
10864 		{0x18, 0x90170112},
10865 		{0x1a, 0x04a11020}),
10866 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10867 		ALC290_STANDARD_PINS,
10868 		{0x15, 0x04211040},
10869 		{0x18, 0x90170110},
10870 		{0x1a, 0x04a11020}),
10871 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10872 		ALC290_STANDARD_PINS,
10873 		{0x15, 0x0421101f},
10874 		{0x1a, 0x04a11020}),
10875 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10876 		ALC290_STANDARD_PINS,
10877 		{0x15, 0x04211020},
10878 		{0x1a, 0x04a11040}),
10879 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10880 		ALC290_STANDARD_PINS,
10881 		{0x14, 0x90170110},
10882 		{0x15, 0x04211020},
10883 		{0x1a, 0x04a11040}),
10884 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10885 		ALC290_STANDARD_PINS,
10886 		{0x14, 0x90170110},
10887 		{0x15, 0x04211020},
10888 		{0x1a, 0x04a11020}),
10889 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10890 		ALC290_STANDARD_PINS,
10891 		{0x14, 0x90170110},
10892 		{0x15, 0x0421101f},
10893 		{0x1a, 0x04a11020}),
10894 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10895 		ALC292_STANDARD_PINS,
10896 		{0x12, 0x90a60140},
10897 		{0x16, 0x01014020},
10898 		{0x19, 0x01a19030}),
10899 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10900 		ALC292_STANDARD_PINS,
10901 		{0x12, 0x90a60140},
10902 		{0x16, 0x01014020},
10903 		{0x18, 0x02a19031},
10904 		{0x19, 0x01a1903e}),
10905 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
10906 		ALC292_STANDARD_PINS,
10907 		{0x12, 0x90a60140}),
10908 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10909 		ALC292_STANDARD_PINS,
10910 		{0x13, 0x90a60140},
10911 		{0x16, 0x21014020},
10912 		{0x19, 0x21a19030}),
10913 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10914 		ALC292_STANDARD_PINS,
10915 		{0x13, 0x90a60140}),
10916 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10917 		{0x17, 0x90170110},
10918 		{0x21, 0x04211020}),
10919 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10920 		{0x14, 0x90170110},
10921 		{0x1b, 0x90a70130},
10922 		{0x21, 0x04211020}),
10923 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10924 		{0x12, 0x90a60130},
10925 		{0x17, 0x90170110},
10926 		{0x21, 0x03211020}),
10927 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10928 		{0x12, 0x90a60130},
10929 		{0x17, 0x90170110},
10930 		{0x21, 0x04211020}),
10931 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10932 		{0x12, 0x90a60130},
10933 		{0x17, 0x90170110},
10934 		{0x21, 0x03211020}),
10935 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10936 		{0x12, 0x90a60120},
10937 		{0x17, 0x90170110},
10938 		{0x21, 0x04211030}),
10939 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10940 		{0x12, 0x90a60130},
10941 		{0x17, 0x90170110},
10942 		{0x21, 0x03211020}),
10943 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10944 		{0x12, 0x90a60130},
10945 		{0x17, 0x90170110},
10946 		{0x21, 0x03211020}),
10947 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10948 		ALC298_STANDARD_PINS,
10949 		{0x17, 0x90170110}),
10950 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10951 		ALC298_STANDARD_PINS,
10952 		{0x17, 0x90170140}),
10953 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10954 		ALC298_STANDARD_PINS,
10955 		{0x17, 0x90170150}),
10956 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10957 		{0x12, 0xb7a60140},
10958 		{0x13, 0xb7a60150},
10959 		{0x17, 0x90170110},
10960 		{0x1a, 0x03011020},
10961 		{0x21, 0x03211030}),
10962 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10963 		{0x12, 0xb7a60140},
10964 		{0x17, 0x90170110},
10965 		{0x1a, 0x03a11030},
10966 		{0x21, 0x03211020}),
10967 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10968 		ALC225_STANDARD_PINS,
10969 		{0x12, 0xb7a60130},
10970 		{0x17, 0x90170110}),
10971 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10972 		{0x14, 0x01014010},
10973 		{0x17, 0x90170120},
10974 		{0x18, 0x02a11030},
10975 		{0x19, 0x02a1103f},
10976 		{0x21, 0x0221101f}),
10977 	{}
10978 };
10979 
10980 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10981  * more machines, don't need to match all valid pins, just need to match
10982  * all the pins defined in the tbl. Just because of this reason, it is possible
10983  * that a single machine matches multiple tbls, so there is one limitation:
10984  *   at most one tbl is allowed to define for the same vendor and same codec
10985  */
10986 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10987 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
10988 		{0x19, 0x40000000}),
10989 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10990 		{0x19, 0x40000000},
10991 		{0x1b, 0x40000000}),
10992 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10993 		{0x19, 0x40000000},
10994 		{0x1b, 0x40000000}),
10995 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10996 		{0x19, 0x40000000},
10997 		{0x1a, 0x40000000}),
10998 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10999 		{0x19, 0x40000000},
11000 		{0x1a, 0x40000000}),
11001 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11002 		{0x19, 0x40000000},
11003 		{0x1a, 0x40000000}),
11004 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11005 		{0x19, 0x40000000}),
11006 	{}
11007 };
11008 
11009 static void alc269_fill_coef(struct hda_codec *codec)
11010 {
11011 	struct alc_spec *spec = codec->spec;
11012 	int val;
11013 
11014 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11015 		return;
11016 
11017 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11018 		alc_write_coef_idx(codec, 0xf, 0x960b);
11019 		alc_write_coef_idx(codec, 0xe, 0x8817);
11020 	}
11021 
11022 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11023 		alc_write_coef_idx(codec, 0xf, 0x960b);
11024 		alc_write_coef_idx(codec, 0xe, 0x8814);
11025 	}
11026 
11027 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11028 		/* Power up output pin */
11029 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11030 	}
11031 
11032 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11033 		val = alc_read_coef_idx(codec, 0xd);
11034 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11035 			/* Capless ramp up clock control */
11036 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
11037 		}
11038 		val = alc_read_coef_idx(codec, 0x17);
11039 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11040 			/* Class D power on reset */
11041 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
11042 		}
11043 	}
11044 
11045 	/* HP */
11046 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11047 }
11048 
11049 /*
11050  */
11051 static int patch_alc269(struct hda_codec *codec)
11052 {
11053 	struct alc_spec *spec;
11054 	int err;
11055 
11056 	err = alc_alloc_spec(codec, 0x0b);
11057 	if (err < 0)
11058 		return err;
11059 
11060 	spec = codec->spec;
11061 	spec->gen.shared_mic_vref_pin = 0x18;
11062 	codec->power_save_node = 0;
11063 	spec->en_3kpull_low = true;
11064 
11065 #ifdef CONFIG_PM
11066 	codec->patch_ops.suspend = alc269_suspend;
11067 	codec->patch_ops.resume = alc269_resume;
11068 #endif
11069 	spec->shutup = alc_default_shutup;
11070 	spec->init_hook = alc_default_init;
11071 
11072 	switch (codec->core.vendor_id) {
11073 	case 0x10ec0269:
11074 		spec->codec_variant = ALC269_TYPE_ALC269VA;
11075 		switch (alc_get_coef0(codec) & 0x00f0) {
11076 		case 0x0010:
11077 			if (codec->bus->pci &&
11078 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
11079 			    spec->cdefine.platform_type == 1)
11080 				err = alc_codec_rename(codec, "ALC271X");
11081 			spec->codec_variant = ALC269_TYPE_ALC269VB;
11082 			break;
11083 		case 0x0020:
11084 			if (codec->bus->pci &&
11085 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
11086 			    codec->bus->pci->subsystem_device == 0x21f3)
11087 				err = alc_codec_rename(codec, "ALC3202");
11088 			spec->codec_variant = ALC269_TYPE_ALC269VC;
11089 			break;
11090 		case 0x0030:
11091 			spec->codec_variant = ALC269_TYPE_ALC269VD;
11092 			break;
11093 		default:
11094 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
11095 		}
11096 		if (err < 0)
11097 			goto error;
11098 		spec->shutup = alc269_shutup;
11099 		spec->init_hook = alc269_fill_coef;
11100 		alc269_fill_coef(codec);
11101 		break;
11102 
11103 	case 0x10ec0280:
11104 	case 0x10ec0290:
11105 		spec->codec_variant = ALC269_TYPE_ALC280;
11106 		break;
11107 	case 0x10ec0282:
11108 		spec->codec_variant = ALC269_TYPE_ALC282;
11109 		spec->shutup = alc282_shutup;
11110 		spec->init_hook = alc282_init;
11111 		break;
11112 	case 0x10ec0233:
11113 	case 0x10ec0283:
11114 		spec->codec_variant = ALC269_TYPE_ALC283;
11115 		spec->shutup = alc283_shutup;
11116 		spec->init_hook = alc283_init;
11117 		break;
11118 	case 0x10ec0284:
11119 	case 0x10ec0292:
11120 		spec->codec_variant = ALC269_TYPE_ALC284;
11121 		break;
11122 	case 0x10ec0293:
11123 		spec->codec_variant = ALC269_TYPE_ALC293;
11124 		break;
11125 	case 0x10ec0286:
11126 	case 0x10ec0288:
11127 		spec->codec_variant = ALC269_TYPE_ALC286;
11128 		break;
11129 	case 0x10ec0298:
11130 		spec->codec_variant = ALC269_TYPE_ALC298;
11131 		break;
11132 	case 0x10ec0235:
11133 	case 0x10ec0255:
11134 		spec->codec_variant = ALC269_TYPE_ALC255;
11135 		spec->shutup = alc256_shutup;
11136 		spec->init_hook = alc256_init;
11137 		break;
11138 	case 0x10ec0230:
11139 	case 0x10ec0236:
11140 	case 0x10ec0256:
11141 	case 0x19e58326:
11142 		spec->codec_variant = ALC269_TYPE_ALC256;
11143 		spec->shutup = alc256_shutup;
11144 		spec->init_hook = alc256_init;
11145 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11146 		if (codec->core.vendor_id == 0x10ec0236 &&
11147 		    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11148 			spec->en_3kpull_low = false;
11149 		break;
11150 	case 0x10ec0257:
11151 		spec->codec_variant = ALC269_TYPE_ALC257;
11152 		spec->shutup = alc256_shutup;
11153 		spec->init_hook = alc256_init;
11154 		spec->gen.mixer_nid = 0;
11155 		spec->en_3kpull_low = false;
11156 		break;
11157 	case 0x10ec0215:
11158 	case 0x10ec0245:
11159 	case 0x10ec0285:
11160 	case 0x10ec0289:
11161 		if (alc_get_coef0(codec) & 0x0010)
11162 			spec->codec_variant = ALC269_TYPE_ALC245;
11163 		else
11164 			spec->codec_variant = ALC269_TYPE_ALC215;
11165 		spec->shutup = alc225_shutup;
11166 		spec->init_hook = alc225_init;
11167 		spec->gen.mixer_nid = 0;
11168 		break;
11169 	case 0x10ec0225:
11170 	case 0x10ec0295:
11171 	case 0x10ec0299:
11172 		spec->codec_variant = ALC269_TYPE_ALC225;
11173 		spec->shutup = alc225_shutup;
11174 		spec->init_hook = alc225_init;
11175 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11176 		break;
11177 	case 0x10ec0287:
11178 		spec->codec_variant = ALC269_TYPE_ALC287;
11179 		spec->shutup = alc225_shutup;
11180 		spec->init_hook = alc225_init;
11181 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11182 		break;
11183 	case 0x10ec0234:
11184 	case 0x10ec0274:
11185 	case 0x10ec0294:
11186 		spec->codec_variant = ALC269_TYPE_ALC294;
11187 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11188 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11189 		spec->init_hook = alc294_init;
11190 		break;
11191 	case 0x10ec0300:
11192 		spec->codec_variant = ALC269_TYPE_ALC300;
11193 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11194 		break;
11195 	case 0x10ec0623:
11196 		spec->codec_variant = ALC269_TYPE_ALC623;
11197 		break;
11198 	case 0x10ec0700:
11199 	case 0x10ec0701:
11200 	case 0x10ec0703:
11201 	case 0x10ec0711:
11202 		spec->codec_variant = ALC269_TYPE_ALC700;
11203 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11204 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11205 		spec->init_hook = alc294_init;
11206 		break;
11207 
11208 	}
11209 
11210 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11211 		spec->has_alc5505_dsp = 1;
11212 		spec->init_hook = alc5505_dsp_init;
11213 	}
11214 
11215 	alc_pre_init(codec);
11216 
11217 	snd_hda_pick_fixup(codec, alc269_fixup_models,
11218 		       alc269_fixup_tbl, alc269_fixups);
11219 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11220 	 * the quirk breaks the latter (bko#214101).
11221 	 * Clear the wrong entry.
11222 	 */
11223 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11224 	    codec->core.vendor_id == 0x10ec0294) {
11225 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11226 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11227 	}
11228 
11229 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11230 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11231 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
11232 			   alc269_fixups);
11233 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11234 
11235 	alc_auto_parse_customize_define(codec);
11236 
11237 	if (has_cdefine_beep(codec))
11238 		spec->gen.beep_nid = 0x01;
11239 
11240 	/* automatic parse from the BIOS config */
11241 	err = alc269_parse_auto_config(codec);
11242 	if (err < 0)
11243 		goto error;
11244 
11245 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11246 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11247 		if (err < 0)
11248 			goto error;
11249 	}
11250 
11251 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11252 
11253 	return 0;
11254 
11255  error:
11256 	alc_free(codec);
11257 	return err;
11258 }
11259 
11260 /*
11261  * ALC861
11262  */
11263 
11264 static int alc861_parse_auto_config(struct hda_codec *codec)
11265 {
11266 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11267 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11268 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11269 }
11270 
11271 /* Pin config fixes */
11272 enum {
11273 	ALC861_FIXUP_FSC_AMILO_PI1505,
11274 	ALC861_FIXUP_AMP_VREF_0F,
11275 	ALC861_FIXUP_NO_JACK_DETECT,
11276 	ALC861_FIXUP_ASUS_A6RP,
11277 	ALC660_FIXUP_ASUS_W7J,
11278 };
11279 
11280 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11281 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11282 			const struct hda_fixup *fix, int action)
11283 {
11284 	struct alc_spec *spec = codec->spec;
11285 	unsigned int val;
11286 
11287 	if (action != HDA_FIXUP_ACT_INIT)
11288 		return;
11289 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
11290 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11291 		val |= AC_PINCTL_IN_EN;
11292 	val |= AC_PINCTL_VREF_50;
11293 	snd_hda_set_pin_ctl(codec, 0x0f, val);
11294 	spec->gen.keep_vref_in_automute = 1;
11295 }
11296 
11297 /* suppress the jack-detection */
11298 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11299 				     const struct hda_fixup *fix, int action)
11300 {
11301 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11302 		codec->no_jack_detect = 1;
11303 }
11304 
11305 static const struct hda_fixup alc861_fixups[] = {
11306 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
11307 		.type = HDA_FIXUP_PINS,
11308 		.v.pins = (const struct hda_pintbl[]) {
11309 			{ 0x0b, 0x0221101f }, /* HP */
11310 			{ 0x0f, 0x90170310 }, /* speaker */
11311 			{ }
11312 		}
11313 	},
11314 	[ALC861_FIXUP_AMP_VREF_0F] = {
11315 		.type = HDA_FIXUP_FUNC,
11316 		.v.func = alc861_fixup_asus_amp_vref_0f,
11317 	},
11318 	[ALC861_FIXUP_NO_JACK_DETECT] = {
11319 		.type = HDA_FIXUP_FUNC,
11320 		.v.func = alc_fixup_no_jack_detect,
11321 	},
11322 	[ALC861_FIXUP_ASUS_A6RP] = {
11323 		.type = HDA_FIXUP_FUNC,
11324 		.v.func = alc861_fixup_asus_amp_vref_0f,
11325 		.chained = true,
11326 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11327 	},
11328 	[ALC660_FIXUP_ASUS_W7J] = {
11329 		.type = HDA_FIXUP_VERBS,
11330 		.v.verbs = (const struct hda_verb[]) {
11331 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
11332 			 * for enabling outputs
11333 			 */
11334 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11335 			{ }
11336 		},
11337 	}
11338 };
11339 
11340 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
11341 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11342 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11343 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11344 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11345 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11346 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11347 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11348 	{}
11349 };
11350 
11351 /*
11352  */
11353 static int patch_alc861(struct hda_codec *codec)
11354 {
11355 	struct alc_spec *spec;
11356 	int err;
11357 
11358 	err = alc_alloc_spec(codec, 0x15);
11359 	if (err < 0)
11360 		return err;
11361 
11362 	spec = codec->spec;
11363 	if (has_cdefine_beep(codec))
11364 		spec->gen.beep_nid = 0x23;
11365 
11366 #ifdef CONFIG_PM
11367 	spec->power_hook = alc_power_eapd;
11368 #endif
11369 
11370 	alc_pre_init(codec);
11371 
11372 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11373 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11374 
11375 	/* automatic parse from the BIOS config */
11376 	err = alc861_parse_auto_config(codec);
11377 	if (err < 0)
11378 		goto error;
11379 
11380 	if (!spec->gen.no_analog) {
11381 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11382 		if (err < 0)
11383 			goto error;
11384 	}
11385 
11386 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11387 
11388 	return 0;
11389 
11390  error:
11391 	alc_free(codec);
11392 	return err;
11393 }
11394 
11395 /*
11396  * ALC861-VD support
11397  *
11398  * Based on ALC882
11399  *
11400  * In addition, an independent DAC
11401  */
11402 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11403 {
11404 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11405 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11406 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11407 }
11408 
11409 enum {
11410 	ALC660VD_FIX_ASUS_GPIO1,
11411 	ALC861VD_FIX_DALLAS,
11412 };
11413 
11414 /* exclude VREF80 */
11415 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11416 				  const struct hda_fixup *fix, int action)
11417 {
11418 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11419 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11420 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11421 	}
11422 }
11423 
11424 /* reset GPIO1 */
11425 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11426 				      const struct hda_fixup *fix, int action)
11427 {
11428 	struct alc_spec *spec = codec->spec;
11429 
11430 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11431 		spec->gpio_mask |= 0x02;
11432 	alc_fixup_gpio(codec, action, 0x01);
11433 }
11434 
11435 static const struct hda_fixup alc861vd_fixups[] = {
11436 	[ALC660VD_FIX_ASUS_GPIO1] = {
11437 		.type = HDA_FIXUP_FUNC,
11438 		.v.func = alc660vd_fixup_asus_gpio1,
11439 	},
11440 	[ALC861VD_FIX_DALLAS] = {
11441 		.type = HDA_FIXUP_FUNC,
11442 		.v.func = alc861vd_fixup_dallas,
11443 	},
11444 };
11445 
11446 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
11447 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
11448 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
11449 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
11450 	{}
11451 };
11452 
11453 /*
11454  */
11455 static int patch_alc861vd(struct hda_codec *codec)
11456 {
11457 	struct alc_spec *spec;
11458 	int err;
11459 
11460 	err = alc_alloc_spec(codec, 0x0b);
11461 	if (err < 0)
11462 		return err;
11463 
11464 	spec = codec->spec;
11465 	if (has_cdefine_beep(codec))
11466 		spec->gen.beep_nid = 0x23;
11467 
11468 	spec->shutup = alc_eapd_shutup;
11469 
11470 	alc_pre_init(codec);
11471 
11472 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11473 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11474 
11475 	/* automatic parse from the BIOS config */
11476 	err = alc861vd_parse_auto_config(codec);
11477 	if (err < 0)
11478 		goto error;
11479 
11480 	if (!spec->gen.no_analog) {
11481 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11482 		if (err < 0)
11483 			goto error;
11484 	}
11485 
11486 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11487 
11488 	return 0;
11489 
11490  error:
11491 	alc_free(codec);
11492 	return err;
11493 }
11494 
11495 /*
11496  * ALC662 support
11497  *
11498  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11499  * configuration.  Each pin widget can choose any input DACs and a mixer.
11500  * Each ADC is connected from a mixer of all inputs.  This makes possible
11501  * 6-channel independent captures.
11502  *
11503  * In addition, an independent DAC for the multi-playback (not used in this
11504  * driver yet).
11505  */
11506 
11507 /*
11508  * BIOS auto configuration
11509  */
11510 
11511 static int alc662_parse_auto_config(struct hda_codec *codec)
11512 {
11513 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
11514 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11515 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11516 	const hda_nid_t *ssids;
11517 
11518 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11519 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11520 	    codec->core.vendor_id == 0x10ec0671)
11521 		ssids = alc663_ssids;
11522 	else
11523 		ssids = alc662_ssids;
11524 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
11525 }
11526 
11527 static void alc272_fixup_mario(struct hda_codec *codec,
11528 			       const struct hda_fixup *fix, int action)
11529 {
11530 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
11531 		return;
11532 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11533 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11534 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11535 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11536 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
11537 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
11538 }
11539 
11540 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11541 	{ .channels = 2,
11542 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11543 	{ .channels = 4,
11544 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11545 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11546 	{ }
11547 };
11548 
11549 /* override the 2.1 chmap */
11550 static void alc_fixup_bass_chmap(struct hda_codec *codec,
11551 				    const struct hda_fixup *fix, int action)
11552 {
11553 	if (action == HDA_FIXUP_ACT_BUILD) {
11554 		struct alc_spec *spec = codec->spec;
11555 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
11556 	}
11557 }
11558 
11559 /* avoid D3 for keeping GPIO up */
11560 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11561 					  hda_nid_t nid,
11562 					  unsigned int power_state)
11563 {
11564 	struct alc_spec *spec = codec->spec;
11565 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
11566 		return AC_PWRST_D0;
11567 	return power_state;
11568 }
11569 
11570 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11571 				   const struct hda_fixup *fix, int action)
11572 {
11573 	struct alc_spec *spec = codec->spec;
11574 
11575 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
11576 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11577 		spec->mute_led_polarity = 1;
11578 		codec->power_filter = gpio_led_power_filter;
11579 	}
11580 }
11581 
11582 static void alc662_usi_automute_hook(struct hda_codec *codec,
11583 					 struct hda_jack_callback *jack)
11584 {
11585 	struct alc_spec *spec = codec->spec;
11586 	int vref;
11587 	msleep(200);
11588 	snd_hda_gen_hp_automute(codec, jack);
11589 
11590 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11591 	msleep(100);
11592 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11593 			    vref);
11594 }
11595 
11596 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11597 				     const struct hda_fixup *fix, int action)
11598 {
11599 	struct alc_spec *spec = codec->spec;
11600 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11601 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11602 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11603 	}
11604 }
11605 
11606 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11607 					struct hda_jack_callback *cb)
11608 {
11609 	/* surround speakers at 0x1b already get muted automatically when
11610 	 * headphones are plugged in, but we have to mute/unmute the remaining
11611 	 * channels manually:
11612 	 * 0x15 - front left/front right
11613 	 * 0x18 - front center/ LFE
11614 	 */
11615 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11616 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11617 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11618 	} else {
11619 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11620 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11621 	}
11622 }
11623 
11624 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11625 					const struct hda_fixup *fix, int action)
11626 {
11627     /* Pin 0x1b: shared headphones jack and surround speakers */
11628 	if (!is_jack_detectable(codec, 0x1b))
11629 		return;
11630 
11631 	switch (action) {
11632 	case HDA_FIXUP_ACT_PRE_PROBE:
11633 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
11634 				alc662_aspire_ethos_mute_speakers);
11635 		/* subwoofer needs an extra GPIO setting to become audible */
11636 		alc_setup_gpio(codec, 0x02);
11637 		break;
11638 	case HDA_FIXUP_ACT_INIT:
11639 		/* Make sure to start in a correct state, i.e. if
11640 		 * headphones have been plugged in before powering up the system
11641 		 */
11642 		alc662_aspire_ethos_mute_speakers(codec, NULL);
11643 		break;
11644 	}
11645 }
11646 
11647 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11648 					     const struct hda_fixup *fix, int action)
11649 {
11650 	struct alc_spec *spec = codec->spec;
11651 
11652 	static const struct hda_pintbl pincfgs[] = {
11653 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11654 		{ 0x1b, 0x0181304f },
11655 		{ }
11656 	};
11657 
11658 	switch (action) {
11659 	case HDA_FIXUP_ACT_PRE_PROBE:
11660 		spec->gen.mixer_nid = 0;
11661 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11662 		snd_hda_apply_pincfgs(codec, pincfgs);
11663 		break;
11664 	case HDA_FIXUP_ACT_INIT:
11665 		alc_write_coef_idx(codec, 0x19, 0xa054);
11666 		break;
11667 	}
11668 }
11669 
11670 static void alc897_hp_automute_hook(struct hda_codec *codec,
11671 					 struct hda_jack_callback *jack)
11672 {
11673 	struct alc_spec *spec = codec->spec;
11674 	int vref;
11675 
11676 	snd_hda_gen_hp_automute(codec, jack);
11677 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11678 	snd_hda_set_pin_ctl(codec, 0x1b, vref);
11679 }
11680 
11681 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11682 				     const struct hda_fixup *fix, int action)
11683 {
11684 	struct alc_spec *spec = codec->spec;
11685 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11686 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11687 		spec->no_shutup_pins = 1;
11688 	}
11689 	if (action == HDA_FIXUP_ACT_PROBE) {
11690 		snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
11691 	}
11692 }
11693 
11694 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11695 				     const struct hda_fixup *fix, int action)
11696 {
11697 	struct alc_spec *spec = codec->spec;
11698 
11699 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11700 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11701 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11702 	}
11703 }
11704 
11705 static const struct coef_fw alc668_coefs[] = {
11706 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
11707 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
11708 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
11709 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11710 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11711 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11712 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
11713 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
11714 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11715 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11716 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11717 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11718 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
11719 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11720 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
11721 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
11722 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11723 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11724 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11725 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11726 	{}
11727 };
11728 
11729 static void alc668_restore_default_value(struct hda_codec *codec)
11730 {
11731 	alc_process_coef_fw(codec, alc668_coefs);
11732 }
11733 
11734 enum {
11735 	ALC662_FIXUP_ASPIRE,
11736 	ALC662_FIXUP_LED_GPIO1,
11737 	ALC662_FIXUP_IDEAPAD,
11738 	ALC272_FIXUP_MARIO,
11739 	ALC662_FIXUP_CZC_ET26,
11740 	ALC662_FIXUP_CZC_P10T,
11741 	ALC662_FIXUP_SKU_IGNORE,
11742 	ALC662_FIXUP_HP_RP5800,
11743 	ALC662_FIXUP_ASUS_MODE1,
11744 	ALC662_FIXUP_ASUS_MODE2,
11745 	ALC662_FIXUP_ASUS_MODE3,
11746 	ALC662_FIXUP_ASUS_MODE4,
11747 	ALC662_FIXUP_ASUS_MODE5,
11748 	ALC662_FIXUP_ASUS_MODE6,
11749 	ALC662_FIXUP_ASUS_MODE7,
11750 	ALC662_FIXUP_ASUS_MODE8,
11751 	ALC662_FIXUP_NO_JACK_DETECT,
11752 	ALC662_FIXUP_ZOTAC_Z68,
11753 	ALC662_FIXUP_INV_DMIC,
11754 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11755 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
11756 	ALC662_FIXUP_HEADSET_MODE,
11757 	ALC668_FIXUP_HEADSET_MODE,
11758 	ALC662_FIXUP_BASS_MODE4_CHMAP,
11759 	ALC662_FIXUP_BASS_16,
11760 	ALC662_FIXUP_BASS_1A,
11761 	ALC662_FIXUP_BASS_CHMAP,
11762 	ALC668_FIXUP_AUTO_MUTE,
11763 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
11764 	ALC668_FIXUP_DELL_XPS13,
11765 	ALC662_FIXUP_ASUS_Nx50,
11766 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11767 	ALC668_FIXUP_ASUS_Nx51,
11768 	ALC668_FIXUP_MIC_COEF,
11769 	ALC668_FIXUP_ASUS_G751,
11770 	ALC891_FIXUP_HEADSET_MODE,
11771 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11772 	ALC662_FIXUP_ACER_VERITON,
11773 	ALC892_FIXUP_ASROCK_MOBO,
11774 	ALC662_FIXUP_USI_FUNC,
11775 	ALC662_FIXUP_USI_HEADSET_MODE,
11776 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
11777 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
11778 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
11779 	ALC671_FIXUP_HP_HEADSET_MIC2,
11780 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
11781 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
11782 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11783 	ALC668_FIXUP_HEADSET_MIC,
11784 	ALC668_FIXUP_MIC_DET_COEF,
11785 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
11786 	ALC897_FIXUP_HEADSET_MIC_PIN,
11787 	ALC897_FIXUP_HP_HSMIC_VERB,
11788 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
11789 	ALC897_FIXUP_HEADSET_MIC_PIN2,
11790 	ALC897_FIXUP_UNIS_H3C_X500S,
11791 	ALC897_FIXUP_HEADSET_MIC_PIN3,
11792 };
11793 
11794 static const struct hda_fixup alc662_fixups[] = {
11795 	[ALC662_FIXUP_ASPIRE] = {
11796 		.type = HDA_FIXUP_PINS,
11797 		.v.pins = (const struct hda_pintbl[]) {
11798 			{ 0x15, 0x99130112 }, /* subwoofer */
11799 			{ }
11800 		}
11801 	},
11802 	[ALC662_FIXUP_LED_GPIO1] = {
11803 		.type = HDA_FIXUP_FUNC,
11804 		.v.func = alc662_fixup_led_gpio1,
11805 	},
11806 	[ALC662_FIXUP_IDEAPAD] = {
11807 		.type = HDA_FIXUP_PINS,
11808 		.v.pins = (const struct hda_pintbl[]) {
11809 			{ 0x17, 0x99130112 }, /* subwoofer */
11810 			{ }
11811 		},
11812 		.chained = true,
11813 		.chain_id = ALC662_FIXUP_LED_GPIO1,
11814 	},
11815 	[ALC272_FIXUP_MARIO] = {
11816 		.type = HDA_FIXUP_FUNC,
11817 		.v.func = alc272_fixup_mario,
11818 	},
11819 	[ALC662_FIXUP_CZC_ET26] = {
11820 		.type = HDA_FIXUP_PINS,
11821 		.v.pins = (const struct hda_pintbl[]) {
11822 			{0x12, 0x403cc000},
11823 			{0x14, 0x90170110}, /* speaker */
11824 			{0x15, 0x411111f0},
11825 			{0x16, 0x411111f0},
11826 			{0x18, 0x01a19030}, /* mic */
11827 			{0x19, 0x90a7013f}, /* int-mic */
11828 			{0x1a, 0x01014020},
11829 			{0x1b, 0x0121401f},
11830 			{0x1c, 0x411111f0},
11831 			{0x1d, 0x411111f0},
11832 			{0x1e, 0x40478e35},
11833 			{}
11834 		},
11835 		.chained = true,
11836 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11837 	},
11838 	[ALC662_FIXUP_CZC_P10T] = {
11839 		.type = HDA_FIXUP_VERBS,
11840 		.v.verbs = (const struct hda_verb[]) {
11841 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11842 			{}
11843 		}
11844 	},
11845 	[ALC662_FIXUP_SKU_IGNORE] = {
11846 		.type = HDA_FIXUP_FUNC,
11847 		.v.func = alc_fixup_sku_ignore,
11848 	},
11849 	[ALC662_FIXUP_HP_RP5800] = {
11850 		.type = HDA_FIXUP_PINS,
11851 		.v.pins = (const struct hda_pintbl[]) {
11852 			{ 0x14, 0x0221201f }, /* HP out */
11853 			{ }
11854 		},
11855 		.chained = true,
11856 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11857 	},
11858 	[ALC662_FIXUP_ASUS_MODE1] = {
11859 		.type = HDA_FIXUP_PINS,
11860 		.v.pins = (const struct hda_pintbl[]) {
11861 			{ 0x14, 0x99130110 }, /* speaker */
11862 			{ 0x18, 0x01a19c20 }, /* mic */
11863 			{ 0x19, 0x99a3092f }, /* int-mic */
11864 			{ 0x21, 0x0121401f }, /* HP out */
11865 			{ }
11866 		},
11867 		.chained = true,
11868 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11869 	},
11870 	[ALC662_FIXUP_ASUS_MODE2] = {
11871 		.type = HDA_FIXUP_PINS,
11872 		.v.pins = (const struct hda_pintbl[]) {
11873 			{ 0x14, 0x99130110 }, /* speaker */
11874 			{ 0x18, 0x01a19820 }, /* mic */
11875 			{ 0x19, 0x99a3092f }, /* int-mic */
11876 			{ 0x1b, 0x0121401f }, /* HP out */
11877 			{ }
11878 		},
11879 		.chained = true,
11880 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11881 	},
11882 	[ALC662_FIXUP_ASUS_MODE3] = {
11883 		.type = HDA_FIXUP_PINS,
11884 		.v.pins = (const struct hda_pintbl[]) {
11885 			{ 0x14, 0x99130110 }, /* speaker */
11886 			{ 0x15, 0x0121441f }, /* HP */
11887 			{ 0x18, 0x01a19840 }, /* mic */
11888 			{ 0x19, 0x99a3094f }, /* int-mic */
11889 			{ 0x21, 0x01211420 }, /* HP2 */
11890 			{ }
11891 		},
11892 		.chained = true,
11893 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11894 	},
11895 	[ALC662_FIXUP_ASUS_MODE4] = {
11896 		.type = HDA_FIXUP_PINS,
11897 		.v.pins = (const struct hda_pintbl[]) {
11898 			{ 0x14, 0x99130110 }, /* speaker */
11899 			{ 0x16, 0x99130111 }, /* speaker */
11900 			{ 0x18, 0x01a19840 }, /* mic */
11901 			{ 0x19, 0x99a3094f }, /* int-mic */
11902 			{ 0x21, 0x0121441f }, /* HP */
11903 			{ }
11904 		},
11905 		.chained = true,
11906 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11907 	},
11908 	[ALC662_FIXUP_ASUS_MODE5] = {
11909 		.type = HDA_FIXUP_PINS,
11910 		.v.pins = (const struct hda_pintbl[]) {
11911 			{ 0x14, 0x99130110 }, /* speaker */
11912 			{ 0x15, 0x0121441f }, /* HP */
11913 			{ 0x16, 0x99130111 }, /* speaker */
11914 			{ 0x18, 0x01a19840 }, /* mic */
11915 			{ 0x19, 0x99a3094f }, /* int-mic */
11916 			{ }
11917 		},
11918 		.chained = true,
11919 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11920 	},
11921 	[ALC662_FIXUP_ASUS_MODE6] = {
11922 		.type = HDA_FIXUP_PINS,
11923 		.v.pins = (const struct hda_pintbl[]) {
11924 			{ 0x14, 0x99130110 }, /* speaker */
11925 			{ 0x15, 0x01211420 }, /* HP2 */
11926 			{ 0x18, 0x01a19840 }, /* mic */
11927 			{ 0x19, 0x99a3094f }, /* int-mic */
11928 			{ 0x1b, 0x0121441f }, /* HP */
11929 			{ }
11930 		},
11931 		.chained = true,
11932 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11933 	},
11934 	[ALC662_FIXUP_ASUS_MODE7] = {
11935 		.type = HDA_FIXUP_PINS,
11936 		.v.pins = (const struct hda_pintbl[]) {
11937 			{ 0x14, 0x99130110 }, /* speaker */
11938 			{ 0x17, 0x99130111 }, /* speaker */
11939 			{ 0x18, 0x01a19840 }, /* mic */
11940 			{ 0x19, 0x99a3094f }, /* int-mic */
11941 			{ 0x1b, 0x01214020 }, /* HP */
11942 			{ 0x21, 0x0121401f }, /* HP */
11943 			{ }
11944 		},
11945 		.chained = true,
11946 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11947 	},
11948 	[ALC662_FIXUP_ASUS_MODE8] = {
11949 		.type = HDA_FIXUP_PINS,
11950 		.v.pins = (const struct hda_pintbl[]) {
11951 			{ 0x14, 0x99130110 }, /* speaker */
11952 			{ 0x12, 0x99a30970 }, /* int-mic */
11953 			{ 0x15, 0x01214020 }, /* HP */
11954 			{ 0x17, 0x99130111 }, /* speaker */
11955 			{ 0x18, 0x01a19840 }, /* mic */
11956 			{ 0x21, 0x0121401f }, /* HP */
11957 			{ }
11958 		},
11959 		.chained = true,
11960 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11961 	},
11962 	[ALC662_FIXUP_NO_JACK_DETECT] = {
11963 		.type = HDA_FIXUP_FUNC,
11964 		.v.func = alc_fixup_no_jack_detect,
11965 	},
11966 	[ALC662_FIXUP_ZOTAC_Z68] = {
11967 		.type = HDA_FIXUP_PINS,
11968 		.v.pins = (const struct hda_pintbl[]) {
11969 			{ 0x1b, 0x02214020 }, /* Front HP */
11970 			{ }
11971 		}
11972 	},
11973 	[ALC662_FIXUP_INV_DMIC] = {
11974 		.type = HDA_FIXUP_FUNC,
11975 		.v.func = alc_fixup_inv_dmic,
11976 	},
11977 	[ALC668_FIXUP_DELL_XPS13] = {
11978 		.type = HDA_FIXUP_FUNC,
11979 		.v.func = alc_fixup_dell_xps13,
11980 		.chained = true,
11981 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11982 	},
11983 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11984 		.type = HDA_FIXUP_FUNC,
11985 		.v.func = alc_fixup_disable_aamix,
11986 		.chained = true,
11987 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11988 	},
11989 	[ALC668_FIXUP_AUTO_MUTE] = {
11990 		.type = HDA_FIXUP_FUNC,
11991 		.v.func = alc_fixup_auto_mute_via_amp,
11992 		.chained = true,
11993 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11994 	},
11995 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11996 		.type = HDA_FIXUP_PINS,
11997 		.v.pins = (const struct hda_pintbl[]) {
11998 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11999 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12000 			{ }
12001 		},
12002 		.chained = true,
12003 		.chain_id = ALC662_FIXUP_HEADSET_MODE
12004 	},
12005 	[ALC662_FIXUP_HEADSET_MODE] = {
12006 		.type = HDA_FIXUP_FUNC,
12007 		.v.func = alc_fixup_headset_mode_alc662,
12008 	},
12009 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12010 		.type = HDA_FIXUP_PINS,
12011 		.v.pins = (const struct hda_pintbl[]) {
12012 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12013 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12014 			{ }
12015 		},
12016 		.chained = true,
12017 		.chain_id = ALC668_FIXUP_HEADSET_MODE
12018 	},
12019 	[ALC668_FIXUP_HEADSET_MODE] = {
12020 		.type = HDA_FIXUP_FUNC,
12021 		.v.func = alc_fixup_headset_mode_alc668,
12022 	},
12023 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12024 		.type = HDA_FIXUP_FUNC,
12025 		.v.func = alc_fixup_bass_chmap,
12026 		.chained = true,
12027 		.chain_id = ALC662_FIXUP_ASUS_MODE4
12028 	},
12029 	[ALC662_FIXUP_BASS_16] = {
12030 		.type = HDA_FIXUP_PINS,
12031 		.v.pins = (const struct hda_pintbl[]) {
12032 			{0x16, 0x80106111}, /* bass speaker */
12033 			{}
12034 		},
12035 		.chained = true,
12036 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12037 	},
12038 	[ALC662_FIXUP_BASS_1A] = {
12039 		.type = HDA_FIXUP_PINS,
12040 		.v.pins = (const struct hda_pintbl[]) {
12041 			{0x1a, 0x80106111}, /* bass speaker */
12042 			{}
12043 		},
12044 		.chained = true,
12045 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12046 	},
12047 	[ALC662_FIXUP_BASS_CHMAP] = {
12048 		.type = HDA_FIXUP_FUNC,
12049 		.v.func = alc_fixup_bass_chmap,
12050 	},
12051 	[ALC662_FIXUP_ASUS_Nx50] = {
12052 		.type = HDA_FIXUP_FUNC,
12053 		.v.func = alc_fixup_auto_mute_via_amp,
12054 		.chained = true,
12055 		.chain_id = ALC662_FIXUP_BASS_1A
12056 	},
12057 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12058 		.type = HDA_FIXUP_FUNC,
12059 		.v.func = alc_fixup_headset_mode_alc668,
12060 		.chain_id = ALC662_FIXUP_BASS_CHMAP
12061 	},
12062 	[ALC668_FIXUP_ASUS_Nx51] = {
12063 		.type = HDA_FIXUP_PINS,
12064 		.v.pins = (const struct hda_pintbl[]) {
12065 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12066 			{ 0x1a, 0x90170151 }, /* bass speaker */
12067 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12068 			{}
12069 		},
12070 		.chained = true,
12071 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12072 	},
12073 	[ALC668_FIXUP_MIC_COEF] = {
12074 		.type = HDA_FIXUP_VERBS,
12075 		.v.verbs = (const struct hda_verb[]) {
12076 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12077 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12078 			{}
12079 		},
12080 	},
12081 	[ALC668_FIXUP_ASUS_G751] = {
12082 		.type = HDA_FIXUP_PINS,
12083 		.v.pins = (const struct hda_pintbl[]) {
12084 			{ 0x16, 0x0421101f }, /* HP */
12085 			{}
12086 		},
12087 		.chained = true,
12088 		.chain_id = ALC668_FIXUP_MIC_COEF
12089 	},
12090 	[ALC891_FIXUP_HEADSET_MODE] = {
12091 		.type = HDA_FIXUP_FUNC,
12092 		.v.func = alc_fixup_headset_mode,
12093 	},
12094 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12095 		.type = HDA_FIXUP_PINS,
12096 		.v.pins = (const struct hda_pintbl[]) {
12097 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12098 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12099 			{ }
12100 		},
12101 		.chained = true,
12102 		.chain_id = ALC891_FIXUP_HEADSET_MODE
12103 	},
12104 	[ALC662_FIXUP_ACER_VERITON] = {
12105 		.type = HDA_FIXUP_PINS,
12106 		.v.pins = (const struct hda_pintbl[]) {
12107 			{ 0x15, 0x50170120 }, /* no internal speaker */
12108 			{ }
12109 		}
12110 	},
12111 	[ALC892_FIXUP_ASROCK_MOBO] = {
12112 		.type = HDA_FIXUP_PINS,
12113 		.v.pins = (const struct hda_pintbl[]) {
12114 			{ 0x15, 0x40f000f0 }, /* disabled */
12115 			{ 0x16, 0x40f000f0 }, /* disabled */
12116 			{ }
12117 		}
12118 	},
12119 	[ALC662_FIXUP_USI_FUNC] = {
12120 		.type = HDA_FIXUP_FUNC,
12121 		.v.func = alc662_fixup_usi_headset_mic,
12122 	},
12123 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
12124 		.type = HDA_FIXUP_PINS,
12125 		.v.pins = (const struct hda_pintbl[]) {
12126 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12127 			{ 0x18, 0x01a1903d },
12128 			{ }
12129 		},
12130 		.chained = true,
12131 		.chain_id = ALC662_FIXUP_USI_FUNC
12132 	},
12133 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12134 		.type = HDA_FIXUP_FUNC,
12135 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12136 	},
12137 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12138 		.type = HDA_FIXUP_FUNC,
12139 		.v.func = alc662_fixup_aspire_ethos_hp,
12140 	},
12141 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12142 		.type = HDA_FIXUP_PINS,
12143 		.v.pins = (const struct hda_pintbl[]) {
12144 			{ 0x15, 0x92130110 }, /* front speakers */
12145 			{ 0x18, 0x99130111 }, /* center/subwoofer */
12146 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
12147 			{ }
12148 		},
12149 		.chained = true,
12150 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12151 	},
12152 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
12153 		.type = HDA_FIXUP_FUNC,
12154 		.v.func = alc671_fixup_hp_headset_mic2,
12155 	},
12156 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12157 		.type = HDA_FIXUP_PINS,
12158 		.v.pins = (const struct hda_pintbl[]) {
12159 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12160 			{ }
12161 		},
12162 		.chained = true,
12163 		.chain_id = ALC662_FIXUP_USI_FUNC
12164 	},
12165 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12166 		.type = HDA_FIXUP_PINS,
12167 		.v.pins = (const struct hda_pintbl[]) {
12168 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12169 			{ 0x1b, 0x0221144f },
12170 			{ }
12171 		},
12172 		.chained = true,
12173 		.chain_id = ALC662_FIXUP_USI_FUNC
12174 	},
12175 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12176 		.type = HDA_FIXUP_PINS,
12177 		.v.pins = (const struct hda_pintbl[]) {
12178 			{ 0x1b, 0x04a1112c },
12179 			{ }
12180 		},
12181 		.chained = true,
12182 		.chain_id = ALC668_FIXUP_HEADSET_MIC
12183 	},
12184 	[ALC668_FIXUP_HEADSET_MIC] = {
12185 		.type = HDA_FIXUP_FUNC,
12186 		.v.func = alc269_fixup_headset_mic,
12187 		.chained = true,
12188 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
12189 	},
12190 	[ALC668_FIXUP_MIC_DET_COEF] = {
12191 		.type = HDA_FIXUP_VERBS,
12192 		.v.verbs = (const struct hda_verb[]) {
12193 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12194 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12195 			{}
12196 		},
12197 	},
12198 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12199 		.type = HDA_FIXUP_FUNC,
12200 		.v.func = alc897_fixup_lenovo_headset_mic,
12201 	},
12202 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
12203 		.type = HDA_FIXUP_PINS,
12204 		.v.pins = (const struct hda_pintbl[]) {
12205 			{ 0x1a, 0x03a11050 },
12206 			{ }
12207 		},
12208 		.chained = true,
12209 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12210 	},
12211 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
12212 		.type = HDA_FIXUP_PINS,
12213 		.v.pins = (const struct hda_pintbl[]) {
12214 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12215 			{ }
12216 		},
12217 	},
12218 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12219 		.type = HDA_FIXUP_FUNC,
12220 		.v.func = alc897_fixup_lenovo_headset_mode,
12221 	},
12222 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12223 		.type = HDA_FIXUP_PINS,
12224 		.v.pins = (const struct hda_pintbl[]) {
12225 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12226 			{ }
12227 		},
12228 		.chained = true,
12229 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12230 	},
12231 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
12232 		.type = HDA_FIXUP_VERBS,
12233 		.v.verbs = (const struct hda_verb[]) {
12234 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12235 			{}
12236 		},
12237 	},
12238 	[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12239 		.type = HDA_FIXUP_PINS,
12240 		.v.pins = (const struct hda_pintbl[]) {
12241 			{ 0x19, 0x03a11050 }, /* use as headset mic */
12242 			{ }
12243 		},
12244 	},
12245 };
12246 
12247 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
12248 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12249 	SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12250 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12251 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12252 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12253 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12254 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12255 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12256 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12257 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12258 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12259 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12260 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12261 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12262 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12263 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12264 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12265 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12266 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12267 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12268 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12269 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12270 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12271 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12272 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12273 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12274 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12275 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12276 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12277 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12278 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12279 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12280 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12281 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12282 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12283 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12284 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12285 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12286 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12287 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12288 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12289 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12290 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12291 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12292 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12293 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12294 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12295 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12296 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12297 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12298 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12299 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12300 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12301 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12302 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12303 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12304 	SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12305 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12306 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12307 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12308 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12309 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12310 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12311 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12312 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12313 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12314 
12315 #if 0
12316 	/* Below is a quirk table taken from the old code.
12317 	 * Basically the device should work as is without the fixup table.
12318 	 * If BIOS doesn't give a proper info, enable the corresponding
12319 	 * fixup entry.
12320 	 */
12321 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12322 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12323 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12324 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12325 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12326 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12327 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12328 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12329 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12330 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12331 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12332 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12333 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12334 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12335 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12336 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12337 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12338 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12339 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12340 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12341 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12342 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12343 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12344 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12345 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12346 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12347 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12348 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12349 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12350 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12351 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12352 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12353 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12354 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12355 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12356 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12357 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12358 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12359 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12360 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12361 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12362 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12363 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12364 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12365 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12366 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12367 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12368 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12369 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12370 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12371 #endif
12372 	{}
12373 };
12374 
12375 static const struct hda_model_fixup alc662_fixup_models[] = {
12376 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12377 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12378 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
12379 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12380 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12381 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12382 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12383 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12384 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12385 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12386 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12387 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12388 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12389 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12390 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12391 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12392 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12393 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12394 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12395 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12396 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12397 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12398 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12399 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12400 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12401 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12402 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12403 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12404 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12405 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12406 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12407 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12408 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12409 	{}
12410 };
12411 
12412 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12413 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12414 		{0x17, 0x02211010},
12415 		{0x18, 0x01a19030},
12416 		{0x1a, 0x01813040},
12417 		{0x21, 0x01014020}),
12418 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12419 		{0x16, 0x01813030},
12420 		{0x17, 0x02211010},
12421 		{0x18, 0x01a19040},
12422 		{0x21, 0x01014020}),
12423 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12424 		{0x14, 0x01014010},
12425 		{0x18, 0x01a19020},
12426 		{0x1a, 0x0181302f},
12427 		{0x1b, 0x0221401f}),
12428 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12429 		{0x12, 0x99a30130},
12430 		{0x14, 0x90170110},
12431 		{0x15, 0x0321101f},
12432 		{0x16, 0x03011020}),
12433 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12434 		{0x12, 0x99a30140},
12435 		{0x14, 0x90170110},
12436 		{0x15, 0x0321101f},
12437 		{0x16, 0x03011020}),
12438 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12439 		{0x12, 0x99a30150},
12440 		{0x14, 0x90170110},
12441 		{0x15, 0x0321101f},
12442 		{0x16, 0x03011020}),
12443 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12444 		{0x14, 0x90170110},
12445 		{0x15, 0x0321101f},
12446 		{0x16, 0x03011020}),
12447 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12448 		{0x12, 0x90a60130},
12449 		{0x14, 0x90170110},
12450 		{0x15, 0x0321101f}),
12451 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12452 		{0x14, 0x01014010},
12453 		{0x17, 0x90170150},
12454 		{0x19, 0x02a11060},
12455 		{0x1b, 0x01813030},
12456 		{0x21, 0x02211020}),
12457 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12458 		{0x14, 0x01014010},
12459 		{0x18, 0x01a19040},
12460 		{0x1b, 0x01813030},
12461 		{0x21, 0x02211020}),
12462 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12463 		{0x14, 0x01014020},
12464 		{0x17, 0x90170110},
12465 		{0x18, 0x01a19050},
12466 		{0x1b, 0x01813040},
12467 		{0x21, 0x02211030}),
12468 	{}
12469 };
12470 
12471 /*
12472  */
12473 static int patch_alc662(struct hda_codec *codec)
12474 {
12475 	struct alc_spec *spec;
12476 	int err;
12477 
12478 	err = alc_alloc_spec(codec, 0x0b);
12479 	if (err < 0)
12480 		return err;
12481 
12482 	spec = codec->spec;
12483 
12484 	spec->shutup = alc_eapd_shutup;
12485 
12486 	/* handle multiple HPs as is */
12487 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12488 
12489 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
12490 
12491 	switch (codec->core.vendor_id) {
12492 	case 0x10ec0668:
12493 		spec->init_hook = alc668_restore_default_value;
12494 		break;
12495 	}
12496 
12497 	alc_pre_init(codec);
12498 
12499 	snd_hda_pick_fixup(codec, alc662_fixup_models,
12500 		       alc662_fixup_tbl, alc662_fixups);
12501 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
12502 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12503 
12504 	alc_auto_parse_customize_define(codec);
12505 
12506 	if (has_cdefine_beep(codec))
12507 		spec->gen.beep_nid = 0x01;
12508 
12509 	if ((alc_get_coef0(codec) & (1 << 14)) &&
12510 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
12511 	    spec->cdefine.platform_type == 1) {
12512 		err = alc_codec_rename(codec, "ALC272X");
12513 		if (err < 0)
12514 			goto error;
12515 	}
12516 
12517 	/* automatic parse from the BIOS config */
12518 	err = alc662_parse_auto_config(codec);
12519 	if (err < 0)
12520 		goto error;
12521 
12522 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
12523 		switch (codec->core.vendor_id) {
12524 		case 0x10ec0662:
12525 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12526 			break;
12527 		case 0x10ec0272:
12528 		case 0x10ec0663:
12529 		case 0x10ec0665:
12530 		case 0x10ec0668:
12531 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
12532 			break;
12533 		case 0x10ec0273:
12534 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
12535 			break;
12536 		}
12537 		if (err < 0)
12538 			goto error;
12539 	}
12540 
12541 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12542 
12543 	return 0;
12544 
12545  error:
12546 	alc_free(codec);
12547 	return err;
12548 }
12549 
12550 /*
12551  * ALC680 support
12552  */
12553 
12554 static int alc680_parse_auto_config(struct hda_codec *codec)
12555 {
12556 	return alc_parse_auto_config(codec, NULL, NULL);
12557 }
12558 
12559 /*
12560  */
12561 static int patch_alc680(struct hda_codec *codec)
12562 {
12563 	int err;
12564 
12565 	/* ALC680 has no aa-loopback mixer */
12566 	err = alc_alloc_spec(codec, 0);
12567 	if (err < 0)
12568 		return err;
12569 
12570 	/* automatic parse from the BIOS config */
12571 	err = alc680_parse_auto_config(codec);
12572 	if (err < 0) {
12573 		alc_free(codec);
12574 		return err;
12575 	}
12576 
12577 	return 0;
12578 }
12579 
12580 /*
12581  * patch entries
12582  */
12583 static const struct hda_device_id snd_hda_id_realtek[] = {
12584 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
12585 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
12586 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
12587 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
12588 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
12589 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12590 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
12591 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
12592 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
12593 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
12594 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
12595 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12596 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
12597 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
12598 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12599 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12600 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12601 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12602 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12603 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12604 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
12605 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
12606 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12607 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12608 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12609 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12610 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12611 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
12612 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
12613 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
12614 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
12615 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
12616 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
12617 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12618 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12619 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
12620 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
12621 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
12622 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
12623 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
12624 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
12625 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
12626 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12627 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12628 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12629 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12630 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12631 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12632 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12633 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12634 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12635 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12636 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12637 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12638 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12639 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
12640 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12641 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12642 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
12643 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
12644 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
12645 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12646 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12647 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12648 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12649 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12650 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12651 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12652 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12653 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12654 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12655 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
12656 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
12657 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12658 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
12659 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
12660 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
12661 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
12662 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
12663 	{} /* terminator */
12664 };
12665 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
12666 
12667 MODULE_LICENSE("GPL");
12668 MODULE_DESCRIPTION("Realtek HD-audio codec");
12669 
12670 static struct hda_codec_driver realtek_driver = {
12671 	.id = snd_hda_id_realtek,
12672 };
12673 
12674 module_hda_codec_driver(realtek_driver);
12675