xref: /linux/sound/pci/hda/patch_realtek.c (revision 235f0da3274690f540aa53fccf77d433e344e4b8)
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/acpi.h>
14 #include <linux/cleanup.h>
15 #include <linux/init.h>
16 #include <linux/delay.h>
17 #include <linux/slab.h>
18 #include <linux/pci.h>
19 #include <linux/dmi.h>
20 #include <linux/module.h>
21 #include <linux/i2c.h>
22 #include <linux/input.h>
23 #include <linux/leds.h>
24 #include <linux/ctype.h>
25 #include <linux/spi/spi.h>
26 #include <sound/core.h>
27 #include <sound/jack.h>
28 #include <sound/hda_codec.h>
29 #include "hda_local.h"
30 #include "hda_auto_parser.h"
31 #include "hda_jack.h"
32 #include "hda_generic.h"
33 #include "hda_component.h"
34 
35 /* keep halting ALC5505 DSP, for power saving */
36 #define HALT_REALTEK_ALC5505
37 
38 /* extra amp-initialization sequence types */
39 enum {
40 	ALC_INIT_UNDEFINED,
41 	ALC_INIT_NONE,
42 	ALC_INIT_DEFAULT,
43 };
44 
45 enum {
46 	ALC_HEADSET_MODE_UNKNOWN,
47 	ALC_HEADSET_MODE_UNPLUGGED,
48 	ALC_HEADSET_MODE_HEADSET,
49 	ALC_HEADSET_MODE_MIC,
50 	ALC_HEADSET_MODE_HEADPHONE,
51 };
52 
53 enum {
54 	ALC_HEADSET_TYPE_UNKNOWN,
55 	ALC_HEADSET_TYPE_CTIA,
56 	ALC_HEADSET_TYPE_OMTP,
57 };
58 
59 enum {
60 	ALC_KEY_MICMUTE_INDEX,
61 };
62 
63 struct alc_customize_define {
64 	unsigned int  sku_cfg;
65 	unsigned char port_connectivity;
66 	unsigned char check_sum;
67 	unsigned char customization;
68 	unsigned char external_amp;
69 	unsigned int  enable_pcbeep:1;
70 	unsigned int  platform_type:1;
71 	unsigned int  swap:1;
72 	unsigned int  override:1;
73 	unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
74 };
75 
76 struct alc_coef_led {
77 	unsigned int idx;
78 	unsigned int mask;
79 	unsigned int on;
80 	unsigned int off;
81 };
82 
83 struct alc_spec {
84 	struct hda_gen_spec gen; /* must be at head */
85 
86 	/* codec parameterization */
87 	struct alc_customize_define cdefine;
88 	unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
89 
90 	/* GPIO bits */
91 	unsigned int gpio_mask;
92 	unsigned int gpio_dir;
93 	unsigned int gpio_data;
94 	bool gpio_write_delay;	/* add a delay before writing gpio_data */
95 
96 	/* mute LED for HP laptops, see vref_mute_led_set() */
97 	int mute_led_polarity;
98 	int micmute_led_polarity;
99 	hda_nid_t mute_led_nid;
100 	hda_nid_t cap_mute_led_nid;
101 
102 	unsigned int gpio_mute_led_mask;
103 	unsigned int gpio_mic_led_mask;
104 	struct alc_coef_led mute_led_coef;
105 	struct alc_coef_led mic_led_coef;
106 	struct mutex coef_mutex;
107 
108 	hda_nid_t headset_mic_pin;
109 	hda_nid_t headphone_mic_pin;
110 	int current_headset_mode;
111 	int current_headset_type;
112 
113 	/* hooks */
114 	void (*init_hook)(struct hda_codec *codec);
115 	void (*power_hook)(struct hda_codec *codec);
116 	void (*shutup)(struct hda_codec *codec);
117 
118 	int init_amp;
119 	int codec_variant;	/* flag for other variants */
120 	unsigned int has_alc5505_dsp:1;
121 	unsigned int no_depop_delay:1;
122 	unsigned int done_hp_init:1;
123 	unsigned int no_shutup_pins:1;
124 	unsigned int ultra_low_power:1;
125 	unsigned int has_hs_key:1;
126 	unsigned int no_internal_mic_pin:1;
127 	unsigned int en_3kpull_low:1;
128 
129 	/* for PLL fix */
130 	hda_nid_t pll_nid;
131 	unsigned int pll_coef_idx, pll_coef_bit;
132 	unsigned int coef0;
133 	struct input_dev *kb_dev;
134 	u8 alc_mute_keycode_map[1];
135 
136 	/* component binding */
137 	struct hda_component_parent comps;
138 };
139 
140 /*
141  * COEF access helper functions
142  */
143 
144 static void coef_mutex_lock(struct hda_codec *codec)
145 {
146 	struct alc_spec *spec = codec->spec;
147 
148 	snd_hda_power_up_pm(codec);
149 	mutex_lock(&spec->coef_mutex);
150 }
151 
152 static void coef_mutex_unlock(struct hda_codec *codec)
153 {
154 	struct alc_spec *spec = codec->spec;
155 
156 	mutex_unlock(&spec->coef_mutex);
157 	snd_hda_power_down_pm(codec);
158 }
159 
160 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
161 				 unsigned int coef_idx)
162 {
163 	unsigned int val;
164 
165 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
166 	val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
167 	return val;
168 }
169 
170 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
171 			       unsigned int coef_idx)
172 {
173 	unsigned int val;
174 
175 	coef_mutex_lock(codec);
176 	val = __alc_read_coefex_idx(codec, nid, coef_idx);
177 	coef_mutex_unlock(codec);
178 	return val;
179 }
180 
181 #define alc_read_coef_idx(codec, coef_idx) \
182 	alc_read_coefex_idx(codec, 0x20, coef_idx)
183 
184 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
185 				   unsigned int coef_idx, unsigned int coef_val)
186 {
187 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
188 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
189 }
190 
191 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
192 				 unsigned int coef_idx, unsigned int coef_val)
193 {
194 	coef_mutex_lock(codec);
195 	__alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
196 	coef_mutex_unlock(codec);
197 }
198 
199 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
200 	alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
201 
202 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
203 				    unsigned int coef_idx, unsigned int mask,
204 				    unsigned int bits_set)
205 {
206 	unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
207 
208 	if (val != -1)
209 		__alc_write_coefex_idx(codec, nid, coef_idx,
210 				       (val & ~mask) | bits_set);
211 }
212 
213 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
214 				  unsigned int coef_idx, unsigned int mask,
215 				  unsigned int bits_set)
216 {
217 	coef_mutex_lock(codec);
218 	__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
219 	coef_mutex_unlock(codec);
220 }
221 
222 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set)	\
223 	alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
224 
225 /* a special bypass for COEF 0; read the cached value at the second time */
226 static unsigned int alc_get_coef0(struct hda_codec *codec)
227 {
228 	struct alc_spec *spec = codec->spec;
229 
230 	if (!spec->coef0)
231 		spec->coef0 = alc_read_coef_idx(codec, 0);
232 	return spec->coef0;
233 }
234 
235 /* coef writes/updates batch */
236 struct coef_fw {
237 	unsigned char nid;
238 	unsigned char idx;
239 	unsigned short mask;
240 	unsigned short val;
241 };
242 
243 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
244 	{ .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
245 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
246 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
247 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
248 
249 static void alc_process_coef_fw(struct hda_codec *codec,
250 				const struct coef_fw *fw)
251 {
252 	coef_mutex_lock(codec);
253 	for (; fw->nid; fw++) {
254 		if (fw->mask == (unsigned short)-1)
255 			__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
256 		else
257 			__alc_update_coefex_idx(codec, fw->nid, fw->idx,
258 						fw->mask, fw->val);
259 	}
260 	coef_mutex_unlock(codec);
261 }
262 
263 /*
264  * GPIO setup tables, used in initialization
265  */
266 
267 /* Enable GPIO mask and set output */
268 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
269 {
270 	struct alc_spec *spec = codec->spec;
271 
272 	spec->gpio_mask |= mask;
273 	spec->gpio_dir |= mask;
274 	spec->gpio_data |= mask;
275 }
276 
277 static void alc_write_gpio_data(struct hda_codec *codec)
278 {
279 	struct alc_spec *spec = codec->spec;
280 
281 	snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
282 			    spec->gpio_data);
283 }
284 
285 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
286 				 bool on)
287 {
288 	struct alc_spec *spec = codec->spec;
289 	unsigned int oldval = spec->gpio_data;
290 
291 	if (on)
292 		spec->gpio_data |= mask;
293 	else
294 		spec->gpio_data &= ~mask;
295 	if (oldval != spec->gpio_data)
296 		alc_write_gpio_data(codec);
297 }
298 
299 static void alc_write_gpio(struct hda_codec *codec)
300 {
301 	struct alc_spec *spec = codec->spec;
302 
303 	if (!spec->gpio_mask)
304 		return;
305 
306 	snd_hda_codec_write(codec, codec->core.afg, 0,
307 			    AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
308 	snd_hda_codec_write(codec, codec->core.afg, 0,
309 			    AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
310 	if (spec->gpio_write_delay)
311 		msleep(1);
312 	alc_write_gpio_data(codec);
313 }
314 
315 static void alc_fixup_gpio(struct hda_codec *codec, int action,
316 			   unsigned int mask)
317 {
318 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
319 		alc_setup_gpio(codec, mask);
320 }
321 
322 static void alc_fixup_gpio1(struct hda_codec *codec,
323 			    const struct hda_fixup *fix, int action)
324 {
325 	alc_fixup_gpio(codec, action, 0x01);
326 }
327 
328 static void alc_fixup_gpio2(struct hda_codec *codec,
329 			    const struct hda_fixup *fix, int action)
330 {
331 	alc_fixup_gpio(codec, action, 0x02);
332 }
333 
334 static void alc_fixup_gpio3(struct hda_codec *codec,
335 			    const struct hda_fixup *fix, int action)
336 {
337 	alc_fixup_gpio(codec, action, 0x03);
338 }
339 
340 static void alc_fixup_gpio4(struct hda_codec *codec,
341 			    const struct hda_fixup *fix, int action)
342 {
343 	alc_fixup_gpio(codec, action, 0x04);
344 }
345 
346 static void alc_fixup_micmute_led(struct hda_codec *codec,
347 				  const struct hda_fixup *fix, int action)
348 {
349 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
350 		snd_hda_gen_add_micmute_led_cdev(codec, NULL);
351 }
352 
353 /*
354  * Fix hardware PLL issue
355  * On some codecs, the analog PLL gating control must be off while
356  * the default value is 1.
357  */
358 static void alc_fix_pll(struct hda_codec *codec)
359 {
360 	struct alc_spec *spec = codec->spec;
361 
362 	if (spec->pll_nid)
363 		alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
364 				      1 << spec->pll_coef_bit, 0);
365 }
366 
367 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
368 			     unsigned int coef_idx, unsigned int coef_bit)
369 {
370 	struct alc_spec *spec = codec->spec;
371 	spec->pll_nid = nid;
372 	spec->pll_coef_idx = coef_idx;
373 	spec->pll_coef_bit = coef_bit;
374 	alc_fix_pll(codec);
375 }
376 
377 /* update the master volume per volume-knob's unsol event */
378 static void alc_update_knob_master(struct hda_codec *codec,
379 				   struct hda_jack_callback *jack)
380 {
381 	unsigned int val;
382 	struct snd_kcontrol *kctl;
383 	struct snd_ctl_elem_value *uctl;
384 
385 	kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
386 	if (!kctl)
387 		return;
388 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
389 	if (!uctl)
390 		return;
391 	val = snd_hda_codec_read(codec, jack->nid, 0,
392 				 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
393 	val &= HDA_AMP_VOLMASK;
394 	uctl->value.integer.value[0] = val;
395 	uctl->value.integer.value[1] = val;
396 	kctl->put(kctl, uctl);
397 	kfree(uctl);
398 }
399 
400 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
401 {
402 	/* For some reason, the res given from ALC880 is broken.
403 	   Here we adjust it properly. */
404 	snd_hda_jack_unsol_event(codec, res >> 2);
405 }
406 
407 /* Change EAPD to verb control */
408 static void alc_fill_eapd_coef(struct hda_codec *codec)
409 {
410 	int coef;
411 
412 	coef = alc_get_coef0(codec);
413 
414 	switch (codec->core.vendor_id) {
415 	case 0x10ec0262:
416 		alc_update_coef_idx(codec, 0x7, 0, 1<<5);
417 		break;
418 	case 0x10ec0267:
419 	case 0x10ec0268:
420 		alc_update_coef_idx(codec, 0x7, 0, 1<<13);
421 		break;
422 	case 0x10ec0269:
423 		if ((coef & 0x00f0) == 0x0010)
424 			alc_update_coef_idx(codec, 0xd, 0, 1<<14);
425 		if ((coef & 0x00f0) == 0x0020)
426 			alc_update_coef_idx(codec, 0x4, 1<<15, 0);
427 		if ((coef & 0x00f0) == 0x0030)
428 			alc_update_coef_idx(codec, 0x10, 1<<9, 0);
429 		break;
430 	case 0x10ec0280:
431 	case 0x10ec0284:
432 	case 0x10ec0290:
433 	case 0x10ec0292:
434 		alc_update_coef_idx(codec, 0x4, 1<<15, 0);
435 		break;
436 	case 0x10ec0225:
437 	case 0x10ec0295:
438 	case 0x10ec0299:
439 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
440 		fallthrough;
441 	case 0x10ec0215:
442 	case 0x10ec0285:
443 	case 0x10ec0289:
444 		alc_update_coef_idx(codec, 0x36, 1<<13, 0);
445 		fallthrough;
446 	case 0x10ec0230:
447 	case 0x10ec0233:
448 	case 0x10ec0235:
449 	case 0x10ec0236:
450 	case 0x10ec0245:
451 	case 0x10ec0255:
452 	case 0x10ec0256:
453 	case 0x19e58326:
454 	case 0x10ec0257:
455 	case 0x10ec0282:
456 	case 0x10ec0283:
457 	case 0x10ec0286:
458 	case 0x10ec0288:
459 	case 0x10ec0298:
460 	case 0x10ec0300:
461 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
462 		break;
463 	case 0x10ec0275:
464 		alc_update_coef_idx(codec, 0xe, 0, 1<<0);
465 		break;
466 	case 0x10ec0287:
467 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
468 		alc_write_coef_idx(codec, 0x8, 0x4ab7);
469 		break;
470 	case 0x10ec0293:
471 		alc_update_coef_idx(codec, 0xa, 1<<13, 0);
472 		break;
473 	case 0x10ec0234:
474 	case 0x10ec0274:
475 	case 0x10ec0294:
476 	case 0x10ec0700:
477 	case 0x10ec0701:
478 	case 0x10ec0703:
479 	case 0x10ec0711:
480 		alc_update_coef_idx(codec, 0x10, 1<<15, 0);
481 		break;
482 	case 0x10ec0662:
483 		if ((coef & 0x00f0) == 0x0030)
484 			alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
485 		break;
486 	case 0x10ec0272:
487 	case 0x10ec0273:
488 	case 0x10ec0663:
489 	case 0x10ec0665:
490 	case 0x10ec0670:
491 	case 0x10ec0671:
492 	case 0x10ec0672:
493 		alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
494 		break;
495 	case 0x10ec0222:
496 	case 0x10ec0623:
497 		alc_update_coef_idx(codec, 0x19, 1<<13, 0);
498 		break;
499 	case 0x10ec0668:
500 		alc_update_coef_idx(codec, 0x7, 3<<13, 0);
501 		break;
502 	case 0x10ec0867:
503 		alc_update_coef_idx(codec, 0x4, 1<<10, 0);
504 		break;
505 	case 0x10ec0888:
506 		if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
507 			alc_update_coef_idx(codec, 0x7, 1<<5, 0);
508 		break;
509 	case 0x10ec0892:
510 	case 0x10ec0897:
511 		alc_update_coef_idx(codec, 0x7, 1<<5, 0);
512 		break;
513 	case 0x10ec0899:
514 	case 0x10ec0900:
515 	case 0x10ec0b00:
516 	case 0x10ec1168:
517 	case 0x10ec1220:
518 		alc_update_coef_idx(codec, 0x7, 1<<1, 0);
519 		break;
520 	}
521 }
522 
523 /* additional initialization for ALC888 variants */
524 static void alc888_coef_init(struct hda_codec *codec)
525 {
526 	switch (alc_get_coef0(codec) & 0x00f0) {
527 	/* alc888-VA */
528 	case 0x00:
529 	/* alc888-VB */
530 	case 0x10:
531 		alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
532 		break;
533 	}
534 }
535 
536 /* turn on/off EAPD control (only if available) */
537 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
538 {
539 	if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
540 		return;
541 	if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
542 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
543 				    on ? 2 : 0);
544 }
545 
546 /* turn on/off EAPD controls of the codec */
547 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
548 {
549 	/* We currently only handle front, HP */
550 	static const hda_nid_t pins[] = {
551 		0x0f, 0x10, 0x14, 0x15, 0x17, 0
552 	};
553 	const hda_nid_t *p;
554 	for (p = pins; *p; p++)
555 		set_eapd(codec, *p, on);
556 }
557 
558 static int find_ext_mic_pin(struct hda_codec *codec);
559 
560 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
561 {
562 	const struct hda_pincfg *pin;
563 	int mic_pin = find_ext_mic_pin(codec);
564 	int i;
565 
566 	/* don't shut up pins when unloading the driver; otherwise it breaks
567 	 * the default pin setup at the next load of the driver
568 	 */
569 	if (codec->bus->shutdown)
570 		return;
571 
572 	snd_array_for_each(&codec->init_pins, i, pin) {
573 		/* use read here for syncing after issuing each verb */
574 		if (pin->nid != mic_pin)
575 			snd_hda_codec_read(codec, pin->nid, 0,
576 					AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
577 	}
578 
579 	codec->pins_shutup = 1;
580 }
581 
582 static void alc_shutup_pins(struct hda_codec *codec)
583 {
584 	struct alc_spec *spec = codec->spec;
585 
586 	switch (codec->core.vendor_id) {
587 	case 0x10ec0236:
588 	case 0x10ec0256:
589 	case 0x19e58326:
590 	case 0x10ec0283:
591 	case 0x10ec0285:
592 	case 0x10ec0286:
593 	case 0x10ec0287:
594 	case 0x10ec0288:
595 	case 0x10ec0295:
596 	case 0x10ec0298:
597 		alc_headset_mic_no_shutup(codec);
598 		break;
599 	default:
600 		if (!spec->no_shutup_pins)
601 			snd_hda_shutup_pins(codec);
602 		break;
603 	}
604 }
605 
606 /* generic shutup callback;
607  * just turning off EAPD and a little pause for avoiding pop-noise
608  */
609 static void alc_eapd_shutup(struct hda_codec *codec)
610 {
611 	struct alc_spec *spec = codec->spec;
612 
613 	alc_auto_setup_eapd(codec, false);
614 	if (!spec->no_depop_delay)
615 		msleep(200);
616 	alc_shutup_pins(codec);
617 }
618 
619 /* generic EAPD initialization */
620 static void alc_auto_init_amp(struct hda_codec *codec, int type)
621 {
622 	alc_auto_setup_eapd(codec, true);
623 	alc_write_gpio(codec);
624 	switch (type) {
625 	case ALC_INIT_DEFAULT:
626 		switch (codec->core.vendor_id) {
627 		case 0x10ec0260:
628 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
629 			break;
630 		case 0x10ec0880:
631 		case 0x10ec0882:
632 		case 0x10ec0883:
633 		case 0x10ec0885:
634 			alc_update_coef_idx(codec, 7, 0, 0x2030);
635 			break;
636 		case 0x10ec0888:
637 			alc888_coef_init(codec);
638 			break;
639 		}
640 		break;
641 	}
642 }
643 
644 /* get a primary headphone pin if available */
645 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
646 {
647 	if (spec->gen.autocfg.hp_pins[0])
648 		return spec->gen.autocfg.hp_pins[0];
649 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
650 		return spec->gen.autocfg.line_out_pins[0];
651 	return 0;
652 }
653 
654 /*
655  * Realtek SSID verification
656  */
657 
658 /* Could be any non-zero and even value. When used as fixup, tells
659  * the driver to ignore any present sku defines.
660  */
661 #define ALC_FIXUP_SKU_IGNORE (2)
662 
663 static void alc_fixup_sku_ignore(struct hda_codec *codec,
664 				 const struct hda_fixup *fix, int action)
665 {
666 	struct alc_spec *spec = codec->spec;
667 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
668 		spec->cdefine.fixup = 1;
669 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
670 	}
671 }
672 
673 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
674 				    const struct hda_fixup *fix, int action)
675 {
676 	struct alc_spec *spec = codec->spec;
677 
678 	if (action == HDA_FIXUP_ACT_PROBE) {
679 		spec->no_depop_delay = 1;
680 		codec->depop_delay = 0;
681 	}
682 }
683 
684 static int alc_auto_parse_customize_define(struct hda_codec *codec)
685 {
686 	unsigned int ass, tmp, i;
687 	unsigned nid = 0;
688 	struct alc_spec *spec = codec->spec;
689 
690 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
691 
692 	if (spec->cdefine.fixup) {
693 		ass = spec->cdefine.sku_cfg;
694 		if (ass == ALC_FIXUP_SKU_IGNORE)
695 			return -1;
696 		goto do_sku;
697 	}
698 
699 	if (!codec->bus->pci)
700 		return -1;
701 	ass = codec->core.subsystem_id & 0xffff;
702 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
703 		goto do_sku;
704 
705 	nid = 0x1d;
706 	if (codec->core.vendor_id == 0x10ec0260)
707 		nid = 0x17;
708 	ass = snd_hda_codec_get_pincfg(codec, nid);
709 
710 	if (!(ass & 1)) {
711 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
712 			   codec->core.chip_name, ass);
713 		return -1;
714 	}
715 
716 	/* check sum */
717 	tmp = 0;
718 	for (i = 1; i < 16; i++) {
719 		if ((ass >> i) & 1)
720 			tmp++;
721 	}
722 	if (((ass >> 16) & 0xf) != tmp)
723 		return -1;
724 
725 	spec->cdefine.port_connectivity = ass >> 30;
726 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
727 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
728 	spec->cdefine.customization = ass >> 8;
729 do_sku:
730 	spec->cdefine.sku_cfg = ass;
731 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
732 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
733 	spec->cdefine.swap = (ass & 0x2) >> 1;
734 	spec->cdefine.override = ass & 0x1;
735 
736 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
737 		   nid, spec->cdefine.sku_cfg);
738 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
739 		   spec->cdefine.port_connectivity);
740 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
741 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
742 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
743 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
744 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
745 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
746 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
747 
748 	return 0;
749 }
750 
751 /* return the position of NID in the list, or -1 if not found */
752 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
753 {
754 	int i;
755 	for (i = 0; i < nums; i++)
756 		if (list[i] == nid)
757 			return i;
758 	return -1;
759 }
760 /* return true if the given NID is found in the list */
761 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
762 {
763 	return find_idx_in_nid_list(nid, list, nums) >= 0;
764 }
765 
766 /* check subsystem ID and set up device-specific initialization;
767  * return 1 if initialized, 0 if invalid SSID
768  */
769 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
770  *	31 ~ 16 :	Manufacture ID
771  *	15 ~ 8	:	SKU ID
772  *	7  ~ 0	:	Assembly ID
773  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
774  */
775 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
776 {
777 	unsigned int ass, tmp, i;
778 	unsigned nid;
779 	struct alc_spec *spec = codec->spec;
780 
781 	if (spec->cdefine.fixup) {
782 		ass = spec->cdefine.sku_cfg;
783 		if (ass == ALC_FIXUP_SKU_IGNORE)
784 			return 0;
785 		goto do_sku;
786 	}
787 
788 	ass = codec->core.subsystem_id & 0xffff;
789 	if (codec->bus->pci &&
790 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
791 		goto do_sku;
792 
793 	/* invalid SSID, check the special NID pin defcfg instead */
794 	/*
795 	 * 31~30	: port connectivity
796 	 * 29~21	: reserve
797 	 * 20		: PCBEEP input
798 	 * 19~16	: Check sum (15:1)
799 	 * 15~1		: Custom
800 	 * 0		: override
801 	*/
802 	nid = 0x1d;
803 	if (codec->core.vendor_id == 0x10ec0260)
804 		nid = 0x17;
805 	ass = snd_hda_codec_get_pincfg(codec, nid);
806 	codec_dbg(codec,
807 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
808 		   ass, nid);
809 	if (!(ass & 1))
810 		return 0;
811 	if ((ass >> 30) != 1)	/* no physical connection */
812 		return 0;
813 
814 	/* check sum */
815 	tmp = 0;
816 	for (i = 1; i < 16; i++) {
817 		if ((ass >> i) & 1)
818 			tmp++;
819 	}
820 	if (((ass >> 16) & 0xf) != tmp)
821 		return 0;
822 do_sku:
823 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
824 		   ass & 0xffff, codec->core.vendor_id);
825 	/*
826 	 * 0 : override
827 	 * 1 :	Swap Jack
828 	 * 2 : 0 --> Desktop, 1 --> Laptop
829 	 * 3~5 : External Amplifier control
830 	 * 7~6 : Reserved
831 	*/
832 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
833 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
834 		switch (tmp) {
835 		case 1:
836 			alc_setup_gpio(codec, 0x01);
837 			break;
838 		case 3:
839 			alc_setup_gpio(codec, 0x02);
840 			break;
841 		case 7:
842 			alc_setup_gpio(codec, 0x04);
843 			break;
844 		case 5:
845 		default:
846 			spec->init_amp = ALC_INIT_DEFAULT;
847 			break;
848 		}
849 	}
850 
851 	/* is laptop or Desktop and enable the function "Mute internal speaker
852 	 * when the external headphone out jack is plugged"
853 	 */
854 	if (!(ass & 0x8000))
855 		return 1;
856 	/*
857 	 * 10~8 : Jack location
858 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
859 	 * 14~13: Resvered
860 	 * 15   : 1 --> enable the function "Mute internal speaker
861 	 *	        when the external headphone out jack is plugged"
862 	 */
863 	if (!alc_get_hp_pin(spec)) {
864 		hda_nid_t nid;
865 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
866 		nid = ports[tmp];
867 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
868 				      spec->gen.autocfg.line_outs))
869 			return 1;
870 		spec->gen.autocfg.hp_pins[0] = nid;
871 	}
872 	return 1;
873 }
874 
875 /* Check the validity of ALC subsystem-id
876  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
877 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
878 {
879 	if (!alc_subsystem_id(codec, ports)) {
880 		struct alc_spec *spec = codec->spec;
881 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
882 			codec_dbg(codec,
883 				  "realtek: Enable default setup for auto mode as fallback\n");
884 			spec->init_amp = ALC_INIT_DEFAULT;
885 		}
886 	}
887 }
888 
889 /*
890  */
891 
892 static void alc_fixup_inv_dmic(struct hda_codec *codec,
893 			       const struct hda_fixup *fix, int action)
894 {
895 	struct alc_spec *spec = codec->spec;
896 
897 	spec->gen.inv_dmic_split = 1;
898 }
899 
900 
901 static int alc_build_controls(struct hda_codec *codec)
902 {
903 	int err;
904 
905 	err = snd_hda_gen_build_controls(codec);
906 	if (err < 0)
907 		return err;
908 
909 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
910 	return 0;
911 }
912 
913 
914 /*
915  * Common callbacks
916  */
917 
918 static void alc_pre_init(struct hda_codec *codec)
919 {
920 	alc_fill_eapd_coef(codec);
921 }
922 
923 #define is_s3_resume(codec) \
924 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
925 #define is_s4_resume(codec) \
926 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
927 #define is_s4_suspend(codec) \
928 	((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
929 
930 static int alc_init(struct hda_codec *codec)
931 {
932 	struct alc_spec *spec = codec->spec;
933 
934 	/* hibernation resume needs the full chip initialization */
935 	if (is_s4_resume(codec))
936 		alc_pre_init(codec);
937 
938 	if (spec->init_hook)
939 		spec->init_hook(codec);
940 
941 	spec->gen.skip_verbs = 1; /* applied in below */
942 	snd_hda_gen_init(codec);
943 	alc_fix_pll(codec);
944 	alc_auto_init_amp(codec, spec->init_amp);
945 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
946 
947 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
948 
949 	return 0;
950 }
951 
952 #define alc_free	snd_hda_gen_free
953 
954 static inline void alc_shutup(struct hda_codec *codec)
955 {
956 	struct alc_spec *spec = codec->spec;
957 
958 	if (!snd_hda_get_bool_hint(codec, "shutup"))
959 		return; /* disabled explicitly by hints */
960 
961 	if (spec && spec->shutup)
962 		spec->shutup(codec);
963 	else
964 		alc_shutup_pins(codec);
965 }
966 
967 static void alc_power_eapd(struct hda_codec *codec)
968 {
969 	alc_auto_setup_eapd(codec, false);
970 }
971 
972 static int alc_suspend(struct hda_codec *codec)
973 {
974 	struct alc_spec *spec = codec->spec;
975 	alc_shutup(codec);
976 	if (spec && spec->power_hook)
977 		spec->power_hook(codec);
978 	return 0;
979 }
980 
981 static int alc_resume(struct hda_codec *codec)
982 {
983 	struct alc_spec *spec = codec->spec;
984 
985 	if (!spec->no_depop_delay)
986 		msleep(150); /* to avoid pop noise */
987 	codec->patch_ops.init(codec);
988 	snd_hda_regmap_sync(codec);
989 	hda_call_check_power_status(codec, 0x01);
990 	return 0;
991 }
992 
993 /*
994  */
995 static const struct hda_codec_ops alc_patch_ops = {
996 	.build_controls = alc_build_controls,
997 	.build_pcms = snd_hda_gen_build_pcms,
998 	.init = alc_init,
999 	.free = alc_free,
1000 	.unsol_event = snd_hda_jack_unsol_event,
1001 	.resume = alc_resume,
1002 	.suspend = alc_suspend,
1003 	.check_power_status = snd_hda_gen_check_power_status,
1004 };
1005 
1006 
1007 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1008 
1009 /*
1010  * Rename codecs appropriately from COEF value or subvendor id
1011  */
1012 struct alc_codec_rename_table {
1013 	unsigned int vendor_id;
1014 	unsigned short coef_mask;
1015 	unsigned short coef_bits;
1016 	const char *name;
1017 };
1018 
1019 struct alc_codec_rename_pci_table {
1020 	unsigned int codec_vendor_id;
1021 	unsigned short pci_subvendor;
1022 	unsigned short pci_subdevice;
1023 	const char *name;
1024 };
1025 
1026 static const struct alc_codec_rename_table rename_tbl[] = {
1027 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1028 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1029 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1030 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1031 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1032 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1033 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1034 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1035 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1036 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1037 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1038 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1039 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1040 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1041 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1042 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1043 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1044 	{ } /* terminator */
1045 };
1046 
1047 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1048 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1049 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1050 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1051 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1052 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1053 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1054 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1055 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1056 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1057 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1058 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1059 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1060 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1061 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1062 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1063 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1064 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1065 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1066 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1067 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1068 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1069 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1070 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1071 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1072 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1073 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1074 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1075 	{ } /* terminator */
1076 };
1077 
1078 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1079 {
1080 	const struct alc_codec_rename_table *p;
1081 	const struct alc_codec_rename_pci_table *q;
1082 
1083 	for (p = rename_tbl; p->vendor_id; p++) {
1084 		if (p->vendor_id != codec->core.vendor_id)
1085 			continue;
1086 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1087 			return alc_codec_rename(codec, p->name);
1088 	}
1089 
1090 	if (!codec->bus->pci)
1091 		return 0;
1092 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1093 		if (q->codec_vendor_id != codec->core.vendor_id)
1094 			continue;
1095 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1096 			continue;
1097 		if (!q->pci_subdevice ||
1098 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1099 			return alc_codec_rename(codec, q->name);
1100 	}
1101 
1102 	return 0;
1103 }
1104 
1105 
1106 /*
1107  * Digital-beep handlers
1108  */
1109 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1110 
1111 /* additional beep mixers; private_value will be overwritten */
1112 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1113 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1114 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1115 };
1116 
1117 /* set up and create beep controls */
1118 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1119 			int idx, int dir)
1120 {
1121 	struct snd_kcontrol_new *knew;
1122 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1123 	int i;
1124 
1125 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1126 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1127 					    &alc_beep_mixer[i]);
1128 		if (!knew)
1129 			return -ENOMEM;
1130 		knew->private_value = beep_amp;
1131 	}
1132 	return 0;
1133 }
1134 
1135 static const struct snd_pci_quirk beep_allow_list[] = {
1136 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1137 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1138 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1139 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1140 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1141 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1142 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1143 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1144 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1145 	/* denylist -- no beep available */
1146 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1147 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1148 	{}
1149 };
1150 
1151 static inline int has_cdefine_beep(struct hda_codec *codec)
1152 {
1153 	struct alc_spec *spec = codec->spec;
1154 	const struct snd_pci_quirk *q;
1155 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1156 	if (q)
1157 		return q->value;
1158 	return spec->cdefine.enable_pcbeep;
1159 }
1160 #else
1161 #define set_beep_amp(spec, nid, idx, dir)	0
1162 #define has_cdefine_beep(codec)		0
1163 #endif
1164 
1165 /* parse the BIOS configuration and set up the alc_spec */
1166 /* return 1 if successful, 0 if the proper config is not found,
1167  * or a negative error code
1168  */
1169 static int alc_parse_auto_config(struct hda_codec *codec,
1170 				 const hda_nid_t *ignore_nids,
1171 				 const hda_nid_t *ssid_nids)
1172 {
1173 	struct alc_spec *spec = codec->spec;
1174 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1175 	int err;
1176 
1177 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1178 				       spec->parse_flags);
1179 	if (err < 0)
1180 		return err;
1181 
1182 	if (ssid_nids)
1183 		alc_ssid_check(codec, ssid_nids);
1184 
1185 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1186 	if (err < 0)
1187 		return err;
1188 
1189 	return 1;
1190 }
1191 
1192 /* common preparation job for alc_spec */
1193 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1194 {
1195 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1196 	int err;
1197 
1198 	if (!spec)
1199 		return -ENOMEM;
1200 	codec->spec = spec;
1201 	snd_hda_gen_spec_init(&spec->gen);
1202 	spec->gen.mixer_nid = mixer_nid;
1203 	spec->gen.own_eapd_ctl = 1;
1204 	codec->single_adc_amp = 1;
1205 	/* FIXME: do we need this for all Realtek codec models? */
1206 	codec->spdif_status_reset = 1;
1207 	codec->forced_resume = 1;
1208 	codec->patch_ops = alc_patch_ops;
1209 	mutex_init(&spec->coef_mutex);
1210 
1211 	err = alc_codec_rename_from_preset(codec);
1212 	if (err < 0) {
1213 		kfree(spec);
1214 		return err;
1215 	}
1216 	return 0;
1217 }
1218 
1219 static int alc880_parse_auto_config(struct hda_codec *codec)
1220 {
1221 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1222 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1223 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1224 }
1225 
1226 /*
1227  * ALC880 fix-ups
1228  */
1229 enum {
1230 	ALC880_FIXUP_GPIO1,
1231 	ALC880_FIXUP_GPIO2,
1232 	ALC880_FIXUP_MEDION_RIM,
1233 	ALC880_FIXUP_LG,
1234 	ALC880_FIXUP_LG_LW25,
1235 	ALC880_FIXUP_W810,
1236 	ALC880_FIXUP_EAPD_COEF,
1237 	ALC880_FIXUP_TCL_S700,
1238 	ALC880_FIXUP_VOL_KNOB,
1239 	ALC880_FIXUP_FUJITSU,
1240 	ALC880_FIXUP_F1734,
1241 	ALC880_FIXUP_UNIWILL,
1242 	ALC880_FIXUP_UNIWILL_DIG,
1243 	ALC880_FIXUP_Z71V,
1244 	ALC880_FIXUP_ASUS_W5A,
1245 	ALC880_FIXUP_3ST_BASE,
1246 	ALC880_FIXUP_3ST,
1247 	ALC880_FIXUP_3ST_DIG,
1248 	ALC880_FIXUP_5ST_BASE,
1249 	ALC880_FIXUP_5ST,
1250 	ALC880_FIXUP_5ST_DIG,
1251 	ALC880_FIXUP_6ST_BASE,
1252 	ALC880_FIXUP_6ST,
1253 	ALC880_FIXUP_6ST_DIG,
1254 	ALC880_FIXUP_6ST_AUTOMUTE,
1255 };
1256 
1257 /* enable the volume-knob widget support on NID 0x21 */
1258 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1259 				  const struct hda_fixup *fix, int action)
1260 {
1261 	if (action == HDA_FIXUP_ACT_PROBE)
1262 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1263 						    alc_update_knob_master);
1264 }
1265 
1266 static const struct hda_fixup alc880_fixups[] = {
1267 	[ALC880_FIXUP_GPIO1] = {
1268 		.type = HDA_FIXUP_FUNC,
1269 		.v.func = alc_fixup_gpio1,
1270 	},
1271 	[ALC880_FIXUP_GPIO2] = {
1272 		.type = HDA_FIXUP_FUNC,
1273 		.v.func = alc_fixup_gpio2,
1274 	},
1275 	[ALC880_FIXUP_MEDION_RIM] = {
1276 		.type = HDA_FIXUP_VERBS,
1277 		.v.verbs = (const struct hda_verb[]) {
1278 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1279 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1280 			{ }
1281 		},
1282 		.chained = true,
1283 		.chain_id = ALC880_FIXUP_GPIO2,
1284 	},
1285 	[ALC880_FIXUP_LG] = {
1286 		.type = HDA_FIXUP_PINS,
1287 		.v.pins = (const struct hda_pintbl[]) {
1288 			/* disable bogus unused pins */
1289 			{ 0x16, 0x411111f0 },
1290 			{ 0x18, 0x411111f0 },
1291 			{ 0x1a, 0x411111f0 },
1292 			{ }
1293 		}
1294 	},
1295 	[ALC880_FIXUP_LG_LW25] = {
1296 		.type = HDA_FIXUP_PINS,
1297 		.v.pins = (const struct hda_pintbl[]) {
1298 			{ 0x1a, 0x0181344f }, /* line-in */
1299 			{ 0x1b, 0x0321403f }, /* headphone */
1300 			{ }
1301 		}
1302 	},
1303 	[ALC880_FIXUP_W810] = {
1304 		.type = HDA_FIXUP_PINS,
1305 		.v.pins = (const struct hda_pintbl[]) {
1306 			/* disable bogus unused pins */
1307 			{ 0x17, 0x411111f0 },
1308 			{ }
1309 		},
1310 		.chained = true,
1311 		.chain_id = ALC880_FIXUP_GPIO2,
1312 	},
1313 	[ALC880_FIXUP_EAPD_COEF] = {
1314 		.type = HDA_FIXUP_VERBS,
1315 		.v.verbs = (const struct hda_verb[]) {
1316 			/* change to EAPD mode */
1317 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1318 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1319 			{}
1320 		},
1321 	},
1322 	[ALC880_FIXUP_TCL_S700] = {
1323 		.type = HDA_FIXUP_VERBS,
1324 		.v.verbs = (const struct hda_verb[]) {
1325 			/* change to EAPD mode */
1326 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1327 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1328 			{}
1329 		},
1330 		.chained = true,
1331 		.chain_id = ALC880_FIXUP_GPIO2,
1332 	},
1333 	[ALC880_FIXUP_VOL_KNOB] = {
1334 		.type = HDA_FIXUP_FUNC,
1335 		.v.func = alc880_fixup_vol_knob,
1336 	},
1337 	[ALC880_FIXUP_FUJITSU] = {
1338 		/* override all pins as BIOS on old Amilo is broken */
1339 		.type = HDA_FIXUP_PINS,
1340 		.v.pins = (const struct hda_pintbl[]) {
1341 			{ 0x14, 0x0121401f }, /* HP */
1342 			{ 0x15, 0x99030120 }, /* speaker */
1343 			{ 0x16, 0x99030130 }, /* bass speaker */
1344 			{ 0x17, 0x411111f0 }, /* N/A */
1345 			{ 0x18, 0x411111f0 }, /* N/A */
1346 			{ 0x19, 0x01a19950 }, /* mic-in */
1347 			{ 0x1a, 0x411111f0 }, /* N/A */
1348 			{ 0x1b, 0x411111f0 }, /* N/A */
1349 			{ 0x1c, 0x411111f0 }, /* N/A */
1350 			{ 0x1d, 0x411111f0 }, /* N/A */
1351 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1352 			{ }
1353 		},
1354 		.chained = true,
1355 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1356 	},
1357 	[ALC880_FIXUP_F1734] = {
1358 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1359 		.type = HDA_FIXUP_PINS,
1360 		.v.pins = (const struct hda_pintbl[]) {
1361 			{ 0x14, 0x0121401f }, /* HP */
1362 			{ 0x15, 0x99030120 }, /* speaker */
1363 			{ 0x16, 0x411111f0 }, /* N/A */
1364 			{ 0x17, 0x411111f0 }, /* N/A */
1365 			{ 0x18, 0x411111f0 }, /* N/A */
1366 			{ 0x19, 0x01a19950 }, /* mic-in */
1367 			{ 0x1a, 0x411111f0 }, /* N/A */
1368 			{ 0x1b, 0x411111f0 }, /* N/A */
1369 			{ 0x1c, 0x411111f0 }, /* N/A */
1370 			{ 0x1d, 0x411111f0 }, /* N/A */
1371 			{ 0x1e, 0x411111f0 }, /* N/A */
1372 			{ }
1373 		},
1374 		.chained = true,
1375 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1376 	},
1377 	[ALC880_FIXUP_UNIWILL] = {
1378 		/* need to fix HP and speaker pins to be parsed correctly */
1379 		.type = HDA_FIXUP_PINS,
1380 		.v.pins = (const struct hda_pintbl[]) {
1381 			{ 0x14, 0x0121411f }, /* HP */
1382 			{ 0x15, 0x99030120 }, /* speaker */
1383 			{ 0x16, 0x99030130 }, /* bass speaker */
1384 			{ }
1385 		},
1386 	},
1387 	[ALC880_FIXUP_UNIWILL_DIG] = {
1388 		.type = HDA_FIXUP_PINS,
1389 		.v.pins = (const struct hda_pintbl[]) {
1390 			/* disable bogus unused pins */
1391 			{ 0x17, 0x411111f0 },
1392 			{ 0x19, 0x411111f0 },
1393 			{ 0x1b, 0x411111f0 },
1394 			{ 0x1f, 0x411111f0 },
1395 			{ }
1396 		}
1397 	},
1398 	[ALC880_FIXUP_Z71V] = {
1399 		.type = HDA_FIXUP_PINS,
1400 		.v.pins = (const struct hda_pintbl[]) {
1401 			/* set up the whole pins as BIOS is utterly broken */
1402 			{ 0x14, 0x99030120 }, /* speaker */
1403 			{ 0x15, 0x0121411f }, /* HP */
1404 			{ 0x16, 0x411111f0 }, /* N/A */
1405 			{ 0x17, 0x411111f0 }, /* N/A */
1406 			{ 0x18, 0x01a19950 }, /* mic-in */
1407 			{ 0x19, 0x411111f0 }, /* N/A */
1408 			{ 0x1a, 0x01813031 }, /* line-in */
1409 			{ 0x1b, 0x411111f0 }, /* N/A */
1410 			{ 0x1c, 0x411111f0 }, /* N/A */
1411 			{ 0x1d, 0x411111f0 }, /* N/A */
1412 			{ 0x1e, 0x0144111e }, /* SPDIF */
1413 			{ }
1414 		}
1415 	},
1416 	[ALC880_FIXUP_ASUS_W5A] = {
1417 		.type = HDA_FIXUP_PINS,
1418 		.v.pins = (const struct hda_pintbl[]) {
1419 			/* set up the whole pins as BIOS is utterly broken */
1420 			{ 0x14, 0x0121411f }, /* HP */
1421 			{ 0x15, 0x411111f0 }, /* N/A */
1422 			{ 0x16, 0x411111f0 }, /* N/A */
1423 			{ 0x17, 0x411111f0 }, /* N/A */
1424 			{ 0x18, 0x90a60160 }, /* mic */
1425 			{ 0x19, 0x411111f0 }, /* N/A */
1426 			{ 0x1a, 0x411111f0 }, /* N/A */
1427 			{ 0x1b, 0x411111f0 }, /* N/A */
1428 			{ 0x1c, 0x411111f0 }, /* N/A */
1429 			{ 0x1d, 0x411111f0 }, /* N/A */
1430 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1431 			{ }
1432 		},
1433 		.chained = true,
1434 		.chain_id = ALC880_FIXUP_GPIO1,
1435 	},
1436 	[ALC880_FIXUP_3ST_BASE] = {
1437 		.type = HDA_FIXUP_PINS,
1438 		.v.pins = (const struct hda_pintbl[]) {
1439 			{ 0x14, 0x01014010 }, /* line-out */
1440 			{ 0x15, 0x411111f0 }, /* N/A */
1441 			{ 0x16, 0x411111f0 }, /* N/A */
1442 			{ 0x17, 0x411111f0 }, /* N/A */
1443 			{ 0x18, 0x01a19c30 }, /* mic-in */
1444 			{ 0x19, 0x0121411f }, /* HP */
1445 			{ 0x1a, 0x01813031 }, /* line-in */
1446 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1447 			{ 0x1c, 0x411111f0 }, /* N/A */
1448 			{ 0x1d, 0x411111f0 }, /* N/A */
1449 			/* 0x1e is filled in below */
1450 			{ 0x1f, 0x411111f0 }, /* N/A */
1451 			{ }
1452 		}
1453 	},
1454 	[ALC880_FIXUP_3ST] = {
1455 		.type = HDA_FIXUP_PINS,
1456 		.v.pins = (const struct hda_pintbl[]) {
1457 			{ 0x1e, 0x411111f0 }, /* N/A */
1458 			{ }
1459 		},
1460 		.chained = true,
1461 		.chain_id = ALC880_FIXUP_3ST_BASE,
1462 	},
1463 	[ALC880_FIXUP_3ST_DIG] = {
1464 		.type = HDA_FIXUP_PINS,
1465 		.v.pins = (const struct hda_pintbl[]) {
1466 			{ 0x1e, 0x0144111e }, /* SPDIF */
1467 			{ }
1468 		},
1469 		.chained = true,
1470 		.chain_id = ALC880_FIXUP_3ST_BASE,
1471 	},
1472 	[ALC880_FIXUP_5ST_BASE] = {
1473 		.type = HDA_FIXUP_PINS,
1474 		.v.pins = (const struct hda_pintbl[]) {
1475 			{ 0x14, 0x01014010 }, /* front */
1476 			{ 0x15, 0x411111f0 }, /* N/A */
1477 			{ 0x16, 0x01011411 }, /* CLFE */
1478 			{ 0x17, 0x01016412 }, /* surr */
1479 			{ 0x18, 0x01a19c30 }, /* mic-in */
1480 			{ 0x19, 0x0121411f }, /* HP */
1481 			{ 0x1a, 0x01813031 }, /* line-in */
1482 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1483 			{ 0x1c, 0x411111f0 }, /* N/A */
1484 			{ 0x1d, 0x411111f0 }, /* N/A */
1485 			/* 0x1e is filled in below */
1486 			{ 0x1f, 0x411111f0 }, /* N/A */
1487 			{ }
1488 		}
1489 	},
1490 	[ALC880_FIXUP_5ST] = {
1491 		.type = HDA_FIXUP_PINS,
1492 		.v.pins = (const struct hda_pintbl[]) {
1493 			{ 0x1e, 0x411111f0 }, /* N/A */
1494 			{ }
1495 		},
1496 		.chained = true,
1497 		.chain_id = ALC880_FIXUP_5ST_BASE,
1498 	},
1499 	[ALC880_FIXUP_5ST_DIG] = {
1500 		.type = HDA_FIXUP_PINS,
1501 		.v.pins = (const struct hda_pintbl[]) {
1502 			{ 0x1e, 0x0144111e }, /* SPDIF */
1503 			{ }
1504 		},
1505 		.chained = true,
1506 		.chain_id = ALC880_FIXUP_5ST_BASE,
1507 	},
1508 	[ALC880_FIXUP_6ST_BASE] = {
1509 		.type = HDA_FIXUP_PINS,
1510 		.v.pins = (const struct hda_pintbl[]) {
1511 			{ 0x14, 0x01014010 }, /* front */
1512 			{ 0x15, 0x01016412 }, /* surr */
1513 			{ 0x16, 0x01011411 }, /* CLFE */
1514 			{ 0x17, 0x01012414 }, /* side */
1515 			{ 0x18, 0x01a19c30 }, /* mic-in */
1516 			{ 0x19, 0x02a19c40 }, /* front-mic */
1517 			{ 0x1a, 0x01813031 }, /* line-in */
1518 			{ 0x1b, 0x0121411f }, /* HP */
1519 			{ 0x1c, 0x411111f0 }, /* N/A */
1520 			{ 0x1d, 0x411111f0 }, /* N/A */
1521 			/* 0x1e is filled in below */
1522 			{ 0x1f, 0x411111f0 }, /* N/A */
1523 			{ }
1524 		}
1525 	},
1526 	[ALC880_FIXUP_6ST] = {
1527 		.type = HDA_FIXUP_PINS,
1528 		.v.pins = (const struct hda_pintbl[]) {
1529 			{ 0x1e, 0x411111f0 }, /* N/A */
1530 			{ }
1531 		},
1532 		.chained = true,
1533 		.chain_id = ALC880_FIXUP_6ST_BASE,
1534 	},
1535 	[ALC880_FIXUP_6ST_DIG] = {
1536 		.type = HDA_FIXUP_PINS,
1537 		.v.pins = (const struct hda_pintbl[]) {
1538 			{ 0x1e, 0x0144111e }, /* SPDIF */
1539 			{ }
1540 		},
1541 		.chained = true,
1542 		.chain_id = ALC880_FIXUP_6ST_BASE,
1543 	},
1544 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1545 		.type = HDA_FIXUP_PINS,
1546 		.v.pins = (const struct hda_pintbl[]) {
1547 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1548 			{ }
1549 		},
1550 		.chained_before = true,
1551 		.chain_id = ALC880_FIXUP_6ST_BASE,
1552 	},
1553 };
1554 
1555 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1556 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1557 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1558 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1559 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1560 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1561 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1562 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1563 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1564 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1565 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1566 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1567 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1568 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1569 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1570 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1571 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1572 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1573 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1574 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1575 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1576 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1577 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1578 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1579 
1580 	/* Below is the copied entries from alc880_quirks.c.
1581 	 * It's not quite sure whether BIOS sets the correct pin-config table
1582 	 * on these machines, thus they are kept to be compatible with
1583 	 * the old static quirks.  Once when it's confirmed to work without
1584 	 * these overrides, it'd be better to remove.
1585 	 */
1586 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1587 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1588 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1589 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1590 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1591 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1592 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1593 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1594 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1595 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1596 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1597 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1598 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1599 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1600 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1601 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1602 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1603 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1605 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1606 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1607 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1608 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1609 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1610 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1611 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1613 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1615 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1616 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1617 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1618 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1619 	/* default Intel */
1620 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1621 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1622 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1623 	{}
1624 };
1625 
1626 static const struct hda_model_fixup alc880_fixup_models[] = {
1627 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1628 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1629 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1630 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1631 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1632 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1633 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1634 	{}
1635 };
1636 
1637 
1638 /*
1639  * OK, here we have finally the patch for ALC880
1640  */
1641 static int patch_alc880(struct hda_codec *codec)
1642 {
1643 	struct alc_spec *spec;
1644 	int err;
1645 
1646 	err = alc_alloc_spec(codec, 0x0b);
1647 	if (err < 0)
1648 		return err;
1649 
1650 	spec = codec->spec;
1651 	spec->gen.need_dac_fix = 1;
1652 	spec->gen.beep_nid = 0x01;
1653 
1654 	codec->patch_ops.unsol_event = alc880_unsol_event;
1655 
1656 	alc_pre_init(codec);
1657 
1658 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1659 		       alc880_fixups);
1660 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1661 
1662 	/* automatic parse from the BIOS config */
1663 	err = alc880_parse_auto_config(codec);
1664 	if (err < 0)
1665 		goto error;
1666 
1667 	if (!spec->gen.no_analog) {
1668 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1669 		if (err < 0)
1670 			goto error;
1671 	}
1672 
1673 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1674 
1675 	return 0;
1676 
1677  error:
1678 	alc_free(codec);
1679 	return err;
1680 }
1681 
1682 
1683 /*
1684  * ALC260 support
1685  */
1686 static int alc260_parse_auto_config(struct hda_codec *codec)
1687 {
1688 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1689 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1690 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1691 }
1692 
1693 /*
1694  * Pin config fixes
1695  */
1696 enum {
1697 	ALC260_FIXUP_HP_DC5750,
1698 	ALC260_FIXUP_HP_PIN_0F,
1699 	ALC260_FIXUP_COEF,
1700 	ALC260_FIXUP_GPIO1,
1701 	ALC260_FIXUP_GPIO1_TOGGLE,
1702 	ALC260_FIXUP_REPLACER,
1703 	ALC260_FIXUP_HP_B1900,
1704 	ALC260_FIXUP_KN1,
1705 	ALC260_FIXUP_FSC_S7020,
1706 	ALC260_FIXUP_FSC_S7020_JWSE,
1707 	ALC260_FIXUP_VAIO_PINS,
1708 };
1709 
1710 static void alc260_gpio1_automute(struct hda_codec *codec)
1711 {
1712 	struct alc_spec *spec = codec->spec;
1713 
1714 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1715 }
1716 
1717 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1718 				      const struct hda_fixup *fix, int action)
1719 {
1720 	struct alc_spec *spec = codec->spec;
1721 	if (action == HDA_FIXUP_ACT_PROBE) {
1722 		/* although the machine has only one output pin, we need to
1723 		 * toggle GPIO1 according to the jack state
1724 		 */
1725 		spec->gen.automute_hook = alc260_gpio1_automute;
1726 		spec->gen.detect_hp = 1;
1727 		spec->gen.automute_speaker = 1;
1728 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1729 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1730 						    snd_hda_gen_hp_automute);
1731 		alc_setup_gpio(codec, 0x01);
1732 	}
1733 }
1734 
1735 static void alc260_fixup_kn1(struct hda_codec *codec,
1736 			     const struct hda_fixup *fix, int action)
1737 {
1738 	struct alc_spec *spec = codec->spec;
1739 	static const struct hda_pintbl pincfgs[] = {
1740 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1741 		{ 0x12, 0x90a60160 }, /* int mic */
1742 		{ 0x13, 0x02a19000 }, /* ext mic */
1743 		{ 0x18, 0x01446000 }, /* SPDIF out */
1744 		/* disable bogus I/O pins */
1745 		{ 0x10, 0x411111f0 },
1746 		{ 0x11, 0x411111f0 },
1747 		{ 0x14, 0x411111f0 },
1748 		{ 0x15, 0x411111f0 },
1749 		{ 0x16, 0x411111f0 },
1750 		{ 0x17, 0x411111f0 },
1751 		{ 0x19, 0x411111f0 },
1752 		{ }
1753 	};
1754 
1755 	switch (action) {
1756 	case HDA_FIXUP_ACT_PRE_PROBE:
1757 		snd_hda_apply_pincfgs(codec, pincfgs);
1758 		spec->init_amp = ALC_INIT_NONE;
1759 		break;
1760 	}
1761 }
1762 
1763 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1764 				   const struct hda_fixup *fix, int action)
1765 {
1766 	struct alc_spec *spec = codec->spec;
1767 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1768 		spec->init_amp = ALC_INIT_NONE;
1769 }
1770 
1771 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1772 				   const struct hda_fixup *fix, int action)
1773 {
1774 	struct alc_spec *spec = codec->spec;
1775 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1776 		spec->gen.add_jack_modes = 1;
1777 		spec->gen.hp_mic = 1;
1778 	}
1779 }
1780 
1781 static const struct hda_fixup alc260_fixups[] = {
1782 	[ALC260_FIXUP_HP_DC5750] = {
1783 		.type = HDA_FIXUP_PINS,
1784 		.v.pins = (const struct hda_pintbl[]) {
1785 			{ 0x11, 0x90130110 }, /* speaker */
1786 			{ }
1787 		}
1788 	},
1789 	[ALC260_FIXUP_HP_PIN_0F] = {
1790 		.type = HDA_FIXUP_PINS,
1791 		.v.pins = (const struct hda_pintbl[]) {
1792 			{ 0x0f, 0x01214000 }, /* HP */
1793 			{ }
1794 		}
1795 	},
1796 	[ALC260_FIXUP_COEF] = {
1797 		.type = HDA_FIXUP_VERBS,
1798 		.v.verbs = (const struct hda_verb[]) {
1799 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1800 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3040 },
1801 			{ }
1802 		},
1803 	},
1804 	[ALC260_FIXUP_GPIO1] = {
1805 		.type = HDA_FIXUP_FUNC,
1806 		.v.func = alc_fixup_gpio1,
1807 	},
1808 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1809 		.type = HDA_FIXUP_FUNC,
1810 		.v.func = alc260_fixup_gpio1_toggle,
1811 		.chained = true,
1812 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1813 	},
1814 	[ALC260_FIXUP_REPLACER] = {
1815 		.type = HDA_FIXUP_VERBS,
1816 		.v.verbs = (const struct hda_verb[]) {
1817 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1818 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1819 			{ }
1820 		},
1821 		.chained = true,
1822 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1823 	},
1824 	[ALC260_FIXUP_HP_B1900] = {
1825 		.type = HDA_FIXUP_FUNC,
1826 		.v.func = alc260_fixup_gpio1_toggle,
1827 		.chained = true,
1828 		.chain_id = ALC260_FIXUP_COEF,
1829 	},
1830 	[ALC260_FIXUP_KN1] = {
1831 		.type = HDA_FIXUP_FUNC,
1832 		.v.func = alc260_fixup_kn1,
1833 	},
1834 	[ALC260_FIXUP_FSC_S7020] = {
1835 		.type = HDA_FIXUP_FUNC,
1836 		.v.func = alc260_fixup_fsc_s7020,
1837 	},
1838 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1839 		.type = HDA_FIXUP_FUNC,
1840 		.v.func = alc260_fixup_fsc_s7020_jwse,
1841 		.chained = true,
1842 		.chain_id = ALC260_FIXUP_FSC_S7020,
1843 	},
1844 	[ALC260_FIXUP_VAIO_PINS] = {
1845 		.type = HDA_FIXUP_PINS,
1846 		.v.pins = (const struct hda_pintbl[]) {
1847 			/* Pin configs are missing completely on some VAIOs */
1848 			{ 0x0f, 0x01211020 },
1849 			{ 0x10, 0x0001003f },
1850 			{ 0x11, 0x411111f0 },
1851 			{ 0x12, 0x01a15930 },
1852 			{ 0x13, 0x411111f0 },
1853 			{ 0x14, 0x411111f0 },
1854 			{ 0x15, 0x411111f0 },
1855 			{ 0x16, 0x411111f0 },
1856 			{ 0x17, 0x411111f0 },
1857 			{ 0x18, 0x411111f0 },
1858 			{ 0x19, 0x411111f0 },
1859 			{ }
1860 		}
1861 	},
1862 };
1863 
1864 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1865 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1866 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1867 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1868 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1869 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1870 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1871 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1872 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1873 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1874 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1875 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1876 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1877 	{}
1878 };
1879 
1880 static const struct hda_model_fixup alc260_fixup_models[] = {
1881 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1882 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1883 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1884 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1885 	{}
1886 };
1887 
1888 /*
1889  */
1890 static int patch_alc260(struct hda_codec *codec)
1891 {
1892 	struct alc_spec *spec;
1893 	int err;
1894 
1895 	err = alc_alloc_spec(codec, 0x07);
1896 	if (err < 0)
1897 		return err;
1898 
1899 	spec = codec->spec;
1900 	/* as quite a few machines require HP amp for speaker outputs,
1901 	 * it's easier to enable it unconditionally; even if it's unneeded,
1902 	 * it's almost harmless.
1903 	 */
1904 	spec->gen.prefer_hp_amp = 1;
1905 	spec->gen.beep_nid = 0x01;
1906 
1907 	spec->shutup = alc_eapd_shutup;
1908 
1909 	alc_pre_init(codec);
1910 
1911 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1912 			   alc260_fixups);
1913 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1914 
1915 	/* automatic parse from the BIOS config */
1916 	err = alc260_parse_auto_config(codec);
1917 	if (err < 0)
1918 		goto error;
1919 
1920 	if (!spec->gen.no_analog) {
1921 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1922 		if (err < 0)
1923 			goto error;
1924 	}
1925 
1926 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1927 
1928 	return 0;
1929 
1930  error:
1931 	alc_free(codec);
1932 	return err;
1933 }
1934 
1935 
1936 /*
1937  * ALC882/883/885/888/889 support
1938  *
1939  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1940  * configuration.  Each pin widget can choose any input DACs and a mixer.
1941  * Each ADC is connected from a mixer of all inputs.  This makes possible
1942  * 6-channel independent captures.
1943  *
1944  * In addition, an independent DAC for the multi-playback (not used in this
1945  * driver yet).
1946  */
1947 
1948 /*
1949  * Pin config fixes
1950  */
1951 enum {
1952 	ALC882_FIXUP_ABIT_AW9D_MAX,
1953 	ALC882_FIXUP_LENOVO_Y530,
1954 	ALC882_FIXUP_PB_M5210,
1955 	ALC882_FIXUP_ACER_ASPIRE_7736,
1956 	ALC882_FIXUP_ASUS_W90V,
1957 	ALC889_FIXUP_CD,
1958 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1959 	ALC889_FIXUP_VAIO_TT,
1960 	ALC888_FIXUP_EEE1601,
1961 	ALC886_FIXUP_EAPD,
1962 	ALC882_FIXUP_EAPD,
1963 	ALC883_FIXUP_EAPD,
1964 	ALC883_FIXUP_ACER_EAPD,
1965 	ALC882_FIXUP_GPIO1,
1966 	ALC882_FIXUP_GPIO2,
1967 	ALC882_FIXUP_GPIO3,
1968 	ALC889_FIXUP_COEF,
1969 	ALC882_FIXUP_ASUS_W2JC,
1970 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1971 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1972 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1973 	ALC885_FIXUP_MACPRO_GPIO,
1974 	ALC889_FIXUP_DAC_ROUTE,
1975 	ALC889_FIXUP_MBP_VREF,
1976 	ALC889_FIXUP_IMAC91_VREF,
1977 	ALC889_FIXUP_MBA11_VREF,
1978 	ALC889_FIXUP_MBA21_VREF,
1979 	ALC889_FIXUP_MP11_VREF,
1980 	ALC889_FIXUP_MP41_VREF,
1981 	ALC882_FIXUP_INV_DMIC,
1982 	ALC882_FIXUP_NO_PRIMARY_HP,
1983 	ALC887_FIXUP_ASUS_BASS,
1984 	ALC887_FIXUP_BASS_CHMAP,
1985 	ALC1220_FIXUP_GB_DUAL_CODECS,
1986 	ALC1220_FIXUP_GB_X570,
1987 	ALC1220_FIXUP_CLEVO_P950,
1988 	ALC1220_FIXUP_CLEVO_PB51ED,
1989 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1990 	ALC887_FIXUP_ASUS_AUDIO,
1991 	ALC887_FIXUP_ASUS_HMIC,
1992 	ALCS1200A_FIXUP_MIC_VREF,
1993 	ALC888VD_FIXUP_MIC_100VREF,
1994 };
1995 
1996 static void alc889_fixup_coef(struct hda_codec *codec,
1997 			      const struct hda_fixup *fix, int action)
1998 {
1999 	if (action != HDA_FIXUP_ACT_INIT)
2000 		return;
2001 	alc_update_coef_idx(codec, 7, 0, 0x2030);
2002 }
2003 
2004 /* set up GPIO at initialization */
2005 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2006 				     const struct hda_fixup *fix, int action)
2007 {
2008 	struct alc_spec *spec = codec->spec;
2009 
2010 	spec->gpio_write_delay = true;
2011 	alc_fixup_gpio3(codec, fix, action);
2012 }
2013 
2014 /* Fix the connection of some pins for ALC889:
2015  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2016  * work correctly (bko#42740)
2017  */
2018 static void alc889_fixup_dac_route(struct hda_codec *codec,
2019 				   const struct hda_fixup *fix, int action)
2020 {
2021 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2022 		/* fake the connections during parsing the tree */
2023 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2024 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2025 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2026 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2027 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2028 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2029 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2030 		/* restore the connections */
2031 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2032 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2033 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2034 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2035 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2036 	}
2037 }
2038 
2039 /* Set VREF on HP pin */
2040 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2041 				  const struct hda_fixup *fix, int action)
2042 {
2043 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2044 	struct alc_spec *spec = codec->spec;
2045 	int i;
2046 
2047 	if (action != HDA_FIXUP_ACT_INIT)
2048 		return;
2049 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2050 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2051 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2052 			continue;
2053 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2054 		val |= AC_PINCTL_VREF_80;
2055 		snd_hda_set_pin_ctl(codec, nids[i], val);
2056 		spec->gen.keep_vref_in_automute = 1;
2057 		break;
2058 	}
2059 }
2060 
2061 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2062 				  const hda_nid_t *nids, int num_nids)
2063 {
2064 	struct alc_spec *spec = codec->spec;
2065 	int i;
2066 
2067 	for (i = 0; i < num_nids; i++) {
2068 		unsigned int val;
2069 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2070 		val |= AC_PINCTL_VREF_50;
2071 		snd_hda_set_pin_ctl(codec, nids[i], val);
2072 	}
2073 	spec->gen.keep_vref_in_automute = 1;
2074 }
2075 
2076 /* Set VREF on speaker pins on imac91 */
2077 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2078 				     const struct hda_fixup *fix, int action)
2079 {
2080 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2081 
2082 	if (action == HDA_FIXUP_ACT_INIT)
2083 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2084 }
2085 
2086 /* Set VREF on speaker pins on mba11 */
2087 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2088 				    const struct hda_fixup *fix, int action)
2089 {
2090 	static const hda_nid_t nids[] = { 0x18 };
2091 
2092 	if (action == HDA_FIXUP_ACT_INIT)
2093 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2094 }
2095 
2096 /* Set VREF on speaker pins on mba21 */
2097 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2098 				    const struct hda_fixup *fix, int action)
2099 {
2100 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2101 
2102 	if (action == HDA_FIXUP_ACT_INIT)
2103 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2104 }
2105 
2106 /* Don't take HP output as primary
2107  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2108  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2109  */
2110 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2111 				       const struct hda_fixup *fix, int action)
2112 {
2113 	struct alc_spec *spec = codec->spec;
2114 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2115 		spec->gen.no_primary_hp = 1;
2116 		spec->gen.no_multi_io = 1;
2117 	}
2118 }
2119 
2120 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2121 				 const struct hda_fixup *fix, int action);
2122 
2123 /* For dual-codec configuration, we need to disable some features to avoid
2124  * conflicts of kctls and PCM streams
2125  */
2126 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2127 				  const struct hda_fixup *fix, int action)
2128 {
2129 	struct alc_spec *spec = codec->spec;
2130 
2131 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2132 		return;
2133 	/* disable vmaster */
2134 	spec->gen.suppress_vmaster = 1;
2135 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2136 	spec->gen.suppress_auto_mute = 1;
2137 	spec->gen.suppress_auto_mic = 1;
2138 	/* disable aamix as well */
2139 	spec->gen.mixer_nid = 0;
2140 	/* add location prefix to avoid conflicts */
2141 	codec->force_pin_prefix = 1;
2142 }
2143 
2144 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2145 		       const char *newname)
2146 {
2147 	struct snd_kcontrol *kctl;
2148 
2149 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2150 	if (kctl)
2151 		snd_ctl_rename(codec->card, kctl, newname);
2152 }
2153 
2154 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2155 					 const struct hda_fixup *fix,
2156 					 int action)
2157 {
2158 	alc_fixup_dual_codecs(codec, fix, action);
2159 	switch (action) {
2160 	case HDA_FIXUP_ACT_PRE_PROBE:
2161 		/* override card longname to provide a unique UCM profile */
2162 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2163 		break;
2164 	case HDA_FIXUP_ACT_BUILD:
2165 		/* rename Capture controls depending on the codec */
2166 		rename_ctl(codec, "Capture Volume",
2167 			   codec->addr == 0 ?
2168 			   "Rear-Panel Capture Volume" :
2169 			   "Front-Panel Capture Volume");
2170 		rename_ctl(codec, "Capture Switch",
2171 			   codec->addr == 0 ?
2172 			   "Rear-Panel Capture Switch" :
2173 			   "Front-Panel Capture Switch");
2174 		break;
2175 	}
2176 }
2177 
2178 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2179 				     const struct hda_fixup *fix,
2180 				     int action)
2181 {
2182 	static const hda_nid_t conn1[] = { 0x0c };
2183 	static const struct coef_fw gb_x570_coefs[] = {
2184 		WRITE_COEF(0x07, 0x03c0),
2185 		WRITE_COEF(0x1a, 0x01c1),
2186 		WRITE_COEF(0x1b, 0x0202),
2187 		WRITE_COEF(0x43, 0x3005),
2188 		{}
2189 	};
2190 
2191 	switch (action) {
2192 	case HDA_FIXUP_ACT_PRE_PROBE:
2193 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2194 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2195 		break;
2196 	case HDA_FIXUP_ACT_INIT:
2197 		alc_process_coef_fw(codec, gb_x570_coefs);
2198 		break;
2199 	}
2200 }
2201 
2202 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2203 				     const struct hda_fixup *fix,
2204 				     int action)
2205 {
2206 	static const hda_nid_t conn1[] = { 0x0c };
2207 
2208 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2209 		return;
2210 
2211 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2212 	/* We therefore want to make sure 0x14 (front headphone) and
2213 	 * 0x1b (speakers) use the stereo DAC 0x02
2214 	 */
2215 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2216 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2217 }
2218 
2219 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2220 				const struct hda_fixup *fix, int action);
2221 
2222 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2223 				     const struct hda_fixup *fix,
2224 				     int action)
2225 {
2226 	alc1220_fixup_clevo_p950(codec, fix, action);
2227 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2228 }
2229 
2230 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2231 					 struct hda_jack_callback *jack)
2232 {
2233 	struct alc_spec *spec = codec->spec;
2234 	unsigned int vref;
2235 
2236 	snd_hda_gen_hp_automute(codec, jack);
2237 
2238 	if (spec->gen.hp_jack_present)
2239 		vref = AC_PINCTL_VREF_80;
2240 	else
2241 		vref = AC_PINCTL_VREF_HIZ;
2242 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2243 }
2244 
2245 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2246 				     const struct hda_fixup *fix, int action)
2247 {
2248 	struct alc_spec *spec = codec->spec;
2249 	if (action != HDA_FIXUP_ACT_PROBE)
2250 		return;
2251 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2252 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2253 }
2254 
2255 static const struct hda_fixup alc882_fixups[] = {
2256 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2257 		.type = HDA_FIXUP_PINS,
2258 		.v.pins = (const struct hda_pintbl[]) {
2259 			{ 0x15, 0x01080104 }, /* side */
2260 			{ 0x16, 0x01011012 }, /* rear */
2261 			{ 0x17, 0x01016011 }, /* clfe */
2262 			{ }
2263 		}
2264 	},
2265 	[ALC882_FIXUP_LENOVO_Y530] = {
2266 		.type = HDA_FIXUP_PINS,
2267 		.v.pins = (const struct hda_pintbl[]) {
2268 			{ 0x15, 0x99130112 }, /* rear int speakers */
2269 			{ 0x16, 0x99130111 }, /* subwoofer */
2270 			{ }
2271 		}
2272 	},
2273 	[ALC882_FIXUP_PB_M5210] = {
2274 		.type = HDA_FIXUP_PINCTLS,
2275 		.v.pins = (const struct hda_pintbl[]) {
2276 			{ 0x19, PIN_VREF50 },
2277 			{}
2278 		}
2279 	},
2280 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2281 		.type = HDA_FIXUP_FUNC,
2282 		.v.func = alc_fixup_sku_ignore,
2283 	},
2284 	[ALC882_FIXUP_ASUS_W90V] = {
2285 		.type = HDA_FIXUP_PINS,
2286 		.v.pins = (const struct hda_pintbl[]) {
2287 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2288 			{ }
2289 		}
2290 	},
2291 	[ALC889_FIXUP_CD] = {
2292 		.type = HDA_FIXUP_PINS,
2293 		.v.pins = (const struct hda_pintbl[]) {
2294 			{ 0x1c, 0x993301f0 }, /* CD */
2295 			{ }
2296 		}
2297 	},
2298 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2299 		.type = HDA_FIXUP_PINS,
2300 		.v.pins = (const struct hda_pintbl[]) {
2301 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2302 			{ }
2303 		},
2304 		.chained = true,
2305 		.chain_id = ALC889_FIXUP_CD,
2306 	},
2307 	[ALC889_FIXUP_VAIO_TT] = {
2308 		.type = HDA_FIXUP_PINS,
2309 		.v.pins = (const struct hda_pintbl[]) {
2310 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2311 			{ }
2312 		}
2313 	},
2314 	[ALC888_FIXUP_EEE1601] = {
2315 		.type = HDA_FIXUP_VERBS,
2316 		.v.verbs = (const struct hda_verb[]) {
2317 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2318 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2319 			{ }
2320 		}
2321 	},
2322 	[ALC886_FIXUP_EAPD] = {
2323 		.type = HDA_FIXUP_VERBS,
2324 		.v.verbs = (const struct hda_verb[]) {
2325 			/* change to EAPD mode */
2326 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2327 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2328 			{ }
2329 		}
2330 	},
2331 	[ALC882_FIXUP_EAPD] = {
2332 		.type = HDA_FIXUP_VERBS,
2333 		.v.verbs = (const struct hda_verb[]) {
2334 			/* change to EAPD mode */
2335 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2336 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2337 			{ }
2338 		}
2339 	},
2340 	[ALC883_FIXUP_EAPD] = {
2341 		.type = HDA_FIXUP_VERBS,
2342 		.v.verbs = (const struct hda_verb[]) {
2343 			/* change to EAPD mode */
2344 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2345 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2346 			{ }
2347 		}
2348 	},
2349 	[ALC883_FIXUP_ACER_EAPD] = {
2350 		.type = HDA_FIXUP_VERBS,
2351 		.v.verbs = (const struct hda_verb[]) {
2352 			/* eanable EAPD on Acer laptops */
2353 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2354 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2355 			{ }
2356 		}
2357 	},
2358 	[ALC882_FIXUP_GPIO1] = {
2359 		.type = HDA_FIXUP_FUNC,
2360 		.v.func = alc_fixup_gpio1,
2361 	},
2362 	[ALC882_FIXUP_GPIO2] = {
2363 		.type = HDA_FIXUP_FUNC,
2364 		.v.func = alc_fixup_gpio2,
2365 	},
2366 	[ALC882_FIXUP_GPIO3] = {
2367 		.type = HDA_FIXUP_FUNC,
2368 		.v.func = alc_fixup_gpio3,
2369 	},
2370 	[ALC882_FIXUP_ASUS_W2JC] = {
2371 		.type = HDA_FIXUP_FUNC,
2372 		.v.func = alc_fixup_gpio1,
2373 		.chained = true,
2374 		.chain_id = ALC882_FIXUP_EAPD,
2375 	},
2376 	[ALC889_FIXUP_COEF] = {
2377 		.type = HDA_FIXUP_FUNC,
2378 		.v.func = alc889_fixup_coef,
2379 	},
2380 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2381 		.type = HDA_FIXUP_PINS,
2382 		.v.pins = (const struct hda_pintbl[]) {
2383 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2384 			{ 0x17, 0x99130112 }, /* surround speaker */
2385 			{ }
2386 		},
2387 		.chained = true,
2388 		.chain_id = ALC882_FIXUP_GPIO1,
2389 	},
2390 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2391 		.type = HDA_FIXUP_PINS,
2392 		.v.pins = (const struct hda_pintbl[]) {
2393 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2394 			{ 0x1b, 0x99130112 }, /* surround speaker */
2395 			{ }
2396 		},
2397 		.chained = true,
2398 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2399 	},
2400 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2401 		/* additional init verbs for Acer Aspire 8930G */
2402 		.type = HDA_FIXUP_VERBS,
2403 		.v.verbs = (const struct hda_verb[]) {
2404 			/* Enable all DACs */
2405 			/* DAC DISABLE/MUTE 1? */
2406 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2407 			 *  apparently. Init=0x38 */
2408 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2409 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2410 			/* DAC DISABLE/MUTE 2? */
2411 			/*  some bit here disables the other DACs.
2412 			 *  Init=0x4900 */
2413 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2414 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2415 			/* DMIC fix
2416 			 * This laptop has a stereo digital microphone.
2417 			 * The mics are only 1cm apart which makes the stereo
2418 			 * useless. However, either the mic or the ALC889
2419 			 * makes the signal become a difference/sum signal
2420 			 * instead of standard stereo, which is annoying.
2421 			 * So instead we flip this bit which makes the
2422 			 * codec replicate the sum signal to both channels,
2423 			 * turning it into a normal mono mic.
2424 			 */
2425 			/* DMIC_CONTROL? Init value = 0x0001 */
2426 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2427 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2428 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2429 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2430 			{ }
2431 		},
2432 		.chained = true,
2433 		.chain_id = ALC882_FIXUP_GPIO1,
2434 	},
2435 	[ALC885_FIXUP_MACPRO_GPIO] = {
2436 		.type = HDA_FIXUP_FUNC,
2437 		.v.func = alc885_fixup_macpro_gpio,
2438 	},
2439 	[ALC889_FIXUP_DAC_ROUTE] = {
2440 		.type = HDA_FIXUP_FUNC,
2441 		.v.func = alc889_fixup_dac_route,
2442 	},
2443 	[ALC889_FIXUP_MBP_VREF] = {
2444 		.type = HDA_FIXUP_FUNC,
2445 		.v.func = alc889_fixup_mbp_vref,
2446 		.chained = true,
2447 		.chain_id = ALC882_FIXUP_GPIO1,
2448 	},
2449 	[ALC889_FIXUP_IMAC91_VREF] = {
2450 		.type = HDA_FIXUP_FUNC,
2451 		.v.func = alc889_fixup_imac91_vref,
2452 		.chained = true,
2453 		.chain_id = ALC882_FIXUP_GPIO1,
2454 	},
2455 	[ALC889_FIXUP_MBA11_VREF] = {
2456 		.type = HDA_FIXUP_FUNC,
2457 		.v.func = alc889_fixup_mba11_vref,
2458 		.chained = true,
2459 		.chain_id = ALC889_FIXUP_MBP_VREF,
2460 	},
2461 	[ALC889_FIXUP_MBA21_VREF] = {
2462 		.type = HDA_FIXUP_FUNC,
2463 		.v.func = alc889_fixup_mba21_vref,
2464 		.chained = true,
2465 		.chain_id = ALC889_FIXUP_MBP_VREF,
2466 	},
2467 	[ALC889_FIXUP_MP11_VREF] = {
2468 		.type = HDA_FIXUP_FUNC,
2469 		.v.func = alc889_fixup_mba11_vref,
2470 		.chained = true,
2471 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2472 	},
2473 	[ALC889_FIXUP_MP41_VREF] = {
2474 		.type = HDA_FIXUP_FUNC,
2475 		.v.func = alc889_fixup_mbp_vref,
2476 		.chained = true,
2477 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2478 	},
2479 	[ALC882_FIXUP_INV_DMIC] = {
2480 		.type = HDA_FIXUP_FUNC,
2481 		.v.func = alc_fixup_inv_dmic,
2482 	},
2483 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2484 		.type = HDA_FIXUP_FUNC,
2485 		.v.func = alc882_fixup_no_primary_hp,
2486 	},
2487 	[ALC887_FIXUP_ASUS_BASS] = {
2488 		.type = HDA_FIXUP_PINS,
2489 		.v.pins = (const struct hda_pintbl[]) {
2490 			{0x16, 0x99130130}, /* bass speaker */
2491 			{}
2492 		},
2493 		.chained = true,
2494 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2495 	},
2496 	[ALC887_FIXUP_BASS_CHMAP] = {
2497 		.type = HDA_FIXUP_FUNC,
2498 		.v.func = alc_fixup_bass_chmap,
2499 	},
2500 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2501 		.type = HDA_FIXUP_FUNC,
2502 		.v.func = alc1220_fixup_gb_dual_codecs,
2503 	},
2504 	[ALC1220_FIXUP_GB_X570] = {
2505 		.type = HDA_FIXUP_FUNC,
2506 		.v.func = alc1220_fixup_gb_x570,
2507 	},
2508 	[ALC1220_FIXUP_CLEVO_P950] = {
2509 		.type = HDA_FIXUP_FUNC,
2510 		.v.func = alc1220_fixup_clevo_p950,
2511 	},
2512 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2513 		.type = HDA_FIXUP_FUNC,
2514 		.v.func = alc1220_fixup_clevo_pb51ed,
2515 	},
2516 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2517 		.type = HDA_FIXUP_PINS,
2518 		.v.pins = (const struct hda_pintbl[]) {
2519 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2520 			{}
2521 		},
2522 		.chained = true,
2523 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2524 	},
2525 	[ALC887_FIXUP_ASUS_AUDIO] = {
2526 		.type = HDA_FIXUP_PINS,
2527 		.v.pins = (const struct hda_pintbl[]) {
2528 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2529 			{ 0x19, 0x22219420 },
2530 			{}
2531 		},
2532 	},
2533 	[ALC887_FIXUP_ASUS_HMIC] = {
2534 		.type = HDA_FIXUP_FUNC,
2535 		.v.func = alc887_fixup_asus_jack,
2536 		.chained = true,
2537 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2538 	},
2539 	[ALCS1200A_FIXUP_MIC_VREF] = {
2540 		.type = HDA_FIXUP_PINCTLS,
2541 		.v.pins = (const struct hda_pintbl[]) {
2542 			{ 0x18, PIN_VREF50 }, /* rear mic */
2543 			{ 0x19, PIN_VREF50 }, /* front mic */
2544 			{}
2545 		}
2546 	},
2547 	[ALC888VD_FIXUP_MIC_100VREF] = {
2548 		.type = HDA_FIXUP_PINCTLS,
2549 		.v.pins = (const struct hda_pintbl[]) {
2550 			{ 0x18, PIN_VREF100 }, /* headset mic */
2551 			{}
2552 		}
2553 	},
2554 };
2555 
2556 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2557 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2558 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2559 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2560 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2561 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2562 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2563 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2564 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2565 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2566 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2567 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2568 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2569 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2570 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2571 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2572 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2573 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2574 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2575 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2576 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2577 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2578 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2579 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2580 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2581 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2582 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2583 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2584 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2585 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2586 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2587 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2588 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2589 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2590 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2591 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2592 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2593 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2594 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2595 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2596 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2597 
2598 	/* All Apple entries are in codec SSIDs */
2599 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2600 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2601 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2602 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2603 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2604 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2605 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2606 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2607 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2608 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2609 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2610 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2611 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2612 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2613 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2614 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2615 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2616 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2617 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2618 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2619 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2620 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2621 
2622 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2623 	SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2624 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2625 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2626 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2627 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2628 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2629 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2630 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2631 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2632 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2633 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2634 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2635 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2636 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2637 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2638 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2639 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2640 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2641 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2642 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2643 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2644 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2645 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2646 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2647 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2648 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2649 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2650 	SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2651 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2653 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2654 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2659 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2660 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2661 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2662 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2663 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2664 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2665 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2666 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2667 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2668 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2669 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2670 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2671 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2672 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2673 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2674 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2675 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2676 	{}
2677 };
2678 
2679 static const struct hda_model_fixup alc882_fixup_models[] = {
2680 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2681 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2682 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2683 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2684 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2685 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2686 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2687 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2688 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2689 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2690 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2691 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2692 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2693 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2694 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2695 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2696 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2697 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2698 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2699 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2700 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2701 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2702 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2703 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2704 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2705 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2706 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2707 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2708 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2709 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2710 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2711 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2712 	{}
2713 };
2714 
2715 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2716 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2717 		{0x14, 0x01014010},
2718 		{0x15, 0x01011012},
2719 		{0x16, 0x01016011},
2720 		{0x18, 0x01a19040},
2721 		{0x19, 0x02a19050},
2722 		{0x1a, 0x0181304f},
2723 		{0x1b, 0x0221401f},
2724 		{0x1e, 0x01456130}),
2725 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2726 		{0x14, 0x01015010},
2727 		{0x15, 0x01011012},
2728 		{0x16, 0x01011011},
2729 		{0x18, 0x01a11040},
2730 		{0x19, 0x02a19050},
2731 		{0x1a, 0x0181104f},
2732 		{0x1b, 0x0221401f},
2733 		{0x1e, 0x01451130}),
2734 	{}
2735 };
2736 
2737 /*
2738  * BIOS auto configuration
2739  */
2740 /* almost identical with ALC880 parser... */
2741 static int alc882_parse_auto_config(struct hda_codec *codec)
2742 {
2743 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2744 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2745 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2746 }
2747 
2748 /*
2749  */
2750 static int patch_alc882(struct hda_codec *codec)
2751 {
2752 	struct alc_spec *spec;
2753 	int err;
2754 
2755 	err = alc_alloc_spec(codec, 0x0b);
2756 	if (err < 0)
2757 		return err;
2758 
2759 	spec = codec->spec;
2760 
2761 	switch (codec->core.vendor_id) {
2762 	case 0x10ec0882:
2763 	case 0x10ec0885:
2764 	case 0x10ec0900:
2765 	case 0x10ec0b00:
2766 	case 0x10ec1220:
2767 		break;
2768 	default:
2769 		/* ALC883 and variants */
2770 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2771 		break;
2772 	}
2773 
2774 	alc_pre_init(codec);
2775 
2776 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2777 		       alc882_fixups);
2778 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2779 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2780 
2781 	alc_auto_parse_customize_define(codec);
2782 
2783 	if (has_cdefine_beep(codec))
2784 		spec->gen.beep_nid = 0x01;
2785 
2786 	/* automatic parse from the BIOS config */
2787 	err = alc882_parse_auto_config(codec);
2788 	if (err < 0)
2789 		goto error;
2790 
2791 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2792 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2793 		if (err < 0)
2794 			goto error;
2795 	}
2796 
2797 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2798 
2799 	return 0;
2800 
2801  error:
2802 	alc_free(codec);
2803 	return err;
2804 }
2805 
2806 
2807 /*
2808  * ALC262 support
2809  */
2810 static int alc262_parse_auto_config(struct hda_codec *codec)
2811 {
2812 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2813 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2814 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2815 }
2816 
2817 /*
2818  * Pin config fixes
2819  */
2820 enum {
2821 	ALC262_FIXUP_FSC_H270,
2822 	ALC262_FIXUP_FSC_S7110,
2823 	ALC262_FIXUP_HP_Z200,
2824 	ALC262_FIXUP_TYAN,
2825 	ALC262_FIXUP_LENOVO_3000,
2826 	ALC262_FIXUP_BENQ,
2827 	ALC262_FIXUP_BENQ_T31,
2828 	ALC262_FIXUP_INV_DMIC,
2829 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2830 };
2831 
2832 static const struct hda_fixup alc262_fixups[] = {
2833 	[ALC262_FIXUP_FSC_H270] = {
2834 		.type = HDA_FIXUP_PINS,
2835 		.v.pins = (const struct hda_pintbl[]) {
2836 			{ 0x14, 0x99130110 }, /* speaker */
2837 			{ 0x15, 0x0221142f }, /* front HP */
2838 			{ 0x1b, 0x0121141f }, /* rear HP */
2839 			{ }
2840 		}
2841 	},
2842 	[ALC262_FIXUP_FSC_S7110] = {
2843 		.type = HDA_FIXUP_PINS,
2844 		.v.pins = (const struct hda_pintbl[]) {
2845 			{ 0x15, 0x90170110 }, /* speaker */
2846 			{ }
2847 		},
2848 		.chained = true,
2849 		.chain_id = ALC262_FIXUP_BENQ,
2850 	},
2851 	[ALC262_FIXUP_HP_Z200] = {
2852 		.type = HDA_FIXUP_PINS,
2853 		.v.pins = (const struct hda_pintbl[]) {
2854 			{ 0x16, 0x99130120 }, /* internal speaker */
2855 			{ }
2856 		}
2857 	},
2858 	[ALC262_FIXUP_TYAN] = {
2859 		.type = HDA_FIXUP_PINS,
2860 		.v.pins = (const struct hda_pintbl[]) {
2861 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2862 			{ }
2863 		}
2864 	},
2865 	[ALC262_FIXUP_LENOVO_3000] = {
2866 		.type = HDA_FIXUP_PINCTLS,
2867 		.v.pins = (const struct hda_pintbl[]) {
2868 			{ 0x19, PIN_VREF50 },
2869 			{}
2870 		},
2871 		.chained = true,
2872 		.chain_id = ALC262_FIXUP_BENQ,
2873 	},
2874 	[ALC262_FIXUP_BENQ] = {
2875 		.type = HDA_FIXUP_VERBS,
2876 		.v.verbs = (const struct hda_verb[]) {
2877 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2878 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2879 			{}
2880 		}
2881 	},
2882 	[ALC262_FIXUP_BENQ_T31] = {
2883 		.type = HDA_FIXUP_VERBS,
2884 		.v.verbs = (const struct hda_verb[]) {
2885 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2886 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2887 			{}
2888 		}
2889 	},
2890 	[ALC262_FIXUP_INV_DMIC] = {
2891 		.type = HDA_FIXUP_FUNC,
2892 		.v.func = alc_fixup_inv_dmic,
2893 	},
2894 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2895 		.type = HDA_FIXUP_FUNC,
2896 		.v.func = alc_fixup_no_depop_delay,
2897 	},
2898 };
2899 
2900 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2901 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2902 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2903 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2904 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2905 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2906 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2907 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2908 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2909 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2910 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2911 	{}
2912 };
2913 
2914 static const struct hda_model_fixup alc262_fixup_models[] = {
2915 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2916 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2917 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2918 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2919 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2920 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2921 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2922 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2923 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2924 	{}
2925 };
2926 
2927 /*
2928  */
2929 static int patch_alc262(struct hda_codec *codec)
2930 {
2931 	struct alc_spec *spec;
2932 	int err;
2933 
2934 	err = alc_alloc_spec(codec, 0x0b);
2935 	if (err < 0)
2936 		return err;
2937 
2938 	spec = codec->spec;
2939 	spec->gen.shared_mic_vref_pin = 0x18;
2940 
2941 	spec->shutup = alc_eapd_shutup;
2942 
2943 #if 0
2944 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2945 	 * under-run
2946 	 */
2947 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2948 #endif
2949 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2950 
2951 	alc_pre_init(codec);
2952 
2953 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2954 		       alc262_fixups);
2955 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2956 
2957 	alc_auto_parse_customize_define(codec);
2958 
2959 	if (has_cdefine_beep(codec))
2960 		spec->gen.beep_nid = 0x01;
2961 
2962 	/* automatic parse from the BIOS config */
2963 	err = alc262_parse_auto_config(codec);
2964 	if (err < 0)
2965 		goto error;
2966 
2967 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2968 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2969 		if (err < 0)
2970 			goto error;
2971 	}
2972 
2973 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2974 
2975 	return 0;
2976 
2977  error:
2978 	alc_free(codec);
2979 	return err;
2980 }
2981 
2982 /*
2983  *  ALC268
2984  */
2985 /* bind Beep switches of both NID 0x0f and 0x10 */
2986 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2987 				  struct snd_ctl_elem_value *ucontrol)
2988 {
2989 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2990 	unsigned long pval;
2991 	int err;
2992 
2993 	mutex_lock(&codec->control_mutex);
2994 	pval = kcontrol->private_value;
2995 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
2996 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2997 	if (err >= 0) {
2998 		kcontrol->private_value = (pval & ~0xff) | 0x10;
2999 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3000 	}
3001 	kcontrol->private_value = pval;
3002 	mutex_unlock(&codec->control_mutex);
3003 	return err;
3004 }
3005 
3006 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3007 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3008 	{
3009 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3010 		.name = "Beep Playback Switch",
3011 		.subdevice = HDA_SUBDEV_AMP_FLAG,
3012 		.info = snd_hda_mixer_amp_switch_info,
3013 		.get = snd_hda_mixer_amp_switch_get,
3014 		.put = alc268_beep_switch_put,
3015 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3016 	},
3017 };
3018 
3019 /* set PCBEEP vol = 0, mute connections */
3020 static const struct hda_verb alc268_beep_init_verbs[] = {
3021 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3022 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3023 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3024 	{ }
3025 };
3026 
3027 enum {
3028 	ALC268_FIXUP_INV_DMIC,
3029 	ALC268_FIXUP_HP_EAPD,
3030 	ALC268_FIXUP_SPDIF,
3031 };
3032 
3033 static const struct hda_fixup alc268_fixups[] = {
3034 	[ALC268_FIXUP_INV_DMIC] = {
3035 		.type = HDA_FIXUP_FUNC,
3036 		.v.func = alc_fixup_inv_dmic,
3037 	},
3038 	[ALC268_FIXUP_HP_EAPD] = {
3039 		.type = HDA_FIXUP_VERBS,
3040 		.v.verbs = (const struct hda_verb[]) {
3041 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3042 			{}
3043 		}
3044 	},
3045 	[ALC268_FIXUP_SPDIF] = {
3046 		.type = HDA_FIXUP_PINS,
3047 		.v.pins = (const struct hda_pintbl[]) {
3048 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3049 			{}
3050 		}
3051 	},
3052 };
3053 
3054 static const struct hda_model_fixup alc268_fixup_models[] = {
3055 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3056 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3057 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3058 	{}
3059 };
3060 
3061 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3062 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3063 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3064 	/* below is codec SSID since multiple Toshiba laptops have the
3065 	 * same PCI SSID 1179:ff00
3066 	 */
3067 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3068 	{}
3069 };
3070 
3071 /*
3072  * BIOS auto configuration
3073  */
3074 static int alc268_parse_auto_config(struct hda_codec *codec)
3075 {
3076 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3077 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3078 }
3079 
3080 /*
3081  */
3082 static int patch_alc268(struct hda_codec *codec)
3083 {
3084 	struct alc_spec *spec;
3085 	int i, err;
3086 
3087 	/* ALC268 has no aa-loopback mixer */
3088 	err = alc_alloc_spec(codec, 0);
3089 	if (err < 0)
3090 		return err;
3091 
3092 	spec = codec->spec;
3093 	if (has_cdefine_beep(codec))
3094 		spec->gen.beep_nid = 0x01;
3095 
3096 	spec->shutup = alc_eapd_shutup;
3097 
3098 	alc_pre_init(codec);
3099 
3100 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3101 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3102 
3103 	/* automatic parse from the BIOS config */
3104 	err = alc268_parse_auto_config(codec);
3105 	if (err < 0)
3106 		goto error;
3107 
3108 	if (err > 0 && !spec->gen.no_analog &&
3109 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3110 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3111 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3112 						  &alc268_beep_mixer[i])) {
3113 				err = -ENOMEM;
3114 				goto error;
3115 			}
3116 		}
3117 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3118 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3119 			/* override the amp caps for beep generator */
3120 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3121 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3122 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3123 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3124 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3125 	}
3126 
3127 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3128 
3129 	return 0;
3130 
3131  error:
3132 	alc_free(codec);
3133 	return err;
3134 }
3135 
3136 /*
3137  * ALC269
3138  */
3139 
3140 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3141 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3142 };
3143 
3144 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3145 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3146 };
3147 
3148 /* different alc269-variants */
3149 enum {
3150 	ALC269_TYPE_ALC269VA,
3151 	ALC269_TYPE_ALC269VB,
3152 	ALC269_TYPE_ALC269VC,
3153 	ALC269_TYPE_ALC269VD,
3154 	ALC269_TYPE_ALC280,
3155 	ALC269_TYPE_ALC282,
3156 	ALC269_TYPE_ALC283,
3157 	ALC269_TYPE_ALC284,
3158 	ALC269_TYPE_ALC293,
3159 	ALC269_TYPE_ALC286,
3160 	ALC269_TYPE_ALC298,
3161 	ALC269_TYPE_ALC255,
3162 	ALC269_TYPE_ALC256,
3163 	ALC269_TYPE_ALC257,
3164 	ALC269_TYPE_ALC215,
3165 	ALC269_TYPE_ALC225,
3166 	ALC269_TYPE_ALC245,
3167 	ALC269_TYPE_ALC287,
3168 	ALC269_TYPE_ALC294,
3169 	ALC269_TYPE_ALC300,
3170 	ALC269_TYPE_ALC623,
3171 	ALC269_TYPE_ALC700,
3172 };
3173 
3174 /*
3175  * BIOS auto configuration
3176  */
3177 static int alc269_parse_auto_config(struct hda_codec *codec)
3178 {
3179 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3180 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3181 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3182 	struct alc_spec *spec = codec->spec;
3183 	const hda_nid_t *ssids;
3184 
3185 	switch (spec->codec_variant) {
3186 	case ALC269_TYPE_ALC269VA:
3187 	case ALC269_TYPE_ALC269VC:
3188 	case ALC269_TYPE_ALC280:
3189 	case ALC269_TYPE_ALC284:
3190 	case ALC269_TYPE_ALC293:
3191 		ssids = alc269va_ssids;
3192 		break;
3193 	case ALC269_TYPE_ALC269VB:
3194 	case ALC269_TYPE_ALC269VD:
3195 	case ALC269_TYPE_ALC282:
3196 	case ALC269_TYPE_ALC283:
3197 	case ALC269_TYPE_ALC286:
3198 	case ALC269_TYPE_ALC298:
3199 	case ALC269_TYPE_ALC255:
3200 	case ALC269_TYPE_ALC256:
3201 	case ALC269_TYPE_ALC257:
3202 	case ALC269_TYPE_ALC215:
3203 	case ALC269_TYPE_ALC225:
3204 	case ALC269_TYPE_ALC245:
3205 	case ALC269_TYPE_ALC287:
3206 	case ALC269_TYPE_ALC294:
3207 	case ALC269_TYPE_ALC300:
3208 	case ALC269_TYPE_ALC623:
3209 	case ALC269_TYPE_ALC700:
3210 		ssids = alc269_ssids;
3211 		break;
3212 	default:
3213 		ssids = alc269_ssids;
3214 		break;
3215 	}
3216 
3217 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3218 }
3219 
3220 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3221 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3222 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3223 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3224 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3225 	{}
3226 };
3227 
3228 static void alc_headset_btn_callback(struct hda_codec *codec,
3229 				     struct hda_jack_callback *jack)
3230 {
3231 	int report = 0;
3232 
3233 	if (jack->unsol_res & (7 << 13))
3234 		report |= SND_JACK_BTN_0;
3235 
3236 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3237 		report |= SND_JACK_BTN_1;
3238 
3239 	/* Volume up key */
3240 	if (jack->unsol_res & (7 << 23))
3241 		report |= SND_JACK_BTN_2;
3242 
3243 	/* Volume down key */
3244 	if (jack->unsol_res & (7 << 10))
3245 		report |= SND_JACK_BTN_3;
3246 
3247 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3248 }
3249 
3250 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3251 {
3252 	struct alc_spec *spec = codec->spec;
3253 
3254 	if (!spec->has_hs_key)
3255 		return;
3256 
3257 	switch (codec->core.vendor_id) {
3258 	case 0x10ec0215:
3259 	case 0x10ec0225:
3260 	case 0x10ec0285:
3261 	case 0x10ec0287:
3262 	case 0x10ec0295:
3263 	case 0x10ec0289:
3264 	case 0x10ec0299:
3265 		alc_write_coef_idx(codec, 0x48, 0x0);
3266 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3267 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3268 		break;
3269 	case 0x10ec0230:
3270 	case 0x10ec0236:
3271 	case 0x10ec0256:
3272 	case 0x10ec0257:
3273 	case 0x19e58326:
3274 		alc_write_coef_idx(codec, 0x48, 0x0);
3275 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3276 		break;
3277 	}
3278 }
3279 
3280 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3281 {
3282 	struct alc_spec *spec = codec->spec;
3283 
3284 	if (!spec->has_hs_key)
3285 		return;
3286 
3287 	switch (codec->core.vendor_id) {
3288 	case 0x10ec0215:
3289 	case 0x10ec0225:
3290 	case 0x10ec0285:
3291 	case 0x10ec0287:
3292 	case 0x10ec0295:
3293 	case 0x10ec0289:
3294 	case 0x10ec0299:
3295 		alc_write_coef_idx(codec, 0x48, 0xd011);
3296 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3297 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3298 		break;
3299 	case 0x10ec0230:
3300 	case 0x10ec0236:
3301 	case 0x10ec0256:
3302 	case 0x10ec0257:
3303 	case 0x19e58326:
3304 		alc_write_coef_idx(codec, 0x48, 0xd011);
3305 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3306 		break;
3307 	}
3308 }
3309 
3310 static void alc_fixup_headset_jack(struct hda_codec *codec,
3311 				    const struct hda_fixup *fix, int action)
3312 {
3313 	struct alc_spec *spec = codec->spec;
3314 	hda_nid_t hp_pin;
3315 
3316 	switch (action) {
3317 	case HDA_FIXUP_ACT_PRE_PROBE:
3318 		spec->has_hs_key = 1;
3319 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3320 						    alc_headset_btn_callback);
3321 		break;
3322 	case HDA_FIXUP_ACT_BUILD:
3323 		hp_pin = alc_get_hp_pin(spec);
3324 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3325 							alc_headset_btn_keymap,
3326 							hp_pin))
3327 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3328 					      false, SND_JACK_HEADSET,
3329 					      alc_headset_btn_keymap);
3330 
3331 		alc_enable_headset_jack_key(codec);
3332 		break;
3333 	}
3334 }
3335 
3336 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3337 {
3338 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3339 }
3340 
3341 static void alc269_shutup(struct hda_codec *codec)
3342 {
3343 	struct alc_spec *spec = codec->spec;
3344 
3345 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3346 		alc269vb_toggle_power_output(codec, 0);
3347 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3348 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3349 		msleep(150);
3350 	}
3351 	alc_shutup_pins(codec);
3352 }
3353 
3354 static const struct coef_fw alc282_coefs[] = {
3355 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3356 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3357 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3358 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3359 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3360 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3361 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3362 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3363 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3364 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3365 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3366 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3367 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3368 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3369 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3370 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3371 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3372 	WRITE_COEF(0x63, 0x2902), /* PLL */
3373 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3374 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3375 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3376 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3377 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3378 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3379 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3380 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3381 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3382 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3383 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3384 	{}
3385 };
3386 
3387 static void alc282_restore_default_value(struct hda_codec *codec)
3388 {
3389 	alc_process_coef_fw(codec, alc282_coefs);
3390 }
3391 
3392 static void alc282_init(struct hda_codec *codec)
3393 {
3394 	struct alc_spec *spec = codec->spec;
3395 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3396 	bool hp_pin_sense;
3397 	int coef78;
3398 
3399 	alc282_restore_default_value(codec);
3400 
3401 	if (!hp_pin)
3402 		return;
3403 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3404 	coef78 = alc_read_coef_idx(codec, 0x78);
3405 
3406 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3407 	/* Headphone capless set to high power mode */
3408 	alc_write_coef_idx(codec, 0x78, 0x9004);
3409 
3410 	if (hp_pin_sense)
3411 		msleep(2);
3412 
3413 	snd_hda_codec_write(codec, hp_pin, 0,
3414 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3415 
3416 	if (hp_pin_sense)
3417 		msleep(85);
3418 
3419 	snd_hda_codec_write(codec, hp_pin, 0,
3420 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3421 
3422 	if (hp_pin_sense)
3423 		msleep(100);
3424 
3425 	/* Headphone capless set to normal mode */
3426 	alc_write_coef_idx(codec, 0x78, coef78);
3427 }
3428 
3429 static void alc282_shutup(struct hda_codec *codec)
3430 {
3431 	struct alc_spec *spec = codec->spec;
3432 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3433 	bool hp_pin_sense;
3434 	int coef78;
3435 
3436 	if (!hp_pin) {
3437 		alc269_shutup(codec);
3438 		return;
3439 	}
3440 
3441 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3442 	coef78 = alc_read_coef_idx(codec, 0x78);
3443 	alc_write_coef_idx(codec, 0x78, 0x9004);
3444 
3445 	if (hp_pin_sense)
3446 		msleep(2);
3447 
3448 	snd_hda_codec_write(codec, hp_pin, 0,
3449 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3450 
3451 	if (hp_pin_sense)
3452 		msleep(85);
3453 
3454 	if (!spec->no_shutup_pins)
3455 		snd_hda_codec_write(codec, hp_pin, 0,
3456 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3457 
3458 	if (hp_pin_sense)
3459 		msleep(100);
3460 
3461 	alc_auto_setup_eapd(codec, false);
3462 	alc_shutup_pins(codec);
3463 	alc_write_coef_idx(codec, 0x78, coef78);
3464 }
3465 
3466 static const struct coef_fw alc283_coefs[] = {
3467 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3468 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3469 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3470 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3471 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3472 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3473 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3474 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3475 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3476 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3477 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3478 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3479 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3480 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3481 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3482 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3483 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3484 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3485 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3486 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3487 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3488 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3489 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3490 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3491 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3492 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3493 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3494 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3495 	WRITE_COEF(0x49, 0x0), /* test mode */
3496 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3497 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3498 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3499 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3500 	{}
3501 };
3502 
3503 static void alc283_restore_default_value(struct hda_codec *codec)
3504 {
3505 	alc_process_coef_fw(codec, alc283_coefs);
3506 }
3507 
3508 static void alc283_init(struct hda_codec *codec)
3509 {
3510 	struct alc_spec *spec = codec->spec;
3511 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3512 	bool hp_pin_sense;
3513 
3514 	alc283_restore_default_value(codec);
3515 
3516 	if (!hp_pin)
3517 		return;
3518 
3519 	msleep(30);
3520 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3521 
3522 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3523 	/* Headphone capless set to high power mode */
3524 	alc_write_coef_idx(codec, 0x43, 0x9004);
3525 
3526 	snd_hda_codec_write(codec, hp_pin, 0,
3527 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3528 
3529 	if (hp_pin_sense)
3530 		msleep(85);
3531 
3532 	snd_hda_codec_write(codec, hp_pin, 0,
3533 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3534 
3535 	if (hp_pin_sense)
3536 		msleep(85);
3537 	/* Index 0x46 Combo jack auto switch control 2 */
3538 	/* 3k pull low control for Headset jack. */
3539 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3540 	/* Headphone capless set to normal mode */
3541 	alc_write_coef_idx(codec, 0x43, 0x9614);
3542 }
3543 
3544 static void alc283_shutup(struct hda_codec *codec)
3545 {
3546 	struct alc_spec *spec = codec->spec;
3547 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3548 	bool hp_pin_sense;
3549 
3550 	if (!hp_pin) {
3551 		alc269_shutup(codec);
3552 		return;
3553 	}
3554 
3555 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3556 
3557 	alc_write_coef_idx(codec, 0x43, 0x9004);
3558 
3559 	/*depop hp during suspend*/
3560 	alc_write_coef_idx(codec, 0x06, 0x2100);
3561 
3562 	snd_hda_codec_write(codec, hp_pin, 0,
3563 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3564 
3565 	if (hp_pin_sense)
3566 		msleep(100);
3567 
3568 	if (!spec->no_shutup_pins)
3569 		snd_hda_codec_write(codec, hp_pin, 0,
3570 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3571 
3572 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3573 
3574 	if (hp_pin_sense)
3575 		msleep(100);
3576 	alc_auto_setup_eapd(codec, false);
3577 	alc_shutup_pins(codec);
3578 	alc_write_coef_idx(codec, 0x43, 0x9614);
3579 }
3580 
3581 static void alc256_init(struct hda_codec *codec)
3582 {
3583 	struct alc_spec *spec = codec->spec;
3584 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3585 	bool hp_pin_sense;
3586 
3587 	if (spec->ultra_low_power) {
3588 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3589 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3590 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3591 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3592 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3593 		msleep(30);
3594 	}
3595 
3596 	if (!hp_pin)
3597 		hp_pin = 0x21;
3598 
3599 	msleep(30);
3600 
3601 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3602 
3603 	if (hp_pin_sense)
3604 		msleep(2);
3605 
3606 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3607 
3608 	snd_hda_codec_write(codec, hp_pin, 0,
3609 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3610 
3611 	if (hp_pin_sense || spec->ultra_low_power)
3612 		msleep(85);
3613 
3614 	snd_hda_codec_write(codec, hp_pin, 0,
3615 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3616 
3617 	if (hp_pin_sense || spec->ultra_low_power)
3618 		msleep(100);
3619 
3620 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3621 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3622 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3623 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3624 	/*
3625 	 * Expose headphone mic (or possibly Line In on some machines) instead
3626 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3627 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3628 	 * this register.
3629 	 */
3630 	alc_write_coef_idx(codec, 0x36, 0x5757);
3631 }
3632 
3633 static void alc256_shutup(struct hda_codec *codec)
3634 {
3635 	struct alc_spec *spec = codec->spec;
3636 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3637 	bool hp_pin_sense;
3638 
3639 	if (!hp_pin)
3640 		hp_pin = 0x21;
3641 
3642 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3643 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3644 
3645 	if (hp_pin_sense)
3646 		msleep(2);
3647 
3648 	snd_hda_codec_write(codec, hp_pin, 0,
3649 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3650 
3651 	if (hp_pin_sense || spec->ultra_low_power)
3652 		msleep(85);
3653 
3654 	/* 3k pull low control for Headset jack. */
3655 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3656 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3657 	 * when booting with headset plugged. So skip setting it for the codec alc257
3658 	 */
3659 	if (spec->en_3kpull_low)
3660 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3661 
3662 	if (!spec->no_shutup_pins)
3663 		snd_hda_codec_write(codec, hp_pin, 0,
3664 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3665 
3666 	if (hp_pin_sense || spec->ultra_low_power)
3667 		msleep(100);
3668 
3669 	alc_auto_setup_eapd(codec, false);
3670 	alc_shutup_pins(codec);
3671 	if (spec->ultra_low_power) {
3672 		msleep(50);
3673 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3674 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3675 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3676 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3677 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3678 		msleep(30);
3679 	}
3680 }
3681 
3682 static void alc285_hp_init(struct hda_codec *codec)
3683 {
3684 	struct alc_spec *spec = codec->spec;
3685 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3686 	int i, val;
3687 	int coef38, coef0d, coef36;
3688 
3689 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3690 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3691 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3692 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3693 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3694 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3695 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3696 
3697 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3698 
3699 	if (hp_pin)
3700 		snd_hda_codec_write(codec, hp_pin, 0,
3701 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3702 
3703 	msleep(130);
3704 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3705 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3706 
3707 	if (hp_pin)
3708 		snd_hda_codec_write(codec, hp_pin, 0,
3709 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3710 	msleep(10);
3711 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3712 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3713 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3714 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3715 
3716 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3717 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3718 	for (i = 0; i < 20 && val & 0x8000; i++) {
3719 		msleep(50);
3720 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3721 	} /* Wait for depop procedure finish  */
3722 
3723 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3724 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3725 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3726 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3727 
3728 	msleep(50);
3729 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3730 }
3731 
3732 static void alc225_init(struct hda_codec *codec)
3733 {
3734 	struct alc_spec *spec = codec->spec;
3735 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3736 	bool hp1_pin_sense, hp2_pin_sense;
3737 
3738 	if (spec->ultra_low_power) {
3739 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3740 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3741 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3742 		msleep(30);
3743 	}
3744 
3745 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3746 		spec->codec_variant != ALC269_TYPE_ALC245)
3747 		/* required only at boot or S3 and S4 resume time */
3748 		if (!spec->done_hp_init ||
3749 			is_s3_resume(codec) ||
3750 			is_s4_resume(codec)) {
3751 			alc285_hp_init(codec);
3752 			spec->done_hp_init = true;
3753 		}
3754 
3755 	if (!hp_pin)
3756 		hp_pin = 0x21;
3757 	msleep(30);
3758 
3759 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3760 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3761 
3762 	if (hp1_pin_sense || hp2_pin_sense)
3763 		msleep(2);
3764 
3765 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3766 
3767 	if (hp1_pin_sense || spec->ultra_low_power)
3768 		snd_hda_codec_write(codec, hp_pin, 0,
3769 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3770 	if (hp2_pin_sense)
3771 		snd_hda_codec_write(codec, 0x16, 0,
3772 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3773 
3774 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3775 		msleep(85);
3776 
3777 	if (hp1_pin_sense || spec->ultra_low_power)
3778 		snd_hda_codec_write(codec, hp_pin, 0,
3779 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3780 	if (hp2_pin_sense)
3781 		snd_hda_codec_write(codec, 0x16, 0,
3782 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3783 
3784 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3785 		msleep(100);
3786 
3787 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3788 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3789 }
3790 
3791 static void alc225_shutup(struct hda_codec *codec)
3792 {
3793 	struct alc_spec *spec = codec->spec;
3794 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3795 	bool hp1_pin_sense, hp2_pin_sense;
3796 
3797 	if (!hp_pin)
3798 		hp_pin = 0x21;
3799 
3800 	alc_disable_headset_jack_key(codec);
3801 	/* 3k pull low control for Headset jack. */
3802 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3803 
3804 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3805 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3806 
3807 	if (hp1_pin_sense || hp2_pin_sense)
3808 		msleep(2);
3809 
3810 	if (hp1_pin_sense || spec->ultra_low_power)
3811 		snd_hda_codec_write(codec, hp_pin, 0,
3812 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3813 	if (hp2_pin_sense)
3814 		snd_hda_codec_write(codec, 0x16, 0,
3815 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3816 
3817 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3818 		msleep(85);
3819 
3820 	if (hp1_pin_sense || spec->ultra_low_power)
3821 		snd_hda_codec_write(codec, hp_pin, 0,
3822 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3823 	if (hp2_pin_sense)
3824 		snd_hda_codec_write(codec, 0x16, 0,
3825 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3826 
3827 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3828 		msleep(100);
3829 
3830 	alc_auto_setup_eapd(codec, false);
3831 	alc_shutup_pins(codec);
3832 	if (spec->ultra_low_power) {
3833 		msleep(50);
3834 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3835 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3836 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3837 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3838 		msleep(30);
3839 	}
3840 
3841 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3842 	alc_enable_headset_jack_key(codec);
3843 }
3844 
3845 static void alc_default_init(struct hda_codec *codec)
3846 {
3847 	struct alc_spec *spec = codec->spec;
3848 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3849 	bool hp_pin_sense;
3850 
3851 	if (!hp_pin)
3852 		return;
3853 
3854 	msleep(30);
3855 
3856 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3857 
3858 	if (hp_pin_sense)
3859 		msleep(2);
3860 
3861 	snd_hda_codec_write(codec, hp_pin, 0,
3862 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3863 
3864 	if (hp_pin_sense)
3865 		msleep(85);
3866 
3867 	snd_hda_codec_write(codec, hp_pin, 0,
3868 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3869 
3870 	if (hp_pin_sense)
3871 		msleep(100);
3872 }
3873 
3874 static void alc_default_shutup(struct hda_codec *codec)
3875 {
3876 	struct alc_spec *spec = codec->spec;
3877 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3878 	bool hp_pin_sense;
3879 
3880 	if (!hp_pin) {
3881 		alc269_shutup(codec);
3882 		return;
3883 	}
3884 
3885 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3886 
3887 	if (hp_pin_sense)
3888 		msleep(2);
3889 
3890 	snd_hda_codec_write(codec, hp_pin, 0,
3891 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3892 
3893 	if (hp_pin_sense)
3894 		msleep(85);
3895 
3896 	if (!spec->no_shutup_pins)
3897 		snd_hda_codec_write(codec, hp_pin, 0,
3898 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3899 
3900 	if (hp_pin_sense)
3901 		msleep(100);
3902 
3903 	alc_auto_setup_eapd(codec, false);
3904 	alc_shutup_pins(codec);
3905 }
3906 
3907 static void alc294_hp_init(struct hda_codec *codec)
3908 {
3909 	struct alc_spec *spec = codec->spec;
3910 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3911 	int i, val;
3912 
3913 	if (!hp_pin)
3914 		return;
3915 
3916 	snd_hda_codec_write(codec, hp_pin, 0,
3917 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3918 
3919 	msleep(100);
3920 
3921 	if (!spec->no_shutup_pins)
3922 		snd_hda_codec_write(codec, hp_pin, 0,
3923 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3924 
3925 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3926 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3927 
3928 	/* Wait for depop procedure finish  */
3929 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3930 	for (i = 0; i < 20 && val & 0x0080; i++) {
3931 		msleep(50);
3932 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3933 	}
3934 	/* Set HP depop to auto mode */
3935 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3936 	msleep(50);
3937 }
3938 
3939 static void alc294_init(struct hda_codec *codec)
3940 {
3941 	struct alc_spec *spec = codec->spec;
3942 
3943 	/* required only at boot or S4 resume time */
3944 	if (!spec->done_hp_init ||
3945 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3946 		alc294_hp_init(codec);
3947 		spec->done_hp_init = true;
3948 	}
3949 	alc_default_init(codec);
3950 }
3951 
3952 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3953 			     unsigned int val)
3954 {
3955 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3956 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3957 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3958 }
3959 
3960 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3961 {
3962 	unsigned int val;
3963 
3964 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3965 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3966 		& 0xffff;
3967 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3968 		<< 16;
3969 	return val;
3970 }
3971 
3972 static void alc5505_dsp_halt(struct hda_codec *codec)
3973 {
3974 	unsigned int val;
3975 
3976 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3977 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3978 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3979 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3980 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3981 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3982 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3983 	val = alc5505_coef_get(codec, 0x6220);
3984 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3985 }
3986 
3987 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3988 {
3989 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
3990 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3991 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3992 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3993 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
3994 	alc5505_coef_set(codec, 0x880c, 0x00000004);
3995 }
3996 
3997 static void alc5505_dsp_init(struct hda_codec *codec)
3998 {
3999 	unsigned int val;
4000 
4001 	alc5505_dsp_halt(codec);
4002 	alc5505_dsp_back_from_halt(codec);
4003 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4004 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
4005 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4006 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4007 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4008 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4009 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4010 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4011 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
4012 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
4013 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4014 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4015 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4016 
4017 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4018 	if (val <= 3)
4019 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4020 	else
4021 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4022 
4023 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4024 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4025 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4026 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4027 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4028 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4029 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4030 
4031 #ifdef HALT_REALTEK_ALC5505
4032 	alc5505_dsp_halt(codec);
4033 #endif
4034 }
4035 
4036 #ifdef HALT_REALTEK_ALC5505
4037 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4038 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4039 #else
4040 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4041 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4042 #endif
4043 
4044 static int alc269_suspend(struct hda_codec *codec)
4045 {
4046 	struct alc_spec *spec = codec->spec;
4047 
4048 	if (spec->has_alc5505_dsp)
4049 		alc5505_dsp_suspend(codec);
4050 
4051 	return alc_suspend(codec);
4052 }
4053 
4054 static int alc269_resume(struct hda_codec *codec)
4055 {
4056 	struct alc_spec *spec = codec->spec;
4057 
4058 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4059 		alc269vb_toggle_power_output(codec, 0);
4060 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4061 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4062 		msleep(150);
4063 	}
4064 
4065 	codec->patch_ops.init(codec);
4066 
4067 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4068 		alc269vb_toggle_power_output(codec, 1);
4069 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4070 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4071 		msleep(200);
4072 	}
4073 
4074 	snd_hda_regmap_sync(codec);
4075 	hda_call_check_power_status(codec, 0x01);
4076 
4077 	/* on some machine, the BIOS will clear the codec gpio data when enter
4078 	 * suspend, and won't restore the data after resume, so we restore it
4079 	 * in the driver.
4080 	 */
4081 	if (spec->gpio_data)
4082 		alc_write_gpio_data(codec);
4083 
4084 	if (spec->has_alc5505_dsp)
4085 		alc5505_dsp_resume(codec);
4086 
4087 	return 0;
4088 }
4089 
4090 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4091 						 const struct hda_fixup *fix, int action)
4092 {
4093 	struct alc_spec *spec = codec->spec;
4094 
4095 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4096 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4097 }
4098 
4099 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4100 						 const struct hda_fixup *fix,
4101 						 int action)
4102 {
4103 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4104 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4105 
4106 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4107 		snd_hda_codec_set_pincfg(codec, 0x19,
4108 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4109 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4110 }
4111 
4112 static void alc269_fixup_hweq(struct hda_codec *codec,
4113 			       const struct hda_fixup *fix, int action)
4114 {
4115 	if (action == HDA_FIXUP_ACT_INIT)
4116 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4117 }
4118 
4119 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4120 				       const struct hda_fixup *fix, int action)
4121 {
4122 	struct alc_spec *spec = codec->spec;
4123 
4124 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4125 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4126 }
4127 
4128 static void alc271_fixup_dmic(struct hda_codec *codec,
4129 			      const struct hda_fixup *fix, int action)
4130 {
4131 	static const struct hda_verb verbs[] = {
4132 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4133 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4134 		{}
4135 	};
4136 	unsigned int cfg;
4137 
4138 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4139 	    strcmp(codec->core.chip_name, "ALC269VB"))
4140 		return;
4141 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4142 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4143 		snd_hda_sequence_write(codec, verbs);
4144 }
4145 
4146 /* Fix the speaker amp after resume, etc */
4147 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4148 					  const struct hda_fixup *fix,
4149 					  int action)
4150 {
4151 	if (action == HDA_FIXUP_ACT_INIT)
4152 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4153 }
4154 
4155 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4156 				 const struct hda_fixup *fix, int action)
4157 {
4158 	struct alc_spec *spec = codec->spec;
4159 
4160 	if (action != HDA_FIXUP_ACT_PROBE)
4161 		return;
4162 
4163 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4164 	 * fix the sample rate of analog I/O to 44.1kHz
4165 	 */
4166 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4167 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4168 }
4169 
4170 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4171 				     const struct hda_fixup *fix, int action)
4172 {
4173 	/* The digital-mic unit sends PDM (differential signal) instead of
4174 	 * the standard PCM, thus you can't record a valid mono stream as is.
4175 	 * Below is a workaround specific to ALC269 to control the dmic
4176 	 * signal source as mono.
4177 	 */
4178 	if (action == HDA_FIXUP_ACT_INIT)
4179 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4180 }
4181 
4182 static void alc269_quanta_automute(struct hda_codec *codec)
4183 {
4184 	snd_hda_gen_update_outputs(codec);
4185 
4186 	alc_write_coef_idx(codec, 0x0c, 0x680);
4187 	alc_write_coef_idx(codec, 0x0c, 0x480);
4188 }
4189 
4190 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4191 				     const struct hda_fixup *fix, int action)
4192 {
4193 	struct alc_spec *spec = codec->spec;
4194 	if (action != HDA_FIXUP_ACT_PROBE)
4195 		return;
4196 	spec->gen.automute_hook = alc269_quanta_automute;
4197 }
4198 
4199 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4200 					 struct hda_jack_callback *jack)
4201 {
4202 	struct alc_spec *spec = codec->spec;
4203 	int vref;
4204 	msleep(200);
4205 	snd_hda_gen_hp_automute(codec, jack);
4206 
4207 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4208 	msleep(100);
4209 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4210 			    vref);
4211 	msleep(500);
4212 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4213 			    vref);
4214 }
4215 
4216 /*
4217  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4218  */
4219 struct hda_alc298_mbxinit {
4220 	unsigned char value_0x23;
4221 	unsigned char value_0x25;
4222 };
4223 
4224 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4225 					 const struct hda_alc298_mbxinit *initval,
4226 					 bool first)
4227 {
4228 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4229 	alc_write_coef_idx(codec, 0x26, 0xb000);
4230 
4231 	if (first)
4232 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4233 
4234 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4235 	alc_write_coef_idx(codec, 0x26, 0xf000);
4236 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4237 
4238 	if (initval->value_0x23 != 0x1e)
4239 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4240 
4241 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4242 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4243 }
4244 
4245 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4246 					   const struct hda_fixup *fix,
4247 					   int action)
4248 {
4249 	/* Initialization magic */
4250 	static const struct hda_alc298_mbxinit dac_init[] = {
4251 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4252 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4253 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4254 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4255 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4256 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4257 		{0x2f, 0x00},
4258 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4259 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4260 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4261 		{}
4262 	};
4263 	const struct hda_alc298_mbxinit *seq;
4264 
4265 	if (action != HDA_FIXUP_ACT_INIT)
4266 		return;
4267 
4268 	/* Start */
4269 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4270 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4271 	alc_write_coef_idx(codec, 0x26, 0xf000);
4272 	alc_write_coef_idx(codec, 0x22, 0x31);
4273 	alc_write_coef_idx(codec, 0x23, 0x0b);
4274 	alc_write_coef_idx(codec, 0x25, 0x00);
4275 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4276 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4277 
4278 	for (seq = dac_init; seq->value_0x23; seq++)
4279 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4280 }
4281 
4282 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4283 				     const struct hda_fixup *fix, int action)
4284 {
4285 	struct alc_spec *spec = codec->spec;
4286 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4287 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4288 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4289 	}
4290 }
4291 
4292 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4293 				bool polarity, bool on)
4294 {
4295 	unsigned int pinval;
4296 
4297 	if (!pin)
4298 		return;
4299 	if (polarity)
4300 		on = !on;
4301 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4302 	pinval &= ~AC_PINCTL_VREFEN;
4303 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4304 	/* temporarily power up/down for setting VREF */
4305 	snd_hda_power_up_pm(codec);
4306 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4307 	snd_hda_power_down_pm(codec);
4308 }
4309 
4310 /* update mute-LED according to the speaker mute state via mic VREF pin */
4311 static int vref_mute_led_set(struct led_classdev *led_cdev,
4312 			     enum led_brightness brightness)
4313 {
4314 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4315 	struct alc_spec *spec = codec->spec;
4316 
4317 	alc_update_vref_led(codec, spec->mute_led_nid,
4318 			    spec->mute_led_polarity, brightness);
4319 	return 0;
4320 }
4321 
4322 /* Make sure the led works even in runtime suspend */
4323 static unsigned int led_power_filter(struct hda_codec *codec,
4324 						  hda_nid_t nid,
4325 						  unsigned int power_state)
4326 {
4327 	struct alc_spec *spec = codec->spec;
4328 
4329 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4330 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4331 		return power_state;
4332 
4333 	/* Set pin ctl again, it might have just been set to 0 */
4334 	snd_hda_set_pin_ctl(codec, nid,
4335 			    snd_hda_codec_get_pin_target(codec, nid));
4336 
4337 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4338 }
4339 
4340 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4341 				     const struct hda_fixup *fix, int action)
4342 {
4343 	struct alc_spec *spec = codec->spec;
4344 	const struct dmi_device *dev = NULL;
4345 
4346 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4347 		return;
4348 
4349 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4350 		int pol, pin;
4351 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4352 			continue;
4353 		if (pin < 0x0a || pin >= 0x10)
4354 			break;
4355 		spec->mute_led_polarity = pol;
4356 		spec->mute_led_nid = pin - 0x0a + 0x18;
4357 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4358 		codec->power_filter = led_power_filter;
4359 		codec_dbg(codec,
4360 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4361 			   spec->mute_led_polarity);
4362 		break;
4363 	}
4364 }
4365 
4366 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4367 					  const struct hda_fixup *fix,
4368 					  int action, hda_nid_t pin)
4369 {
4370 	struct alc_spec *spec = codec->spec;
4371 
4372 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4373 		spec->mute_led_polarity = 0;
4374 		spec->mute_led_nid = pin;
4375 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4376 		codec->power_filter = led_power_filter;
4377 	}
4378 }
4379 
4380 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4381 				const struct hda_fixup *fix, int action)
4382 {
4383 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4384 }
4385 
4386 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4387 				const struct hda_fixup *fix, int action)
4388 {
4389 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4390 }
4391 
4392 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4393 				const struct hda_fixup *fix, int action)
4394 {
4395 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4396 }
4397 
4398 /* update LED status via GPIO */
4399 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4400 				int polarity, bool enabled)
4401 {
4402 	if (polarity)
4403 		enabled = !enabled;
4404 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4405 }
4406 
4407 /* turn on/off mute LED via GPIO per vmaster hook */
4408 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4409 			     enum led_brightness brightness)
4410 {
4411 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4412 	struct alc_spec *spec = codec->spec;
4413 
4414 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4415 			    spec->mute_led_polarity, !brightness);
4416 	return 0;
4417 }
4418 
4419 /* turn on/off mic-mute LED via GPIO per capture hook */
4420 static int micmute_led_set(struct led_classdev *led_cdev,
4421 			   enum led_brightness brightness)
4422 {
4423 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4424 	struct alc_spec *spec = codec->spec;
4425 
4426 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4427 			    spec->micmute_led_polarity, !brightness);
4428 	return 0;
4429 }
4430 
4431 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4432 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4433 				  int action,
4434 				  unsigned int mute_mask,
4435 				  unsigned int micmute_mask)
4436 {
4437 	struct alc_spec *spec = codec->spec;
4438 
4439 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4440 
4441 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4442 		return;
4443 	if (mute_mask) {
4444 		spec->gpio_mute_led_mask = mute_mask;
4445 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4446 	}
4447 	if (micmute_mask) {
4448 		spec->gpio_mic_led_mask = micmute_mask;
4449 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4450 	}
4451 }
4452 
4453 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4454 				const struct hda_fixup *fix, int action)
4455 {
4456 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4457 }
4458 
4459 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4460 				const struct hda_fixup *fix, int action)
4461 {
4462 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4463 }
4464 
4465 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4466 				const struct hda_fixup *fix, int action)
4467 {
4468 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4469 }
4470 
4471 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4472 				const struct hda_fixup *fix, int action)
4473 {
4474 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4475 }
4476 
4477 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4478 				const struct hda_fixup *fix, int action)
4479 {
4480 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4481 }
4482 
4483 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4484 				const struct hda_fixup *fix, int action)
4485 {
4486 	struct alc_spec *spec = codec->spec;
4487 
4488 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4489 		spec->micmute_led_polarity = 1;
4490 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4491 }
4492 
4493 /* turn on/off mic-mute LED per capture hook via VREF change */
4494 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4495 				enum led_brightness brightness)
4496 {
4497 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4498 	struct alc_spec *spec = codec->spec;
4499 
4500 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4501 			    spec->micmute_led_polarity, brightness);
4502 	return 0;
4503 }
4504 
4505 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4506 				const struct hda_fixup *fix, int action)
4507 {
4508 	struct alc_spec *spec = codec->spec;
4509 
4510 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4511 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4512 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4513 		 * enable headphone amp
4514 		 */
4515 		spec->gpio_mask |= 0x10;
4516 		spec->gpio_dir |= 0x10;
4517 		spec->cap_mute_led_nid = 0x18;
4518 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4519 		codec->power_filter = led_power_filter;
4520 	}
4521 }
4522 
4523 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4524 				   const struct hda_fixup *fix, int action)
4525 {
4526 	struct alc_spec *spec = codec->spec;
4527 
4528 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4529 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4530 		spec->cap_mute_led_nid = 0x18;
4531 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4532 		codec->power_filter = led_power_filter;
4533 	}
4534 }
4535 
4536 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4537  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4538  */
4539 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4540 				     const struct hda_fixup *fix, int action)
4541 {
4542 	struct alc_spec *spec = codec->spec;
4543 
4544 	switch (action) {
4545 	case HDA_FIXUP_ACT_PRE_PROBE:
4546 		spec->gpio_mask |= 0x01;
4547 		spec->gpio_dir |= 0x01;
4548 		break;
4549 	case HDA_FIXUP_ACT_INIT:
4550 		/* need to toggle GPIO to enable the amp */
4551 		alc_update_gpio_data(codec, 0x01, true);
4552 		msleep(100);
4553 		alc_update_gpio_data(codec, 0x01, false);
4554 		break;
4555 	}
4556 }
4557 
4558 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4559 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4560 				    struct hda_codec *codec,
4561 				    struct snd_pcm_substream *substream,
4562 				    int action)
4563 {
4564 	switch (action) {
4565 	case HDA_GEN_PCM_ACT_PREPARE:
4566 		alc_update_gpio_data(codec, 0x04, true);
4567 		break;
4568 	case HDA_GEN_PCM_ACT_CLEANUP:
4569 		alc_update_gpio_data(codec, 0x04, false);
4570 		break;
4571 	}
4572 }
4573 
4574 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4575 				      const struct hda_fixup *fix,
4576 				      int action)
4577 {
4578 	struct alc_spec *spec = codec->spec;
4579 
4580 	if (action == HDA_FIXUP_ACT_PROBE) {
4581 		spec->gpio_mask |= 0x04;
4582 		spec->gpio_dir |= 0x04;
4583 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4584 	}
4585 }
4586 
4587 static void alc_update_coef_led(struct hda_codec *codec,
4588 				struct alc_coef_led *led,
4589 				bool polarity, bool on)
4590 {
4591 	if (polarity)
4592 		on = !on;
4593 	/* temporarily power up/down for setting COEF bit */
4594 	alc_update_coef_idx(codec, led->idx, led->mask,
4595 			    on ? led->on : led->off);
4596 }
4597 
4598 /* update mute-LED according to the speaker mute state via COEF bit */
4599 static int coef_mute_led_set(struct led_classdev *led_cdev,
4600 			     enum led_brightness brightness)
4601 {
4602 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4603 	struct alc_spec *spec = codec->spec;
4604 
4605 	alc_update_coef_led(codec, &spec->mute_led_coef,
4606 			    spec->mute_led_polarity, brightness);
4607 	return 0;
4608 }
4609 
4610 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4611 					  const struct hda_fixup *fix,
4612 					  int action)
4613 {
4614 	struct alc_spec *spec = codec->spec;
4615 
4616 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4617 		spec->mute_led_polarity = 0;
4618 		spec->mute_led_coef.idx = 0x0b;
4619 		spec->mute_led_coef.mask = 1 << 3;
4620 		spec->mute_led_coef.on = 1 << 3;
4621 		spec->mute_led_coef.off = 0;
4622 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4623 	}
4624 }
4625 
4626 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4627 					  const struct hda_fixup *fix,
4628 					  int action)
4629 {
4630 	struct alc_spec *spec = codec->spec;
4631 
4632 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4633 		spec->mute_led_polarity = 0;
4634 		spec->mute_led_coef.idx = 0x34;
4635 		spec->mute_led_coef.mask = 1 << 5;
4636 		spec->mute_led_coef.on = 0;
4637 		spec->mute_led_coef.off = 1 << 5;
4638 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4639 	}
4640 }
4641 
4642 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4643 					  const struct hda_fixup *fix, int action)
4644 {
4645 	struct alc_spec *spec = codec->spec;
4646 
4647 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4648 		spec->mute_led_polarity = 0;
4649 		spec->mute_led_coef.idx = 0x07;
4650 		spec->mute_led_coef.mask = 1;
4651 		spec->mute_led_coef.on = 1;
4652 		spec->mute_led_coef.off = 0;
4653 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4654 	}
4655 }
4656 
4657 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4658 					  const struct hda_fixup *fix,
4659 					  int action)
4660 {
4661 	struct alc_spec *spec = codec->spec;
4662 
4663 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4664 		spec->mute_led_polarity = 0;
4665 		spec->mute_led_coef.idx = 0x0b;
4666 		spec->mute_led_coef.mask = 3 << 2;
4667 		spec->mute_led_coef.on = 2 << 2;
4668 		spec->mute_led_coef.off = 1 << 2;
4669 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4670 	}
4671 }
4672 
4673 /* turn on/off mic-mute LED per capture hook by coef bit */
4674 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4675 				enum led_brightness brightness)
4676 {
4677 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4678 	struct alc_spec *spec = codec->spec;
4679 
4680 	alc_update_coef_led(codec, &spec->mic_led_coef,
4681 			    spec->micmute_led_polarity, brightness);
4682 	return 0;
4683 }
4684 
4685 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4686 				const struct hda_fixup *fix, int action)
4687 {
4688 	struct alc_spec *spec = codec->spec;
4689 
4690 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4691 		spec->mic_led_coef.idx = 0x19;
4692 		spec->mic_led_coef.mask = 1 << 13;
4693 		spec->mic_led_coef.on = 1 << 13;
4694 		spec->mic_led_coef.off = 0;
4695 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4696 	}
4697 }
4698 
4699 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4700 				const struct hda_fixup *fix, int action)
4701 {
4702 	struct alc_spec *spec = codec->spec;
4703 
4704 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4705 		spec->micmute_led_polarity = 1;
4706 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4707 }
4708 
4709 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4710 				const struct hda_fixup *fix, int action)
4711 {
4712 	struct alc_spec *spec = codec->spec;
4713 
4714 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4715 		spec->mic_led_coef.idx = 0x35;
4716 		spec->mic_led_coef.mask = 3 << 2;
4717 		spec->mic_led_coef.on = 2 << 2;
4718 		spec->mic_led_coef.off = 1 << 2;
4719 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4720 	}
4721 }
4722 
4723 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4724 				const struct hda_fixup *fix, int action)
4725 {
4726 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4727 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4728 }
4729 
4730 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4731 				const struct hda_fixup *fix, int action)
4732 {
4733 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4734 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4735 }
4736 
4737 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4738 				const struct hda_fixup *fix, int action)
4739 {
4740 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4741 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4742 }
4743 
4744 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4745 				const struct hda_fixup *fix, int action)
4746 {
4747 	struct alc_spec *spec = codec->spec;
4748 
4749 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4750 		spec->cap_mute_led_nid = 0x1a;
4751 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4752 		codec->power_filter = led_power_filter;
4753 	}
4754 }
4755 
4756 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4757 				const struct hda_fixup *fix, int action)
4758 {
4759 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4760 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4761 }
4762 
4763 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4764 						  const unsigned short coefs[2])
4765 {
4766 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4767 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4768 	alc_write_coef_idx(codec, 0x26, 0xb011);
4769 }
4770 
4771 struct alc298_samsung_amp_desc {
4772 	unsigned char nid;
4773 	unsigned short init_seq[2][2];
4774 };
4775 
4776 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4777 				     const struct hda_fixup *fix, int action)
4778 {
4779 	int i, j;
4780 	static const unsigned short init_seq[][2] = {
4781 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4782 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4783 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4784 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4785 	};
4786 	static const struct alc298_samsung_amp_desc amps[] = {
4787 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4788 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4789 	};
4790 
4791 	if (action != HDA_FIXUP_ACT_INIT)
4792 		return;
4793 
4794 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4795 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4796 
4797 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4798 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4799 
4800 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4801 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4802 	}
4803 }
4804 
4805 #include "samsung_helper.c"
4806 
4807 #if IS_REACHABLE(CONFIG_INPUT)
4808 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4809 				   struct hda_jack_callback *event)
4810 {
4811 	struct alc_spec *spec = codec->spec;
4812 
4813 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4814 	   send both key on and key off event for every interrupt. */
4815 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4816 	input_sync(spec->kb_dev);
4817 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4818 	input_sync(spec->kb_dev);
4819 }
4820 
4821 static int alc_register_micmute_input_device(struct hda_codec *codec)
4822 {
4823 	struct alc_spec *spec = codec->spec;
4824 	int i;
4825 
4826 	spec->kb_dev = input_allocate_device();
4827 	if (!spec->kb_dev) {
4828 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4829 		return -ENOMEM;
4830 	}
4831 
4832 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4833 
4834 	spec->kb_dev->name = "Microphone Mute Button";
4835 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4836 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4837 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4838 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4839 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4840 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4841 
4842 	if (input_register_device(spec->kb_dev)) {
4843 		codec_err(codec, "input_register_device failed\n");
4844 		input_free_device(spec->kb_dev);
4845 		spec->kb_dev = NULL;
4846 		return -ENOMEM;
4847 	}
4848 
4849 	return 0;
4850 }
4851 
4852 /* GPIO1 = set according to SKU external amp
4853  * GPIO2 = mic mute hotkey
4854  * GPIO3 = mute LED
4855  * GPIO4 = mic mute LED
4856  */
4857 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4858 					     const struct hda_fixup *fix, int action)
4859 {
4860 	struct alc_spec *spec = codec->spec;
4861 
4862 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4863 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4864 		spec->init_amp = ALC_INIT_DEFAULT;
4865 		if (alc_register_micmute_input_device(codec) != 0)
4866 			return;
4867 
4868 		spec->gpio_mask |= 0x06;
4869 		spec->gpio_dir |= 0x02;
4870 		spec->gpio_data |= 0x02;
4871 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4872 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4873 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4874 						    gpio2_mic_hotkey_event);
4875 		return;
4876 	}
4877 
4878 	if (!spec->kb_dev)
4879 		return;
4880 
4881 	switch (action) {
4882 	case HDA_FIXUP_ACT_FREE:
4883 		input_unregister_device(spec->kb_dev);
4884 		spec->kb_dev = NULL;
4885 	}
4886 }
4887 
4888 /* Line2 = mic mute hotkey
4889  * GPIO2 = mic mute LED
4890  */
4891 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4892 					     const struct hda_fixup *fix, int action)
4893 {
4894 	struct alc_spec *spec = codec->spec;
4895 
4896 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4897 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4898 		spec->init_amp = ALC_INIT_DEFAULT;
4899 		if (alc_register_micmute_input_device(codec) != 0)
4900 			return;
4901 
4902 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
4903 						    gpio2_mic_hotkey_event);
4904 		return;
4905 	}
4906 
4907 	if (!spec->kb_dev)
4908 		return;
4909 
4910 	switch (action) {
4911 	case HDA_FIXUP_ACT_FREE:
4912 		input_unregister_device(spec->kb_dev);
4913 		spec->kb_dev = NULL;
4914 	}
4915 }
4916 #else /* INPUT */
4917 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
4918 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
4919 #endif /* INPUT */
4920 
4921 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4922 				const struct hda_fixup *fix, int action)
4923 {
4924 	struct alc_spec *spec = codec->spec;
4925 
4926 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4927 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4928 		spec->cap_mute_led_nid = 0x18;
4929 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4930 	}
4931 }
4932 
4933 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
4934 {
4935 	if (delay <= 0)
4936 		delay = 75;
4937 	snd_hda_codec_write(codec, 0x21, 0,
4938 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4939 	msleep(delay);
4940 	snd_hda_codec_write(codec, 0x21, 0,
4941 		    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4942 	msleep(delay);
4943 }
4944 
4945 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
4946 {
4947 	if (delay <= 0)
4948 		delay = 75;
4949 	snd_hda_codec_write(codec, 0x21, 0,
4950 		    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4951 	msleep(delay);
4952 	snd_hda_codec_write(codec, 0x21, 0,
4953 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4954 	msleep(delay);
4955 }
4956 
4957 static const struct coef_fw alc225_pre_hsmode[] = {
4958 	UPDATE_COEF(0x4a, 1<<8, 0),
4959 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4960 	UPDATE_COEF(0x63, 3<<14, 3<<14),
4961 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
4962 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
4963 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4964 	UPDATE_COEF(0x4a, 3<<10, 0),
4965 	{}
4966 };
4967 
4968 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4969 {
4970 	struct alc_spec *spec = codec->spec;
4971 	static const struct coef_fw coef0255[] = {
4972 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4973 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4974 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4975 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4976 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4977 		{}
4978 	};
4979 	static const struct coef_fw coef0256[] = {
4980 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4981 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4982 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4983 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4984 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4985 		{}
4986 	};
4987 	static const struct coef_fw coef0233[] = {
4988 		WRITE_COEF(0x1b, 0x0c0b),
4989 		WRITE_COEF(0x45, 0xc429),
4990 		UPDATE_COEF(0x35, 0x4000, 0),
4991 		WRITE_COEF(0x06, 0x2104),
4992 		WRITE_COEF(0x1a, 0x0001),
4993 		WRITE_COEF(0x26, 0x0004),
4994 		WRITE_COEF(0x32, 0x42a3),
4995 		{}
4996 	};
4997 	static const struct coef_fw coef0288[] = {
4998 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4999 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5000 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5001 		UPDATE_COEF(0x66, 0x0008, 0),
5002 		UPDATE_COEF(0x67, 0x2000, 0),
5003 		{}
5004 	};
5005 	static const struct coef_fw coef0298[] = {
5006 		UPDATE_COEF(0x19, 0x1300, 0x0300),
5007 		{}
5008 	};
5009 	static const struct coef_fw coef0292[] = {
5010 		WRITE_COEF(0x76, 0x000e),
5011 		WRITE_COEF(0x6c, 0x2400),
5012 		WRITE_COEF(0x18, 0x7308),
5013 		WRITE_COEF(0x6b, 0xc429),
5014 		{}
5015 	};
5016 	static const struct coef_fw coef0293[] = {
5017 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
5018 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
5019 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
5020 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
5021 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5022 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5023 		{}
5024 	};
5025 	static const struct coef_fw coef0668[] = {
5026 		WRITE_COEF(0x15, 0x0d40),
5027 		WRITE_COEF(0xb7, 0x802b),
5028 		{}
5029 	};
5030 	static const struct coef_fw coef0225[] = {
5031 		UPDATE_COEF(0x63, 3<<14, 0),
5032 		{}
5033 	};
5034 	static const struct coef_fw coef0274[] = {
5035 		UPDATE_COEF(0x4a, 0x0100, 0),
5036 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5037 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
5038 		UPDATE_COEF(0x4a, 0x0010, 0),
5039 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5040 		WRITE_COEF(0x45, 0x5289),
5041 		UPDATE_COEF(0x4a, 0x0c00, 0),
5042 		{}
5043 	};
5044 
5045 	if (spec->no_internal_mic_pin) {
5046 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5047 		return;
5048 	}
5049 
5050 	switch (codec->core.vendor_id) {
5051 	case 0x10ec0255:
5052 		alc_process_coef_fw(codec, coef0255);
5053 		break;
5054 	case 0x10ec0230:
5055 	case 0x10ec0236:
5056 	case 0x10ec0256:
5057 	case 0x19e58326:
5058 		alc_hp_mute_disable(codec, 75);
5059 		alc_process_coef_fw(codec, coef0256);
5060 		break;
5061 	case 0x10ec0234:
5062 	case 0x10ec0274:
5063 	case 0x10ec0294:
5064 		alc_process_coef_fw(codec, coef0274);
5065 		break;
5066 	case 0x10ec0233:
5067 	case 0x10ec0283:
5068 		alc_process_coef_fw(codec, coef0233);
5069 		break;
5070 	case 0x10ec0286:
5071 	case 0x10ec0288:
5072 		alc_process_coef_fw(codec, coef0288);
5073 		break;
5074 	case 0x10ec0298:
5075 		alc_process_coef_fw(codec, coef0298);
5076 		alc_process_coef_fw(codec, coef0288);
5077 		break;
5078 	case 0x10ec0292:
5079 		alc_process_coef_fw(codec, coef0292);
5080 		break;
5081 	case 0x10ec0293:
5082 		alc_process_coef_fw(codec, coef0293);
5083 		break;
5084 	case 0x10ec0668:
5085 		alc_process_coef_fw(codec, coef0668);
5086 		break;
5087 	case 0x10ec0215:
5088 	case 0x10ec0225:
5089 	case 0x10ec0285:
5090 	case 0x10ec0295:
5091 	case 0x10ec0289:
5092 	case 0x10ec0299:
5093 		alc_hp_mute_disable(codec, 75);
5094 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5095 		alc_process_coef_fw(codec, coef0225);
5096 		break;
5097 	case 0x10ec0867:
5098 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5099 		break;
5100 	}
5101 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5102 }
5103 
5104 
5105 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5106 				    hda_nid_t mic_pin)
5107 {
5108 	static const struct coef_fw coef0255[] = {
5109 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5110 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5111 		{}
5112 	};
5113 	static const struct coef_fw coef0256[] = {
5114 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5115 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5116 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5117 		{}
5118 	};
5119 	static const struct coef_fw coef0233[] = {
5120 		UPDATE_COEF(0x35, 0, 1<<14),
5121 		WRITE_COEF(0x06, 0x2100),
5122 		WRITE_COEF(0x1a, 0x0021),
5123 		WRITE_COEF(0x26, 0x008c),
5124 		{}
5125 	};
5126 	static const struct coef_fw coef0288[] = {
5127 		UPDATE_COEF(0x4f, 0x00c0, 0),
5128 		UPDATE_COEF(0x50, 0x2000, 0),
5129 		UPDATE_COEF(0x56, 0x0006, 0),
5130 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5131 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5132 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5133 		{}
5134 	};
5135 	static const struct coef_fw coef0292[] = {
5136 		WRITE_COEF(0x19, 0xa208),
5137 		WRITE_COEF(0x2e, 0xacf0),
5138 		{}
5139 	};
5140 	static const struct coef_fw coef0293[] = {
5141 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5142 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5143 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5144 		{}
5145 	};
5146 	static const struct coef_fw coef0688[] = {
5147 		WRITE_COEF(0xb7, 0x802b),
5148 		WRITE_COEF(0xb5, 0x1040),
5149 		UPDATE_COEF(0xc3, 0, 1<<12),
5150 		{}
5151 	};
5152 	static const struct coef_fw coef0225[] = {
5153 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5154 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5155 		UPDATE_COEF(0x63, 3<<14, 0),
5156 		{}
5157 	};
5158 	static const struct coef_fw coef0274[] = {
5159 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5160 		UPDATE_COEF(0x4a, 0x0010, 0),
5161 		UPDATE_COEF(0x6b, 0xf000, 0),
5162 		{}
5163 	};
5164 
5165 	switch (codec->core.vendor_id) {
5166 	case 0x10ec0255:
5167 		alc_write_coef_idx(codec, 0x45, 0xc489);
5168 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5169 		alc_process_coef_fw(codec, coef0255);
5170 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5171 		break;
5172 	case 0x10ec0230:
5173 	case 0x10ec0236:
5174 	case 0x10ec0256:
5175 	case 0x19e58326:
5176 		alc_write_coef_idx(codec, 0x45, 0xc489);
5177 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5178 		alc_process_coef_fw(codec, coef0256);
5179 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5180 		break;
5181 	case 0x10ec0234:
5182 	case 0x10ec0274:
5183 	case 0x10ec0294:
5184 		alc_write_coef_idx(codec, 0x45, 0x4689);
5185 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5186 		alc_process_coef_fw(codec, coef0274);
5187 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5188 		break;
5189 	case 0x10ec0233:
5190 	case 0x10ec0283:
5191 		alc_write_coef_idx(codec, 0x45, 0xc429);
5192 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5193 		alc_process_coef_fw(codec, coef0233);
5194 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5195 		break;
5196 	case 0x10ec0286:
5197 	case 0x10ec0288:
5198 	case 0x10ec0298:
5199 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5200 		alc_process_coef_fw(codec, coef0288);
5201 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5202 		break;
5203 	case 0x10ec0292:
5204 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5205 		alc_process_coef_fw(codec, coef0292);
5206 		break;
5207 	case 0x10ec0293:
5208 		/* Set to TRS mode */
5209 		alc_write_coef_idx(codec, 0x45, 0xc429);
5210 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5211 		alc_process_coef_fw(codec, coef0293);
5212 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5213 		break;
5214 	case 0x10ec0867:
5215 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5216 		fallthrough;
5217 	case 0x10ec0221:
5218 	case 0x10ec0662:
5219 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5220 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5221 		break;
5222 	case 0x10ec0668:
5223 		alc_write_coef_idx(codec, 0x11, 0x0001);
5224 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5225 		alc_process_coef_fw(codec, coef0688);
5226 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5227 		break;
5228 	case 0x10ec0215:
5229 	case 0x10ec0225:
5230 	case 0x10ec0285:
5231 	case 0x10ec0295:
5232 	case 0x10ec0289:
5233 	case 0x10ec0299:
5234 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5235 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5236 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5237 		alc_process_coef_fw(codec, coef0225);
5238 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5239 		break;
5240 	}
5241 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5242 }
5243 
5244 static void alc_headset_mode_default(struct hda_codec *codec)
5245 {
5246 	static const struct coef_fw coef0225[] = {
5247 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5248 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5249 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5250 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5251 		UPDATE_COEF(0x63, 3<<14, 0),
5252 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5253 		{}
5254 	};
5255 	static const struct coef_fw coef0255[] = {
5256 		WRITE_COEF(0x45, 0xc089),
5257 		WRITE_COEF(0x45, 0xc489),
5258 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5259 		WRITE_COEF(0x49, 0x0049),
5260 		{}
5261 	};
5262 	static const struct coef_fw coef0256[] = {
5263 		WRITE_COEF(0x45, 0xc489),
5264 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5265 		WRITE_COEF(0x49, 0x0049),
5266 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5267 		WRITE_COEF(0x06, 0x6100),
5268 		{}
5269 	};
5270 	static const struct coef_fw coef0233[] = {
5271 		WRITE_COEF(0x06, 0x2100),
5272 		WRITE_COEF(0x32, 0x4ea3),
5273 		{}
5274 	};
5275 	static const struct coef_fw coef0288[] = {
5276 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5277 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5278 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5279 		UPDATE_COEF(0x66, 0x0008, 0),
5280 		UPDATE_COEF(0x67, 0x2000, 0),
5281 		{}
5282 	};
5283 	static const struct coef_fw coef0292[] = {
5284 		WRITE_COEF(0x76, 0x000e),
5285 		WRITE_COEF(0x6c, 0x2400),
5286 		WRITE_COEF(0x6b, 0xc429),
5287 		WRITE_COEF(0x18, 0x7308),
5288 		{}
5289 	};
5290 	static const struct coef_fw coef0293[] = {
5291 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5292 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5293 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5294 		{}
5295 	};
5296 	static const struct coef_fw coef0688[] = {
5297 		WRITE_COEF(0x11, 0x0041),
5298 		WRITE_COEF(0x15, 0x0d40),
5299 		WRITE_COEF(0xb7, 0x802b),
5300 		{}
5301 	};
5302 	static const struct coef_fw coef0274[] = {
5303 		WRITE_COEF(0x45, 0x4289),
5304 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5305 		UPDATE_COEF(0x6b, 0x0f00, 0),
5306 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5307 		{}
5308 	};
5309 
5310 	switch (codec->core.vendor_id) {
5311 	case 0x10ec0215:
5312 	case 0x10ec0225:
5313 	case 0x10ec0285:
5314 	case 0x10ec0295:
5315 	case 0x10ec0289:
5316 	case 0x10ec0299:
5317 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5318 		alc_process_coef_fw(codec, coef0225);
5319 		alc_hp_enable_unmute(codec, 75);
5320 		break;
5321 	case 0x10ec0255:
5322 		alc_process_coef_fw(codec, coef0255);
5323 		break;
5324 	case 0x10ec0230:
5325 	case 0x10ec0236:
5326 	case 0x10ec0256:
5327 	case 0x19e58326:
5328 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5329 		alc_write_coef_idx(codec, 0x45, 0xc089);
5330 		msleep(50);
5331 		alc_process_coef_fw(codec, coef0256);
5332 		alc_hp_enable_unmute(codec, 75);
5333 		break;
5334 	case 0x10ec0234:
5335 	case 0x10ec0274:
5336 	case 0x10ec0294:
5337 		alc_process_coef_fw(codec, coef0274);
5338 		break;
5339 	case 0x10ec0233:
5340 	case 0x10ec0283:
5341 		alc_process_coef_fw(codec, coef0233);
5342 		break;
5343 	case 0x10ec0286:
5344 	case 0x10ec0288:
5345 	case 0x10ec0298:
5346 		alc_process_coef_fw(codec, coef0288);
5347 		break;
5348 	case 0x10ec0292:
5349 		alc_process_coef_fw(codec, coef0292);
5350 		break;
5351 	case 0x10ec0293:
5352 		alc_process_coef_fw(codec, coef0293);
5353 		break;
5354 	case 0x10ec0668:
5355 		alc_process_coef_fw(codec, coef0688);
5356 		break;
5357 	case 0x10ec0867:
5358 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5359 		break;
5360 	}
5361 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5362 }
5363 
5364 /* Iphone type */
5365 static void alc_headset_mode_ctia(struct hda_codec *codec)
5366 {
5367 	int val;
5368 
5369 	static const struct coef_fw coef0255[] = {
5370 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5371 		WRITE_COEF(0x1b, 0x0c2b),
5372 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5373 		{}
5374 	};
5375 	static const struct coef_fw coef0256[] = {
5376 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5377 		WRITE_COEF(0x1b, 0x0e6b),
5378 		{}
5379 	};
5380 	static const struct coef_fw coef0233[] = {
5381 		WRITE_COEF(0x45, 0xd429),
5382 		WRITE_COEF(0x1b, 0x0c2b),
5383 		WRITE_COEF(0x32, 0x4ea3),
5384 		{}
5385 	};
5386 	static const struct coef_fw coef0288[] = {
5387 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5388 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5389 		UPDATE_COEF(0x66, 0x0008, 0),
5390 		UPDATE_COEF(0x67, 0x2000, 0),
5391 		{}
5392 	};
5393 	static const struct coef_fw coef0292[] = {
5394 		WRITE_COEF(0x6b, 0xd429),
5395 		WRITE_COEF(0x76, 0x0008),
5396 		WRITE_COEF(0x18, 0x7388),
5397 		{}
5398 	};
5399 	static const struct coef_fw coef0293[] = {
5400 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5401 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5402 		{}
5403 	};
5404 	static const struct coef_fw coef0688[] = {
5405 		WRITE_COEF(0x11, 0x0001),
5406 		WRITE_COEF(0x15, 0x0d60),
5407 		WRITE_COEF(0xc3, 0x0000),
5408 		{}
5409 	};
5410 	static const struct coef_fw coef0225_1[] = {
5411 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5412 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5413 		{}
5414 	};
5415 	static const struct coef_fw coef0225_2[] = {
5416 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5417 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5418 		{}
5419 	};
5420 
5421 	switch (codec->core.vendor_id) {
5422 	case 0x10ec0255:
5423 		alc_process_coef_fw(codec, coef0255);
5424 		break;
5425 	case 0x10ec0230:
5426 	case 0x10ec0236:
5427 	case 0x10ec0256:
5428 	case 0x19e58326:
5429 		alc_process_coef_fw(codec, coef0256);
5430 		alc_hp_enable_unmute(codec, 75);
5431 		break;
5432 	case 0x10ec0234:
5433 	case 0x10ec0274:
5434 	case 0x10ec0294:
5435 		alc_write_coef_idx(codec, 0x45, 0xd689);
5436 		break;
5437 	case 0x10ec0233:
5438 	case 0x10ec0283:
5439 		alc_process_coef_fw(codec, coef0233);
5440 		break;
5441 	case 0x10ec0298:
5442 		val = alc_read_coef_idx(codec, 0x50);
5443 		if (val & (1 << 12)) {
5444 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5445 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5446 			msleep(300);
5447 		} else {
5448 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5449 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5450 			msleep(300);
5451 		}
5452 		break;
5453 	case 0x10ec0286:
5454 	case 0x10ec0288:
5455 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5456 		msleep(300);
5457 		alc_process_coef_fw(codec, coef0288);
5458 		break;
5459 	case 0x10ec0292:
5460 		alc_process_coef_fw(codec, coef0292);
5461 		break;
5462 	case 0x10ec0293:
5463 		alc_process_coef_fw(codec, coef0293);
5464 		break;
5465 	case 0x10ec0668:
5466 		alc_process_coef_fw(codec, coef0688);
5467 		break;
5468 	case 0x10ec0215:
5469 	case 0x10ec0225:
5470 	case 0x10ec0285:
5471 	case 0x10ec0295:
5472 	case 0x10ec0289:
5473 	case 0x10ec0299:
5474 		val = alc_read_coef_idx(codec, 0x45);
5475 		if (val & (1 << 9))
5476 			alc_process_coef_fw(codec, coef0225_2);
5477 		else
5478 			alc_process_coef_fw(codec, coef0225_1);
5479 		alc_hp_enable_unmute(codec, 75);
5480 		break;
5481 	case 0x10ec0867:
5482 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5483 		break;
5484 	}
5485 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5486 }
5487 
5488 /* Nokia type */
5489 static void alc_headset_mode_omtp(struct hda_codec *codec)
5490 {
5491 	static const struct coef_fw coef0255[] = {
5492 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5493 		WRITE_COEF(0x1b, 0x0c2b),
5494 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5495 		{}
5496 	};
5497 	static const struct coef_fw coef0256[] = {
5498 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5499 		WRITE_COEF(0x1b, 0x0e6b),
5500 		{}
5501 	};
5502 	static const struct coef_fw coef0233[] = {
5503 		WRITE_COEF(0x45, 0xe429),
5504 		WRITE_COEF(0x1b, 0x0c2b),
5505 		WRITE_COEF(0x32, 0x4ea3),
5506 		{}
5507 	};
5508 	static const struct coef_fw coef0288[] = {
5509 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5510 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5511 		UPDATE_COEF(0x66, 0x0008, 0),
5512 		UPDATE_COEF(0x67, 0x2000, 0),
5513 		{}
5514 	};
5515 	static const struct coef_fw coef0292[] = {
5516 		WRITE_COEF(0x6b, 0xe429),
5517 		WRITE_COEF(0x76, 0x0008),
5518 		WRITE_COEF(0x18, 0x7388),
5519 		{}
5520 	};
5521 	static const struct coef_fw coef0293[] = {
5522 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5523 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5524 		{}
5525 	};
5526 	static const struct coef_fw coef0688[] = {
5527 		WRITE_COEF(0x11, 0x0001),
5528 		WRITE_COEF(0x15, 0x0d50),
5529 		WRITE_COEF(0xc3, 0x0000),
5530 		{}
5531 	};
5532 	static const struct coef_fw coef0225[] = {
5533 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5534 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5535 		{}
5536 	};
5537 
5538 	switch (codec->core.vendor_id) {
5539 	case 0x10ec0255:
5540 		alc_process_coef_fw(codec, coef0255);
5541 		break;
5542 	case 0x10ec0230:
5543 	case 0x10ec0236:
5544 	case 0x10ec0256:
5545 	case 0x19e58326:
5546 		alc_process_coef_fw(codec, coef0256);
5547 		alc_hp_enable_unmute(codec, 75);
5548 		break;
5549 	case 0x10ec0234:
5550 	case 0x10ec0274:
5551 	case 0x10ec0294:
5552 		alc_write_coef_idx(codec, 0x45, 0xe689);
5553 		break;
5554 	case 0x10ec0233:
5555 	case 0x10ec0283:
5556 		alc_process_coef_fw(codec, coef0233);
5557 		break;
5558 	case 0x10ec0298:
5559 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5560 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5561 		msleep(300);
5562 		break;
5563 	case 0x10ec0286:
5564 	case 0x10ec0288:
5565 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5566 		msleep(300);
5567 		alc_process_coef_fw(codec, coef0288);
5568 		break;
5569 	case 0x10ec0292:
5570 		alc_process_coef_fw(codec, coef0292);
5571 		break;
5572 	case 0x10ec0293:
5573 		alc_process_coef_fw(codec, coef0293);
5574 		break;
5575 	case 0x10ec0668:
5576 		alc_process_coef_fw(codec, coef0688);
5577 		break;
5578 	case 0x10ec0215:
5579 	case 0x10ec0225:
5580 	case 0x10ec0285:
5581 	case 0x10ec0295:
5582 	case 0x10ec0289:
5583 	case 0x10ec0299:
5584 		alc_process_coef_fw(codec, coef0225);
5585 		alc_hp_enable_unmute(codec, 75);
5586 		break;
5587 	}
5588 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5589 }
5590 
5591 static void alc_determine_headset_type(struct hda_codec *codec)
5592 {
5593 	int val;
5594 	bool is_ctia = false;
5595 	struct alc_spec *spec = codec->spec;
5596 	static const struct coef_fw coef0255[] = {
5597 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5598 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5599  conteol) */
5600 		{}
5601 	};
5602 	static const struct coef_fw coef0288[] = {
5603 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5604 		{}
5605 	};
5606 	static const struct coef_fw coef0298[] = {
5607 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5608 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5609 		UPDATE_COEF(0x66, 0x0008, 0),
5610 		UPDATE_COEF(0x67, 0x2000, 0),
5611 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5612 		{}
5613 	};
5614 	static const struct coef_fw coef0293[] = {
5615 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5616 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5617 		{}
5618 	};
5619 	static const struct coef_fw coef0688[] = {
5620 		WRITE_COEF(0x11, 0x0001),
5621 		WRITE_COEF(0xb7, 0x802b),
5622 		WRITE_COEF(0x15, 0x0d60),
5623 		WRITE_COEF(0xc3, 0x0c00),
5624 		{}
5625 	};
5626 	static const struct coef_fw coef0274[] = {
5627 		UPDATE_COEF(0x4a, 0x0010, 0),
5628 		UPDATE_COEF(0x4a, 0x8000, 0),
5629 		WRITE_COEF(0x45, 0xd289),
5630 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5631 		{}
5632 	};
5633 
5634 	if (spec->no_internal_mic_pin) {
5635 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5636 		return;
5637 	}
5638 
5639 	switch (codec->core.vendor_id) {
5640 	case 0x10ec0255:
5641 		alc_process_coef_fw(codec, coef0255);
5642 		msleep(300);
5643 		val = alc_read_coef_idx(codec, 0x46);
5644 		is_ctia = (val & 0x0070) == 0x0070;
5645 		break;
5646 	case 0x10ec0230:
5647 	case 0x10ec0236:
5648 	case 0x10ec0256:
5649 	case 0x19e58326:
5650 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5651 		alc_write_coef_idx(codec, 0x06, 0x6104);
5652 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5653 
5654 		alc_process_coef_fw(codec, coef0255);
5655 		msleep(300);
5656 		val = alc_read_coef_idx(codec, 0x46);
5657 		is_ctia = (val & 0x0070) == 0x0070;
5658 		if (!is_ctia) {
5659 			alc_write_coef_idx(codec, 0x45, 0xe089);
5660 			msleep(100);
5661 			val = alc_read_coef_idx(codec, 0x46);
5662 			if ((val & 0x0070) == 0x0070)
5663 				is_ctia = false;
5664 			else
5665 				is_ctia = true;
5666 		}
5667 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5668 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5669 		break;
5670 	case 0x10ec0234:
5671 	case 0x10ec0274:
5672 	case 0x10ec0294:
5673 		alc_process_coef_fw(codec, coef0274);
5674 		msleep(850);
5675 		val = alc_read_coef_idx(codec, 0x46);
5676 		is_ctia = (val & 0x00f0) == 0x00f0;
5677 		break;
5678 	case 0x10ec0233:
5679 	case 0x10ec0283:
5680 		alc_write_coef_idx(codec, 0x45, 0xd029);
5681 		msleep(300);
5682 		val = alc_read_coef_idx(codec, 0x46);
5683 		is_ctia = (val & 0x0070) == 0x0070;
5684 		break;
5685 	case 0x10ec0298:
5686 		snd_hda_codec_write(codec, 0x21, 0,
5687 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5688 		msleep(100);
5689 		snd_hda_codec_write(codec, 0x21, 0,
5690 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5691 		msleep(200);
5692 
5693 		val = alc_read_coef_idx(codec, 0x50);
5694 		if (val & (1 << 12)) {
5695 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5696 			alc_process_coef_fw(codec, coef0288);
5697 			msleep(350);
5698 			val = alc_read_coef_idx(codec, 0x50);
5699 			is_ctia = (val & 0x0070) == 0x0070;
5700 		} else {
5701 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5702 			alc_process_coef_fw(codec, coef0288);
5703 			msleep(350);
5704 			val = alc_read_coef_idx(codec, 0x50);
5705 			is_ctia = (val & 0x0070) == 0x0070;
5706 		}
5707 		alc_process_coef_fw(codec, coef0298);
5708 		snd_hda_codec_write(codec, 0x21, 0,
5709 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5710 		msleep(75);
5711 		snd_hda_codec_write(codec, 0x21, 0,
5712 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5713 		break;
5714 	case 0x10ec0286:
5715 	case 0x10ec0288:
5716 		alc_process_coef_fw(codec, coef0288);
5717 		msleep(350);
5718 		val = alc_read_coef_idx(codec, 0x50);
5719 		is_ctia = (val & 0x0070) == 0x0070;
5720 		break;
5721 	case 0x10ec0292:
5722 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5723 		msleep(300);
5724 		val = alc_read_coef_idx(codec, 0x6c);
5725 		is_ctia = (val & 0x001c) == 0x001c;
5726 		break;
5727 	case 0x10ec0293:
5728 		alc_process_coef_fw(codec, coef0293);
5729 		msleep(300);
5730 		val = alc_read_coef_idx(codec, 0x46);
5731 		is_ctia = (val & 0x0070) == 0x0070;
5732 		break;
5733 	case 0x10ec0668:
5734 		alc_process_coef_fw(codec, coef0688);
5735 		msleep(300);
5736 		val = alc_read_coef_idx(codec, 0xbe);
5737 		is_ctia = (val & 0x1c02) == 0x1c02;
5738 		break;
5739 	case 0x10ec0215:
5740 	case 0x10ec0225:
5741 	case 0x10ec0285:
5742 	case 0x10ec0295:
5743 	case 0x10ec0289:
5744 	case 0x10ec0299:
5745 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5746 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5747 		val = alc_read_coef_idx(codec, 0x45);
5748 		if (val & (1 << 9)) {
5749 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5750 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5751 			msleep(800);
5752 			val = alc_read_coef_idx(codec, 0x46);
5753 			is_ctia = (val & 0x00f0) == 0x00f0;
5754 		} else {
5755 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5756 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5757 			msleep(800);
5758 			val = alc_read_coef_idx(codec, 0x46);
5759 			is_ctia = (val & 0x00f0) == 0x00f0;
5760 		}
5761 		if (!is_ctia) {
5762 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5763 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5764 			msleep(100);
5765 			val = alc_read_coef_idx(codec, 0x46);
5766 			if ((val & 0x00f0) == 0x00f0)
5767 				is_ctia = false;
5768 			else
5769 				is_ctia = true;
5770 		}
5771 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5772 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5773 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5774 		break;
5775 	case 0x10ec0867:
5776 		is_ctia = true;
5777 		break;
5778 	}
5779 
5780 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5781 		    is_ctia ? "yes" : "no");
5782 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5783 }
5784 
5785 static void alc_update_headset_mode(struct hda_codec *codec)
5786 {
5787 	struct alc_spec *spec = codec->spec;
5788 
5789 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5790 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5791 
5792 	int new_headset_mode;
5793 
5794 	if (!snd_hda_jack_detect(codec, hp_pin))
5795 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5796 	else if (mux_pin == spec->headset_mic_pin)
5797 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5798 	else if (mux_pin == spec->headphone_mic_pin)
5799 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5800 	else
5801 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5802 
5803 	if (new_headset_mode == spec->current_headset_mode) {
5804 		snd_hda_gen_update_outputs(codec);
5805 		return;
5806 	}
5807 
5808 	switch (new_headset_mode) {
5809 	case ALC_HEADSET_MODE_UNPLUGGED:
5810 		alc_headset_mode_unplugged(codec);
5811 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5812 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5813 		spec->gen.hp_jack_present = false;
5814 		break;
5815 	case ALC_HEADSET_MODE_HEADSET:
5816 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5817 			alc_determine_headset_type(codec);
5818 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5819 			alc_headset_mode_ctia(codec);
5820 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5821 			alc_headset_mode_omtp(codec);
5822 		spec->gen.hp_jack_present = true;
5823 		break;
5824 	case ALC_HEADSET_MODE_MIC:
5825 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5826 		spec->gen.hp_jack_present = false;
5827 		break;
5828 	case ALC_HEADSET_MODE_HEADPHONE:
5829 		alc_headset_mode_default(codec);
5830 		spec->gen.hp_jack_present = true;
5831 		break;
5832 	}
5833 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5834 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5835 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5836 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5837 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5838 						  PIN_VREFHIZ);
5839 	}
5840 	spec->current_headset_mode = new_headset_mode;
5841 
5842 	snd_hda_gen_update_outputs(codec);
5843 }
5844 
5845 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5846 					 struct snd_kcontrol *kcontrol,
5847 					 struct snd_ctl_elem_value *ucontrol)
5848 {
5849 	alc_update_headset_mode(codec);
5850 }
5851 
5852 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5853 				       struct hda_jack_callback *jack)
5854 {
5855 	snd_hda_gen_hp_automute(codec, jack);
5856 	alc_update_headset_mode(codec);
5857 }
5858 
5859 static void alc_probe_headset_mode(struct hda_codec *codec)
5860 {
5861 	int i;
5862 	struct alc_spec *spec = codec->spec;
5863 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5864 
5865 	/* Find mic pins */
5866 	for (i = 0; i < cfg->num_inputs; i++) {
5867 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5868 			spec->headset_mic_pin = cfg->inputs[i].pin;
5869 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5870 			spec->headphone_mic_pin = cfg->inputs[i].pin;
5871 	}
5872 
5873 	WARN_ON(spec->gen.cap_sync_hook);
5874 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5875 	spec->gen.automute_hook = alc_update_headset_mode;
5876 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5877 }
5878 
5879 static void alc_fixup_headset_mode(struct hda_codec *codec,
5880 				const struct hda_fixup *fix, int action)
5881 {
5882 	struct alc_spec *spec = codec->spec;
5883 
5884 	switch (action) {
5885 	case HDA_FIXUP_ACT_PRE_PROBE:
5886 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5887 		break;
5888 	case HDA_FIXUP_ACT_PROBE:
5889 		alc_probe_headset_mode(codec);
5890 		break;
5891 	case HDA_FIXUP_ACT_INIT:
5892 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
5893 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5894 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5895 		}
5896 		alc_update_headset_mode(codec);
5897 		break;
5898 	}
5899 }
5900 
5901 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5902 				const struct hda_fixup *fix, int action)
5903 {
5904 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5905 		struct alc_spec *spec = codec->spec;
5906 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5907 	}
5908 	else
5909 		alc_fixup_headset_mode(codec, fix, action);
5910 }
5911 
5912 static void alc255_set_default_jack_type(struct hda_codec *codec)
5913 {
5914 	/* Set to iphone type */
5915 	static const struct coef_fw alc255fw[] = {
5916 		WRITE_COEF(0x1b, 0x880b),
5917 		WRITE_COEF(0x45, 0xd089),
5918 		WRITE_COEF(0x1b, 0x080b),
5919 		WRITE_COEF(0x46, 0x0004),
5920 		WRITE_COEF(0x1b, 0x0c0b),
5921 		{}
5922 	};
5923 	static const struct coef_fw alc256fw[] = {
5924 		WRITE_COEF(0x1b, 0x884b),
5925 		WRITE_COEF(0x45, 0xd089),
5926 		WRITE_COEF(0x1b, 0x084b),
5927 		WRITE_COEF(0x46, 0x0004),
5928 		WRITE_COEF(0x1b, 0x0c4b),
5929 		{}
5930 	};
5931 	switch (codec->core.vendor_id) {
5932 	case 0x10ec0255:
5933 		alc_process_coef_fw(codec, alc255fw);
5934 		break;
5935 	case 0x10ec0230:
5936 	case 0x10ec0236:
5937 	case 0x10ec0256:
5938 	case 0x19e58326:
5939 		alc_process_coef_fw(codec, alc256fw);
5940 		break;
5941 	}
5942 	msleep(30);
5943 }
5944 
5945 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5946 				const struct hda_fixup *fix, int action)
5947 {
5948 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5949 		alc255_set_default_jack_type(codec);
5950 	}
5951 	alc_fixup_headset_mode(codec, fix, action);
5952 }
5953 
5954 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5955 				const struct hda_fixup *fix, int action)
5956 {
5957 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5958 		struct alc_spec *spec = codec->spec;
5959 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5960 		alc255_set_default_jack_type(codec);
5961 	}
5962 	else
5963 		alc_fixup_headset_mode(codec, fix, action);
5964 }
5965 
5966 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5967 				       struct hda_jack_callback *jack)
5968 {
5969 	struct alc_spec *spec = codec->spec;
5970 
5971 	alc_update_headset_jack_cb(codec, jack);
5972 	/* Headset Mic enable or disable, only for Dell Dino */
5973 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5974 }
5975 
5976 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5977 				const struct hda_fixup *fix, int action)
5978 {
5979 	alc_fixup_headset_mode(codec, fix, action);
5980 	if (action == HDA_FIXUP_ACT_PROBE) {
5981 		struct alc_spec *spec = codec->spec;
5982 		/* toggled via hp_automute_hook */
5983 		spec->gpio_mask |= 0x40;
5984 		spec->gpio_dir |= 0x40;
5985 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5986 	}
5987 }
5988 
5989 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5990 					const struct hda_fixup *fix, int action)
5991 {
5992 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5993 		struct alc_spec *spec = codec->spec;
5994 		spec->gen.auto_mute_via_amp = 1;
5995 	}
5996 }
5997 
5998 static void alc_fixup_no_shutup(struct hda_codec *codec,
5999 				const struct hda_fixup *fix, int action)
6000 {
6001 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6002 		struct alc_spec *spec = codec->spec;
6003 		spec->no_shutup_pins = 1;
6004 	}
6005 }
6006 
6007 static void alc_fixup_disable_aamix(struct hda_codec *codec,
6008 				    const struct hda_fixup *fix, int action)
6009 {
6010 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6011 		struct alc_spec *spec = codec->spec;
6012 		/* Disable AA-loopback as it causes white noise */
6013 		spec->gen.mixer_nid = 0;
6014 	}
6015 }
6016 
6017 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
6018 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
6019 				  const struct hda_fixup *fix, int action)
6020 {
6021 	static const struct hda_pintbl pincfgs[] = {
6022 		{ 0x16, 0x21211010 }, /* dock headphone */
6023 		{ 0x19, 0x21a11010 }, /* dock mic */
6024 		{ }
6025 	};
6026 	struct alc_spec *spec = codec->spec;
6027 
6028 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6029 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6030 		codec->power_save_node = 0; /* avoid click noises */
6031 		snd_hda_apply_pincfgs(codec, pincfgs);
6032 	}
6033 }
6034 
6035 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6036 				  const struct hda_fixup *fix, int action)
6037 {
6038 	static const struct hda_pintbl pincfgs[] = {
6039 		{ 0x17, 0x21211010 }, /* dock headphone */
6040 		{ 0x19, 0x21a11010 }, /* dock mic */
6041 		{ }
6042 	};
6043 	struct alc_spec *spec = codec->spec;
6044 
6045 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6046 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6047 		snd_hda_apply_pincfgs(codec, pincfgs);
6048 	} else if (action == HDA_FIXUP_ACT_INIT) {
6049 		/* Enable DOCK device */
6050 		snd_hda_codec_write(codec, 0x17, 0,
6051 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6052 		/* Enable DOCK device */
6053 		snd_hda_codec_write(codec, 0x19, 0,
6054 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6055 	}
6056 }
6057 
6058 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6059 				  const struct hda_fixup *fix, int action)
6060 {
6061 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6062 	 * the speaker output becomes too low by some reason on Thinkpads with
6063 	 * ALC298 codec
6064 	 */
6065 	static const hda_nid_t preferred_pairs[] = {
6066 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6067 		0
6068 	};
6069 	struct alc_spec *spec = codec->spec;
6070 
6071 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6072 		spec->gen.preferred_dacs = preferred_pairs;
6073 }
6074 
6075 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6076 				   const struct hda_fixup *fix, int action)
6077 {
6078 	static const hda_nid_t preferred_pairs[] = {
6079 		0x17, 0x02, 0x21, 0x03, 0
6080 	};
6081 	struct alc_spec *spec = codec->spec;
6082 
6083 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6084 		spec->gen.preferred_dacs = preferred_pairs;
6085 }
6086 
6087 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6088 {
6089 	struct alc_spec *spec = codec->spec;
6090 	int hp_pin = alc_get_hp_pin(spec);
6091 
6092 	/* Prevent pop noises when headphones are plugged in */
6093 	snd_hda_codec_write(codec, hp_pin, 0,
6094 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6095 	msleep(20);
6096 }
6097 
6098 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6099 				const struct hda_fixup *fix, int action)
6100 {
6101 	struct alc_spec *spec = codec->spec;
6102 	struct hda_input_mux *imux = &spec->gen.input_mux;
6103 	int i;
6104 
6105 	switch (action) {
6106 	case HDA_FIXUP_ACT_PRE_PROBE:
6107 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6108 		 * it causes a click noise at start up
6109 		 */
6110 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6111 		spec->shutup = alc_shutup_dell_xps13;
6112 		break;
6113 	case HDA_FIXUP_ACT_PROBE:
6114 		/* Make the internal mic the default input source. */
6115 		for (i = 0; i < imux->num_items; i++) {
6116 			if (spec->gen.imux_pins[i] == 0x12) {
6117 				spec->gen.cur_mux[0] = i;
6118 				break;
6119 			}
6120 		}
6121 		break;
6122 	}
6123 }
6124 
6125 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6126 				const struct hda_fixup *fix, int action)
6127 {
6128 	struct alc_spec *spec = codec->spec;
6129 
6130 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6131 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6132 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6133 
6134 		/* Disable boost for mic-in permanently. (This code is only called
6135 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6136 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6137 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6138 	} else
6139 		alc_fixup_headset_mode(codec, fix, action);
6140 }
6141 
6142 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6143 				const struct hda_fixup *fix, int action)
6144 {
6145 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6146 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6147 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6148 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6149 	}
6150 	alc_fixup_headset_mode(codec, fix, action);
6151 }
6152 
6153 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6154 static int find_ext_mic_pin(struct hda_codec *codec)
6155 {
6156 	struct alc_spec *spec = codec->spec;
6157 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6158 	hda_nid_t nid;
6159 	unsigned int defcfg;
6160 	int i;
6161 
6162 	for (i = 0; i < cfg->num_inputs; i++) {
6163 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6164 			continue;
6165 		nid = cfg->inputs[i].pin;
6166 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6167 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6168 			continue;
6169 		return nid;
6170 	}
6171 
6172 	return 0;
6173 }
6174 
6175 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6176 				    const struct hda_fixup *fix,
6177 				    int action)
6178 {
6179 	struct alc_spec *spec = codec->spec;
6180 
6181 	if (action == HDA_FIXUP_ACT_PROBE) {
6182 		int mic_pin = find_ext_mic_pin(codec);
6183 		int hp_pin = alc_get_hp_pin(spec);
6184 
6185 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6186 			return;
6187 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6188 	}
6189 }
6190 
6191 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6192 					     const struct hda_fixup *fix,
6193 					     int action)
6194 {
6195 	struct alc_spec *spec = codec->spec;
6196 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6197 	int i;
6198 
6199 	/* The mic boosts on level 2 and 3 are too noisy
6200 	   on the internal mic input.
6201 	   Therefore limit the boost to 0 or 1. */
6202 
6203 	if (action != HDA_FIXUP_ACT_PROBE)
6204 		return;
6205 
6206 	for (i = 0; i < cfg->num_inputs; i++) {
6207 		hda_nid_t nid = cfg->inputs[i].pin;
6208 		unsigned int defcfg;
6209 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6210 			continue;
6211 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6212 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6213 			continue;
6214 
6215 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6216 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6217 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6218 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6219 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6220 	}
6221 }
6222 
6223 static void alc283_hp_automute_hook(struct hda_codec *codec,
6224 				    struct hda_jack_callback *jack)
6225 {
6226 	struct alc_spec *spec = codec->spec;
6227 	int vref;
6228 
6229 	msleep(200);
6230 	snd_hda_gen_hp_automute(codec, jack);
6231 
6232 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6233 
6234 	msleep(600);
6235 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6236 			    vref);
6237 }
6238 
6239 static void alc283_fixup_chromebook(struct hda_codec *codec,
6240 				    const struct hda_fixup *fix, int action)
6241 {
6242 	struct alc_spec *spec = codec->spec;
6243 
6244 	switch (action) {
6245 	case HDA_FIXUP_ACT_PRE_PROBE:
6246 		snd_hda_override_wcaps(codec, 0x03, 0);
6247 		/* Disable AA-loopback as it causes white noise */
6248 		spec->gen.mixer_nid = 0;
6249 		break;
6250 	case HDA_FIXUP_ACT_INIT:
6251 		/* MIC2-VREF control */
6252 		/* Set to manual mode */
6253 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6254 		/* Enable Line1 input control by verb */
6255 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6256 		break;
6257 	}
6258 }
6259 
6260 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6261 				    const struct hda_fixup *fix, int action)
6262 {
6263 	struct alc_spec *spec = codec->spec;
6264 
6265 	switch (action) {
6266 	case HDA_FIXUP_ACT_PRE_PROBE:
6267 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6268 		break;
6269 	case HDA_FIXUP_ACT_INIT:
6270 		/* MIC2-VREF control */
6271 		/* Set to manual mode */
6272 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6273 		break;
6274 	}
6275 }
6276 
6277 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6278 static void asus_tx300_automute(struct hda_codec *codec)
6279 {
6280 	struct alc_spec *spec = codec->spec;
6281 	snd_hda_gen_update_outputs(codec);
6282 	if (snd_hda_jack_detect(codec, 0x1b))
6283 		spec->gen.mute_bits |= (1ULL << 0x14);
6284 }
6285 
6286 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6287 				    const struct hda_fixup *fix, int action)
6288 {
6289 	struct alc_spec *spec = codec->spec;
6290 	static const struct hda_pintbl dock_pins[] = {
6291 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6292 		{}
6293 	};
6294 
6295 	switch (action) {
6296 	case HDA_FIXUP_ACT_PRE_PROBE:
6297 		spec->init_amp = ALC_INIT_DEFAULT;
6298 		/* TX300 needs to set up GPIO2 for the speaker amp */
6299 		alc_setup_gpio(codec, 0x04);
6300 		snd_hda_apply_pincfgs(codec, dock_pins);
6301 		spec->gen.auto_mute_via_amp = 1;
6302 		spec->gen.automute_hook = asus_tx300_automute;
6303 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6304 						    snd_hda_gen_hp_automute);
6305 		break;
6306 	case HDA_FIXUP_ACT_PROBE:
6307 		spec->init_amp = ALC_INIT_DEFAULT;
6308 		break;
6309 	case HDA_FIXUP_ACT_BUILD:
6310 		/* this is a bit tricky; give more sane names for the main
6311 		 * (tablet) speaker and the dock speaker, respectively
6312 		 */
6313 		rename_ctl(codec, "Speaker Playback Switch",
6314 			   "Dock Speaker Playback Switch");
6315 		rename_ctl(codec, "Bass Speaker Playback Switch",
6316 			   "Speaker Playback Switch");
6317 		break;
6318 	}
6319 }
6320 
6321 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6322 				       const struct hda_fixup *fix, int action)
6323 {
6324 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6325 		/* DAC node 0x03 is giving mono output. We therefore want to
6326 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6327 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6328 		static const hda_nid_t conn1[] = { 0x0c };
6329 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6330 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6331 	}
6332 }
6333 
6334 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6335 					const struct hda_fixup *fix, int action)
6336 {
6337 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6338 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6339 		   we can't adjust the speaker's volume since this node does not has
6340 		   Amp-out capability. we change the speaker's route to:
6341 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6342 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6343 		   speaker's volume now. */
6344 
6345 		static const hda_nid_t conn1[] = { 0x0c };
6346 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6347 	}
6348 }
6349 
6350 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6351 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6352 				      const struct hda_fixup *fix, int action)
6353 {
6354 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6355 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6356 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6357 	}
6358 }
6359 
6360 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6361 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6362 					  const struct hda_fixup *fix, int action)
6363 {
6364 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6365 		static const hda_nid_t conn[] = { 0x02 };
6366 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6367 	}
6368 }
6369 
6370 /* Hook to update amp GPIO4 for automute */
6371 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6372 					  struct hda_jack_callback *jack)
6373 {
6374 	struct alc_spec *spec = codec->spec;
6375 
6376 	snd_hda_gen_hp_automute(codec, jack);
6377 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6378 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6379 			    !spec->gen.hp_jack_present);
6380 }
6381 
6382 /* Manage GPIOs for HP EliteBook Folio 9480m.
6383  *
6384  * GPIO4 is the headphone amplifier power control
6385  * GPIO3 is the audio output mute indicator LED
6386  */
6387 
6388 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6389 				  const struct hda_fixup *fix,
6390 				  int action)
6391 {
6392 	struct alc_spec *spec = codec->spec;
6393 
6394 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6395 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6396 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6397 		spec->gpio_mask |= 0x10;
6398 		spec->gpio_dir |= 0x10;
6399 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6400 	}
6401 }
6402 
6403 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6404 				   const struct hda_fixup *fix,
6405 				   int action)
6406 {
6407 	struct alc_spec *spec = codec->spec;
6408 
6409 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6410 		spec->gpio_mask |= 0x04;
6411 		spec->gpio_dir |= 0x04;
6412 		/* set data bit low */
6413 	}
6414 }
6415 
6416 /* Quirk for Thinkpad X1 7th and 8th Gen
6417  * The following fixed routing needed
6418  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6419  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6420  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6421  */
6422 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6423 					  const struct hda_fixup *fix, int action)
6424 {
6425 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6426 	static const hda_nid_t preferred_pairs[] = {
6427 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6428 	};
6429 	struct alc_spec *spec = codec->spec;
6430 
6431 	switch (action) {
6432 	case HDA_FIXUP_ACT_PRE_PROBE:
6433 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6434 		spec->gen.preferred_dacs = preferred_pairs;
6435 		break;
6436 	case HDA_FIXUP_ACT_BUILD:
6437 		/* The generic parser creates somewhat unintuitive volume ctls
6438 		 * with the fixed routing above, and the shared DAC2 may be
6439 		 * confusing for PA.
6440 		 * Rename those to unique names so that PA doesn't touch them
6441 		 * and use only Master volume.
6442 		 */
6443 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6444 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6445 		break;
6446 	}
6447 }
6448 
6449 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6450 					 const struct hda_fixup *fix,
6451 					 int action)
6452 {
6453 	alc_fixup_dual_codecs(codec, fix, action);
6454 	switch (action) {
6455 	case HDA_FIXUP_ACT_PRE_PROBE:
6456 		/* override card longname to provide a unique UCM profile */
6457 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6458 		break;
6459 	case HDA_FIXUP_ACT_BUILD:
6460 		/* rename Capture controls depending on the codec */
6461 		rename_ctl(codec, "Capture Volume",
6462 			   codec->addr == 0 ?
6463 			   "Rear-Panel Capture Volume" :
6464 			   "Front-Panel Capture Volume");
6465 		rename_ctl(codec, "Capture Switch",
6466 			   codec->addr == 0 ?
6467 			   "Rear-Panel Capture Switch" :
6468 			   "Front-Panel Capture Switch");
6469 		break;
6470 	}
6471 }
6472 
6473 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6474 				      const struct hda_fixup *fix, int action)
6475 {
6476 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6477 		return;
6478 
6479 	codec->power_save_node = 1;
6480 }
6481 
6482 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6483 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6484 				    const struct hda_fixup *fix, int action)
6485 {
6486 	struct alc_spec *spec = codec->spec;
6487 	static const hda_nid_t preferred_pairs[] = {
6488 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6489 		0
6490 	};
6491 
6492 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6493 		return;
6494 
6495 	spec->gen.preferred_dacs = preferred_pairs;
6496 	spec->gen.auto_mute_via_amp = 1;
6497 	codec->power_save_node = 0;
6498 }
6499 
6500 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6501 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6502 				    const struct hda_fixup *fix, int action)
6503 {
6504 	static const hda_nid_t preferred_pairs[] = {
6505 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6506 	};
6507 	struct alc_spec *spec = codec->spec;
6508 
6509 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6510 		spec->gen.preferred_dacs = preferred_pairs;
6511 		spec->gen.obey_preferred_dacs = 1;
6512 	}
6513 }
6514 
6515 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6516 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6517 			      const struct hda_fixup *fix, int action)
6518 {
6519 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6520 		return;
6521 
6522 	snd_hda_override_wcaps(codec, 0x03, 0);
6523 }
6524 
6525 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6526 {
6527 	switch (codec->core.vendor_id) {
6528 	case 0x10ec0274:
6529 	case 0x10ec0294:
6530 	case 0x10ec0225:
6531 	case 0x10ec0295:
6532 	case 0x10ec0299:
6533 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6534 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6535 		break;
6536 	case 0x10ec0230:
6537 	case 0x10ec0235:
6538 	case 0x10ec0236:
6539 	case 0x10ec0255:
6540 	case 0x10ec0256:
6541 	case 0x10ec0257:
6542 	case 0x19e58326:
6543 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6544 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6545 		break;
6546 	}
6547 }
6548 
6549 static void alc295_fixup_chromebook(struct hda_codec *codec,
6550 				    const struct hda_fixup *fix, int action)
6551 {
6552 	struct alc_spec *spec = codec->spec;
6553 
6554 	switch (action) {
6555 	case HDA_FIXUP_ACT_PRE_PROBE:
6556 		spec->ultra_low_power = true;
6557 		break;
6558 	case HDA_FIXUP_ACT_INIT:
6559 		alc_combo_jack_hp_jd_restart(codec);
6560 		break;
6561 	}
6562 }
6563 
6564 static void alc256_fixup_chromebook(struct hda_codec *codec,
6565 				    const struct hda_fixup *fix, int action)
6566 {
6567 	struct alc_spec *spec = codec->spec;
6568 
6569 	switch (action) {
6570 	case HDA_FIXUP_ACT_PRE_PROBE:
6571 		spec->gen.suppress_auto_mute = 1;
6572 		spec->gen.suppress_auto_mic = 1;
6573 		spec->en_3kpull_low = false;
6574 		break;
6575 	}
6576 }
6577 
6578 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6579 				  const struct hda_fixup *fix, int action)
6580 {
6581 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6582 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6583 }
6584 
6585 
6586 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6587 					struct hda_jack_callback *cb)
6588 {
6589 	/* The Windows driver sets the codec up in a very different way where
6590 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6591 	 */
6592 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6593 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6594 	else
6595 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6596 }
6597 
6598 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6599 					const struct hda_fixup *fix, int action)
6600 {
6601 	/* Pin 0x21: headphones/headset mic */
6602 	if (!is_jack_detectable(codec, 0x21))
6603 		return;
6604 
6605 	switch (action) {
6606 	case HDA_FIXUP_ACT_PRE_PROBE:
6607 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6608 				alc294_gx502_toggle_output);
6609 		break;
6610 	case HDA_FIXUP_ACT_INIT:
6611 		/* Make sure to start in a correct state, i.e. if
6612 		 * headphones have been plugged in before powering up the system
6613 		 */
6614 		alc294_gx502_toggle_output(codec, NULL);
6615 		break;
6616 	}
6617 }
6618 
6619 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6620 				       struct hda_jack_callback *cb)
6621 {
6622 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6623 	 * responsible from changes between speakers and headphones
6624 	 */
6625 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6626 		alc_write_coef_idx(codec, 0x10, 0x8420);
6627 	else
6628 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6629 }
6630 
6631 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6632 				  const struct hda_fixup *fix, int action)
6633 {
6634 	if (!is_jack_detectable(codec, 0x21))
6635 		return;
6636 
6637 	switch (action) {
6638 	case HDA_FIXUP_ACT_PRE_PROBE:
6639 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6640 				alc294_gu502_toggle_output);
6641 		break;
6642 	case HDA_FIXUP_ACT_INIT:
6643 		alc294_gu502_toggle_output(codec, NULL);
6644 		break;
6645 	}
6646 }
6647 
6648 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6649 			      const struct hda_fixup *fix, int action)
6650 {
6651 	if (action != HDA_FIXUP_ACT_INIT)
6652 		return;
6653 
6654 	msleep(100);
6655 	alc_write_coef_idx(codec, 0x65, 0x0);
6656 }
6657 
6658 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6659 				    const struct hda_fixup *fix, int action)
6660 {
6661 	switch (action) {
6662 	case HDA_FIXUP_ACT_INIT:
6663 		alc_combo_jack_hp_jd_restart(codec);
6664 		break;
6665 	}
6666 }
6667 
6668 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6669 				    const struct hda_fixup *fix, int action)
6670 {
6671 	struct alc_spec *spec = codec->spec;
6672 
6673 	switch (action) {
6674 	case HDA_FIXUP_ACT_PRE_PROBE:
6675 		/* Mic RING SLEEVE swap for combo jack */
6676 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6677 		spec->no_internal_mic_pin = true;
6678 		break;
6679 	case HDA_FIXUP_ACT_INIT:
6680 		alc_combo_jack_hp_jd_restart(codec);
6681 		break;
6682 	}
6683 }
6684 
6685 /* GPIO1 = amplifier on/off
6686  * GPIO3 = mic mute LED
6687  */
6688 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6689 					  const struct hda_fixup *fix, int action)
6690 {
6691 	static const hda_nid_t conn[] = { 0x02 };
6692 
6693 	struct alc_spec *spec = codec->spec;
6694 	static const struct hda_pintbl pincfgs[] = {
6695 		{ 0x14, 0x90170110 },  /* front/high speakers */
6696 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6697 		{ }
6698 	};
6699 
6700 	//enable micmute led
6701 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6702 
6703 	switch (action) {
6704 	case HDA_FIXUP_ACT_PRE_PROBE:
6705 		spec->micmute_led_polarity = 1;
6706 		/* needed for amp of back speakers */
6707 		spec->gpio_mask |= 0x01;
6708 		spec->gpio_dir |= 0x01;
6709 		snd_hda_apply_pincfgs(codec, pincfgs);
6710 		/* share DAC to have unified volume control */
6711 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6712 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6713 		break;
6714 	case HDA_FIXUP_ACT_INIT:
6715 		/* need to toggle GPIO to enable the amp of back speakers */
6716 		alc_update_gpio_data(codec, 0x01, true);
6717 		msleep(100);
6718 		alc_update_gpio_data(codec, 0x01, false);
6719 		break;
6720 	}
6721 }
6722 
6723 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6724 					  const struct hda_fixup *fix, int action)
6725 {
6726 	static const hda_nid_t conn[] = { 0x02 };
6727 	static const struct hda_pintbl pincfgs[] = {
6728 		{ 0x14, 0x90170110 },  /* rear speaker */
6729 		{ }
6730 	};
6731 
6732 	switch (action) {
6733 	case HDA_FIXUP_ACT_PRE_PROBE:
6734 		snd_hda_apply_pincfgs(codec, pincfgs);
6735 		/* force front speaker to DAC1 */
6736 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6737 		break;
6738 	}
6739 }
6740 
6741 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6742 				      const struct hda_fixup *fix,
6743 				      int action)
6744 {
6745 	static const struct coef_fw coefs[] = {
6746 		WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6747 		WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6748 		WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6749 		WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6750 		WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6751 		WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6752 		WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6753 		WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6754 		WRITE_COEF(0x6e, 0x1005), { }
6755 	};
6756 
6757 	static const struct hda_pintbl pincfgs[] = {
6758 		{ 0x12, 0xb7a60130 },  /* Internal microphone*/
6759 		{ 0x14, 0x90170150 },  /* B&O soundbar speakers */
6760 		{ 0x17, 0x90170153 },  /* Side speakers */
6761 		{ 0x19, 0x03a11040 },  /* Headset microphone */
6762 		{ }
6763 	};
6764 
6765 	switch (action) {
6766 	case HDA_FIXUP_ACT_PRE_PROBE:
6767 		snd_hda_apply_pincfgs(codec, pincfgs);
6768 
6769 		/* Fixes volume control problem for side speakers */
6770 		alc295_fixup_disable_dac3(codec, fix, action);
6771 
6772 		/* Fixes no sound from headset speaker */
6773 		snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6774 
6775 		/* Auto-enable headset mic when plugged */
6776 		snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6777 
6778 		/* Headset mic volume enhancement */
6779 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6780 		break;
6781 	case HDA_FIXUP_ACT_INIT:
6782 		alc_process_coef_fw(codec, coefs);
6783 		break;
6784 	case HDA_FIXUP_ACT_BUILD:
6785 		rename_ctl(codec, "Bass Speaker Playback Volume",
6786 			   "B&O-Tuned Playback Volume");
6787 		rename_ctl(codec, "Front Playback Switch",
6788 			   "B&O Soundbar Playback Switch");
6789 		rename_ctl(codec, "Bass Speaker Playback Switch",
6790 			   "Side Speaker Playback Switch");
6791 		break;
6792 	}
6793 }
6794 
6795 /* for hda_fixup_thinkpad_acpi() */
6796 #include "thinkpad_helper.c"
6797 
6798 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6799 				    const struct hda_fixup *fix, int action)
6800 {
6801 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6802 	hda_fixup_thinkpad_acpi(codec, fix, action);
6803 }
6804 
6805 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6806 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6807 						  const struct hda_fixup *fix,
6808 						  int action)
6809 {
6810 	struct alc_spec *spec = codec->spec;
6811 
6812 	switch (action) {
6813 	case HDA_FIXUP_ACT_PRE_PROBE:
6814 		spec->gen.suppress_auto_mute = 1;
6815 		break;
6816 	}
6817 }
6818 
6819 static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
6820 {
6821 	struct hda_codec *cdc = data;
6822 	struct alc_spec *spec = cdc->spec;
6823 
6824 	codec_info(cdc, "ACPI Notification %d\n", event);
6825 
6826 	hda_component_acpi_device_notify(&spec->comps, handle, event, data);
6827 }
6828 
6829 static int comp_bind(struct device *dev)
6830 {
6831 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6832 	struct alc_spec *spec = cdc->spec;
6833 	int ret;
6834 
6835 	ret = hda_component_manager_bind(cdc, &spec->comps);
6836 	if (ret)
6837 		return ret;
6838 
6839 	return hda_component_manager_bind_acpi_notifications(cdc,
6840 							     &spec->comps,
6841 							     comp_acpi_device_notify, cdc);
6842 }
6843 
6844 static void comp_unbind(struct device *dev)
6845 {
6846 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6847 	struct alc_spec *spec = cdc->spec;
6848 
6849 	hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify);
6850 	hda_component_manager_unbind(cdc, &spec->comps);
6851 }
6852 
6853 static const struct component_master_ops comp_master_ops = {
6854 	.bind = comp_bind,
6855 	.unbind = comp_unbind,
6856 };
6857 
6858 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6859 				       struct snd_pcm_substream *sub, int action)
6860 {
6861 	struct alc_spec *spec = cdc->spec;
6862 
6863 	hda_component_manager_playback_hook(&spec->comps, action);
6864 }
6865 
6866 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6867 			       const char *hid, const char *match_str, int count)
6868 {
6869 	struct alc_spec *spec = cdc->spec;
6870 	int ret;
6871 
6872 	switch (action) {
6873 	case HDA_FIXUP_ACT_PRE_PROBE:
6874 		ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid,
6875 						 match_str, &comp_master_ops);
6876 		if (ret)
6877 			return;
6878 
6879 		spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6880 		break;
6881 	case HDA_FIXUP_ACT_FREE:
6882 		hda_component_manager_free(cdc, &comp_master_ops);
6883 		break;
6884 	}
6885 }
6886 
6887 static void cs35lxx_autodet_fixup(struct hda_codec *cdc,
6888 				  const struct hda_fixup *fix,
6889 				  int action)
6890 {
6891 	struct device *dev = hda_codec_dev(cdc);
6892 	struct acpi_device *adev;
6893 	struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
6894 	const char *bus = NULL;
6895 	static const struct {
6896 		const char *hid;
6897 		const char *name;
6898 	} acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
6899 			{ "CSC3556", "cs35l56-hda" },
6900 			{ "CSC3557", "cs35l57-hda" }};
6901 	char *match;
6902 	int i, count = 0, count_devindex = 0;
6903 
6904 	switch (action) {
6905 	case HDA_FIXUP_ACT_PRE_PROBE:
6906 		for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
6907 			adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
6908 			if (adev)
6909 				break;
6910 		}
6911 		if (!adev) {
6912 			dev_err(dev, "Failed to find ACPI entry for a Cirrus Amp\n");
6913 			return;
6914 		}
6915 
6916 		count = i2c_acpi_client_count(adev);
6917 		if (count > 0) {
6918 			bus = "i2c";
6919 		} else {
6920 			count = acpi_spi_count_resources(adev);
6921 			if (count > 0)
6922 				bus = "spi";
6923 		}
6924 
6925 		fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
6926 		acpi_dev_put(adev);
6927 
6928 		if (!bus) {
6929 			dev_err(dev, "Did not find any buses for %s\n", acpi_ids[i].hid);
6930 			return;
6931 		}
6932 
6933 		if (!fwnode) {
6934 			dev_err(dev, "Could not get fwnode for %s\n", acpi_ids[i].hid);
6935 			return;
6936 		}
6937 
6938 		/*
6939 		 * When available the cirrus,dev-index property is an accurate
6940 		 * count of the amps in a system and is used in preference to
6941 		 * the count of bus devices that can contain additional address
6942 		 * alias entries.
6943 		 */
6944 		count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
6945 		if (count_devindex > 0)
6946 			count = count_devindex;
6947 
6948 		match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
6949 		if (!match)
6950 			return;
6951 		dev_info(dev, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
6952 		comp_generic_fixup(cdc, action, bus, acpi_ids[i].hid, match, count);
6953 
6954 		break;
6955 	case HDA_FIXUP_ACT_FREE:
6956 		/*
6957 		 * Pass the action on to comp_generic_fixup() so that
6958 		 * hda_component_manager functions can be called in just once
6959 		 * place. In this context the bus, hid, match_str or count
6960 		 * values do not need to be calculated.
6961 		 */
6962 		comp_generic_fixup(cdc, action, NULL, NULL, NULL, 0);
6963 		break;
6964 	}
6965 }
6966 
6967 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6968 {
6969 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
6970 }
6971 
6972 static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6973 {
6974 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
6975 }
6976 
6977 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6978 {
6979 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
6980 }
6981 
6982 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6983 {
6984 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
6985 }
6986 
6987 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6988 						 int action)
6989 {
6990 	comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
6991 }
6992 
6993 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6994 						 int action)
6995 {
6996 	comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
6997 }
6998 
6999 static void cs35l56_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7000 {
7001 	comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 2);
7002 }
7003 
7004 static void cs35l56_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7005 {
7006 	comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 4);
7007 }
7008 
7009 static void cs35l56_fixup_spi_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7010 {
7011 	comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 2);
7012 }
7013 
7014 static void cs35l56_fixup_spi_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7015 {
7016 	comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 4);
7017 }
7018 
7019 static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7020 {
7021 	/*
7022 	 * The same SSID has been re-used in different hardware, they have
7023 	 * different codecs and the newer GA403U has a ALC285.
7024 	 */
7025 	if (cdc->core.vendor_id == 0x10ec0285)
7026 		cs35l56_fixup_i2c_two(cdc, fix, action);
7027 	else
7028 		alc_fixup_inv_dmic(cdc, fix, action);
7029 }
7030 
7031 static void tas2781_fixup_i2c(struct hda_codec *cdc,
7032 	const struct hda_fixup *fix, int action)
7033 {
7034 	comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
7035 }
7036 
7037 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
7038 	const struct hda_fixup *fix, int action)
7039 {
7040 	comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
7041 }
7042 
7043 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
7044 	const struct hda_fixup *fix, int action)
7045 {
7046 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
7047 }
7048 
7049 
7050 /* for alc295_fixup_hp_top_speakers */
7051 #include "hp_x360_helper.c"
7052 
7053 /* for alc285_fixup_ideapad_s740_coef() */
7054 #include "ideapad_s740_helper.c"
7055 
7056 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7057 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7058 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7059 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7060 	{}
7061 };
7062 
7063 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7064 					   const struct hda_fixup *fix,
7065 					   int action)
7066 {
7067 	/*
7068 	 * A certain other OS sets these coeffs to different values. On at least
7069 	 * one TongFang barebone these settings might survive even a cold
7070 	 * reboot. So to restore a clean slate the values are explicitly reset
7071 	 * to default here. Without this, the external microphone is always in a
7072 	 * plugged-in state, while the internal microphone is always in an
7073 	 * unplugged state, breaking the ability to use the internal microphone.
7074 	 */
7075 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
7076 }
7077 
7078 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7079 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7080 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7081 	WRITE_COEF(0x49, 0x0149),
7082 	{}
7083 };
7084 
7085 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7086 				       const struct hda_fixup *fix,
7087 				       int action)
7088 {
7089 	/*
7090 	 * The audio jack input and output is not detected on the ASRock NUC Box
7091 	 * 1100 series when cold booting without this fix. Warm rebooting from a
7092 	 * certain other OS makes the audio functional, as COEF settings are
7093 	 * preserved in this case. This fix sets these altered COEF values as
7094 	 * the default.
7095 	 */
7096 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7097 }
7098 
7099 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7100 						    const struct hda_fixup *fix,
7101 						    int action)
7102 {
7103 	/*
7104 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7105 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7106 	 * needs an additional quirk for sound working after suspend and resume.
7107 	 */
7108 	if (codec->core.vendor_id == 0x10ec0256) {
7109 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7110 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7111 	} else {
7112 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7113 	}
7114 }
7115 
7116 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
7117 					      const struct hda_fixup *fix, int action)
7118 {
7119 	u32 caps;
7120 	u8 nsteps, offs;
7121 
7122 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7123 		return;
7124 
7125 	caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
7126 	nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
7127 	offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
7128 	caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
7129 	caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
7130 
7131 	if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
7132 		codec_warn(codec, "failed to override amp caps for NID 0x3\n");
7133 }
7134 
7135 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7136 						  const struct hda_fixup *fix,
7137 						  int action)
7138 {
7139 	struct alc_spec *spec = codec->spec;
7140 	struct hda_input_mux *imux = &spec->gen.input_mux;
7141 	int i;
7142 
7143 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
7144 
7145 	switch (action) {
7146 	case HDA_FIXUP_ACT_PRE_PROBE:
7147 		/**
7148 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7149 		 * to Hi-Z to avoid pop noises at startup and when plugging and
7150 		 * unplugging headphones.
7151 		 */
7152 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7153 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7154 		break;
7155 	case HDA_FIXUP_ACT_PROBE:
7156 		/**
7157 		 * Make the internal mic (0x12) the default input source to
7158 		 * prevent pop noises on cold boot.
7159 		 */
7160 		for (i = 0; i < imux->num_items; i++) {
7161 			if (spec->gen.imux_pins[i] == 0x12) {
7162 				spec->gen.cur_mux[0] = i;
7163 				break;
7164 			}
7165 		}
7166 		break;
7167 	}
7168 }
7169 
7170 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7171 					  const struct hda_fixup *fix, int action)
7172 {
7173 	/*
7174 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7175 	 * unconnected.
7176 	 */
7177 	static const struct hda_pintbl pincfgs[] = {
7178 		{ 0x17, 0x90170121 },
7179 		{ }
7180 	};
7181 	/*
7182 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7183 	 * DAC 0x02 and 0x03 would be fine.
7184 	 */
7185 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7186 	/*
7187 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7188 	 * Headphones (0x21) are connected to DAC 0x03.
7189 	 */
7190 	static const hda_nid_t preferred_pairs[] = {
7191 		0x14, 0x02,
7192 		0x17, 0x02,
7193 		0x21, 0x03,
7194 		0
7195 	};
7196 	struct alc_spec *spec = codec->spec;
7197 
7198 	switch (action) {
7199 	case HDA_FIXUP_ACT_PRE_PROBE:
7200 		snd_hda_apply_pincfgs(codec, pincfgs);
7201 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7202 		spec->gen.preferred_dacs = preferred_pairs;
7203 		break;
7204 	}
7205 }
7206 
7207 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7208 					  const struct hda_fixup *fix, int action)
7209 {
7210 	static const struct hda_pintbl pincfgs[] = {
7211 		{ 0x14, 0x90170151 },
7212 		{ 0x17, 0x90170150 },
7213 		{ }
7214 	};
7215 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7216 	static const hda_nid_t preferred_pairs[] = {
7217 		0x14, 0x02,
7218 		0x17, 0x03,
7219 		0x21, 0x02,
7220 		0
7221 	};
7222 	struct alc_spec *spec = codec->spec;
7223 
7224 	alc_fixup_no_shutup(codec, fix, action);
7225 
7226 	switch (action) {
7227 	case HDA_FIXUP_ACT_PRE_PROBE:
7228 		snd_hda_apply_pincfgs(codec, pincfgs);
7229 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7230 		spec->gen.preferred_dacs = preferred_pairs;
7231 		break;
7232 	}
7233 }
7234 
7235 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7236 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7237 				    const struct hda_fixup *fix, int action)
7238 {
7239 	struct alc_spec *spec = codec->spec;
7240 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7241 	static const hda_nid_t preferred_pairs[] = {
7242 		0x17, 0x02, 0x21, 0x03, 0
7243 	};
7244 
7245 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7246 		return;
7247 
7248 	snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7249 	spec->gen.preferred_dacs = preferred_pairs;
7250 	spec->gen.auto_mute_via_amp = 1;
7251 	if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7252 		snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7253 					0x0); /* Make sure 0x14 was disable */
7254 	}
7255 }
7256 /* Fix none verb table of Headset Mic pin */
7257 static void alc_fixup_headset_mic(struct hda_codec *codec,
7258 				   const struct hda_fixup *fix, int action)
7259 {
7260 	struct alc_spec *spec = codec->spec;
7261 	static const struct hda_pintbl pincfgs[] = {
7262 		{ 0x19, 0x03a1103c },
7263 		{ }
7264 	};
7265 
7266 	switch (action) {
7267 	case HDA_FIXUP_ACT_PRE_PROBE:
7268 		snd_hda_apply_pincfgs(codec, pincfgs);
7269 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7270 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7271 		break;
7272 	}
7273 }
7274 
7275 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
7276 					  const struct hda_fixup *fix, int action)
7277 {
7278 	/*
7279 	 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7280 	 * unconnected.
7281 	 * The Pin Complex 0x17 for the bass speakers has the lowest association
7282 	 * and sequence values so shift it up a bit to squeeze 0x14 in.
7283 	 */
7284 	static const struct hda_pintbl pincfgs[] = {
7285 		{ 0x14, 0x90170110 }, // top/treble
7286 		{ 0x17, 0x90170111 }, // bottom/bass
7287 		{ }
7288 	};
7289 
7290 	/*
7291 	 * Force DAC 0x02 for the bass speakers 0x17.
7292 	 */
7293 	static const hda_nid_t conn[] = { 0x02 };
7294 
7295 	switch (action) {
7296 	case HDA_FIXUP_ACT_PRE_PROBE:
7297 		snd_hda_apply_pincfgs(codec, pincfgs);
7298 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7299 		break;
7300 	}
7301 
7302 	cs35l41_fixup_i2c_two(codec, fix, action);
7303 	alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7304 	alc245_fixup_hp_gpio_led(codec, fix, action);
7305 }
7306 
7307 /*
7308  * ALC287 PCM hooks
7309  */
7310 static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
7311 				   struct hda_codec *codec,
7312 				   struct snd_pcm_substream *substream,
7313 				   int action)
7314 {
7315 	alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7316 	switch (action) {
7317 	case HDA_GEN_PCM_ACT_OPEN:
7318 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
7319 		break;
7320 	case HDA_GEN_PCM_ACT_CLOSE:
7321 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7322 		break;
7323 	}
7324 }
7325 
7326 static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
7327 {
7328 	if (is_s4_suspend(codec)) {
7329 		alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7330 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7331 	}
7332 }
7333 
7334 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
7335 			       const struct hda_fixup *fix, int action)
7336 {
7337 	struct alc_spec *spec = codec->spec;
7338 
7339 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7340 		return;
7341 	spec->power_hook = alc287_s4_power_gpio3_default;
7342 	spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
7343 }
7344 
7345 
7346 enum {
7347 	ALC269_FIXUP_GPIO2,
7348 	ALC269_FIXUP_SONY_VAIO,
7349 	ALC275_FIXUP_SONY_VAIO_GPIO2,
7350 	ALC269_FIXUP_DELL_M101Z,
7351 	ALC269_FIXUP_SKU_IGNORE,
7352 	ALC269_FIXUP_ASUS_G73JW,
7353 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
7354 	ALC269_FIXUP_ASUS_N7601ZM,
7355 	ALC269_FIXUP_LENOVO_EAPD,
7356 	ALC275_FIXUP_SONY_HWEQ,
7357 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
7358 	ALC271_FIXUP_DMIC,
7359 	ALC269_FIXUP_PCM_44K,
7360 	ALC269_FIXUP_STEREO_DMIC,
7361 	ALC269_FIXUP_HEADSET_MIC,
7362 	ALC269_FIXUP_QUANTA_MUTE,
7363 	ALC269_FIXUP_LIFEBOOK,
7364 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
7365 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
7366 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7367 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7368 	ALC269_FIXUP_AMIC,
7369 	ALC269_FIXUP_DMIC,
7370 	ALC269VB_FIXUP_AMIC,
7371 	ALC269VB_FIXUP_DMIC,
7372 	ALC269_FIXUP_HP_MUTE_LED,
7373 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
7374 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
7375 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
7376 	ALC269_FIXUP_HP_GPIO_LED,
7377 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
7378 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
7379 	ALC269_FIXUP_INV_DMIC,
7380 	ALC269_FIXUP_LENOVO_DOCK,
7381 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7382 	ALC269_FIXUP_NO_SHUTUP,
7383 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7384 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7385 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7386 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7387 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7388 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7389 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7390 	ALC269_FIXUP_HEADSET_MODE,
7391 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7392 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7393 	ALC269_FIXUP_ASUS_X101_FUNC,
7394 	ALC269_FIXUP_ASUS_X101_VERB,
7395 	ALC269_FIXUP_ASUS_X101,
7396 	ALC271_FIXUP_AMIC_MIC2,
7397 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7398 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7399 	ALC269_FIXUP_ACER_AC700,
7400 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7401 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7402 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7403 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7404 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7405 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7406 	ALC283_FIXUP_CHROME_BOOK,
7407 	ALC283_FIXUP_SENSE_COMBO_JACK,
7408 	ALC282_FIXUP_ASUS_TX300,
7409 	ALC283_FIXUP_INT_MIC,
7410 	ALC290_FIXUP_MONO_SPEAKERS,
7411 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7412 	ALC290_FIXUP_SUBWOOFER,
7413 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7414 	ALC269_FIXUP_THINKPAD_ACPI,
7415 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7416 	ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7417 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7418 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7419 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7420 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7421 	ALC255_FIXUP_HEADSET_MODE,
7422 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7423 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7424 	ALC292_FIXUP_TPT440_DOCK,
7425 	ALC292_FIXUP_TPT440,
7426 	ALC283_FIXUP_HEADSET_MIC,
7427 	ALC255_FIXUP_MIC_MUTE_LED,
7428 	ALC282_FIXUP_ASPIRE_V5_PINS,
7429 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7430 	ALC280_FIXUP_HP_GPIO4,
7431 	ALC286_FIXUP_HP_GPIO_LED,
7432 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7433 	ALC280_FIXUP_HP_DOCK_PINS,
7434 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7435 	ALC280_FIXUP_HP_9480M,
7436 	ALC245_FIXUP_HP_X360_AMP,
7437 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7438 	ALC285_FIXUP_HP_ENVY_X360,
7439 	ALC288_FIXUP_DELL_HEADSET_MODE,
7440 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7441 	ALC288_FIXUP_DELL_XPS_13,
7442 	ALC288_FIXUP_DISABLE_AAMIX,
7443 	ALC292_FIXUP_DELL_E7X_AAMIX,
7444 	ALC292_FIXUP_DELL_E7X,
7445 	ALC292_FIXUP_DISABLE_AAMIX,
7446 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7447 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7448 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7449 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7450 	ALC275_FIXUP_DELL_XPS,
7451 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7452 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7453 	ALC255_FIXUP_DELL_SPK_NOISE,
7454 	ALC225_FIXUP_DISABLE_MIC_VREF,
7455 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7456 	ALC295_FIXUP_DISABLE_DAC3,
7457 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7458 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7459 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7460 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7461 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7462 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7463 	ALC280_FIXUP_HP_HEADSET_MIC,
7464 	ALC221_FIXUP_HP_FRONT_MIC,
7465 	ALC292_FIXUP_TPT460,
7466 	ALC298_FIXUP_SPK_VOLUME,
7467 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7468 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7469 	ALC269_FIXUP_ATIV_BOOK_8,
7470 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7471 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7472 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7473 	ALC256_FIXUP_ASUS_MIC,
7474 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7475 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7476 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7477 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7478 	ALC233_FIXUP_ACER_HEADSET_MIC,
7479 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7480 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7481 	ALC225_FIXUP_S3_POP_NOISE,
7482 	ALC700_FIXUP_INTEL_REFERENCE,
7483 	ALC274_FIXUP_DELL_BIND_DACS,
7484 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7485 	ALC298_FIXUP_TPT470_DOCK_FIX,
7486 	ALC298_FIXUP_TPT470_DOCK,
7487 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7488 	ALC255_FIXUP_DELL_HEADSET_MIC,
7489 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7490 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7491 	ALC295_FIXUP_HP_X360,
7492 	ALC221_FIXUP_HP_HEADSET_MIC,
7493 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7494 	ALC295_FIXUP_HP_AUTO_MUTE,
7495 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7496 	ALC294_FIXUP_ASUS_MIC,
7497 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7498 	ALC294_FIXUP_ASUS_SPK,
7499 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7500 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7501 	ALC255_FIXUP_ACER_HEADSET_MIC,
7502 	ALC295_FIXUP_CHROME_BOOK,
7503 	ALC225_FIXUP_HEADSET_JACK,
7504 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7505 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7506 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7507 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7508 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7509 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7510 	ALC299_FIXUP_PREDATOR_SPK,
7511 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7512 	ALC289_FIXUP_DELL_SPK1,
7513 	ALC289_FIXUP_DELL_SPK2,
7514 	ALC289_FIXUP_DUAL_SPK,
7515 	ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7516 	ALC294_FIXUP_SPK2_TO_DAC1,
7517 	ALC294_FIXUP_ASUS_DUAL_SPK,
7518 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7519 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7520 	ALC294_FIXUP_ASUS_ALLY,
7521 	ALC294_FIXUP_ASUS_ALLY_PINS,
7522 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7523 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7524 	ALC294_FIXUP_ASUS_HPE,
7525 	ALC294_FIXUP_ASUS_COEF_1B,
7526 	ALC294_FIXUP_ASUS_GX502_HP,
7527 	ALC294_FIXUP_ASUS_GX502_PINS,
7528 	ALC294_FIXUP_ASUS_GX502_VERBS,
7529 	ALC294_FIXUP_ASUS_GU502_HP,
7530 	ALC294_FIXUP_ASUS_GU502_PINS,
7531 	ALC294_FIXUP_ASUS_GU502_VERBS,
7532 	ALC294_FIXUP_ASUS_G513_PINS,
7533 	ALC285_FIXUP_ASUS_G533Z_PINS,
7534 	ALC285_FIXUP_HP_GPIO_LED,
7535 	ALC285_FIXUP_HP_MUTE_LED,
7536 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7537 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7538 	ALC236_FIXUP_HP_GPIO_LED,
7539 	ALC236_FIXUP_HP_MUTE_LED,
7540 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7541 	ALC298_FIXUP_SAMSUNG_AMP,
7542 	ALC298_FIXUP_SAMSUNG_AMP2,
7543 	ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7544 	ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7545 	ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7546 	ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7547 	ALC269VC_FIXUP_ACER_HEADSET_MIC,
7548 	ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7549 	ALC289_FIXUP_ASUS_GA401,
7550 	ALC289_FIXUP_ASUS_GA502,
7551 	ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7552 	ALC285_FIXUP_HP_GPIO_AMP_INIT,
7553 	ALC269_FIXUP_CZC_B20,
7554 	ALC269_FIXUP_CZC_TMI,
7555 	ALC269_FIXUP_CZC_L101,
7556 	ALC269_FIXUP_LEMOTE_A1802,
7557 	ALC269_FIXUP_LEMOTE_A190X,
7558 	ALC256_FIXUP_INTEL_NUC8_RUGGED,
7559 	ALC233_FIXUP_INTEL_NUC8_DMIC,
7560 	ALC233_FIXUP_INTEL_NUC8_BOOST,
7561 	ALC256_FIXUP_INTEL_NUC10,
7562 	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7563 	ALC274_FIXUP_HP_MIC,
7564 	ALC274_FIXUP_HP_HEADSET_MIC,
7565 	ALC274_FIXUP_HP_ENVY_GPIO,
7566 	ALC256_FIXUP_ASUS_HPE,
7567 	ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7568 	ALC287_FIXUP_HP_GPIO_LED,
7569 	ALC256_FIXUP_HP_HEADSET_MIC,
7570 	ALC245_FIXUP_HP_GPIO_LED,
7571 	ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7572 	ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7573 	ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7574 	ALC256_FIXUP_ACER_HEADSET_MIC,
7575 	ALC285_FIXUP_IDEAPAD_S740_COEF,
7576 	ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7577 	ALC295_FIXUP_ASUS_DACS,
7578 	ALC295_FIXUP_HP_OMEN,
7579 	ALC285_FIXUP_HP_SPECTRE_X360,
7580 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7581 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7582 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7583 	ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7584 	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7585 	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7586 	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7587 	ALC298_FIXUP_LENOVO_C940_DUET7,
7588 	ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
7589 	ALC287_FIXUP_LENOVO_LEGION_7,
7590 	ALC287_FIXUP_13S_GEN2_SPEAKERS,
7591 	ALC256_FIXUP_SET_COEF_DEFAULTS,
7592 	ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7593 	ALC233_FIXUP_NO_AUDIO_JACK,
7594 	ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7595 	ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7596 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7597 	ALC287_FIXUP_LEGION_16ACHG6,
7598 	ALC287_FIXUP_CS35L41_I2C_2,
7599 	ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7600 	ALC287_FIXUP_CS35L41_I2C_4,
7601 	ALC245_FIXUP_CS35L41_SPI_2,
7602 	ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7603 	ALC245_FIXUP_CS35L41_SPI_4,
7604 	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7605 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7606 	ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7607 	ALC287_FIXUP_LEGION_16ITHG6,
7608 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7609 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7610 	ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
7611 	ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7612 	ALC236_FIXUP_DELL_DUAL_CODECS,
7613 	ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
7614 	ALC287_FIXUP_TAS2781_I2C,
7615 	ALC287_FIXUP_YOGA7_14ARB7_I2C,
7616 	ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
7617 	ALC245_FIXUP_HP_X360_MUTE_LEDS,
7618 	ALC287_FIXUP_THINKPAD_I2S_SPK,
7619 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
7620 	ALC2XX_FIXUP_HEADSET_MIC,
7621 	ALC289_FIXUP_DELL_CS35L41_SPI_2,
7622 	ALC294_FIXUP_CS35L41_I2C_2,
7623 	ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED,
7624 	ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
7625 	ALC256_FIXUP_HEADPHONE_AMP_VOL,
7626 	ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
7627 	ALC285_FIXUP_CS35L56_SPI_2,
7628 	ALC285_FIXUP_CS35L56_I2C_2,
7629 	ALC285_FIXUP_CS35L56_I2C_4,
7630 	ALC285_FIXUP_ASUS_GA403U,
7631 	ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
7632 	ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
7633 	ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
7634 	ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
7635 	ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
7636 	ALC256_FIXUP_CHROME_BOOK,
7637 	ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7,
7638 	ALC287_FIXUP_LENOVO_SSID_17AA3820,
7639 	ALCXXX_FIXUP_CS35LXX,
7640 };
7641 
7642 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7643  * both have the very same PCI SSID, and we need to apply different fixups
7644  * depending on the codec ID
7645  */
7646 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7647 					   const struct hda_fixup *fix,
7648 					   int action)
7649 {
7650 	int id;
7651 
7652 	if (codec->core.vendor_id == 0x10ec0298)
7653 		id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7654 	else
7655 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7656 	__snd_hda_apply_fixup(codec, id, action, 0);
7657 }
7658 
7659 /* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
7660  * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
7661  * so we need to apply a different fixup in this case. The only DuetITL codec
7662  * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
7663  * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
7664  * have matched correctly by their codecs.
7665  */
7666 static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
7667 					      const struct hda_fixup *fix,
7668 					      int action)
7669 {
7670 	int id;
7671 
7672 	if (codec->core.subsystem_id == 0x17aa3802)
7673 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
7674 	else
7675 		id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
7676 	__snd_hda_apply_fixup(codec, id, action, 0);
7677 }
7678 
7679 /* Similar to above the Lenovo Yoga Pro 7 14ARP8 PCI SSID matches the codec SSID of the
7680    Legion Y9000X 2022 IAH7.*/
7681 static void alc287_fixup_lenovo_14arp8_legion_iah7(struct hda_codec *codec,
7682 					   const struct hda_fixup *fix,
7683 					   int action)
7684 {
7685 	int id;
7686 
7687 	if (codec->core.subsystem_id == 0x17aa386e)
7688 		id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion Y9000X 2022 IAH7 */
7689 	else
7690 		id = ALC285_FIXUP_SPEAKER2_TO_DAC1; /* Yoga Pro 7 14ARP8 */
7691 	__snd_hda_apply_fixup(codec, id, action, 0);
7692 }
7693 
7694 /* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with
7695  * TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec);
7696  * we apply a corresponding fixup depending on the codec SSID instead
7697  */
7698 static void alc287_fixup_lenovo_legion_7(struct hda_codec *codec,
7699 					 const struct hda_fixup *fix,
7700 					 int action)
7701 {
7702 	int id;
7703 
7704 	if (codec->core.subsystem_id == 0x17aa38a8)
7705 		id = ALC287_FIXUP_TAS2781_I2C; /* Legion Pro 7 16ARX8H */
7706 	else
7707 		id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion 7i 16IAX7 */
7708 	__snd_hda_apply_fixup(codec, id, action, 0);
7709 }
7710 
7711 /* Yet more conflicting PCI SSID (17aa:3820) on two Lenovo models */
7712 static void alc287_fixup_lenovo_ssid_17aa3820(struct hda_codec *codec,
7713 					      const struct hda_fixup *fix,
7714 					      int action)
7715 {
7716 	int id;
7717 
7718 	if (codec->core.subsystem_id == 0x17aa3820)
7719 		id = ALC269_FIXUP_ASPIRE_HEADSET_MIC; /* IdeaPad 330-17IKB 81DM */
7720 	else /* 0x17aa3802 */
7721 		id =  ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* "Yoga Duet 7 13ITL6 */
7722 	__snd_hda_apply_fixup(codec, id, action, 0);
7723 }
7724 
7725 static const struct hda_fixup alc269_fixups[] = {
7726 	[ALC269_FIXUP_GPIO2] = {
7727 		.type = HDA_FIXUP_FUNC,
7728 		.v.func = alc_fixup_gpio2,
7729 	},
7730 	[ALC269_FIXUP_SONY_VAIO] = {
7731 		.type = HDA_FIXUP_PINCTLS,
7732 		.v.pins = (const struct hda_pintbl[]) {
7733 			{0x19, PIN_VREFGRD},
7734 			{}
7735 		}
7736 	},
7737 	[ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7738 		.type = HDA_FIXUP_FUNC,
7739 		.v.func = alc275_fixup_gpio4_off,
7740 		.chained = true,
7741 		.chain_id = ALC269_FIXUP_SONY_VAIO
7742 	},
7743 	[ALC269_FIXUP_DELL_M101Z] = {
7744 		.type = HDA_FIXUP_VERBS,
7745 		.v.verbs = (const struct hda_verb[]) {
7746 			/* Enables internal speaker */
7747 			{0x20, AC_VERB_SET_COEF_INDEX, 13},
7748 			{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7749 			{}
7750 		}
7751 	},
7752 	[ALC269_FIXUP_SKU_IGNORE] = {
7753 		.type = HDA_FIXUP_FUNC,
7754 		.v.func = alc_fixup_sku_ignore,
7755 	},
7756 	[ALC269_FIXUP_ASUS_G73JW] = {
7757 		.type = HDA_FIXUP_PINS,
7758 		.v.pins = (const struct hda_pintbl[]) {
7759 			{ 0x17, 0x99130111 }, /* subwoofer */
7760 			{ }
7761 		}
7762 	},
7763 	[ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7764 		.type = HDA_FIXUP_PINS,
7765 		.v.pins = (const struct hda_pintbl[]) {
7766 			{ 0x19, 0x03A11050 },
7767 			{ 0x1a, 0x03A11C30 },
7768 			{ 0x21, 0x03211420 },
7769 			{ }
7770 		}
7771 	},
7772 	[ALC269_FIXUP_ASUS_N7601ZM] = {
7773 		.type = HDA_FIXUP_VERBS,
7774 		.v.verbs = (const struct hda_verb[]) {
7775 			{0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7776 			{0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7777 			{0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7778 			{0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7779 			{0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7780 			{0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7781 			{ }
7782 		},
7783 		.chained = true,
7784 		.chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7785 	},
7786 	[ALC269_FIXUP_LENOVO_EAPD] = {
7787 		.type = HDA_FIXUP_VERBS,
7788 		.v.verbs = (const struct hda_verb[]) {
7789 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7790 			{}
7791 		}
7792 	},
7793 	[ALC275_FIXUP_SONY_HWEQ] = {
7794 		.type = HDA_FIXUP_FUNC,
7795 		.v.func = alc269_fixup_hweq,
7796 		.chained = true,
7797 		.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7798 	},
7799 	[ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7800 		.type = HDA_FIXUP_FUNC,
7801 		.v.func = alc_fixup_disable_aamix,
7802 		.chained = true,
7803 		.chain_id = ALC269_FIXUP_SONY_VAIO
7804 	},
7805 	[ALC271_FIXUP_DMIC] = {
7806 		.type = HDA_FIXUP_FUNC,
7807 		.v.func = alc271_fixup_dmic,
7808 	},
7809 	[ALC269_FIXUP_PCM_44K] = {
7810 		.type = HDA_FIXUP_FUNC,
7811 		.v.func = alc269_fixup_pcm_44k,
7812 		.chained = true,
7813 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7814 	},
7815 	[ALC269_FIXUP_STEREO_DMIC] = {
7816 		.type = HDA_FIXUP_FUNC,
7817 		.v.func = alc269_fixup_stereo_dmic,
7818 	},
7819 	[ALC269_FIXUP_HEADSET_MIC] = {
7820 		.type = HDA_FIXUP_FUNC,
7821 		.v.func = alc269_fixup_headset_mic,
7822 	},
7823 	[ALC269_FIXUP_QUANTA_MUTE] = {
7824 		.type = HDA_FIXUP_FUNC,
7825 		.v.func = alc269_fixup_quanta_mute,
7826 	},
7827 	[ALC269_FIXUP_LIFEBOOK] = {
7828 		.type = HDA_FIXUP_PINS,
7829 		.v.pins = (const struct hda_pintbl[]) {
7830 			{ 0x1a, 0x2101103f }, /* dock line-out */
7831 			{ 0x1b, 0x23a11040 }, /* dock mic-in */
7832 			{ }
7833 		},
7834 		.chained = true,
7835 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7836 	},
7837 	[ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7838 		.type = HDA_FIXUP_PINS,
7839 		.v.pins = (const struct hda_pintbl[]) {
7840 			{ 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7841 			{ }
7842 		},
7843 	},
7844 	[ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7845 		.type = HDA_FIXUP_PINS,
7846 		.v.pins = (const struct hda_pintbl[]) {
7847 			{ 0x21, 0x0221102f }, /* HP out */
7848 			{ }
7849 		},
7850 	},
7851 	[ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7852 		.type = HDA_FIXUP_FUNC,
7853 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7854 	},
7855 	[ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7856 		.type = HDA_FIXUP_FUNC,
7857 		.v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7858 	},
7859 	[ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7860 		.type = HDA_FIXUP_PINS,
7861 		.v.pins = (const struct hda_pintbl[]) {
7862 			{ 0x18, 0x03a19020 }, /* headset mic */
7863 			{ 0x1b, 0x90170150 }, /* speaker */
7864 			{ }
7865 		},
7866 	},
7867 	[ALC269_FIXUP_AMIC] = {
7868 		.type = HDA_FIXUP_PINS,
7869 		.v.pins = (const struct hda_pintbl[]) {
7870 			{ 0x14, 0x99130110 }, /* speaker */
7871 			{ 0x15, 0x0121401f }, /* HP out */
7872 			{ 0x18, 0x01a19c20 }, /* mic */
7873 			{ 0x19, 0x99a3092f }, /* int-mic */
7874 			{ }
7875 		},
7876 	},
7877 	[ALC269_FIXUP_DMIC] = {
7878 		.type = HDA_FIXUP_PINS,
7879 		.v.pins = (const struct hda_pintbl[]) {
7880 			{ 0x12, 0x99a3092f }, /* int-mic */
7881 			{ 0x14, 0x99130110 }, /* speaker */
7882 			{ 0x15, 0x0121401f }, /* HP out */
7883 			{ 0x18, 0x01a19c20 }, /* mic */
7884 			{ }
7885 		},
7886 	},
7887 	[ALC269VB_FIXUP_AMIC] = {
7888 		.type = HDA_FIXUP_PINS,
7889 		.v.pins = (const struct hda_pintbl[]) {
7890 			{ 0x14, 0x99130110 }, /* speaker */
7891 			{ 0x18, 0x01a19c20 }, /* mic */
7892 			{ 0x19, 0x99a3092f }, /* int-mic */
7893 			{ 0x21, 0x0121401f }, /* HP out */
7894 			{ }
7895 		},
7896 	},
7897 	[ALC269VB_FIXUP_DMIC] = {
7898 		.type = HDA_FIXUP_PINS,
7899 		.v.pins = (const struct hda_pintbl[]) {
7900 			{ 0x12, 0x99a3092f }, /* int-mic */
7901 			{ 0x14, 0x99130110 }, /* speaker */
7902 			{ 0x18, 0x01a19c20 }, /* mic */
7903 			{ 0x21, 0x0121401f }, /* HP out */
7904 			{ }
7905 		},
7906 	},
7907 	[ALC269_FIXUP_HP_MUTE_LED] = {
7908 		.type = HDA_FIXUP_FUNC,
7909 		.v.func = alc269_fixup_hp_mute_led,
7910 	},
7911 	[ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7912 		.type = HDA_FIXUP_FUNC,
7913 		.v.func = alc269_fixup_hp_mute_led_mic1,
7914 	},
7915 	[ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7916 		.type = HDA_FIXUP_FUNC,
7917 		.v.func = alc269_fixup_hp_mute_led_mic2,
7918 	},
7919 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7920 		.type = HDA_FIXUP_FUNC,
7921 		.v.func = alc269_fixup_hp_mute_led_mic3,
7922 		.chained = true,
7923 		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7924 	},
7925 	[ALC269_FIXUP_HP_GPIO_LED] = {
7926 		.type = HDA_FIXUP_FUNC,
7927 		.v.func = alc269_fixup_hp_gpio_led,
7928 	},
7929 	[ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7930 		.type = HDA_FIXUP_FUNC,
7931 		.v.func = alc269_fixup_hp_gpio_mic1_led,
7932 	},
7933 	[ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7934 		.type = HDA_FIXUP_FUNC,
7935 		.v.func = alc269_fixup_hp_line1_mic1_led,
7936 	},
7937 	[ALC269_FIXUP_INV_DMIC] = {
7938 		.type = HDA_FIXUP_FUNC,
7939 		.v.func = alc_fixup_inv_dmic,
7940 	},
7941 	[ALC269_FIXUP_NO_SHUTUP] = {
7942 		.type = HDA_FIXUP_FUNC,
7943 		.v.func = alc_fixup_no_shutup,
7944 	},
7945 	[ALC269_FIXUP_LENOVO_DOCK] = {
7946 		.type = HDA_FIXUP_PINS,
7947 		.v.pins = (const struct hda_pintbl[]) {
7948 			{ 0x19, 0x23a11040 }, /* dock mic */
7949 			{ 0x1b, 0x2121103f }, /* dock headphone */
7950 			{ }
7951 		},
7952 		.chained = true,
7953 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7954 	},
7955 	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7956 		.type = HDA_FIXUP_FUNC,
7957 		.v.func = alc269_fixup_limit_int_mic_boost,
7958 		.chained = true,
7959 		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
7960 	},
7961 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7962 		.type = HDA_FIXUP_FUNC,
7963 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7964 		.chained = true,
7965 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7966 	},
7967 	[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7968 		.type = HDA_FIXUP_PINS,
7969 		.v.pins = (const struct hda_pintbl[]) {
7970 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7971 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7972 			{ }
7973 		},
7974 		.chained = true,
7975 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7976 	},
7977 	[ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7978 		.type = HDA_FIXUP_PINS,
7979 		.v.pins = (const struct hda_pintbl[]) {
7980 			{ 0x16, 0x21014020 }, /* dock line out */
7981 			{ 0x19, 0x21a19030 }, /* dock mic */
7982 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7983 			{ }
7984 		},
7985 		.chained = true,
7986 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7987 	},
7988 	[ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7989 		.type = HDA_FIXUP_PINS,
7990 		.v.pins = (const struct hda_pintbl[]) {
7991 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7992 			{ }
7993 		},
7994 		.chained = true,
7995 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7996 	},
7997 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7998 		.type = HDA_FIXUP_PINS,
7999 		.v.pins = (const struct hda_pintbl[]) {
8000 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8001 			{ 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8002 			{ }
8003 		},
8004 		.chained = true,
8005 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8006 	},
8007 	[ALC269_FIXUP_HEADSET_MODE] = {
8008 		.type = HDA_FIXUP_FUNC,
8009 		.v.func = alc_fixup_headset_mode,
8010 		.chained = true,
8011 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8012 	},
8013 	[ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8014 		.type = HDA_FIXUP_FUNC,
8015 		.v.func = alc_fixup_headset_mode_no_hp_mic,
8016 	},
8017 	[ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
8018 		.type = HDA_FIXUP_PINS,
8019 		.v.pins = (const struct hda_pintbl[]) {
8020 			{ 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
8021 			{ }
8022 		},
8023 		.chained = true,
8024 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8025 	},
8026 	[ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
8027 		.type = HDA_FIXUP_PINS,
8028 		.v.pins = (const struct hda_pintbl[]) {
8029 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8030 			{ }
8031 		},
8032 		.chained = true,
8033 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8034 	},
8035 	[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8036 		.type = HDA_FIXUP_PINS,
8037 		.v.pins = (const struct hda_pintbl[]) {
8038 			{0x12, 0x90a60130},
8039 			{0x13, 0x40000000},
8040 			{0x14, 0x90170110},
8041 			{0x18, 0x411111f0},
8042 			{0x19, 0x04a11040},
8043 			{0x1a, 0x411111f0},
8044 			{0x1b, 0x90170112},
8045 			{0x1d, 0x40759a05},
8046 			{0x1e, 0x411111f0},
8047 			{0x21, 0x04211020},
8048 			{ }
8049 		},
8050 		.chained = true,
8051 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8052 	},
8053 	[ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
8054 		.type = HDA_FIXUP_FUNC,
8055 		.v.func = alc298_fixup_huawei_mbx_stereo,
8056 		.chained = true,
8057 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8058 	},
8059 	[ALC269_FIXUP_ASUS_X101_FUNC] = {
8060 		.type = HDA_FIXUP_FUNC,
8061 		.v.func = alc269_fixup_x101_headset_mic,
8062 	},
8063 	[ALC269_FIXUP_ASUS_X101_VERB] = {
8064 		.type = HDA_FIXUP_VERBS,
8065 		.v.verbs = (const struct hda_verb[]) {
8066 			{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
8067 			{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8068 			{0x20, AC_VERB_SET_PROC_COEF,  0x0310},
8069 			{ }
8070 		},
8071 		.chained = true,
8072 		.chain_id = ALC269_FIXUP_ASUS_X101_FUNC
8073 	},
8074 	[ALC269_FIXUP_ASUS_X101] = {
8075 		.type = HDA_FIXUP_PINS,
8076 		.v.pins = (const struct hda_pintbl[]) {
8077 			{ 0x18, 0x04a1182c }, /* Headset mic */
8078 			{ }
8079 		},
8080 		.chained = true,
8081 		.chain_id = ALC269_FIXUP_ASUS_X101_VERB
8082 	},
8083 	[ALC271_FIXUP_AMIC_MIC2] = {
8084 		.type = HDA_FIXUP_PINS,
8085 		.v.pins = (const struct hda_pintbl[]) {
8086 			{ 0x14, 0x99130110 }, /* speaker */
8087 			{ 0x19, 0x01a19c20 }, /* mic */
8088 			{ 0x1b, 0x99a7012f }, /* int-mic */
8089 			{ 0x21, 0x0121401f }, /* HP out */
8090 			{ }
8091 		},
8092 	},
8093 	[ALC271_FIXUP_HP_GATE_MIC_JACK] = {
8094 		.type = HDA_FIXUP_FUNC,
8095 		.v.func = alc271_hp_gate_mic_jack,
8096 		.chained = true,
8097 		.chain_id = ALC271_FIXUP_AMIC_MIC2,
8098 	},
8099 	[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
8100 		.type = HDA_FIXUP_FUNC,
8101 		.v.func = alc269_fixup_limit_int_mic_boost,
8102 		.chained = true,
8103 		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
8104 	},
8105 	[ALC269_FIXUP_ACER_AC700] = {
8106 		.type = HDA_FIXUP_PINS,
8107 		.v.pins = (const struct hda_pintbl[]) {
8108 			{ 0x12, 0x99a3092f }, /* int-mic */
8109 			{ 0x14, 0x99130110 }, /* speaker */
8110 			{ 0x18, 0x03a11c20 }, /* mic */
8111 			{ 0x1e, 0x0346101e }, /* SPDIF1 */
8112 			{ 0x21, 0x0321101f }, /* HP out */
8113 			{ }
8114 		},
8115 		.chained = true,
8116 		.chain_id = ALC271_FIXUP_DMIC,
8117 	},
8118 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
8119 		.type = HDA_FIXUP_FUNC,
8120 		.v.func = alc269_fixup_limit_int_mic_boost,
8121 		.chained = true,
8122 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8123 	},
8124 	[ALC269VB_FIXUP_ASUS_ZENBOOK] = {
8125 		.type = HDA_FIXUP_FUNC,
8126 		.v.func = alc269_fixup_limit_int_mic_boost,
8127 		.chained = true,
8128 		.chain_id = ALC269VB_FIXUP_DMIC,
8129 	},
8130 	[ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
8131 		.type = HDA_FIXUP_VERBS,
8132 		.v.verbs = (const struct hda_verb[]) {
8133 			/* class-D output amp +5dB */
8134 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
8135 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
8136 			{}
8137 		},
8138 		.chained = true,
8139 		.chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
8140 	},
8141 	[ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8142 		.type = HDA_FIXUP_PINS,
8143 		.v.pins = (const struct hda_pintbl[]) {
8144 			{ 0x18, 0x01a110f0 },  /* use as headset mic */
8145 			{ }
8146 		},
8147 		.chained = true,
8148 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8149 	},
8150 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8151 		.type = HDA_FIXUP_FUNC,
8152 		.v.func = alc269_fixup_limit_int_mic_boost,
8153 		.chained = true,
8154 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8155 	},
8156 	[ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8157 		.type = HDA_FIXUP_PINS,
8158 		.v.pins = (const struct hda_pintbl[]) {
8159 			{ 0x12, 0x99a3092f }, /* int-mic */
8160 			{ 0x18, 0x03a11d20 }, /* mic */
8161 			{ 0x19, 0x411111f0 }, /* Unused bogus pin */
8162 			{ }
8163 		},
8164 	},
8165 	[ALC283_FIXUP_CHROME_BOOK] = {
8166 		.type = HDA_FIXUP_FUNC,
8167 		.v.func = alc283_fixup_chromebook,
8168 	},
8169 	[ALC283_FIXUP_SENSE_COMBO_JACK] = {
8170 		.type = HDA_FIXUP_FUNC,
8171 		.v.func = alc283_fixup_sense_combo_jack,
8172 		.chained = true,
8173 		.chain_id = ALC283_FIXUP_CHROME_BOOK,
8174 	},
8175 	[ALC282_FIXUP_ASUS_TX300] = {
8176 		.type = HDA_FIXUP_FUNC,
8177 		.v.func = alc282_fixup_asus_tx300,
8178 	},
8179 	[ALC283_FIXUP_INT_MIC] = {
8180 		.type = HDA_FIXUP_VERBS,
8181 		.v.verbs = (const struct hda_verb[]) {
8182 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8183 			{0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8184 			{ }
8185 		},
8186 		.chained = true,
8187 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8188 	},
8189 	[ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8190 		.type = HDA_FIXUP_PINS,
8191 		.v.pins = (const struct hda_pintbl[]) {
8192 			{ 0x17, 0x90170112 }, /* subwoofer */
8193 			{ }
8194 		},
8195 		.chained = true,
8196 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8197 	},
8198 	[ALC290_FIXUP_SUBWOOFER] = {
8199 		.type = HDA_FIXUP_PINS,
8200 		.v.pins = (const struct hda_pintbl[]) {
8201 			{ 0x17, 0x90170112 }, /* subwoofer */
8202 			{ }
8203 		},
8204 		.chained = true,
8205 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8206 	},
8207 	[ALC290_FIXUP_MONO_SPEAKERS] = {
8208 		.type = HDA_FIXUP_FUNC,
8209 		.v.func = alc290_fixup_mono_speakers,
8210 	},
8211 	[ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8212 		.type = HDA_FIXUP_FUNC,
8213 		.v.func = alc290_fixup_mono_speakers,
8214 		.chained = true,
8215 		.chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8216 	},
8217 	[ALC269_FIXUP_THINKPAD_ACPI] = {
8218 		.type = HDA_FIXUP_FUNC,
8219 		.v.func = alc_fixup_thinkpad_acpi,
8220 		.chained = true,
8221 		.chain_id = ALC269_FIXUP_SKU_IGNORE,
8222 	},
8223 	[ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8224 		.type = HDA_FIXUP_FUNC,
8225 		.v.func = alc_fixup_inv_dmic,
8226 		.chained = true,
8227 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8228 	},
8229 	[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
8230 		.type = HDA_FIXUP_PINS,
8231 		.v.pins = (const struct hda_pintbl[]) {
8232 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8233 			{ }
8234 		},
8235 		.chained = true,
8236 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8237 	},
8238 	[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8239 		.type = HDA_FIXUP_PINS,
8240 		.v.pins = (const struct hda_pintbl[]) {
8241 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8242 			{ }
8243 		},
8244 		.chained = true,
8245 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8246 	},
8247 	[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8248 		.type = HDA_FIXUP_PINS,
8249 		.v.pins = (const struct hda_pintbl[]) {
8250 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8251 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8252 			{ }
8253 		},
8254 		.chained = true,
8255 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8256 	},
8257 	[ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8258 		.type = HDA_FIXUP_PINS,
8259 		.v.pins = (const struct hda_pintbl[]) {
8260 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8261 			{ }
8262 		},
8263 		.chained = true,
8264 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8265 	},
8266 	[ALC255_FIXUP_HEADSET_MODE] = {
8267 		.type = HDA_FIXUP_FUNC,
8268 		.v.func = alc_fixup_headset_mode_alc255,
8269 		.chained = true,
8270 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8271 	},
8272 	[ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8273 		.type = HDA_FIXUP_FUNC,
8274 		.v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8275 	},
8276 	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8277 		.type = HDA_FIXUP_PINS,
8278 		.v.pins = (const struct hda_pintbl[]) {
8279 			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8280 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8281 			{ }
8282 		},
8283 		.chained = true,
8284 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8285 	},
8286 	[ALC292_FIXUP_TPT440_DOCK] = {
8287 		.type = HDA_FIXUP_FUNC,
8288 		.v.func = alc_fixup_tpt440_dock,
8289 		.chained = true,
8290 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8291 	},
8292 	[ALC292_FIXUP_TPT440] = {
8293 		.type = HDA_FIXUP_FUNC,
8294 		.v.func = alc_fixup_disable_aamix,
8295 		.chained = true,
8296 		.chain_id = ALC292_FIXUP_TPT440_DOCK,
8297 	},
8298 	[ALC283_FIXUP_HEADSET_MIC] = {
8299 		.type = HDA_FIXUP_PINS,
8300 		.v.pins = (const struct hda_pintbl[]) {
8301 			{ 0x19, 0x04a110f0 },
8302 			{ },
8303 		},
8304 	},
8305 	[ALC255_FIXUP_MIC_MUTE_LED] = {
8306 		.type = HDA_FIXUP_FUNC,
8307 		.v.func = alc_fixup_micmute_led,
8308 	},
8309 	[ALC282_FIXUP_ASPIRE_V5_PINS] = {
8310 		.type = HDA_FIXUP_PINS,
8311 		.v.pins = (const struct hda_pintbl[]) {
8312 			{ 0x12, 0x90a60130 },
8313 			{ 0x14, 0x90170110 },
8314 			{ 0x17, 0x40000008 },
8315 			{ 0x18, 0x411111f0 },
8316 			{ 0x19, 0x01a1913c },
8317 			{ 0x1a, 0x411111f0 },
8318 			{ 0x1b, 0x411111f0 },
8319 			{ 0x1d, 0x40f89b2d },
8320 			{ 0x1e, 0x411111f0 },
8321 			{ 0x21, 0x0321101f },
8322 			{ },
8323 		},
8324 	},
8325 	[ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8326 		.type = HDA_FIXUP_FUNC,
8327 		.v.func = alc269vb_fixup_aspire_e1_coef,
8328 	},
8329 	[ALC280_FIXUP_HP_GPIO4] = {
8330 		.type = HDA_FIXUP_FUNC,
8331 		.v.func = alc280_fixup_hp_gpio4,
8332 	},
8333 	[ALC286_FIXUP_HP_GPIO_LED] = {
8334 		.type = HDA_FIXUP_FUNC,
8335 		.v.func = alc286_fixup_hp_gpio_led,
8336 	},
8337 	[ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8338 		.type = HDA_FIXUP_FUNC,
8339 		.v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8340 	},
8341 	[ALC280_FIXUP_HP_DOCK_PINS] = {
8342 		.type = HDA_FIXUP_PINS,
8343 		.v.pins = (const struct hda_pintbl[]) {
8344 			{ 0x1b, 0x21011020 }, /* line-out */
8345 			{ 0x1a, 0x01a1903c }, /* headset mic */
8346 			{ 0x18, 0x2181103f }, /* line-in */
8347 			{ },
8348 		},
8349 		.chained = true,
8350 		.chain_id = ALC280_FIXUP_HP_GPIO4
8351 	},
8352 	[ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8353 		.type = HDA_FIXUP_PINS,
8354 		.v.pins = (const struct hda_pintbl[]) {
8355 			{ 0x1b, 0x21011020 }, /* line-out */
8356 			{ 0x18, 0x2181103f }, /* line-in */
8357 			{ },
8358 		},
8359 		.chained = true,
8360 		.chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8361 	},
8362 	[ALC280_FIXUP_HP_9480M] = {
8363 		.type = HDA_FIXUP_FUNC,
8364 		.v.func = alc280_fixup_hp_9480m,
8365 	},
8366 	[ALC245_FIXUP_HP_X360_AMP] = {
8367 		.type = HDA_FIXUP_FUNC,
8368 		.v.func = alc245_fixup_hp_x360_amp,
8369 		.chained = true,
8370 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
8371 	},
8372 	[ALC288_FIXUP_DELL_HEADSET_MODE] = {
8373 		.type = HDA_FIXUP_FUNC,
8374 		.v.func = alc_fixup_headset_mode_dell_alc288,
8375 		.chained = true,
8376 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8377 	},
8378 	[ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8379 		.type = HDA_FIXUP_PINS,
8380 		.v.pins = (const struct hda_pintbl[]) {
8381 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8382 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8383 			{ }
8384 		},
8385 		.chained = true,
8386 		.chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8387 	},
8388 	[ALC288_FIXUP_DISABLE_AAMIX] = {
8389 		.type = HDA_FIXUP_FUNC,
8390 		.v.func = alc_fixup_disable_aamix,
8391 		.chained = true,
8392 		.chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
8393 	},
8394 	[ALC288_FIXUP_DELL_XPS_13] = {
8395 		.type = HDA_FIXUP_FUNC,
8396 		.v.func = alc_fixup_dell_xps13,
8397 		.chained = true,
8398 		.chain_id = ALC288_FIXUP_DISABLE_AAMIX
8399 	},
8400 	[ALC292_FIXUP_DISABLE_AAMIX] = {
8401 		.type = HDA_FIXUP_FUNC,
8402 		.v.func = alc_fixup_disable_aamix,
8403 		.chained = true,
8404 		.chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8405 	},
8406 	[ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8407 		.type = HDA_FIXUP_FUNC,
8408 		.v.func = alc_fixup_disable_aamix,
8409 		.chained = true,
8410 		.chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8411 	},
8412 	[ALC292_FIXUP_DELL_E7X_AAMIX] = {
8413 		.type = HDA_FIXUP_FUNC,
8414 		.v.func = alc_fixup_dell_xps13,
8415 		.chained = true,
8416 		.chain_id = ALC292_FIXUP_DISABLE_AAMIX
8417 	},
8418 	[ALC292_FIXUP_DELL_E7X] = {
8419 		.type = HDA_FIXUP_FUNC,
8420 		.v.func = alc_fixup_micmute_led,
8421 		/* micmute fixup must be applied at last */
8422 		.chained_before = true,
8423 		.chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8424 	},
8425 	[ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8426 		.type = HDA_FIXUP_PINS,
8427 		.v.pins = (const struct hda_pintbl[]) {
8428 			{ 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8429 			{ }
8430 		},
8431 		.chained_before = true,
8432 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8433 	},
8434 	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8435 		.type = HDA_FIXUP_PINS,
8436 		.v.pins = (const struct hda_pintbl[]) {
8437 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8438 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8439 			{ }
8440 		},
8441 		.chained = true,
8442 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8443 	},
8444 	[ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8445 		.type = HDA_FIXUP_PINS,
8446 		.v.pins = (const struct hda_pintbl[]) {
8447 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8448 			{ }
8449 		},
8450 		.chained = true,
8451 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8452 	},
8453 	[ALC275_FIXUP_DELL_XPS] = {
8454 		.type = HDA_FIXUP_VERBS,
8455 		.v.verbs = (const struct hda_verb[]) {
8456 			/* Enables internal speaker */
8457 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8458 			{0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8459 			{0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8460 			{0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8461 			{}
8462 		}
8463 	},
8464 	[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8465 		.type = HDA_FIXUP_FUNC,
8466 		.v.func = alc_fixup_disable_aamix,
8467 		.chained = true,
8468 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8469 	},
8470 	[ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8471 		.type = HDA_FIXUP_FUNC,
8472 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8473 	},
8474 	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8475 		.type = HDA_FIXUP_FUNC,
8476 		.v.func = alc_fixup_inv_dmic,
8477 		.chained = true,
8478 		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8479 	},
8480 	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8481 		.type = HDA_FIXUP_FUNC,
8482 		.v.func = alc269_fixup_limit_int_mic_boost
8483 	},
8484 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
8485 		.type = HDA_FIXUP_FUNC,
8486 		.v.func = alc_fixup_disable_aamix,
8487 		.chained = true,
8488 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8489 	},
8490 	[ALC225_FIXUP_DISABLE_MIC_VREF] = {
8491 		.type = HDA_FIXUP_FUNC,
8492 		.v.func = alc_fixup_disable_mic_vref,
8493 		.chained = true,
8494 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8495 	},
8496 	[ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8497 		.type = HDA_FIXUP_VERBS,
8498 		.v.verbs = (const struct hda_verb[]) {
8499 			/* Disable pass-through path for FRONT 14h */
8500 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8501 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8502 			{}
8503 		},
8504 		.chained = true,
8505 		.chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8506 	},
8507 	[ALC280_FIXUP_HP_HEADSET_MIC] = {
8508 		.type = HDA_FIXUP_FUNC,
8509 		.v.func = alc_fixup_disable_aamix,
8510 		.chained = true,
8511 		.chain_id = ALC269_FIXUP_HEADSET_MIC,
8512 	},
8513 	[ALC221_FIXUP_HP_FRONT_MIC] = {
8514 		.type = HDA_FIXUP_PINS,
8515 		.v.pins = (const struct hda_pintbl[]) {
8516 			{ 0x19, 0x02a19020 }, /* Front Mic */
8517 			{ }
8518 		},
8519 	},
8520 	[ALC292_FIXUP_TPT460] = {
8521 		.type = HDA_FIXUP_FUNC,
8522 		.v.func = alc_fixup_tpt440_dock,
8523 		.chained = true,
8524 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8525 	},
8526 	[ALC298_FIXUP_SPK_VOLUME] = {
8527 		.type = HDA_FIXUP_FUNC,
8528 		.v.func = alc298_fixup_speaker_volume,
8529 		.chained = true,
8530 		.chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8531 	},
8532 	[ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8533 		.type = HDA_FIXUP_FUNC,
8534 		.v.func = alc298_fixup_speaker_volume,
8535 	},
8536 	[ALC295_FIXUP_DISABLE_DAC3] = {
8537 		.type = HDA_FIXUP_FUNC,
8538 		.v.func = alc295_fixup_disable_dac3,
8539 	},
8540 	[ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8541 		.type = HDA_FIXUP_FUNC,
8542 		.v.func = alc285_fixup_speaker2_to_dac1,
8543 		.chained = true,
8544 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8545 	},
8546 	[ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8547 		.type = HDA_FIXUP_FUNC,
8548 		.v.func = alc285_fixup_speaker2_to_dac1,
8549 		.chained = true,
8550 		.chain_id = ALC245_FIXUP_CS35L41_SPI_2
8551 	},
8552 	[ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8553 		.type = HDA_FIXUP_PINS,
8554 		.v.pins = (const struct hda_pintbl[]) {
8555 			{ 0x19, 0x03a11050 },
8556 			{ 0x1b, 0x03a11c30 },
8557 			{ }
8558 		},
8559 		.chained = true,
8560 		.chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8561 	},
8562 	[ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8563 		.type = HDA_FIXUP_PINS,
8564 		.v.pins = (const struct hda_pintbl[]) {
8565 			{ 0x14, 0x90170120 },
8566 			{ }
8567 		},
8568 		.chained = true,
8569 		.chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8570 	},
8571 	[ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8572 		.type = HDA_FIXUP_FUNC,
8573 		.v.func = alc285_fixup_speaker2_to_dac1,
8574 		.chained = true,
8575 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2
8576 	},
8577 	[ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8578 		.type = HDA_FIXUP_PINS,
8579 		.v.pins = (const struct hda_pintbl[]) {
8580 			{ 0x19, 0x03a11050 },
8581 			{ 0x1b, 0x03a11c30 },
8582 			{ }
8583 		},
8584 		.chained = true,
8585 		.chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8586 	},
8587 	[ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8588 		.type = HDA_FIXUP_PINS,
8589 		.v.pins = (const struct hda_pintbl[]) {
8590 			{ 0x1b, 0x90170151 },
8591 			{ }
8592 		},
8593 		.chained = true,
8594 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8595 	},
8596 	[ALC269_FIXUP_ATIV_BOOK_8] = {
8597 		.type = HDA_FIXUP_FUNC,
8598 		.v.func = alc_fixup_auto_mute_via_amp,
8599 		.chained = true,
8600 		.chain_id = ALC269_FIXUP_NO_SHUTUP
8601 	},
8602 	[ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8603 		.type = HDA_FIXUP_PINS,
8604 		.v.pins = (const struct hda_pintbl[]) {
8605 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8606 			{ 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8607 			{ }
8608 		},
8609 		.chained = true,
8610 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8611 	},
8612 	[ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8613 		.type = HDA_FIXUP_PINS,
8614 		.v.pins = (const struct hda_pintbl[]) {
8615 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8616 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8617 			{ }
8618 		},
8619 		.chained = true,
8620 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8621 	},
8622 	[ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8623 		.type = HDA_FIXUP_FUNC,
8624 		.v.func = alc_fixup_headset_mode,
8625 	},
8626 	[ALC256_FIXUP_ASUS_MIC] = {
8627 		.type = HDA_FIXUP_PINS,
8628 		.v.pins = (const struct hda_pintbl[]) {
8629 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8630 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8631 			{ }
8632 		},
8633 		.chained = true,
8634 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8635 	},
8636 	[ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8637 		.type = HDA_FIXUP_FUNC,
8638 		/* Set up GPIO2 for the speaker amp */
8639 		.v.func = alc_fixup_gpio4,
8640 	},
8641 	[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8642 		.type = HDA_FIXUP_PINS,
8643 		.v.pins = (const struct hda_pintbl[]) {
8644 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8645 			{ }
8646 		},
8647 		.chained = true,
8648 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8649 	},
8650 	[ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8651 		.type = HDA_FIXUP_VERBS,
8652 		.v.verbs = (const struct hda_verb[]) {
8653 			/* Enables internal speaker */
8654 			{0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8655 			{0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8656 			{}
8657 		},
8658 		.chained = true,
8659 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8660 	},
8661 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8662 		.type = HDA_FIXUP_FUNC,
8663 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8664 		.chained = true,
8665 		.chain_id = ALC269_FIXUP_GPIO2
8666 	},
8667 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
8668 		.type = HDA_FIXUP_VERBS,
8669 		.v.verbs = (const struct hda_verb[]) {
8670 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8671 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8672 			{ }
8673 		},
8674 		.chained = true,
8675 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8676 	},
8677 	[ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8678 		.type = HDA_FIXUP_PINS,
8679 		.v.pins = (const struct hda_pintbl[]) {
8680 			/* Change the mic location from front to right, otherwise there are
8681 			   two front mics with the same name, pulseaudio can't handle them.
8682 			   This is just a temporary workaround, after applying this fixup,
8683 			   there will be one "Front Mic" and one "Mic" in this machine.
8684 			 */
8685 			{ 0x1a, 0x04a19040 },
8686 			{ }
8687 		},
8688 	},
8689 	[ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8690 		.type = HDA_FIXUP_PINS,
8691 		.v.pins = (const struct hda_pintbl[]) {
8692 			{ 0x16, 0x0101102f }, /* Rear Headset HP */
8693 			{ 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8694 			{ 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8695 			{ 0x1b, 0x02011020 },
8696 			{ }
8697 		},
8698 		.chained = true,
8699 		.chain_id = ALC225_FIXUP_S3_POP_NOISE
8700 	},
8701 	[ALC225_FIXUP_S3_POP_NOISE] = {
8702 		.type = HDA_FIXUP_FUNC,
8703 		.v.func = alc225_fixup_s3_pop_noise,
8704 		.chained = true,
8705 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8706 	},
8707 	[ALC700_FIXUP_INTEL_REFERENCE] = {
8708 		.type = HDA_FIXUP_VERBS,
8709 		.v.verbs = (const struct hda_verb[]) {
8710 			/* Enables internal speaker */
8711 			{0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8712 			{0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8713 			{0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8714 			{0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8715 			{0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8716 			{0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8717 			{0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8718 			{0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8719 			{}
8720 		}
8721 	},
8722 	[ALC274_FIXUP_DELL_BIND_DACS] = {
8723 		.type = HDA_FIXUP_FUNC,
8724 		.v.func = alc274_fixup_bind_dacs,
8725 		.chained = true,
8726 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8727 	},
8728 	[ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8729 		.type = HDA_FIXUP_PINS,
8730 		.v.pins = (const struct hda_pintbl[]) {
8731 			{ 0x1b, 0x0401102f },
8732 			{ }
8733 		},
8734 		.chained = true,
8735 		.chain_id = ALC274_FIXUP_DELL_BIND_DACS
8736 	},
8737 	[ALC298_FIXUP_TPT470_DOCK_FIX] = {
8738 		.type = HDA_FIXUP_FUNC,
8739 		.v.func = alc_fixup_tpt470_dock,
8740 		.chained = true,
8741 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8742 	},
8743 	[ALC298_FIXUP_TPT470_DOCK] = {
8744 		.type = HDA_FIXUP_FUNC,
8745 		.v.func = alc_fixup_tpt470_dacs,
8746 		.chained = true,
8747 		.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8748 	},
8749 	[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8750 		.type = HDA_FIXUP_PINS,
8751 		.v.pins = (const struct hda_pintbl[]) {
8752 			{ 0x14, 0x0201101f },
8753 			{ }
8754 		},
8755 		.chained = true,
8756 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8757 	},
8758 	[ALC255_FIXUP_DELL_HEADSET_MIC] = {
8759 		.type = HDA_FIXUP_PINS,
8760 		.v.pins = (const struct hda_pintbl[]) {
8761 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8762 			{ }
8763 		},
8764 		.chained = true,
8765 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8766 	},
8767 	[ALC295_FIXUP_HP_X360] = {
8768 		.type = HDA_FIXUP_FUNC,
8769 		.v.func = alc295_fixup_hp_top_speakers,
8770 		.chained = true,
8771 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8772 	},
8773 	[ALC221_FIXUP_HP_HEADSET_MIC] = {
8774 		.type = HDA_FIXUP_PINS,
8775 		.v.pins = (const struct hda_pintbl[]) {
8776 			{ 0x19, 0x0181313f},
8777 			{ }
8778 		},
8779 		.chained = true,
8780 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8781 	},
8782 	[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8783 		.type = HDA_FIXUP_FUNC,
8784 		.v.func = alc285_fixup_invalidate_dacs,
8785 		.chained = true,
8786 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8787 	},
8788 	[ALC295_FIXUP_HP_AUTO_MUTE] = {
8789 		.type = HDA_FIXUP_FUNC,
8790 		.v.func = alc_fixup_auto_mute_via_amp,
8791 	},
8792 	[ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8793 		.type = HDA_FIXUP_PINS,
8794 		.v.pins = (const struct hda_pintbl[]) {
8795 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8796 			{ }
8797 		},
8798 		.chained = true,
8799 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8800 	},
8801 	[ALC294_FIXUP_ASUS_MIC] = {
8802 		.type = HDA_FIXUP_PINS,
8803 		.v.pins = (const struct hda_pintbl[]) {
8804 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8805 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8806 			{ }
8807 		},
8808 		.chained = true,
8809 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8810 	},
8811 	[ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8812 		.type = HDA_FIXUP_PINS,
8813 		.v.pins = (const struct hda_pintbl[]) {
8814 			{ 0x19, 0x01a1103c }, /* use as headset mic */
8815 			{ }
8816 		},
8817 		.chained = true,
8818 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8819 	},
8820 	[ALC294_FIXUP_ASUS_SPK] = {
8821 		.type = HDA_FIXUP_VERBS,
8822 		.v.verbs = (const struct hda_verb[]) {
8823 			/* Set EAPD high */
8824 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8825 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8826 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8827 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8828 			{ }
8829 		},
8830 		.chained = true,
8831 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8832 	},
8833 	[ALC295_FIXUP_CHROME_BOOK] = {
8834 		.type = HDA_FIXUP_FUNC,
8835 		.v.func = alc295_fixup_chromebook,
8836 		.chained = true,
8837 		.chain_id = ALC225_FIXUP_HEADSET_JACK
8838 	},
8839 	[ALC225_FIXUP_HEADSET_JACK] = {
8840 		.type = HDA_FIXUP_FUNC,
8841 		.v.func = alc_fixup_headset_jack,
8842 	},
8843 	[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8844 		.type = HDA_FIXUP_PINS,
8845 		.v.pins = (const struct hda_pintbl[]) {
8846 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8847 			{ }
8848 		},
8849 		.chained = true,
8850 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8851 	},
8852 	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8853 		.type = HDA_FIXUP_VERBS,
8854 		.v.verbs = (const struct hda_verb[]) {
8855 			/* Disable PCBEEP-IN passthrough */
8856 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8857 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8858 			{ }
8859 		},
8860 		.chained = true,
8861 		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8862 	},
8863 	[ALC255_FIXUP_ACER_HEADSET_MIC] = {
8864 		.type = HDA_FIXUP_PINS,
8865 		.v.pins = (const struct hda_pintbl[]) {
8866 			{ 0x19, 0x03a11130 },
8867 			{ 0x1a, 0x90a60140 }, /* use as internal mic */
8868 			{ }
8869 		},
8870 		.chained = true,
8871 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8872 	},
8873 	[ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8874 		.type = HDA_FIXUP_PINS,
8875 		.v.pins = (const struct hda_pintbl[]) {
8876 			{ 0x16, 0x01011020 }, /* Rear Line out */
8877 			{ 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8878 			{ }
8879 		},
8880 		.chained = true,
8881 		.chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8882 	},
8883 	[ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8884 		.type = HDA_FIXUP_FUNC,
8885 		.v.func = alc_fixup_auto_mute_via_amp,
8886 		.chained = true,
8887 		.chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8888 	},
8889 	[ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8890 		.type = HDA_FIXUP_FUNC,
8891 		.v.func = alc_fixup_disable_mic_vref,
8892 		.chained = true,
8893 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8894 	},
8895 	[ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8896 		.type = HDA_FIXUP_VERBS,
8897 		.v.verbs = (const struct hda_verb[]) {
8898 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8899 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8900 			{ }
8901 		},
8902 		.chained = true,
8903 		.chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8904 	},
8905 	[ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8906 		.type = HDA_FIXUP_PINS,
8907 		.v.pins = (const struct hda_pintbl[]) {
8908 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8909 			{ }
8910 		},
8911 		.chained = true,
8912 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8913 	},
8914 	[ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8915 		.type = HDA_FIXUP_PINS,
8916 		.v.pins = (const struct hda_pintbl[]) {
8917 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8918 			{ }
8919 		},
8920 		.chained = true,
8921 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8922 	},
8923 	[ALC299_FIXUP_PREDATOR_SPK] = {
8924 		.type = HDA_FIXUP_PINS,
8925 		.v.pins = (const struct hda_pintbl[]) {
8926 			{ 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8927 			{ }
8928 		}
8929 	},
8930 	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8931 		.type = HDA_FIXUP_PINS,
8932 		.v.pins = (const struct hda_pintbl[]) {
8933 			{ 0x19, 0x04a11040 },
8934 			{ 0x21, 0x04211020 },
8935 			{ }
8936 		},
8937 		.chained = true,
8938 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8939 	},
8940 	[ALC289_FIXUP_DELL_SPK1] = {
8941 		.type = HDA_FIXUP_PINS,
8942 		.v.pins = (const struct hda_pintbl[]) {
8943 			{ 0x14, 0x90170140 },
8944 			{ }
8945 		},
8946 		.chained = true,
8947 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8948 	},
8949 	[ALC289_FIXUP_DELL_SPK2] = {
8950 		.type = HDA_FIXUP_PINS,
8951 		.v.pins = (const struct hda_pintbl[]) {
8952 			{ 0x17, 0x90170130 }, /* bass spk */
8953 			{ }
8954 		},
8955 		.chained = true,
8956 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8957 	},
8958 	[ALC289_FIXUP_DUAL_SPK] = {
8959 		.type = HDA_FIXUP_FUNC,
8960 		.v.func = alc285_fixup_speaker2_to_dac1,
8961 		.chained = true,
8962 		.chain_id = ALC289_FIXUP_DELL_SPK2
8963 	},
8964 	[ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
8965 		.type = HDA_FIXUP_FUNC,
8966 		.v.func = alc285_fixup_speaker2_to_dac1,
8967 		.chained = true,
8968 		.chain_id = ALC289_FIXUP_DELL_SPK1
8969 	},
8970 	[ALC294_FIXUP_SPK2_TO_DAC1] = {
8971 		.type = HDA_FIXUP_FUNC,
8972 		.v.func = alc285_fixup_speaker2_to_dac1,
8973 		.chained = true,
8974 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8975 	},
8976 	[ALC294_FIXUP_ASUS_DUAL_SPK] = {
8977 		.type = HDA_FIXUP_FUNC,
8978 		/* The GPIO must be pulled to initialize the AMP */
8979 		.v.func = alc_fixup_gpio4,
8980 		.chained = true,
8981 		.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8982 	},
8983 	[ALC294_FIXUP_ASUS_ALLY] = {
8984 		.type = HDA_FIXUP_FUNC,
8985 		.v.func = cs35l41_fixup_i2c_two,
8986 		.chained = true,
8987 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8988 	},
8989 	[ALC294_FIXUP_ASUS_ALLY_PINS] = {
8990 		.type = HDA_FIXUP_PINS,
8991 		.v.pins = (const struct hda_pintbl[]) {
8992 			{ 0x19, 0x03a11050 },
8993 			{ 0x1a, 0x03a11c30 },
8994 			{ 0x21, 0x03211420 },
8995 			{ }
8996 		},
8997 		.chained = true,
8998 		.chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8999 	},
9000 	[ALC294_FIXUP_ASUS_ALLY_VERBS] = {
9001 		.type = HDA_FIXUP_VERBS,
9002 		.v.verbs = (const struct hda_verb[]) {
9003 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9004 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9005 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
9006 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
9007 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
9008 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
9009 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
9010 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
9011 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
9012 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
9013 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
9014 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
9015 			{ }
9016 		},
9017 		.chained = true,
9018 		.chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
9019 	},
9020 	[ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
9021 		.type = HDA_FIXUP_FUNC,
9022 		.v.func = alc285_fixup_speaker2_to_dac1,
9023 	},
9024 	[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
9025 		.type = HDA_FIXUP_FUNC,
9026 		.v.func = alc285_fixup_thinkpad_x1_gen7,
9027 		.chained = true,
9028 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9029 	},
9030 	[ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
9031 		.type = HDA_FIXUP_FUNC,
9032 		.v.func = alc_fixup_headset_jack,
9033 		.chained = true,
9034 		.chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
9035 	},
9036 	[ALC294_FIXUP_ASUS_HPE] = {
9037 		.type = HDA_FIXUP_VERBS,
9038 		.v.verbs = (const struct hda_verb[]) {
9039 			/* Set EAPD high */
9040 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9041 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
9042 			{ }
9043 		},
9044 		.chained = true,
9045 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9046 	},
9047 	[ALC294_FIXUP_ASUS_GX502_PINS] = {
9048 		.type = HDA_FIXUP_PINS,
9049 		.v.pins = (const struct hda_pintbl[]) {
9050 			{ 0x19, 0x03a11050 }, /* front HP mic */
9051 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9052 			{ 0x21, 0x03211020 }, /* front HP out */
9053 			{ }
9054 		},
9055 		.chained = true,
9056 		.chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
9057 	},
9058 	[ALC294_FIXUP_ASUS_GX502_VERBS] = {
9059 		.type = HDA_FIXUP_VERBS,
9060 		.v.verbs = (const struct hda_verb[]) {
9061 			/* set 0x15 to HP-OUT ctrl */
9062 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9063 			/* unmute the 0x15 amp */
9064 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9065 			{ }
9066 		},
9067 		.chained = true,
9068 		.chain_id = ALC294_FIXUP_ASUS_GX502_HP
9069 	},
9070 	[ALC294_FIXUP_ASUS_GX502_HP] = {
9071 		.type = HDA_FIXUP_FUNC,
9072 		.v.func = alc294_fixup_gx502_hp,
9073 	},
9074 	[ALC294_FIXUP_ASUS_GU502_PINS] = {
9075 		.type = HDA_FIXUP_PINS,
9076 		.v.pins = (const struct hda_pintbl[]) {
9077 			{ 0x19, 0x01a11050 }, /* rear HP mic */
9078 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9079 			{ 0x21, 0x012110f0 }, /* rear HP out */
9080 			{ }
9081 		},
9082 		.chained = true,
9083 		.chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
9084 	},
9085 	[ALC294_FIXUP_ASUS_GU502_VERBS] = {
9086 		.type = HDA_FIXUP_VERBS,
9087 		.v.verbs = (const struct hda_verb[]) {
9088 			/* set 0x15 to HP-OUT ctrl */
9089 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9090 			/* unmute the 0x15 amp */
9091 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9092 			/* set 0x1b to HP-OUT */
9093 			{ 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
9094 			{ }
9095 		},
9096 		.chained = true,
9097 		.chain_id = ALC294_FIXUP_ASUS_GU502_HP
9098 	},
9099 	[ALC294_FIXUP_ASUS_GU502_HP] = {
9100 		.type = HDA_FIXUP_FUNC,
9101 		.v.func = alc294_fixup_gu502_hp,
9102 	},
9103 	 [ALC294_FIXUP_ASUS_G513_PINS] = {
9104 		.type = HDA_FIXUP_PINS,
9105 		.v.pins = (const struct hda_pintbl[]) {
9106 				{ 0x19, 0x03a11050 }, /* front HP mic */
9107 				{ 0x1a, 0x03a11c30 }, /* rear external mic */
9108 				{ 0x21, 0x03211420 }, /* front HP out */
9109 				{ }
9110 		},
9111 	},
9112 	[ALC285_FIXUP_ASUS_G533Z_PINS] = {
9113 		.type = HDA_FIXUP_PINS,
9114 		.v.pins = (const struct hda_pintbl[]) {
9115 			{ 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
9116 			{ 0x19, 0x03a19020 }, /* Mic Boost Volume */
9117 			{ 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
9118 			{ 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
9119 			{ 0x21, 0x03211420 },
9120 			{ }
9121 		},
9122 	},
9123 	[ALC294_FIXUP_ASUS_COEF_1B] = {
9124 		.type = HDA_FIXUP_VERBS,
9125 		.v.verbs = (const struct hda_verb[]) {
9126 			/* Set bit 10 to correct noisy output after reboot from
9127 			 * Windows 10 (due to pop noise reduction?)
9128 			 */
9129 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
9130 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
9131 			{ }
9132 		},
9133 		.chained = true,
9134 		.chain_id = ALC289_FIXUP_ASUS_GA401,
9135 	},
9136 	[ALC285_FIXUP_HP_GPIO_LED] = {
9137 		.type = HDA_FIXUP_FUNC,
9138 		.v.func = alc285_fixup_hp_gpio_led,
9139 	},
9140 	[ALC285_FIXUP_HP_MUTE_LED] = {
9141 		.type = HDA_FIXUP_FUNC,
9142 		.v.func = alc285_fixup_hp_mute_led,
9143 	},
9144 	[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
9145 		.type = HDA_FIXUP_FUNC,
9146 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
9147 	},
9148 	[ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
9149 	    .type = HDA_FIXUP_FUNC,
9150 	    .v.func = alc236_fixup_hp_mute_led_coefbit2,
9151 	},
9152 	[ALC236_FIXUP_HP_GPIO_LED] = {
9153 		.type = HDA_FIXUP_FUNC,
9154 		.v.func = alc236_fixup_hp_gpio_led,
9155 	},
9156 	[ALC236_FIXUP_HP_MUTE_LED] = {
9157 		.type = HDA_FIXUP_FUNC,
9158 		.v.func = alc236_fixup_hp_mute_led,
9159 	},
9160 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9161 		.type = HDA_FIXUP_FUNC,
9162 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
9163 	},
9164 	[ALC298_FIXUP_SAMSUNG_AMP] = {
9165 		.type = HDA_FIXUP_FUNC,
9166 		.v.func = alc298_fixup_samsung_amp,
9167 		.chained = true,
9168 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9169 	},
9170 	[ALC298_FIXUP_SAMSUNG_AMP2] = {
9171 		.type = HDA_FIXUP_FUNC,
9172 		.v.func = alc298_fixup_samsung_amp2
9173 	},
9174 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9175 		.type = HDA_FIXUP_VERBS,
9176 		.v.verbs = (const struct hda_verb[]) {
9177 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9178 			{ }
9179 		},
9180 	},
9181 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9182 		.type = HDA_FIXUP_VERBS,
9183 		.v.verbs = (const struct hda_verb[]) {
9184 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9185 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9186 			{ }
9187 		},
9188 	},
9189 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9190 		.type = HDA_FIXUP_PINS,
9191 		.v.pins = (const struct hda_pintbl[]) {
9192 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9193 			{ }
9194 		},
9195 		.chained = true,
9196 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9197 	},
9198 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9199 		.type = HDA_FIXUP_PINS,
9200 		.v.pins = (const struct hda_pintbl[]) {
9201 			{ 0x14, 0x90100120 }, /* use as internal speaker */
9202 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9203 			{ 0x1a, 0x01011020 }, /* use as line out */
9204 			{ },
9205 		},
9206 		.chained = true,
9207 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9208 	},
9209 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9210 		.type = HDA_FIXUP_PINS,
9211 		.v.pins = (const struct hda_pintbl[]) {
9212 			{ 0x18, 0x02a11030 }, /* use as headset mic */
9213 			{ }
9214 		},
9215 		.chained = true,
9216 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9217 	},
9218 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9219 		.type = HDA_FIXUP_PINS,
9220 		.v.pins = (const struct hda_pintbl[]) {
9221 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9222 			{ }
9223 		},
9224 		.chained = true,
9225 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9226 	},
9227 	[ALC289_FIXUP_ASUS_GA401] = {
9228 		.type = HDA_FIXUP_FUNC,
9229 		.v.func = alc289_fixup_asus_ga401,
9230 		.chained = true,
9231 		.chain_id = ALC289_FIXUP_ASUS_GA502,
9232 	},
9233 	[ALC289_FIXUP_ASUS_GA502] = {
9234 		.type = HDA_FIXUP_PINS,
9235 		.v.pins = (const struct hda_pintbl[]) {
9236 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
9237 			{ }
9238 		},
9239 	},
9240 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9241 		.type = HDA_FIXUP_PINS,
9242 		.v.pins = (const struct hda_pintbl[]) {
9243 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9244 			{ }
9245 		},
9246 		.chained = true,
9247 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9248 	},
9249 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9250 		.type = HDA_FIXUP_FUNC,
9251 		.v.func = alc285_fixup_hp_gpio_amp_init,
9252 		.chained = true,
9253 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
9254 	},
9255 	[ALC269_FIXUP_CZC_B20] = {
9256 		.type = HDA_FIXUP_PINS,
9257 		.v.pins = (const struct hda_pintbl[]) {
9258 			{ 0x12, 0x411111f0 },
9259 			{ 0x14, 0x90170110 }, /* speaker */
9260 			{ 0x15, 0x032f1020 }, /* HP out */
9261 			{ 0x17, 0x411111f0 },
9262 			{ 0x18, 0x03ab1040 }, /* mic */
9263 			{ 0x19, 0xb7a7013f },
9264 			{ 0x1a, 0x0181305f },
9265 			{ 0x1b, 0x411111f0 },
9266 			{ 0x1d, 0x411111f0 },
9267 			{ 0x1e, 0x411111f0 },
9268 			{ }
9269 		},
9270 		.chain_id = ALC269_FIXUP_DMIC,
9271 	},
9272 	[ALC269_FIXUP_CZC_TMI] = {
9273 		.type = HDA_FIXUP_PINS,
9274 		.v.pins = (const struct hda_pintbl[]) {
9275 			{ 0x12, 0x4000c000 },
9276 			{ 0x14, 0x90170110 }, /* speaker */
9277 			{ 0x15, 0x0421401f }, /* HP out */
9278 			{ 0x17, 0x411111f0 },
9279 			{ 0x18, 0x04a19020 }, /* mic */
9280 			{ 0x19, 0x411111f0 },
9281 			{ 0x1a, 0x411111f0 },
9282 			{ 0x1b, 0x411111f0 },
9283 			{ 0x1d, 0x40448505 },
9284 			{ 0x1e, 0x411111f0 },
9285 			{ 0x20, 0x8000ffff },
9286 			{ }
9287 		},
9288 		.chain_id = ALC269_FIXUP_DMIC,
9289 	},
9290 	[ALC269_FIXUP_CZC_L101] = {
9291 		.type = HDA_FIXUP_PINS,
9292 		.v.pins = (const struct hda_pintbl[]) {
9293 			{ 0x12, 0x40000000 },
9294 			{ 0x14, 0x01014010 }, /* speaker */
9295 			{ 0x15, 0x411111f0 }, /* HP out */
9296 			{ 0x16, 0x411111f0 },
9297 			{ 0x18, 0x01a19020 }, /* mic */
9298 			{ 0x19, 0x02a19021 },
9299 			{ 0x1a, 0x0181302f },
9300 			{ 0x1b, 0x0221401f },
9301 			{ 0x1c, 0x411111f0 },
9302 			{ 0x1d, 0x4044c601 },
9303 			{ 0x1e, 0x411111f0 },
9304 			{ }
9305 		},
9306 		.chain_id = ALC269_FIXUP_DMIC,
9307 	},
9308 	[ALC269_FIXUP_LEMOTE_A1802] = {
9309 		.type = HDA_FIXUP_PINS,
9310 		.v.pins = (const struct hda_pintbl[]) {
9311 			{ 0x12, 0x40000000 },
9312 			{ 0x14, 0x90170110 }, /* speaker */
9313 			{ 0x17, 0x411111f0 },
9314 			{ 0x18, 0x03a19040 }, /* mic1 */
9315 			{ 0x19, 0x90a70130 }, /* mic2 */
9316 			{ 0x1a, 0x411111f0 },
9317 			{ 0x1b, 0x411111f0 },
9318 			{ 0x1d, 0x40489d2d },
9319 			{ 0x1e, 0x411111f0 },
9320 			{ 0x20, 0x0003ffff },
9321 			{ 0x21, 0x03214020 },
9322 			{ }
9323 		},
9324 		.chain_id = ALC269_FIXUP_DMIC,
9325 	},
9326 	[ALC269_FIXUP_LEMOTE_A190X] = {
9327 		.type = HDA_FIXUP_PINS,
9328 		.v.pins = (const struct hda_pintbl[]) {
9329 			{ 0x14, 0x99130110 }, /* speaker */
9330 			{ 0x15, 0x0121401f }, /* HP out */
9331 			{ 0x18, 0x01a19c20 }, /* rear  mic */
9332 			{ 0x19, 0x99a3092f }, /* front mic */
9333 			{ 0x1b, 0x0201401f }, /* front lineout */
9334 			{ }
9335 		},
9336 		.chain_id = ALC269_FIXUP_DMIC,
9337 	},
9338 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9339 		.type = HDA_FIXUP_PINS,
9340 		.v.pins = (const struct hda_pintbl[]) {
9341 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9342 			{ }
9343 		},
9344 		.chained = true,
9345 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9346 	},
9347 	[ALC256_FIXUP_INTEL_NUC10] = {
9348 		.type = HDA_FIXUP_PINS,
9349 		.v.pins = (const struct hda_pintbl[]) {
9350 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9351 			{ }
9352 		},
9353 		.chained = true,
9354 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9355 	},
9356 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9357 		.type = HDA_FIXUP_VERBS,
9358 		.v.verbs = (const struct hda_verb[]) {
9359 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9360 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9361 			{ }
9362 		},
9363 		.chained = true,
9364 		.chain_id = ALC289_FIXUP_ASUS_GA502
9365 	},
9366 	[ALC274_FIXUP_HP_MIC] = {
9367 		.type = HDA_FIXUP_VERBS,
9368 		.v.verbs = (const struct hda_verb[]) {
9369 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9370 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9371 			{ }
9372 		},
9373 	},
9374 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
9375 		.type = HDA_FIXUP_FUNC,
9376 		.v.func = alc274_fixup_hp_headset_mic,
9377 		.chained = true,
9378 		.chain_id = ALC274_FIXUP_HP_MIC
9379 	},
9380 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
9381 		.type = HDA_FIXUP_FUNC,
9382 		.v.func = alc274_fixup_hp_envy_gpio,
9383 	},
9384 	[ALC256_FIXUP_ASUS_HPE] = {
9385 		.type = HDA_FIXUP_VERBS,
9386 		.v.verbs = (const struct hda_verb[]) {
9387 			/* Set EAPD high */
9388 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9389 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9390 			{ }
9391 		},
9392 		.chained = true,
9393 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9394 	},
9395 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9396 		.type = HDA_FIXUP_FUNC,
9397 		.v.func = alc_fixup_headset_jack,
9398 		.chained = true,
9399 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9400 	},
9401 	[ALC287_FIXUP_HP_GPIO_LED] = {
9402 		.type = HDA_FIXUP_FUNC,
9403 		.v.func = alc287_fixup_hp_gpio_led,
9404 	},
9405 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
9406 		.type = HDA_FIXUP_FUNC,
9407 		.v.func = alc274_fixup_hp_headset_mic,
9408 	},
9409 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9410 		.type = HDA_FIXUP_FUNC,
9411 		.v.func = alc_fixup_no_int_mic,
9412 		.chained = true,
9413 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9414 	},
9415 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9416 		.type = HDA_FIXUP_PINS,
9417 		.v.pins = (const struct hda_pintbl[]) {
9418 			{ 0x1b, 0x411111f0 },
9419 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9420 			{ },
9421 		},
9422 		.chained = true,
9423 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9424 	},
9425 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9426 		.type = HDA_FIXUP_FUNC,
9427 		.v.func = alc269_fixup_limit_int_mic_boost,
9428 		.chained = true,
9429 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9430 	},
9431 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
9432 		.type = HDA_FIXUP_PINS,
9433 		.v.pins = (const struct hda_pintbl[]) {
9434 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9435 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
9436 			{ }
9437 		},
9438 		.chained = true,
9439 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9440 	},
9441 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9442 		.type = HDA_FIXUP_FUNC,
9443 		.v.func = alc285_fixup_ideapad_s740_coef,
9444 		.chained = true,
9445 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9446 	},
9447 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9448 		.type = HDA_FIXUP_FUNC,
9449 		.v.func = alc269_fixup_limit_int_mic_boost,
9450 		.chained = true,
9451 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9452 	},
9453 	[ALC295_FIXUP_ASUS_DACS] = {
9454 		.type = HDA_FIXUP_FUNC,
9455 		.v.func = alc295_fixup_asus_dacs,
9456 	},
9457 	[ALC295_FIXUP_HP_OMEN] = {
9458 		.type = HDA_FIXUP_PINS,
9459 		.v.pins = (const struct hda_pintbl[]) {
9460 			{ 0x12, 0xb7a60130 },
9461 			{ 0x13, 0x40000000 },
9462 			{ 0x14, 0x411111f0 },
9463 			{ 0x16, 0x411111f0 },
9464 			{ 0x17, 0x90170110 },
9465 			{ 0x18, 0x411111f0 },
9466 			{ 0x19, 0x02a11030 },
9467 			{ 0x1a, 0x411111f0 },
9468 			{ 0x1b, 0x04a19030 },
9469 			{ 0x1d, 0x40600001 },
9470 			{ 0x1e, 0x411111f0 },
9471 			{ 0x21, 0x03211020 },
9472 			{}
9473 		},
9474 		.chained = true,
9475 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9476 	},
9477 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
9478 		.type = HDA_FIXUP_FUNC,
9479 		.v.func = alc285_fixup_hp_spectre_x360,
9480 	},
9481 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9482 		.type = HDA_FIXUP_FUNC,
9483 		.v.func = alc285_fixup_hp_spectre_x360_eb1
9484 	},
9485 	[ALC285_FIXUP_HP_ENVY_X360] = {
9486 		.type = HDA_FIXUP_FUNC,
9487 		.v.func = alc285_fixup_hp_envy_x360,
9488 		.chained = true,
9489 		.chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9490 	},
9491 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9492 		.type = HDA_FIXUP_FUNC,
9493 		.v.func = alc285_fixup_ideapad_s740_coef,
9494 		.chained = true,
9495 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9496 	},
9497 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9498 		.type = HDA_FIXUP_FUNC,
9499 		.v.func = alc_fixup_no_shutup,
9500 		.chained = true,
9501 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
9502 	},
9503 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9504 		.type = HDA_FIXUP_PINS,
9505 		.v.pins = (const struct hda_pintbl[]) {
9506 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9507 			{ }
9508 		},
9509 		.chained = true,
9510 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9511 	},
9512 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9513 		.type = HDA_FIXUP_FUNC,
9514 		.v.func = alc269_fixup_limit_int_mic_boost,
9515 		.chained = true,
9516 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9517 	},
9518 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9519 		.type = HDA_FIXUP_FUNC,
9520 		.v.func = alc285_fixup_ideapad_s740_coef,
9521 		.chained = true,
9522 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9523 	},
9524 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9525 		.type = HDA_FIXUP_FUNC,
9526 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9527 		.chained = true,
9528 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9529 	},
9530 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9531 		.type = HDA_FIXUP_VERBS,
9532 		//.v.verbs = legion_15imhg05_coefs,
9533 		.v.verbs = (const struct hda_verb[]) {
9534 			 // set left speaker Legion 7i.
9535 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9536 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9537 
9538 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9539 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9540 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9541 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9542 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9543 
9544 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9545 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9546 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9547 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9548 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9549 
9550 			 // set right speaker Legion 7i.
9551 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9552 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9553 
9554 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9555 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9556 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9557 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9558 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9559 
9560 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9561 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9562 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9563 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9564 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9565 			 {}
9566 		},
9567 		.chained = true,
9568 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9569 	},
9570 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9571 		.type = HDA_FIXUP_FUNC,
9572 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9573 		.chained = true,
9574 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9575 	},
9576 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9577 		.type = HDA_FIXUP_VERBS,
9578 		.v.verbs = (const struct hda_verb[]) {
9579 			 // set left speaker Yoga 7i.
9580 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9581 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9582 
9583 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9584 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9585 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9586 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9587 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9588 
9589 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9590 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9591 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9592 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9593 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9594 
9595 			 // set right speaker Yoga 7i.
9596 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9597 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9598 
9599 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9600 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9601 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9602 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9603 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9604 
9605 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9606 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9607 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9608 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9609 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9610 			 {}
9611 		},
9612 		.chained = true,
9613 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9614 	},
9615 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9616 		.type = HDA_FIXUP_FUNC,
9617 		.v.func = alc298_fixup_lenovo_c940_duet7,
9618 	},
9619 	[ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9620 		.type = HDA_FIXUP_FUNC,
9621 		.v.func = alc287_fixup_lenovo_14irp8_duetitl,
9622 	},
9623 	[ALC287_FIXUP_LENOVO_LEGION_7] = {
9624 		.type = HDA_FIXUP_FUNC,
9625 		.v.func = alc287_fixup_lenovo_legion_7,
9626 	},
9627 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9628 		.type = HDA_FIXUP_VERBS,
9629 		.v.verbs = (const struct hda_verb[]) {
9630 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9631 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9632 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9633 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9634 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9635 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9636 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9637 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9638 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9639 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9640 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9641 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9642 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9643 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9644 			{}
9645 		},
9646 		.chained = true,
9647 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9648 	},
9649 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9650 		.type = HDA_FIXUP_FUNC,
9651 		.v.func = alc256_fixup_set_coef_defaults,
9652 	},
9653 	[ALC245_FIXUP_HP_GPIO_LED] = {
9654 		.type = HDA_FIXUP_FUNC,
9655 		.v.func = alc245_fixup_hp_gpio_led,
9656 	},
9657 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9658 		.type = HDA_FIXUP_PINS,
9659 		.v.pins = (const struct hda_pintbl[]) {
9660 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9661 			{ }
9662 		},
9663 		.chained = true,
9664 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9665 	},
9666 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9667 		.type = HDA_FIXUP_FUNC,
9668 		.v.func = alc233_fixup_no_audio_jack,
9669 	},
9670 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9671 		.type = HDA_FIXUP_FUNC,
9672 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9673 		.chained = true,
9674 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9675 	},
9676 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9677 		.type = HDA_FIXUP_FUNC,
9678 		.v.func = alc287_fixup_legion_16achg6_speakers,
9679 	},
9680 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9681 		.type = HDA_FIXUP_FUNC,
9682 		.v.func = cs35l41_fixup_i2c_two,
9683 	},
9684 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9685 		.type = HDA_FIXUP_FUNC,
9686 		.v.func = cs35l41_fixup_i2c_two,
9687 		.chained = true,
9688 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9689 	},
9690 	[ALC287_FIXUP_CS35L41_I2C_4] = {
9691 		.type = HDA_FIXUP_FUNC,
9692 		.v.func = cs35l41_fixup_i2c_four,
9693 	},
9694 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9695 		.type = HDA_FIXUP_FUNC,
9696 		.v.func = cs35l41_fixup_spi_two,
9697 	},
9698 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9699 		.type = HDA_FIXUP_FUNC,
9700 		.v.func = cs35l41_fixup_spi_two,
9701 		.chained = true,
9702 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9703 	},
9704 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9705 		.type = HDA_FIXUP_FUNC,
9706 		.v.func = cs35l41_fixup_spi_four,
9707 	},
9708 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9709 		.type = HDA_FIXUP_FUNC,
9710 		.v.func = cs35l41_fixup_spi_four,
9711 		.chained = true,
9712 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9713 	},
9714 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9715 		.type = HDA_FIXUP_VERBS,
9716 		.v.verbs = (const struct hda_verb[]) {
9717 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9718 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9719 			 { }
9720 		},
9721 		.chained = true,
9722 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9723 	},
9724 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9725 		.type = HDA_FIXUP_FUNC,
9726 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9727 		.chained = true,
9728 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9729 	},
9730 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9731 		.type = HDA_FIXUP_PINS,
9732 		.v.pins = (const struct hda_pintbl[]) {
9733 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9734 			{ }
9735 		},
9736 		.chained = true,
9737 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9738 	},
9739 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9740 		.type = HDA_FIXUP_FUNC,
9741 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9742 	},
9743 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9744 		.type = HDA_FIXUP_VERBS,
9745 		.v.verbs = (const struct hda_verb[]) {
9746 			// enable left speaker
9747 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9748 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9749 
9750 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9751 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9752 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9753 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9754 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9755 
9756 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9757 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9758 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9759 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9760 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9761 
9762 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9763 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9764 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9765 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9766 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9767 
9768 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9769 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9770 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9771 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9772 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9773 
9774 			// enable right speaker
9775 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9776 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9777 
9778 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9779 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9780 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9781 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9782 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9783 
9784 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9785 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9786 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9787 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9788 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9789 
9790 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9791 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9792 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9793 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9794 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9795 
9796 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9797 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9798 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9799 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9800 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9801 
9802 			{ },
9803 		},
9804 	},
9805 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9806 		.type = HDA_FIXUP_FUNC,
9807 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9808 		.chained = true,
9809 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9810 	},
9811 	[ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7] = {
9812 		.type = HDA_FIXUP_FUNC,
9813 		.v.func = alc287_fixup_lenovo_14arp8_legion_iah7,
9814 	},
9815 	[ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9816 		.type = HDA_FIXUP_FUNC,
9817 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9818 		.chained = true,
9819 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9820 	},
9821 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9822 		.type = HDA_FIXUP_FUNC,
9823 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9824 		.chained = true,
9825 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9826 	},
9827 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9828 		.type = HDA_FIXUP_PINS,
9829 		.v.func = alc1220_fixup_gb_dual_codecs,
9830 		.chained = true,
9831 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9832 	},
9833 	[ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9834 		.type = HDA_FIXUP_FUNC,
9835 		.v.func = cs35l41_fixup_i2c_two,
9836 		.chained = true,
9837 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9838 	},
9839 	[ALC287_FIXUP_TAS2781_I2C] = {
9840 		.type = HDA_FIXUP_FUNC,
9841 		.v.func = tas2781_fixup_i2c,
9842 		.chained = true,
9843 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9844 	},
9845 	[ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
9846 		.type = HDA_FIXUP_FUNC,
9847 		.v.func = yoga7_14arb7_fixup_i2c,
9848 		.chained = true,
9849 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9850 	},
9851 	[ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9852 		.type = HDA_FIXUP_FUNC,
9853 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9854 	},
9855 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9856 		.type = HDA_FIXUP_FUNC,
9857 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9858 		.chained = true,
9859 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
9860 	},
9861 	[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9862 		.type = HDA_FIXUP_FUNC,
9863 		.v.func = alc287_fixup_bind_dacs,
9864 		.chained = true,
9865 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9866 	},
9867 	[ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9868 		.type = HDA_FIXUP_FUNC,
9869 		.v.func = alc287_fixup_bind_dacs,
9870 		.chained = true,
9871 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9872 	},
9873 	[ALC2XX_FIXUP_HEADSET_MIC] = {
9874 		.type = HDA_FIXUP_FUNC,
9875 		.v.func = alc_fixup_headset_mic,
9876 	},
9877 	[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9878 		.type = HDA_FIXUP_FUNC,
9879 		.v.func = cs35l41_fixup_spi_two,
9880 		.chained = true,
9881 		.chain_id = ALC289_FIXUP_DUAL_SPK
9882 	},
9883 	[ALC294_FIXUP_CS35L41_I2C_2] = {
9884 		.type = HDA_FIXUP_FUNC,
9885 		.v.func = cs35l41_fixup_i2c_two,
9886 	},
9887 	[ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED] = {
9888 		.type = HDA_FIXUP_FUNC,
9889 		.v.func = cs35l56_fixup_spi_four,
9890 		.chained = true,
9891 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9892 	},
9893 	[ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
9894 		.type = HDA_FIXUP_FUNC,
9895 		.v.func = alc256_fixup_acer_sfg16_micmute_led,
9896 	},
9897 	[ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
9898 		.type = HDA_FIXUP_FUNC,
9899 		.v.func = alc256_decrease_headphone_amp_val,
9900 	},
9901 	[ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
9902 		.type = HDA_FIXUP_FUNC,
9903 		.v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
9904 	},
9905 	[ALC285_FIXUP_CS35L56_SPI_2] = {
9906 		.type = HDA_FIXUP_FUNC,
9907 		.v.func = cs35l56_fixup_spi_two,
9908 	},
9909 	[ALC285_FIXUP_CS35L56_I2C_2] = {
9910 		.type = HDA_FIXUP_FUNC,
9911 		.v.func = cs35l56_fixup_i2c_two,
9912 	},
9913 	[ALC285_FIXUP_CS35L56_I2C_4] = {
9914 		.type = HDA_FIXUP_FUNC,
9915 		.v.func = cs35l56_fixup_i2c_four,
9916 	},
9917 	[ALC285_FIXUP_ASUS_GA403U] = {
9918 		.type = HDA_FIXUP_FUNC,
9919 		.v.func = alc285_fixup_asus_ga403u,
9920 	},
9921 	[ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
9922 		.type = HDA_FIXUP_PINS,
9923 		.v.pins = (const struct hda_pintbl[]) {
9924 			{ 0x19, 0x03a11050 },
9925 			{ 0x1b, 0x03a11c30 },
9926 			{ }
9927 		},
9928 		.chained = true,
9929 		.chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
9930 	},
9931 	[ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
9932 		.type = HDA_FIXUP_FUNC,
9933 		.v.func = alc285_fixup_speaker2_to_dac1,
9934 		.chained = true,
9935 		.chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
9936 	},
9937 	[ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
9938 		.type = HDA_FIXUP_PINS,
9939 		.v.pins = (const struct hda_pintbl[]) {
9940 			{ 0x19, 0x03a11050 },
9941 			{ 0x1b, 0x03a11c30 },
9942 			{ }
9943 		},
9944 		.chained = true,
9945 		.chain_id = ALC285_FIXUP_CS35L56_SPI_2
9946 	},
9947 	[ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
9948 		.type = HDA_FIXUP_FUNC,
9949 		.v.func = alc285_fixup_speaker2_to_dac1,
9950 		.chained = true,
9951 		.chain_id = ALC285_FIXUP_ASUS_GA403U,
9952 	},
9953 	[ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
9954 		.type = HDA_FIXUP_FUNC,
9955 		.v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
9956 		.chained = true,
9957 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9958 	},
9959 	[ALC256_FIXUP_CHROME_BOOK] = {
9960 		.type = HDA_FIXUP_FUNC,
9961 		.v.func = alc256_fixup_chromebook,
9962 		.chained = true,
9963 		.chain_id = ALC225_FIXUP_HEADSET_JACK
9964 	},
9965 	[ALC287_FIXUP_LENOVO_SSID_17AA3820] = {
9966 		.type = HDA_FIXUP_FUNC,
9967 		.v.func = alc287_fixup_lenovo_ssid_17aa3820,
9968 	},
9969 	[ALCXXX_FIXUP_CS35LXX] = {
9970 		.type = HDA_FIXUP_FUNC,
9971 		.v.func = cs35lxx_autodet_fixup,
9972 	},
9973 };
9974 
9975 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
9976 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
9977 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9978 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
9979 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
9980 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9981 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9982 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
9983 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9984 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9985 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
9986 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9987 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
9988 	SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9989 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
9990 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
9991 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
9992 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
9993 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9994 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9995 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9996 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9997 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
9998 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
9999 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10000 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
10001 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
10002 	SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10003 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10004 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10005 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10006 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
10007 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10008 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10009 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10010 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
10011 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
10012 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10013 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10014 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10015 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
10016 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10017 	SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
10018 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
10019 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
10020 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
10021 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
10022 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
10023 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
10024 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
10025 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
10026 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10027 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10028 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10029 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10030 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10031 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
10032 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
10033 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
10034 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10035 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10036 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
10037 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10038 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
10039 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10040 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10041 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10042 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10043 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10044 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10045 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10046 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10047 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10048 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
10049 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
10050 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
10051 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
10052 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10053 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
10054 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
10055 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10056 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10057 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10058 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10059 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
10060 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
10061 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
10062 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10063 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10064 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10065 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10066 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10067 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10068 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10069 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
10070 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
10071 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
10072 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
10073 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10074 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10075 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
10076 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
10077 	SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10078 	SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10079 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10080 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10081 	SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10082 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10083 	SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10084 	SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10085 	SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10086 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10087 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10088 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10089 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10090 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10091 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10092 	SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10093 	SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
10094 	SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10095 	SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10096 	SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10097 	SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10098 	SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10099 	SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10100 	SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10101 	SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10102 	SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10103 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10104 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10105 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
10106 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
10107 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
10108 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10109 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10110 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10111 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10112 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
10113 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10114 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10115 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10116 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10117 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10118 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10119 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10120 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10121 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10122 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10123 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10124 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10125 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10126 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
10127 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
10128 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10129 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10130 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10131 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10132 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10133 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10134 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10135 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10136 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
10137 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10138 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10139 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10140 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10141 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10142 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10143 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10144 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10145 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10146 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10147 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10148 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10149 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10150 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10151 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10152 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10153 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10154 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10155 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
10156 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10157 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10158 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10159 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10160 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10161 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10162 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
10163 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10164 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10165 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10166 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10167 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
10168 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
10169 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
10170 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10171 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10172 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10173 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10174 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10175 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10176 	SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10177 	SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10178 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
10179 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10180 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
10181 	SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10182 	SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
10183 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10184 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10185 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10186 	SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10187 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
10188 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10189 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10190 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
10191 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10192 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10193 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
10194 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
10195 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
10196 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10197 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10198 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10199 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
10200 	SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10201 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
10202 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10203 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10204 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10205 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10206 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10207 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10208 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10209 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10210 	SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10211 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
10212 	SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10213 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10214 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10215 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10216 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10217 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10218 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
10219 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10220 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10221 	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10222 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10223 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10224 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10225 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10226 	SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10227 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10228 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10229 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10230 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10231 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10232 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10233 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10234 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10235 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10236 	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10237 	SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10238 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
10239 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
10240 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
10241 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10242 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
10243 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
10244 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10245 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
10246 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10247 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10248 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10249 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10250 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10251 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10252 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10253 	SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
10254 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10255 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10256 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10257 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10258 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
10259 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10260 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
10261 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10262 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
10263 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
10264 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10265 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
10266 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10267 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10268 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10269 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10270 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10271 	SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10272 	SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
10273 	SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10274 	SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10275 	SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
10276 	SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10277 	SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10278 	SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10279 	SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10280 	SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10281 	SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10282 	SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10283 	SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10284 	SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
10285 	SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10286 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10287 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10288 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10289 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10290 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
10291 	SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
10292 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10293 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10294 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10295 	SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10296 	SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10297 	SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10298 	SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10299 	SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
10300 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10301 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10302 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10303 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10304 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10305 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10306 	SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10307 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10308 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10309 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10310 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10311 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10312 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10313 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10314 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10315 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
10316 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10317 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10318 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
10319 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10320 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10321 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10322 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10323 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10324 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10325 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10326 	SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10327 	SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10328 	SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10329 	SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10330 	SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10331 	SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10332 	SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10333 	SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10334 	SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10335 	SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10336 	SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10337 	SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10338 	SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10339 	SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10340 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
10341 	SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
10342 	SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10343 	SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10344 	SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10345 	SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10346 	SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10347 	SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10348 	SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10349 	SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10350 	SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10351 	SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10352 	SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10353 	SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10354 	SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED),
10355 	SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED),
10356 	SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10357 	SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10358 	SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10359 	SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10360 	SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10361 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10362 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10363 	SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10364 	SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10365 	SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10366 	SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10367 	SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10368 	SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10369 	SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10370 	SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10371 	SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10372 	SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10373 	SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
10374 	SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10375 	SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10376 	SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10377 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10378 	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10379 	SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10380 	SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10381 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10382 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10383 	SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10384 	SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10385 	SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10386 	SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10387 	SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10388 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10389 	SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALCXXX_FIXUP_CS35LXX),
10390 	SND_PCI_QUIRK(0x103c, 0x8d08, "HP EliteBook 1045 14 G12", ALCXXX_FIXUP_CS35LXX),
10391 	SND_PCI_QUIRK(0x103c, 0x8d85, "HP EliteBook 1040 14 G12", ALCXXX_FIXUP_CS35LXX),
10392 	SND_PCI_QUIRK(0x103c, 0x8d86, "HP Elite x360 1040 14 G12", ALCXXX_FIXUP_CS35LXX),
10393 	SND_PCI_QUIRK(0x103c, 0x8d8c, "HP EliteBook 830 13 G12", ALCXXX_FIXUP_CS35LXX),
10394 	SND_PCI_QUIRK(0x103c, 0x8d8d, "HP Elite x360 830 13 G12", ALCXXX_FIXUP_CS35LXX),
10395 	SND_PCI_QUIRK(0x103c, 0x8d8e, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX),
10396 	SND_PCI_QUIRK(0x103c, 0x8d8f, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX),
10397 	SND_PCI_QUIRK(0x103c, 0x8d90, "HP EliteBook 860 16 G12", ALCXXX_FIXUP_CS35LXX),
10398 	SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALCXXX_FIXUP_CS35LXX),
10399 	SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALCXXX_FIXUP_CS35LXX),
10400 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10401 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
10402 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10403 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
10404 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10405 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10406 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
10407 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10408 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10409 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10410 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10411 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10412 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10413 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10414 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10415 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10416 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10417 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10418 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10419 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10420 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10421 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10422 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10423 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10424 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10425 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10426 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
10427 	SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
10428 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10429 	SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10430 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
10431 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10432 	SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10433 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10434 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10435 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10436 	SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
10437 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10438 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
10439 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10440 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10441 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
10442 	SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
10443 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10444 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10445 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10446 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10447 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10448 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10449 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10450 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10451 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10452 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10453 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
10454 	SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10455 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10456 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10457 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10458 	SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
10459 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10460 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10461 	SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10462 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10463 	SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10464 	SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10465 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10466 	SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
10467 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10468 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10469 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10470 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10471 	SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10472 	SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10473 	SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10474 	SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
10475 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10476 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10477 	SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10478 	SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606", ALC285_FIXUP_CS35L56_I2C_4),
10479 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10480 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10481 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10482 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10483 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10484 	SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_CS35L56_I2C_2),
10485 	SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_CS35L56_I2C_2),
10486 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10487 	SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
10488 	SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10489 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10490 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10491 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10492 	SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
10493 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10494 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10495 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10496 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10497 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10498 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10499 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10500 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10501 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10502 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10503 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10504 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10505 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10506 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10507 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10508 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10509 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10510 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10511 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10512 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10513 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10514 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10515 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10516 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10517 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10518 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10519 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10520 	SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10521 	SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10522 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10523 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10524 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10525 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10526 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10527 	SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10528 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10529 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10530 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10531 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10532 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10533 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10534 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10535 	SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10536 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10537 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10538 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10539 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10540 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10541 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10542 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10543 	SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG-KB1US)", ALC298_FIXUP_SAMSUNG_AMP2),
10544 	SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH-XD92G))", ALC298_FIXUP_SAMSUNG_AMP2),
10545 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10546 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10547 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10548 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10549 	SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10550 	SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10551 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10552 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10553 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10554 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10555 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10556 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10557 	SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10558 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10559 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10560 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10561 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10562 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10563 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10564 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10565 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10566 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10567 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10568 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10569 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10570 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10571 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10572 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10573 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10574 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10575 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10576 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10577 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10578 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10579 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10580 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10581 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10582 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10583 	SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10584 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10585 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10586 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10587 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10588 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10589 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10590 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10591 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10592 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10593 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10594 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10595 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10596 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10597 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10598 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10599 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10600 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10601 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10602 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10603 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10604 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10605 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10606 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10607 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10608 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10609 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10610 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10611 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10612 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10613 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10614 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10615 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10616 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10617 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10618 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10619 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10620 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10621 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10622 	SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10623 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10624 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10625 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10626 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10627 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10628 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10629 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10630 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10631 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10632 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10633 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10634 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10635 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10636 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10637 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10638 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10639 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10640 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10641 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10642 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10643 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10644 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10645 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10646 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10647 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10648 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10649 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10650 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10651 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10652 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10653 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10654 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10655 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10656 	SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10657 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10658 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10659 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10660 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10661 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10662 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10663 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10664 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10665 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10666 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10667 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10668 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10669 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10670 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10671 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10672 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10673 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10674 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10675 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10676 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10677 	SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10678 	SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10679 	SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C),
10680 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10681 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10682 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10683 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10684 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10685 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10686 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10687 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10688 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10689 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10690 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10691 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10692 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10693 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
10694 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10695 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10696 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10697 	SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330 / Yoga Duet 7", ALC287_FIXUP_LENOVO_SSID_17AA3820),
10698 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10699 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10700 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10701 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10702 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10703 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10704 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10705 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10706 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10707 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10708 	SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10709 	SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10710 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10711 	SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7 / Yoga Pro 7 14ARP8",  ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7),
10712 	SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7),
10713 	SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
10714 	SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10715 	SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10716 	SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10717 	SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10718 	SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10719 	SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10720 	SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10721 	SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10722 	SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10723 	SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10724 	SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10725 	SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10726 	SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10727 	SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10728 	SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10729 	SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10730 	SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10731 	SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10732 	SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10733 	SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10734 	SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10735 	SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10736 	SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10737 	SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10738 	SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10739 	SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10740 	SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10741 	SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10742 	SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10743 	SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10744 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10745 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10746 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10747 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10748 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10749 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10750 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10751 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10752 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10753 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10754 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10755 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10756 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10757 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10758 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10759 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10760 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10761 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10762 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10763 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10764 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10765 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10766 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10767 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10768 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10769 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10770 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10771 	SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10772 	SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10773 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10774 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10775 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10776 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10777 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10778 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10779 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10780 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10781 	SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10782 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10783 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10784 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10785 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10786 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10787 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10788 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10789 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10790 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10791 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10792 	SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10793 	SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10794 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10795 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10796 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10797 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10798 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10799 	SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10800 	SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10801 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10802 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10803 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10804 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10805 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10806 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10807 	SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10808 	SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10809 
10810 #if 0
10811 	/* Below is a quirk table taken from the old code.
10812 	 * Basically the device should work as is without the fixup table.
10813 	 * If BIOS doesn't give a proper info, enable the corresponding
10814 	 * fixup entry.
10815 	 */
10816 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10817 		      ALC269_FIXUP_AMIC),
10818 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10819 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10820 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10821 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10822 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10823 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10824 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10825 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10826 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10827 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10828 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10829 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10830 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10831 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10832 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10833 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10834 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10835 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10836 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10837 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10838 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10839 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10840 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10841 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10842 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10843 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10844 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10845 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10846 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10847 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10848 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10849 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10850 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10851 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10852 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10853 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10854 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10855 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10856 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10857 #endif
10858 	{}
10859 };
10860 
10861 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10862 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10863 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10864 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10865 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10866 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10867 	{}
10868 };
10869 
10870 static const struct hda_model_fixup alc269_fixup_models[] = {
10871 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10872 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10873 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10874 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10875 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10876 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10877 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10878 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10879 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10880 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10881 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10882 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10883 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10884 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10885 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10886 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10887 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10888 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10889 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10890 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10891 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10892 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10893 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
10894 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10895 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
10896 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10897 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10898 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10899 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10900 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10901 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10902 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10903 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10904 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10905 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10906 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10907 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10908 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10909 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10910 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10911 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10912 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10913 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10914 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10915 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10916 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10917 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10918 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10919 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10920 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10921 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10922 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10923 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10924 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10925 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10926 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10927 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10928 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10929 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10930 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10931 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10932 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10933 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10934 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10935 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
10936 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
10937 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
10938 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
10939 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10940 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10941 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10942 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10943 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10944 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10945 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10946 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10947 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10948 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10949 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10950 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10951 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10952 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
10953 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10954 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10955 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
10956 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
10957 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
10958 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
10959 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10960 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10961 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10962 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10963 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10964 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10965 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10966 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10967 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10968 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10969 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10970 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10971 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10972 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10973 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10974 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10975 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
10976 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10977 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
10978 	{.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"},
10979 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
10980 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
10981 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
10982 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
10983 	{.id = ALC298_FIXUP_SAMSUNG_AMP2, .name = "alc298-samsung-amp2"},
10984 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
10985 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
10986 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
10987 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
10988 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
10989 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
10990 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
10991 	{.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
10992 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
10993 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
10994 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
10995 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
10996 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
10997 	{}
10998 };
10999 #define ALC225_STANDARD_PINS \
11000 	{0x21, 0x04211020}
11001 
11002 #define ALC256_STANDARD_PINS \
11003 	{0x12, 0x90a60140}, \
11004 	{0x14, 0x90170110}, \
11005 	{0x21, 0x02211020}
11006 
11007 #define ALC282_STANDARD_PINS \
11008 	{0x14, 0x90170110}
11009 
11010 #define ALC290_STANDARD_PINS \
11011 	{0x12, 0x99a30130}
11012 
11013 #define ALC292_STANDARD_PINS \
11014 	{0x14, 0x90170110}, \
11015 	{0x15, 0x0221401f}
11016 
11017 #define ALC295_STANDARD_PINS \
11018 	{0x12, 0xb7a60130}, \
11019 	{0x14, 0x90170110}, \
11020 	{0x21, 0x04211020}
11021 
11022 #define ALC298_STANDARD_PINS \
11023 	{0x12, 0x90a60130}, \
11024 	{0x21, 0x03211020}
11025 
11026 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
11027 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
11028 		{0x14, 0x01014020},
11029 		{0x17, 0x90170110},
11030 		{0x18, 0x02a11030},
11031 		{0x19, 0x0181303F},
11032 		{0x21, 0x0221102f}),
11033 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
11034 		{0x12, 0x90a601c0},
11035 		{0x14, 0x90171120},
11036 		{0x21, 0x02211030}),
11037 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11038 		{0x14, 0x90170110},
11039 		{0x1b, 0x90a70130},
11040 		{0x21, 0x03211020}),
11041 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11042 		{0x1a, 0x90a70130},
11043 		{0x1b, 0x90170110},
11044 		{0x21, 0x03211020}),
11045 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11046 		ALC225_STANDARD_PINS,
11047 		{0x12, 0xb7a60130},
11048 		{0x14, 0x901701a0}),
11049 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11050 		ALC225_STANDARD_PINS,
11051 		{0x12, 0xb7a60130},
11052 		{0x14, 0x901701b0}),
11053 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11054 		ALC225_STANDARD_PINS,
11055 		{0x12, 0xb7a60150},
11056 		{0x14, 0x901701a0}),
11057 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11058 		ALC225_STANDARD_PINS,
11059 		{0x12, 0xb7a60150},
11060 		{0x14, 0x901701b0}),
11061 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11062 		ALC225_STANDARD_PINS,
11063 		{0x12, 0xb7a60130},
11064 		{0x1b, 0x90170110}),
11065 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11066 		{0x1b, 0x01111010},
11067 		{0x1e, 0x01451130},
11068 		{0x21, 0x02211020}),
11069 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
11070 		{0x12, 0x90a60140},
11071 		{0x14, 0x90170110},
11072 		{0x19, 0x02a11030},
11073 		{0x21, 0x02211020}),
11074 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11075 		{0x14, 0x90170110},
11076 		{0x19, 0x02a11030},
11077 		{0x1a, 0x02a11040},
11078 		{0x1b, 0x01014020},
11079 		{0x21, 0x0221101f}),
11080 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11081 		{0x14, 0x90170110},
11082 		{0x19, 0x02a11030},
11083 		{0x1a, 0x02a11040},
11084 		{0x1b, 0x01011020},
11085 		{0x21, 0x0221101f}),
11086 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11087 		{0x14, 0x90170110},
11088 		{0x19, 0x02a11020},
11089 		{0x1a, 0x02a11030},
11090 		{0x21, 0x0221101f}),
11091 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
11092 		{0x21, 0x02211010}),
11093 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11094 		{0x14, 0x90170110},
11095 		{0x19, 0x02a11020},
11096 		{0x21, 0x02211030}),
11097 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
11098 		{0x14, 0x90170110},
11099 		{0x21, 0x02211020}),
11100 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11101 		{0x14, 0x90170130},
11102 		{0x21, 0x02211040}),
11103 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11104 		{0x12, 0x90a60140},
11105 		{0x14, 0x90170110},
11106 		{0x21, 0x02211020}),
11107 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11108 		{0x12, 0x90a60160},
11109 		{0x14, 0x90170120},
11110 		{0x21, 0x02211030}),
11111 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11112 		{0x14, 0x90170110},
11113 		{0x1b, 0x02011020},
11114 		{0x21, 0x0221101f}),
11115 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11116 		{0x14, 0x90170110},
11117 		{0x1b, 0x01011020},
11118 		{0x21, 0x0221101f}),
11119 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11120 		{0x14, 0x90170130},
11121 		{0x1b, 0x01014020},
11122 		{0x21, 0x0221103f}),
11123 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11124 		{0x14, 0x90170130},
11125 		{0x1b, 0x01011020},
11126 		{0x21, 0x0221103f}),
11127 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11128 		{0x14, 0x90170130},
11129 		{0x1b, 0x02011020},
11130 		{0x21, 0x0221103f}),
11131 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11132 		{0x14, 0x90170150},
11133 		{0x1b, 0x02011020},
11134 		{0x21, 0x0221105f}),
11135 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11136 		{0x14, 0x90170110},
11137 		{0x1b, 0x01014020},
11138 		{0x21, 0x0221101f}),
11139 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11140 		{0x12, 0x90a60160},
11141 		{0x14, 0x90170120},
11142 		{0x17, 0x90170140},
11143 		{0x21, 0x0321102f}),
11144 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11145 		{0x12, 0x90a60160},
11146 		{0x14, 0x90170130},
11147 		{0x21, 0x02211040}),
11148 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11149 		{0x12, 0x90a60160},
11150 		{0x14, 0x90170140},
11151 		{0x21, 0x02211050}),
11152 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11153 		{0x12, 0x90a60170},
11154 		{0x14, 0x90170120},
11155 		{0x21, 0x02211030}),
11156 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11157 		{0x12, 0x90a60170},
11158 		{0x14, 0x90170130},
11159 		{0x21, 0x02211040}),
11160 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11161 		{0x12, 0x90a60170},
11162 		{0x14, 0x90171130},
11163 		{0x21, 0x02211040}),
11164 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11165 		{0x12, 0x90a60170},
11166 		{0x14, 0x90170140},
11167 		{0x21, 0x02211050}),
11168 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11169 		{0x12, 0x90a60180},
11170 		{0x14, 0x90170130},
11171 		{0x21, 0x02211040}),
11172 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11173 		{0x12, 0x90a60180},
11174 		{0x14, 0x90170120},
11175 		{0x21, 0x02211030}),
11176 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11177 		{0x1b, 0x01011020},
11178 		{0x21, 0x02211010}),
11179 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11180 		{0x14, 0x90170110},
11181 		{0x1b, 0x90a70130},
11182 		{0x21, 0x04211020}),
11183 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11184 		{0x14, 0x90170110},
11185 		{0x1b, 0x90a70130},
11186 		{0x21, 0x03211020}),
11187 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11188 		{0x12, 0x90a60130},
11189 		{0x14, 0x90170110},
11190 		{0x21, 0x03211020}),
11191 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11192 		{0x12, 0x90a60130},
11193 		{0x14, 0x90170110},
11194 		{0x21, 0x04211020}),
11195 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11196 		{0x1a, 0x90a70130},
11197 		{0x1b, 0x90170110},
11198 		{0x21, 0x03211020}),
11199        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11200 		{0x14, 0x90170110},
11201 		{0x19, 0x02a11020},
11202 		{0x21, 0x0221101f}),
11203        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
11204 		{0x17, 0x90170110},
11205 		{0x19, 0x03a11030},
11206 		{0x21, 0x03211020}),
11207 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
11208 		{0x12, 0x90a60130},
11209 		{0x14, 0x90170110},
11210 		{0x15, 0x0421101f},
11211 		{0x1a, 0x04a11020}),
11212 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
11213 		{0x12, 0x90a60140},
11214 		{0x14, 0x90170110},
11215 		{0x15, 0x0421101f},
11216 		{0x18, 0x02811030},
11217 		{0x1a, 0x04a1103f},
11218 		{0x1b, 0x02011020}),
11219 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11220 		ALC282_STANDARD_PINS,
11221 		{0x12, 0x99a30130},
11222 		{0x19, 0x03a11020},
11223 		{0x21, 0x0321101f}),
11224 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11225 		ALC282_STANDARD_PINS,
11226 		{0x12, 0x99a30130},
11227 		{0x19, 0x03a11020},
11228 		{0x21, 0x03211040}),
11229 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11230 		ALC282_STANDARD_PINS,
11231 		{0x12, 0x99a30130},
11232 		{0x19, 0x03a11030},
11233 		{0x21, 0x03211020}),
11234 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11235 		ALC282_STANDARD_PINS,
11236 		{0x12, 0x99a30130},
11237 		{0x19, 0x04a11020},
11238 		{0x21, 0x0421101f}),
11239 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
11240 		ALC282_STANDARD_PINS,
11241 		{0x12, 0x90a60140},
11242 		{0x19, 0x04a11030},
11243 		{0x21, 0x04211020}),
11244 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11245 		ALC282_STANDARD_PINS,
11246 		{0x12, 0x90a609c0},
11247 		{0x18, 0x03a11830},
11248 		{0x19, 0x04a19831},
11249 		{0x1a, 0x0481303f},
11250 		{0x1b, 0x04211020},
11251 		{0x21, 0x0321101f}),
11252 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11253 		ALC282_STANDARD_PINS,
11254 		{0x12, 0x90a60940},
11255 		{0x18, 0x03a11830},
11256 		{0x19, 0x04a19831},
11257 		{0x1a, 0x0481303f},
11258 		{0x1b, 0x04211020},
11259 		{0x21, 0x0321101f}),
11260 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11261 		ALC282_STANDARD_PINS,
11262 		{0x12, 0x90a60130},
11263 		{0x21, 0x0321101f}),
11264 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11265 		{0x12, 0x90a60160},
11266 		{0x14, 0x90170120},
11267 		{0x21, 0x02211030}),
11268 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11269 		ALC282_STANDARD_PINS,
11270 		{0x12, 0x90a60130},
11271 		{0x19, 0x03a11020},
11272 		{0x21, 0x0321101f}),
11273 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11274 		{0x12, 0x90a60130},
11275 		{0x14, 0x90170110},
11276 		{0x19, 0x04a11040},
11277 		{0x21, 0x04211020}),
11278 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11279 		{0x14, 0x90170110},
11280 		{0x19, 0x04a11040},
11281 		{0x1d, 0x40600001},
11282 		{0x21, 0x04211020}),
11283 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
11284 		{0x14, 0x90170110},
11285 		{0x19, 0x04a11040},
11286 		{0x21, 0x04211020}),
11287 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11288 		{0x14, 0x90170110},
11289 		{0x17, 0x90170111},
11290 		{0x19, 0x03a11030},
11291 		{0x21, 0x03211020}),
11292 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11293 		{0x17, 0x90170110},
11294 		{0x19, 0x03a11030},
11295 		{0x21, 0x03211020}),
11296 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11297 		{0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11298 		{0x19, 0x04a11040},
11299 		{0x21, 0x04211020}),
11300 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11301 		{0x12, 0x90a60130},
11302 		{0x17, 0x90170110},
11303 		{0x21, 0x02211020}),
11304 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
11305 		{0x12, 0x90a60120},
11306 		{0x14, 0x90170110},
11307 		{0x21, 0x0321101f}),
11308 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11309 		ALC290_STANDARD_PINS,
11310 		{0x15, 0x04211040},
11311 		{0x18, 0x90170112},
11312 		{0x1a, 0x04a11020}),
11313 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11314 		ALC290_STANDARD_PINS,
11315 		{0x15, 0x04211040},
11316 		{0x18, 0x90170110},
11317 		{0x1a, 0x04a11020}),
11318 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11319 		ALC290_STANDARD_PINS,
11320 		{0x15, 0x0421101f},
11321 		{0x1a, 0x04a11020}),
11322 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11323 		ALC290_STANDARD_PINS,
11324 		{0x15, 0x04211020},
11325 		{0x1a, 0x04a11040}),
11326 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11327 		ALC290_STANDARD_PINS,
11328 		{0x14, 0x90170110},
11329 		{0x15, 0x04211020},
11330 		{0x1a, 0x04a11040}),
11331 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11332 		ALC290_STANDARD_PINS,
11333 		{0x14, 0x90170110},
11334 		{0x15, 0x04211020},
11335 		{0x1a, 0x04a11020}),
11336 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11337 		ALC290_STANDARD_PINS,
11338 		{0x14, 0x90170110},
11339 		{0x15, 0x0421101f},
11340 		{0x1a, 0x04a11020}),
11341 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11342 		ALC292_STANDARD_PINS,
11343 		{0x12, 0x90a60140},
11344 		{0x16, 0x01014020},
11345 		{0x19, 0x01a19030}),
11346 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11347 		ALC292_STANDARD_PINS,
11348 		{0x12, 0x90a60140},
11349 		{0x16, 0x01014020},
11350 		{0x18, 0x02a19031},
11351 		{0x19, 0x01a1903e}),
11352 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
11353 		ALC292_STANDARD_PINS,
11354 		{0x12, 0x90a60140}),
11355 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11356 		ALC292_STANDARD_PINS,
11357 		{0x13, 0x90a60140},
11358 		{0x16, 0x21014020},
11359 		{0x19, 0x21a19030}),
11360 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11361 		ALC292_STANDARD_PINS,
11362 		{0x13, 0x90a60140}),
11363 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
11364 		{0x17, 0x90170110},
11365 		{0x21, 0x04211020}),
11366 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
11367 		{0x14, 0x90170110},
11368 		{0x1b, 0x90a70130},
11369 		{0x21, 0x04211020}),
11370 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11371 		{0x12, 0x90a60130},
11372 		{0x17, 0x90170110},
11373 		{0x21, 0x03211020}),
11374 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11375 		{0x12, 0x90a60130},
11376 		{0x17, 0x90170110},
11377 		{0x21, 0x04211020}),
11378 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11379 		{0x12, 0x90a60130},
11380 		{0x17, 0x90170110},
11381 		{0x21, 0x03211020}),
11382 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11383 		{0x12, 0x90a60120},
11384 		{0x17, 0x90170110},
11385 		{0x21, 0x04211030}),
11386 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11387 		{0x12, 0x90a60130},
11388 		{0x17, 0x90170110},
11389 		{0x21, 0x03211020}),
11390 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11391 		{0x12, 0x90a60130},
11392 		{0x17, 0x90170110},
11393 		{0x21, 0x03211020}),
11394 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11395 		ALC298_STANDARD_PINS,
11396 		{0x17, 0x90170110}),
11397 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11398 		ALC298_STANDARD_PINS,
11399 		{0x17, 0x90170140}),
11400 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11401 		ALC298_STANDARD_PINS,
11402 		{0x17, 0x90170150}),
11403 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
11404 		{0x12, 0xb7a60140},
11405 		{0x13, 0xb7a60150},
11406 		{0x17, 0x90170110},
11407 		{0x1a, 0x03011020},
11408 		{0x21, 0x03211030}),
11409 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
11410 		{0x12, 0xb7a60140},
11411 		{0x17, 0x90170110},
11412 		{0x1a, 0x03a11030},
11413 		{0x21, 0x03211020}),
11414 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11415 		ALC225_STANDARD_PINS,
11416 		{0x12, 0xb7a60130},
11417 		{0x17, 0x90170110}),
11418 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
11419 		{0x14, 0x01014010},
11420 		{0x17, 0x90170120},
11421 		{0x18, 0x02a11030},
11422 		{0x19, 0x02a1103f},
11423 		{0x21, 0x0221101f}),
11424 	{}
11425 };
11426 
11427 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
11428  * more machines, don't need to match all valid pins, just need to match
11429  * all the pins defined in the tbl. Just because of this reason, it is possible
11430  * that a single machine matches multiple tbls, so there is one limitation:
11431  *   at most one tbl is allowed to define for the same vendor and same codec
11432  */
11433 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
11434 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
11435 		{0x19, 0x40000000}),
11436 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11437 		{0x19, 0x40000000},
11438 		{0x1b, 0x40000000}),
11439 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11440 		{0x19, 0x40000000},
11441 		{0x1b, 0x40000000}),
11442 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11443 		{0x19, 0x40000000},
11444 		{0x1a, 0x40000000}),
11445 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11446 		{0x19, 0x40000000},
11447 		{0x1a, 0x40000000}),
11448 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11449 		{0x19, 0x40000000},
11450 		{0x1a, 0x40000000}),
11451 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11452 		{0x19, 0x40000000}),
11453 	{}
11454 };
11455 
11456 static void alc269_fill_coef(struct hda_codec *codec)
11457 {
11458 	struct alc_spec *spec = codec->spec;
11459 	int val;
11460 
11461 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11462 		return;
11463 
11464 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11465 		alc_write_coef_idx(codec, 0xf, 0x960b);
11466 		alc_write_coef_idx(codec, 0xe, 0x8817);
11467 	}
11468 
11469 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11470 		alc_write_coef_idx(codec, 0xf, 0x960b);
11471 		alc_write_coef_idx(codec, 0xe, 0x8814);
11472 	}
11473 
11474 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11475 		/* Power up output pin */
11476 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11477 	}
11478 
11479 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11480 		val = alc_read_coef_idx(codec, 0xd);
11481 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11482 			/* Capless ramp up clock control */
11483 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
11484 		}
11485 		val = alc_read_coef_idx(codec, 0x17);
11486 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11487 			/* Class D power on reset */
11488 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
11489 		}
11490 	}
11491 
11492 	/* HP */
11493 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11494 }
11495 
11496 /*
11497  */
11498 static int patch_alc269(struct hda_codec *codec)
11499 {
11500 	struct alc_spec *spec;
11501 	int err;
11502 
11503 	err = alc_alloc_spec(codec, 0x0b);
11504 	if (err < 0)
11505 		return err;
11506 
11507 	spec = codec->spec;
11508 	spec->gen.shared_mic_vref_pin = 0x18;
11509 	codec->power_save_node = 0;
11510 	spec->en_3kpull_low = true;
11511 
11512 	codec->patch_ops.suspend = alc269_suspend;
11513 	codec->patch_ops.resume = alc269_resume;
11514 	spec->shutup = alc_default_shutup;
11515 	spec->init_hook = alc_default_init;
11516 
11517 	switch (codec->core.vendor_id) {
11518 	case 0x10ec0269:
11519 		spec->codec_variant = ALC269_TYPE_ALC269VA;
11520 		switch (alc_get_coef0(codec) & 0x00f0) {
11521 		case 0x0010:
11522 			if (codec->bus->pci &&
11523 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
11524 			    spec->cdefine.platform_type == 1)
11525 				err = alc_codec_rename(codec, "ALC271X");
11526 			spec->codec_variant = ALC269_TYPE_ALC269VB;
11527 			break;
11528 		case 0x0020:
11529 			if (codec->bus->pci &&
11530 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
11531 			    codec->bus->pci->subsystem_device == 0x21f3)
11532 				err = alc_codec_rename(codec, "ALC3202");
11533 			spec->codec_variant = ALC269_TYPE_ALC269VC;
11534 			break;
11535 		case 0x0030:
11536 			spec->codec_variant = ALC269_TYPE_ALC269VD;
11537 			break;
11538 		default:
11539 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
11540 		}
11541 		if (err < 0)
11542 			goto error;
11543 		spec->shutup = alc269_shutup;
11544 		spec->init_hook = alc269_fill_coef;
11545 		alc269_fill_coef(codec);
11546 		break;
11547 
11548 	case 0x10ec0280:
11549 	case 0x10ec0290:
11550 		spec->codec_variant = ALC269_TYPE_ALC280;
11551 		break;
11552 	case 0x10ec0282:
11553 		spec->codec_variant = ALC269_TYPE_ALC282;
11554 		spec->shutup = alc282_shutup;
11555 		spec->init_hook = alc282_init;
11556 		break;
11557 	case 0x10ec0233:
11558 	case 0x10ec0283:
11559 		spec->codec_variant = ALC269_TYPE_ALC283;
11560 		spec->shutup = alc283_shutup;
11561 		spec->init_hook = alc283_init;
11562 		break;
11563 	case 0x10ec0284:
11564 	case 0x10ec0292:
11565 		spec->codec_variant = ALC269_TYPE_ALC284;
11566 		break;
11567 	case 0x10ec0293:
11568 		spec->codec_variant = ALC269_TYPE_ALC293;
11569 		break;
11570 	case 0x10ec0286:
11571 	case 0x10ec0288:
11572 		spec->codec_variant = ALC269_TYPE_ALC286;
11573 		break;
11574 	case 0x10ec0298:
11575 		spec->codec_variant = ALC269_TYPE_ALC298;
11576 		break;
11577 	case 0x10ec0235:
11578 	case 0x10ec0255:
11579 		spec->codec_variant = ALC269_TYPE_ALC255;
11580 		spec->shutup = alc256_shutup;
11581 		spec->init_hook = alc256_init;
11582 		break;
11583 	case 0x10ec0230:
11584 	case 0x10ec0236:
11585 	case 0x10ec0256:
11586 	case 0x19e58326:
11587 		spec->codec_variant = ALC269_TYPE_ALC256;
11588 		spec->shutup = alc256_shutup;
11589 		spec->init_hook = alc256_init;
11590 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11591 		if (codec->core.vendor_id == 0x10ec0236 &&
11592 		    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11593 			spec->en_3kpull_low = false;
11594 		break;
11595 	case 0x10ec0257:
11596 		spec->codec_variant = ALC269_TYPE_ALC257;
11597 		spec->shutup = alc256_shutup;
11598 		spec->init_hook = alc256_init;
11599 		spec->gen.mixer_nid = 0;
11600 		spec->en_3kpull_low = false;
11601 		break;
11602 	case 0x10ec0215:
11603 	case 0x10ec0245:
11604 	case 0x10ec0285:
11605 	case 0x10ec0289:
11606 		if (alc_get_coef0(codec) & 0x0010)
11607 			spec->codec_variant = ALC269_TYPE_ALC245;
11608 		else
11609 			spec->codec_variant = ALC269_TYPE_ALC215;
11610 		spec->shutup = alc225_shutup;
11611 		spec->init_hook = alc225_init;
11612 		spec->gen.mixer_nid = 0;
11613 		break;
11614 	case 0x10ec0225:
11615 	case 0x10ec0295:
11616 	case 0x10ec0299:
11617 		spec->codec_variant = ALC269_TYPE_ALC225;
11618 		spec->shutup = alc225_shutup;
11619 		spec->init_hook = alc225_init;
11620 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11621 		break;
11622 	case 0x10ec0287:
11623 		spec->codec_variant = ALC269_TYPE_ALC287;
11624 		spec->shutup = alc225_shutup;
11625 		spec->init_hook = alc225_init;
11626 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11627 		break;
11628 	case 0x10ec0234:
11629 	case 0x10ec0274:
11630 	case 0x10ec0294:
11631 		spec->codec_variant = ALC269_TYPE_ALC294;
11632 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11633 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11634 		spec->init_hook = alc294_init;
11635 		break;
11636 	case 0x10ec0300:
11637 		spec->codec_variant = ALC269_TYPE_ALC300;
11638 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11639 		break;
11640 	case 0x10ec0623:
11641 		spec->codec_variant = ALC269_TYPE_ALC623;
11642 		break;
11643 	case 0x10ec0700:
11644 	case 0x10ec0701:
11645 	case 0x10ec0703:
11646 	case 0x10ec0711:
11647 		spec->codec_variant = ALC269_TYPE_ALC700;
11648 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11649 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11650 		spec->init_hook = alc294_init;
11651 		break;
11652 
11653 	}
11654 
11655 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11656 		spec->has_alc5505_dsp = 1;
11657 		spec->init_hook = alc5505_dsp_init;
11658 	}
11659 
11660 	alc_pre_init(codec);
11661 
11662 	snd_hda_pick_fixup(codec, alc269_fixup_models,
11663 		       alc269_fixup_tbl, alc269_fixups);
11664 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11665 	 * the quirk breaks the latter (bko#214101).
11666 	 * Clear the wrong entry.
11667 	 */
11668 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11669 	    codec->core.vendor_id == 0x10ec0294) {
11670 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11671 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11672 	}
11673 
11674 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11675 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11676 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
11677 			   alc269_fixups);
11678 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11679 
11680 	alc_auto_parse_customize_define(codec);
11681 
11682 	if (has_cdefine_beep(codec))
11683 		spec->gen.beep_nid = 0x01;
11684 
11685 	/* automatic parse from the BIOS config */
11686 	err = alc269_parse_auto_config(codec);
11687 	if (err < 0)
11688 		goto error;
11689 
11690 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11691 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11692 		if (err < 0)
11693 			goto error;
11694 	}
11695 
11696 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11697 
11698 	return 0;
11699 
11700  error:
11701 	alc_free(codec);
11702 	return err;
11703 }
11704 
11705 /*
11706  * ALC861
11707  */
11708 
11709 static int alc861_parse_auto_config(struct hda_codec *codec)
11710 {
11711 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11712 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11713 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11714 }
11715 
11716 /* Pin config fixes */
11717 enum {
11718 	ALC861_FIXUP_FSC_AMILO_PI1505,
11719 	ALC861_FIXUP_AMP_VREF_0F,
11720 	ALC861_FIXUP_NO_JACK_DETECT,
11721 	ALC861_FIXUP_ASUS_A6RP,
11722 	ALC660_FIXUP_ASUS_W7J,
11723 };
11724 
11725 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11726 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11727 			const struct hda_fixup *fix, int action)
11728 {
11729 	struct alc_spec *spec = codec->spec;
11730 	unsigned int val;
11731 
11732 	if (action != HDA_FIXUP_ACT_INIT)
11733 		return;
11734 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
11735 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11736 		val |= AC_PINCTL_IN_EN;
11737 	val |= AC_PINCTL_VREF_50;
11738 	snd_hda_set_pin_ctl(codec, 0x0f, val);
11739 	spec->gen.keep_vref_in_automute = 1;
11740 }
11741 
11742 /* suppress the jack-detection */
11743 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11744 				     const struct hda_fixup *fix, int action)
11745 {
11746 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11747 		codec->no_jack_detect = 1;
11748 }
11749 
11750 static const struct hda_fixup alc861_fixups[] = {
11751 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
11752 		.type = HDA_FIXUP_PINS,
11753 		.v.pins = (const struct hda_pintbl[]) {
11754 			{ 0x0b, 0x0221101f }, /* HP */
11755 			{ 0x0f, 0x90170310 }, /* speaker */
11756 			{ }
11757 		}
11758 	},
11759 	[ALC861_FIXUP_AMP_VREF_0F] = {
11760 		.type = HDA_FIXUP_FUNC,
11761 		.v.func = alc861_fixup_asus_amp_vref_0f,
11762 	},
11763 	[ALC861_FIXUP_NO_JACK_DETECT] = {
11764 		.type = HDA_FIXUP_FUNC,
11765 		.v.func = alc_fixup_no_jack_detect,
11766 	},
11767 	[ALC861_FIXUP_ASUS_A6RP] = {
11768 		.type = HDA_FIXUP_FUNC,
11769 		.v.func = alc861_fixup_asus_amp_vref_0f,
11770 		.chained = true,
11771 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11772 	},
11773 	[ALC660_FIXUP_ASUS_W7J] = {
11774 		.type = HDA_FIXUP_VERBS,
11775 		.v.verbs = (const struct hda_verb[]) {
11776 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
11777 			 * for enabling outputs
11778 			 */
11779 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11780 			{ }
11781 		},
11782 	}
11783 };
11784 
11785 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
11786 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11787 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11788 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11789 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11790 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11791 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11792 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11793 	{}
11794 };
11795 
11796 /*
11797  */
11798 static int patch_alc861(struct hda_codec *codec)
11799 {
11800 	struct alc_spec *spec;
11801 	int err;
11802 
11803 	err = alc_alloc_spec(codec, 0x15);
11804 	if (err < 0)
11805 		return err;
11806 
11807 	spec = codec->spec;
11808 	if (has_cdefine_beep(codec))
11809 		spec->gen.beep_nid = 0x23;
11810 
11811 	spec->power_hook = alc_power_eapd;
11812 
11813 	alc_pre_init(codec);
11814 
11815 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11816 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11817 
11818 	/* automatic parse from the BIOS config */
11819 	err = alc861_parse_auto_config(codec);
11820 	if (err < 0)
11821 		goto error;
11822 
11823 	if (!spec->gen.no_analog) {
11824 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11825 		if (err < 0)
11826 			goto error;
11827 	}
11828 
11829 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11830 
11831 	return 0;
11832 
11833  error:
11834 	alc_free(codec);
11835 	return err;
11836 }
11837 
11838 /*
11839  * ALC861-VD support
11840  *
11841  * Based on ALC882
11842  *
11843  * In addition, an independent DAC
11844  */
11845 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11846 {
11847 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11848 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11849 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11850 }
11851 
11852 enum {
11853 	ALC660VD_FIX_ASUS_GPIO1,
11854 	ALC861VD_FIX_DALLAS,
11855 };
11856 
11857 /* exclude VREF80 */
11858 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11859 				  const struct hda_fixup *fix, int action)
11860 {
11861 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11862 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11863 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11864 	}
11865 }
11866 
11867 /* reset GPIO1 */
11868 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11869 				      const struct hda_fixup *fix, int action)
11870 {
11871 	struct alc_spec *spec = codec->spec;
11872 
11873 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11874 		spec->gpio_mask |= 0x02;
11875 	alc_fixup_gpio(codec, action, 0x01);
11876 }
11877 
11878 static const struct hda_fixup alc861vd_fixups[] = {
11879 	[ALC660VD_FIX_ASUS_GPIO1] = {
11880 		.type = HDA_FIXUP_FUNC,
11881 		.v.func = alc660vd_fixup_asus_gpio1,
11882 	},
11883 	[ALC861VD_FIX_DALLAS] = {
11884 		.type = HDA_FIXUP_FUNC,
11885 		.v.func = alc861vd_fixup_dallas,
11886 	},
11887 };
11888 
11889 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
11890 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
11891 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
11892 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
11893 	{}
11894 };
11895 
11896 /*
11897  */
11898 static int patch_alc861vd(struct hda_codec *codec)
11899 {
11900 	struct alc_spec *spec;
11901 	int err;
11902 
11903 	err = alc_alloc_spec(codec, 0x0b);
11904 	if (err < 0)
11905 		return err;
11906 
11907 	spec = codec->spec;
11908 	if (has_cdefine_beep(codec))
11909 		spec->gen.beep_nid = 0x23;
11910 
11911 	spec->shutup = alc_eapd_shutup;
11912 
11913 	alc_pre_init(codec);
11914 
11915 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11916 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11917 
11918 	/* automatic parse from the BIOS config */
11919 	err = alc861vd_parse_auto_config(codec);
11920 	if (err < 0)
11921 		goto error;
11922 
11923 	if (!spec->gen.no_analog) {
11924 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11925 		if (err < 0)
11926 			goto error;
11927 	}
11928 
11929 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11930 
11931 	return 0;
11932 
11933  error:
11934 	alc_free(codec);
11935 	return err;
11936 }
11937 
11938 /*
11939  * ALC662 support
11940  *
11941  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11942  * configuration.  Each pin widget can choose any input DACs and a mixer.
11943  * Each ADC is connected from a mixer of all inputs.  This makes possible
11944  * 6-channel independent captures.
11945  *
11946  * In addition, an independent DAC for the multi-playback (not used in this
11947  * driver yet).
11948  */
11949 
11950 /*
11951  * BIOS auto configuration
11952  */
11953 
11954 static int alc662_parse_auto_config(struct hda_codec *codec)
11955 {
11956 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
11957 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11958 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11959 	const hda_nid_t *ssids;
11960 
11961 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11962 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11963 	    codec->core.vendor_id == 0x10ec0671)
11964 		ssids = alc663_ssids;
11965 	else
11966 		ssids = alc662_ssids;
11967 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
11968 }
11969 
11970 static void alc272_fixup_mario(struct hda_codec *codec,
11971 			       const struct hda_fixup *fix, int action)
11972 {
11973 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
11974 		return;
11975 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11976 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11977 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11978 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11979 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
11980 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
11981 }
11982 
11983 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11984 	{ .channels = 2,
11985 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11986 	{ .channels = 4,
11987 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11988 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11989 	{ }
11990 };
11991 
11992 /* override the 2.1 chmap */
11993 static void alc_fixup_bass_chmap(struct hda_codec *codec,
11994 				    const struct hda_fixup *fix, int action)
11995 {
11996 	if (action == HDA_FIXUP_ACT_BUILD) {
11997 		struct alc_spec *spec = codec->spec;
11998 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
11999 	}
12000 }
12001 
12002 /* avoid D3 for keeping GPIO up */
12003 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
12004 					  hda_nid_t nid,
12005 					  unsigned int power_state)
12006 {
12007 	struct alc_spec *spec = codec->spec;
12008 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
12009 		return AC_PWRST_D0;
12010 	return power_state;
12011 }
12012 
12013 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
12014 				   const struct hda_fixup *fix, int action)
12015 {
12016 	struct alc_spec *spec = codec->spec;
12017 
12018 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
12019 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12020 		spec->mute_led_polarity = 1;
12021 		codec->power_filter = gpio_led_power_filter;
12022 	}
12023 }
12024 
12025 static void alc662_usi_automute_hook(struct hda_codec *codec,
12026 					 struct hda_jack_callback *jack)
12027 {
12028 	struct alc_spec *spec = codec->spec;
12029 	int vref;
12030 	msleep(200);
12031 	snd_hda_gen_hp_automute(codec, jack);
12032 
12033 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
12034 	msleep(100);
12035 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
12036 			    vref);
12037 }
12038 
12039 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
12040 				     const struct hda_fixup *fix, int action)
12041 {
12042 	struct alc_spec *spec = codec->spec;
12043 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12044 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12045 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
12046 	}
12047 }
12048 
12049 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
12050 					struct hda_jack_callback *cb)
12051 {
12052 	/* surround speakers at 0x1b already get muted automatically when
12053 	 * headphones are plugged in, but we have to mute/unmute the remaining
12054 	 * channels manually:
12055 	 * 0x15 - front left/front right
12056 	 * 0x18 - front center/ LFE
12057 	 */
12058 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
12059 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
12060 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
12061 	} else {
12062 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
12063 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
12064 	}
12065 }
12066 
12067 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
12068 					const struct hda_fixup *fix, int action)
12069 {
12070     /* Pin 0x1b: shared headphones jack and surround speakers */
12071 	if (!is_jack_detectable(codec, 0x1b))
12072 		return;
12073 
12074 	switch (action) {
12075 	case HDA_FIXUP_ACT_PRE_PROBE:
12076 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
12077 				alc662_aspire_ethos_mute_speakers);
12078 		/* subwoofer needs an extra GPIO setting to become audible */
12079 		alc_setup_gpio(codec, 0x02);
12080 		break;
12081 	case HDA_FIXUP_ACT_INIT:
12082 		/* Make sure to start in a correct state, i.e. if
12083 		 * headphones have been plugged in before powering up the system
12084 		 */
12085 		alc662_aspire_ethos_mute_speakers(codec, NULL);
12086 		break;
12087 	}
12088 }
12089 
12090 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
12091 					     const struct hda_fixup *fix, int action)
12092 {
12093 	struct alc_spec *spec = codec->spec;
12094 
12095 	static const struct hda_pintbl pincfgs[] = {
12096 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
12097 		{ 0x1b, 0x0181304f },
12098 		{ }
12099 	};
12100 
12101 	switch (action) {
12102 	case HDA_FIXUP_ACT_PRE_PROBE:
12103 		spec->gen.mixer_nid = 0;
12104 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12105 		snd_hda_apply_pincfgs(codec, pincfgs);
12106 		break;
12107 	case HDA_FIXUP_ACT_INIT:
12108 		alc_write_coef_idx(codec, 0x19, 0xa054);
12109 		break;
12110 	}
12111 }
12112 
12113 static void alc897_hp_automute_hook(struct hda_codec *codec,
12114 					 struct hda_jack_callback *jack)
12115 {
12116 	struct alc_spec *spec = codec->spec;
12117 	int vref;
12118 
12119 	snd_hda_gen_hp_automute(codec, jack);
12120 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
12121 	snd_hda_set_pin_ctl(codec, 0x1b, vref);
12122 }
12123 
12124 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
12125 				     const struct hda_fixup *fix, int action)
12126 {
12127 	struct alc_spec *spec = codec->spec;
12128 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12129 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12130 		spec->no_shutup_pins = 1;
12131 	}
12132 	if (action == HDA_FIXUP_ACT_PROBE) {
12133 		snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
12134 	}
12135 }
12136 
12137 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
12138 				     const struct hda_fixup *fix, int action)
12139 {
12140 	struct alc_spec *spec = codec->spec;
12141 
12142 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12143 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12144 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12145 	}
12146 }
12147 
12148 static const struct coef_fw alc668_coefs[] = {
12149 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
12150 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
12151 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
12152 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
12153 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
12154 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
12155 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
12156 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
12157 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
12158 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
12159 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
12160 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
12161 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
12162 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
12163 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
12164 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
12165 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
12166 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
12167 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
12168 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
12169 	{}
12170 };
12171 
12172 static void alc668_restore_default_value(struct hda_codec *codec)
12173 {
12174 	alc_process_coef_fw(codec, alc668_coefs);
12175 }
12176 
12177 enum {
12178 	ALC662_FIXUP_ASPIRE,
12179 	ALC662_FIXUP_LED_GPIO1,
12180 	ALC662_FIXUP_IDEAPAD,
12181 	ALC272_FIXUP_MARIO,
12182 	ALC662_FIXUP_CZC_ET26,
12183 	ALC662_FIXUP_CZC_P10T,
12184 	ALC662_FIXUP_SKU_IGNORE,
12185 	ALC662_FIXUP_HP_RP5800,
12186 	ALC662_FIXUP_ASUS_MODE1,
12187 	ALC662_FIXUP_ASUS_MODE2,
12188 	ALC662_FIXUP_ASUS_MODE3,
12189 	ALC662_FIXUP_ASUS_MODE4,
12190 	ALC662_FIXUP_ASUS_MODE5,
12191 	ALC662_FIXUP_ASUS_MODE6,
12192 	ALC662_FIXUP_ASUS_MODE7,
12193 	ALC662_FIXUP_ASUS_MODE8,
12194 	ALC662_FIXUP_NO_JACK_DETECT,
12195 	ALC662_FIXUP_ZOTAC_Z68,
12196 	ALC662_FIXUP_INV_DMIC,
12197 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12198 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
12199 	ALC662_FIXUP_HEADSET_MODE,
12200 	ALC668_FIXUP_HEADSET_MODE,
12201 	ALC662_FIXUP_BASS_MODE4_CHMAP,
12202 	ALC662_FIXUP_BASS_16,
12203 	ALC662_FIXUP_BASS_1A,
12204 	ALC662_FIXUP_BASS_CHMAP,
12205 	ALC668_FIXUP_AUTO_MUTE,
12206 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
12207 	ALC668_FIXUP_DELL_XPS13,
12208 	ALC662_FIXUP_ASUS_Nx50,
12209 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12210 	ALC668_FIXUP_ASUS_Nx51,
12211 	ALC668_FIXUP_MIC_COEF,
12212 	ALC668_FIXUP_ASUS_G751,
12213 	ALC891_FIXUP_HEADSET_MODE,
12214 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12215 	ALC662_FIXUP_ACER_VERITON,
12216 	ALC892_FIXUP_ASROCK_MOBO,
12217 	ALC662_FIXUP_USI_FUNC,
12218 	ALC662_FIXUP_USI_HEADSET_MODE,
12219 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
12220 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
12221 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
12222 	ALC671_FIXUP_HP_HEADSET_MIC2,
12223 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
12224 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
12225 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12226 	ALC668_FIXUP_HEADSET_MIC,
12227 	ALC668_FIXUP_MIC_DET_COEF,
12228 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
12229 	ALC897_FIXUP_HEADSET_MIC_PIN,
12230 	ALC897_FIXUP_HP_HSMIC_VERB,
12231 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
12232 	ALC897_FIXUP_HEADSET_MIC_PIN2,
12233 	ALC897_FIXUP_UNIS_H3C_X500S,
12234 	ALC897_FIXUP_HEADSET_MIC_PIN3,
12235 };
12236 
12237 static const struct hda_fixup alc662_fixups[] = {
12238 	[ALC662_FIXUP_ASPIRE] = {
12239 		.type = HDA_FIXUP_PINS,
12240 		.v.pins = (const struct hda_pintbl[]) {
12241 			{ 0x15, 0x99130112 }, /* subwoofer */
12242 			{ }
12243 		}
12244 	},
12245 	[ALC662_FIXUP_LED_GPIO1] = {
12246 		.type = HDA_FIXUP_FUNC,
12247 		.v.func = alc662_fixup_led_gpio1,
12248 	},
12249 	[ALC662_FIXUP_IDEAPAD] = {
12250 		.type = HDA_FIXUP_PINS,
12251 		.v.pins = (const struct hda_pintbl[]) {
12252 			{ 0x17, 0x99130112 }, /* subwoofer */
12253 			{ }
12254 		},
12255 		.chained = true,
12256 		.chain_id = ALC662_FIXUP_LED_GPIO1,
12257 	},
12258 	[ALC272_FIXUP_MARIO] = {
12259 		.type = HDA_FIXUP_FUNC,
12260 		.v.func = alc272_fixup_mario,
12261 	},
12262 	[ALC662_FIXUP_CZC_ET26] = {
12263 		.type = HDA_FIXUP_PINS,
12264 		.v.pins = (const struct hda_pintbl[]) {
12265 			{0x12, 0x403cc000},
12266 			{0x14, 0x90170110}, /* speaker */
12267 			{0x15, 0x411111f0},
12268 			{0x16, 0x411111f0},
12269 			{0x18, 0x01a19030}, /* mic */
12270 			{0x19, 0x90a7013f}, /* int-mic */
12271 			{0x1a, 0x01014020},
12272 			{0x1b, 0x0121401f},
12273 			{0x1c, 0x411111f0},
12274 			{0x1d, 0x411111f0},
12275 			{0x1e, 0x40478e35},
12276 			{}
12277 		},
12278 		.chained = true,
12279 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12280 	},
12281 	[ALC662_FIXUP_CZC_P10T] = {
12282 		.type = HDA_FIXUP_VERBS,
12283 		.v.verbs = (const struct hda_verb[]) {
12284 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12285 			{}
12286 		}
12287 	},
12288 	[ALC662_FIXUP_SKU_IGNORE] = {
12289 		.type = HDA_FIXUP_FUNC,
12290 		.v.func = alc_fixup_sku_ignore,
12291 	},
12292 	[ALC662_FIXUP_HP_RP5800] = {
12293 		.type = HDA_FIXUP_PINS,
12294 		.v.pins = (const struct hda_pintbl[]) {
12295 			{ 0x14, 0x0221201f }, /* HP out */
12296 			{ }
12297 		},
12298 		.chained = true,
12299 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12300 	},
12301 	[ALC662_FIXUP_ASUS_MODE1] = {
12302 		.type = HDA_FIXUP_PINS,
12303 		.v.pins = (const struct hda_pintbl[]) {
12304 			{ 0x14, 0x99130110 }, /* speaker */
12305 			{ 0x18, 0x01a19c20 }, /* mic */
12306 			{ 0x19, 0x99a3092f }, /* int-mic */
12307 			{ 0x21, 0x0121401f }, /* HP out */
12308 			{ }
12309 		},
12310 		.chained = true,
12311 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12312 	},
12313 	[ALC662_FIXUP_ASUS_MODE2] = {
12314 		.type = HDA_FIXUP_PINS,
12315 		.v.pins = (const struct hda_pintbl[]) {
12316 			{ 0x14, 0x99130110 }, /* speaker */
12317 			{ 0x18, 0x01a19820 }, /* mic */
12318 			{ 0x19, 0x99a3092f }, /* int-mic */
12319 			{ 0x1b, 0x0121401f }, /* HP out */
12320 			{ }
12321 		},
12322 		.chained = true,
12323 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12324 	},
12325 	[ALC662_FIXUP_ASUS_MODE3] = {
12326 		.type = HDA_FIXUP_PINS,
12327 		.v.pins = (const struct hda_pintbl[]) {
12328 			{ 0x14, 0x99130110 }, /* speaker */
12329 			{ 0x15, 0x0121441f }, /* HP */
12330 			{ 0x18, 0x01a19840 }, /* mic */
12331 			{ 0x19, 0x99a3094f }, /* int-mic */
12332 			{ 0x21, 0x01211420 }, /* HP2 */
12333 			{ }
12334 		},
12335 		.chained = true,
12336 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12337 	},
12338 	[ALC662_FIXUP_ASUS_MODE4] = {
12339 		.type = HDA_FIXUP_PINS,
12340 		.v.pins = (const struct hda_pintbl[]) {
12341 			{ 0x14, 0x99130110 }, /* speaker */
12342 			{ 0x16, 0x99130111 }, /* speaker */
12343 			{ 0x18, 0x01a19840 }, /* mic */
12344 			{ 0x19, 0x99a3094f }, /* int-mic */
12345 			{ 0x21, 0x0121441f }, /* HP */
12346 			{ }
12347 		},
12348 		.chained = true,
12349 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12350 	},
12351 	[ALC662_FIXUP_ASUS_MODE5] = {
12352 		.type = HDA_FIXUP_PINS,
12353 		.v.pins = (const struct hda_pintbl[]) {
12354 			{ 0x14, 0x99130110 }, /* speaker */
12355 			{ 0x15, 0x0121441f }, /* HP */
12356 			{ 0x16, 0x99130111 }, /* speaker */
12357 			{ 0x18, 0x01a19840 }, /* mic */
12358 			{ 0x19, 0x99a3094f }, /* int-mic */
12359 			{ }
12360 		},
12361 		.chained = true,
12362 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12363 	},
12364 	[ALC662_FIXUP_ASUS_MODE6] = {
12365 		.type = HDA_FIXUP_PINS,
12366 		.v.pins = (const struct hda_pintbl[]) {
12367 			{ 0x14, 0x99130110 }, /* speaker */
12368 			{ 0x15, 0x01211420 }, /* HP2 */
12369 			{ 0x18, 0x01a19840 }, /* mic */
12370 			{ 0x19, 0x99a3094f }, /* int-mic */
12371 			{ 0x1b, 0x0121441f }, /* HP */
12372 			{ }
12373 		},
12374 		.chained = true,
12375 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12376 	},
12377 	[ALC662_FIXUP_ASUS_MODE7] = {
12378 		.type = HDA_FIXUP_PINS,
12379 		.v.pins = (const struct hda_pintbl[]) {
12380 			{ 0x14, 0x99130110 }, /* speaker */
12381 			{ 0x17, 0x99130111 }, /* speaker */
12382 			{ 0x18, 0x01a19840 }, /* mic */
12383 			{ 0x19, 0x99a3094f }, /* int-mic */
12384 			{ 0x1b, 0x01214020 }, /* HP */
12385 			{ 0x21, 0x0121401f }, /* HP */
12386 			{ }
12387 		},
12388 		.chained = true,
12389 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12390 	},
12391 	[ALC662_FIXUP_ASUS_MODE8] = {
12392 		.type = HDA_FIXUP_PINS,
12393 		.v.pins = (const struct hda_pintbl[]) {
12394 			{ 0x14, 0x99130110 }, /* speaker */
12395 			{ 0x12, 0x99a30970 }, /* int-mic */
12396 			{ 0x15, 0x01214020 }, /* HP */
12397 			{ 0x17, 0x99130111 }, /* speaker */
12398 			{ 0x18, 0x01a19840 }, /* mic */
12399 			{ 0x21, 0x0121401f }, /* HP */
12400 			{ }
12401 		},
12402 		.chained = true,
12403 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12404 	},
12405 	[ALC662_FIXUP_NO_JACK_DETECT] = {
12406 		.type = HDA_FIXUP_FUNC,
12407 		.v.func = alc_fixup_no_jack_detect,
12408 	},
12409 	[ALC662_FIXUP_ZOTAC_Z68] = {
12410 		.type = HDA_FIXUP_PINS,
12411 		.v.pins = (const struct hda_pintbl[]) {
12412 			{ 0x1b, 0x02214020 }, /* Front HP */
12413 			{ }
12414 		}
12415 	},
12416 	[ALC662_FIXUP_INV_DMIC] = {
12417 		.type = HDA_FIXUP_FUNC,
12418 		.v.func = alc_fixup_inv_dmic,
12419 	},
12420 	[ALC668_FIXUP_DELL_XPS13] = {
12421 		.type = HDA_FIXUP_FUNC,
12422 		.v.func = alc_fixup_dell_xps13,
12423 		.chained = true,
12424 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
12425 	},
12426 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
12427 		.type = HDA_FIXUP_FUNC,
12428 		.v.func = alc_fixup_disable_aamix,
12429 		.chained = true,
12430 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12431 	},
12432 	[ALC668_FIXUP_AUTO_MUTE] = {
12433 		.type = HDA_FIXUP_FUNC,
12434 		.v.func = alc_fixup_auto_mute_via_amp,
12435 		.chained = true,
12436 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12437 	},
12438 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12439 		.type = HDA_FIXUP_PINS,
12440 		.v.pins = (const struct hda_pintbl[]) {
12441 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12442 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12443 			{ }
12444 		},
12445 		.chained = true,
12446 		.chain_id = ALC662_FIXUP_HEADSET_MODE
12447 	},
12448 	[ALC662_FIXUP_HEADSET_MODE] = {
12449 		.type = HDA_FIXUP_FUNC,
12450 		.v.func = alc_fixup_headset_mode_alc662,
12451 	},
12452 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12453 		.type = HDA_FIXUP_PINS,
12454 		.v.pins = (const struct hda_pintbl[]) {
12455 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12456 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12457 			{ }
12458 		},
12459 		.chained = true,
12460 		.chain_id = ALC668_FIXUP_HEADSET_MODE
12461 	},
12462 	[ALC668_FIXUP_HEADSET_MODE] = {
12463 		.type = HDA_FIXUP_FUNC,
12464 		.v.func = alc_fixup_headset_mode_alc668,
12465 	},
12466 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12467 		.type = HDA_FIXUP_FUNC,
12468 		.v.func = alc_fixup_bass_chmap,
12469 		.chained = true,
12470 		.chain_id = ALC662_FIXUP_ASUS_MODE4
12471 	},
12472 	[ALC662_FIXUP_BASS_16] = {
12473 		.type = HDA_FIXUP_PINS,
12474 		.v.pins = (const struct hda_pintbl[]) {
12475 			{0x16, 0x80106111}, /* bass speaker */
12476 			{}
12477 		},
12478 		.chained = true,
12479 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12480 	},
12481 	[ALC662_FIXUP_BASS_1A] = {
12482 		.type = HDA_FIXUP_PINS,
12483 		.v.pins = (const struct hda_pintbl[]) {
12484 			{0x1a, 0x80106111}, /* bass speaker */
12485 			{}
12486 		},
12487 		.chained = true,
12488 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12489 	},
12490 	[ALC662_FIXUP_BASS_CHMAP] = {
12491 		.type = HDA_FIXUP_FUNC,
12492 		.v.func = alc_fixup_bass_chmap,
12493 	},
12494 	[ALC662_FIXUP_ASUS_Nx50] = {
12495 		.type = HDA_FIXUP_FUNC,
12496 		.v.func = alc_fixup_auto_mute_via_amp,
12497 		.chained = true,
12498 		.chain_id = ALC662_FIXUP_BASS_1A
12499 	},
12500 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12501 		.type = HDA_FIXUP_FUNC,
12502 		.v.func = alc_fixup_headset_mode_alc668,
12503 		.chain_id = ALC662_FIXUP_BASS_CHMAP
12504 	},
12505 	[ALC668_FIXUP_ASUS_Nx51] = {
12506 		.type = HDA_FIXUP_PINS,
12507 		.v.pins = (const struct hda_pintbl[]) {
12508 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12509 			{ 0x1a, 0x90170151 }, /* bass speaker */
12510 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12511 			{}
12512 		},
12513 		.chained = true,
12514 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12515 	},
12516 	[ALC668_FIXUP_MIC_COEF] = {
12517 		.type = HDA_FIXUP_VERBS,
12518 		.v.verbs = (const struct hda_verb[]) {
12519 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12520 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12521 			{}
12522 		},
12523 	},
12524 	[ALC668_FIXUP_ASUS_G751] = {
12525 		.type = HDA_FIXUP_PINS,
12526 		.v.pins = (const struct hda_pintbl[]) {
12527 			{ 0x16, 0x0421101f }, /* HP */
12528 			{}
12529 		},
12530 		.chained = true,
12531 		.chain_id = ALC668_FIXUP_MIC_COEF
12532 	},
12533 	[ALC891_FIXUP_HEADSET_MODE] = {
12534 		.type = HDA_FIXUP_FUNC,
12535 		.v.func = alc_fixup_headset_mode,
12536 	},
12537 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12538 		.type = HDA_FIXUP_PINS,
12539 		.v.pins = (const struct hda_pintbl[]) {
12540 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12541 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12542 			{ }
12543 		},
12544 		.chained = true,
12545 		.chain_id = ALC891_FIXUP_HEADSET_MODE
12546 	},
12547 	[ALC662_FIXUP_ACER_VERITON] = {
12548 		.type = HDA_FIXUP_PINS,
12549 		.v.pins = (const struct hda_pintbl[]) {
12550 			{ 0x15, 0x50170120 }, /* no internal speaker */
12551 			{ }
12552 		}
12553 	},
12554 	[ALC892_FIXUP_ASROCK_MOBO] = {
12555 		.type = HDA_FIXUP_PINS,
12556 		.v.pins = (const struct hda_pintbl[]) {
12557 			{ 0x15, 0x40f000f0 }, /* disabled */
12558 			{ 0x16, 0x40f000f0 }, /* disabled */
12559 			{ }
12560 		}
12561 	},
12562 	[ALC662_FIXUP_USI_FUNC] = {
12563 		.type = HDA_FIXUP_FUNC,
12564 		.v.func = alc662_fixup_usi_headset_mic,
12565 	},
12566 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
12567 		.type = HDA_FIXUP_PINS,
12568 		.v.pins = (const struct hda_pintbl[]) {
12569 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12570 			{ 0x18, 0x01a1903d },
12571 			{ }
12572 		},
12573 		.chained = true,
12574 		.chain_id = ALC662_FIXUP_USI_FUNC
12575 	},
12576 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12577 		.type = HDA_FIXUP_FUNC,
12578 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12579 	},
12580 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12581 		.type = HDA_FIXUP_FUNC,
12582 		.v.func = alc662_fixup_aspire_ethos_hp,
12583 	},
12584 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12585 		.type = HDA_FIXUP_PINS,
12586 		.v.pins = (const struct hda_pintbl[]) {
12587 			{ 0x15, 0x92130110 }, /* front speakers */
12588 			{ 0x18, 0x99130111 }, /* center/subwoofer */
12589 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
12590 			{ }
12591 		},
12592 		.chained = true,
12593 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12594 	},
12595 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
12596 		.type = HDA_FIXUP_FUNC,
12597 		.v.func = alc671_fixup_hp_headset_mic2,
12598 	},
12599 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12600 		.type = HDA_FIXUP_PINS,
12601 		.v.pins = (const struct hda_pintbl[]) {
12602 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12603 			{ }
12604 		},
12605 		.chained = true,
12606 		.chain_id = ALC662_FIXUP_USI_FUNC
12607 	},
12608 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12609 		.type = HDA_FIXUP_PINS,
12610 		.v.pins = (const struct hda_pintbl[]) {
12611 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12612 			{ 0x1b, 0x0221144f },
12613 			{ }
12614 		},
12615 		.chained = true,
12616 		.chain_id = ALC662_FIXUP_USI_FUNC
12617 	},
12618 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12619 		.type = HDA_FIXUP_PINS,
12620 		.v.pins = (const struct hda_pintbl[]) {
12621 			{ 0x1b, 0x04a1112c },
12622 			{ }
12623 		},
12624 		.chained = true,
12625 		.chain_id = ALC668_FIXUP_HEADSET_MIC
12626 	},
12627 	[ALC668_FIXUP_HEADSET_MIC] = {
12628 		.type = HDA_FIXUP_FUNC,
12629 		.v.func = alc269_fixup_headset_mic,
12630 		.chained = true,
12631 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
12632 	},
12633 	[ALC668_FIXUP_MIC_DET_COEF] = {
12634 		.type = HDA_FIXUP_VERBS,
12635 		.v.verbs = (const struct hda_verb[]) {
12636 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12637 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12638 			{}
12639 		},
12640 	},
12641 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12642 		.type = HDA_FIXUP_FUNC,
12643 		.v.func = alc897_fixup_lenovo_headset_mic,
12644 	},
12645 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
12646 		.type = HDA_FIXUP_PINS,
12647 		.v.pins = (const struct hda_pintbl[]) {
12648 			{ 0x1a, 0x03a11050 },
12649 			{ }
12650 		},
12651 		.chained = true,
12652 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12653 	},
12654 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
12655 		.type = HDA_FIXUP_PINS,
12656 		.v.pins = (const struct hda_pintbl[]) {
12657 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12658 			{ }
12659 		},
12660 	},
12661 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12662 		.type = HDA_FIXUP_FUNC,
12663 		.v.func = alc897_fixup_lenovo_headset_mode,
12664 	},
12665 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12666 		.type = HDA_FIXUP_PINS,
12667 		.v.pins = (const struct hda_pintbl[]) {
12668 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12669 			{ }
12670 		},
12671 		.chained = true,
12672 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12673 	},
12674 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
12675 		.type = HDA_FIXUP_VERBS,
12676 		.v.verbs = (const struct hda_verb[]) {
12677 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12678 			{}
12679 		},
12680 	},
12681 	[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12682 		.type = HDA_FIXUP_PINS,
12683 		.v.pins = (const struct hda_pintbl[]) {
12684 			{ 0x19, 0x03a11050 }, /* use as headset mic */
12685 			{ }
12686 		},
12687 	},
12688 };
12689 
12690 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
12691 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12692 	SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12693 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12694 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12695 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12696 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12697 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12698 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12699 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12700 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12701 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12702 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12703 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12704 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12705 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12706 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12707 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12708 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12709 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12710 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12711 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12712 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12713 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12714 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12715 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12716 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12717 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12718 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12719 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12720 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12721 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12722 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12723 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12724 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12725 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12726 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12727 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12728 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12729 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12730 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12731 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12732 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12733 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12734 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12735 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12736 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12737 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12738 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12739 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12740 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12741 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12742 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12743 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12744 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12745 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12746 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12747 	SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12748 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12749 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12750 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12751 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12752 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12753 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12754 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12755 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12756 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12757 
12758 #if 0
12759 	/* Below is a quirk table taken from the old code.
12760 	 * Basically the device should work as is without the fixup table.
12761 	 * If BIOS doesn't give a proper info, enable the corresponding
12762 	 * fixup entry.
12763 	 */
12764 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12765 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12766 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12767 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12768 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12769 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12770 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12771 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12772 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12773 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12774 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12775 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12776 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12777 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12778 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12779 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12780 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12781 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12782 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12783 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12784 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12785 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12786 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12787 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12788 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12789 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12790 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12791 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12792 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12793 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12794 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12795 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12796 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12797 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12798 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12799 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12800 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12801 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12802 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12803 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12804 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12805 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12806 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12807 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12808 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12809 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12810 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12811 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12812 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12813 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12814 #endif
12815 	{}
12816 };
12817 
12818 static const struct hda_model_fixup alc662_fixup_models[] = {
12819 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12820 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12821 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
12822 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12823 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12824 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12825 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12826 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12827 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12828 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12829 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12830 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12831 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12832 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12833 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12834 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12835 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12836 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12837 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12838 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12839 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12840 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12841 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12842 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12843 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12844 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12845 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12846 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12847 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12848 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12849 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12850 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12851 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12852 	{}
12853 };
12854 
12855 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12856 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12857 		{0x17, 0x02211010},
12858 		{0x18, 0x01a19030},
12859 		{0x1a, 0x01813040},
12860 		{0x21, 0x01014020}),
12861 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12862 		{0x16, 0x01813030},
12863 		{0x17, 0x02211010},
12864 		{0x18, 0x01a19040},
12865 		{0x21, 0x01014020}),
12866 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12867 		{0x14, 0x01014010},
12868 		{0x18, 0x01a19020},
12869 		{0x1a, 0x0181302f},
12870 		{0x1b, 0x0221401f}),
12871 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12872 		{0x12, 0x99a30130},
12873 		{0x14, 0x90170110},
12874 		{0x15, 0x0321101f},
12875 		{0x16, 0x03011020}),
12876 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12877 		{0x12, 0x99a30140},
12878 		{0x14, 0x90170110},
12879 		{0x15, 0x0321101f},
12880 		{0x16, 0x03011020}),
12881 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12882 		{0x12, 0x99a30150},
12883 		{0x14, 0x90170110},
12884 		{0x15, 0x0321101f},
12885 		{0x16, 0x03011020}),
12886 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12887 		{0x14, 0x90170110},
12888 		{0x15, 0x0321101f},
12889 		{0x16, 0x03011020}),
12890 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12891 		{0x12, 0x90a60130},
12892 		{0x14, 0x90170110},
12893 		{0x15, 0x0321101f}),
12894 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12895 		{0x14, 0x01014010},
12896 		{0x17, 0x90170150},
12897 		{0x19, 0x02a11060},
12898 		{0x1b, 0x01813030},
12899 		{0x21, 0x02211020}),
12900 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12901 		{0x14, 0x01014010},
12902 		{0x18, 0x01a19040},
12903 		{0x1b, 0x01813030},
12904 		{0x21, 0x02211020}),
12905 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12906 		{0x14, 0x01014020},
12907 		{0x17, 0x90170110},
12908 		{0x18, 0x01a19050},
12909 		{0x1b, 0x01813040},
12910 		{0x21, 0x02211030}),
12911 	{}
12912 };
12913 
12914 /*
12915  */
12916 static int patch_alc662(struct hda_codec *codec)
12917 {
12918 	struct alc_spec *spec;
12919 	int err;
12920 
12921 	err = alc_alloc_spec(codec, 0x0b);
12922 	if (err < 0)
12923 		return err;
12924 
12925 	spec = codec->spec;
12926 
12927 	spec->shutup = alc_eapd_shutup;
12928 
12929 	/* handle multiple HPs as is */
12930 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12931 
12932 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
12933 
12934 	switch (codec->core.vendor_id) {
12935 	case 0x10ec0668:
12936 		spec->init_hook = alc668_restore_default_value;
12937 		break;
12938 	}
12939 
12940 	alc_pre_init(codec);
12941 
12942 	snd_hda_pick_fixup(codec, alc662_fixup_models,
12943 		       alc662_fixup_tbl, alc662_fixups);
12944 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
12945 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12946 
12947 	alc_auto_parse_customize_define(codec);
12948 
12949 	if (has_cdefine_beep(codec))
12950 		spec->gen.beep_nid = 0x01;
12951 
12952 	if ((alc_get_coef0(codec) & (1 << 14)) &&
12953 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
12954 	    spec->cdefine.platform_type == 1) {
12955 		err = alc_codec_rename(codec, "ALC272X");
12956 		if (err < 0)
12957 			goto error;
12958 	}
12959 
12960 	/* automatic parse from the BIOS config */
12961 	err = alc662_parse_auto_config(codec);
12962 	if (err < 0)
12963 		goto error;
12964 
12965 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
12966 		switch (codec->core.vendor_id) {
12967 		case 0x10ec0662:
12968 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12969 			break;
12970 		case 0x10ec0272:
12971 		case 0x10ec0663:
12972 		case 0x10ec0665:
12973 		case 0x10ec0668:
12974 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
12975 			break;
12976 		case 0x10ec0273:
12977 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
12978 			break;
12979 		}
12980 		if (err < 0)
12981 			goto error;
12982 	}
12983 
12984 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12985 
12986 	return 0;
12987 
12988  error:
12989 	alc_free(codec);
12990 	return err;
12991 }
12992 
12993 /*
12994  * ALC680 support
12995  */
12996 
12997 static int alc680_parse_auto_config(struct hda_codec *codec)
12998 {
12999 	return alc_parse_auto_config(codec, NULL, NULL);
13000 }
13001 
13002 /*
13003  */
13004 static int patch_alc680(struct hda_codec *codec)
13005 {
13006 	int err;
13007 
13008 	/* ALC680 has no aa-loopback mixer */
13009 	err = alc_alloc_spec(codec, 0);
13010 	if (err < 0)
13011 		return err;
13012 
13013 	/* automatic parse from the BIOS config */
13014 	err = alc680_parse_auto_config(codec);
13015 	if (err < 0) {
13016 		alc_free(codec);
13017 		return err;
13018 	}
13019 
13020 	return 0;
13021 }
13022 
13023 /*
13024  * patch entries
13025  */
13026 static const struct hda_device_id snd_hda_id_realtek[] = {
13027 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
13028 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
13029 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
13030 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
13031 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
13032 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
13033 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
13034 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
13035 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
13036 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
13037 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
13038 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
13039 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
13040 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
13041 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
13042 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
13043 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
13044 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
13045 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
13046 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
13047 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
13048 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
13049 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
13050 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
13051 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
13052 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
13053 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
13054 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
13055 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
13056 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
13057 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
13058 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
13059 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
13060 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
13061 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
13062 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
13063 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
13064 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
13065 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
13066 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
13067 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
13068 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
13069 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
13070 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
13071 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
13072 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
13073 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
13074 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
13075 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
13076 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
13077 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
13078 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
13079 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
13080 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
13081 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
13082 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
13083 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
13084 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
13085 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
13086 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
13087 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
13088 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
13089 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
13090 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
13091 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
13092 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
13093 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
13094 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
13095 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
13096 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
13097 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
13098 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
13099 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
13100 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
13101 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
13102 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
13103 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
13104 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
13105 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
13106 	{} /* terminator */
13107 };
13108 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
13109 
13110 MODULE_LICENSE("GPL");
13111 MODULE_DESCRIPTION("Realtek HD-audio codec");
13112 MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT);
13113 
13114 static struct hda_codec_driver realtek_driver = {
13115 	.id = snd_hda_id_realtek,
13116 };
13117 
13118 module_hda_codec_driver(realtek_driver);
13119