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