xref: /openbmc/linux/sound/pci/hda/patch_realtek.c (revision 9134211f)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Universal Interface for Intel High Definition Audio Codec
4  *
5  * HD audio interface patch for Realtek ALC codecs
6  *
7  * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8  *                    PeiSen Hou <pshou@realtek.com.tw>
9  *                    Takashi Iwai <tiwai@suse.de>
10  *                    Jonathan Woithe <jwoithe@just42.net>
11  */
12 
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <linux/ctype.h>
22 #include <sound/core.h>
23 #include <sound/jack.h>
24 #include <sound/hda_codec.h>
25 #include "hda_local.h"
26 #include "hda_auto_parser.h"
27 #include "hda_jack.h"
28 #include "hda_generic.h"
29 #include "hda_component.h"
30 
31 /* keep halting ALC5505 DSP, for power saving */
32 #define HALT_REALTEK_ALC5505
33 
34 /* extra amp-initialization sequence types */
35 enum {
36 	ALC_INIT_UNDEFINED,
37 	ALC_INIT_NONE,
38 	ALC_INIT_DEFAULT,
39 };
40 
41 enum {
42 	ALC_HEADSET_MODE_UNKNOWN,
43 	ALC_HEADSET_MODE_UNPLUGGED,
44 	ALC_HEADSET_MODE_HEADSET,
45 	ALC_HEADSET_MODE_MIC,
46 	ALC_HEADSET_MODE_HEADPHONE,
47 };
48 
49 enum {
50 	ALC_HEADSET_TYPE_UNKNOWN,
51 	ALC_HEADSET_TYPE_CTIA,
52 	ALC_HEADSET_TYPE_OMTP,
53 };
54 
55 enum {
56 	ALC_KEY_MICMUTE_INDEX,
57 };
58 
59 struct alc_customize_define {
60 	unsigned int  sku_cfg;
61 	unsigned char port_connectivity;
62 	unsigned char check_sum;
63 	unsigned char customization;
64 	unsigned char external_amp;
65 	unsigned int  enable_pcbeep:1;
66 	unsigned int  platform_type:1;
67 	unsigned int  swap:1;
68 	unsigned int  override:1;
69 	unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
70 };
71 
72 struct alc_coef_led {
73 	unsigned int idx;
74 	unsigned int mask;
75 	unsigned int on;
76 	unsigned int off;
77 };
78 
79 struct alc_spec {
80 	struct hda_gen_spec gen; /* must be at head */
81 
82 	/* codec parameterization */
83 	struct alc_customize_define cdefine;
84 	unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 
86 	/* GPIO bits */
87 	unsigned int gpio_mask;
88 	unsigned int gpio_dir;
89 	unsigned int gpio_data;
90 	bool gpio_write_delay;	/* add a delay before writing gpio_data */
91 
92 	/* mute LED for HP laptops, see vref_mute_led_set() */
93 	int mute_led_polarity;
94 	int micmute_led_polarity;
95 	hda_nid_t mute_led_nid;
96 	hda_nid_t cap_mute_led_nid;
97 
98 	unsigned int gpio_mute_led_mask;
99 	unsigned int gpio_mic_led_mask;
100 	struct alc_coef_led mute_led_coef;
101 	struct alc_coef_led mic_led_coef;
102 	struct mutex coef_mutex;
103 
104 	hda_nid_t headset_mic_pin;
105 	hda_nid_t headphone_mic_pin;
106 	int current_headset_mode;
107 	int current_headset_type;
108 
109 	/* hooks */
110 	void (*init_hook)(struct hda_codec *codec);
111 #ifdef CONFIG_PM
112 	void (*power_hook)(struct hda_codec *codec);
113 #endif
114 	void (*shutup)(struct hda_codec *codec);
115 
116 	int init_amp;
117 	int codec_variant;	/* flag for other variants */
118 	unsigned int has_alc5505_dsp:1;
119 	unsigned int no_depop_delay:1;
120 	unsigned int done_hp_init:1;
121 	unsigned int no_shutup_pins:1;
122 	unsigned int ultra_low_power:1;
123 	unsigned int has_hs_key:1;
124 	unsigned int no_internal_mic_pin:1;
125 
126 	/* for PLL fix */
127 	hda_nid_t pll_nid;
128 	unsigned int pll_coef_idx, pll_coef_bit;
129 	unsigned int coef0;
130 	struct input_dev *kb_dev;
131 	u8 alc_mute_keycode_map[1];
132 
133 	/* component binding */
134 	struct component_match *match;
135 	struct hda_component comps[HDA_MAX_COMPONENTS];
136 };
137 
138 /*
139  * COEF access helper functions
140  */
141 
142 static void coef_mutex_lock(struct hda_codec *codec)
143 {
144 	struct alc_spec *spec = codec->spec;
145 
146 	snd_hda_power_up_pm(codec);
147 	mutex_lock(&spec->coef_mutex);
148 }
149 
150 static void coef_mutex_unlock(struct hda_codec *codec)
151 {
152 	struct alc_spec *spec = codec->spec;
153 
154 	mutex_unlock(&spec->coef_mutex);
155 	snd_hda_power_down_pm(codec);
156 }
157 
158 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
159 				 unsigned int coef_idx)
160 {
161 	unsigned int val;
162 
163 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
164 	val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
165 	return val;
166 }
167 
168 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
169 			       unsigned int coef_idx)
170 {
171 	unsigned int val;
172 
173 	coef_mutex_lock(codec);
174 	val = __alc_read_coefex_idx(codec, nid, coef_idx);
175 	coef_mutex_unlock(codec);
176 	return val;
177 }
178 
179 #define alc_read_coef_idx(codec, coef_idx) \
180 	alc_read_coefex_idx(codec, 0x20, coef_idx)
181 
182 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
183 				   unsigned int coef_idx, unsigned int coef_val)
184 {
185 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
186 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
187 }
188 
189 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
190 				 unsigned int coef_idx, unsigned int coef_val)
191 {
192 	coef_mutex_lock(codec);
193 	__alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
194 	coef_mutex_unlock(codec);
195 }
196 
197 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
198 	alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
199 
200 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
201 				    unsigned int coef_idx, unsigned int mask,
202 				    unsigned int bits_set)
203 {
204 	unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
205 
206 	if (val != -1)
207 		__alc_write_coefex_idx(codec, nid, coef_idx,
208 				       (val & ~mask) | bits_set);
209 }
210 
211 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
212 				  unsigned int coef_idx, unsigned int mask,
213 				  unsigned int bits_set)
214 {
215 	coef_mutex_lock(codec);
216 	__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
217 	coef_mutex_unlock(codec);
218 }
219 
220 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set)	\
221 	alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
222 
223 /* a special bypass for COEF 0; read the cached value at the second time */
224 static unsigned int alc_get_coef0(struct hda_codec *codec)
225 {
226 	struct alc_spec *spec = codec->spec;
227 
228 	if (!spec->coef0)
229 		spec->coef0 = alc_read_coef_idx(codec, 0);
230 	return spec->coef0;
231 }
232 
233 /* coef writes/updates batch */
234 struct coef_fw {
235 	unsigned char nid;
236 	unsigned char idx;
237 	unsigned short mask;
238 	unsigned short val;
239 };
240 
241 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
242 	{ .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
243 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
244 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
245 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
246 
247 static void alc_process_coef_fw(struct hda_codec *codec,
248 				const struct coef_fw *fw)
249 {
250 	coef_mutex_lock(codec);
251 	for (; fw->nid; fw++) {
252 		if (fw->mask == (unsigned short)-1)
253 			__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
254 		else
255 			__alc_update_coefex_idx(codec, fw->nid, fw->idx,
256 						fw->mask, fw->val);
257 	}
258 	coef_mutex_unlock(codec);
259 }
260 
261 /*
262  * GPIO setup tables, used in initialization
263  */
264 
265 /* Enable GPIO mask and set output */
266 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
267 {
268 	struct alc_spec *spec = codec->spec;
269 
270 	spec->gpio_mask |= mask;
271 	spec->gpio_dir |= mask;
272 	spec->gpio_data |= mask;
273 }
274 
275 static void alc_write_gpio_data(struct hda_codec *codec)
276 {
277 	struct alc_spec *spec = codec->spec;
278 
279 	snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
280 			    spec->gpio_data);
281 }
282 
283 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
284 				 bool on)
285 {
286 	struct alc_spec *spec = codec->spec;
287 	unsigned int oldval = spec->gpio_data;
288 
289 	if (on)
290 		spec->gpio_data |= mask;
291 	else
292 		spec->gpio_data &= ~mask;
293 	if (oldval != spec->gpio_data)
294 		alc_write_gpio_data(codec);
295 }
296 
297 static void alc_write_gpio(struct hda_codec *codec)
298 {
299 	struct alc_spec *spec = codec->spec;
300 
301 	if (!spec->gpio_mask)
302 		return;
303 
304 	snd_hda_codec_write(codec, codec->core.afg, 0,
305 			    AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
306 	snd_hda_codec_write(codec, codec->core.afg, 0,
307 			    AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
308 	if (spec->gpio_write_delay)
309 		msleep(1);
310 	alc_write_gpio_data(codec);
311 }
312 
313 static void alc_fixup_gpio(struct hda_codec *codec, int action,
314 			   unsigned int mask)
315 {
316 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
317 		alc_setup_gpio(codec, mask);
318 }
319 
320 static void alc_fixup_gpio1(struct hda_codec *codec,
321 			    const struct hda_fixup *fix, int action)
322 {
323 	alc_fixup_gpio(codec, action, 0x01);
324 }
325 
326 static void alc_fixup_gpio2(struct hda_codec *codec,
327 			    const struct hda_fixup *fix, int action)
328 {
329 	alc_fixup_gpio(codec, action, 0x02);
330 }
331 
332 static void alc_fixup_gpio3(struct hda_codec *codec,
333 			    const struct hda_fixup *fix, int action)
334 {
335 	alc_fixup_gpio(codec, action, 0x03);
336 }
337 
338 static void alc_fixup_gpio4(struct hda_codec *codec,
339 			    const struct hda_fixup *fix, int action)
340 {
341 	alc_fixup_gpio(codec, action, 0x04);
342 }
343 
344 static void alc_fixup_micmute_led(struct hda_codec *codec,
345 				  const struct hda_fixup *fix, int action)
346 {
347 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
348 		snd_hda_gen_add_micmute_led_cdev(codec, NULL);
349 }
350 
351 /*
352  * Fix hardware PLL issue
353  * On some codecs, the analog PLL gating control must be off while
354  * the default value is 1.
355  */
356 static void alc_fix_pll(struct hda_codec *codec)
357 {
358 	struct alc_spec *spec = codec->spec;
359 
360 	if (spec->pll_nid)
361 		alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
362 				      1 << spec->pll_coef_bit, 0);
363 }
364 
365 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
366 			     unsigned int coef_idx, unsigned int coef_bit)
367 {
368 	struct alc_spec *spec = codec->spec;
369 	spec->pll_nid = nid;
370 	spec->pll_coef_idx = coef_idx;
371 	spec->pll_coef_bit = coef_bit;
372 	alc_fix_pll(codec);
373 }
374 
375 /* update the master volume per volume-knob's unsol event */
376 static void alc_update_knob_master(struct hda_codec *codec,
377 				   struct hda_jack_callback *jack)
378 {
379 	unsigned int val;
380 	struct snd_kcontrol *kctl;
381 	struct snd_ctl_elem_value *uctl;
382 
383 	kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
384 	if (!kctl)
385 		return;
386 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
387 	if (!uctl)
388 		return;
389 	val = snd_hda_codec_read(codec, jack->nid, 0,
390 				 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
391 	val &= HDA_AMP_VOLMASK;
392 	uctl->value.integer.value[0] = val;
393 	uctl->value.integer.value[1] = val;
394 	kctl->put(kctl, uctl);
395 	kfree(uctl);
396 }
397 
398 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
399 {
400 	/* For some reason, the res given from ALC880 is broken.
401 	   Here we adjust it properly. */
402 	snd_hda_jack_unsol_event(codec, res >> 2);
403 }
404 
405 /* Change EAPD to verb control */
406 static void alc_fill_eapd_coef(struct hda_codec *codec)
407 {
408 	int coef;
409 
410 	coef = alc_get_coef0(codec);
411 
412 	switch (codec->core.vendor_id) {
413 	case 0x10ec0262:
414 		alc_update_coef_idx(codec, 0x7, 0, 1<<5);
415 		break;
416 	case 0x10ec0267:
417 	case 0x10ec0268:
418 		alc_update_coef_idx(codec, 0x7, 0, 1<<13);
419 		break;
420 	case 0x10ec0269:
421 		if ((coef & 0x00f0) == 0x0010)
422 			alc_update_coef_idx(codec, 0xd, 0, 1<<14);
423 		if ((coef & 0x00f0) == 0x0020)
424 			alc_update_coef_idx(codec, 0x4, 1<<15, 0);
425 		if ((coef & 0x00f0) == 0x0030)
426 			alc_update_coef_idx(codec, 0x10, 1<<9, 0);
427 		break;
428 	case 0x10ec0280:
429 	case 0x10ec0284:
430 	case 0x10ec0290:
431 	case 0x10ec0292:
432 		alc_update_coef_idx(codec, 0x4, 1<<15, 0);
433 		break;
434 	case 0x10ec0225:
435 	case 0x10ec0295:
436 	case 0x10ec0299:
437 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
438 		fallthrough;
439 	case 0x10ec0215:
440 	case 0x10ec0230:
441 	case 0x10ec0233:
442 	case 0x10ec0235:
443 	case 0x10ec0236:
444 	case 0x10ec0245:
445 	case 0x10ec0255:
446 	case 0x10ec0256:
447 	case 0x19e58326:
448 	case 0x10ec0257:
449 	case 0x10ec0282:
450 	case 0x10ec0283:
451 	case 0x10ec0286:
452 	case 0x10ec0288:
453 	case 0x10ec0285:
454 	case 0x10ec0298:
455 	case 0x10ec0289:
456 	case 0x10ec0300:
457 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
458 		break;
459 	case 0x10ec0275:
460 		alc_update_coef_idx(codec, 0xe, 0, 1<<0);
461 		break;
462 	case 0x10ec0287:
463 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
464 		alc_write_coef_idx(codec, 0x8, 0x4ab7);
465 		break;
466 	case 0x10ec0293:
467 		alc_update_coef_idx(codec, 0xa, 1<<13, 0);
468 		break;
469 	case 0x10ec0234:
470 	case 0x10ec0274:
471 	case 0x10ec0294:
472 	case 0x10ec0700:
473 	case 0x10ec0701:
474 	case 0x10ec0703:
475 	case 0x10ec0711:
476 		alc_update_coef_idx(codec, 0x10, 1<<15, 0);
477 		break;
478 	case 0x10ec0662:
479 		if ((coef & 0x00f0) == 0x0030)
480 			alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
481 		break;
482 	case 0x10ec0272:
483 	case 0x10ec0273:
484 	case 0x10ec0663:
485 	case 0x10ec0665:
486 	case 0x10ec0670:
487 	case 0x10ec0671:
488 	case 0x10ec0672:
489 		alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
490 		break;
491 	case 0x10ec0222:
492 	case 0x10ec0623:
493 		alc_update_coef_idx(codec, 0x19, 1<<13, 0);
494 		break;
495 	case 0x10ec0668:
496 		alc_update_coef_idx(codec, 0x7, 3<<13, 0);
497 		break;
498 	case 0x10ec0867:
499 		alc_update_coef_idx(codec, 0x4, 1<<10, 0);
500 		break;
501 	case 0x10ec0888:
502 		if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
503 			alc_update_coef_idx(codec, 0x7, 1<<5, 0);
504 		break;
505 	case 0x10ec0892:
506 	case 0x10ec0897:
507 		alc_update_coef_idx(codec, 0x7, 1<<5, 0);
508 		break;
509 	case 0x10ec0899:
510 	case 0x10ec0900:
511 	case 0x10ec0b00:
512 	case 0x10ec1168:
513 	case 0x10ec1220:
514 		alc_update_coef_idx(codec, 0x7, 1<<1, 0);
515 		break;
516 	}
517 }
518 
519 /* additional initialization for ALC888 variants */
520 static void alc888_coef_init(struct hda_codec *codec)
521 {
522 	switch (alc_get_coef0(codec) & 0x00f0) {
523 	/* alc888-VA */
524 	case 0x00:
525 	/* alc888-VB */
526 	case 0x10:
527 		alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
528 		break;
529 	}
530 }
531 
532 /* turn on/off EAPD control (only if available) */
533 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
534 {
535 	if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
536 		return;
537 	if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
538 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
539 				    on ? 2 : 0);
540 }
541 
542 /* turn on/off EAPD controls of the codec */
543 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
544 {
545 	/* We currently only handle front, HP */
546 	static const hda_nid_t pins[] = {
547 		0x0f, 0x10, 0x14, 0x15, 0x17, 0
548 	};
549 	const hda_nid_t *p;
550 	for (p = pins; *p; p++)
551 		set_eapd(codec, *p, on);
552 }
553 
554 static int find_ext_mic_pin(struct hda_codec *codec);
555 
556 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
557 {
558 	const struct hda_pincfg *pin;
559 	int mic_pin = find_ext_mic_pin(codec);
560 	int i;
561 
562 	/* don't shut up pins when unloading the driver; otherwise it breaks
563 	 * the default pin setup at the next load of the driver
564 	 */
565 	if (codec->bus->shutdown)
566 		return;
567 
568 	snd_array_for_each(&codec->init_pins, i, pin) {
569 		/* use read here for syncing after issuing each verb */
570 		if (pin->nid != mic_pin)
571 			snd_hda_codec_read(codec, pin->nid, 0,
572 					AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
573 	}
574 
575 	codec->pins_shutup = 1;
576 }
577 
578 static void alc_shutup_pins(struct hda_codec *codec)
579 {
580 	struct alc_spec *spec = codec->spec;
581 
582 	switch (codec->core.vendor_id) {
583 	case 0x10ec0236:
584 	case 0x10ec0256:
585 	case 0x19e58326:
586 	case 0x10ec0283:
587 	case 0x10ec0286:
588 	case 0x10ec0288:
589 	case 0x10ec0298:
590 		alc_headset_mic_no_shutup(codec);
591 		break;
592 	default:
593 		if (!spec->no_shutup_pins)
594 			snd_hda_shutup_pins(codec);
595 		break;
596 	}
597 }
598 
599 /* generic shutup callback;
600  * just turning off EAPD and a little pause for avoiding pop-noise
601  */
602 static void alc_eapd_shutup(struct hda_codec *codec)
603 {
604 	struct alc_spec *spec = codec->spec;
605 
606 	alc_auto_setup_eapd(codec, false);
607 	if (!spec->no_depop_delay)
608 		msleep(200);
609 	alc_shutup_pins(codec);
610 }
611 
612 /* generic EAPD initialization */
613 static void alc_auto_init_amp(struct hda_codec *codec, int type)
614 {
615 	alc_auto_setup_eapd(codec, true);
616 	alc_write_gpio(codec);
617 	switch (type) {
618 	case ALC_INIT_DEFAULT:
619 		switch (codec->core.vendor_id) {
620 		case 0x10ec0260:
621 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
622 			break;
623 		case 0x10ec0880:
624 		case 0x10ec0882:
625 		case 0x10ec0883:
626 		case 0x10ec0885:
627 			alc_update_coef_idx(codec, 7, 0, 0x2030);
628 			break;
629 		case 0x10ec0888:
630 			alc888_coef_init(codec);
631 			break;
632 		}
633 		break;
634 	}
635 }
636 
637 /* get a primary headphone pin if available */
638 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
639 {
640 	if (spec->gen.autocfg.hp_pins[0])
641 		return spec->gen.autocfg.hp_pins[0];
642 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
643 		return spec->gen.autocfg.line_out_pins[0];
644 	return 0;
645 }
646 
647 /*
648  * Realtek SSID verification
649  */
650 
651 /* Could be any non-zero and even value. When used as fixup, tells
652  * the driver to ignore any present sku defines.
653  */
654 #define ALC_FIXUP_SKU_IGNORE (2)
655 
656 static void alc_fixup_sku_ignore(struct hda_codec *codec,
657 				 const struct hda_fixup *fix, int action)
658 {
659 	struct alc_spec *spec = codec->spec;
660 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
661 		spec->cdefine.fixup = 1;
662 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
663 	}
664 }
665 
666 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
667 				    const struct hda_fixup *fix, int action)
668 {
669 	struct alc_spec *spec = codec->spec;
670 
671 	if (action == HDA_FIXUP_ACT_PROBE) {
672 		spec->no_depop_delay = 1;
673 		codec->depop_delay = 0;
674 	}
675 }
676 
677 static int alc_auto_parse_customize_define(struct hda_codec *codec)
678 {
679 	unsigned int ass, tmp, i;
680 	unsigned nid = 0;
681 	struct alc_spec *spec = codec->spec;
682 
683 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
684 
685 	if (spec->cdefine.fixup) {
686 		ass = spec->cdefine.sku_cfg;
687 		if (ass == ALC_FIXUP_SKU_IGNORE)
688 			return -1;
689 		goto do_sku;
690 	}
691 
692 	if (!codec->bus->pci)
693 		return -1;
694 	ass = codec->core.subsystem_id & 0xffff;
695 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
696 		goto do_sku;
697 
698 	nid = 0x1d;
699 	if (codec->core.vendor_id == 0x10ec0260)
700 		nid = 0x17;
701 	ass = snd_hda_codec_get_pincfg(codec, nid);
702 
703 	if (!(ass & 1)) {
704 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
705 			   codec->core.chip_name, ass);
706 		return -1;
707 	}
708 
709 	/* check sum */
710 	tmp = 0;
711 	for (i = 1; i < 16; i++) {
712 		if ((ass >> i) & 1)
713 			tmp++;
714 	}
715 	if (((ass >> 16) & 0xf) != tmp)
716 		return -1;
717 
718 	spec->cdefine.port_connectivity = ass >> 30;
719 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
720 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
721 	spec->cdefine.customization = ass >> 8;
722 do_sku:
723 	spec->cdefine.sku_cfg = ass;
724 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
725 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
726 	spec->cdefine.swap = (ass & 0x2) >> 1;
727 	spec->cdefine.override = ass & 0x1;
728 
729 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
730 		   nid, spec->cdefine.sku_cfg);
731 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
732 		   spec->cdefine.port_connectivity);
733 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
734 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
735 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
736 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
737 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
738 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
739 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
740 
741 	return 0;
742 }
743 
744 /* return the position of NID in the list, or -1 if not found */
745 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
746 {
747 	int i;
748 	for (i = 0; i < nums; i++)
749 		if (list[i] == nid)
750 			return i;
751 	return -1;
752 }
753 /* return true if the given NID is found in the list */
754 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
755 {
756 	return find_idx_in_nid_list(nid, list, nums) >= 0;
757 }
758 
759 /* check subsystem ID and set up device-specific initialization;
760  * return 1 if initialized, 0 if invalid SSID
761  */
762 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
763  *	31 ~ 16 :	Manufacture ID
764  *	15 ~ 8	:	SKU ID
765  *	7  ~ 0	:	Assembly ID
766  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
767  */
768 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
769 {
770 	unsigned int ass, tmp, i;
771 	unsigned nid;
772 	struct alc_spec *spec = codec->spec;
773 
774 	if (spec->cdefine.fixup) {
775 		ass = spec->cdefine.sku_cfg;
776 		if (ass == ALC_FIXUP_SKU_IGNORE)
777 			return 0;
778 		goto do_sku;
779 	}
780 
781 	ass = codec->core.subsystem_id & 0xffff;
782 	if (codec->bus->pci &&
783 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
784 		goto do_sku;
785 
786 	/* invalid SSID, check the special NID pin defcfg instead */
787 	/*
788 	 * 31~30	: port connectivity
789 	 * 29~21	: reserve
790 	 * 20		: PCBEEP input
791 	 * 19~16	: Check sum (15:1)
792 	 * 15~1		: Custom
793 	 * 0		: override
794 	*/
795 	nid = 0x1d;
796 	if (codec->core.vendor_id == 0x10ec0260)
797 		nid = 0x17;
798 	ass = snd_hda_codec_get_pincfg(codec, nid);
799 	codec_dbg(codec,
800 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
801 		   ass, nid);
802 	if (!(ass & 1))
803 		return 0;
804 	if ((ass >> 30) != 1)	/* no physical connection */
805 		return 0;
806 
807 	/* check sum */
808 	tmp = 0;
809 	for (i = 1; i < 16; i++) {
810 		if ((ass >> i) & 1)
811 			tmp++;
812 	}
813 	if (((ass >> 16) & 0xf) != tmp)
814 		return 0;
815 do_sku:
816 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
817 		   ass & 0xffff, codec->core.vendor_id);
818 	/*
819 	 * 0 : override
820 	 * 1 :	Swap Jack
821 	 * 2 : 0 --> Desktop, 1 --> Laptop
822 	 * 3~5 : External Amplifier control
823 	 * 7~6 : Reserved
824 	*/
825 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
826 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
827 		switch (tmp) {
828 		case 1:
829 			alc_setup_gpio(codec, 0x01);
830 			break;
831 		case 3:
832 			alc_setup_gpio(codec, 0x02);
833 			break;
834 		case 7:
835 			alc_setup_gpio(codec, 0x04);
836 			break;
837 		case 5:
838 		default:
839 			spec->init_amp = ALC_INIT_DEFAULT;
840 			break;
841 		}
842 	}
843 
844 	/* is laptop or Desktop and enable the function "Mute internal speaker
845 	 * when the external headphone out jack is plugged"
846 	 */
847 	if (!(ass & 0x8000))
848 		return 1;
849 	/*
850 	 * 10~8 : Jack location
851 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
852 	 * 14~13: Resvered
853 	 * 15   : 1 --> enable the function "Mute internal speaker
854 	 *	        when the external headphone out jack is plugged"
855 	 */
856 	if (!alc_get_hp_pin(spec)) {
857 		hda_nid_t nid;
858 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
859 		nid = ports[tmp];
860 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
861 				      spec->gen.autocfg.line_outs))
862 			return 1;
863 		spec->gen.autocfg.hp_pins[0] = nid;
864 	}
865 	return 1;
866 }
867 
868 /* Check the validity of ALC subsystem-id
869  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
870 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
871 {
872 	if (!alc_subsystem_id(codec, ports)) {
873 		struct alc_spec *spec = codec->spec;
874 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
875 			codec_dbg(codec,
876 				  "realtek: Enable default setup for auto mode as fallback\n");
877 			spec->init_amp = ALC_INIT_DEFAULT;
878 		}
879 	}
880 }
881 
882 /*
883  */
884 
885 static void alc_fixup_inv_dmic(struct hda_codec *codec,
886 			       const struct hda_fixup *fix, int action)
887 {
888 	struct alc_spec *spec = codec->spec;
889 
890 	spec->gen.inv_dmic_split = 1;
891 }
892 
893 
894 static int alc_build_controls(struct hda_codec *codec)
895 {
896 	int err;
897 
898 	err = snd_hda_gen_build_controls(codec);
899 	if (err < 0)
900 		return err;
901 
902 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
903 	return 0;
904 }
905 
906 
907 /*
908  * Common callbacks
909  */
910 
911 static void alc_pre_init(struct hda_codec *codec)
912 {
913 	alc_fill_eapd_coef(codec);
914 }
915 
916 #define is_s3_resume(codec) \
917 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
918 #define is_s4_resume(codec) \
919 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
920 
921 static int alc_init(struct hda_codec *codec)
922 {
923 	struct alc_spec *spec = codec->spec;
924 
925 	/* hibernation resume needs the full chip initialization */
926 	if (is_s4_resume(codec))
927 		alc_pre_init(codec);
928 
929 	if (spec->init_hook)
930 		spec->init_hook(codec);
931 
932 	spec->gen.skip_verbs = 1; /* applied in below */
933 	snd_hda_gen_init(codec);
934 	alc_fix_pll(codec);
935 	alc_auto_init_amp(codec, spec->init_amp);
936 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
937 
938 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
939 
940 	return 0;
941 }
942 
943 #define alc_free	snd_hda_gen_free
944 
945 #ifdef CONFIG_PM
946 static inline void alc_shutup(struct hda_codec *codec)
947 {
948 	struct alc_spec *spec = codec->spec;
949 
950 	if (!snd_hda_get_bool_hint(codec, "shutup"))
951 		return; /* disabled explicitly by hints */
952 
953 	if (spec && spec->shutup)
954 		spec->shutup(codec);
955 	else
956 		alc_shutup_pins(codec);
957 }
958 
959 static void alc_power_eapd(struct hda_codec *codec)
960 {
961 	alc_auto_setup_eapd(codec, false);
962 }
963 
964 static int alc_suspend(struct hda_codec *codec)
965 {
966 	struct alc_spec *spec = codec->spec;
967 	alc_shutup(codec);
968 	if (spec && spec->power_hook)
969 		spec->power_hook(codec);
970 	return 0;
971 }
972 
973 static int alc_resume(struct hda_codec *codec)
974 {
975 	struct alc_spec *spec = codec->spec;
976 
977 	if (!spec->no_depop_delay)
978 		msleep(150); /* to avoid pop noise */
979 	codec->patch_ops.init(codec);
980 	snd_hda_regmap_sync(codec);
981 	hda_call_check_power_status(codec, 0x01);
982 	return 0;
983 }
984 #endif
985 
986 /*
987  */
988 static const struct hda_codec_ops alc_patch_ops = {
989 	.build_controls = alc_build_controls,
990 	.build_pcms = snd_hda_gen_build_pcms,
991 	.init = alc_init,
992 	.free = alc_free,
993 	.unsol_event = snd_hda_jack_unsol_event,
994 #ifdef CONFIG_PM
995 	.resume = alc_resume,
996 	.suspend = alc_suspend,
997 	.check_power_status = snd_hda_gen_check_power_status,
998 #endif
999 };
1000 
1001 
1002 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1003 
1004 /*
1005  * Rename codecs appropriately from COEF value or subvendor id
1006  */
1007 struct alc_codec_rename_table {
1008 	unsigned int vendor_id;
1009 	unsigned short coef_mask;
1010 	unsigned short coef_bits;
1011 	const char *name;
1012 };
1013 
1014 struct alc_codec_rename_pci_table {
1015 	unsigned int codec_vendor_id;
1016 	unsigned short pci_subvendor;
1017 	unsigned short pci_subdevice;
1018 	const char *name;
1019 };
1020 
1021 static const struct alc_codec_rename_table rename_tbl[] = {
1022 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1023 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1024 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1025 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1026 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1027 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1028 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1029 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1030 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1031 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1032 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1033 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1034 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1035 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1036 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1037 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1038 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1039 	{ } /* terminator */
1040 };
1041 
1042 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1043 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1044 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1045 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1046 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1047 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1048 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1049 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1050 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1051 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1052 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1053 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1054 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1055 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1056 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1057 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1058 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1059 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1060 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1061 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1062 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1063 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1064 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1065 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1066 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1067 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1068 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1069 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1070 	{ } /* terminator */
1071 };
1072 
1073 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1074 {
1075 	const struct alc_codec_rename_table *p;
1076 	const struct alc_codec_rename_pci_table *q;
1077 
1078 	for (p = rename_tbl; p->vendor_id; p++) {
1079 		if (p->vendor_id != codec->core.vendor_id)
1080 			continue;
1081 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1082 			return alc_codec_rename(codec, p->name);
1083 	}
1084 
1085 	if (!codec->bus->pci)
1086 		return 0;
1087 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1088 		if (q->codec_vendor_id != codec->core.vendor_id)
1089 			continue;
1090 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1091 			continue;
1092 		if (!q->pci_subdevice ||
1093 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1094 			return alc_codec_rename(codec, q->name);
1095 	}
1096 
1097 	return 0;
1098 }
1099 
1100 
1101 /*
1102  * Digital-beep handlers
1103  */
1104 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1105 
1106 /* additional beep mixers; private_value will be overwritten */
1107 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1108 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1109 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1110 };
1111 
1112 /* set up and create beep controls */
1113 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1114 			int idx, int dir)
1115 {
1116 	struct snd_kcontrol_new *knew;
1117 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1118 	int i;
1119 
1120 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1121 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1122 					    &alc_beep_mixer[i]);
1123 		if (!knew)
1124 			return -ENOMEM;
1125 		knew->private_value = beep_amp;
1126 	}
1127 	return 0;
1128 }
1129 
1130 static const struct snd_pci_quirk beep_allow_list[] = {
1131 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1132 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1133 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1134 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1135 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1136 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1137 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1138 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1139 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1140 	/* denylist -- no beep available */
1141 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1142 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1143 	{}
1144 };
1145 
1146 static inline int has_cdefine_beep(struct hda_codec *codec)
1147 {
1148 	struct alc_spec *spec = codec->spec;
1149 	const struct snd_pci_quirk *q;
1150 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1151 	if (q)
1152 		return q->value;
1153 	return spec->cdefine.enable_pcbeep;
1154 }
1155 #else
1156 #define set_beep_amp(spec, nid, idx, dir)	0
1157 #define has_cdefine_beep(codec)		0
1158 #endif
1159 
1160 /* parse the BIOS configuration and set up the alc_spec */
1161 /* return 1 if successful, 0 if the proper config is not found,
1162  * or a negative error code
1163  */
1164 static int alc_parse_auto_config(struct hda_codec *codec,
1165 				 const hda_nid_t *ignore_nids,
1166 				 const hda_nid_t *ssid_nids)
1167 {
1168 	struct alc_spec *spec = codec->spec;
1169 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1170 	int err;
1171 
1172 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1173 				       spec->parse_flags);
1174 	if (err < 0)
1175 		return err;
1176 
1177 	if (ssid_nids)
1178 		alc_ssid_check(codec, ssid_nids);
1179 
1180 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1181 	if (err < 0)
1182 		return err;
1183 
1184 	return 1;
1185 }
1186 
1187 /* common preparation job for alc_spec */
1188 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1189 {
1190 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1191 	int err;
1192 
1193 	if (!spec)
1194 		return -ENOMEM;
1195 	codec->spec = spec;
1196 	snd_hda_gen_spec_init(&spec->gen);
1197 	spec->gen.mixer_nid = mixer_nid;
1198 	spec->gen.own_eapd_ctl = 1;
1199 	codec->single_adc_amp = 1;
1200 	/* FIXME: do we need this for all Realtek codec models? */
1201 	codec->spdif_status_reset = 1;
1202 	codec->forced_resume = 1;
1203 	codec->patch_ops = alc_patch_ops;
1204 	mutex_init(&spec->coef_mutex);
1205 
1206 	err = alc_codec_rename_from_preset(codec);
1207 	if (err < 0) {
1208 		kfree(spec);
1209 		return err;
1210 	}
1211 	return 0;
1212 }
1213 
1214 static int alc880_parse_auto_config(struct hda_codec *codec)
1215 {
1216 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1217 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1218 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1219 }
1220 
1221 /*
1222  * ALC880 fix-ups
1223  */
1224 enum {
1225 	ALC880_FIXUP_GPIO1,
1226 	ALC880_FIXUP_GPIO2,
1227 	ALC880_FIXUP_MEDION_RIM,
1228 	ALC880_FIXUP_LG,
1229 	ALC880_FIXUP_LG_LW25,
1230 	ALC880_FIXUP_W810,
1231 	ALC880_FIXUP_EAPD_COEF,
1232 	ALC880_FIXUP_TCL_S700,
1233 	ALC880_FIXUP_VOL_KNOB,
1234 	ALC880_FIXUP_FUJITSU,
1235 	ALC880_FIXUP_F1734,
1236 	ALC880_FIXUP_UNIWILL,
1237 	ALC880_FIXUP_UNIWILL_DIG,
1238 	ALC880_FIXUP_Z71V,
1239 	ALC880_FIXUP_ASUS_W5A,
1240 	ALC880_FIXUP_3ST_BASE,
1241 	ALC880_FIXUP_3ST,
1242 	ALC880_FIXUP_3ST_DIG,
1243 	ALC880_FIXUP_5ST_BASE,
1244 	ALC880_FIXUP_5ST,
1245 	ALC880_FIXUP_5ST_DIG,
1246 	ALC880_FIXUP_6ST_BASE,
1247 	ALC880_FIXUP_6ST,
1248 	ALC880_FIXUP_6ST_DIG,
1249 	ALC880_FIXUP_6ST_AUTOMUTE,
1250 };
1251 
1252 /* enable the volume-knob widget support on NID 0x21 */
1253 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1254 				  const struct hda_fixup *fix, int action)
1255 {
1256 	if (action == HDA_FIXUP_ACT_PROBE)
1257 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1258 						    alc_update_knob_master);
1259 }
1260 
1261 static const struct hda_fixup alc880_fixups[] = {
1262 	[ALC880_FIXUP_GPIO1] = {
1263 		.type = HDA_FIXUP_FUNC,
1264 		.v.func = alc_fixup_gpio1,
1265 	},
1266 	[ALC880_FIXUP_GPIO2] = {
1267 		.type = HDA_FIXUP_FUNC,
1268 		.v.func = alc_fixup_gpio2,
1269 	},
1270 	[ALC880_FIXUP_MEDION_RIM] = {
1271 		.type = HDA_FIXUP_VERBS,
1272 		.v.verbs = (const struct hda_verb[]) {
1273 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1274 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1275 			{ }
1276 		},
1277 		.chained = true,
1278 		.chain_id = ALC880_FIXUP_GPIO2,
1279 	},
1280 	[ALC880_FIXUP_LG] = {
1281 		.type = HDA_FIXUP_PINS,
1282 		.v.pins = (const struct hda_pintbl[]) {
1283 			/* disable bogus unused pins */
1284 			{ 0x16, 0x411111f0 },
1285 			{ 0x18, 0x411111f0 },
1286 			{ 0x1a, 0x411111f0 },
1287 			{ }
1288 		}
1289 	},
1290 	[ALC880_FIXUP_LG_LW25] = {
1291 		.type = HDA_FIXUP_PINS,
1292 		.v.pins = (const struct hda_pintbl[]) {
1293 			{ 0x1a, 0x0181344f }, /* line-in */
1294 			{ 0x1b, 0x0321403f }, /* headphone */
1295 			{ }
1296 		}
1297 	},
1298 	[ALC880_FIXUP_W810] = {
1299 		.type = HDA_FIXUP_PINS,
1300 		.v.pins = (const struct hda_pintbl[]) {
1301 			/* disable bogus unused pins */
1302 			{ 0x17, 0x411111f0 },
1303 			{ }
1304 		},
1305 		.chained = true,
1306 		.chain_id = ALC880_FIXUP_GPIO2,
1307 	},
1308 	[ALC880_FIXUP_EAPD_COEF] = {
1309 		.type = HDA_FIXUP_VERBS,
1310 		.v.verbs = (const struct hda_verb[]) {
1311 			/* change to EAPD mode */
1312 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1313 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1314 			{}
1315 		},
1316 	},
1317 	[ALC880_FIXUP_TCL_S700] = {
1318 		.type = HDA_FIXUP_VERBS,
1319 		.v.verbs = (const struct hda_verb[]) {
1320 			/* change to EAPD mode */
1321 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1322 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1323 			{}
1324 		},
1325 		.chained = true,
1326 		.chain_id = ALC880_FIXUP_GPIO2,
1327 	},
1328 	[ALC880_FIXUP_VOL_KNOB] = {
1329 		.type = HDA_FIXUP_FUNC,
1330 		.v.func = alc880_fixup_vol_knob,
1331 	},
1332 	[ALC880_FIXUP_FUJITSU] = {
1333 		/* override all pins as BIOS on old Amilo is broken */
1334 		.type = HDA_FIXUP_PINS,
1335 		.v.pins = (const struct hda_pintbl[]) {
1336 			{ 0x14, 0x0121401f }, /* HP */
1337 			{ 0x15, 0x99030120 }, /* speaker */
1338 			{ 0x16, 0x99030130 }, /* bass speaker */
1339 			{ 0x17, 0x411111f0 }, /* N/A */
1340 			{ 0x18, 0x411111f0 }, /* N/A */
1341 			{ 0x19, 0x01a19950 }, /* mic-in */
1342 			{ 0x1a, 0x411111f0 }, /* N/A */
1343 			{ 0x1b, 0x411111f0 }, /* N/A */
1344 			{ 0x1c, 0x411111f0 }, /* N/A */
1345 			{ 0x1d, 0x411111f0 }, /* N/A */
1346 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1347 			{ }
1348 		},
1349 		.chained = true,
1350 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1351 	},
1352 	[ALC880_FIXUP_F1734] = {
1353 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1354 		.type = HDA_FIXUP_PINS,
1355 		.v.pins = (const struct hda_pintbl[]) {
1356 			{ 0x14, 0x0121401f }, /* HP */
1357 			{ 0x15, 0x99030120 }, /* speaker */
1358 			{ 0x16, 0x411111f0 }, /* N/A */
1359 			{ 0x17, 0x411111f0 }, /* N/A */
1360 			{ 0x18, 0x411111f0 }, /* N/A */
1361 			{ 0x19, 0x01a19950 }, /* mic-in */
1362 			{ 0x1a, 0x411111f0 }, /* N/A */
1363 			{ 0x1b, 0x411111f0 }, /* N/A */
1364 			{ 0x1c, 0x411111f0 }, /* N/A */
1365 			{ 0x1d, 0x411111f0 }, /* N/A */
1366 			{ 0x1e, 0x411111f0 }, /* N/A */
1367 			{ }
1368 		},
1369 		.chained = true,
1370 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1371 	},
1372 	[ALC880_FIXUP_UNIWILL] = {
1373 		/* need to fix HP and speaker pins to be parsed correctly */
1374 		.type = HDA_FIXUP_PINS,
1375 		.v.pins = (const struct hda_pintbl[]) {
1376 			{ 0x14, 0x0121411f }, /* HP */
1377 			{ 0x15, 0x99030120 }, /* speaker */
1378 			{ 0x16, 0x99030130 }, /* bass speaker */
1379 			{ }
1380 		},
1381 	},
1382 	[ALC880_FIXUP_UNIWILL_DIG] = {
1383 		.type = HDA_FIXUP_PINS,
1384 		.v.pins = (const struct hda_pintbl[]) {
1385 			/* disable bogus unused pins */
1386 			{ 0x17, 0x411111f0 },
1387 			{ 0x19, 0x411111f0 },
1388 			{ 0x1b, 0x411111f0 },
1389 			{ 0x1f, 0x411111f0 },
1390 			{ }
1391 		}
1392 	},
1393 	[ALC880_FIXUP_Z71V] = {
1394 		.type = HDA_FIXUP_PINS,
1395 		.v.pins = (const struct hda_pintbl[]) {
1396 			/* set up the whole pins as BIOS is utterly broken */
1397 			{ 0x14, 0x99030120 }, /* speaker */
1398 			{ 0x15, 0x0121411f }, /* HP */
1399 			{ 0x16, 0x411111f0 }, /* N/A */
1400 			{ 0x17, 0x411111f0 }, /* N/A */
1401 			{ 0x18, 0x01a19950 }, /* mic-in */
1402 			{ 0x19, 0x411111f0 }, /* N/A */
1403 			{ 0x1a, 0x01813031 }, /* line-in */
1404 			{ 0x1b, 0x411111f0 }, /* N/A */
1405 			{ 0x1c, 0x411111f0 }, /* N/A */
1406 			{ 0x1d, 0x411111f0 }, /* N/A */
1407 			{ 0x1e, 0x0144111e }, /* SPDIF */
1408 			{ }
1409 		}
1410 	},
1411 	[ALC880_FIXUP_ASUS_W5A] = {
1412 		.type = HDA_FIXUP_PINS,
1413 		.v.pins = (const struct hda_pintbl[]) {
1414 			/* set up the whole pins as BIOS is utterly broken */
1415 			{ 0x14, 0x0121411f }, /* HP */
1416 			{ 0x15, 0x411111f0 }, /* N/A */
1417 			{ 0x16, 0x411111f0 }, /* N/A */
1418 			{ 0x17, 0x411111f0 }, /* N/A */
1419 			{ 0x18, 0x90a60160 }, /* mic */
1420 			{ 0x19, 0x411111f0 }, /* N/A */
1421 			{ 0x1a, 0x411111f0 }, /* N/A */
1422 			{ 0x1b, 0x411111f0 }, /* N/A */
1423 			{ 0x1c, 0x411111f0 }, /* N/A */
1424 			{ 0x1d, 0x411111f0 }, /* N/A */
1425 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1426 			{ }
1427 		},
1428 		.chained = true,
1429 		.chain_id = ALC880_FIXUP_GPIO1,
1430 	},
1431 	[ALC880_FIXUP_3ST_BASE] = {
1432 		.type = HDA_FIXUP_PINS,
1433 		.v.pins = (const struct hda_pintbl[]) {
1434 			{ 0x14, 0x01014010 }, /* line-out */
1435 			{ 0x15, 0x411111f0 }, /* N/A */
1436 			{ 0x16, 0x411111f0 }, /* N/A */
1437 			{ 0x17, 0x411111f0 }, /* N/A */
1438 			{ 0x18, 0x01a19c30 }, /* mic-in */
1439 			{ 0x19, 0x0121411f }, /* HP */
1440 			{ 0x1a, 0x01813031 }, /* line-in */
1441 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1442 			{ 0x1c, 0x411111f0 }, /* N/A */
1443 			{ 0x1d, 0x411111f0 }, /* N/A */
1444 			/* 0x1e is filled in below */
1445 			{ 0x1f, 0x411111f0 }, /* N/A */
1446 			{ }
1447 		}
1448 	},
1449 	[ALC880_FIXUP_3ST] = {
1450 		.type = HDA_FIXUP_PINS,
1451 		.v.pins = (const struct hda_pintbl[]) {
1452 			{ 0x1e, 0x411111f0 }, /* N/A */
1453 			{ }
1454 		},
1455 		.chained = true,
1456 		.chain_id = ALC880_FIXUP_3ST_BASE,
1457 	},
1458 	[ALC880_FIXUP_3ST_DIG] = {
1459 		.type = HDA_FIXUP_PINS,
1460 		.v.pins = (const struct hda_pintbl[]) {
1461 			{ 0x1e, 0x0144111e }, /* SPDIF */
1462 			{ }
1463 		},
1464 		.chained = true,
1465 		.chain_id = ALC880_FIXUP_3ST_BASE,
1466 	},
1467 	[ALC880_FIXUP_5ST_BASE] = {
1468 		.type = HDA_FIXUP_PINS,
1469 		.v.pins = (const struct hda_pintbl[]) {
1470 			{ 0x14, 0x01014010 }, /* front */
1471 			{ 0x15, 0x411111f0 }, /* N/A */
1472 			{ 0x16, 0x01011411 }, /* CLFE */
1473 			{ 0x17, 0x01016412 }, /* surr */
1474 			{ 0x18, 0x01a19c30 }, /* mic-in */
1475 			{ 0x19, 0x0121411f }, /* HP */
1476 			{ 0x1a, 0x01813031 }, /* line-in */
1477 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1478 			{ 0x1c, 0x411111f0 }, /* N/A */
1479 			{ 0x1d, 0x411111f0 }, /* N/A */
1480 			/* 0x1e is filled in below */
1481 			{ 0x1f, 0x411111f0 }, /* N/A */
1482 			{ }
1483 		}
1484 	},
1485 	[ALC880_FIXUP_5ST] = {
1486 		.type = HDA_FIXUP_PINS,
1487 		.v.pins = (const struct hda_pintbl[]) {
1488 			{ 0x1e, 0x411111f0 }, /* N/A */
1489 			{ }
1490 		},
1491 		.chained = true,
1492 		.chain_id = ALC880_FIXUP_5ST_BASE,
1493 	},
1494 	[ALC880_FIXUP_5ST_DIG] = {
1495 		.type = HDA_FIXUP_PINS,
1496 		.v.pins = (const struct hda_pintbl[]) {
1497 			{ 0x1e, 0x0144111e }, /* SPDIF */
1498 			{ }
1499 		},
1500 		.chained = true,
1501 		.chain_id = ALC880_FIXUP_5ST_BASE,
1502 	},
1503 	[ALC880_FIXUP_6ST_BASE] = {
1504 		.type = HDA_FIXUP_PINS,
1505 		.v.pins = (const struct hda_pintbl[]) {
1506 			{ 0x14, 0x01014010 }, /* front */
1507 			{ 0x15, 0x01016412 }, /* surr */
1508 			{ 0x16, 0x01011411 }, /* CLFE */
1509 			{ 0x17, 0x01012414 }, /* side */
1510 			{ 0x18, 0x01a19c30 }, /* mic-in */
1511 			{ 0x19, 0x02a19c40 }, /* front-mic */
1512 			{ 0x1a, 0x01813031 }, /* line-in */
1513 			{ 0x1b, 0x0121411f }, /* HP */
1514 			{ 0x1c, 0x411111f0 }, /* N/A */
1515 			{ 0x1d, 0x411111f0 }, /* N/A */
1516 			/* 0x1e is filled in below */
1517 			{ 0x1f, 0x411111f0 }, /* N/A */
1518 			{ }
1519 		}
1520 	},
1521 	[ALC880_FIXUP_6ST] = {
1522 		.type = HDA_FIXUP_PINS,
1523 		.v.pins = (const struct hda_pintbl[]) {
1524 			{ 0x1e, 0x411111f0 }, /* N/A */
1525 			{ }
1526 		},
1527 		.chained = true,
1528 		.chain_id = ALC880_FIXUP_6ST_BASE,
1529 	},
1530 	[ALC880_FIXUP_6ST_DIG] = {
1531 		.type = HDA_FIXUP_PINS,
1532 		.v.pins = (const struct hda_pintbl[]) {
1533 			{ 0x1e, 0x0144111e }, /* SPDIF */
1534 			{ }
1535 		},
1536 		.chained = true,
1537 		.chain_id = ALC880_FIXUP_6ST_BASE,
1538 	},
1539 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1540 		.type = HDA_FIXUP_PINS,
1541 		.v.pins = (const struct hda_pintbl[]) {
1542 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1543 			{ }
1544 		},
1545 		.chained_before = true,
1546 		.chain_id = ALC880_FIXUP_6ST_BASE,
1547 	},
1548 };
1549 
1550 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1551 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1552 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1553 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1554 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1555 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1556 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1557 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1558 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1559 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1560 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1561 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1562 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1563 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1564 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1565 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1566 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1567 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1568 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1569 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1570 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1571 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1572 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1573 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1574 
1575 	/* Below is the copied entries from alc880_quirks.c.
1576 	 * It's not quite sure whether BIOS sets the correct pin-config table
1577 	 * on these machines, thus they are kept to be compatible with
1578 	 * the old static quirks.  Once when it's confirmed to work without
1579 	 * these overrides, it'd be better to remove.
1580 	 */
1581 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1582 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1583 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1584 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1585 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1586 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1587 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1588 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1589 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1590 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1591 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1592 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1593 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1594 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1595 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1596 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1597 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1598 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1599 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1600 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1601 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1602 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1603 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1605 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1606 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1608 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1609 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1610 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1611 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1613 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 	/* default Intel */
1615 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1616 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1617 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1618 	{}
1619 };
1620 
1621 static const struct hda_model_fixup alc880_fixup_models[] = {
1622 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1623 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1624 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1625 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1626 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1627 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1628 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1629 	{}
1630 };
1631 
1632 
1633 /*
1634  * OK, here we have finally the patch for ALC880
1635  */
1636 static int patch_alc880(struct hda_codec *codec)
1637 {
1638 	struct alc_spec *spec;
1639 	int err;
1640 
1641 	err = alc_alloc_spec(codec, 0x0b);
1642 	if (err < 0)
1643 		return err;
1644 
1645 	spec = codec->spec;
1646 	spec->gen.need_dac_fix = 1;
1647 	spec->gen.beep_nid = 0x01;
1648 
1649 	codec->patch_ops.unsol_event = alc880_unsol_event;
1650 
1651 	alc_pre_init(codec);
1652 
1653 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1654 		       alc880_fixups);
1655 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1656 
1657 	/* automatic parse from the BIOS config */
1658 	err = alc880_parse_auto_config(codec);
1659 	if (err < 0)
1660 		goto error;
1661 
1662 	if (!spec->gen.no_analog) {
1663 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1664 		if (err < 0)
1665 			goto error;
1666 	}
1667 
1668 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1669 
1670 	return 0;
1671 
1672  error:
1673 	alc_free(codec);
1674 	return err;
1675 }
1676 
1677 
1678 /*
1679  * ALC260 support
1680  */
1681 static int alc260_parse_auto_config(struct hda_codec *codec)
1682 {
1683 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1684 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1685 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1686 }
1687 
1688 /*
1689  * Pin config fixes
1690  */
1691 enum {
1692 	ALC260_FIXUP_HP_DC5750,
1693 	ALC260_FIXUP_HP_PIN_0F,
1694 	ALC260_FIXUP_COEF,
1695 	ALC260_FIXUP_GPIO1,
1696 	ALC260_FIXUP_GPIO1_TOGGLE,
1697 	ALC260_FIXUP_REPLACER,
1698 	ALC260_FIXUP_HP_B1900,
1699 	ALC260_FIXUP_KN1,
1700 	ALC260_FIXUP_FSC_S7020,
1701 	ALC260_FIXUP_FSC_S7020_JWSE,
1702 	ALC260_FIXUP_VAIO_PINS,
1703 };
1704 
1705 static void alc260_gpio1_automute(struct hda_codec *codec)
1706 {
1707 	struct alc_spec *spec = codec->spec;
1708 
1709 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1710 }
1711 
1712 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1713 				      const struct hda_fixup *fix, int action)
1714 {
1715 	struct alc_spec *spec = codec->spec;
1716 	if (action == HDA_FIXUP_ACT_PROBE) {
1717 		/* although the machine has only one output pin, we need to
1718 		 * toggle GPIO1 according to the jack state
1719 		 */
1720 		spec->gen.automute_hook = alc260_gpio1_automute;
1721 		spec->gen.detect_hp = 1;
1722 		spec->gen.automute_speaker = 1;
1723 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1724 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1725 						    snd_hda_gen_hp_automute);
1726 		alc_setup_gpio(codec, 0x01);
1727 	}
1728 }
1729 
1730 static void alc260_fixup_kn1(struct hda_codec *codec,
1731 			     const struct hda_fixup *fix, int action)
1732 {
1733 	struct alc_spec *spec = codec->spec;
1734 	static const struct hda_pintbl pincfgs[] = {
1735 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1736 		{ 0x12, 0x90a60160 }, /* int mic */
1737 		{ 0x13, 0x02a19000 }, /* ext mic */
1738 		{ 0x18, 0x01446000 }, /* SPDIF out */
1739 		/* disable bogus I/O pins */
1740 		{ 0x10, 0x411111f0 },
1741 		{ 0x11, 0x411111f0 },
1742 		{ 0x14, 0x411111f0 },
1743 		{ 0x15, 0x411111f0 },
1744 		{ 0x16, 0x411111f0 },
1745 		{ 0x17, 0x411111f0 },
1746 		{ 0x19, 0x411111f0 },
1747 		{ }
1748 	};
1749 
1750 	switch (action) {
1751 	case HDA_FIXUP_ACT_PRE_PROBE:
1752 		snd_hda_apply_pincfgs(codec, pincfgs);
1753 		spec->init_amp = ALC_INIT_NONE;
1754 		break;
1755 	}
1756 }
1757 
1758 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1759 				   const struct hda_fixup *fix, int action)
1760 {
1761 	struct alc_spec *spec = codec->spec;
1762 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1763 		spec->init_amp = ALC_INIT_NONE;
1764 }
1765 
1766 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1767 				   const struct hda_fixup *fix, int action)
1768 {
1769 	struct alc_spec *spec = codec->spec;
1770 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1771 		spec->gen.add_jack_modes = 1;
1772 		spec->gen.hp_mic = 1;
1773 	}
1774 }
1775 
1776 static const struct hda_fixup alc260_fixups[] = {
1777 	[ALC260_FIXUP_HP_DC5750] = {
1778 		.type = HDA_FIXUP_PINS,
1779 		.v.pins = (const struct hda_pintbl[]) {
1780 			{ 0x11, 0x90130110 }, /* speaker */
1781 			{ }
1782 		}
1783 	},
1784 	[ALC260_FIXUP_HP_PIN_0F] = {
1785 		.type = HDA_FIXUP_PINS,
1786 		.v.pins = (const struct hda_pintbl[]) {
1787 			{ 0x0f, 0x01214000 }, /* HP */
1788 			{ }
1789 		}
1790 	},
1791 	[ALC260_FIXUP_COEF] = {
1792 		.type = HDA_FIXUP_VERBS,
1793 		.v.verbs = (const struct hda_verb[]) {
1794 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1795 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3040 },
1796 			{ }
1797 		},
1798 	},
1799 	[ALC260_FIXUP_GPIO1] = {
1800 		.type = HDA_FIXUP_FUNC,
1801 		.v.func = alc_fixup_gpio1,
1802 	},
1803 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1804 		.type = HDA_FIXUP_FUNC,
1805 		.v.func = alc260_fixup_gpio1_toggle,
1806 		.chained = true,
1807 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1808 	},
1809 	[ALC260_FIXUP_REPLACER] = {
1810 		.type = HDA_FIXUP_VERBS,
1811 		.v.verbs = (const struct hda_verb[]) {
1812 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1813 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1814 			{ }
1815 		},
1816 		.chained = true,
1817 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1818 	},
1819 	[ALC260_FIXUP_HP_B1900] = {
1820 		.type = HDA_FIXUP_FUNC,
1821 		.v.func = alc260_fixup_gpio1_toggle,
1822 		.chained = true,
1823 		.chain_id = ALC260_FIXUP_COEF,
1824 	},
1825 	[ALC260_FIXUP_KN1] = {
1826 		.type = HDA_FIXUP_FUNC,
1827 		.v.func = alc260_fixup_kn1,
1828 	},
1829 	[ALC260_FIXUP_FSC_S7020] = {
1830 		.type = HDA_FIXUP_FUNC,
1831 		.v.func = alc260_fixup_fsc_s7020,
1832 	},
1833 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1834 		.type = HDA_FIXUP_FUNC,
1835 		.v.func = alc260_fixup_fsc_s7020_jwse,
1836 		.chained = true,
1837 		.chain_id = ALC260_FIXUP_FSC_S7020,
1838 	},
1839 	[ALC260_FIXUP_VAIO_PINS] = {
1840 		.type = HDA_FIXUP_PINS,
1841 		.v.pins = (const struct hda_pintbl[]) {
1842 			/* Pin configs are missing completely on some VAIOs */
1843 			{ 0x0f, 0x01211020 },
1844 			{ 0x10, 0x0001003f },
1845 			{ 0x11, 0x411111f0 },
1846 			{ 0x12, 0x01a15930 },
1847 			{ 0x13, 0x411111f0 },
1848 			{ 0x14, 0x411111f0 },
1849 			{ 0x15, 0x411111f0 },
1850 			{ 0x16, 0x411111f0 },
1851 			{ 0x17, 0x411111f0 },
1852 			{ 0x18, 0x411111f0 },
1853 			{ 0x19, 0x411111f0 },
1854 			{ }
1855 		}
1856 	},
1857 };
1858 
1859 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1860 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1861 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1862 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1863 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1864 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1865 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1866 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1867 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1868 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1869 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1870 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1871 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1872 	{}
1873 };
1874 
1875 static const struct hda_model_fixup alc260_fixup_models[] = {
1876 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1877 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1878 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1879 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1880 	{}
1881 };
1882 
1883 /*
1884  */
1885 static int patch_alc260(struct hda_codec *codec)
1886 {
1887 	struct alc_spec *spec;
1888 	int err;
1889 
1890 	err = alc_alloc_spec(codec, 0x07);
1891 	if (err < 0)
1892 		return err;
1893 
1894 	spec = codec->spec;
1895 	/* as quite a few machines require HP amp for speaker outputs,
1896 	 * it's easier to enable it unconditionally; even if it's unneeded,
1897 	 * it's almost harmless.
1898 	 */
1899 	spec->gen.prefer_hp_amp = 1;
1900 	spec->gen.beep_nid = 0x01;
1901 
1902 	spec->shutup = alc_eapd_shutup;
1903 
1904 	alc_pre_init(codec);
1905 
1906 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1907 			   alc260_fixups);
1908 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1909 
1910 	/* automatic parse from the BIOS config */
1911 	err = alc260_parse_auto_config(codec);
1912 	if (err < 0)
1913 		goto error;
1914 
1915 	if (!spec->gen.no_analog) {
1916 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1917 		if (err < 0)
1918 			goto error;
1919 	}
1920 
1921 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1922 
1923 	return 0;
1924 
1925  error:
1926 	alc_free(codec);
1927 	return err;
1928 }
1929 
1930 
1931 /*
1932  * ALC882/883/885/888/889 support
1933  *
1934  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1935  * configuration.  Each pin widget can choose any input DACs and a mixer.
1936  * Each ADC is connected from a mixer of all inputs.  This makes possible
1937  * 6-channel independent captures.
1938  *
1939  * In addition, an independent DAC for the multi-playback (not used in this
1940  * driver yet).
1941  */
1942 
1943 /*
1944  * Pin config fixes
1945  */
1946 enum {
1947 	ALC882_FIXUP_ABIT_AW9D_MAX,
1948 	ALC882_FIXUP_LENOVO_Y530,
1949 	ALC882_FIXUP_PB_M5210,
1950 	ALC882_FIXUP_ACER_ASPIRE_7736,
1951 	ALC882_FIXUP_ASUS_W90V,
1952 	ALC889_FIXUP_CD,
1953 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1954 	ALC889_FIXUP_VAIO_TT,
1955 	ALC888_FIXUP_EEE1601,
1956 	ALC886_FIXUP_EAPD,
1957 	ALC882_FIXUP_EAPD,
1958 	ALC883_FIXUP_EAPD,
1959 	ALC883_FIXUP_ACER_EAPD,
1960 	ALC882_FIXUP_GPIO1,
1961 	ALC882_FIXUP_GPIO2,
1962 	ALC882_FIXUP_GPIO3,
1963 	ALC889_FIXUP_COEF,
1964 	ALC882_FIXUP_ASUS_W2JC,
1965 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1966 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1967 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1968 	ALC885_FIXUP_MACPRO_GPIO,
1969 	ALC889_FIXUP_DAC_ROUTE,
1970 	ALC889_FIXUP_MBP_VREF,
1971 	ALC889_FIXUP_IMAC91_VREF,
1972 	ALC889_FIXUP_MBA11_VREF,
1973 	ALC889_FIXUP_MBA21_VREF,
1974 	ALC889_FIXUP_MP11_VREF,
1975 	ALC889_FIXUP_MP41_VREF,
1976 	ALC882_FIXUP_INV_DMIC,
1977 	ALC882_FIXUP_NO_PRIMARY_HP,
1978 	ALC887_FIXUP_ASUS_BASS,
1979 	ALC887_FIXUP_BASS_CHMAP,
1980 	ALC1220_FIXUP_GB_DUAL_CODECS,
1981 	ALC1220_FIXUP_GB_X570,
1982 	ALC1220_FIXUP_CLEVO_P950,
1983 	ALC1220_FIXUP_CLEVO_PB51ED,
1984 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1985 	ALC887_FIXUP_ASUS_AUDIO,
1986 	ALC887_FIXUP_ASUS_HMIC,
1987 	ALCS1200A_FIXUP_MIC_VREF,
1988 };
1989 
1990 static void alc889_fixup_coef(struct hda_codec *codec,
1991 			      const struct hda_fixup *fix, int action)
1992 {
1993 	if (action != HDA_FIXUP_ACT_INIT)
1994 		return;
1995 	alc_update_coef_idx(codec, 7, 0, 0x2030);
1996 }
1997 
1998 /* set up GPIO at initialization */
1999 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2000 				     const struct hda_fixup *fix, int action)
2001 {
2002 	struct alc_spec *spec = codec->spec;
2003 
2004 	spec->gpio_write_delay = true;
2005 	alc_fixup_gpio3(codec, fix, action);
2006 }
2007 
2008 /* Fix the connection of some pins for ALC889:
2009  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2010  * work correctly (bko#42740)
2011  */
2012 static void alc889_fixup_dac_route(struct hda_codec *codec,
2013 				   const struct hda_fixup *fix, int action)
2014 {
2015 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2016 		/* fake the connections during parsing the tree */
2017 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2018 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2019 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2020 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2021 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2022 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2023 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2024 		/* restore the connections */
2025 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2026 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2027 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2028 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2029 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2030 	}
2031 }
2032 
2033 /* Set VREF on HP pin */
2034 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2035 				  const struct hda_fixup *fix, int action)
2036 {
2037 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2038 	struct alc_spec *spec = codec->spec;
2039 	int i;
2040 
2041 	if (action != HDA_FIXUP_ACT_INIT)
2042 		return;
2043 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2044 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2045 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2046 			continue;
2047 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2048 		val |= AC_PINCTL_VREF_80;
2049 		snd_hda_set_pin_ctl(codec, nids[i], val);
2050 		spec->gen.keep_vref_in_automute = 1;
2051 		break;
2052 	}
2053 }
2054 
2055 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2056 				  const hda_nid_t *nids, int num_nids)
2057 {
2058 	struct alc_spec *spec = codec->spec;
2059 	int i;
2060 
2061 	for (i = 0; i < num_nids; i++) {
2062 		unsigned int val;
2063 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2064 		val |= AC_PINCTL_VREF_50;
2065 		snd_hda_set_pin_ctl(codec, nids[i], val);
2066 	}
2067 	spec->gen.keep_vref_in_automute = 1;
2068 }
2069 
2070 /* Set VREF on speaker pins on imac91 */
2071 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2072 				     const struct hda_fixup *fix, int action)
2073 {
2074 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2075 
2076 	if (action == HDA_FIXUP_ACT_INIT)
2077 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2078 }
2079 
2080 /* Set VREF on speaker pins on mba11 */
2081 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2082 				    const struct hda_fixup *fix, int action)
2083 {
2084 	static const hda_nid_t nids[] = { 0x18 };
2085 
2086 	if (action == HDA_FIXUP_ACT_INIT)
2087 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2088 }
2089 
2090 /* Set VREF on speaker pins on mba21 */
2091 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2092 				    const struct hda_fixup *fix, int action)
2093 {
2094 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2095 
2096 	if (action == HDA_FIXUP_ACT_INIT)
2097 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2098 }
2099 
2100 /* Don't take HP output as primary
2101  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2102  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2103  */
2104 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2105 				       const struct hda_fixup *fix, int action)
2106 {
2107 	struct alc_spec *spec = codec->spec;
2108 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2109 		spec->gen.no_primary_hp = 1;
2110 		spec->gen.no_multi_io = 1;
2111 	}
2112 }
2113 
2114 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2115 				 const struct hda_fixup *fix, int action);
2116 
2117 /* For dual-codec configuration, we need to disable some features to avoid
2118  * conflicts of kctls and PCM streams
2119  */
2120 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2121 				  const struct hda_fixup *fix, int action)
2122 {
2123 	struct alc_spec *spec = codec->spec;
2124 
2125 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2126 		return;
2127 	/* disable vmaster */
2128 	spec->gen.suppress_vmaster = 1;
2129 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2130 	spec->gen.suppress_auto_mute = 1;
2131 	spec->gen.suppress_auto_mic = 1;
2132 	/* disable aamix as well */
2133 	spec->gen.mixer_nid = 0;
2134 	/* add location prefix to avoid conflicts */
2135 	codec->force_pin_prefix = 1;
2136 }
2137 
2138 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2139 		       const char *newname)
2140 {
2141 	struct snd_kcontrol *kctl;
2142 
2143 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2144 	if (kctl)
2145 		snd_ctl_rename(codec->card, kctl, newname);
2146 }
2147 
2148 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2149 					 const struct hda_fixup *fix,
2150 					 int action)
2151 {
2152 	alc_fixup_dual_codecs(codec, fix, action);
2153 	switch (action) {
2154 	case HDA_FIXUP_ACT_PRE_PROBE:
2155 		/* override card longname to provide a unique UCM profile */
2156 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2157 		break;
2158 	case HDA_FIXUP_ACT_BUILD:
2159 		/* rename Capture controls depending on the codec */
2160 		rename_ctl(codec, "Capture Volume",
2161 			   codec->addr == 0 ?
2162 			   "Rear-Panel Capture Volume" :
2163 			   "Front-Panel Capture Volume");
2164 		rename_ctl(codec, "Capture Switch",
2165 			   codec->addr == 0 ?
2166 			   "Rear-Panel Capture Switch" :
2167 			   "Front-Panel Capture Switch");
2168 		break;
2169 	}
2170 }
2171 
2172 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2173 				     const struct hda_fixup *fix,
2174 				     int action)
2175 {
2176 	static const hda_nid_t conn1[] = { 0x0c };
2177 	static const struct coef_fw gb_x570_coefs[] = {
2178 		WRITE_COEF(0x07, 0x03c0),
2179 		WRITE_COEF(0x1a, 0x01c1),
2180 		WRITE_COEF(0x1b, 0x0202),
2181 		WRITE_COEF(0x43, 0x3005),
2182 		{}
2183 	};
2184 
2185 	switch (action) {
2186 	case HDA_FIXUP_ACT_PRE_PROBE:
2187 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2188 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2189 		break;
2190 	case HDA_FIXUP_ACT_INIT:
2191 		alc_process_coef_fw(codec, gb_x570_coefs);
2192 		break;
2193 	}
2194 }
2195 
2196 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2197 				     const struct hda_fixup *fix,
2198 				     int action)
2199 {
2200 	static const hda_nid_t conn1[] = { 0x0c };
2201 
2202 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2203 		return;
2204 
2205 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2206 	/* We therefore want to make sure 0x14 (front headphone) and
2207 	 * 0x1b (speakers) use the stereo DAC 0x02
2208 	 */
2209 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2210 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2211 }
2212 
2213 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2214 				const struct hda_fixup *fix, int action);
2215 
2216 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2217 				     const struct hda_fixup *fix,
2218 				     int action)
2219 {
2220 	alc1220_fixup_clevo_p950(codec, fix, action);
2221 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2222 }
2223 
2224 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2225 					 struct hda_jack_callback *jack)
2226 {
2227 	struct alc_spec *spec = codec->spec;
2228 	unsigned int vref;
2229 
2230 	snd_hda_gen_hp_automute(codec, jack);
2231 
2232 	if (spec->gen.hp_jack_present)
2233 		vref = AC_PINCTL_VREF_80;
2234 	else
2235 		vref = AC_PINCTL_VREF_HIZ;
2236 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2237 }
2238 
2239 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2240 				     const struct hda_fixup *fix, int action)
2241 {
2242 	struct alc_spec *spec = codec->spec;
2243 	if (action != HDA_FIXUP_ACT_PROBE)
2244 		return;
2245 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2246 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2247 }
2248 
2249 static const struct hda_fixup alc882_fixups[] = {
2250 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2251 		.type = HDA_FIXUP_PINS,
2252 		.v.pins = (const struct hda_pintbl[]) {
2253 			{ 0x15, 0x01080104 }, /* side */
2254 			{ 0x16, 0x01011012 }, /* rear */
2255 			{ 0x17, 0x01016011 }, /* clfe */
2256 			{ }
2257 		}
2258 	},
2259 	[ALC882_FIXUP_LENOVO_Y530] = {
2260 		.type = HDA_FIXUP_PINS,
2261 		.v.pins = (const struct hda_pintbl[]) {
2262 			{ 0x15, 0x99130112 }, /* rear int speakers */
2263 			{ 0x16, 0x99130111 }, /* subwoofer */
2264 			{ }
2265 		}
2266 	},
2267 	[ALC882_FIXUP_PB_M5210] = {
2268 		.type = HDA_FIXUP_PINCTLS,
2269 		.v.pins = (const struct hda_pintbl[]) {
2270 			{ 0x19, PIN_VREF50 },
2271 			{}
2272 		}
2273 	},
2274 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2275 		.type = HDA_FIXUP_FUNC,
2276 		.v.func = alc_fixup_sku_ignore,
2277 	},
2278 	[ALC882_FIXUP_ASUS_W90V] = {
2279 		.type = HDA_FIXUP_PINS,
2280 		.v.pins = (const struct hda_pintbl[]) {
2281 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2282 			{ }
2283 		}
2284 	},
2285 	[ALC889_FIXUP_CD] = {
2286 		.type = HDA_FIXUP_PINS,
2287 		.v.pins = (const struct hda_pintbl[]) {
2288 			{ 0x1c, 0x993301f0 }, /* CD */
2289 			{ }
2290 		}
2291 	},
2292 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2293 		.type = HDA_FIXUP_PINS,
2294 		.v.pins = (const struct hda_pintbl[]) {
2295 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2296 			{ }
2297 		},
2298 		.chained = true,
2299 		.chain_id = ALC889_FIXUP_CD,
2300 	},
2301 	[ALC889_FIXUP_VAIO_TT] = {
2302 		.type = HDA_FIXUP_PINS,
2303 		.v.pins = (const struct hda_pintbl[]) {
2304 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2305 			{ }
2306 		}
2307 	},
2308 	[ALC888_FIXUP_EEE1601] = {
2309 		.type = HDA_FIXUP_VERBS,
2310 		.v.verbs = (const struct hda_verb[]) {
2311 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2312 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2313 			{ }
2314 		}
2315 	},
2316 	[ALC886_FIXUP_EAPD] = {
2317 		.type = HDA_FIXUP_VERBS,
2318 		.v.verbs = (const struct hda_verb[]) {
2319 			/* change to EAPD mode */
2320 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2321 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2322 			{ }
2323 		}
2324 	},
2325 	[ALC882_FIXUP_EAPD] = {
2326 		.type = HDA_FIXUP_VERBS,
2327 		.v.verbs = (const struct hda_verb[]) {
2328 			/* change to EAPD mode */
2329 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2330 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2331 			{ }
2332 		}
2333 	},
2334 	[ALC883_FIXUP_EAPD] = {
2335 		.type = HDA_FIXUP_VERBS,
2336 		.v.verbs = (const struct hda_verb[]) {
2337 			/* change to EAPD mode */
2338 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2339 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2340 			{ }
2341 		}
2342 	},
2343 	[ALC883_FIXUP_ACER_EAPD] = {
2344 		.type = HDA_FIXUP_VERBS,
2345 		.v.verbs = (const struct hda_verb[]) {
2346 			/* eanable EAPD on Acer laptops */
2347 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2348 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2349 			{ }
2350 		}
2351 	},
2352 	[ALC882_FIXUP_GPIO1] = {
2353 		.type = HDA_FIXUP_FUNC,
2354 		.v.func = alc_fixup_gpio1,
2355 	},
2356 	[ALC882_FIXUP_GPIO2] = {
2357 		.type = HDA_FIXUP_FUNC,
2358 		.v.func = alc_fixup_gpio2,
2359 	},
2360 	[ALC882_FIXUP_GPIO3] = {
2361 		.type = HDA_FIXUP_FUNC,
2362 		.v.func = alc_fixup_gpio3,
2363 	},
2364 	[ALC882_FIXUP_ASUS_W2JC] = {
2365 		.type = HDA_FIXUP_FUNC,
2366 		.v.func = alc_fixup_gpio1,
2367 		.chained = true,
2368 		.chain_id = ALC882_FIXUP_EAPD,
2369 	},
2370 	[ALC889_FIXUP_COEF] = {
2371 		.type = HDA_FIXUP_FUNC,
2372 		.v.func = alc889_fixup_coef,
2373 	},
2374 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2375 		.type = HDA_FIXUP_PINS,
2376 		.v.pins = (const struct hda_pintbl[]) {
2377 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2378 			{ 0x17, 0x99130112 }, /* surround speaker */
2379 			{ }
2380 		},
2381 		.chained = true,
2382 		.chain_id = ALC882_FIXUP_GPIO1,
2383 	},
2384 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2385 		.type = HDA_FIXUP_PINS,
2386 		.v.pins = (const struct hda_pintbl[]) {
2387 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2388 			{ 0x1b, 0x99130112 }, /* surround speaker */
2389 			{ }
2390 		},
2391 		.chained = true,
2392 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2393 	},
2394 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2395 		/* additional init verbs for Acer Aspire 8930G */
2396 		.type = HDA_FIXUP_VERBS,
2397 		.v.verbs = (const struct hda_verb[]) {
2398 			/* Enable all DACs */
2399 			/* DAC DISABLE/MUTE 1? */
2400 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2401 			 *  apparently. Init=0x38 */
2402 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2403 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2404 			/* DAC DISABLE/MUTE 2? */
2405 			/*  some bit here disables the other DACs.
2406 			 *  Init=0x4900 */
2407 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2408 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2409 			/* DMIC fix
2410 			 * This laptop has a stereo digital microphone.
2411 			 * The mics are only 1cm apart which makes the stereo
2412 			 * useless. However, either the mic or the ALC889
2413 			 * makes the signal become a difference/sum signal
2414 			 * instead of standard stereo, which is annoying.
2415 			 * So instead we flip this bit which makes the
2416 			 * codec replicate the sum signal to both channels,
2417 			 * turning it into a normal mono mic.
2418 			 */
2419 			/* DMIC_CONTROL? Init value = 0x0001 */
2420 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2421 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2422 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2423 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2424 			{ }
2425 		},
2426 		.chained = true,
2427 		.chain_id = ALC882_FIXUP_GPIO1,
2428 	},
2429 	[ALC885_FIXUP_MACPRO_GPIO] = {
2430 		.type = HDA_FIXUP_FUNC,
2431 		.v.func = alc885_fixup_macpro_gpio,
2432 	},
2433 	[ALC889_FIXUP_DAC_ROUTE] = {
2434 		.type = HDA_FIXUP_FUNC,
2435 		.v.func = alc889_fixup_dac_route,
2436 	},
2437 	[ALC889_FIXUP_MBP_VREF] = {
2438 		.type = HDA_FIXUP_FUNC,
2439 		.v.func = alc889_fixup_mbp_vref,
2440 		.chained = true,
2441 		.chain_id = ALC882_FIXUP_GPIO1,
2442 	},
2443 	[ALC889_FIXUP_IMAC91_VREF] = {
2444 		.type = HDA_FIXUP_FUNC,
2445 		.v.func = alc889_fixup_imac91_vref,
2446 		.chained = true,
2447 		.chain_id = ALC882_FIXUP_GPIO1,
2448 	},
2449 	[ALC889_FIXUP_MBA11_VREF] = {
2450 		.type = HDA_FIXUP_FUNC,
2451 		.v.func = alc889_fixup_mba11_vref,
2452 		.chained = true,
2453 		.chain_id = ALC889_FIXUP_MBP_VREF,
2454 	},
2455 	[ALC889_FIXUP_MBA21_VREF] = {
2456 		.type = HDA_FIXUP_FUNC,
2457 		.v.func = alc889_fixup_mba21_vref,
2458 		.chained = true,
2459 		.chain_id = ALC889_FIXUP_MBP_VREF,
2460 	},
2461 	[ALC889_FIXUP_MP11_VREF] = {
2462 		.type = HDA_FIXUP_FUNC,
2463 		.v.func = alc889_fixup_mba11_vref,
2464 		.chained = true,
2465 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2466 	},
2467 	[ALC889_FIXUP_MP41_VREF] = {
2468 		.type = HDA_FIXUP_FUNC,
2469 		.v.func = alc889_fixup_mbp_vref,
2470 		.chained = true,
2471 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2472 	},
2473 	[ALC882_FIXUP_INV_DMIC] = {
2474 		.type = HDA_FIXUP_FUNC,
2475 		.v.func = alc_fixup_inv_dmic,
2476 	},
2477 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2478 		.type = HDA_FIXUP_FUNC,
2479 		.v.func = alc882_fixup_no_primary_hp,
2480 	},
2481 	[ALC887_FIXUP_ASUS_BASS] = {
2482 		.type = HDA_FIXUP_PINS,
2483 		.v.pins = (const struct hda_pintbl[]) {
2484 			{0x16, 0x99130130}, /* bass speaker */
2485 			{}
2486 		},
2487 		.chained = true,
2488 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2489 	},
2490 	[ALC887_FIXUP_BASS_CHMAP] = {
2491 		.type = HDA_FIXUP_FUNC,
2492 		.v.func = alc_fixup_bass_chmap,
2493 	},
2494 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2495 		.type = HDA_FIXUP_FUNC,
2496 		.v.func = alc1220_fixup_gb_dual_codecs,
2497 	},
2498 	[ALC1220_FIXUP_GB_X570] = {
2499 		.type = HDA_FIXUP_FUNC,
2500 		.v.func = alc1220_fixup_gb_x570,
2501 	},
2502 	[ALC1220_FIXUP_CLEVO_P950] = {
2503 		.type = HDA_FIXUP_FUNC,
2504 		.v.func = alc1220_fixup_clevo_p950,
2505 	},
2506 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2507 		.type = HDA_FIXUP_FUNC,
2508 		.v.func = alc1220_fixup_clevo_pb51ed,
2509 	},
2510 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2511 		.type = HDA_FIXUP_PINS,
2512 		.v.pins = (const struct hda_pintbl[]) {
2513 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2514 			{}
2515 		},
2516 		.chained = true,
2517 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2518 	},
2519 	[ALC887_FIXUP_ASUS_AUDIO] = {
2520 		.type = HDA_FIXUP_PINS,
2521 		.v.pins = (const struct hda_pintbl[]) {
2522 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2523 			{ 0x19, 0x22219420 },
2524 			{}
2525 		},
2526 	},
2527 	[ALC887_FIXUP_ASUS_HMIC] = {
2528 		.type = HDA_FIXUP_FUNC,
2529 		.v.func = alc887_fixup_asus_jack,
2530 		.chained = true,
2531 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2532 	},
2533 	[ALCS1200A_FIXUP_MIC_VREF] = {
2534 		.type = HDA_FIXUP_PINCTLS,
2535 		.v.pins = (const struct hda_pintbl[]) {
2536 			{ 0x18, PIN_VREF50 }, /* rear mic */
2537 			{ 0x19, PIN_VREF50 }, /* front mic */
2538 			{}
2539 		}
2540 	},
2541 };
2542 
2543 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2544 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2545 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2546 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2547 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2548 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2549 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2550 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2551 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2552 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2553 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2554 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2555 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2556 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2557 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2558 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2559 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2560 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2561 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2562 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2563 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2564 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2565 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2566 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2567 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2568 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2569 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2570 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2571 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2572 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2573 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2574 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2575 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2576 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2577 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2578 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2579 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2580 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2581 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2582 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2583 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2584 
2585 	/* All Apple entries are in codec SSIDs */
2586 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2587 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2588 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2589 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2590 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2591 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2592 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2593 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2594 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2595 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2596 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2597 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2598 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2599 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2600 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2601 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2602 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2603 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2604 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2605 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2606 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2607 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2608 
2609 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2610 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2611 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2612 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2613 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2614 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2615 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2616 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2617 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2618 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2619 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2620 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2621 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2622 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2623 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2624 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2625 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2626 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2627 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2628 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2631 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2632 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2633 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2634 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2635 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2636 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2637 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2638 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2639 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2640 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2641 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2642 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2643 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2644 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2645 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2646 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2647 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2648 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2649 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2650 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2651 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2652 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2653 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2654 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2655 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2656 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2658 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2659 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2660 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2661 	{}
2662 };
2663 
2664 static const struct hda_model_fixup alc882_fixup_models[] = {
2665 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2666 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2667 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2668 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2669 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2670 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2671 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2672 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2673 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2674 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2675 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2676 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2677 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2678 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2679 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2680 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2681 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2682 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2683 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2684 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2685 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2686 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2687 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2688 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2689 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2690 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2691 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2692 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2693 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2694 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2695 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2696 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2697 	{}
2698 };
2699 
2700 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2701 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2702 		{0x14, 0x01014010},
2703 		{0x15, 0x01011012},
2704 		{0x16, 0x01016011},
2705 		{0x18, 0x01a19040},
2706 		{0x19, 0x02a19050},
2707 		{0x1a, 0x0181304f},
2708 		{0x1b, 0x0221401f},
2709 		{0x1e, 0x01456130}),
2710 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2711 		{0x14, 0x01015010},
2712 		{0x15, 0x01011012},
2713 		{0x16, 0x01011011},
2714 		{0x18, 0x01a11040},
2715 		{0x19, 0x02a19050},
2716 		{0x1a, 0x0181104f},
2717 		{0x1b, 0x0221401f},
2718 		{0x1e, 0x01451130}),
2719 	{}
2720 };
2721 
2722 /*
2723  * BIOS auto configuration
2724  */
2725 /* almost identical with ALC880 parser... */
2726 static int alc882_parse_auto_config(struct hda_codec *codec)
2727 {
2728 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2729 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2730 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2731 }
2732 
2733 /*
2734  */
2735 static int patch_alc882(struct hda_codec *codec)
2736 {
2737 	struct alc_spec *spec;
2738 	int err;
2739 
2740 	err = alc_alloc_spec(codec, 0x0b);
2741 	if (err < 0)
2742 		return err;
2743 
2744 	spec = codec->spec;
2745 
2746 	switch (codec->core.vendor_id) {
2747 	case 0x10ec0882:
2748 	case 0x10ec0885:
2749 	case 0x10ec0900:
2750 	case 0x10ec0b00:
2751 	case 0x10ec1220:
2752 		break;
2753 	default:
2754 		/* ALC883 and variants */
2755 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2756 		break;
2757 	}
2758 
2759 	alc_pre_init(codec);
2760 
2761 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2762 		       alc882_fixups);
2763 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2764 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2765 
2766 	alc_auto_parse_customize_define(codec);
2767 
2768 	if (has_cdefine_beep(codec))
2769 		spec->gen.beep_nid = 0x01;
2770 
2771 	/* automatic parse from the BIOS config */
2772 	err = alc882_parse_auto_config(codec);
2773 	if (err < 0)
2774 		goto error;
2775 
2776 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2777 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2778 		if (err < 0)
2779 			goto error;
2780 	}
2781 
2782 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2783 
2784 	return 0;
2785 
2786  error:
2787 	alc_free(codec);
2788 	return err;
2789 }
2790 
2791 
2792 /*
2793  * ALC262 support
2794  */
2795 static int alc262_parse_auto_config(struct hda_codec *codec)
2796 {
2797 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2798 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2799 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2800 }
2801 
2802 /*
2803  * Pin config fixes
2804  */
2805 enum {
2806 	ALC262_FIXUP_FSC_H270,
2807 	ALC262_FIXUP_FSC_S7110,
2808 	ALC262_FIXUP_HP_Z200,
2809 	ALC262_FIXUP_TYAN,
2810 	ALC262_FIXUP_LENOVO_3000,
2811 	ALC262_FIXUP_BENQ,
2812 	ALC262_FIXUP_BENQ_T31,
2813 	ALC262_FIXUP_INV_DMIC,
2814 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2815 };
2816 
2817 static const struct hda_fixup alc262_fixups[] = {
2818 	[ALC262_FIXUP_FSC_H270] = {
2819 		.type = HDA_FIXUP_PINS,
2820 		.v.pins = (const struct hda_pintbl[]) {
2821 			{ 0x14, 0x99130110 }, /* speaker */
2822 			{ 0x15, 0x0221142f }, /* front HP */
2823 			{ 0x1b, 0x0121141f }, /* rear HP */
2824 			{ }
2825 		}
2826 	},
2827 	[ALC262_FIXUP_FSC_S7110] = {
2828 		.type = HDA_FIXUP_PINS,
2829 		.v.pins = (const struct hda_pintbl[]) {
2830 			{ 0x15, 0x90170110 }, /* speaker */
2831 			{ }
2832 		},
2833 		.chained = true,
2834 		.chain_id = ALC262_FIXUP_BENQ,
2835 	},
2836 	[ALC262_FIXUP_HP_Z200] = {
2837 		.type = HDA_FIXUP_PINS,
2838 		.v.pins = (const struct hda_pintbl[]) {
2839 			{ 0x16, 0x99130120 }, /* internal speaker */
2840 			{ }
2841 		}
2842 	},
2843 	[ALC262_FIXUP_TYAN] = {
2844 		.type = HDA_FIXUP_PINS,
2845 		.v.pins = (const struct hda_pintbl[]) {
2846 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2847 			{ }
2848 		}
2849 	},
2850 	[ALC262_FIXUP_LENOVO_3000] = {
2851 		.type = HDA_FIXUP_PINCTLS,
2852 		.v.pins = (const struct hda_pintbl[]) {
2853 			{ 0x19, PIN_VREF50 },
2854 			{}
2855 		},
2856 		.chained = true,
2857 		.chain_id = ALC262_FIXUP_BENQ,
2858 	},
2859 	[ALC262_FIXUP_BENQ] = {
2860 		.type = HDA_FIXUP_VERBS,
2861 		.v.verbs = (const struct hda_verb[]) {
2862 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2863 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2864 			{}
2865 		}
2866 	},
2867 	[ALC262_FIXUP_BENQ_T31] = {
2868 		.type = HDA_FIXUP_VERBS,
2869 		.v.verbs = (const struct hda_verb[]) {
2870 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2871 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2872 			{}
2873 		}
2874 	},
2875 	[ALC262_FIXUP_INV_DMIC] = {
2876 		.type = HDA_FIXUP_FUNC,
2877 		.v.func = alc_fixup_inv_dmic,
2878 	},
2879 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2880 		.type = HDA_FIXUP_FUNC,
2881 		.v.func = alc_fixup_no_depop_delay,
2882 	},
2883 };
2884 
2885 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2886 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2887 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2888 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2889 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2890 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2891 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2892 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2893 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2894 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2895 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2896 	{}
2897 };
2898 
2899 static const struct hda_model_fixup alc262_fixup_models[] = {
2900 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2901 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2902 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2903 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2904 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2905 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2906 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2907 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2908 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2909 	{}
2910 };
2911 
2912 /*
2913  */
2914 static int patch_alc262(struct hda_codec *codec)
2915 {
2916 	struct alc_spec *spec;
2917 	int err;
2918 
2919 	err = alc_alloc_spec(codec, 0x0b);
2920 	if (err < 0)
2921 		return err;
2922 
2923 	spec = codec->spec;
2924 	spec->gen.shared_mic_vref_pin = 0x18;
2925 
2926 	spec->shutup = alc_eapd_shutup;
2927 
2928 #if 0
2929 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2930 	 * under-run
2931 	 */
2932 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2933 #endif
2934 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2935 
2936 	alc_pre_init(codec);
2937 
2938 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2939 		       alc262_fixups);
2940 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2941 
2942 	alc_auto_parse_customize_define(codec);
2943 
2944 	if (has_cdefine_beep(codec))
2945 		spec->gen.beep_nid = 0x01;
2946 
2947 	/* automatic parse from the BIOS config */
2948 	err = alc262_parse_auto_config(codec);
2949 	if (err < 0)
2950 		goto error;
2951 
2952 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2953 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2954 		if (err < 0)
2955 			goto error;
2956 	}
2957 
2958 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2959 
2960 	return 0;
2961 
2962  error:
2963 	alc_free(codec);
2964 	return err;
2965 }
2966 
2967 /*
2968  *  ALC268
2969  */
2970 /* bind Beep switches of both NID 0x0f and 0x10 */
2971 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2972 				  struct snd_ctl_elem_value *ucontrol)
2973 {
2974 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2975 	unsigned long pval;
2976 	int err;
2977 
2978 	mutex_lock(&codec->control_mutex);
2979 	pval = kcontrol->private_value;
2980 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
2981 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2982 	if (err >= 0) {
2983 		kcontrol->private_value = (pval & ~0xff) | 0x10;
2984 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2985 	}
2986 	kcontrol->private_value = pval;
2987 	mutex_unlock(&codec->control_mutex);
2988 	return err;
2989 }
2990 
2991 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2992 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2993 	{
2994 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2995 		.name = "Beep Playback Switch",
2996 		.subdevice = HDA_SUBDEV_AMP_FLAG,
2997 		.info = snd_hda_mixer_amp_switch_info,
2998 		.get = snd_hda_mixer_amp_switch_get,
2999 		.put = alc268_beep_switch_put,
3000 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3001 	},
3002 };
3003 
3004 /* set PCBEEP vol = 0, mute connections */
3005 static const struct hda_verb alc268_beep_init_verbs[] = {
3006 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3007 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3008 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3009 	{ }
3010 };
3011 
3012 enum {
3013 	ALC268_FIXUP_INV_DMIC,
3014 	ALC268_FIXUP_HP_EAPD,
3015 	ALC268_FIXUP_SPDIF,
3016 };
3017 
3018 static const struct hda_fixup alc268_fixups[] = {
3019 	[ALC268_FIXUP_INV_DMIC] = {
3020 		.type = HDA_FIXUP_FUNC,
3021 		.v.func = alc_fixup_inv_dmic,
3022 	},
3023 	[ALC268_FIXUP_HP_EAPD] = {
3024 		.type = HDA_FIXUP_VERBS,
3025 		.v.verbs = (const struct hda_verb[]) {
3026 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3027 			{}
3028 		}
3029 	},
3030 	[ALC268_FIXUP_SPDIF] = {
3031 		.type = HDA_FIXUP_PINS,
3032 		.v.pins = (const struct hda_pintbl[]) {
3033 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3034 			{}
3035 		}
3036 	},
3037 };
3038 
3039 static const struct hda_model_fixup alc268_fixup_models[] = {
3040 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3041 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3042 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3043 	{}
3044 };
3045 
3046 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3047 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3048 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3049 	/* below is codec SSID since multiple Toshiba laptops have the
3050 	 * same PCI SSID 1179:ff00
3051 	 */
3052 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3053 	{}
3054 };
3055 
3056 /*
3057  * BIOS auto configuration
3058  */
3059 static int alc268_parse_auto_config(struct hda_codec *codec)
3060 {
3061 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3062 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3063 }
3064 
3065 /*
3066  */
3067 static int patch_alc268(struct hda_codec *codec)
3068 {
3069 	struct alc_spec *spec;
3070 	int i, err;
3071 
3072 	/* ALC268 has no aa-loopback mixer */
3073 	err = alc_alloc_spec(codec, 0);
3074 	if (err < 0)
3075 		return err;
3076 
3077 	spec = codec->spec;
3078 	if (has_cdefine_beep(codec))
3079 		spec->gen.beep_nid = 0x01;
3080 
3081 	spec->shutup = alc_eapd_shutup;
3082 
3083 	alc_pre_init(codec);
3084 
3085 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3086 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3087 
3088 	/* automatic parse from the BIOS config */
3089 	err = alc268_parse_auto_config(codec);
3090 	if (err < 0)
3091 		goto error;
3092 
3093 	if (err > 0 && !spec->gen.no_analog &&
3094 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3095 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3096 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3097 						  &alc268_beep_mixer[i])) {
3098 				err = -ENOMEM;
3099 				goto error;
3100 			}
3101 		}
3102 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3103 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3104 			/* override the amp caps for beep generator */
3105 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3106 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3107 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3108 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3109 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3110 	}
3111 
3112 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3113 
3114 	return 0;
3115 
3116  error:
3117 	alc_free(codec);
3118 	return err;
3119 }
3120 
3121 /*
3122  * ALC269
3123  */
3124 
3125 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3126 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3127 };
3128 
3129 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3130 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3131 };
3132 
3133 /* different alc269-variants */
3134 enum {
3135 	ALC269_TYPE_ALC269VA,
3136 	ALC269_TYPE_ALC269VB,
3137 	ALC269_TYPE_ALC269VC,
3138 	ALC269_TYPE_ALC269VD,
3139 	ALC269_TYPE_ALC280,
3140 	ALC269_TYPE_ALC282,
3141 	ALC269_TYPE_ALC283,
3142 	ALC269_TYPE_ALC284,
3143 	ALC269_TYPE_ALC293,
3144 	ALC269_TYPE_ALC286,
3145 	ALC269_TYPE_ALC298,
3146 	ALC269_TYPE_ALC255,
3147 	ALC269_TYPE_ALC256,
3148 	ALC269_TYPE_ALC257,
3149 	ALC269_TYPE_ALC215,
3150 	ALC269_TYPE_ALC225,
3151 	ALC269_TYPE_ALC245,
3152 	ALC269_TYPE_ALC287,
3153 	ALC269_TYPE_ALC294,
3154 	ALC269_TYPE_ALC300,
3155 	ALC269_TYPE_ALC623,
3156 	ALC269_TYPE_ALC700,
3157 };
3158 
3159 /*
3160  * BIOS auto configuration
3161  */
3162 static int alc269_parse_auto_config(struct hda_codec *codec)
3163 {
3164 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3165 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3166 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3167 	struct alc_spec *spec = codec->spec;
3168 	const hda_nid_t *ssids;
3169 
3170 	switch (spec->codec_variant) {
3171 	case ALC269_TYPE_ALC269VA:
3172 	case ALC269_TYPE_ALC269VC:
3173 	case ALC269_TYPE_ALC280:
3174 	case ALC269_TYPE_ALC284:
3175 	case ALC269_TYPE_ALC293:
3176 		ssids = alc269va_ssids;
3177 		break;
3178 	case ALC269_TYPE_ALC269VB:
3179 	case ALC269_TYPE_ALC269VD:
3180 	case ALC269_TYPE_ALC282:
3181 	case ALC269_TYPE_ALC283:
3182 	case ALC269_TYPE_ALC286:
3183 	case ALC269_TYPE_ALC298:
3184 	case ALC269_TYPE_ALC255:
3185 	case ALC269_TYPE_ALC256:
3186 	case ALC269_TYPE_ALC257:
3187 	case ALC269_TYPE_ALC215:
3188 	case ALC269_TYPE_ALC225:
3189 	case ALC269_TYPE_ALC245:
3190 	case ALC269_TYPE_ALC287:
3191 	case ALC269_TYPE_ALC294:
3192 	case ALC269_TYPE_ALC300:
3193 	case ALC269_TYPE_ALC623:
3194 	case ALC269_TYPE_ALC700:
3195 		ssids = alc269_ssids;
3196 		break;
3197 	default:
3198 		ssids = alc269_ssids;
3199 		break;
3200 	}
3201 
3202 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3203 }
3204 
3205 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3206 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3207 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3208 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3209 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3210 	{}
3211 };
3212 
3213 static void alc_headset_btn_callback(struct hda_codec *codec,
3214 				     struct hda_jack_callback *jack)
3215 {
3216 	int report = 0;
3217 
3218 	if (jack->unsol_res & (7 << 13))
3219 		report |= SND_JACK_BTN_0;
3220 
3221 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3222 		report |= SND_JACK_BTN_1;
3223 
3224 	/* Volume up key */
3225 	if (jack->unsol_res & (7 << 23))
3226 		report |= SND_JACK_BTN_2;
3227 
3228 	/* Volume down key */
3229 	if (jack->unsol_res & (7 << 10))
3230 		report |= SND_JACK_BTN_3;
3231 
3232 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3233 }
3234 
3235 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3236 {
3237 	struct alc_spec *spec = codec->spec;
3238 
3239 	if (!spec->has_hs_key)
3240 		return;
3241 
3242 	switch (codec->core.vendor_id) {
3243 	case 0x10ec0215:
3244 	case 0x10ec0225:
3245 	case 0x10ec0285:
3246 	case 0x10ec0287:
3247 	case 0x10ec0295:
3248 	case 0x10ec0289:
3249 	case 0x10ec0299:
3250 		alc_write_coef_idx(codec, 0x48, 0x0);
3251 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3252 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3253 		break;
3254 	case 0x10ec0230:
3255 	case 0x10ec0236:
3256 	case 0x10ec0256:
3257 	case 0x19e58326:
3258 		alc_write_coef_idx(codec, 0x48, 0x0);
3259 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3260 		break;
3261 	}
3262 }
3263 
3264 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3265 {
3266 	struct alc_spec *spec = codec->spec;
3267 
3268 	if (!spec->has_hs_key)
3269 		return;
3270 
3271 	switch (codec->core.vendor_id) {
3272 	case 0x10ec0215:
3273 	case 0x10ec0225:
3274 	case 0x10ec0285:
3275 	case 0x10ec0287:
3276 	case 0x10ec0295:
3277 	case 0x10ec0289:
3278 	case 0x10ec0299:
3279 		alc_write_coef_idx(codec, 0x48, 0xd011);
3280 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3281 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3282 		break;
3283 	case 0x10ec0230:
3284 	case 0x10ec0236:
3285 	case 0x10ec0256:
3286 	case 0x19e58326:
3287 		alc_write_coef_idx(codec, 0x48, 0xd011);
3288 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3289 		break;
3290 	}
3291 }
3292 
3293 static void alc_fixup_headset_jack(struct hda_codec *codec,
3294 				    const struct hda_fixup *fix, int action)
3295 {
3296 	struct alc_spec *spec = codec->spec;
3297 	hda_nid_t hp_pin;
3298 
3299 	switch (action) {
3300 	case HDA_FIXUP_ACT_PRE_PROBE:
3301 		spec->has_hs_key = 1;
3302 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3303 						    alc_headset_btn_callback);
3304 		break;
3305 	case HDA_FIXUP_ACT_BUILD:
3306 		hp_pin = alc_get_hp_pin(spec);
3307 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3308 							alc_headset_btn_keymap,
3309 							hp_pin))
3310 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3311 					      false, SND_JACK_HEADSET,
3312 					      alc_headset_btn_keymap);
3313 
3314 		alc_enable_headset_jack_key(codec);
3315 		break;
3316 	}
3317 }
3318 
3319 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3320 {
3321 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3322 }
3323 
3324 static void alc269_shutup(struct hda_codec *codec)
3325 {
3326 	struct alc_spec *spec = codec->spec;
3327 
3328 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3329 		alc269vb_toggle_power_output(codec, 0);
3330 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3331 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3332 		msleep(150);
3333 	}
3334 	alc_shutup_pins(codec);
3335 }
3336 
3337 static const struct coef_fw alc282_coefs[] = {
3338 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3339 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3340 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3341 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3342 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3343 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3344 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3345 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3346 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3347 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3348 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3349 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3350 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3351 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3352 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3353 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3354 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3355 	WRITE_COEF(0x63, 0x2902), /* PLL */
3356 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3357 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3358 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3359 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3360 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3361 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3362 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3363 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3364 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3365 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3366 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3367 	{}
3368 };
3369 
3370 static void alc282_restore_default_value(struct hda_codec *codec)
3371 {
3372 	alc_process_coef_fw(codec, alc282_coefs);
3373 }
3374 
3375 static void alc282_init(struct hda_codec *codec)
3376 {
3377 	struct alc_spec *spec = codec->spec;
3378 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3379 	bool hp_pin_sense;
3380 	int coef78;
3381 
3382 	alc282_restore_default_value(codec);
3383 
3384 	if (!hp_pin)
3385 		return;
3386 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3387 	coef78 = alc_read_coef_idx(codec, 0x78);
3388 
3389 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3390 	/* Headphone capless set to high power mode */
3391 	alc_write_coef_idx(codec, 0x78, 0x9004);
3392 
3393 	if (hp_pin_sense)
3394 		msleep(2);
3395 
3396 	snd_hda_codec_write(codec, hp_pin, 0,
3397 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3398 
3399 	if (hp_pin_sense)
3400 		msleep(85);
3401 
3402 	snd_hda_codec_write(codec, hp_pin, 0,
3403 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3404 
3405 	if (hp_pin_sense)
3406 		msleep(100);
3407 
3408 	/* Headphone capless set to normal mode */
3409 	alc_write_coef_idx(codec, 0x78, coef78);
3410 }
3411 
3412 static void alc282_shutup(struct hda_codec *codec)
3413 {
3414 	struct alc_spec *spec = codec->spec;
3415 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3416 	bool hp_pin_sense;
3417 	int coef78;
3418 
3419 	if (!hp_pin) {
3420 		alc269_shutup(codec);
3421 		return;
3422 	}
3423 
3424 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3425 	coef78 = alc_read_coef_idx(codec, 0x78);
3426 	alc_write_coef_idx(codec, 0x78, 0x9004);
3427 
3428 	if (hp_pin_sense)
3429 		msleep(2);
3430 
3431 	snd_hda_codec_write(codec, hp_pin, 0,
3432 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3433 
3434 	if (hp_pin_sense)
3435 		msleep(85);
3436 
3437 	if (!spec->no_shutup_pins)
3438 		snd_hda_codec_write(codec, hp_pin, 0,
3439 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3440 
3441 	if (hp_pin_sense)
3442 		msleep(100);
3443 
3444 	alc_auto_setup_eapd(codec, false);
3445 	alc_shutup_pins(codec);
3446 	alc_write_coef_idx(codec, 0x78, coef78);
3447 }
3448 
3449 static const struct coef_fw alc283_coefs[] = {
3450 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3451 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3452 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3453 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3454 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3455 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3456 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3457 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3458 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3459 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3460 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3461 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3462 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3463 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3464 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3465 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3466 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3467 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3468 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3469 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3470 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3471 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3472 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3473 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3474 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3475 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3476 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3477 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3478 	WRITE_COEF(0x49, 0x0), /* test mode */
3479 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3480 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3481 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3482 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3483 	{}
3484 };
3485 
3486 static void alc283_restore_default_value(struct hda_codec *codec)
3487 {
3488 	alc_process_coef_fw(codec, alc283_coefs);
3489 }
3490 
3491 static void alc283_init(struct hda_codec *codec)
3492 {
3493 	struct alc_spec *spec = codec->spec;
3494 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3495 	bool hp_pin_sense;
3496 
3497 	alc283_restore_default_value(codec);
3498 
3499 	if (!hp_pin)
3500 		return;
3501 
3502 	msleep(30);
3503 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3504 
3505 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3506 	/* Headphone capless set to high power mode */
3507 	alc_write_coef_idx(codec, 0x43, 0x9004);
3508 
3509 	snd_hda_codec_write(codec, hp_pin, 0,
3510 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3511 
3512 	if (hp_pin_sense)
3513 		msleep(85);
3514 
3515 	snd_hda_codec_write(codec, hp_pin, 0,
3516 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3517 
3518 	if (hp_pin_sense)
3519 		msleep(85);
3520 	/* Index 0x46 Combo jack auto switch control 2 */
3521 	/* 3k pull low control for Headset jack. */
3522 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3523 	/* Headphone capless set to normal mode */
3524 	alc_write_coef_idx(codec, 0x43, 0x9614);
3525 }
3526 
3527 static void alc283_shutup(struct hda_codec *codec)
3528 {
3529 	struct alc_spec *spec = codec->spec;
3530 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3531 	bool hp_pin_sense;
3532 
3533 	if (!hp_pin) {
3534 		alc269_shutup(codec);
3535 		return;
3536 	}
3537 
3538 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3539 
3540 	alc_write_coef_idx(codec, 0x43, 0x9004);
3541 
3542 	/*depop hp during suspend*/
3543 	alc_write_coef_idx(codec, 0x06, 0x2100);
3544 
3545 	snd_hda_codec_write(codec, hp_pin, 0,
3546 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3547 
3548 	if (hp_pin_sense)
3549 		msleep(100);
3550 
3551 	if (!spec->no_shutup_pins)
3552 		snd_hda_codec_write(codec, hp_pin, 0,
3553 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3554 
3555 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3556 
3557 	if (hp_pin_sense)
3558 		msleep(100);
3559 	alc_auto_setup_eapd(codec, false);
3560 	alc_shutup_pins(codec);
3561 	alc_write_coef_idx(codec, 0x43, 0x9614);
3562 }
3563 
3564 static void alc256_init(struct hda_codec *codec)
3565 {
3566 	struct alc_spec *spec = codec->spec;
3567 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3568 	bool hp_pin_sense;
3569 
3570 	if (spec->ultra_low_power) {
3571 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3572 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3573 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3574 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3575 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3576 		msleep(30);
3577 	}
3578 
3579 	if (!hp_pin)
3580 		hp_pin = 0x21;
3581 
3582 	msleep(30);
3583 
3584 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3585 
3586 	if (hp_pin_sense)
3587 		msleep(2);
3588 
3589 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3590 
3591 	snd_hda_codec_write(codec, hp_pin, 0,
3592 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3593 
3594 	if (hp_pin_sense || spec->ultra_low_power)
3595 		msleep(85);
3596 
3597 	snd_hda_codec_write(codec, hp_pin, 0,
3598 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3599 
3600 	if (hp_pin_sense || spec->ultra_low_power)
3601 		msleep(100);
3602 
3603 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3604 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3605 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3606 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3607 	/*
3608 	 * Expose headphone mic (or possibly Line In on some machines) instead
3609 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3610 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3611 	 * this register.
3612 	 */
3613 	alc_write_coef_idx(codec, 0x36, 0x5757);
3614 }
3615 
3616 static void alc256_shutup(struct hda_codec *codec)
3617 {
3618 	struct alc_spec *spec = codec->spec;
3619 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3620 	bool hp_pin_sense;
3621 
3622 	if (!hp_pin)
3623 		hp_pin = 0x21;
3624 
3625 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3626 
3627 	if (hp_pin_sense)
3628 		msleep(2);
3629 
3630 	snd_hda_codec_write(codec, hp_pin, 0,
3631 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3632 
3633 	if (hp_pin_sense || spec->ultra_low_power)
3634 		msleep(85);
3635 
3636 	/* 3k pull low control for Headset jack. */
3637 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3638 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3639 	 * when booting with headset plugged. So skip setting it for the codec alc257
3640 	 */
3641 	if (codec->core.vendor_id != 0x10ec0236 &&
3642 	    codec->core.vendor_id != 0x10ec0257)
3643 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3644 
3645 	if (!spec->no_shutup_pins)
3646 		snd_hda_codec_write(codec, hp_pin, 0,
3647 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3648 
3649 	if (hp_pin_sense || spec->ultra_low_power)
3650 		msleep(100);
3651 
3652 	alc_auto_setup_eapd(codec, false);
3653 	alc_shutup_pins(codec);
3654 	if (spec->ultra_low_power) {
3655 		msleep(50);
3656 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3657 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3658 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3659 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3660 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3661 		msleep(30);
3662 	}
3663 }
3664 
3665 static void alc285_hp_init(struct hda_codec *codec)
3666 {
3667 	struct alc_spec *spec = codec->spec;
3668 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3669 	int i, val;
3670 	int coef38, coef0d, coef36;
3671 
3672 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3673 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3674 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3675 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3676 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3677 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3678 
3679 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3680 
3681 	if (hp_pin)
3682 		snd_hda_codec_write(codec, hp_pin, 0,
3683 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3684 
3685 	msleep(130);
3686 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3687 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3688 
3689 	if (hp_pin)
3690 		snd_hda_codec_write(codec, hp_pin, 0,
3691 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3692 	msleep(10);
3693 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3694 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3695 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3696 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3697 
3698 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3699 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3700 	for (i = 0; i < 20 && val & 0x8000; i++) {
3701 		msleep(50);
3702 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3703 	} /* Wait for depop procedure finish  */
3704 
3705 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3706 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3707 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3708 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3709 
3710 	msleep(50);
3711 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3712 }
3713 
3714 static void alc225_init(struct hda_codec *codec)
3715 {
3716 	struct alc_spec *spec = codec->spec;
3717 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3718 	bool hp1_pin_sense, hp2_pin_sense;
3719 
3720 	if (spec->ultra_low_power) {
3721 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3722 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3723 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3724 		msleep(30);
3725 	}
3726 
3727 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3728 		spec->codec_variant != ALC269_TYPE_ALC245)
3729 		/* required only at boot or S3 and S4 resume time */
3730 		if (!spec->done_hp_init ||
3731 			is_s3_resume(codec) ||
3732 			is_s4_resume(codec)) {
3733 			alc285_hp_init(codec);
3734 			spec->done_hp_init = true;
3735 		}
3736 
3737 	if (!hp_pin)
3738 		hp_pin = 0x21;
3739 	msleep(30);
3740 
3741 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3742 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3743 
3744 	if (hp1_pin_sense || hp2_pin_sense)
3745 		msleep(2);
3746 
3747 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3748 
3749 	if (hp1_pin_sense || spec->ultra_low_power)
3750 		snd_hda_codec_write(codec, hp_pin, 0,
3751 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3752 	if (hp2_pin_sense)
3753 		snd_hda_codec_write(codec, 0x16, 0,
3754 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3755 
3756 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3757 		msleep(85);
3758 
3759 	if (hp1_pin_sense || spec->ultra_low_power)
3760 		snd_hda_codec_write(codec, hp_pin, 0,
3761 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3762 	if (hp2_pin_sense)
3763 		snd_hda_codec_write(codec, 0x16, 0,
3764 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3765 
3766 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3767 		msleep(100);
3768 
3769 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3770 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3771 }
3772 
3773 static void alc225_shutup(struct hda_codec *codec)
3774 {
3775 	struct alc_spec *spec = codec->spec;
3776 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3777 	bool hp1_pin_sense, hp2_pin_sense;
3778 
3779 	if (!hp_pin)
3780 		hp_pin = 0x21;
3781 
3782 	alc_disable_headset_jack_key(codec);
3783 	/* 3k pull low control for Headset jack. */
3784 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3785 
3786 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3787 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3788 
3789 	if (hp1_pin_sense || hp2_pin_sense)
3790 		msleep(2);
3791 
3792 	if (hp1_pin_sense || spec->ultra_low_power)
3793 		snd_hda_codec_write(codec, hp_pin, 0,
3794 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3795 	if (hp2_pin_sense)
3796 		snd_hda_codec_write(codec, 0x16, 0,
3797 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3798 
3799 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3800 		msleep(85);
3801 
3802 	if (hp1_pin_sense || spec->ultra_low_power)
3803 		snd_hda_codec_write(codec, hp_pin, 0,
3804 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3805 	if (hp2_pin_sense)
3806 		snd_hda_codec_write(codec, 0x16, 0,
3807 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3808 
3809 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3810 		msleep(100);
3811 
3812 	alc_auto_setup_eapd(codec, false);
3813 	alc_shutup_pins(codec);
3814 	if (spec->ultra_low_power) {
3815 		msleep(50);
3816 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3817 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3818 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3819 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3820 		msleep(30);
3821 	}
3822 
3823 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3824 	alc_enable_headset_jack_key(codec);
3825 }
3826 
3827 static void alc_default_init(struct hda_codec *codec)
3828 {
3829 	struct alc_spec *spec = codec->spec;
3830 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3831 	bool hp_pin_sense;
3832 
3833 	if (!hp_pin)
3834 		return;
3835 
3836 	msleep(30);
3837 
3838 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3839 
3840 	if (hp_pin_sense)
3841 		msleep(2);
3842 
3843 	snd_hda_codec_write(codec, hp_pin, 0,
3844 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3845 
3846 	if (hp_pin_sense)
3847 		msleep(85);
3848 
3849 	snd_hda_codec_write(codec, hp_pin, 0,
3850 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3851 
3852 	if (hp_pin_sense)
3853 		msleep(100);
3854 }
3855 
3856 static void alc_default_shutup(struct hda_codec *codec)
3857 {
3858 	struct alc_spec *spec = codec->spec;
3859 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3860 	bool hp_pin_sense;
3861 
3862 	if (!hp_pin) {
3863 		alc269_shutup(codec);
3864 		return;
3865 	}
3866 
3867 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3868 
3869 	if (hp_pin_sense)
3870 		msleep(2);
3871 
3872 	snd_hda_codec_write(codec, hp_pin, 0,
3873 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3874 
3875 	if (hp_pin_sense)
3876 		msleep(85);
3877 
3878 	if (!spec->no_shutup_pins)
3879 		snd_hda_codec_write(codec, hp_pin, 0,
3880 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3881 
3882 	if (hp_pin_sense)
3883 		msleep(100);
3884 
3885 	alc_auto_setup_eapd(codec, false);
3886 	alc_shutup_pins(codec);
3887 }
3888 
3889 static void alc294_hp_init(struct hda_codec *codec)
3890 {
3891 	struct alc_spec *spec = codec->spec;
3892 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3893 	int i, val;
3894 
3895 	if (!hp_pin)
3896 		return;
3897 
3898 	snd_hda_codec_write(codec, hp_pin, 0,
3899 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3900 
3901 	msleep(100);
3902 
3903 	if (!spec->no_shutup_pins)
3904 		snd_hda_codec_write(codec, hp_pin, 0,
3905 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3906 
3907 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3908 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3909 
3910 	/* Wait for depop procedure finish  */
3911 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3912 	for (i = 0; i < 20 && val & 0x0080; i++) {
3913 		msleep(50);
3914 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3915 	}
3916 	/* Set HP depop to auto mode */
3917 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3918 	msleep(50);
3919 }
3920 
3921 static void alc294_init(struct hda_codec *codec)
3922 {
3923 	struct alc_spec *spec = codec->spec;
3924 
3925 	/* required only at boot or S4 resume time */
3926 	if (!spec->done_hp_init ||
3927 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3928 		alc294_hp_init(codec);
3929 		spec->done_hp_init = true;
3930 	}
3931 	alc_default_init(codec);
3932 }
3933 
3934 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3935 			     unsigned int val)
3936 {
3937 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3938 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3939 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3940 }
3941 
3942 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3943 {
3944 	unsigned int val;
3945 
3946 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3947 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3948 		& 0xffff;
3949 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3950 		<< 16;
3951 	return val;
3952 }
3953 
3954 static void alc5505_dsp_halt(struct hda_codec *codec)
3955 {
3956 	unsigned int val;
3957 
3958 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3959 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3960 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3961 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3962 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3963 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3964 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3965 	val = alc5505_coef_get(codec, 0x6220);
3966 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3967 }
3968 
3969 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3970 {
3971 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
3972 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3973 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3974 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3975 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
3976 	alc5505_coef_set(codec, 0x880c, 0x00000004);
3977 }
3978 
3979 static void alc5505_dsp_init(struct hda_codec *codec)
3980 {
3981 	unsigned int val;
3982 
3983 	alc5505_dsp_halt(codec);
3984 	alc5505_dsp_back_from_halt(codec);
3985 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3986 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
3987 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3988 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3989 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3990 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3991 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3992 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3993 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
3994 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
3995 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3996 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3997 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3998 
3999 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4000 	if (val <= 3)
4001 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4002 	else
4003 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4004 
4005 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4006 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4007 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4008 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4009 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4010 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4011 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4012 
4013 #ifdef HALT_REALTEK_ALC5505
4014 	alc5505_dsp_halt(codec);
4015 #endif
4016 }
4017 
4018 #ifdef HALT_REALTEK_ALC5505
4019 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4020 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4021 #else
4022 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4023 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4024 #endif
4025 
4026 #ifdef CONFIG_PM
4027 static int alc269_suspend(struct hda_codec *codec)
4028 {
4029 	struct alc_spec *spec = codec->spec;
4030 
4031 	if (spec->has_alc5505_dsp)
4032 		alc5505_dsp_suspend(codec);
4033 
4034 	return alc_suspend(codec);
4035 }
4036 
4037 static int alc269_resume(struct hda_codec *codec)
4038 {
4039 	struct alc_spec *spec = codec->spec;
4040 
4041 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4042 		alc269vb_toggle_power_output(codec, 0);
4043 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4044 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4045 		msleep(150);
4046 	}
4047 
4048 	codec->patch_ops.init(codec);
4049 
4050 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4051 		alc269vb_toggle_power_output(codec, 1);
4052 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4053 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4054 		msleep(200);
4055 	}
4056 
4057 	snd_hda_regmap_sync(codec);
4058 	hda_call_check_power_status(codec, 0x01);
4059 
4060 	/* on some machine, the BIOS will clear the codec gpio data when enter
4061 	 * suspend, and won't restore the data after resume, so we restore it
4062 	 * in the driver.
4063 	 */
4064 	if (spec->gpio_data)
4065 		alc_write_gpio_data(codec);
4066 
4067 	if (spec->has_alc5505_dsp)
4068 		alc5505_dsp_resume(codec);
4069 
4070 	return 0;
4071 }
4072 #endif /* CONFIG_PM */
4073 
4074 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4075 						 const struct hda_fixup *fix, int action)
4076 {
4077 	struct alc_spec *spec = codec->spec;
4078 
4079 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4080 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4081 }
4082 
4083 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4084 						 const struct hda_fixup *fix,
4085 						 int action)
4086 {
4087 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4088 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4089 
4090 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4091 		snd_hda_codec_set_pincfg(codec, 0x19,
4092 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4093 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4094 }
4095 
4096 static void alc269_fixup_hweq(struct hda_codec *codec,
4097 			       const struct hda_fixup *fix, int action)
4098 {
4099 	if (action == HDA_FIXUP_ACT_INIT)
4100 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4101 }
4102 
4103 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4104 				       const struct hda_fixup *fix, int action)
4105 {
4106 	struct alc_spec *spec = codec->spec;
4107 
4108 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4109 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4110 }
4111 
4112 static void alc271_fixup_dmic(struct hda_codec *codec,
4113 			      const struct hda_fixup *fix, int action)
4114 {
4115 	static const struct hda_verb verbs[] = {
4116 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4117 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4118 		{}
4119 	};
4120 	unsigned int cfg;
4121 
4122 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4123 	    strcmp(codec->core.chip_name, "ALC269VB"))
4124 		return;
4125 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4126 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4127 		snd_hda_sequence_write(codec, verbs);
4128 }
4129 
4130 /* Fix the speaker amp after resume, etc */
4131 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4132 					  const struct hda_fixup *fix,
4133 					  int action)
4134 {
4135 	if (action == HDA_FIXUP_ACT_INIT)
4136 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4137 }
4138 
4139 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4140 				 const struct hda_fixup *fix, int action)
4141 {
4142 	struct alc_spec *spec = codec->spec;
4143 
4144 	if (action != HDA_FIXUP_ACT_PROBE)
4145 		return;
4146 
4147 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4148 	 * fix the sample rate of analog I/O to 44.1kHz
4149 	 */
4150 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4151 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4152 }
4153 
4154 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4155 				     const struct hda_fixup *fix, int action)
4156 {
4157 	/* The digital-mic unit sends PDM (differential signal) instead of
4158 	 * the standard PCM, thus you can't record a valid mono stream as is.
4159 	 * Below is a workaround specific to ALC269 to control the dmic
4160 	 * signal source as mono.
4161 	 */
4162 	if (action == HDA_FIXUP_ACT_INIT)
4163 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4164 }
4165 
4166 static void alc269_quanta_automute(struct hda_codec *codec)
4167 {
4168 	snd_hda_gen_update_outputs(codec);
4169 
4170 	alc_write_coef_idx(codec, 0x0c, 0x680);
4171 	alc_write_coef_idx(codec, 0x0c, 0x480);
4172 }
4173 
4174 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4175 				     const struct hda_fixup *fix, int action)
4176 {
4177 	struct alc_spec *spec = codec->spec;
4178 	if (action != HDA_FIXUP_ACT_PROBE)
4179 		return;
4180 	spec->gen.automute_hook = alc269_quanta_automute;
4181 }
4182 
4183 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4184 					 struct hda_jack_callback *jack)
4185 {
4186 	struct alc_spec *spec = codec->spec;
4187 	int vref;
4188 	msleep(200);
4189 	snd_hda_gen_hp_automute(codec, jack);
4190 
4191 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4192 	msleep(100);
4193 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4194 			    vref);
4195 	msleep(500);
4196 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4197 			    vref);
4198 }
4199 
4200 /*
4201  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4202  */
4203 struct hda_alc298_mbxinit {
4204 	unsigned char value_0x23;
4205 	unsigned char value_0x25;
4206 };
4207 
4208 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4209 					 const struct hda_alc298_mbxinit *initval,
4210 					 bool first)
4211 {
4212 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4213 	alc_write_coef_idx(codec, 0x26, 0xb000);
4214 
4215 	if (first)
4216 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4217 
4218 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4219 	alc_write_coef_idx(codec, 0x26, 0xf000);
4220 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4221 
4222 	if (initval->value_0x23 != 0x1e)
4223 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4224 
4225 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4226 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4227 }
4228 
4229 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4230 					   const struct hda_fixup *fix,
4231 					   int action)
4232 {
4233 	/* Initialization magic */
4234 	static const struct hda_alc298_mbxinit dac_init[] = {
4235 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4236 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4237 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4238 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4239 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4240 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4241 		{0x2f, 0x00},
4242 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4243 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4244 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4245 		{}
4246 	};
4247 	const struct hda_alc298_mbxinit *seq;
4248 
4249 	if (action != HDA_FIXUP_ACT_INIT)
4250 		return;
4251 
4252 	/* Start */
4253 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4254 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4255 	alc_write_coef_idx(codec, 0x26, 0xf000);
4256 	alc_write_coef_idx(codec, 0x22, 0x31);
4257 	alc_write_coef_idx(codec, 0x23, 0x0b);
4258 	alc_write_coef_idx(codec, 0x25, 0x00);
4259 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4260 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4261 
4262 	for (seq = dac_init; seq->value_0x23; seq++)
4263 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4264 }
4265 
4266 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4267 				     const struct hda_fixup *fix, int action)
4268 {
4269 	struct alc_spec *spec = codec->spec;
4270 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4271 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4272 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4273 	}
4274 }
4275 
4276 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4277 				bool polarity, bool on)
4278 {
4279 	unsigned int pinval;
4280 
4281 	if (!pin)
4282 		return;
4283 	if (polarity)
4284 		on = !on;
4285 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4286 	pinval &= ~AC_PINCTL_VREFEN;
4287 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4288 	/* temporarily power up/down for setting VREF */
4289 	snd_hda_power_up_pm(codec);
4290 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4291 	snd_hda_power_down_pm(codec);
4292 }
4293 
4294 /* update mute-LED according to the speaker mute state via mic VREF pin */
4295 static int vref_mute_led_set(struct led_classdev *led_cdev,
4296 			     enum led_brightness brightness)
4297 {
4298 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4299 	struct alc_spec *spec = codec->spec;
4300 
4301 	alc_update_vref_led(codec, spec->mute_led_nid,
4302 			    spec->mute_led_polarity, brightness);
4303 	return 0;
4304 }
4305 
4306 /* Make sure the led works even in runtime suspend */
4307 static unsigned int led_power_filter(struct hda_codec *codec,
4308 						  hda_nid_t nid,
4309 						  unsigned int power_state)
4310 {
4311 	struct alc_spec *spec = codec->spec;
4312 
4313 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4314 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4315 		return power_state;
4316 
4317 	/* Set pin ctl again, it might have just been set to 0 */
4318 	snd_hda_set_pin_ctl(codec, nid,
4319 			    snd_hda_codec_get_pin_target(codec, nid));
4320 
4321 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4322 }
4323 
4324 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4325 				     const struct hda_fixup *fix, int action)
4326 {
4327 	struct alc_spec *spec = codec->spec;
4328 	const struct dmi_device *dev = NULL;
4329 
4330 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4331 		return;
4332 
4333 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4334 		int pol, pin;
4335 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4336 			continue;
4337 		if (pin < 0x0a || pin >= 0x10)
4338 			break;
4339 		spec->mute_led_polarity = pol;
4340 		spec->mute_led_nid = pin - 0x0a + 0x18;
4341 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4342 		codec->power_filter = led_power_filter;
4343 		codec_dbg(codec,
4344 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4345 			   spec->mute_led_polarity);
4346 		break;
4347 	}
4348 }
4349 
4350 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4351 					  const struct hda_fixup *fix,
4352 					  int action, hda_nid_t pin)
4353 {
4354 	struct alc_spec *spec = codec->spec;
4355 
4356 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4357 		spec->mute_led_polarity = 0;
4358 		spec->mute_led_nid = pin;
4359 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4360 		codec->power_filter = led_power_filter;
4361 	}
4362 }
4363 
4364 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4365 				const struct hda_fixup *fix, int action)
4366 {
4367 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4368 }
4369 
4370 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4371 				const struct hda_fixup *fix, int action)
4372 {
4373 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4374 }
4375 
4376 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4377 				const struct hda_fixup *fix, int action)
4378 {
4379 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4380 }
4381 
4382 /* update LED status via GPIO */
4383 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4384 				int polarity, bool enabled)
4385 {
4386 	if (polarity)
4387 		enabled = !enabled;
4388 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4389 }
4390 
4391 /* turn on/off mute LED via GPIO per vmaster hook */
4392 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4393 			     enum led_brightness brightness)
4394 {
4395 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4396 	struct alc_spec *spec = codec->spec;
4397 
4398 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4399 			    spec->mute_led_polarity, !brightness);
4400 	return 0;
4401 }
4402 
4403 /* turn on/off mic-mute LED via GPIO per capture hook */
4404 static int micmute_led_set(struct led_classdev *led_cdev,
4405 			   enum led_brightness brightness)
4406 {
4407 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4408 	struct alc_spec *spec = codec->spec;
4409 
4410 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4411 			    spec->micmute_led_polarity, !brightness);
4412 	return 0;
4413 }
4414 
4415 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4416 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4417 				  int action,
4418 				  unsigned int mute_mask,
4419 				  unsigned int micmute_mask)
4420 {
4421 	struct alc_spec *spec = codec->spec;
4422 
4423 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4424 
4425 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4426 		return;
4427 	if (mute_mask) {
4428 		spec->gpio_mute_led_mask = mute_mask;
4429 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4430 	}
4431 	if (micmute_mask) {
4432 		spec->gpio_mic_led_mask = micmute_mask;
4433 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4434 	}
4435 }
4436 
4437 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4438 				const struct hda_fixup *fix, int action)
4439 {
4440 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4441 }
4442 
4443 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4444 				const struct hda_fixup *fix, int action)
4445 {
4446 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4447 }
4448 
4449 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4450 				const struct hda_fixup *fix, int action)
4451 {
4452 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4453 }
4454 
4455 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4456 				const struct hda_fixup *fix, int action)
4457 {
4458 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4459 }
4460 
4461 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4462 				const struct hda_fixup *fix, int action)
4463 {
4464 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4465 }
4466 
4467 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4468 				const struct hda_fixup *fix, int action)
4469 {
4470 	struct alc_spec *spec = codec->spec;
4471 
4472 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4473 		spec->micmute_led_polarity = 1;
4474 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4475 }
4476 
4477 /* turn on/off mic-mute LED per capture hook via VREF change */
4478 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4479 				enum led_brightness brightness)
4480 {
4481 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4482 	struct alc_spec *spec = codec->spec;
4483 
4484 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4485 			    spec->micmute_led_polarity, brightness);
4486 	return 0;
4487 }
4488 
4489 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4490 				const struct hda_fixup *fix, int action)
4491 {
4492 	struct alc_spec *spec = codec->spec;
4493 
4494 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4495 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4496 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4497 		 * enable headphone amp
4498 		 */
4499 		spec->gpio_mask |= 0x10;
4500 		spec->gpio_dir |= 0x10;
4501 		spec->cap_mute_led_nid = 0x18;
4502 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4503 		codec->power_filter = led_power_filter;
4504 	}
4505 }
4506 
4507 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4508 				   const struct hda_fixup *fix, int action)
4509 {
4510 	struct alc_spec *spec = codec->spec;
4511 
4512 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4513 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4514 		spec->cap_mute_led_nid = 0x18;
4515 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4516 		codec->power_filter = led_power_filter;
4517 	}
4518 }
4519 
4520 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4521  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4522  */
4523 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4524 				     const struct hda_fixup *fix, int action)
4525 {
4526 	struct alc_spec *spec = codec->spec;
4527 
4528 	switch (action) {
4529 	case HDA_FIXUP_ACT_PRE_PROBE:
4530 		spec->gpio_mask |= 0x01;
4531 		spec->gpio_dir |= 0x01;
4532 		break;
4533 	case HDA_FIXUP_ACT_INIT:
4534 		/* need to toggle GPIO to enable the amp */
4535 		alc_update_gpio_data(codec, 0x01, true);
4536 		msleep(100);
4537 		alc_update_gpio_data(codec, 0x01, false);
4538 		break;
4539 	}
4540 }
4541 
4542 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4543 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4544 				    struct hda_codec *codec,
4545 				    struct snd_pcm_substream *substream,
4546 				    int action)
4547 {
4548 	switch (action) {
4549 	case HDA_GEN_PCM_ACT_PREPARE:
4550 		alc_update_gpio_data(codec, 0x04, true);
4551 		break;
4552 	case HDA_GEN_PCM_ACT_CLEANUP:
4553 		alc_update_gpio_data(codec, 0x04, false);
4554 		break;
4555 	}
4556 }
4557 
4558 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4559 				      const struct hda_fixup *fix,
4560 				      int action)
4561 {
4562 	struct alc_spec *spec = codec->spec;
4563 
4564 	if (action == HDA_FIXUP_ACT_PROBE) {
4565 		spec->gpio_mask |= 0x04;
4566 		spec->gpio_dir |= 0x04;
4567 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4568 	}
4569 }
4570 
4571 static void alc_update_coef_led(struct hda_codec *codec,
4572 				struct alc_coef_led *led,
4573 				bool polarity, bool on)
4574 {
4575 	if (polarity)
4576 		on = !on;
4577 	/* temporarily power up/down for setting COEF bit */
4578 	alc_update_coef_idx(codec, led->idx, led->mask,
4579 			    on ? led->on : led->off);
4580 }
4581 
4582 /* update mute-LED according to the speaker mute state via COEF bit */
4583 static int coef_mute_led_set(struct led_classdev *led_cdev,
4584 			     enum led_brightness brightness)
4585 {
4586 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4587 	struct alc_spec *spec = codec->spec;
4588 
4589 	alc_update_coef_led(codec, &spec->mute_led_coef,
4590 			    spec->mute_led_polarity, brightness);
4591 	return 0;
4592 }
4593 
4594 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4595 					  const struct hda_fixup *fix,
4596 					  int action)
4597 {
4598 	struct alc_spec *spec = codec->spec;
4599 
4600 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4601 		spec->mute_led_polarity = 0;
4602 		spec->mute_led_coef.idx = 0x0b;
4603 		spec->mute_led_coef.mask = 1 << 3;
4604 		spec->mute_led_coef.on = 1 << 3;
4605 		spec->mute_led_coef.off = 0;
4606 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4607 	}
4608 }
4609 
4610 static void alc236_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 = 0x34;
4619 		spec->mute_led_coef.mask = 1 << 5;
4620 		spec->mute_led_coef.on = 0;
4621 		spec->mute_led_coef.off = 1 << 5;
4622 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4623 	}
4624 }
4625 
4626 /* turn on/off mic-mute LED per capture hook by coef bit */
4627 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4628 				enum led_brightness brightness)
4629 {
4630 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4631 	struct alc_spec *spec = codec->spec;
4632 
4633 	alc_update_coef_led(codec, &spec->mic_led_coef,
4634 			    spec->micmute_led_polarity, brightness);
4635 	return 0;
4636 }
4637 
4638 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4639 				const struct hda_fixup *fix, int action)
4640 {
4641 	struct alc_spec *spec = codec->spec;
4642 
4643 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4644 		spec->mic_led_coef.idx = 0x19;
4645 		spec->mic_led_coef.mask = 1 << 13;
4646 		spec->mic_led_coef.on = 1 << 13;
4647 		spec->mic_led_coef.off = 0;
4648 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4649 	}
4650 }
4651 
4652 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4653 				const struct hda_fixup *fix, int action)
4654 {
4655 	struct alc_spec *spec = codec->spec;
4656 
4657 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4658 		spec->micmute_led_polarity = 1;
4659 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4660 }
4661 
4662 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4663 				const struct hda_fixup *fix, int action)
4664 {
4665 	struct alc_spec *spec = codec->spec;
4666 
4667 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4668 		spec->mic_led_coef.idx = 0x35;
4669 		spec->mic_led_coef.mask = 3 << 2;
4670 		spec->mic_led_coef.on = 2 << 2;
4671 		spec->mic_led_coef.off = 1 << 2;
4672 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4673 	}
4674 }
4675 
4676 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4677 				const struct hda_fixup *fix, int action)
4678 {
4679 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4680 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4681 }
4682 
4683 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4684 				const struct hda_fixup *fix, int action)
4685 {
4686 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4687 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4688 }
4689 
4690 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4691 				const struct hda_fixup *fix, int action)
4692 {
4693 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4694 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4695 }
4696 
4697 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4698 				const struct hda_fixup *fix, int action)
4699 {
4700 	struct alc_spec *spec = codec->spec;
4701 
4702 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4703 		spec->cap_mute_led_nid = 0x1a;
4704 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4705 		codec->power_filter = led_power_filter;
4706 	}
4707 }
4708 
4709 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4710 				const struct hda_fixup *fix, int action)
4711 {
4712 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4713 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4714 }
4715 
4716 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4717 						  const unsigned short coefs[2])
4718 {
4719 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4720 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4721 	alc_write_coef_idx(codec, 0x26, 0xb011);
4722 }
4723 
4724 struct alc298_samsung_amp_desc {
4725 	unsigned char nid;
4726 	unsigned short init_seq[2][2];
4727 };
4728 
4729 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4730 				     const struct hda_fixup *fix, int action)
4731 {
4732 	int i, j;
4733 	static const unsigned short init_seq[][2] = {
4734 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4735 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4736 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4737 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4738 	};
4739 	static const struct alc298_samsung_amp_desc amps[] = {
4740 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4741 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4742 	};
4743 
4744 	if (action != HDA_FIXUP_ACT_INIT)
4745 		return;
4746 
4747 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4748 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4749 
4750 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4751 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4752 
4753 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4754 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4755 	}
4756 }
4757 
4758 #if IS_REACHABLE(CONFIG_INPUT)
4759 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4760 				   struct hda_jack_callback *event)
4761 {
4762 	struct alc_spec *spec = codec->spec;
4763 
4764 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4765 	   send both key on and key off event for every interrupt. */
4766 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4767 	input_sync(spec->kb_dev);
4768 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4769 	input_sync(spec->kb_dev);
4770 }
4771 
4772 static int alc_register_micmute_input_device(struct hda_codec *codec)
4773 {
4774 	struct alc_spec *spec = codec->spec;
4775 	int i;
4776 
4777 	spec->kb_dev = input_allocate_device();
4778 	if (!spec->kb_dev) {
4779 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4780 		return -ENOMEM;
4781 	}
4782 
4783 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4784 
4785 	spec->kb_dev->name = "Microphone Mute Button";
4786 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4787 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4788 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4789 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4790 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4791 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4792 
4793 	if (input_register_device(spec->kb_dev)) {
4794 		codec_err(codec, "input_register_device failed\n");
4795 		input_free_device(spec->kb_dev);
4796 		spec->kb_dev = NULL;
4797 		return -ENOMEM;
4798 	}
4799 
4800 	return 0;
4801 }
4802 
4803 /* GPIO1 = set according to SKU external amp
4804  * GPIO2 = mic mute hotkey
4805  * GPIO3 = mute LED
4806  * GPIO4 = mic mute LED
4807  */
4808 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4809 					     const struct hda_fixup *fix, int action)
4810 {
4811 	struct alc_spec *spec = codec->spec;
4812 
4813 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4814 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4815 		spec->init_amp = ALC_INIT_DEFAULT;
4816 		if (alc_register_micmute_input_device(codec) != 0)
4817 			return;
4818 
4819 		spec->gpio_mask |= 0x06;
4820 		spec->gpio_dir |= 0x02;
4821 		spec->gpio_data |= 0x02;
4822 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4823 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4824 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4825 						    gpio2_mic_hotkey_event);
4826 		return;
4827 	}
4828 
4829 	if (!spec->kb_dev)
4830 		return;
4831 
4832 	switch (action) {
4833 	case HDA_FIXUP_ACT_FREE:
4834 		input_unregister_device(spec->kb_dev);
4835 		spec->kb_dev = NULL;
4836 	}
4837 }
4838 
4839 /* Line2 = mic mute hotkey
4840  * GPIO2 = mic mute LED
4841  */
4842 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4843 					     const struct hda_fixup *fix, int action)
4844 {
4845 	struct alc_spec *spec = codec->spec;
4846 
4847 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4848 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4849 		spec->init_amp = ALC_INIT_DEFAULT;
4850 		if (alc_register_micmute_input_device(codec) != 0)
4851 			return;
4852 
4853 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
4854 						    gpio2_mic_hotkey_event);
4855 		return;
4856 	}
4857 
4858 	if (!spec->kb_dev)
4859 		return;
4860 
4861 	switch (action) {
4862 	case HDA_FIXUP_ACT_FREE:
4863 		input_unregister_device(spec->kb_dev);
4864 		spec->kb_dev = NULL;
4865 	}
4866 }
4867 #else /* INPUT */
4868 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
4869 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
4870 #endif /* INPUT */
4871 
4872 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4873 				const struct hda_fixup *fix, int action)
4874 {
4875 	struct alc_spec *spec = codec->spec;
4876 
4877 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4878 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4879 		spec->cap_mute_led_nid = 0x18;
4880 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4881 	}
4882 }
4883 
4884 static const struct coef_fw alc225_pre_hsmode[] = {
4885 	UPDATE_COEF(0x4a, 1<<8, 0),
4886 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4887 	UPDATE_COEF(0x63, 3<<14, 3<<14),
4888 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
4889 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
4890 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4891 	UPDATE_COEF(0x4a, 3<<10, 0),
4892 	{}
4893 };
4894 
4895 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4896 {
4897 	struct alc_spec *spec = codec->spec;
4898 	static const struct coef_fw coef0255[] = {
4899 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4900 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4901 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4902 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4903 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4904 		{}
4905 	};
4906 	static const struct coef_fw coef0256[] = {
4907 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4908 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4909 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4910 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4911 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4912 		{}
4913 	};
4914 	static const struct coef_fw coef0233[] = {
4915 		WRITE_COEF(0x1b, 0x0c0b),
4916 		WRITE_COEF(0x45, 0xc429),
4917 		UPDATE_COEF(0x35, 0x4000, 0),
4918 		WRITE_COEF(0x06, 0x2104),
4919 		WRITE_COEF(0x1a, 0x0001),
4920 		WRITE_COEF(0x26, 0x0004),
4921 		WRITE_COEF(0x32, 0x42a3),
4922 		{}
4923 	};
4924 	static const struct coef_fw coef0288[] = {
4925 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4926 		UPDATE_COEF(0x50, 0x2000, 0x2000),
4927 		UPDATE_COEF(0x56, 0x0006, 0x0006),
4928 		UPDATE_COEF(0x66, 0x0008, 0),
4929 		UPDATE_COEF(0x67, 0x2000, 0),
4930 		{}
4931 	};
4932 	static const struct coef_fw coef0298[] = {
4933 		UPDATE_COEF(0x19, 0x1300, 0x0300),
4934 		{}
4935 	};
4936 	static const struct coef_fw coef0292[] = {
4937 		WRITE_COEF(0x76, 0x000e),
4938 		WRITE_COEF(0x6c, 0x2400),
4939 		WRITE_COEF(0x18, 0x7308),
4940 		WRITE_COEF(0x6b, 0xc429),
4941 		{}
4942 	};
4943 	static const struct coef_fw coef0293[] = {
4944 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4945 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4946 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4947 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4948 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4949 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4950 		{}
4951 	};
4952 	static const struct coef_fw coef0668[] = {
4953 		WRITE_COEF(0x15, 0x0d40),
4954 		WRITE_COEF(0xb7, 0x802b),
4955 		{}
4956 	};
4957 	static const struct coef_fw coef0225[] = {
4958 		UPDATE_COEF(0x63, 3<<14, 0),
4959 		{}
4960 	};
4961 	static const struct coef_fw coef0274[] = {
4962 		UPDATE_COEF(0x4a, 0x0100, 0),
4963 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4964 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
4965 		UPDATE_COEF(0x4a, 0x0010, 0),
4966 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4967 		WRITE_COEF(0x45, 0x5289),
4968 		UPDATE_COEF(0x4a, 0x0c00, 0),
4969 		{}
4970 	};
4971 
4972 	if (spec->no_internal_mic_pin) {
4973 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4974 		return;
4975 	}
4976 
4977 	switch (codec->core.vendor_id) {
4978 	case 0x10ec0255:
4979 		alc_process_coef_fw(codec, coef0255);
4980 		break;
4981 	case 0x10ec0230:
4982 	case 0x10ec0236:
4983 	case 0x10ec0256:
4984 	case 0x19e58326:
4985 		alc_process_coef_fw(codec, coef0256);
4986 		break;
4987 	case 0x10ec0234:
4988 	case 0x10ec0274:
4989 	case 0x10ec0294:
4990 		alc_process_coef_fw(codec, coef0274);
4991 		break;
4992 	case 0x10ec0233:
4993 	case 0x10ec0283:
4994 		alc_process_coef_fw(codec, coef0233);
4995 		break;
4996 	case 0x10ec0286:
4997 	case 0x10ec0288:
4998 		alc_process_coef_fw(codec, coef0288);
4999 		break;
5000 	case 0x10ec0298:
5001 		alc_process_coef_fw(codec, coef0298);
5002 		alc_process_coef_fw(codec, coef0288);
5003 		break;
5004 	case 0x10ec0292:
5005 		alc_process_coef_fw(codec, coef0292);
5006 		break;
5007 	case 0x10ec0293:
5008 		alc_process_coef_fw(codec, coef0293);
5009 		break;
5010 	case 0x10ec0668:
5011 		alc_process_coef_fw(codec, coef0668);
5012 		break;
5013 	case 0x10ec0215:
5014 	case 0x10ec0225:
5015 	case 0x10ec0285:
5016 	case 0x10ec0295:
5017 	case 0x10ec0289:
5018 	case 0x10ec0299:
5019 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5020 		alc_process_coef_fw(codec, coef0225);
5021 		break;
5022 	case 0x10ec0867:
5023 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5024 		break;
5025 	}
5026 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5027 }
5028 
5029 
5030 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5031 				    hda_nid_t mic_pin)
5032 {
5033 	static const struct coef_fw coef0255[] = {
5034 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5035 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5036 		{}
5037 	};
5038 	static const struct coef_fw coef0256[] = {
5039 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5040 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5041 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5042 		{}
5043 	};
5044 	static const struct coef_fw coef0233[] = {
5045 		UPDATE_COEF(0x35, 0, 1<<14),
5046 		WRITE_COEF(0x06, 0x2100),
5047 		WRITE_COEF(0x1a, 0x0021),
5048 		WRITE_COEF(0x26, 0x008c),
5049 		{}
5050 	};
5051 	static const struct coef_fw coef0288[] = {
5052 		UPDATE_COEF(0x4f, 0x00c0, 0),
5053 		UPDATE_COEF(0x50, 0x2000, 0),
5054 		UPDATE_COEF(0x56, 0x0006, 0),
5055 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5056 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5057 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5058 		{}
5059 	};
5060 	static const struct coef_fw coef0292[] = {
5061 		WRITE_COEF(0x19, 0xa208),
5062 		WRITE_COEF(0x2e, 0xacf0),
5063 		{}
5064 	};
5065 	static const struct coef_fw coef0293[] = {
5066 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5067 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5068 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5069 		{}
5070 	};
5071 	static const struct coef_fw coef0688[] = {
5072 		WRITE_COEF(0xb7, 0x802b),
5073 		WRITE_COEF(0xb5, 0x1040),
5074 		UPDATE_COEF(0xc3, 0, 1<<12),
5075 		{}
5076 	};
5077 	static const struct coef_fw coef0225[] = {
5078 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5079 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5080 		UPDATE_COEF(0x63, 3<<14, 0),
5081 		{}
5082 	};
5083 	static const struct coef_fw coef0274[] = {
5084 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5085 		UPDATE_COEF(0x4a, 0x0010, 0),
5086 		UPDATE_COEF(0x6b, 0xf000, 0),
5087 		{}
5088 	};
5089 
5090 	switch (codec->core.vendor_id) {
5091 	case 0x10ec0255:
5092 		alc_write_coef_idx(codec, 0x45, 0xc489);
5093 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5094 		alc_process_coef_fw(codec, coef0255);
5095 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5096 		break;
5097 	case 0x10ec0230:
5098 	case 0x10ec0236:
5099 	case 0x10ec0256:
5100 	case 0x19e58326:
5101 		alc_write_coef_idx(codec, 0x45, 0xc489);
5102 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5103 		alc_process_coef_fw(codec, coef0256);
5104 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5105 		break;
5106 	case 0x10ec0234:
5107 	case 0x10ec0274:
5108 	case 0x10ec0294:
5109 		alc_write_coef_idx(codec, 0x45, 0x4689);
5110 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5111 		alc_process_coef_fw(codec, coef0274);
5112 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5113 		break;
5114 	case 0x10ec0233:
5115 	case 0x10ec0283:
5116 		alc_write_coef_idx(codec, 0x45, 0xc429);
5117 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5118 		alc_process_coef_fw(codec, coef0233);
5119 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5120 		break;
5121 	case 0x10ec0286:
5122 	case 0x10ec0288:
5123 	case 0x10ec0298:
5124 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5125 		alc_process_coef_fw(codec, coef0288);
5126 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5127 		break;
5128 	case 0x10ec0292:
5129 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5130 		alc_process_coef_fw(codec, coef0292);
5131 		break;
5132 	case 0x10ec0293:
5133 		/* Set to TRS mode */
5134 		alc_write_coef_idx(codec, 0x45, 0xc429);
5135 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5136 		alc_process_coef_fw(codec, coef0293);
5137 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5138 		break;
5139 	case 0x10ec0867:
5140 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5141 		fallthrough;
5142 	case 0x10ec0221:
5143 	case 0x10ec0662:
5144 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5145 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5146 		break;
5147 	case 0x10ec0668:
5148 		alc_write_coef_idx(codec, 0x11, 0x0001);
5149 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5150 		alc_process_coef_fw(codec, coef0688);
5151 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5152 		break;
5153 	case 0x10ec0215:
5154 	case 0x10ec0225:
5155 	case 0x10ec0285:
5156 	case 0x10ec0295:
5157 	case 0x10ec0289:
5158 	case 0x10ec0299:
5159 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5160 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5161 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5162 		alc_process_coef_fw(codec, coef0225);
5163 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5164 		break;
5165 	}
5166 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5167 }
5168 
5169 static void alc_headset_mode_default(struct hda_codec *codec)
5170 {
5171 	static const struct coef_fw coef0225[] = {
5172 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5173 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5174 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5175 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5176 		UPDATE_COEF(0x63, 3<<14, 0),
5177 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5178 		{}
5179 	};
5180 	static const struct coef_fw coef0255[] = {
5181 		WRITE_COEF(0x45, 0xc089),
5182 		WRITE_COEF(0x45, 0xc489),
5183 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5184 		WRITE_COEF(0x49, 0x0049),
5185 		{}
5186 	};
5187 	static const struct coef_fw coef0256[] = {
5188 		WRITE_COEF(0x45, 0xc489),
5189 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5190 		WRITE_COEF(0x49, 0x0049),
5191 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5192 		WRITE_COEF(0x06, 0x6100),
5193 		{}
5194 	};
5195 	static const struct coef_fw coef0233[] = {
5196 		WRITE_COEF(0x06, 0x2100),
5197 		WRITE_COEF(0x32, 0x4ea3),
5198 		{}
5199 	};
5200 	static const struct coef_fw coef0288[] = {
5201 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5202 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5203 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5204 		UPDATE_COEF(0x66, 0x0008, 0),
5205 		UPDATE_COEF(0x67, 0x2000, 0),
5206 		{}
5207 	};
5208 	static const struct coef_fw coef0292[] = {
5209 		WRITE_COEF(0x76, 0x000e),
5210 		WRITE_COEF(0x6c, 0x2400),
5211 		WRITE_COEF(0x6b, 0xc429),
5212 		WRITE_COEF(0x18, 0x7308),
5213 		{}
5214 	};
5215 	static const struct coef_fw coef0293[] = {
5216 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5217 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5218 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5219 		{}
5220 	};
5221 	static const struct coef_fw coef0688[] = {
5222 		WRITE_COEF(0x11, 0x0041),
5223 		WRITE_COEF(0x15, 0x0d40),
5224 		WRITE_COEF(0xb7, 0x802b),
5225 		{}
5226 	};
5227 	static const struct coef_fw coef0274[] = {
5228 		WRITE_COEF(0x45, 0x4289),
5229 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5230 		UPDATE_COEF(0x6b, 0x0f00, 0),
5231 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5232 		{}
5233 	};
5234 
5235 	switch (codec->core.vendor_id) {
5236 	case 0x10ec0215:
5237 	case 0x10ec0225:
5238 	case 0x10ec0285:
5239 	case 0x10ec0295:
5240 	case 0x10ec0289:
5241 	case 0x10ec0299:
5242 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5243 		alc_process_coef_fw(codec, coef0225);
5244 		break;
5245 	case 0x10ec0255:
5246 		alc_process_coef_fw(codec, coef0255);
5247 		break;
5248 	case 0x10ec0230:
5249 	case 0x10ec0236:
5250 	case 0x10ec0256:
5251 	case 0x19e58326:
5252 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5253 		alc_write_coef_idx(codec, 0x45, 0xc089);
5254 		msleep(50);
5255 		alc_process_coef_fw(codec, coef0256);
5256 		break;
5257 	case 0x10ec0234:
5258 	case 0x10ec0274:
5259 	case 0x10ec0294:
5260 		alc_process_coef_fw(codec, coef0274);
5261 		break;
5262 	case 0x10ec0233:
5263 	case 0x10ec0283:
5264 		alc_process_coef_fw(codec, coef0233);
5265 		break;
5266 	case 0x10ec0286:
5267 	case 0x10ec0288:
5268 	case 0x10ec0298:
5269 		alc_process_coef_fw(codec, coef0288);
5270 		break;
5271 	case 0x10ec0292:
5272 		alc_process_coef_fw(codec, coef0292);
5273 		break;
5274 	case 0x10ec0293:
5275 		alc_process_coef_fw(codec, coef0293);
5276 		break;
5277 	case 0x10ec0668:
5278 		alc_process_coef_fw(codec, coef0688);
5279 		break;
5280 	case 0x10ec0867:
5281 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5282 		break;
5283 	}
5284 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5285 }
5286 
5287 /* Iphone type */
5288 static void alc_headset_mode_ctia(struct hda_codec *codec)
5289 {
5290 	int val;
5291 
5292 	static const struct coef_fw coef0255[] = {
5293 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5294 		WRITE_COEF(0x1b, 0x0c2b),
5295 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5296 		{}
5297 	};
5298 	static const struct coef_fw coef0256[] = {
5299 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5300 		WRITE_COEF(0x1b, 0x0e6b),
5301 		{}
5302 	};
5303 	static const struct coef_fw coef0233[] = {
5304 		WRITE_COEF(0x45, 0xd429),
5305 		WRITE_COEF(0x1b, 0x0c2b),
5306 		WRITE_COEF(0x32, 0x4ea3),
5307 		{}
5308 	};
5309 	static const struct coef_fw coef0288[] = {
5310 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5311 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5312 		UPDATE_COEF(0x66, 0x0008, 0),
5313 		UPDATE_COEF(0x67, 0x2000, 0),
5314 		{}
5315 	};
5316 	static const struct coef_fw coef0292[] = {
5317 		WRITE_COEF(0x6b, 0xd429),
5318 		WRITE_COEF(0x76, 0x0008),
5319 		WRITE_COEF(0x18, 0x7388),
5320 		{}
5321 	};
5322 	static const struct coef_fw coef0293[] = {
5323 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5324 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5325 		{}
5326 	};
5327 	static const struct coef_fw coef0688[] = {
5328 		WRITE_COEF(0x11, 0x0001),
5329 		WRITE_COEF(0x15, 0x0d60),
5330 		WRITE_COEF(0xc3, 0x0000),
5331 		{}
5332 	};
5333 	static const struct coef_fw coef0225_1[] = {
5334 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5335 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5336 		{}
5337 	};
5338 	static const struct coef_fw coef0225_2[] = {
5339 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5340 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5341 		{}
5342 	};
5343 
5344 	switch (codec->core.vendor_id) {
5345 	case 0x10ec0255:
5346 		alc_process_coef_fw(codec, coef0255);
5347 		break;
5348 	case 0x10ec0230:
5349 	case 0x10ec0236:
5350 	case 0x10ec0256:
5351 	case 0x19e58326:
5352 		alc_process_coef_fw(codec, coef0256);
5353 		break;
5354 	case 0x10ec0234:
5355 	case 0x10ec0274:
5356 	case 0x10ec0294:
5357 		alc_write_coef_idx(codec, 0x45, 0xd689);
5358 		break;
5359 	case 0x10ec0233:
5360 	case 0x10ec0283:
5361 		alc_process_coef_fw(codec, coef0233);
5362 		break;
5363 	case 0x10ec0298:
5364 		val = alc_read_coef_idx(codec, 0x50);
5365 		if (val & (1 << 12)) {
5366 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5367 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5368 			msleep(300);
5369 		} else {
5370 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5371 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5372 			msleep(300);
5373 		}
5374 		break;
5375 	case 0x10ec0286:
5376 	case 0x10ec0288:
5377 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5378 		msleep(300);
5379 		alc_process_coef_fw(codec, coef0288);
5380 		break;
5381 	case 0x10ec0292:
5382 		alc_process_coef_fw(codec, coef0292);
5383 		break;
5384 	case 0x10ec0293:
5385 		alc_process_coef_fw(codec, coef0293);
5386 		break;
5387 	case 0x10ec0668:
5388 		alc_process_coef_fw(codec, coef0688);
5389 		break;
5390 	case 0x10ec0215:
5391 	case 0x10ec0225:
5392 	case 0x10ec0285:
5393 	case 0x10ec0295:
5394 	case 0x10ec0289:
5395 	case 0x10ec0299:
5396 		val = alc_read_coef_idx(codec, 0x45);
5397 		if (val & (1 << 9))
5398 			alc_process_coef_fw(codec, coef0225_2);
5399 		else
5400 			alc_process_coef_fw(codec, coef0225_1);
5401 		break;
5402 	case 0x10ec0867:
5403 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5404 		break;
5405 	}
5406 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5407 }
5408 
5409 /* Nokia type */
5410 static void alc_headset_mode_omtp(struct hda_codec *codec)
5411 {
5412 	static const struct coef_fw coef0255[] = {
5413 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5414 		WRITE_COEF(0x1b, 0x0c2b),
5415 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5416 		{}
5417 	};
5418 	static const struct coef_fw coef0256[] = {
5419 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5420 		WRITE_COEF(0x1b, 0x0e6b),
5421 		{}
5422 	};
5423 	static const struct coef_fw coef0233[] = {
5424 		WRITE_COEF(0x45, 0xe429),
5425 		WRITE_COEF(0x1b, 0x0c2b),
5426 		WRITE_COEF(0x32, 0x4ea3),
5427 		{}
5428 	};
5429 	static const struct coef_fw coef0288[] = {
5430 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5431 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5432 		UPDATE_COEF(0x66, 0x0008, 0),
5433 		UPDATE_COEF(0x67, 0x2000, 0),
5434 		{}
5435 	};
5436 	static const struct coef_fw coef0292[] = {
5437 		WRITE_COEF(0x6b, 0xe429),
5438 		WRITE_COEF(0x76, 0x0008),
5439 		WRITE_COEF(0x18, 0x7388),
5440 		{}
5441 	};
5442 	static const struct coef_fw coef0293[] = {
5443 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5444 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5445 		{}
5446 	};
5447 	static const struct coef_fw coef0688[] = {
5448 		WRITE_COEF(0x11, 0x0001),
5449 		WRITE_COEF(0x15, 0x0d50),
5450 		WRITE_COEF(0xc3, 0x0000),
5451 		{}
5452 	};
5453 	static const struct coef_fw coef0225[] = {
5454 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5455 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5456 		{}
5457 	};
5458 
5459 	switch (codec->core.vendor_id) {
5460 	case 0x10ec0255:
5461 		alc_process_coef_fw(codec, coef0255);
5462 		break;
5463 	case 0x10ec0230:
5464 	case 0x10ec0236:
5465 	case 0x10ec0256:
5466 	case 0x19e58326:
5467 		alc_process_coef_fw(codec, coef0256);
5468 		break;
5469 	case 0x10ec0234:
5470 	case 0x10ec0274:
5471 	case 0x10ec0294:
5472 		alc_write_coef_idx(codec, 0x45, 0xe689);
5473 		break;
5474 	case 0x10ec0233:
5475 	case 0x10ec0283:
5476 		alc_process_coef_fw(codec, coef0233);
5477 		break;
5478 	case 0x10ec0298:
5479 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5480 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5481 		msleep(300);
5482 		break;
5483 	case 0x10ec0286:
5484 	case 0x10ec0288:
5485 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5486 		msleep(300);
5487 		alc_process_coef_fw(codec, coef0288);
5488 		break;
5489 	case 0x10ec0292:
5490 		alc_process_coef_fw(codec, coef0292);
5491 		break;
5492 	case 0x10ec0293:
5493 		alc_process_coef_fw(codec, coef0293);
5494 		break;
5495 	case 0x10ec0668:
5496 		alc_process_coef_fw(codec, coef0688);
5497 		break;
5498 	case 0x10ec0215:
5499 	case 0x10ec0225:
5500 	case 0x10ec0285:
5501 	case 0x10ec0295:
5502 	case 0x10ec0289:
5503 	case 0x10ec0299:
5504 		alc_process_coef_fw(codec, coef0225);
5505 		break;
5506 	}
5507 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5508 }
5509 
5510 static void alc_determine_headset_type(struct hda_codec *codec)
5511 {
5512 	int val;
5513 	bool is_ctia = false;
5514 	struct alc_spec *spec = codec->spec;
5515 	static const struct coef_fw coef0255[] = {
5516 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5517 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5518  conteol) */
5519 		{}
5520 	};
5521 	static const struct coef_fw coef0288[] = {
5522 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5523 		{}
5524 	};
5525 	static const struct coef_fw coef0298[] = {
5526 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5527 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5528 		UPDATE_COEF(0x66, 0x0008, 0),
5529 		UPDATE_COEF(0x67, 0x2000, 0),
5530 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5531 		{}
5532 	};
5533 	static const struct coef_fw coef0293[] = {
5534 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5535 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5536 		{}
5537 	};
5538 	static const struct coef_fw coef0688[] = {
5539 		WRITE_COEF(0x11, 0x0001),
5540 		WRITE_COEF(0xb7, 0x802b),
5541 		WRITE_COEF(0x15, 0x0d60),
5542 		WRITE_COEF(0xc3, 0x0c00),
5543 		{}
5544 	};
5545 	static const struct coef_fw coef0274[] = {
5546 		UPDATE_COEF(0x4a, 0x0010, 0),
5547 		UPDATE_COEF(0x4a, 0x8000, 0),
5548 		WRITE_COEF(0x45, 0xd289),
5549 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5550 		{}
5551 	};
5552 
5553 	if (spec->no_internal_mic_pin) {
5554 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5555 		return;
5556 	}
5557 
5558 	switch (codec->core.vendor_id) {
5559 	case 0x10ec0255:
5560 		alc_process_coef_fw(codec, coef0255);
5561 		msleep(300);
5562 		val = alc_read_coef_idx(codec, 0x46);
5563 		is_ctia = (val & 0x0070) == 0x0070;
5564 		break;
5565 	case 0x10ec0230:
5566 	case 0x10ec0236:
5567 	case 0x10ec0256:
5568 	case 0x19e58326:
5569 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5570 		alc_write_coef_idx(codec, 0x06, 0x6104);
5571 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5572 
5573 		snd_hda_codec_write(codec, 0x21, 0,
5574 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5575 		msleep(80);
5576 		snd_hda_codec_write(codec, 0x21, 0,
5577 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5578 
5579 		alc_process_coef_fw(codec, coef0255);
5580 		msleep(300);
5581 		val = alc_read_coef_idx(codec, 0x46);
5582 		is_ctia = (val & 0x0070) == 0x0070;
5583 
5584 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5585 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5586 
5587 		snd_hda_codec_write(codec, 0x21, 0,
5588 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5589 		msleep(80);
5590 		snd_hda_codec_write(codec, 0x21, 0,
5591 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5592 		break;
5593 	case 0x10ec0234:
5594 	case 0x10ec0274:
5595 	case 0x10ec0294:
5596 		alc_process_coef_fw(codec, coef0274);
5597 		msleep(850);
5598 		val = alc_read_coef_idx(codec, 0x46);
5599 		is_ctia = (val & 0x00f0) == 0x00f0;
5600 		break;
5601 	case 0x10ec0233:
5602 	case 0x10ec0283:
5603 		alc_write_coef_idx(codec, 0x45, 0xd029);
5604 		msleep(300);
5605 		val = alc_read_coef_idx(codec, 0x46);
5606 		is_ctia = (val & 0x0070) == 0x0070;
5607 		break;
5608 	case 0x10ec0298:
5609 		snd_hda_codec_write(codec, 0x21, 0,
5610 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5611 		msleep(100);
5612 		snd_hda_codec_write(codec, 0x21, 0,
5613 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5614 		msleep(200);
5615 
5616 		val = alc_read_coef_idx(codec, 0x50);
5617 		if (val & (1 << 12)) {
5618 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5619 			alc_process_coef_fw(codec, coef0288);
5620 			msleep(350);
5621 			val = alc_read_coef_idx(codec, 0x50);
5622 			is_ctia = (val & 0x0070) == 0x0070;
5623 		} else {
5624 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5625 			alc_process_coef_fw(codec, coef0288);
5626 			msleep(350);
5627 			val = alc_read_coef_idx(codec, 0x50);
5628 			is_ctia = (val & 0x0070) == 0x0070;
5629 		}
5630 		alc_process_coef_fw(codec, coef0298);
5631 		snd_hda_codec_write(codec, 0x21, 0,
5632 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5633 		msleep(75);
5634 		snd_hda_codec_write(codec, 0x21, 0,
5635 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5636 		break;
5637 	case 0x10ec0286:
5638 	case 0x10ec0288:
5639 		alc_process_coef_fw(codec, coef0288);
5640 		msleep(350);
5641 		val = alc_read_coef_idx(codec, 0x50);
5642 		is_ctia = (val & 0x0070) == 0x0070;
5643 		break;
5644 	case 0x10ec0292:
5645 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5646 		msleep(300);
5647 		val = alc_read_coef_idx(codec, 0x6c);
5648 		is_ctia = (val & 0x001c) == 0x001c;
5649 		break;
5650 	case 0x10ec0293:
5651 		alc_process_coef_fw(codec, coef0293);
5652 		msleep(300);
5653 		val = alc_read_coef_idx(codec, 0x46);
5654 		is_ctia = (val & 0x0070) == 0x0070;
5655 		break;
5656 	case 0x10ec0668:
5657 		alc_process_coef_fw(codec, coef0688);
5658 		msleep(300);
5659 		val = alc_read_coef_idx(codec, 0xbe);
5660 		is_ctia = (val & 0x1c02) == 0x1c02;
5661 		break;
5662 	case 0x10ec0215:
5663 	case 0x10ec0225:
5664 	case 0x10ec0285:
5665 	case 0x10ec0295:
5666 	case 0x10ec0289:
5667 	case 0x10ec0299:
5668 		snd_hda_codec_write(codec, 0x21, 0,
5669 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5670 		msleep(80);
5671 		snd_hda_codec_write(codec, 0x21, 0,
5672 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5673 
5674 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5675 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5676 		val = alc_read_coef_idx(codec, 0x45);
5677 		if (val & (1 << 9)) {
5678 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5679 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5680 			msleep(800);
5681 			val = alc_read_coef_idx(codec, 0x46);
5682 			is_ctia = (val & 0x00f0) == 0x00f0;
5683 		} else {
5684 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5685 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5686 			msleep(800);
5687 			val = alc_read_coef_idx(codec, 0x46);
5688 			is_ctia = (val & 0x00f0) == 0x00f0;
5689 		}
5690 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5691 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5692 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5693 
5694 		snd_hda_codec_write(codec, 0x21, 0,
5695 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5696 		msleep(80);
5697 		snd_hda_codec_write(codec, 0x21, 0,
5698 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5699 		break;
5700 	case 0x10ec0867:
5701 		is_ctia = true;
5702 		break;
5703 	}
5704 
5705 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5706 		    is_ctia ? "yes" : "no");
5707 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5708 }
5709 
5710 static void alc_update_headset_mode(struct hda_codec *codec)
5711 {
5712 	struct alc_spec *spec = codec->spec;
5713 
5714 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5715 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5716 
5717 	int new_headset_mode;
5718 
5719 	if (!snd_hda_jack_detect(codec, hp_pin))
5720 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5721 	else if (mux_pin == spec->headset_mic_pin)
5722 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5723 	else if (mux_pin == spec->headphone_mic_pin)
5724 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5725 	else
5726 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5727 
5728 	if (new_headset_mode == spec->current_headset_mode) {
5729 		snd_hda_gen_update_outputs(codec);
5730 		return;
5731 	}
5732 
5733 	switch (new_headset_mode) {
5734 	case ALC_HEADSET_MODE_UNPLUGGED:
5735 		alc_headset_mode_unplugged(codec);
5736 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5737 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5738 		spec->gen.hp_jack_present = false;
5739 		break;
5740 	case ALC_HEADSET_MODE_HEADSET:
5741 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5742 			alc_determine_headset_type(codec);
5743 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5744 			alc_headset_mode_ctia(codec);
5745 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5746 			alc_headset_mode_omtp(codec);
5747 		spec->gen.hp_jack_present = true;
5748 		break;
5749 	case ALC_HEADSET_MODE_MIC:
5750 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5751 		spec->gen.hp_jack_present = false;
5752 		break;
5753 	case ALC_HEADSET_MODE_HEADPHONE:
5754 		alc_headset_mode_default(codec);
5755 		spec->gen.hp_jack_present = true;
5756 		break;
5757 	}
5758 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5759 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5760 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5761 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5762 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5763 						  PIN_VREFHIZ);
5764 	}
5765 	spec->current_headset_mode = new_headset_mode;
5766 
5767 	snd_hda_gen_update_outputs(codec);
5768 }
5769 
5770 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5771 					 struct snd_kcontrol *kcontrol,
5772 					 struct snd_ctl_elem_value *ucontrol)
5773 {
5774 	alc_update_headset_mode(codec);
5775 }
5776 
5777 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5778 				       struct hda_jack_callback *jack)
5779 {
5780 	snd_hda_gen_hp_automute(codec, jack);
5781 	alc_update_headset_mode(codec);
5782 }
5783 
5784 static void alc_probe_headset_mode(struct hda_codec *codec)
5785 {
5786 	int i;
5787 	struct alc_spec *spec = codec->spec;
5788 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5789 
5790 	/* Find mic pins */
5791 	for (i = 0; i < cfg->num_inputs; i++) {
5792 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5793 			spec->headset_mic_pin = cfg->inputs[i].pin;
5794 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5795 			spec->headphone_mic_pin = cfg->inputs[i].pin;
5796 	}
5797 
5798 	WARN_ON(spec->gen.cap_sync_hook);
5799 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5800 	spec->gen.automute_hook = alc_update_headset_mode;
5801 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5802 }
5803 
5804 static void alc_fixup_headset_mode(struct hda_codec *codec,
5805 				const struct hda_fixup *fix, int action)
5806 {
5807 	struct alc_spec *spec = codec->spec;
5808 
5809 	switch (action) {
5810 	case HDA_FIXUP_ACT_PRE_PROBE:
5811 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5812 		break;
5813 	case HDA_FIXUP_ACT_PROBE:
5814 		alc_probe_headset_mode(codec);
5815 		break;
5816 	case HDA_FIXUP_ACT_INIT:
5817 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
5818 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5819 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5820 		}
5821 		alc_update_headset_mode(codec);
5822 		break;
5823 	}
5824 }
5825 
5826 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5827 				const struct hda_fixup *fix, int action)
5828 {
5829 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5830 		struct alc_spec *spec = codec->spec;
5831 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5832 	}
5833 	else
5834 		alc_fixup_headset_mode(codec, fix, action);
5835 }
5836 
5837 static void alc255_set_default_jack_type(struct hda_codec *codec)
5838 {
5839 	/* Set to iphone type */
5840 	static const struct coef_fw alc255fw[] = {
5841 		WRITE_COEF(0x1b, 0x880b),
5842 		WRITE_COEF(0x45, 0xd089),
5843 		WRITE_COEF(0x1b, 0x080b),
5844 		WRITE_COEF(0x46, 0x0004),
5845 		WRITE_COEF(0x1b, 0x0c0b),
5846 		{}
5847 	};
5848 	static const struct coef_fw alc256fw[] = {
5849 		WRITE_COEF(0x1b, 0x884b),
5850 		WRITE_COEF(0x45, 0xd089),
5851 		WRITE_COEF(0x1b, 0x084b),
5852 		WRITE_COEF(0x46, 0x0004),
5853 		WRITE_COEF(0x1b, 0x0c4b),
5854 		{}
5855 	};
5856 	switch (codec->core.vendor_id) {
5857 	case 0x10ec0255:
5858 		alc_process_coef_fw(codec, alc255fw);
5859 		break;
5860 	case 0x10ec0230:
5861 	case 0x10ec0236:
5862 	case 0x10ec0256:
5863 	case 0x19e58326:
5864 		alc_process_coef_fw(codec, alc256fw);
5865 		break;
5866 	}
5867 	msleep(30);
5868 }
5869 
5870 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5871 				const struct hda_fixup *fix, int action)
5872 {
5873 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5874 		alc255_set_default_jack_type(codec);
5875 	}
5876 	alc_fixup_headset_mode(codec, fix, action);
5877 }
5878 
5879 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5880 				const struct hda_fixup *fix, int action)
5881 {
5882 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5883 		struct alc_spec *spec = codec->spec;
5884 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5885 		alc255_set_default_jack_type(codec);
5886 	}
5887 	else
5888 		alc_fixup_headset_mode(codec, fix, action);
5889 }
5890 
5891 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5892 				       struct hda_jack_callback *jack)
5893 {
5894 	struct alc_spec *spec = codec->spec;
5895 
5896 	alc_update_headset_jack_cb(codec, jack);
5897 	/* Headset Mic enable or disable, only for Dell Dino */
5898 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5899 }
5900 
5901 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5902 				const struct hda_fixup *fix, int action)
5903 {
5904 	alc_fixup_headset_mode(codec, fix, action);
5905 	if (action == HDA_FIXUP_ACT_PROBE) {
5906 		struct alc_spec *spec = codec->spec;
5907 		/* toggled via hp_automute_hook */
5908 		spec->gpio_mask |= 0x40;
5909 		spec->gpio_dir |= 0x40;
5910 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5911 	}
5912 }
5913 
5914 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5915 					const struct hda_fixup *fix, int action)
5916 {
5917 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5918 		struct alc_spec *spec = codec->spec;
5919 		spec->gen.auto_mute_via_amp = 1;
5920 	}
5921 }
5922 
5923 static void alc_fixup_no_shutup(struct hda_codec *codec,
5924 				const struct hda_fixup *fix, int action)
5925 {
5926 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5927 		struct alc_spec *spec = codec->spec;
5928 		spec->no_shutup_pins = 1;
5929 	}
5930 }
5931 
5932 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5933 				    const struct hda_fixup *fix, int action)
5934 {
5935 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5936 		struct alc_spec *spec = codec->spec;
5937 		/* Disable AA-loopback as it causes white noise */
5938 		spec->gen.mixer_nid = 0;
5939 	}
5940 }
5941 
5942 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5943 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5944 				  const struct hda_fixup *fix, int action)
5945 {
5946 	static const struct hda_pintbl pincfgs[] = {
5947 		{ 0x16, 0x21211010 }, /* dock headphone */
5948 		{ 0x19, 0x21a11010 }, /* dock mic */
5949 		{ }
5950 	};
5951 	struct alc_spec *spec = codec->spec;
5952 
5953 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5954 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5955 		codec->power_save_node = 0; /* avoid click noises */
5956 		snd_hda_apply_pincfgs(codec, pincfgs);
5957 	}
5958 }
5959 
5960 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5961 				  const struct hda_fixup *fix, int action)
5962 {
5963 	static const struct hda_pintbl pincfgs[] = {
5964 		{ 0x17, 0x21211010 }, /* dock headphone */
5965 		{ 0x19, 0x21a11010 }, /* dock mic */
5966 		{ }
5967 	};
5968 	struct alc_spec *spec = codec->spec;
5969 
5970 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5971 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5972 		snd_hda_apply_pincfgs(codec, pincfgs);
5973 	} else if (action == HDA_FIXUP_ACT_INIT) {
5974 		/* Enable DOCK device */
5975 		snd_hda_codec_write(codec, 0x17, 0,
5976 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5977 		/* Enable DOCK device */
5978 		snd_hda_codec_write(codec, 0x19, 0,
5979 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5980 	}
5981 }
5982 
5983 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5984 				  const struct hda_fixup *fix, int action)
5985 {
5986 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5987 	 * the speaker output becomes too low by some reason on Thinkpads with
5988 	 * ALC298 codec
5989 	 */
5990 	static const hda_nid_t preferred_pairs[] = {
5991 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5992 		0
5993 	};
5994 	struct alc_spec *spec = codec->spec;
5995 
5996 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
5997 		spec->gen.preferred_dacs = preferred_pairs;
5998 }
5999 
6000 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6001 				   const struct hda_fixup *fix, int action)
6002 {
6003 	static const hda_nid_t preferred_pairs[] = {
6004 		0x17, 0x02, 0x21, 0x03, 0
6005 	};
6006 	struct alc_spec *spec = codec->spec;
6007 
6008 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6009 		spec->gen.preferred_dacs = preferred_pairs;
6010 }
6011 
6012 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6013 {
6014 	struct alc_spec *spec = codec->spec;
6015 	int hp_pin = alc_get_hp_pin(spec);
6016 
6017 	/* Prevent pop noises when headphones are plugged in */
6018 	snd_hda_codec_write(codec, hp_pin, 0,
6019 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6020 	msleep(20);
6021 }
6022 
6023 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6024 				const struct hda_fixup *fix, int action)
6025 {
6026 	struct alc_spec *spec = codec->spec;
6027 	struct hda_input_mux *imux = &spec->gen.input_mux;
6028 	int i;
6029 
6030 	switch (action) {
6031 	case HDA_FIXUP_ACT_PRE_PROBE:
6032 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6033 		 * it causes a click noise at start up
6034 		 */
6035 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6036 		spec->shutup = alc_shutup_dell_xps13;
6037 		break;
6038 	case HDA_FIXUP_ACT_PROBE:
6039 		/* Make the internal mic the default input source. */
6040 		for (i = 0; i < imux->num_items; i++) {
6041 			if (spec->gen.imux_pins[i] == 0x12) {
6042 				spec->gen.cur_mux[0] = i;
6043 				break;
6044 			}
6045 		}
6046 		break;
6047 	}
6048 }
6049 
6050 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6051 				const struct hda_fixup *fix, int action)
6052 {
6053 	struct alc_spec *spec = codec->spec;
6054 
6055 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6056 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6057 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6058 
6059 		/* Disable boost for mic-in permanently. (This code is only called
6060 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6061 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6062 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6063 	} else
6064 		alc_fixup_headset_mode(codec, fix, action);
6065 }
6066 
6067 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6068 				const struct hda_fixup *fix, int action)
6069 {
6070 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6071 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6072 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6073 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6074 	}
6075 	alc_fixup_headset_mode(codec, fix, action);
6076 }
6077 
6078 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6079 static int find_ext_mic_pin(struct hda_codec *codec)
6080 {
6081 	struct alc_spec *spec = codec->spec;
6082 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6083 	hda_nid_t nid;
6084 	unsigned int defcfg;
6085 	int i;
6086 
6087 	for (i = 0; i < cfg->num_inputs; i++) {
6088 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6089 			continue;
6090 		nid = cfg->inputs[i].pin;
6091 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6092 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6093 			continue;
6094 		return nid;
6095 	}
6096 
6097 	return 0;
6098 }
6099 
6100 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6101 				    const struct hda_fixup *fix,
6102 				    int action)
6103 {
6104 	struct alc_spec *spec = codec->spec;
6105 
6106 	if (action == HDA_FIXUP_ACT_PROBE) {
6107 		int mic_pin = find_ext_mic_pin(codec);
6108 		int hp_pin = alc_get_hp_pin(spec);
6109 
6110 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6111 			return;
6112 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6113 	}
6114 }
6115 
6116 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6117 					     const struct hda_fixup *fix,
6118 					     int action)
6119 {
6120 	struct alc_spec *spec = codec->spec;
6121 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6122 	int i;
6123 
6124 	/* The mic boosts on level 2 and 3 are too noisy
6125 	   on the internal mic input.
6126 	   Therefore limit the boost to 0 or 1. */
6127 
6128 	if (action != HDA_FIXUP_ACT_PROBE)
6129 		return;
6130 
6131 	for (i = 0; i < cfg->num_inputs; i++) {
6132 		hda_nid_t nid = cfg->inputs[i].pin;
6133 		unsigned int defcfg;
6134 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6135 			continue;
6136 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6137 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6138 			continue;
6139 
6140 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6141 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6142 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6143 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6144 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6145 	}
6146 }
6147 
6148 static void alc283_hp_automute_hook(struct hda_codec *codec,
6149 				    struct hda_jack_callback *jack)
6150 {
6151 	struct alc_spec *spec = codec->spec;
6152 	int vref;
6153 
6154 	msleep(200);
6155 	snd_hda_gen_hp_automute(codec, jack);
6156 
6157 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6158 
6159 	msleep(600);
6160 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6161 			    vref);
6162 }
6163 
6164 static void alc283_fixup_chromebook(struct hda_codec *codec,
6165 				    const struct hda_fixup *fix, int action)
6166 {
6167 	struct alc_spec *spec = codec->spec;
6168 
6169 	switch (action) {
6170 	case HDA_FIXUP_ACT_PRE_PROBE:
6171 		snd_hda_override_wcaps(codec, 0x03, 0);
6172 		/* Disable AA-loopback as it causes white noise */
6173 		spec->gen.mixer_nid = 0;
6174 		break;
6175 	case HDA_FIXUP_ACT_INIT:
6176 		/* MIC2-VREF control */
6177 		/* Set to manual mode */
6178 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6179 		/* Enable Line1 input control by verb */
6180 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6181 		break;
6182 	}
6183 }
6184 
6185 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6186 				    const struct hda_fixup *fix, int action)
6187 {
6188 	struct alc_spec *spec = codec->spec;
6189 
6190 	switch (action) {
6191 	case HDA_FIXUP_ACT_PRE_PROBE:
6192 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6193 		break;
6194 	case HDA_FIXUP_ACT_INIT:
6195 		/* MIC2-VREF control */
6196 		/* Set to manual mode */
6197 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6198 		break;
6199 	}
6200 }
6201 
6202 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6203 static void asus_tx300_automute(struct hda_codec *codec)
6204 {
6205 	struct alc_spec *spec = codec->spec;
6206 	snd_hda_gen_update_outputs(codec);
6207 	if (snd_hda_jack_detect(codec, 0x1b))
6208 		spec->gen.mute_bits |= (1ULL << 0x14);
6209 }
6210 
6211 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6212 				    const struct hda_fixup *fix, int action)
6213 {
6214 	struct alc_spec *spec = codec->spec;
6215 	static const struct hda_pintbl dock_pins[] = {
6216 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6217 		{}
6218 	};
6219 
6220 	switch (action) {
6221 	case HDA_FIXUP_ACT_PRE_PROBE:
6222 		spec->init_amp = ALC_INIT_DEFAULT;
6223 		/* TX300 needs to set up GPIO2 for the speaker amp */
6224 		alc_setup_gpio(codec, 0x04);
6225 		snd_hda_apply_pincfgs(codec, dock_pins);
6226 		spec->gen.auto_mute_via_amp = 1;
6227 		spec->gen.automute_hook = asus_tx300_automute;
6228 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6229 						    snd_hda_gen_hp_automute);
6230 		break;
6231 	case HDA_FIXUP_ACT_PROBE:
6232 		spec->init_amp = ALC_INIT_DEFAULT;
6233 		break;
6234 	case HDA_FIXUP_ACT_BUILD:
6235 		/* this is a bit tricky; give more sane names for the main
6236 		 * (tablet) speaker and the dock speaker, respectively
6237 		 */
6238 		rename_ctl(codec, "Speaker Playback Switch",
6239 			   "Dock Speaker Playback Switch");
6240 		rename_ctl(codec, "Bass Speaker Playback Switch",
6241 			   "Speaker Playback Switch");
6242 		break;
6243 	}
6244 }
6245 
6246 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6247 				       const struct hda_fixup *fix, int action)
6248 {
6249 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6250 		/* DAC node 0x03 is giving mono output. We therefore want to
6251 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6252 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6253 		static const hda_nid_t conn1[] = { 0x0c };
6254 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6255 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6256 	}
6257 }
6258 
6259 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6260 					const struct hda_fixup *fix, int action)
6261 {
6262 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6263 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6264 		   we can't adjust the speaker's volume since this node does not has
6265 		   Amp-out capability. we change the speaker's route to:
6266 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6267 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6268 		   speaker's volume now. */
6269 
6270 		static const hda_nid_t conn1[] = { 0x0c };
6271 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6272 	}
6273 }
6274 
6275 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6276 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6277 				      const struct hda_fixup *fix, int action)
6278 {
6279 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6280 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6281 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6282 	}
6283 }
6284 
6285 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6286 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6287 					  const struct hda_fixup *fix, int action)
6288 {
6289 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6290 		static const hda_nid_t conn[] = { 0x02 };
6291 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6292 	}
6293 }
6294 
6295 /* Hook to update amp GPIO4 for automute */
6296 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6297 					  struct hda_jack_callback *jack)
6298 {
6299 	struct alc_spec *spec = codec->spec;
6300 
6301 	snd_hda_gen_hp_automute(codec, jack);
6302 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6303 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6304 			    !spec->gen.hp_jack_present);
6305 }
6306 
6307 /* Manage GPIOs for HP EliteBook Folio 9480m.
6308  *
6309  * GPIO4 is the headphone amplifier power control
6310  * GPIO3 is the audio output mute indicator LED
6311  */
6312 
6313 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6314 				  const struct hda_fixup *fix,
6315 				  int action)
6316 {
6317 	struct alc_spec *spec = codec->spec;
6318 
6319 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6320 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6321 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6322 		spec->gpio_mask |= 0x10;
6323 		spec->gpio_dir |= 0x10;
6324 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6325 	}
6326 }
6327 
6328 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6329 				   const struct hda_fixup *fix,
6330 				   int action)
6331 {
6332 	struct alc_spec *spec = codec->spec;
6333 
6334 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6335 		spec->gpio_mask |= 0x04;
6336 		spec->gpio_dir |= 0x04;
6337 		/* set data bit low */
6338 	}
6339 }
6340 
6341 /* Quirk for Thinkpad X1 7th and 8th Gen
6342  * The following fixed routing needed
6343  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6344  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6345  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6346  */
6347 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6348 					  const struct hda_fixup *fix, int action)
6349 {
6350 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6351 	static const hda_nid_t preferred_pairs[] = {
6352 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6353 	};
6354 	struct alc_spec *spec = codec->spec;
6355 
6356 	switch (action) {
6357 	case HDA_FIXUP_ACT_PRE_PROBE:
6358 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6359 		spec->gen.preferred_dacs = preferred_pairs;
6360 		break;
6361 	case HDA_FIXUP_ACT_BUILD:
6362 		/* The generic parser creates somewhat unintuitive volume ctls
6363 		 * with the fixed routing above, and the shared DAC2 may be
6364 		 * confusing for PA.
6365 		 * Rename those to unique names so that PA doesn't touch them
6366 		 * and use only Master volume.
6367 		 */
6368 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6369 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6370 		break;
6371 	}
6372 }
6373 
6374 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6375 					 const struct hda_fixup *fix,
6376 					 int action)
6377 {
6378 	alc_fixup_dual_codecs(codec, fix, action);
6379 	switch (action) {
6380 	case HDA_FIXUP_ACT_PRE_PROBE:
6381 		/* override card longname to provide a unique UCM profile */
6382 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6383 		break;
6384 	case HDA_FIXUP_ACT_BUILD:
6385 		/* rename Capture controls depending on the codec */
6386 		rename_ctl(codec, "Capture Volume",
6387 			   codec->addr == 0 ?
6388 			   "Rear-Panel Capture Volume" :
6389 			   "Front-Panel Capture Volume");
6390 		rename_ctl(codec, "Capture Switch",
6391 			   codec->addr == 0 ?
6392 			   "Rear-Panel Capture Switch" :
6393 			   "Front-Panel Capture Switch");
6394 		break;
6395 	}
6396 }
6397 
6398 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6399 				      const struct hda_fixup *fix, int action)
6400 {
6401 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6402 		return;
6403 
6404 	codec->power_save_node = 1;
6405 }
6406 
6407 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6408 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6409 				    const struct hda_fixup *fix, int action)
6410 {
6411 	struct alc_spec *spec = codec->spec;
6412 	static const hda_nid_t preferred_pairs[] = {
6413 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6414 		0
6415 	};
6416 
6417 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6418 		return;
6419 
6420 	spec->gen.preferred_dacs = preferred_pairs;
6421 	spec->gen.auto_mute_via_amp = 1;
6422 	codec->power_save_node = 0;
6423 }
6424 
6425 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6426 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6427 				    const struct hda_fixup *fix, int action)
6428 {
6429 	static const hda_nid_t preferred_pairs[] = {
6430 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6431 	};
6432 	struct alc_spec *spec = codec->spec;
6433 
6434 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6435 		spec->gen.preferred_dacs = preferred_pairs;
6436 		spec->gen.obey_preferred_dacs = 1;
6437 	}
6438 }
6439 
6440 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6441 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6442 			      const struct hda_fixup *fix, int action)
6443 {
6444 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6445 		return;
6446 
6447 	snd_hda_override_wcaps(codec, 0x03, 0);
6448 }
6449 
6450 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6451 {
6452 	switch (codec->core.vendor_id) {
6453 	case 0x10ec0274:
6454 	case 0x10ec0294:
6455 	case 0x10ec0225:
6456 	case 0x10ec0295:
6457 	case 0x10ec0299:
6458 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6459 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6460 		break;
6461 	case 0x10ec0230:
6462 	case 0x10ec0235:
6463 	case 0x10ec0236:
6464 	case 0x10ec0255:
6465 	case 0x10ec0256:
6466 	case 0x19e58326:
6467 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6468 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6469 		break;
6470 	}
6471 }
6472 
6473 static void alc295_fixup_chromebook(struct hda_codec *codec,
6474 				    const struct hda_fixup *fix, int action)
6475 {
6476 	struct alc_spec *spec = codec->spec;
6477 
6478 	switch (action) {
6479 	case HDA_FIXUP_ACT_PRE_PROBE:
6480 		spec->ultra_low_power = true;
6481 		break;
6482 	case HDA_FIXUP_ACT_INIT:
6483 		alc_combo_jack_hp_jd_restart(codec);
6484 		break;
6485 	}
6486 }
6487 
6488 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6489 				  const struct hda_fixup *fix, int action)
6490 {
6491 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6492 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6493 }
6494 
6495 
6496 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6497 					struct hda_jack_callback *cb)
6498 {
6499 	/* The Windows driver sets the codec up in a very different way where
6500 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6501 	 */
6502 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6503 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6504 	else
6505 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6506 }
6507 
6508 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6509 					const struct hda_fixup *fix, int action)
6510 {
6511 	/* Pin 0x21: headphones/headset mic */
6512 	if (!is_jack_detectable(codec, 0x21))
6513 		return;
6514 
6515 	switch (action) {
6516 	case HDA_FIXUP_ACT_PRE_PROBE:
6517 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6518 				alc294_gx502_toggle_output);
6519 		break;
6520 	case HDA_FIXUP_ACT_INIT:
6521 		/* Make sure to start in a correct state, i.e. if
6522 		 * headphones have been plugged in before powering up the system
6523 		 */
6524 		alc294_gx502_toggle_output(codec, NULL);
6525 		break;
6526 	}
6527 }
6528 
6529 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6530 				       struct hda_jack_callback *cb)
6531 {
6532 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6533 	 * responsible from changes between speakers and headphones
6534 	 */
6535 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6536 		alc_write_coef_idx(codec, 0x10, 0x8420);
6537 	else
6538 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6539 }
6540 
6541 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6542 				  const struct hda_fixup *fix, int action)
6543 {
6544 	if (!is_jack_detectable(codec, 0x21))
6545 		return;
6546 
6547 	switch (action) {
6548 	case HDA_FIXUP_ACT_PRE_PROBE:
6549 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6550 				alc294_gu502_toggle_output);
6551 		break;
6552 	case HDA_FIXUP_ACT_INIT:
6553 		alc294_gu502_toggle_output(codec, NULL);
6554 		break;
6555 	}
6556 }
6557 
6558 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6559 			      const struct hda_fixup *fix, int action)
6560 {
6561 	if (action != HDA_FIXUP_ACT_INIT)
6562 		return;
6563 
6564 	msleep(100);
6565 	alc_write_coef_idx(codec, 0x65, 0x0);
6566 }
6567 
6568 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6569 				    const struct hda_fixup *fix, int action)
6570 {
6571 	switch (action) {
6572 	case HDA_FIXUP_ACT_INIT:
6573 		alc_combo_jack_hp_jd_restart(codec);
6574 		break;
6575 	}
6576 }
6577 
6578 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6579 				    const struct hda_fixup *fix, int action)
6580 {
6581 	struct alc_spec *spec = codec->spec;
6582 
6583 	switch (action) {
6584 	case HDA_FIXUP_ACT_PRE_PROBE:
6585 		/* Mic RING SLEEVE swap for combo jack */
6586 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6587 		spec->no_internal_mic_pin = true;
6588 		break;
6589 	case HDA_FIXUP_ACT_INIT:
6590 		alc_combo_jack_hp_jd_restart(codec);
6591 		break;
6592 	}
6593 }
6594 
6595 /* GPIO1 = amplifier on/off
6596  * GPIO3 = mic mute LED
6597  */
6598 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6599 					  const struct hda_fixup *fix, int action)
6600 {
6601 	static const hda_nid_t conn[] = { 0x02 };
6602 
6603 	struct alc_spec *spec = codec->spec;
6604 	static const struct hda_pintbl pincfgs[] = {
6605 		{ 0x14, 0x90170110 },  /* front/high speakers */
6606 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6607 		{ }
6608 	};
6609 
6610 	//enable micmute led
6611 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6612 
6613 	switch (action) {
6614 	case HDA_FIXUP_ACT_PRE_PROBE:
6615 		spec->micmute_led_polarity = 1;
6616 		/* needed for amp of back speakers */
6617 		spec->gpio_mask |= 0x01;
6618 		spec->gpio_dir |= 0x01;
6619 		snd_hda_apply_pincfgs(codec, pincfgs);
6620 		/* share DAC to have unified volume control */
6621 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6622 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6623 		break;
6624 	case HDA_FIXUP_ACT_INIT:
6625 		/* need to toggle GPIO to enable the amp of back speakers */
6626 		alc_update_gpio_data(codec, 0x01, true);
6627 		msleep(100);
6628 		alc_update_gpio_data(codec, 0x01, false);
6629 		break;
6630 	}
6631 }
6632 
6633 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6634 					  const struct hda_fixup *fix, int action)
6635 {
6636 	static const hda_nid_t conn[] = { 0x02 };
6637 	static const struct hda_pintbl pincfgs[] = {
6638 		{ 0x14, 0x90170110 },  /* rear speaker */
6639 		{ }
6640 	};
6641 
6642 	switch (action) {
6643 	case HDA_FIXUP_ACT_PRE_PROBE:
6644 		snd_hda_apply_pincfgs(codec, pincfgs);
6645 		/* force front speaker to DAC1 */
6646 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6647 		break;
6648 	}
6649 }
6650 
6651 /* for hda_fixup_thinkpad_acpi() */
6652 #include "thinkpad_helper.c"
6653 
6654 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6655 				    const struct hda_fixup *fix, int action)
6656 {
6657 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6658 	hda_fixup_thinkpad_acpi(codec, fix, action);
6659 }
6660 
6661 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6662 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6663 						  const struct hda_fixup *fix,
6664 						  int action)
6665 {
6666 	struct alc_spec *spec = codec->spec;
6667 
6668 	switch (action) {
6669 	case HDA_FIXUP_ACT_PRE_PROBE:
6670 		spec->gen.suppress_auto_mute = 1;
6671 		break;
6672 	}
6673 }
6674 
6675 static int comp_bind(struct device *dev)
6676 {
6677 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6678 	struct alc_spec *spec = cdc->spec;
6679 
6680 	return component_bind_all(dev, spec->comps);
6681 }
6682 
6683 static void comp_unbind(struct device *dev)
6684 {
6685 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6686 	struct alc_spec *spec = cdc->spec;
6687 
6688 	component_unbind_all(dev, spec->comps);
6689 }
6690 
6691 static const struct component_master_ops comp_master_ops = {
6692 	.bind = comp_bind,
6693 	.unbind = comp_unbind,
6694 };
6695 
6696 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6697 				       struct snd_pcm_substream *sub, int action)
6698 {
6699 	struct alc_spec *spec = cdc->spec;
6700 	int i;
6701 
6702 	for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6703 		if (spec->comps[i].dev)
6704 			spec->comps[i].playback_hook(spec->comps[i].dev, action);
6705 	}
6706 }
6707 
6708 struct cs35l41_dev_name {
6709 	const char *bus;
6710 	const char *hid;
6711 	int index;
6712 };
6713 
6714 /* match the device name in a slightly relaxed manner */
6715 static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6716 {
6717 	struct cs35l41_dev_name *p = data;
6718 	const char *d = dev_name(dev);
6719 	int n = strlen(p->bus);
6720 	char tmp[32];
6721 
6722 	/* check the bus name */
6723 	if (strncmp(d, p->bus, n))
6724 		return 0;
6725 	/* skip the bus number */
6726 	if (isdigit(d[n]))
6727 		n++;
6728 	/* the rest must be exact matching */
6729 	snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6730 	return !strcmp(d + n, tmp);
6731 }
6732 
6733 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6734 				  const char *hid, int count)
6735 {
6736 	struct device *dev = hda_codec_dev(cdc);
6737 	struct alc_spec *spec = cdc->spec;
6738 	struct cs35l41_dev_name *rec;
6739 	int ret, i;
6740 
6741 	switch (action) {
6742 	case HDA_FIXUP_ACT_PRE_PROBE:
6743 		for (i = 0; i < count; i++) {
6744 			rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6745 			if (!rec)
6746 				return;
6747 			rec->bus = bus;
6748 			rec->hid = hid;
6749 			rec->index = i;
6750 			spec->comps[i].codec = cdc;
6751 			component_match_add(dev, &spec->match,
6752 					    comp_match_cs35l41_dev_name, rec);
6753 		}
6754 		ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6755 		if (ret)
6756 			codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6757 		else
6758 			spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6759 		break;
6760 	case HDA_FIXUP_ACT_FREE:
6761 		component_master_del(dev, &comp_master_ops);
6762 		break;
6763 	}
6764 }
6765 
6766 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6767 {
6768 	cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6769 }
6770 
6771 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6772 {
6773 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
6774 }
6775 
6776 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6777 {
6778 	cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
6779 }
6780 
6781 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6782 						 int action)
6783 {
6784 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
6785 }
6786 
6787 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6788 						 int action)
6789 {
6790 	cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6791 }
6792 
6793 /* for alc295_fixup_hp_top_speakers */
6794 #include "hp_x360_helper.c"
6795 
6796 /* for alc285_fixup_ideapad_s740_coef() */
6797 #include "ideapad_s740_helper.c"
6798 
6799 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6800 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6801 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6802 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6803 	{}
6804 };
6805 
6806 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6807 					   const struct hda_fixup *fix,
6808 					   int action)
6809 {
6810 	/*
6811 	 * A certain other OS sets these coeffs to different values. On at least
6812 	 * one TongFang barebone these settings might survive even a cold
6813 	 * reboot. So to restore a clean slate the values are explicitly reset
6814 	 * to default here. Without this, the external microphone is always in a
6815 	 * plugged-in state, while the internal microphone is always in an
6816 	 * unplugged state, breaking the ability to use the internal microphone.
6817 	 */
6818 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6819 }
6820 
6821 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6822 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6823 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6824 	WRITE_COEF(0x49, 0x0149),
6825 	{}
6826 };
6827 
6828 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6829 				       const struct hda_fixup *fix,
6830 				       int action)
6831 {
6832 	/*
6833 	 * The audio jack input and output is not detected on the ASRock NUC Box
6834 	 * 1100 series when cold booting without this fix. Warm rebooting from a
6835 	 * certain other OS makes the audio functional, as COEF settings are
6836 	 * preserved in this case. This fix sets these altered COEF values as
6837 	 * the default.
6838 	 */
6839 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6840 }
6841 
6842 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6843 						    const struct hda_fixup *fix,
6844 						    int action)
6845 {
6846 	/*
6847 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6848 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6849 	 * needs an additional quirk for sound working after suspend and resume.
6850 	 */
6851 	if (codec->core.vendor_id == 0x10ec0256) {
6852 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6853 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6854 	} else {
6855 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6856 	}
6857 }
6858 
6859 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
6860 						  const struct hda_fixup *fix,
6861 						  int action)
6862 {
6863 	struct alc_spec *spec = codec->spec;
6864 	struct hda_input_mux *imux = &spec->gen.input_mux;
6865 	int i;
6866 
6867 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
6868 
6869 	switch (action) {
6870 	case HDA_FIXUP_ACT_PRE_PROBE:
6871 		/**
6872 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
6873 		 * to Hi-Z to avoid pop noises at startup and when plugging and
6874 		 * unplugging headphones.
6875 		 */
6876 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6877 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
6878 		break;
6879 	case HDA_FIXUP_ACT_PROBE:
6880 		/**
6881 		 * Make the internal mic (0x12) the default input source to
6882 		 * prevent pop noises on cold boot.
6883 		 */
6884 		for (i = 0; i < imux->num_items; i++) {
6885 			if (spec->gen.imux_pins[i] == 0x12) {
6886 				spec->gen.cur_mux[0] = i;
6887 				break;
6888 			}
6889 		}
6890 		break;
6891 	}
6892 }
6893 
6894 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
6895 					  const struct hda_fixup *fix, int action)
6896 {
6897 	/*
6898 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
6899 	 * unconnected.
6900 	 */
6901 	static const struct hda_pintbl pincfgs[] = {
6902 		{ 0x17, 0x90170121 },
6903 		{ }
6904 	};
6905 	/*
6906 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
6907 	 * DAC 0x02 and 0x03 would be fine.
6908 	 */
6909 	static const hda_nid_t conn[] = { 0x02, 0x03 };
6910 	/*
6911 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
6912 	 * Headphones (0x21) are connected to DAC 0x03.
6913 	 */
6914 	static const hda_nid_t preferred_pairs[] = {
6915 		0x14, 0x02,
6916 		0x17, 0x02,
6917 		0x21, 0x03,
6918 		0
6919 	};
6920 	struct alc_spec *spec = codec->spec;
6921 
6922 	switch (action) {
6923 	case HDA_FIXUP_ACT_PRE_PROBE:
6924 		snd_hda_apply_pincfgs(codec, pincfgs);
6925 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6926 		spec->gen.preferred_dacs = preferred_pairs;
6927 		break;
6928 	}
6929 }
6930 
6931 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
6932 					  const struct hda_fixup *fix, int action)
6933 {
6934 	static const struct hda_pintbl pincfgs[] = {
6935 		{ 0x14, 0x90170151 },
6936 		{ 0x17, 0x90170150 },
6937 		{ }
6938 	};
6939 	static const hda_nid_t conn[] = { 0x02, 0x03 };
6940 	static const hda_nid_t preferred_pairs[] = {
6941 		0x14, 0x02,
6942 		0x17, 0x03,
6943 		0x21, 0x02,
6944 		0
6945 	};
6946 	struct alc_spec *spec = codec->spec;
6947 
6948 	alc_fixup_no_shutup(codec, fix, action);
6949 
6950 	switch (action) {
6951 	case HDA_FIXUP_ACT_PRE_PROBE:
6952 		snd_hda_apply_pincfgs(codec, pincfgs);
6953 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6954 		spec->gen.preferred_dacs = preferred_pairs;
6955 		break;
6956 	}
6957 }
6958 
6959 enum {
6960 	ALC269_FIXUP_GPIO2,
6961 	ALC269_FIXUP_SONY_VAIO,
6962 	ALC275_FIXUP_SONY_VAIO_GPIO2,
6963 	ALC269_FIXUP_DELL_M101Z,
6964 	ALC269_FIXUP_SKU_IGNORE,
6965 	ALC269_FIXUP_ASUS_G73JW,
6966 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
6967 	ALC269_FIXUP_ASUS_N7601ZM,
6968 	ALC269_FIXUP_LENOVO_EAPD,
6969 	ALC275_FIXUP_SONY_HWEQ,
6970 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
6971 	ALC271_FIXUP_DMIC,
6972 	ALC269_FIXUP_PCM_44K,
6973 	ALC269_FIXUP_STEREO_DMIC,
6974 	ALC269_FIXUP_HEADSET_MIC,
6975 	ALC269_FIXUP_QUANTA_MUTE,
6976 	ALC269_FIXUP_LIFEBOOK,
6977 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
6978 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
6979 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6980 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6981 	ALC269_FIXUP_AMIC,
6982 	ALC269_FIXUP_DMIC,
6983 	ALC269VB_FIXUP_AMIC,
6984 	ALC269VB_FIXUP_DMIC,
6985 	ALC269_FIXUP_HP_MUTE_LED,
6986 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
6987 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
6988 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
6989 	ALC269_FIXUP_HP_GPIO_LED,
6990 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
6991 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
6992 	ALC269_FIXUP_INV_DMIC,
6993 	ALC269_FIXUP_LENOVO_DOCK,
6994 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6995 	ALC269_FIXUP_NO_SHUTUP,
6996 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6997 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6998 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6999 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7000 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7001 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7002 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7003 	ALC269_FIXUP_HEADSET_MODE,
7004 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7005 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7006 	ALC269_FIXUP_ASUS_X101_FUNC,
7007 	ALC269_FIXUP_ASUS_X101_VERB,
7008 	ALC269_FIXUP_ASUS_X101,
7009 	ALC271_FIXUP_AMIC_MIC2,
7010 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7011 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7012 	ALC269_FIXUP_ACER_AC700,
7013 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7014 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7015 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7016 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7017 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7018 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7019 	ALC283_FIXUP_CHROME_BOOK,
7020 	ALC283_FIXUP_SENSE_COMBO_JACK,
7021 	ALC282_FIXUP_ASUS_TX300,
7022 	ALC283_FIXUP_INT_MIC,
7023 	ALC290_FIXUP_MONO_SPEAKERS,
7024 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7025 	ALC290_FIXUP_SUBWOOFER,
7026 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7027 	ALC269_FIXUP_THINKPAD_ACPI,
7028 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7029 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7030 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7031 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7032 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7033 	ALC255_FIXUP_HEADSET_MODE,
7034 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7035 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7036 	ALC292_FIXUP_TPT440_DOCK,
7037 	ALC292_FIXUP_TPT440,
7038 	ALC283_FIXUP_HEADSET_MIC,
7039 	ALC255_FIXUP_MIC_MUTE_LED,
7040 	ALC282_FIXUP_ASPIRE_V5_PINS,
7041 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7042 	ALC280_FIXUP_HP_GPIO4,
7043 	ALC286_FIXUP_HP_GPIO_LED,
7044 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7045 	ALC280_FIXUP_HP_DOCK_PINS,
7046 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7047 	ALC280_FIXUP_HP_9480M,
7048 	ALC245_FIXUP_HP_X360_AMP,
7049 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7050 	ALC288_FIXUP_DELL_HEADSET_MODE,
7051 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7052 	ALC288_FIXUP_DELL_XPS_13,
7053 	ALC288_FIXUP_DISABLE_AAMIX,
7054 	ALC292_FIXUP_DELL_E7X_AAMIX,
7055 	ALC292_FIXUP_DELL_E7X,
7056 	ALC292_FIXUP_DISABLE_AAMIX,
7057 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7058 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7059 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7060 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7061 	ALC275_FIXUP_DELL_XPS,
7062 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7063 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7064 	ALC255_FIXUP_DELL_SPK_NOISE,
7065 	ALC225_FIXUP_DISABLE_MIC_VREF,
7066 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7067 	ALC295_FIXUP_DISABLE_DAC3,
7068 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7069 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7070 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7071 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7072 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7073 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7074 	ALC280_FIXUP_HP_HEADSET_MIC,
7075 	ALC221_FIXUP_HP_FRONT_MIC,
7076 	ALC292_FIXUP_TPT460,
7077 	ALC298_FIXUP_SPK_VOLUME,
7078 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7079 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7080 	ALC269_FIXUP_ATIV_BOOK_8,
7081 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7082 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7083 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7084 	ALC256_FIXUP_ASUS_MIC,
7085 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7086 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7087 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7088 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7089 	ALC233_FIXUP_ACER_HEADSET_MIC,
7090 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7091 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7092 	ALC225_FIXUP_S3_POP_NOISE,
7093 	ALC700_FIXUP_INTEL_REFERENCE,
7094 	ALC274_FIXUP_DELL_BIND_DACS,
7095 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7096 	ALC298_FIXUP_TPT470_DOCK_FIX,
7097 	ALC298_FIXUP_TPT470_DOCK,
7098 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7099 	ALC255_FIXUP_DELL_HEADSET_MIC,
7100 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7101 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7102 	ALC295_FIXUP_HP_X360,
7103 	ALC221_FIXUP_HP_HEADSET_MIC,
7104 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7105 	ALC295_FIXUP_HP_AUTO_MUTE,
7106 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7107 	ALC294_FIXUP_ASUS_MIC,
7108 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7109 	ALC294_FIXUP_ASUS_SPK,
7110 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7111 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7112 	ALC255_FIXUP_ACER_HEADSET_MIC,
7113 	ALC295_FIXUP_CHROME_BOOK,
7114 	ALC225_FIXUP_HEADSET_JACK,
7115 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7116 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7117 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7118 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7119 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7120 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7121 	ALC299_FIXUP_PREDATOR_SPK,
7122 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7123 	ALC289_FIXUP_DELL_SPK2,
7124 	ALC289_FIXUP_DUAL_SPK,
7125 	ALC294_FIXUP_SPK2_TO_DAC1,
7126 	ALC294_FIXUP_ASUS_DUAL_SPK,
7127 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7128 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7129 	ALC294_FIXUP_ASUS_ALLY,
7130 	ALC294_FIXUP_ASUS_ALLY_PINS,
7131 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7132 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7133 	ALC294_FIXUP_ASUS_HPE,
7134 	ALC294_FIXUP_ASUS_COEF_1B,
7135 	ALC294_FIXUP_ASUS_GX502_HP,
7136 	ALC294_FIXUP_ASUS_GX502_PINS,
7137 	ALC294_FIXUP_ASUS_GX502_VERBS,
7138 	ALC294_FIXUP_ASUS_GU502_HP,
7139 	ALC294_FIXUP_ASUS_GU502_PINS,
7140 	ALC294_FIXUP_ASUS_GU502_VERBS,
7141 	ALC294_FIXUP_ASUS_G513_PINS,
7142 	ALC285_FIXUP_ASUS_G533Z_PINS,
7143 	ALC285_FIXUP_HP_GPIO_LED,
7144 	ALC285_FIXUP_HP_MUTE_LED,
7145 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7146 	ALC236_FIXUP_HP_GPIO_LED,
7147 	ALC236_FIXUP_HP_MUTE_LED,
7148 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7149 	ALC298_FIXUP_SAMSUNG_AMP,
7150 	ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7151 	ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7152 	ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7153 	ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7154 	ALC269VC_FIXUP_ACER_HEADSET_MIC,
7155 	ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7156 	ALC289_FIXUP_ASUS_GA401,
7157 	ALC289_FIXUP_ASUS_GA502,
7158 	ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7159 	ALC285_FIXUP_HP_GPIO_AMP_INIT,
7160 	ALC269_FIXUP_CZC_B20,
7161 	ALC269_FIXUP_CZC_TMI,
7162 	ALC269_FIXUP_CZC_L101,
7163 	ALC269_FIXUP_LEMOTE_A1802,
7164 	ALC269_FIXUP_LEMOTE_A190X,
7165 	ALC256_FIXUP_INTEL_NUC8_RUGGED,
7166 	ALC233_FIXUP_INTEL_NUC8_DMIC,
7167 	ALC233_FIXUP_INTEL_NUC8_BOOST,
7168 	ALC256_FIXUP_INTEL_NUC10,
7169 	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7170 	ALC274_FIXUP_HP_MIC,
7171 	ALC274_FIXUP_HP_HEADSET_MIC,
7172 	ALC274_FIXUP_HP_ENVY_GPIO,
7173 	ALC256_FIXUP_ASUS_HPE,
7174 	ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7175 	ALC287_FIXUP_HP_GPIO_LED,
7176 	ALC256_FIXUP_HP_HEADSET_MIC,
7177 	ALC245_FIXUP_HP_GPIO_LED,
7178 	ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7179 	ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7180 	ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7181 	ALC256_FIXUP_ACER_HEADSET_MIC,
7182 	ALC285_FIXUP_IDEAPAD_S740_COEF,
7183 	ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7184 	ALC295_FIXUP_ASUS_DACS,
7185 	ALC295_FIXUP_HP_OMEN,
7186 	ALC285_FIXUP_HP_SPECTRE_X360,
7187 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7188 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7189 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7190 	ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7191 	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7192 	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7193 	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7194 	ALC298_FIXUP_LENOVO_C940_DUET7,
7195 	ALC287_FIXUP_13S_GEN2_SPEAKERS,
7196 	ALC256_FIXUP_SET_COEF_DEFAULTS,
7197 	ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7198 	ALC233_FIXUP_NO_AUDIO_JACK,
7199 	ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7200 	ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7201 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7202 	ALC287_FIXUP_LEGION_16ACHG6,
7203 	ALC287_FIXUP_CS35L41_I2C_2,
7204 	ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7205 	ALC245_FIXUP_CS35L41_SPI_2,
7206 	ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7207 	ALC245_FIXUP_CS35L41_SPI_4,
7208 	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7209 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7210 	ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7211 	ALC287_FIXUP_LEGION_16ITHG6,
7212 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7213 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7214 	ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7215 	ALC236_FIXUP_DELL_DUAL_CODECS,
7216 };
7217 
7218 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7219  * both have the very same PCI SSID, and we need to apply different fixups
7220  * depending on the codec ID
7221  */
7222 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7223 					   const struct hda_fixup *fix,
7224 					   int action)
7225 {
7226 	int id;
7227 
7228 	if (codec->core.vendor_id == 0x10ec0298)
7229 		id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7230 	else
7231 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7232 	__snd_hda_apply_fixup(codec, id, action, 0);
7233 }
7234 
7235 static const struct hda_fixup alc269_fixups[] = {
7236 	[ALC269_FIXUP_GPIO2] = {
7237 		.type = HDA_FIXUP_FUNC,
7238 		.v.func = alc_fixup_gpio2,
7239 	},
7240 	[ALC269_FIXUP_SONY_VAIO] = {
7241 		.type = HDA_FIXUP_PINCTLS,
7242 		.v.pins = (const struct hda_pintbl[]) {
7243 			{0x19, PIN_VREFGRD},
7244 			{}
7245 		}
7246 	},
7247 	[ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7248 		.type = HDA_FIXUP_FUNC,
7249 		.v.func = alc275_fixup_gpio4_off,
7250 		.chained = true,
7251 		.chain_id = ALC269_FIXUP_SONY_VAIO
7252 	},
7253 	[ALC269_FIXUP_DELL_M101Z] = {
7254 		.type = HDA_FIXUP_VERBS,
7255 		.v.verbs = (const struct hda_verb[]) {
7256 			/* Enables internal speaker */
7257 			{0x20, AC_VERB_SET_COEF_INDEX, 13},
7258 			{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7259 			{}
7260 		}
7261 	},
7262 	[ALC269_FIXUP_SKU_IGNORE] = {
7263 		.type = HDA_FIXUP_FUNC,
7264 		.v.func = alc_fixup_sku_ignore,
7265 	},
7266 	[ALC269_FIXUP_ASUS_G73JW] = {
7267 		.type = HDA_FIXUP_PINS,
7268 		.v.pins = (const struct hda_pintbl[]) {
7269 			{ 0x17, 0x99130111 }, /* subwoofer */
7270 			{ }
7271 		}
7272 	},
7273 	[ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7274 		.type = HDA_FIXUP_PINS,
7275 		.v.pins = (const struct hda_pintbl[]) {
7276 			{ 0x19, 0x03A11050 },
7277 			{ 0x1a, 0x03A11C30 },
7278 			{ 0x21, 0x03211420 },
7279 			{ }
7280 		}
7281 	},
7282 	[ALC269_FIXUP_ASUS_N7601ZM] = {
7283 		.type = HDA_FIXUP_VERBS,
7284 		.v.verbs = (const struct hda_verb[]) {
7285 			{0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7286 			{0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7287 			{0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7288 			{0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7289 			{0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7290 			{0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7291 			{ }
7292 		},
7293 		.chained = true,
7294 		.chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7295 	},
7296 	[ALC269_FIXUP_LENOVO_EAPD] = {
7297 		.type = HDA_FIXUP_VERBS,
7298 		.v.verbs = (const struct hda_verb[]) {
7299 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7300 			{}
7301 		}
7302 	},
7303 	[ALC275_FIXUP_SONY_HWEQ] = {
7304 		.type = HDA_FIXUP_FUNC,
7305 		.v.func = alc269_fixup_hweq,
7306 		.chained = true,
7307 		.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7308 	},
7309 	[ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7310 		.type = HDA_FIXUP_FUNC,
7311 		.v.func = alc_fixup_disable_aamix,
7312 		.chained = true,
7313 		.chain_id = ALC269_FIXUP_SONY_VAIO
7314 	},
7315 	[ALC271_FIXUP_DMIC] = {
7316 		.type = HDA_FIXUP_FUNC,
7317 		.v.func = alc271_fixup_dmic,
7318 	},
7319 	[ALC269_FIXUP_PCM_44K] = {
7320 		.type = HDA_FIXUP_FUNC,
7321 		.v.func = alc269_fixup_pcm_44k,
7322 		.chained = true,
7323 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7324 	},
7325 	[ALC269_FIXUP_STEREO_DMIC] = {
7326 		.type = HDA_FIXUP_FUNC,
7327 		.v.func = alc269_fixup_stereo_dmic,
7328 	},
7329 	[ALC269_FIXUP_HEADSET_MIC] = {
7330 		.type = HDA_FIXUP_FUNC,
7331 		.v.func = alc269_fixup_headset_mic,
7332 	},
7333 	[ALC269_FIXUP_QUANTA_MUTE] = {
7334 		.type = HDA_FIXUP_FUNC,
7335 		.v.func = alc269_fixup_quanta_mute,
7336 	},
7337 	[ALC269_FIXUP_LIFEBOOK] = {
7338 		.type = HDA_FIXUP_PINS,
7339 		.v.pins = (const struct hda_pintbl[]) {
7340 			{ 0x1a, 0x2101103f }, /* dock line-out */
7341 			{ 0x1b, 0x23a11040 }, /* dock mic-in */
7342 			{ }
7343 		},
7344 		.chained = true,
7345 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7346 	},
7347 	[ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7348 		.type = HDA_FIXUP_PINS,
7349 		.v.pins = (const struct hda_pintbl[]) {
7350 			{ 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7351 			{ }
7352 		},
7353 	},
7354 	[ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7355 		.type = HDA_FIXUP_PINS,
7356 		.v.pins = (const struct hda_pintbl[]) {
7357 			{ 0x21, 0x0221102f }, /* HP out */
7358 			{ }
7359 		},
7360 	},
7361 	[ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7362 		.type = HDA_FIXUP_FUNC,
7363 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7364 	},
7365 	[ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7366 		.type = HDA_FIXUP_FUNC,
7367 		.v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7368 	},
7369 	[ALC269_FIXUP_AMIC] = {
7370 		.type = HDA_FIXUP_PINS,
7371 		.v.pins = (const struct hda_pintbl[]) {
7372 			{ 0x14, 0x99130110 }, /* speaker */
7373 			{ 0x15, 0x0121401f }, /* HP out */
7374 			{ 0x18, 0x01a19c20 }, /* mic */
7375 			{ 0x19, 0x99a3092f }, /* int-mic */
7376 			{ }
7377 		},
7378 	},
7379 	[ALC269_FIXUP_DMIC] = {
7380 		.type = HDA_FIXUP_PINS,
7381 		.v.pins = (const struct hda_pintbl[]) {
7382 			{ 0x12, 0x99a3092f }, /* int-mic */
7383 			{ 0x14, 0x99130110 }, /* speaker */
7384 			{ 0x15, 0x0121401f }, /* HP out */
7385 			{ 0x18, 0x01a19c20 }, /* mic */
7386 			{ }
7387 		},
7388 	},
7389 	[ALC269VB_FIXUP_AMIC] = {
7390 		.type = HDA_FIXUP_PINS,
7391 		.v.pins = (const struct hda_pintbl[]) {
7392 			{ 0x14, 0x99130110 }, /* speaker */
7393 			{ 0x18, 0x01a19c20 }, /* mic */
7394 			{ 0x19, 0x99a3092f }, /* int-mic */
7395 			{ 0x21, 0x0121401f }, /* HP out */
7396 			{ }
7397 		},
7398 	},
7399 	[ALC269VB_FIXUP_DMIC] = {
7400 		.type = HDA_FIXUP_PINS,
7401 		.v.pins = (const struct hda_pintbl[]) {
7402 			{ 0x12, 0x99a3092f }, /* int-mic */
7403 			{ 0x14, 0x99130110 }, /* speaker */
7404 			{ 0x18, 0x01a19c20 }, /* mic */
7405 			{ 0x21, 0x0121401f }, /* HP out */
7406 			{ }
7407 		},
7408 	},
7409 	[ALC269_FIXUP_HP_MUTE_LED] = {
7410 		.type = HDA_FIXUP_FUNC,
7411 		.v.func = alc269_fixup_hp_mute_led,
7412 	},
7413 	[ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7414 		.type = HDA_FIXUP_FUNC,
7415 		.v.func = alc269_fixup_hp_mute_led_mic1,
7416 	},
7417 	[ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7418 		.type = HDA_FIXUP_FUNC,
7419 		.v.func = alc269_fixup_hp_mute_led_mic2,
7420 	},
7421 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7422 		.type = HDA_FIXUP_FUNC,
7423 		.v.func = alc269_fixup_hp_mute_led_mic3,
7424 		.chained = true,
7425 		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7426 	},
7427 	[ALC269_FIXUP_HP_GPIO_LED] = {
7428 		.type = HDA_FIXUP_FUNC,
7429 		.v.func = alc269_fixup_hp_gpio_led,
7430 	},
7431 	[ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7432 		.type = HDA_FIXUP_FUNC,
7433 		.v.func = alc269_fixup_hp_gpio_mic1_led,
7434 	},
7435 	[ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7436 		.type = HDA_FIXUP_FUNC,
7437 		.v.func = alc269_fixup_hp_line1_mic1_led,
7438 	},
7439 	[ALC269_FIXUP_INV_DMIC] = {
7440 		.type = HDA_FIXUP_FUNC,
7441 		.v.func = alc_fixup_inv_dmic,
7442 	},
7443 	[ALC269_FIXUP_NO_SHUTUP] = {
7444 		.type = HDA_FIXUP_FUNC,
7445 		.v.func = alc_fixup_no_shutup,
7446 	},
7447 	[ALC269_FIXUP_LENOVO_DOCK] = {
7448 		.type = HDA_FIXUP_PINS,
7449 		.v.pins = (const struct hda_pintbl[]) {
7450 			{ 0x19, 0x23a11040 }, /* dock mic */
7451 			{ 0x1b, 0x2121103f }, /* dock headphone */
7452 			{ }
7453 		},
7454 		.chained = true,
7455 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7456 	},
7457 	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7458 		.type = HDA_FIXUP_FUNC,
7459 		.v.func = alc269_fixup_limit_int_mic_boost,
7460 		.chained = true,
7461 		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
7462 	},
7463 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7464 		.type = HDA_FIXUP_FUNC,
7465 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7466 		.chained = true,
7467 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7468 	},
7469 	[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7470 		.type = HDA_FIXUP_PINS,
7471 		.v.pins = (const struct hda_pintbl[]) {
7472 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7473 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7474 			{ }
7475 		},
7476 		.chained = true,
7477 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7478 	},
7479 	[ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7480 		.type = HDA_FIXUP_PINS,
7481 		.v.pins = (const struct hda_pintbl[]) {
7482 			{ 0x16, 0x21014020 }, /* dock line out */
7483 			{ 0x19, 0x21a19030 }, /* dock mic */
7484 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7485 			{ }
7486 		},
7487 		.chained = true,
7488 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7489 	},
7490 	[ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7491 		.type = HDA_FIXUP_PINS,
7492 		.v.pins = (const struct hda_pintbl[]) {
7493 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7494 			{ }
7495 		},
7496 		.chained = true,
7497 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7498 	},
7499 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7500 		.type = HDA_FIXUP_PINS,
7501 		.v.pins = (const struct hda_pintbl[]) {
7502 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7503 			{ 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7504 			{ }
7505 		},
7506 		.chained = true,
7507 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7508 	},
7509 	[ALC269_FIXUP_HEADSET_MODE] = {
7510 		.type = HDA_FIXUP_FUNC,
7511 		.v.func = alc_fixup_headset_mode,
7512 		.chained = true,
7513 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7514 	},
7515 	[ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7516 		.type = HDA_FIXUP_FUNC,
7517 		.v.func = alc_fixup_headset_mode_no_hp_mic,
7518 	},
7519 	[ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7520 		.type = HDA_FIXUP_PINS,
7521 		.v.pins = (const struct hda_pintbl[]) {
7522 			{ 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7523 			{ }
7524 		},
7525 		.chained = true,
7526 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
7527 	},
7528 	[ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7529 		.type = HDA_FIXUP_PINS,
7530 		.v.pins = (const struct hda_pintbl[]) {
7531 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7532 			{ }
7533 		},
7534 		.chained = true,
7535 		.chain_id = ALC269_FIXUP_HEADSET_MIC
7536 	},
7537 	[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7538 		.type = HDA_FIXUP_PINS,
7539 		.v.pins = (const struct hda_pintbl[]) {
7540 			{0x12, 0x90a60130},
7541 			{0x13, 0x40000000},
7542 			{0x14, 0x90170110},
7543 			{0x18, 0x411111f0},
7544 			{0x19, 0x04a11040},
7545 			{0x1a, 0x411111f0},
7546 			{0x1b, 0x90170112},
7547 			{0x1d, 0x40759a05},
7548 			{0x1e, 0x411111f0},
7549 			{0x21, 0x04211020},
7550 			{ }
7551 		},
7552 		.chained = true,
7553 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7554 	},
7555 	[ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7556 		.type = HDA_FIXUP_FUNC,
7557 		.v.func = alc298_fixup_huawei_mbx_stereo,
7558 		.chained = true,
7559 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7560 	},
7561 	[ALC269_FIXUP_ASUS_X101_FUNC] = {
7562 		.type = HDA_FIXUP_FUNC,
7563 		.v.func = alc269_fixup_x101_headset_mic,
7564 	},
7565 	[ALC269_FIXUP_ASUS_X101_VERB] = {
7566 		.type = HDA_FIXUP_VERBS,
7567 		.v.verbs = (const struct hda_verb[]) {
7568 			{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7569 			{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7570 			{0x20, AC_VERB_SET_PROC_COEF,  0x0310},
7571 			{ }
7572 		},
7573 		.chained = true,
7574 		.chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7575 	},
7576 	[ALC269_FIXUP_ASUS_X101] = {
7577 		.type = HDA_FIXUP_PINS,
7578 		.v.pins = (const struct hda_pintbl[]) {
7579 			{ 0x18, 0x04a1182c }, /* Headset mic */
7580 			{ }
7581 		},
7582 		.chained = true,
7583 		.chain_id = ALC269_FIXUP_ASUS_X101_VERB
7584 	},
7585 	[ALC271_FIXUP_AMIC_MIC2] = {
7586 		.type = HDA_FIXUP_PINS,
7587 		.v.pins = (const struct hda_pintbl[]) {
7588 			{ 0x14, 0x99130110 }, /* speaker */
7589 			{ 0x19, 0x01a19c20 }, /* mic */
7590 			{ 0x1b, 0x99a7012f }, /* int-mic */
7591 			{ 0x21, 0x0121401f }, /* HP out */
7592 			{ }
7593 		},
7594 	},
7595 	[ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7596 		.type = HDA_FIXUP_FUNC,
7597 		.v.func = alc271_hp_gate_mic_jack,
7598 		.chained = true,
7599 		.chain_id = ALC271_FIXUP_AMIC_MIC2,
7600 	},
7601 	[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7602 		.type = HDA_FIXUP_FUNC,
7603 		.v.func = alc269_fixup_limit_int_mic_boost,
7604 		.chained = true,
7605 		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7606 	},
7607 	[ALC269_FIXUP_ACER_AC700] = {
7608 		.type = HDA_FIXUP_PINS,
7609 		.v.pins = (const struct hda_pintbl[]) {
7610 			{ 0x12, 0x99a3092f }, /* int-mic */
7611 			{ 0x14, 0x99130110 }, /* speaker */
7612 			{ 0x18, 0x03a11c20 }, /* mic */
7613 			{ 0x1e, 0x0346101e }, /* SPDIF1 */
7614 			{ 0x21, 0x0321101f }, /* HP out */
7615 			{ }
7616 		},
7617 		.chained = true,
7618 		.chain_id = ALC271_FIXUP_DMIC,
7619 	},
7620 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7621 		.type = HDA_FIXUP_FUNC,
7622 		.v.func = alc269_fixup_limit_int_mic_boost,
7623 		.chained = true,
7624 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7625 	},
7626 	[ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7627 		.type = HDA_FIXUP_FUNC,
7628 		.v.func = alc269_fixup_limit_int_mic_boost,
7629 		.chained = true,
7630 		.chain_id = ALC269VB_FIXUP_DMIC,
7631 	},
7632 	[ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7633 		.type = HDA_FIXUP_VERBS,
7634 		.v.verbs = (const struct hda_verb[]) {
7635 			/* class-D output amp +5dB */
7636 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7637 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7638 			{}
7639 		},
7640 		.chained = true,
7641 		.chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7642 	},
7643 	[ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7644 		.type = HDA_FIXUP_PINS,
7645 		.v.pins = (const struct hda_pintbl[]) {
7646 			{ 0x18, 0x01a110f0 },  /* use as headset mic */
7647 			{ }
7648 		},
7649 		.chained = true,
7650 		.chain_id = ALC269_FIXUP_HEADSET_MIC
7651 	},
7652 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7653 		.type = HDA_FIXUP_FUNC,
7654 		.v.func = alc269_fixup_limit_int_mic_boost,
7655 		.chained = true,
7656 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7657 	},
7658 	[ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7659 		.type = HDA_FIXUP_PINS,
7660 		.v.pins = (const struct hda_pintbl[]) {
7661 			{ 0x12, 0x99a3092f }, /* int-mic */
7662 			{ 0x18, 0x03a11d20 }, /* mic */
7663 			{ 0x19, 0x411111f0 }, /* Unused bogus pin */
7664 			{ }
7665 		},
7666 	},
7667 	[ALC283_FIXUP_CHROME_BOOK] = {
7668 		.type = HDA_FIXUP_FUNC,
7669 		.v.func = alc283_fixup_chromebook,
7670 	},
7671 	[ALC283_FIXUP_SENSE_COMBO_JACK] = {
7672 		.type = HDA_FIXUP_FUNC,
7673 		.v.func = alc283_fixup_sense_combo_jack,
7674 		.chained = true,
7675 		.chain_id = ALC283_FIXUP_CHROME_BOOK,
7676 	},
7677 	[ALC282_FIXUP_ASUS_TX300] = {
7678 		.type = HDA_FIXUP_FUNC,
7679 		.v.func = alc282_fixup_asus_tx300,
7680 	},
7681 	[ALC283_FIXUP_INT_MIC] = {
7682 		.type = HDA_FIXUP_VERBS,
7683 		.v.verbs = (const struct hda_verb[]) {
7684 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7685 			{0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7686 			{ }
7687 		},
7688 		.chained = true,
7689 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7690 	},
7691 	[ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7692 		.type = HDA_FIXUP_PINS,
7693 		.v.pins = (const struct hda_pintbl[]) {
7694 			{ 0x17, 0x90170112 }, /* subwoofer */
7695 			{ }
7696 		},
7697 		.chained = true,
7698 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7699 	},
7700 	[ALC290_FIXUP_SUBWOOFER] = {
7701 		.type = HDA_FIXUP_PINS,
7702 		.v.pins = (const struct hda_pintbl[]) {
7703 			{ 0x17, 0x90170112 }, /* subwoofer */
7704 			{ }
7705 		},
7706 		.chained = true,
7707 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7708 	},
7709 	[ALC290_FIXUP_MONO_SPEAKERS] = {
7710 		.type = HDA_FIXUP_FUNC,
7711 		.v.func = alc290_fixup_mono_speakers,
7712 	},
7713 	[ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7714 		.type = HDA_FIXUP_FUNC,
7715 		.v.func = alc290_fixup_mono_speakers,
7716 		.chained = true,
7717 		.chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7718 	},
7719 	[ALC269_FIXUP_THINKPAD_ACPI] = {
7720 		.type = HDA_FIXUP_FUNC,
7721 		.v.func = alc_fixup_thinkpad_acpi,
7722 		.chained = true,
7723 		.chain_id = ALC269_FIXUP_SKU_IGNORE,
7724 	},
7725 	[ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7726 		.type = HDA_FIXUP_FUNC,
7727 		.v.func = alc_fixup_inv_dmic,
7728 		.chained = true,
7729 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7730 	},
7731 	[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7732 		.type = HDA_FIXUP_PINS,
7733 		.v.pins = (const struct hda_pintbl[]) {
7734 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7735 			{ }
7736 		},
7737 		.chained = true,
7738 		.chain_id = ALC255_FIXUP_HEADSET_MODE
7739 	},
7740 	[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7741 		.type = HDA_FIXUP_PINS,
7742 		.v.pins = (const struct hda_pintbl[]) {
7743 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7744 			{ }
7745 		},
7746 		.chained = true,
7747 		.chain_id = ALC255_FIXUP_HEADSET_MODE
7748 	},
7749 	[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7750 		.type = HDA_FIXUP_PINS,
7751 		.v.pins = (const struct hda_pintbl[]) {
7752 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7753 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7754 			{ }
7755 		},
7756 		.chained = true,
7757 		.chain_id = ALC255_FIXUP_HEADSET_MODE
7758 	},
7759 	[ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7760 		.type = HDA_FIXUP_PINS,
7761 		.v.pins = (const struct hda_pintbl[]) {
7762 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7763 			{ }
7764 		},
7765 		.chained = true,
7766 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7767 	},
7768 	[ALC255_FIXUP_HEADSET_MODE] = {
7769 		.type = HDA_FIXUP_FUNC,
7770 		.v.func = alc_fixup_headset_mode_alc255,
7771 		.chained = true,
7772 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7773 	},
7774 	[ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7775 		.type = HDA_FIXUP_FUNC,
7776 		.v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7777 	},
7778 	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7779 		.type = HDA_FIXUP_PINS,
7780 		.v.pins = (const struct hda_pintbl[]) {
7781 			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7782 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7783 			{ }
7784 		},
7785 		.chained = true,
7786 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7787 	},
7788 	[ALC292_FIXUP_TPT440_DOCK] = {
7789 		.type = HDA_FIXUP_FUNC,
7790 		.v.func = alc_fixup_tpt440_dock,
7791 		.chained = true,
7792 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7793 	},
7794 	[ALC292_FIXUP_TPT440] = {
7795 		.type = HDA_FIXUP_FUNC,
7796 		.v.func = alc_fixup_disable_aamix,
7797 		.chained = true,
7798 		.chain_id = ALC292_FIXUP_TPT440_DOCK,
7799 	},
7800 	[ALC283_FIXUP_HEADSET_MIC] = {
7801 		.type = HDA_FIXUP_PINS,
7802 		.v.pins = (const struct hda_pintbl[]) {
7803 			{ 0x19, 0x04a110f0 },
7804 			{ },
7805 		},
7806 	},
7807 	[ALC255_FIXUP_MIC_MUTE_LED] = {
7808 		.type = HDA_FIXUP_FUNC,
7809 		.v.func = alc_fixup_micmute_led,
7810 	},
7811 	[ALC282_FIXUP_ASPIRE_V5_PINS] = {
7812 		.type = HDA_FIXUP_PINS,
7813 		.v.pins = (const struct hda_pintbl[]) {
7814 			{ 0x12, 0x90a60130 },
7815 			{ 0x14, 0x90170110 },
7816 			{ 0x17, 0x40000008 },
7817 			{ 0x18, 0x411111f0 },
7818 			{ 0x19, 0x01a1913c },
7819 			{ 0x1a, 0x411111f0 },
7820 			{ 0x1b, 0x411111f0 },
7821 			{ 0x1d, 0x40f89b2d },
7822 			{ 0x1e, 0x411111f0 },
7823 			{ 0x21, 0x0321101f },
7824 			{ },
7825 		},
7826 	},
7827 	[ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7828 		.type = HDA_FIXUP_FUNC,
7829 		.v.func = alc269vb_fixup_aspire_e1_coef,
7830 	},
7831 	[ALC280_FIXUP_HP_GPIO4] = {
7832 		.type = HDA_FIXUP_FUNC,
7833 		.v.func = alc280_fixup_hp_gpio4,
7834 	},
7835 	[ALC286_FIXUP_HP_GPIO_LED] = {
7836 		.type = HDA_FIXUP_FUNC,
7837 		.v.func = alc286_fixup_hp_gpio_led,
7838 	},
7839 	[ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7840 		.type = HDA_FIXUP_FUNC,
7841 		.v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7842 	},
7843 	[ALC280_FIXUP_HP_DOCK_PINS] = {
7844 		.type = HDA_FIXUP_PINS,
7845 		.v.pins = (const struct hda_pintbl[]) {
7846 			{ 0x1b, 0x21011020 }, /* line-out */
7847 			{ 0x1a, 0x01a1903c }, /* headset mic */
7848 			{ 0x18, 0x2181103f }, /* line-in */
7849 			{ },
7850 		},
7851 		.chained = true,
7852 		.chain_id = ALC280_FIXUP_HP_GPIO4
7853 	},
7854 	[ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7855 		.type = HDA_FIXUP_PINS,
7856 		.v.pins = (const struct hda_pintbl[]) {
7857 			{ 0x1b, 0x21011020 }, /* line-out */
7858 			{ 0x18, 0x2181103f }, /* line-in */
7859 			{ },
7860 		},
7861 		.chained = true,
7862 		.chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7863 	},
7864 	[ALC280_FIXUP_HP_9480M] = {
7865 		.type = HDA_FIXUP_FUNC,
7866 		.v.func = alc280_fixup_hp_9480m,
7867 	},
7868 	[ALC245_FIXUP_HP_X360_AMP] = {
7869 		.type = HDA_FIXUP_FUNC,
7870 		.v.func = alc245_fixup_hp_x360_amp,
7871 		.chained = true,
7872 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
7873 	},
7874 	[ALC288_FIXUP_DELL_HEADSET_MODE] = {
7875 		.type = HDA_FIXUP_FUNC,
7876 		.v.func = alc_fixup_headset_mode_dell_alc288,
7877 		.chained = true,
7878 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
7879 	},
7880 	[ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7881 		.type = HDA_FIXUP_PINS,
7882 		.v.pins = (const struct hda_pintbl[]) {
7883 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7884 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7885 			{ }
7886 		},
7887 		.chained = true,
7888 		.chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7889 	},
7890 	[ALC288_FIXUP_DISABLE_AAMIX] = {
7891 		.type = HDA_FIXUP_FUNC,
7892 		.v.func = alc_fixup_disable_aamix,
7893 		.chained = true,
7894 		.chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7895 	},
7896 	[ALC288_FIXUP_DELL_XPS_13] = {
7897 		.type = HDA_FIXUP_FUNC,
7898 		.v.func = alc_fixup_dell_xps13,
7899 		.chained = true,
7900 		.chain_id = ALC288_FIXUP_DISABLE_AAMIX
7901 	},
7902 	[ALC292_FIXUP_DISABLE_AAMIX] = {
7903 		.type = HDA_FIXUP_FUNC,
7904 		.v.func = alc_fixup_disable_aamix,
7905 		.chained = true,
7906 		.chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7907 	},
7908 	[ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7909 		.type = HDA_FIXUP_FUNC,
7910 		.v.func = alc_fixup_disable_aamix,
7911 		.chained = true,
7912 		.chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7913 	},
7914 	[ALC292_FIXUP_DELL_E7X_AAMIX] = {
7915 		.type = HDA_FIXUP_FUNC,
7916 		.v.func = alc_fixup_dell_xps13,
7917 		.chained = true,
7918 		.chain_id = ALC292_FIXUP_DISABLE_AAMIX
7919 	},
7920 	[ALC292_FIXUP_DELL_E7X] = {
7921 		.type = HDA_FIXUP_FUNC,
7922 		.v.func = alc_fixup_micmute_led,
7923 		/* micmute fixup must be applied at last */
7924 		.chained_before = true,
7925 		.chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7926 	},
7927 	[ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7928 		.type = HDA_FIXUP_PINS,
7929 		.v.pins = (const struct hda_pintbl[]) {
7930 			{ 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7931 			{ }
7932 		},
7933 		.chained_before = true,
7934 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
7935 	},
7936 	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7937 		.type = HDA_FIXUP_PINS,
7938 		.v.pins = (const struct hda_pintbl[]) {
7939 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7940 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7941 			{ }
7942 		},
7943 		.chained = true,
7944 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7945 	},
7946 	[ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7947 		.type = HDA_FIXUP_PINS,
7948 		.v.pins = (const struct hda_pintbl[]) {
7949 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7950 			{ }
7951 		},
7952 		.chained = true,
7953 		.chain_id = ALC269_FIXUP_HEADSET_MODE
7954 	},
7955 	[ALC275_FIXUP_DELL_XPS] = {
7956 		.type = HDA_FIXUP_VERBS,
7957 		.v.verbs = (const struct hda_verb[]) {
7958 			/* Enables internal speaker */
7959 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7960 			{0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7961 			{0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7962 			{0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7963 			{}
7964 		}
7965 	},
7966 	[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7967 		.type = HDA_FIXUP_FUNC,
7968 		.v.func = alc_fixup_disable_aamix,
7969 		.chained = true,
7970 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
7971 	},
7972 	[ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7973 		.type = HDA_FIXUP_FUNC,
7974 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7975 	},
7976 	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7977 		.type = HDA_FIXUP_FUNC,
7978 		.v.func = alc_fixup_inv_dmic,
7979 		.chained = true,
7980 		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7981 	},
7982 	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7983 		.type = HDA_FIXUP_FUNC,
7984 		.v.func = alc269_fixup_limit_int_mic_boost
7985 	},
7986 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
7987 		.type = HDA_FIXUP_FUNC,
7988 		.v.func = alc_fixup_disable_aamix,
7989 		.chained = true,
7990 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7991 	},
7992 	[ALC225_FIXUP_DISABLE_MIC_VREF] = {
7993 		.type = HDA_FIXUP_FUNC,
7994 		.v.func = alc_fixup_disable_mic_vref,
7995 		.chained = true,
7996 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7997 	},
7998 	[ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7999 		.type = HDA_FIXUP_VERBS,
8000 		.v.verbs = (const struct hda_verb[]) {
8001 			/* Disable pass-through path for FRONT 14h */
8002 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8003 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8004 			{}
8005 		},
8006 		.chained = true,
8007 		.chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8008 	},
8009 	[ALC280_FIXUP_HP_HEADSET_MIC] = {
8010 		.type = HDA_FIXUP_FUNC,
8011 		.v.func = alc_fixup_disable_aamix,
8012 		.chained = true,
8013 		.chain_id = ALC269_FIXUP_HEADSET_MIC,
8014 	},
8015 	[ALC221_FIXUP_HP_FRONT_MIC] = {
8016 		.type = HDA_FIXUP_PINS,
8017 		.v.pins = (const struct hda_pintbl[]) {
8018 			{ 0x19, 0x02a19020 }, /* Front Mic */
8019 			{ }
8020 		},
8021 	},
8022 	[ALC292_FIXUP_TPT460] = {
8023 		.type = HDA_FIXUP_FUNC,
8024 		.v.func = alc_fixup_tpt440_dock,
8025 		.chained = true,
8026 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8027 	},
8028 	[ALC298_FIXUP_SPK_VOLUME] = {
8029 		.type = HDA_FIXUP_FUNC,
8030 		.v.func = alc298_fixup_speaker_volume,
8031 		.chained = true,
8032 		.chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8033 	},
8034 	[ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8035 		.type = HDA_FIXUP_FUNC,
8036 		.v.func = alc298_fixup_speaker_volume,
8037 	},
8038 	[ALC295_FIXUP_DISABLE_DAC3] = {
8039 		.type = HDA_FIXUP_FUNC,
8040 		.v.func = alc295_fixup_disable_dac3,
8041 	},
8042 	[ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8043 		.type = HDA_FIXUP_FUNC,
8044 		.v.func = alc285_fixup_speaker2_to_dac1,
8045 		.chained = true,
8046 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8047 	},
8048 	[ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8049 		.type = HDA_FIXUP_FUNC,
8050 		.v.func = alc285_fixup_speaker2_to_dac1,
8051 		.chained = true,
8052 		.chain_id = ALC245_FIXUP_CS35L41_SPI_2
8053 	},
8054 	[ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8055 		.type = HDA_FIXUP_PINS,
8056 		.v.pins = (const struct hda_pintbl[]) {
8057 			{ 0x19, 0x03a11050 },
8058 			{ 0x1b, 0x03a11c30 },
8059 			{ }
8060 		},
8061 		.chained = true,
8062 		.chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8063 	},
8064 	[ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8065 		.type = HDA_FIXUP_PINS,
8066 		.v.pins = (const struct hda_pintbl[]) {
8067 			{ 0x14, 0x90170120 },
8068 			{ }
8069 		},
8070 		.chained = true,
8071 		.chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8072 	},
8073 	[ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8074 		.type = HDA_FIXUP_FUNC,
8075 		.v.func = alc285_fixup_speaker2_to_dac1,
8076 		.chained = true,
8077 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2
8078 	},
8079 	[ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8080 		.type = HDA_FIXUP_PINS,
8081 		.v.pins = (const struct hda_pintbl[]) {
8082 			{ 0x19, 0x03a11050 },
8083 			{ 0x1b, 0x03a11c30 },
8084 			{ }
8085 		},
8086 		.chained = true,
8087 		.chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8088 	},
8089 	[ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8090 		.type = HDA_FIXUP_PINS,
8091 		.v.pins = (const struct hda_pintbl[]) {
8092 			{ 0x1b, 0x90170151 },
8093 			{ }
8094 		},
8095 		.chained = true,
8096 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8097 	},
8098 	[ALC269_FIXUP_ATIV_BOOK_8] = {
8099 		.type = HDA_FIXUP_FUNC,
8100 		.v.func = alc_fixup_auto_mute_via_amp,
8101 		.chained = true,
8102 		.chain_id = ALC269_FIXUP_NO_SHUTUP
8103 	},
8104 	[ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8105 		.type = HDA_FIXUP_PINS,
8106 		.v.pins = (const struct hda_pintbl[]) {
8107 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8108 			{ 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8109 			{ }
8110 		},
8111 		.chained = true,
8112 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8113 	},
8114 	[ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8115 		.type = HDA_FIXUP_PINS,
8116 		.v.pins = (const struct hda_pintbl[]) {
8117 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8118 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8119 			{ }
8120 		},
8121 		.chained = true,
8122 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8123 	},
8124 	[ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8125 		.type = HDA_FIXUP_FUNC,
8126 		.v.func = alc_fixup_headset_mode,
8127 	},
8128 	[ALC256_FIXUP_ASUS_MIC] = {
8129 		.type = HDA_FIXUP_PINS,
8130 		.v.pins = (const struct hda_pintbl[]) {
8131 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8132 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8133 			{ }
8134 		},
8135 		.chained = true,
8136 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8137 	},
8138 	[ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8139 		.type = HDA_FIXUP_FUNC,
8140 		/* Set up GPIO2 for the speaker amp */
8141 		.v.func = alc_fixup_gpio4,
8142 	},
8143 	[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8144 		.type = HDA_FIXUP_PINS,
8145 		.v.pins = (const struct hda_pintbl[]) {
8146 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8147 			{ }
8148 		},
8149 		.chained = true,
8150 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8151 	},
8152 	[ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8153 		.type = HDA_FIXUP_VERBS,
8154 		.v.verbs = (const struct hda_verb[]) {
8155 			/* Enables internal speaker */
8156 			{0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8157 			{0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8158 			{}
8159 		},
8160 		.chained = true,
8161 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8162 	},
8163 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8164 		.type = HDA_FIXUP_FUNC,
8165 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8166 		.chained = true,
8167 		.chain_id = ALC269_FIXUP_GPIO2
8168 	},
8169 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
8170 		.type = HDA_FIXUP_VERBS,
8171 		.v.verbs = (const struct hda_verb[]) {
8172 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8173 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8174 			{ }
8175 		},
8176 		.chained = true,
8177 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8178 	},
8179 	[ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8180 		.type = HDA_FIXUP_PINS,
8181 		.v.pins = (const struct hda_pintbl[]) {
8182 			/* Change the mic location from front to right, otherwise there are
8183 			   two front mics with the same name, pulseaudio can't handle them.
8184 			   This is just a temporary workaround, after applying this fixup,
8185 			   there will be one "Front Mic" and one "Mic" in this machine.
8186 			 */
8187 			{ 0x1a, 0x04a19040 },
8188 			{ }
8189 		},
8190 	},
8191 	[ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8192 		.type = HDA_FIXUP_PINS,
8193 		.v.pins = (const struct hda_pintbl[]) {
8194 			{ 0x16, 0x0101102f }, /* Rear Headset HP */
8195 			{ 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8196 			{ 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8197 			{ 0x1b, 0x02011020 },
8198 			{ }
8199 		},
8200 		.chained = true,
8201 		.chain_id = ALC225_FIXUP_S3_POP_NOISE
8202 	},
8203 	[ALC225_FIXUP_S3_POP_NOISE] = {
8204 		.type = HDA_FIXUP_FUNC,
8205 		.v.func = alc225_fixup_s3_pop_noise,
8206 		.chained = true,
8207 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8208 	},
8209 	[ALC700_FIXUP_INTEL_REFERENCE] = {
8210 		.type = HDA_FIXUP_VERBS,
8211 		.v.verbs = (const struct hda_verb[]) {
8212 			/* Enables internal speaker */
8213 			{0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8214 			{0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8215 			{0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8216 			{0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8217 			{0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8218 			{0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8219 			{0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8220 			{0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8221 			{}
8222 		}
8223 	},
8224 	[ALC274_FIXUP_DELL_BIND_DACS] = {
8225 		.type = HDA_FIXUP_FUNC,
8226 		.v.func = alc274_fixup_bind_dacs,
8227 		.chained = true,
8228 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8229 	},
8230 	[ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8231 		.type = HDA_FIXUP_PINS,
8232 		.v.pins = (const struct hda_pintbl[]) {
8233 			{ 0x1b, 0x0401102f },
8234 			{ }
8235 		},
8236 		.chained = true,
8237 		.chain_id = ALC274_FIXUP_DELL_BIND_DACS
8238 	},
8239 	[ALC298_FIXUP_TPT470_DOCK_FIX] = {
8240 		.type = HDA_FIXUP_FUNC,
8241 		.v.func = alc_fixup_tpt470_dock,
8242 		.chained = true,
8243 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8244 	},
8245 	[ALC298_FIXUP_TPT470_DOCK] = {
8246 		.type = HDA_FIXUP_FUNC,
8247 		.v.func = alc_fixup_tpt470_dacs,
8248 		.chained = true,
8249 		.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8250 	},
8251 	[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8252 		.type = HDA_FIXUP_PINS,
8253 		.v.pins = (const struct hda_pintbl[]) {
8254 			{ 0x14, 0x0201101f },
8255 			{ }
8256 		},
8257 		.chained = true,
8258 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8259 	},
8260 	[ALC255_FIXUP_DELL_HEADSET_MIC] = {
8261 		.type = HDA_FIXUP_PINS,
8262 		.v.pins = (const struct hda_pintbl[]) {
8263 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8264 			{ }
8265 		},
8266 		.chained = true,
8267 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8268 	},
8269 	[ALC295_FIXUP_HP_X360] = {
8270 		.type = HDA_FIXUP_FUNC,
8271 		.v.func = alc295_fixup_hp_top_speakers,
8272 		.chained = true,
8273 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8274 	},
8275 	[ALC221_FIXUP_HP_HEADSET_MIC] = {
8276 		.type = HDA_FIXUP_PINS,
8277 		.v.pins = (const struct hda_pintbl[]) {
8278 			{ 0x19, 0x0181313f},
8279 			{ }
8280 		},
8281 		.chained = true,
8282 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8283 	},
8284 	[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8285 		.type = HDA_FIXUP_FUNC,
8286 		.v.func = alc285_fixup_invalidate_dacs,
8287 		.chained = true,
8288 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8289 	},
8290 	[ALC295_FIXUP_HP_AUTO_MUTE] = {
8291 		.type = HDA_FIXUP_FUNC,
8292 		.v.func = alc_fixup_auto_mute_via_amp,
8293 	},
8294 	[ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8295 		.type = HDA_FIXUP_PINS,
8296 		.v.pins = (const struct hda_pintbl[]) {
8297 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8298 			{ }
8299 		},
8300 		.chained = true,
8301 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8302 	},
8303 	[ALC294_FIXUP_ASUS_MIC] = {
8304 		.type = HDA_FIXUP_PINS,
8305 		.v.pins = (const struct hda_pintbl[]) {
8306 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8307 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8308 			{ }
8309 		},
8310 		.chained = true,
8311 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8312 	},
8313 	[ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8314 		.type = HDA_FIXUP_PINS,
8315 		.v.pins = (const struct hda_pintbl[]) {
8316 			{ 0x19, 0x01a1103c }, /* use as headset mic */
8317 			{ }
8318 		},
8319 		.chained = true,
8320 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8321 	},
8322 	[ALC294_FIXUP_ASUS_SPK] = {
8323 		.type = HDA_FIXUP_VERBS,
8324 		.v.verbs = (const struct hda_verb[]) {
8325 			/* Set EAPD high */
8326 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8327 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8328 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8329 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8330 			{ }
8331 		},
8332 		.chained = true,
8333 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8334 	},
8335 	[ALC295_FIXUP_CHROME_BOOK] = {
8336 		.type = HDA_FIXUP_FUNC,
8337 		.v.func = alc295_fixup_chromebook,
8338 		.chained = true,
8339 		.chain_id = ALC225_FIXUP_HEADSET_JACK
8340 	},
8341 	[ALC225_FIXUP_HEADSET_JACK] = {
8342 		.type = HDA_FIXUP_FUNC,
8343 		.v.func = alc_fixup_headset_jack,
8344 	},
8345 	[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8346 		.type = HDA_FIXUP_PINS,
8347 		.v.pins = (const struct hda_pintbl[]) {
8348 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8349 			{ }
8350 		},
8351 		.chained = true,
8352 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8353 	},
8354 	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8355 		.type = HDA_FIXUP_VERBS,
8356 		.v.verbs = (const struct hda_verb[]) {
8357 			/* Disable PCBEEP-IN passthrough */
8358 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8359 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8360 			{ }
8361 		},
8362 		.chained = true,
8363 		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8364 	},
8365 	[ALC255_FIXUP_ACER_HEADSET_MIC] = {
8366 		.type = HDA_FIXUP_PINS,
8367 		.v.pins = (const struct hda_pintbl[]) {
8368 			{ 0x19, 0x03a11130 },
8369 			{ 0x1a, 0x90a60140 }, /* use as internal mic */
8370 			{ }
8371 		},
8372 		.chained = true,
8373 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8374 	},
8375 	[ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8376 		.type = HDA_FIXUP_PINS,
8377 		.v.pins = (const struct hda_pintbl[]) {
8378 			{ 0x16, 0x01011020 }, /* Rear Line out */
8379 			{ 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8380 			{ }
8381 		},
8382 		.chained = true,
8383 		.chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8384 	},
8385 	[ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8386 		.type = HDA_FIXUP_FUNC,
8387 		.v.func = alc_fixup_auto_mute_via_amp,
8388 		.chained = true,
8389 		.chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8390 	},
8391 	[ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8392 		.type = HDA_FIXUP_FUNC,
8393 		.v.func = alc_fixup_disable_mic_vref,
8394 		.chained = true,
8395 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8396 	},
8397 	[ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8398 		.type = HDA_FIXUP_VERBS,
8399 		.v.verbs = (const struct hda_verb[]) {
8400 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8401 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8402 			{ }
8403 		},
8404 		.chained = true,
8405 		.chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8406 	},
8407 	[ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8408 		.type = HDA_FIXUP_PINS,
8409 		.v.pins = (const struct hda_pintbl[]) {
8410 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8411 			{ }
8412 		},
8413 		.chained = true,
8414 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8415 	},
8416 	[ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8417 		.type = HDA_FIXUP_PINS,
8418 		.v.pins = (const struct hda_pintbl[]) {
8419 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8420 			{ }
8421 		},
8422 		.chained = true,
8423 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8424 	},
8425 	[ALC299_FIXUP_PREDATOR_SPK] = {
8426 		.type = HDA_FIXUP_PINS,
8427 		.v.pins = (const struct hda_pintbl[]) {
8428 			{ 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8429 			{ }
8430 		}
8431 	},
8432 	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8433 		.type = HDA_FIXUP_PINS,
8434 		.v.pins = (const struct hda_pintbl[]) {
8435 			{ 0x19, 0x04a11040 },
8436 			{ 0x21, 0x04211020 },
8437 			{ }
8438 		},
8439 		.chained = true,
8440 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8441 	},
8442 	[ALC289_FIXUP_DELL_SPK2] = {
8443 		.type = HDA_FIXUP_PINS,
8444 		.v.pins = (const struct hda_pintbl[]) {
8445 			{ 0x17, 0x90170130 }, /* bass spk */
8446 			{ }
8447 		},
8448 		.chained = true,
8449 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8450 	},
8451 	[ALC289_FIXUP_DUAL_SPK] = {
8452 		.type = HDA_FIXUP_FUNC,
8453 		.v.func = alc285_fixup_speaker2_to_dac1,
8454 		.chained = true,
8455 		.chain_id = ALC289_FIXUP_DELL_SPK2
8456 	},
8457 	[ALC294_FIXUP_SPK2_TO_DAC1] = {
8458 		.type = HDA_FIXUP_FUNC,
8459 		.v.func = alc285_fixup_speaker2_to_dac1,
8460 		.chained = true,
8461 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8462 	},
8463 	[ALC294_FIXUP_ASUS_DUAL_SPK] = {
8464 		.type = HDA_FIXUP_FUNC,
8465 		/* The GPIO must be pulled to initialize the AMP */
8466 		.v.func = alc_fixup_gpio4,
8467 		.chained = true,
8468 		.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8469 	},
8470 	[ALC294_FIXUP_ASUS_ALLY] = {
8471 		.type = HDA_FIXUP_FUNC,
8472 		.v.func = cs35l41_fixup_i2c_two,
8473 		.chained = true,
8474 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8475 	},
8476 	[ALC294_FIXUP_ASUS_ALLY_PINS] = {
8477 		.type = HDA_FIXUP_PINS,
8478 		.v.pins = (const struct hda_pintbl[]) {
8479 			{ 0x19, 0x03a11050 },
8480 			{ 0x1a, 0x03a11c30 },
8481 			{ 0x21, 0x03211420 },
8482 			{ }
8483 		},
8484 		.chained = true,
8485 		.chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8486 	},
8487 	[ALC294_FIXUP_ASUS_ALLY_VERBS] = {
8488 		.type = HDA_FIXUP_VERBS,
8489 		.v.verbs = (const struct hda_verb[]) {
8490 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8491 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8492 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
8493 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
8494 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
8495 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
8496 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
8497 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
8498 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
8499 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
8500 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
8501 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
8502 			{ }
8503 		},
8504 		.chained = true,
8505 		.chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
8506 	},
8507 	[ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
8508 		.type = HDA_FIXUP_FUNC,
8509 		.v.func = alc285_fixup_speaker2_to_dac1,
8510 	},
8511 	[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8512 		.type = HDA_FIXUP_FUNC,
8513 		.v.func = alc285_fixup_thinkpad_x1_gen7,
8514 		.chained = true,
8515 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8516 	},
8517 	[ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8518 		.type = HDA_FIXUP_FUNC,
8519 		.v.func = alc_fixup_headset_jack,
8520 		.chained = true,
8521 		.chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8522 	},
8523 	[ALC294_FIXUP_ASUS_HPE] = {
8524 		.type = HDA_FIXUP_VERBS,
8525 		.v.verbs = (const struct hda_verb[]) {
8526 			/* Set EAPD high */
8527 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8528 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8529 			{ }
8530 		},
8531 		.chained = true,
8532 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8533 	},
8534 	[ALC294_FIXUP_ASUS_GX502_PINS] = {
8535 		.type = HDA_FIXUP_PINS,
8536 		.v.pins = (const struct hda_pintbl[]) {
8537 			{ 0x19, 0x03a11050 }, /* front HP mic */
8538 			{ 0x1a, 0x01a11830 }, /* rear external mic */
8539 			{ 0x21, 0x03211020 }, /* front HP out */
8540 			{ }
8541 		},
8542 		.chained = true,
8543 		.chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8544 	},
8545 	[ALC294_FIXUP_ASUS_GX502_VERBS] = {
8546 		.type = HDA_FIXUP_VERBS,
8547 		.v.verbs = (const struct hda_verb[]) {
8548 			/* set 0x15 to HP-OUT ctrl */
8549 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8550 			/* unmute the 0x15 amp */
8551 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8552 			{ }
8553 		},
8554 		.chained = true,
8555 		.chain_id = ALC294_FIXUP_ASUS_GX502_HP
8556 	},
8557 	[ALC294_FIXUP_ASUS_GX502_HP] = {
8558 		.type = HDA_FIXUP_FUNC,
8559 		.v.func = alc294_fixup_gx502_hp,
8560 	},
8561 	[ALC294_FIXUP_ASUS_GU502_PINS] = {
8562 		.type = HDA_FIXUP_PINS,
8563 		.v.pins = (const struct hda_pintbl[]) {
8564 			{ 0x19, 0x01a11050 }, /* rear HP mic */
8565 			{ 0x1a, 0x01a11830 }, /* rear external mic */
8566 			{ 0x21, 0x012110f0 }, /* rear HP out */
8567 			{ }
8568 		},
8569 		.chained = true,
8570 		.chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8571 	},
8572 	[ALC294_FIXUP_ASUS_GU502_VERBS] = {
8573 		.type = HDA_FIXUP_VERBS,
8574 		.v.verbs = (const struct hda_verb[]) {
8575 			/* set 0x15 to HP-OUT ctrl */
8576 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8577 			/* unmute the 0x15 amp */
8578 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8579 			/* set 0x1b to HP-OUT */
8580 			{ 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8581 			{ }
8582 		},
8583 		.chained = true,
8584 		.chain_id = ALC294_FIXUP_ASUS_GU502_HP
8585 	},
8586 	[ALC294_FIXUP_ASUS_GU502_HP] = {
8587 		.type = HDA_FIXUP_FUNC,
8588 		.v.func = alc294_fixup_gu502_hp,
8589 	},
8590 	 [ALC294_FIXUP_ASUS_G513_PINS] = {
8591 		.type = HDA_FIXUP_PINS,
8592 		.v.pins = (const struct hda_pintbl[]) {
8593 				{ 0x19, 0x03a11050 }, /* front HP mic */
8594 				{ 0x1a, 0x03a11c30 }, /* rear external mic */
8595 				{ 0x21, 0x03211420 }, /* front HP out */
8596 				{ }
8597 		},
8598 	},
8599 	[ALC285_FIXUP_ASUS_G533Z_PINS] = {
8600 		.type = HDA_FIXUP_PINS,
8601 		.v.pins = (const struct hda_pintbl[]) {
8602 			{ 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8603 			{ 0x19, 0x03a19020 }, /* Mic Boost Volume */
8604 			{ 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8605 			{ 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8606 			{ 0x21, 0x03211420 },
8607 			{ }
8608 		},
8609 	},
8610 	[ALC294_FIXUP_ASUS_COEF_1B] = {
8611 		.type = HDA_FIXUP_VERBS,
8612 		.v.verbs = (const struct hda_verb[]) {
8613 			/* Set bit 10 to correct noisy output after reboot from
8614 			 * Windows 10 (due to pop noise reduction?)
8615 			 */
8616 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8617 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8618 			{ }
8619 		},
8620 		.chained = true,
8621 		.chain_id = ALC289_FIXUP_ASUS_GA401,
8622 	},
8623 	[ALC285_FIXUP_HP_GPIO_LED] = {
8624 		.type = HDA_FIXUP_FUNC,
8625 		.v.func = alc285_fixup_hp_gpio_led,
8626 	},
8627 	[ALC285_FIXUP_HP_MUTE_LED] = {
8628 		.type = HDA_FIXUP_FUNC,
8629 		.v.func = alc285_fixup_hp_mute_led,
8630 	},
8631 	[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8632 		.type = HDA_FIXUP_FUNC,
8633 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
8634 	},
8635 	[ALC236_FIXUP_HP_GPIO_LED] = {
8636 		.type = HDA_FIXUP_FUNC,
8637 		.v.func = alc236_fixup_hp_gpio_led,
8638 	},
8639 	[ALC236_FIXUP_HP_MUTE_LED] = {
8640 		.type = HDA_FIXUP_FUNC,
8641 		.v.func = alc236_fixup_hp_mute_led,
8642 	},
8643 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8644 		.type = HDA_FIXUP_FUNC,
8645 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
8646 	},
8647 	[ALC298_FIXUP_SAMSUNG_AMP] = {
8648 		.type = HDA_FIXUP_FUNC,
8649 		.v.func = alc298_fixup_samsung_amp,
8650 		.chained = true,
8651 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8652 	},
8653 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8654 		.type = HDA_FIXUP_VERBS,
8655 		.v.verbs = (const struct hda_verb[]) {
8656 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8657 			{ }
8658 		},
8659 	},
8660 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8661 		.type = HDA_FIXUP_VERBS,
8662 		.v.verbs = (const struct hda_verb[]) {
8663 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8664 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8665 			{ }
8666 		},
8667 	},
8668 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8669 		.type = HDA_FIXUP_PINS,
8670 		.v.pins = (const struct hda_pintbl[]) {
8671 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8672 			{ }
8673 		},
8674 		.chained = true,
8675 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8676 	},
8677 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8678 		.type = HDA_FIXUP_PINS,
8679 		.v.pins = (const struct hda_pintbl[]) {
8680 			{ 0x14, 0x90100120 }, /* use as internal speaker */
8681 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8682 			{ 0x1a, 0x01011020 }, /* use as line out */
8683 			{ },
8684 		},
8685 		.chained = true,
8686 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8687 	},
8688 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8689 		.type = HDA_FIXUP_PINS,
8690 		.v.pins = (const struct hda_pintbl[]) {
8691 			{ 0x18, 0x02a11030 }, /* use as headset mic */
8692 			{ }
8693 		},
8694 		.chained = true,
8695 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8696 	},
8697 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8698 		.type = HDA_FIXUP_PINS,
8699 		.v.pins = (const struct hda_pintbl[]) {
8700 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8701 			{ }
8702 		},
8703 		.chained = true,
8704 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8705 	},
8706 	[ALC289_FIXUP_ASUS_GA401] = {
8707 		.type = HDA_FIXUP_FUNC,
8708 		.v.func = alc289_fixup_asus_ga401,
8709 		.chained = true,
8710 		.chain_id = ALC289_FIXUP_ASUS_GA502,
8711 	},
8712 	[ALC289_FIXUP_ASUS_GA502] = {
8713 		.type = HDA_FIXUP_PINS,
8714 		.v.pins = (const struct hda_pintbl[]) {
8715 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8716 			{ }
8717 		},
8718 	},
8719 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8720 		.type = HDA_FIXUP_PINS,
8721 		.v.pins = (const struct hda_pintbl[]) {
8722 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8723 			{ }
8724 		},
8725 		.chained = true,
8726 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8727 	},
8728 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8729 		.type = HDA_FIXUP_FUNC,
8730 		.v.func = alc285_fixup_hp_gpio_amp_init,
8731 		.chained = true,
8732 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
8733 	},
8734 	[ALC269_FIXUP_CZC_B20] = {
8735 		.type = HDA_FIXUP_PINS,
8736 		.v.pins = (const struct hda_pintbl[]) {
8737 			{ 0x12, 0x411111f0 },
8738 			{ 0x14, 0x90170110 }, /* speaker */
8739 			{ 0x15, 0x032f1020 }, /* HP out */
8740 			{ 0x17, 0x411111f0 },
8741 			{ 0x18, 0x03ab1040 }, /* mic */
8742 			{ 0x19, 0xb7a7013f },
8743 			{ 0x1a, 0x0181305f },
8744 			{ 0x1b, 0x411111f0 },
8745 			{ 0x1d, 0x411111f0 },
8746 			{ 0x1e, 0x411111f0 },
8747 			{ }
8748 		},
8749 		.chain_id = ALC269_FIXUP_DMIC,
8750 	},
8751 	[ALC269_FIXUP_CZC_TMI] = {
8752 		.type = HDA_FIXUP_PINS,
8753 		.v.pins = (const struct hda_pintbl[]) {
8754 			{ 0x12, 0x4000c000 },
8755 			{ 0x14, 0x90170110 }, /* speaker */
8756 			{ 0x15, 0x0421401f }, /* HP out */
8757 			{ 0x17, 0x411111f0 },
8758 			{ 0x18, 0x04a19020 }, /* mic */
8759 			{ 0x19, 0x411111f0 },
8760 			{ 0x1a, 0x411111f0 },
8761 			{ 0x1b, 0x411111f0 },
8762 			{ 0x1d, 0x40448505 },
8763 			{ 0x1e, 0x411111f0 },
8764 			{ 0x20, 0x8000ffff },
8765 			{ }
8766 		},
8767 		.chain_id = ALC269_FIXUP_DMIC,
8768 	},
8769 	[ALC269_FIXUP_CZC_L101] = {
8770 		.type = HDA_FIXUP_PINS,
8771 		.v.pins = (const struct hda_pintbl[]) {
8772 			{ 0x12, 0x40000000 },
8773 			{ 0x14, 0x01014010 }, /* speaker */
8774 			{ 0x15, 0x411111f0 }, /* HP out */
8775 			{ 0x16, 0x411111f0 },
8776 			{ 0x18, 0x01a19020 }, /* mic */
8777 			{ 0x19, 0x02a19021 },
8778 			{ 0x1a, 0x0181302f },
8779 			{ 0x1b, 0x0221401f },
8780 			{ 0x1c, 0x411111f0 },
8781 			{ 0x1d, 0x4044c601 },
8782 			{ 0x1e, 0x411111f0 },
8783 			{ }
8784 		},
8785 		.chain_id = ALC269_FIXUP_DMIC,
8786 	},
8787 	[ALC269_FIXUP_LEMOTE_A1802] = {
8788 		.type = HDA_FIXUP_PINS,
8789 		.v.pins = (const struct hda_pintbl[]) {
8790 			{ 0x12, 0x40000000 },
8791 			{ 0x14, 0x90170110 }, /* speaker */
8792 			{ 0x17, 0x411111f0 },
8793 			{ 0x18, 0x03a19040 }, /* mic1 */
8794 			{ 0x19, 0x90a70130 }, /* mic2 */
8795 			{ 0x1a, 0x411111f0 },
8796 			{ 0x1b, 0x411111f0 },
8797 			{ 0x1d, 0x40489d2d },
8798 			{ 0x1e, 0x411111f0 },
8799 			{ 0x20, 0x0003ffff },
8800 			{ 0x21, 0x03214020 },
8801 			{ }
8802 		},
8803 		.chain_id = ALC269_FIXUP_DMIC,
8804 	},
8805 	[ALC269_FIXUP_LEMOTE_A190X] = {
8806 		.type = HDA_FIXUP_PINS,
8807 		.v.pins = (const struct hda_pintbl[]) {
8808 			{ 0x14, 0x99130110 }, /* speaker */
8809 			{ 0x15, 0x0121401f }, /* HP out */
8810 			{ 0x18, 0x01a19c20 }, /* rear  mic */
8811 			{ 0x19, 0x99a3092f }, /* front mic */
8812 			{ 0x1b, 0x0201401f }, /* front lineout */
8813 			{ }
8814 		},
8815 		.chain_id = ALC269_FIXUP_DMIC,
8816 	},
8817 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8818 		.type = HDA_FIXUP_PINS,
8819 		.v.pins = (const struct hda_pintbl[]) {
8820 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8821 			{ }
8822 		},
8823 		.chained = true,
8824 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8825 	},
8826 	[ALC256_FIXUP_INTEL_NUC10] = {
8827 		.type = HDA_FIXUP_PINS,
8828 		.v.pins = (const struct hda_pintbl[]) {
8829 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8830 			{ }
8831 		},
8832 		.chained = true,
8833 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8834 	},
8835 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8836 		.type = HDA_FIXUP_VERBS,
8837 		.v.verbs = (const struct hda_verb[]) {
8838 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8839 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8840 			{ }
8841 		},
8842 		.chained = true,
8843 		.chain_id = ALC289_FIXUP_ASUS_GA502
8844 	},
8845 	[ALC274_FIXUP_HP_MIC] = {
8846 		.type = HDA_FIXUP_VERBS,
8847 		.v.verbs = (const struct hda_verb[]) {
8848 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8849 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8850 			{ }
8851 		},
8852 	},
8853 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
8854 		.type = HDA_FIXUP_FUNC,
8855 		.v.func = alc274_fixup_hp_headset_mic,
8856 		.chained = true,
8857 		.chain_id = ALC274_FIXUP_HP_MIC
8858 	},
8859 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
8860 		.type = HDA_FIXUP_FUNC,
8861 		.v.func = alc274_fixup_hp_envy_gpio,
8862 	},
8863 	[ALC256_FIXUP_ASUS_HPE] = {
8864 		.type = HDA_FIXUP_VERBS,
8865 		.v.verbs = (const struct hda_verb[]) {
8866 			/* Set EAPD high */
8867 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8868 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8869 			{ }
8870 		},
8871 		.chained = true,
8872 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8873 	},
8874 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8875 		.type = HDA_FIXUP_FUNC,
8876 		.v.func = alc_fixup_headset_jack,
8877 		.chained = true,
8878 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8879 	},
8880 	[ALC287_FIXUP_HP_GPIO_LED] = {
8881 		.type = HDA_FIXUP_FUNC,
8882 		.v.func = alc287_fixup_hp_gpio_led,
8883 	},
8884 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
8885 		.type = HDA_FIXUP_FUNC,
8886 		.v.func = alc274_fixup_hp_headset_mic,
8887 	},
8888 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8889 		.type = HDA_FIXUP_FUNC,
8890 		.v.func = alc_fixup_no_int_mic,
8891 		.chained = true,
8892 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8893 	},
8894 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8895 		.type = HDA_FIXUP_PINS,
8896 		.v.pins = (const struct hda_pintbl[]) {
8897 			{ 0x1b, 0x411111f0 },
8898 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8899 			{ },
8900 		},
8901 		.chained = true,
8902 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8903 	},
8904 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8905 		.type = HDA_FIXUP_FUNC,
8906 		.v.func = alc269_fixup_limit_int_mic_boost,
8907 		.chained = true,
8908 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8909 	},
8910 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
8911 		.type = HDA_FIXUP_PINS,
8912 		.v.pins = (const struct hda_pintbl[]) {
8913 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8914 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
8915 			{ }
8916 		},
8917 		.chained = true,
8918 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8919 	},
8920 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8921 		.type = HDA_FIXUP_FUNC,
8922 		.v.func = alc285_fixup_ideapad_s740_coef,
8923 		.chained = true,
8924 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8925 	},
8926 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8927 		.type = HDA_FIXUP_FUNC,
8928 		.v.func = alc269_fixup_limit_int_mic_boost,
8929 		.chained = true,
8930 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
8931 	},
8932 	[ALC295_FIXUP_ASUS_DACS] = {
8933 		.type = HDA_FIXUP_FUNC,
8934 		.v.func = alc295_fixup_asus_dacs,
8935 	},
8936 	[ALC295_FIXUP_HP_OMEN] = {
8937 		.type = HDA_FIXUP_PINS,
8938 		.v.pins = (const struct hda_pintbl[]) {
8939 			{ 0x12, 0xb7a60130 },
8940 			{ 0x13, 0x40000000 },
8941 			{ 0x14, 0x411111f0 },
8942 			{ 0x16, 0x411111f0 },
8943 			{ 0x17, 0x90170110 },
8944 			{ 0x18, 0x411111f0 },
8945 			{ 0x19, 0x02a11030 },
8946 			{ 0x1a, 0x411111f0 },
8947 			{ 0x1b, 0x04a19030 },
8948 			{ 0x1d, 0x40600001 },
8949 			{ 0x1e, 0x411111f0 },
8950 			{ 0x21, 0x03211020 },
8951 			{}
8952 		},
8953 		.chained = true,
8954 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8955 	},
8956 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
8957 		.type = HDA_FIXUP_FUNC,
8958 		.v.func = alc285_fixup_hp_spectre_x360,
8959 	},
8960 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8961 		.type = HDA_FIXUP_FUNC,
8962 		.v.func = alc285_fixup_hp_spectre_x360_eb1
8963 	},
8964 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8965 		.type = HDA_FIXUP_FUNC,
8966 		.v.func = alc285_fixup_ideapad_s740_coef,
8967 		.chained = true,
8968 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8969 	},
8970 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8971 		.type = HDA_FIXUP_FUNC,
8972 		.v.func = alc_fixup_no_shutup,
8973 		.chained = true,
8974 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
8975 	},
8976 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8977 		.type = HDA_FIXUP_PINS,
8978 		.v.pins = (const struct hda_pintbl[]) {
8979 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8980 			{ }
8981 		},
8982 		.chained = true,
8983 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8984 	},
8985 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8986 		.type = HDA_FIXUP_FUNC,
8987 		.v.func = alc269_fixup_limit_int_mic_boost,
8988 		.chained = true,
8989 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8990 	},
8991 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8992 		.type = HDA_FIXUP_FUNC,
8993 		.v.func = alc285_fixup_ideapad_s740_coef,
8994 		.chained = true,
8995 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8996 	},
8997 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8998 		.type = HDA_FIXUP_FUNC,
8999 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9000 		.chained = true,
9001 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9002 	},
9003 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9004 		.type = HDA_FIXUP_VERBS,
9005 		//.v.verbs = legion_15imhg05_coefs,
9006 		.v.verbs = (const struct hda_verb[]) {
9007 			 // set left speaker Legion 7i.
9008 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9009 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9010 
9011 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9012 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9013 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9014 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9015 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9016 
9017 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9018 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9019 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9020 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9021 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9022 
9023 			 // set right speaker Legion 7i.
9024 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9025 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9026 
9027 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9028 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9029 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9030 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9031 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9032 
9033 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9034 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9035 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9036 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9037 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9038 			 {}
9039 		},
9040 		.chained = true,
9041 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9042 	},
9043 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9044 		.type = HDA_FIXUP_FUNC,
9045 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9046 		.chained = true,
9047 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9048 	},
9049 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9050 		.type = HDA_FIXUP_VERBS,
9051 		.v.verbs = (const struct hda_verb[]) {
9052 			 // set left speaker Yoga 7i.
9053 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9054 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9055 
9056 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9057 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9058 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9059 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9060 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9061 
9062 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9063 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9064 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9065 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9066 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9067 
9068 			 // set right speaker Yoga 7i.
9069 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9070 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9071 
9072 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9073 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9074 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9075 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9076 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9077 
9078 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9079 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9080 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9081 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9082 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9083 			 {}
9084 		},
9085 		.chained = true,
9086 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9087 	},
9088 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9089 		.type = HDA_FIXUP_FUNC,
9090 		.v.func = alc298_fixup_lenovo_c940_duet7,
9091 	},
9092 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9093 		.type = HDA_FIXUP_VERBS,
9094 		.v.verbs = (const struct hda_verb[]) {
9095 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9096 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9097 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9098 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9099 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9100 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9101 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9102 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9103 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9104 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9105 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9106 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9107 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9108 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9109 			{}
9110 		},
9111 		.chained = true,
9112 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9113 	},
9114 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9115 		.type = HDA_FIXUP_FUNC,
9116 		.v.func = alc256_fixup_set_coef_defaults,
9117 	},
9118 	[ALC245_FIXUP_HP_GPIO_LED] = {
9119 		.type = HDA_FIXUP_FUNC,
9120 		.v.func = alc245_fixup_hp_gpio_led,
9121 	},
9122 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9123 		.type = HDA_FIXUP_PINS,
9124 		.v.pins = (const struct hda_pintbl[]) {
9125 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9126 			{ }
9127 		},
9128 		.chained = true,
9129 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9130 	},
9131 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9132 		.type = HDA_FIXUP_FUNC,
9133 		.v.func = alc233_fixup_no_audio_jack,
9134 	},
9135 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9136 		.type = HDA_FIXUP_FUNC,
9137 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9138 		.chained = true,
9139 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9140 	},
9141 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9142 		.type = HDA_FIXUP_FUNC,
9143 		.v.func = alc287_fixup_legion_16achg6_speakers,
9144 	},
9145 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9146 		.type = HDA_FIXUP_FUNC,
9147 		.v.func = cs35l41_fixup_i2c_two,
9148 		.chained = true,
9149 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9150 	},
9151 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9152 		.type = HDA_FIXUP_FUNC,
9153 		.v.func = cs35l41_fixup_i2c_two,
9154 		.chained = true,
9155 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9156 	},
9157 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9158 		.type = HDA_FIXUP_FUNC,
9159 		.v.func = cs35l41_fixup_spi_two,
9160 	},
9161 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9162 		.type = HDA_FIXUP_FUNC,
9163 		.v.func = cs35l41_fixup_spi_two,
9164 		.chained = true,
9165 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9166 	},
9167 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9168 		.type = HDA_FIXUP_FUNC,
9169 		.v.func = cs35l41_fixup_spi_four,
9170 	},
9171 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9172 		.type = HDA_FIXUP_FUNC,
9173 		.v.func = cs35l41_fixup_spi_four,
9174 		.chained = true,
9175 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9176 	},
9177 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9178 		.type = HDA_FIXUP_VERBS,
9179 		.v.verbs = (const struct hda_verb[]) {
9180 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9181 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9182 			 { }
9183 		},
9184 		.chained = true,
9185 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9186 	},
9187 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9188 		.type = HDA_FIXUP_FUNC,
9189 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9190 		.chained = true,
9191 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9192 	},
9193 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9194 		.type = HDA_FIXUP_PINS,
9195 		.v.pins = (const struct hda_pintbl[]) {
9196 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9197 			{ }
9198 		},
9199 		.chained = true,
9200 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9201 	},
9202 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9203 		.type = HDA_FIXUP_FUNC,
9204 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9205 	},
9206 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9207 		.type = HDA_FIXUP_VERBS,
9208 		.v.verbs = (const struct hda_verb[]) {
9209 			// enable left speaker
9210 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9211 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9212 
9213 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9214 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9215 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9216 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9217 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9218 
9219 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9220 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9221 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9222 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9223 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9224 
9225 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9226 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9227 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9228 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9229 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9230 
9231 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9232 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9233 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9234 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9235 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9236 
9237 			// enable right speaker
9238 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9239 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9240 
9241 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9242 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9243 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9244 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9245 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9246 
9247 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9248 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9249 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9250 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9251 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9252 
9253 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9254 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9255 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9256 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9257 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9258 
9259 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9260 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9261 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9262 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9263 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9264 
9265 			{ },
9266 		},
9267 	},
9268 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9269 		.type = HDA_FIXUP_FUNC,
9270 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9271 		.chained = true,
9272 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9273 	},
9274 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9275 		.type = HDA_FIXUP_FUNC,
9276 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9277 		.chained = true,
9278 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9279 	},
9280 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9281 		.type = HDA_FIXUP_PINS,
9282 		.v.func = alc1220_fixup_gb_dual_codecs,
9283 		.chained = true,
9284 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9285 	},
9286 };
9287 
9288 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
9289 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
9290 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9291 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
9292 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
9293 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9294 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9295 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
9296 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9297 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
9298 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
9299 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
9300 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
9301 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
9302 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
9303 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
9304 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
9305 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
9306 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9307 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9308 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9309 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
9310 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
9311 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
9312 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
9313 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
9314 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9315 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9316 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9317 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
9318 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9319 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9320 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9321 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
9322 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
9323 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9324 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9325 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
9326 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
9327 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9328 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
9329 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
9330 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
9331 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
9332 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
9333 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9334 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
9335 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
9336 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9337 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9338 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9339 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9340 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9341 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
9342 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
9343 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
9344 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9345 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9346 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
9347 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9348 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
9349 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
9350 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9351 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9352 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9353 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9354 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9355 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9356 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9357 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9358 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
9359 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
9360 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
9361 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
9362 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
9363 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
9364 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
9365 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9366 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9367 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9368 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9369 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
9370 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
9371 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
9372 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9373 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9374 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
9375 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9376 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9377 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9378 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9379 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
9380 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
9381 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
9382 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
9383 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9384 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9385 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
9386 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
9387 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9388 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9389 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9390 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9391 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9392 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9393 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9394 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9395 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9396 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9397 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9398 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9399 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
9400 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
9401 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9402 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9403 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9404 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9405 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9406 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9407 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9408 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9409 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9410 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9411 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9412 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9413 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9414 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9415 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9416 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9417 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9418 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9419 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
9420 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
9421 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9422 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9423 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9424 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9425 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9426 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9427 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9428 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9429 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9430 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9431 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9432 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9433 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9434 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9435 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9436 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9437 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9438 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9439 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9440 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9441 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9442 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9443 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9444 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9445 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9446 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9447 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9448 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9449 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9450 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9451 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9452 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9453 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9454 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9455 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
9456 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9457 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9458 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9459 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9460 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
9461 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
9462 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
9463 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9464 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9465 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9466 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9467 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9468 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9469 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
9470 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9471 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
9472 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9473 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9474 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9475 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
9476 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9477 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9478 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
9479 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9480 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9481 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9482 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9483 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9484 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9485 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9486 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9487 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9488 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9489 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9490 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9491 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9492 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9493 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
9494 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9495 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9496 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9497 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9498 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9499 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9500 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9501 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9502 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9503 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9504 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9505 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9506 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9507 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9508 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9509 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9510 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9511 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9512 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9513 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9514 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9515 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9516 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9517 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9518 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9519 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9520 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9521 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9522 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9523 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9524 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
9525 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
9526 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9527 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9528 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9529 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9530 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9531 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9532 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9533 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9534 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9535 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9536 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9537 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9538 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9539 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
9540 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9541 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
9542 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9543 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9544 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
9545 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9546 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9547 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9548 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9549 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9550 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9551 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9552 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9553 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9554 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9555 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9556 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9557 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9558 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9559 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9560 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9561 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9562 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9563 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9564 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9565 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9566 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9567 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9568 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9569 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9570 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9571 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9572 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
9573 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9574 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9575 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
9576 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9577 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
9578 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
9579 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9580 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9581 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9582 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9583 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
9584 	SND_PCI_QUIRK(0x103c, 0x8c26, "HP HP EliteBook 800G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9585 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9586 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9587 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9588 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9589 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9590 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9591 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9592 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9593 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9594 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9595 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9596 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9597 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
9598 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
9599 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
9600 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
9601 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
9602 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
9603 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
9604 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650P", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
9605 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
9606 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604V", ALC285_FIXUP_ASUS_HEADSET_MIC),
9607 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603V", ALC285_FIXUP_ASUS_HEADSET_MIC),
9608 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601V", ALC285_FIXUP_ASUS_HEADSET_MIC),
9609 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
9610 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301V", ALC285_FIXUP_ASUS_HEADSET_MIC),
9611 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9612 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
9613 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9614 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
9615 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
9616 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
9617 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
9618 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
9619 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
9620 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
9621 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
9622 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
9623 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
9624 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
9625 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
9626 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
9627 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9628 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
9629 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
9630 	SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
9631 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
9632 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9633 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9634 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9635 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
9636 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
9637 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
9638 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
9639 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
9640 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
9641 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),
9642 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
9643 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
9644 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
9645 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
9646 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
9647 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
9648 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
9649 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
9650 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
9651 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
9652 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
9653 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
9654 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC245_FIXUP_CS35L41_SPI_2),
9655 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
9656 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
9657 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9658 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9659 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9660 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9661 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
9662 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9663 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9664 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9665 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
9666 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9667 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9668 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
9669 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
9670 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9671 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
9672 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9673 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
9674 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
9675 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
9676 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9677 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9678 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9679 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9680 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC225_FIXUP_HEADSET_JACK),
9681 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
9682 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
9683 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9684 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9685 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9686 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9687 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
9688 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
9689 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9690 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9691 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
9692 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9693 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
9694 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
9695 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9696 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9697 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9698 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9699 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9700 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9701 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9702 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9703 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9704 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9705 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9706 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9707 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9708 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9709 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9710 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9711 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9712 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9713 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9714 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9715 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9716 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9717 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9718 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9719 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9720 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9721 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9722 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9723 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9724 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9725 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9726 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9727 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9728 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9729 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9730 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9731 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9732 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9733 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9734 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9735 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9736 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9737 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9738 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9739 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9740 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9741 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9742 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9743 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9744 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9745 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9746 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9747 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9748 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9749 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9750 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9751 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9752 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9753 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9754 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9755 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9756 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9757 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9758 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9759 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9760 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9761 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9762 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9763 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9764 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9765 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9766 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9767 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9768 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9769 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9770 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9771 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9772 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9773 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9774 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9775 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9776 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9777 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9778 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9779 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9780 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9781 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9782 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9783 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9784 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9785 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9786 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9787 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9788 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9789 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9790 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9791 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9792 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9793 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9794 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9795 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9796 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9797 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9798 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9799 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9800 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9801 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9802 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9803 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9804 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9805 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9806 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9807 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9808 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9809 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9810 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9811 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9812 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9813 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9814 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9815 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9816 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_CS35L41_I2C_2),
9817 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_CS35L41_I2C_2),
9818 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
9819 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
9820 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
9821 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9822 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9823 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9824 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9825 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9826 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9827 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9828 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9829 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9830 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9831 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9832 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
9833 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9834 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9835 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
9836 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9837 	SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9838 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9839 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9840 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9841 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9842 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9843 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
9844 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9845 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9846 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9847 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
9848 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
9849 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9850 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9851 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9852 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9853 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9854 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9855 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9856 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9857 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9858 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9859 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9860 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9861 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9862 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9863 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9864 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9865 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9866 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9867 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9868 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9869 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9870 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9871 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9872 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9873 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9874 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9875 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
9876 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9877 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9878 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9879 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9880 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9881 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9882 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9883 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9884 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
9885 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9886 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9887 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9888 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9889 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9890 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9891 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9892 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9893 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
9894 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9895 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9896 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9897 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
9898 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9899 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9900 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9901 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9902 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC225_FIXUP_HEADSET_JACK),
9903 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
9904 
9905 #if 0
9906 	/* Below is a quirk table taken from the old code.
9907 	 * Basically the device should work as is without the fixup table.
9908 	 * If BIOS doesn't give a proper info, enable the corresponding
9909 	 * fixup entry.
9910 	 */
9911 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9912 		      ALC269_FIXUP_AMIC),
9913 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9914 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9915 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9916 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9917 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9918 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9919 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9920 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9921 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9922 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9923 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9924 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9925 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9926 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9927 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9928 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9929 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9930 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9931 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9932 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9933 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9934 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9935 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9936 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9937 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9938 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9939 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9940 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9941 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9942 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9943 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9944 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9945 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9946 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9947 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9948 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9949 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9950 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9951 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9952 #endif
9953 	{}
9954 };
9955 
9956 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9957 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9958 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9959 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9960 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9961 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9962 	{}
9963 };
9964 
9965 static const struct hda_model_fixup alc269_fixup_models[] = {
9966 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9967 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9968 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9969 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9970 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9971 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9972 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9973 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9974 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9975 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9976 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9977 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9978 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9979 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9980 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9981 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9982 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9983 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9984 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9985 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9986 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9987 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9988 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9989 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9990 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9991 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9992 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9993 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9994 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9995 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9996 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9997 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9998 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9999 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10000 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10001 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10002 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10003 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10004 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10005 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10006 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10007 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10008 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10009 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10010 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10011 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10012 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10013 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10014 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10015 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10016 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10017 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10018 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10019 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10020 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10021 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10022 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10023 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10024 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10025 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10026 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10027 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10028 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10029 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10030 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
10031 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
10032 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
10033 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
10034 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10035 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10036 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10037 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10038 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10039 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10040 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10041 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10042 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10043 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10044 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10045 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10046 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10047 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
10048 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10049 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10050 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
10051 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
10052 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
10053 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
10054 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10055 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10056 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10057 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10058 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10059 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10060 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10061 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10062 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10063 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10064 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10065 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10066 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10067 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10068 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10069 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10070 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
10071 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10072 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
10073 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
10074 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
10075 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
10076 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
10077 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
10078 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
10079 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
10080 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
10081 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
10082 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
10083 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
10084 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
10085 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
10086 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
10087 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
10088 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
10089 	{}
10090 };
10091 #define ALC225_STANDARD_PINS \
10092 	{0x21, 0x04211020}
10093 
10094 #define ALC256_STANDARD_PINS \
10095 	{0x12, 0x90a60140}, \
10096 	{0x14, 0x90170110}, \
10097 	{0x21, 0x02211020}
10098 
10099 #define ALC282_STANDARD_PINS \
10100 	{0x14, 0x90170110}
10101 
10102 #define ALC290_STANDARD_PINS \
10103 	{0x12, 0x99a30130}
10104 
10105 #define ALC292_STANDARD_PINS \
10106 	{0x14, 0x90170110}, \
10107 	{0x15, 0x0221401f}
10108 
10109 #define ALC295_STANDARD_PINS \
10110 	{0x12, 0xb7a60130}, \
10111 	{0x14, 0x90170110}, \
10112 	{0x21, 0x04211020}
10113 
10114 #define ALC298_STANDARD_PINS \
10115 	{0x12, 0x90a60130}, \
10116 	{0x21, 0x03211020}
10117 
10118 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
10119 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10120 		{0x14, 0x01014020},
10121 		{0x17, 0x90170110},
10122 		{0x18, 0x02a11030},
10123 		{0x19, 0x0181303F},
10124 		{0x21, 0x0221102f}),
10125 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10126 		{0x12, 0x90a601c0},
10127 		{0x14, 0x90171120},
10128 		{0x21, 0x02211030}),
10129 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10130 		{0x14, 0x90170110},
10131 		{0x1b, 0x90a70130},
10132 		{0x21, 0x03211020}),
10133 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10134 		{0x1a, 0x90a70130},
10135 		{0x1b, 0x90170110},
10136 		{0x21, 0x03211020}),
10137 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10138 		ALC225_STANDARD_PINS,
10139 		{0x12, 0xb7a60130},
10140 		{0x14, 0x901701a0}),
10141 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10142 		ALC225_STANDARD_PINS,
10143 		{0x12, 0xb7a60130},
10144 		{0x14, 0x901701b0}),
10145 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10146 		ALC225_STANDARD_PINS,
10147 		{0x12, 0xb7a60150},
10148 		{0x14, 0x901701a0}),
10149 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10150 		ALC225_STANDARD_PINS,
10151 		{0x12, 0xb7a60150},
10152 		{0x14, 0x901701b0}),
10153 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10154 		ALC225_STANDARD_PINS,
10155 		{0x12, 0xb7a60130},
10156 		{0x1b, 0x90170110}),
10157 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10158 		{0x1b, 0x01111010},
10159 		{0x1e, 0x01451130},
10160 		{0x21, 0x02211020}),
10161 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10162 		{0x12, 0x90a60140},
10163 		{0x14, 0x90170110},
10164 		{0x19, 0x02a11030},
10165 		{0x21, 0x02211020}),
10166 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10167 		{0x14, 0x90170110},
10168 		{0x19, 0x02a11030},
10169 		{0x1a, 0x02a11040},
10170 		{0x1b, 0x01014020},
10171 		{0x21, 0x0221101f}),
10172 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10173 		{0x14, 0x90170110},
10174 		{0x19, 0x02a11030},
10175 		{0x1a, 0x02a11040},
10176 		{0x1b, 0x01011020},
10177 		{0x21, 0x0221101f}),
10178 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10179 		{0x14, 0x90170110},
10180 		{0x19, 0x02a11020},
10181 		{0x1a, 0x02a11030},
10182 		{0x21, 0x0221101f}),
10183 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10184 		{0x21, 0x02211010}),
10185 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10186 		{0x14, 0x90170110},
10187 		{0x19, 0x02a11020},
10188 		{0x21, 0x02211030}),
10189 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
10190 		{0x14, 0x90170110},
10191 		{0x21, 0x02211020}),
10192 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10193 		{0x14, 0x90170130},
10194 		{0x21, 0x02211040}),
10195 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10196 		{0x12, 0x90a60140},
10197 		{0x14, 0x90170110},
10198 		{0x21, 0x02211020}),
10199 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10200 		{0x12, 0x90a60160},
10201 		{0x14, 0x90170120},
10202 		{0x21, 0x02211030}),
10203 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10204 		{0x14, 0x90170110},
10205 		{0x1b, 0x02011020},
10206 		{0x21, 0x0221101f}),
10207 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10208 		{0x14, 0x90170110},
10209 		{0x1b, 0x01011020},
10210 		{0x21, 0x0221101f}),
10211 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10212 		{0x14, 0x90170130},
10213 		{0x1b, 0x01014020},
10214 		{0x21, 0x0221103f}),
10215 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10216 		{0x14, 0x90170130},
10217 		{0x1b, 0x01011020},
10218 		{0x21, 0x0221103f}),
10219 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10220 		{0x14, 0x90170130},
10221 		{0x1b, 0x02011020},
10222 		{0x21, 0x0221103f}),
10223 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10224 		{0x14, 0x90170150},
10225 		{0x1b, 0x02011020},
10226 		{0x21, 0x0221105f}),
10227 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10228 		{0x14, 0x90170110},
10229 		{0x1b, 0x01014020},
10230 		{0x21, 0x0221101f}),
10231 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10232 		{0x12, 0x90a60160},
10233 		{0x14, 0x90170120},
10234 		{0x17, 0x90170140},
10235 		{0x21, 0x0321102f}),
10236 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10237 		{0x12, 0x90a60160},
10238 		{0x14, 0x90170130},
10239 		{0x21, 0x02211040}),
10240 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10241 		{0x12, 0x90a60160},
10242 		{0x14, 0x90170140},
10243 		{0x21, 0x02211050}),
10244 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10245 		{0x12, 0x90a60170},
10246 		{0x14, 0x90170120},
10247 		{0x21, 0x02211030}),
10248 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10249 		{0x12, 0x90a60170},
10250 		{0x14, 0x90170130},
10251 		{0x21, 0x02211040}),
10252 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10253 		{0x12, 0x90a60170},
10254 		{0x14, 0x90171130},
10255 		{0x21, 0x02211040}),
10256 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10257 		{0x12, 0x90a60170},
10258 		{0x14, 0x90170140},
10259 		{0x21, 0x02211050}),
10260 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10261 		{0x12, 0x90a60180},
10262 		{0x14, 0x90170130},
10263 		{0x21, 0x02211040}),
10264 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10265 		{0x12, 0x90a60180},
10266 		{0x14, 0x90170120},
10267 		{0x21, 0x02211030}),
10268 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10269 		{0x1b, 0x01011020},
10270 		{0x21, 0x02211010}),
10271 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10272 		{0x14, 0x90170110},
10273 		{0x1b, 0x90a70130},
10274 		{0x21, 0x04211020}),
10275 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10276 		{0x14, 0x90170110},
10277 		{0x1b, 0x90a70130},
10278 		{0x21, 0x03211020}),
10279 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10280 		{0x12, 0x90a60130},
10281 		{0x14, 0x90170110},
10282 		{0x21, 0x03211020}),
10283 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10284 		{0x12, 0x90a60130},
10285 		{0x14, 0x90170110},
10286 		{0x21, 0x04211020}),
10287 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10288 		{0x1a, 0x90a70130},
10289 		{0x1b, 0x90170110},
10290 		{0x21, 0x03211020}),
10291        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10292 		{0x14, 0x90170110},
10293 		{0x19, 0x02a11020},
10294 		{0x21, 0x0221101f}),
10295        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10296 		{0x17, 0x90170110},
10297 		{0x19, 0x03a11030},
10298 		{0x21, 0x03211020}),
10299 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10300 		{0x12, 0x90a60130},
10301 		{0x14, 0x90170110},
10302 		{0x15, 0x0421101f},
10303 		{0x1a, 0x04a11020}),
10304 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10305 		{0x12, 0x90a60140},
10306 		{0x14, 0x90170110},
10307 		{0x15, 0x0421101f},
10308 		{0x18, 0x02811030},
10309 		{0x1a, 0x04a1103f},
10310 		{0x1b, 0x02011020}),
10311 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10312 		ALC282_STANDARD_PINS,
10313 		{0x12, 0x99a30130},
10314 		{0x19, 0x03a11020},
10315 		{0x21, 0x0321101f}),
10316 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10317 		ALC282_STANDARD_PINS,
10318 		{0x12, 0x99a30130},
10319 		{0x19, 0x03a11020},
10320 		{0x21, 0x03211040}),
10321 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10322 		ALC282_STANDARD_PINS,
10323 		{0x12, 0x99a30130},
10324 		{0x19, 0x03a11030},
10325 		{0x21, 0x03211020}),
10326 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10327 		ALC282_STANDARD_PINS,
10328 		{0x12, 0x99a30130},
10329 		{0x19, 0x04a11020},
10330 		{0x21, 0x0421101f}),
10331 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
10332 		ALC282_STANDARD_PINS,
10333 		{0x12, 0x90a60140},
10334 		{0x19, 0x04a11030},
10335 		{0x21, 0x04211020}),
10336 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10337 		ALC282_STANDARD_PINS,
10338 		{0x12, 0x90a609c0},
10339 		{0x18, 0x03a11830},
10340 		{0x19, 0x04a19831},
10341 		{0x1a, 0x0481303f},
10342 		{0x1b, 0x04211020},
10343 		{0x21, 0x0321101f}),
10344 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10345 		ALC282_STANDARD_PINS,
10346 		{0x12, 0x90a60940},
10347 		{0x18, 0x03a11830},
10348 		{0x19, 0x04a19831},
10349 		{0x1a, 0x0481303f},
10350 		{0x1b, 0x04211020},
10351 		{0x21, 0x0321101f}),
10352 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10353 		ALC282_STANDARD_PINS,
10354 		{0x12, 0x90a60130},
10355 		{0x21, 0x0321101f}),
10356 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10357 		{0x12, 0x90a60160},
10358 		{0x14, 0x90170120},
10359 		{0x21, 0x02211030}),
10360 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10361 		ALC282_STANDARD_PINS,
10362 		{0x12, 0x90a60130},
10363 		{0x19, 0x03a11020},
10364 		{0x21, 0x0321101f}),
10365 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10366 		{0x12, 0x90a60130},
10367 		{0x14, 0x90170110},
10368 		{0x19, 0x04a11040},
10369 		{0x21, 0x04211020}),
10370 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10371 		{0x14, 0x90170110},
10372 		{0x19, 0x04a11040},
10373 		{0x1d, 0x40600001},
10374 		{0x21, 0x04211020}),
10375 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
10376 		{0x14, 0x90170110},
10377 		{0x19, 0x04a11040},
10378 		{0x21, 0x04211020}),
10379 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10380 		{0x14, 0x90170110},
10381 		{0x17, 0x90170111},
10382 		{0x19, 0x03a11030},
10383 		{0x21, 0x03211020}),
10384 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10385 		{0x12, 0x90a60130},
10386 		{0x17, 0x90170110},
10387 		{0x21, 0x02211020}),
10388 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
10389 		{0x12, 0x90a60120},
10390 		{0x14, 0x90170110},
10391 		{0x21, 0x0321101f}),
10392 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10393 		ALC290_STANDARD_PINS,
10394 		{0x15, 0x04211040},
10395 		{0x18, 0x90170112},
10396 		{0x1a, 0x04a11020}),
10397 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10398 		ALC290_STANDARD_PINS,
10399 		{0x15, 0x04211040},
10400 		{0x18, 0x90170110},
10401 		{0x1a, 0x04a11020}),
10402 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10403 		ALC290_STANDARD_PINS,
10404 		{0x15, 0x0421101f},
10405 		{0x1a, 0x04a11020}),
10406 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10407 		ALC290_STANDARD_PINS,
10408 		{0x15, 0x04211020},
10409 		{0x1a, 0x04a11040}),
10410 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10411 		ALC290_STANDARD_PINS,
10412 		{0x14, 0x90170110},
10413 		{0x15, 0x04211020},
10414 		{0x1a, 0x04a11040}),
10415 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10416 		ALC290_STANDARD_PINS,
10417 		{0x14, 0x90170110},
10418 		{0x15, 0x04211020},
10419 		{0x1a, 0x04a11020}),
10420 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
10421 		ALC290_STANDARD_PINS,
10422 		{0x14, 0x90170110},
10423 		{0x15, 0x0421101f},
10424 		{0x1a, 0x04a11020}),
10425 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10426 		ALC292_STANDARD_PINS,
10427 		{0x12, 0x90a60140},
10428 		{0x16, 0x01014020},
10429 		{0x19, 0x01a19030}),
10430 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
10431 		ALC292_STANDARD_PINS,
10432 		{0x12, 0x90a60140},
10433 		{0x16, 0x01014020},
10434 		{0x18, 0x02a19031},
10435 		{0x19, 0x01a1903e}),
10436 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
10437 		ALC292_STANDARD_PINS,
10438 		{0x12, 0x90a60140}),
10439 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10440 		ALC292_STANDARD_PINS,
10441 		{0x13, 0x90a60140},
10442 		{0x16, 0x21014020},
10443 		{0x19, 0x21a19030}),
10444 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
10445 		ALC292_STANDARD_PINS,
10446 		{0x13, 0x90a60140}),
10447 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10448 		{0x17, 0x90170110},
10449 		{0x21, 0x04211020}),
10450 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10451 		{0x14, 0x90170110},
10452 		{0x1b, 0x90a70130},
10453 		{0x21, 0x04211020}),
10454 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10455 		{0x12, 0x90a60130},
10456 		{0x17, 0x90170110},
10457 		{0x21, 0x03211020}),
10458 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10459 		{0x12, 0x90a60130},
10460 		{0x17, 0x90170110},
10461 		{0x21, 0x04211020}),
10462 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10463 		{0x12, 0x90a60130},
10464 		{0x17, 0x90170110},
10465 		{0x21, 0x03211020}),
10466 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10467 		{0x12, 0x90a60120},
10468 		{0x17, 0x90170110},
10469 		{0x21, 0x04211030}),
10470 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10471 		{0x12, 0x90a60130},
10472 		{0x17, 0x90170110},
10473 		{0x21, 0x03211020}),
10474 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10475 		{0x12, 0x90a60130},
10476 		{0x17, 0x90170110},
10477 		{0x21, 0x03211020}),
10478 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10479 		{0x14, 0x90170110},
10480 		{0x21, 0x04211020}),
10481 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10482 		{0x14, 0x90170110},
10483 		{0x21, 0x04211030}),
10484 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10485 		ALC295_STANDARD_PINS,
10486 		{0x17, 0x21014020},
10487 		{0x18, 0x21a19030}),
10488 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10489 		ALC295_STANDARD_PINS,
10490 		{0x17, 0x21014040},
10491 		{0x18, 0x21a19050}),
10492 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10493 		ALC295_STANDARD_PINS),
10494 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10495 		ALC298_STANDARD_PINS,
10496 		{0x17, 0x90170110}),
10497 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10498 		ALC298_STANDARD_PINS,
10499 		{0x17, 0x90170140}),
10500 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10501 		ALC298_STANDARD_PINS,
10502 		{0x17, 0x90170150}),
10503 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10504 		{0x12, 0xb7a60140},
10505 		{0x13, 0xb7a60150},
10506 		{0x17, 0x90170110},
10507 		{0x1a, 0x03011020},
10508 		{0x21, 0x03211030}),
10509 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10510 		{0x12, 0xb7a60140},
10511 		{0x17, 0x90170110},
10512 		{0x1a, 0x03a11030},
10513 		{0x21, 0x03211020}),
10514 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10515 		ALC225_STANDARD_PINS,
10516 		{0x12, 0xb7a60130},
10517 		{0x17, 0x90170110}),
10518 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10519 		{0x14, 0x01014010},
10520 		{0x17, 0x90170120},
10521 		{0x18, 0x02a11030},
10522 		{0x19, 0x02a1103f},
10523 		{0x21, 0x0221101f}),
10524 	{}
10525 };
10526 
10527 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10528  * more machines, don't need to match all valid pins, just need to match
10529  * all the pins defined in the tbl. Just because of this reason, it is possible
10530  * that a single machine matches multiple tbls, so there is one limitation:
10531  *   at most one tbl is allowed to define for the same vendor and same codec
10532  */
10533 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10534 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10535 		{0x19, 0x40000000},
10536 		{0x1b, 0x40000000}),
10537 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10538 		{0x19, 0x40000000},
10539 		{0x1a, 0x40000000}),
10540 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10541 		{0x19, 0x40000000},
10542 		{0x1a, 0x40000000}),
10543 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
10544 		{0x19, 0x40000000},
10545 		{0x1a, 0x40000000}),
10546 	{}
10547 };
10548 
10549 static void alc269_fill_coef(struct hda_codec *codec)
10550 {
10551 	struct alc_spec *spec = codec->spec;
10552 	int val;
10553 
10554 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
10555 		return;
10556 
10557 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
10558 		alc_write_coef_idx(codec, 0xf, 0x960b);
10559 		alc_write_coef_idx(codec, 0xe, 0x8817);
10560 	}
10561 
10562 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
10563 		alc_write_coef_idx(codec, 0xf, 0x960b);
10564 		alc_write_coef_idx(codec, 0xe, 0x8814);
10565 	}
10566 
10567 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
10568 		/* Power up output pin */
10569 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
10570 	}
10571 
10572 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
10573 		val = alc_read_coef_idx(codec, 0xd);
10574 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
10575 			/* Capless ramp up clock control */
10576 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
10577 		}
10578 		val = alc_read_coef_idx(codec, 0x17);
10579 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
10580 			/* Class D power on reset */
10581 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
10582 		}
10583 	}
10584 
10585 	/* HP */
10586 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
10587 }
10588 
10589 /*
10590  */
10591 static int patch_alc269(struct hda_codec *codec)
10592 {
10593 	struct alc_spec *spec;
10594 	int err;
10595 
10596 	err = alc_alloc_spec(codec, 0x0b);
10597 	if (err < 0)
10598 		return err;
10599 
10600 	spec = codec->spec;
10601 	spec->gen.shared_mic_vref_pin = 0x18;
10602 	codec->power_save_node = 0;
10603 
10604 #ifdef CONFIG_PM
10605 	codec->patch_ops.suspend = alc269_suspend;
10606 	codec->patch_ops.resume = alc269_resume;
10607 #endif
10608 	spec->shutup = alc_default_shutup;
10609 	spec->init_hook = alc_default_init;
10610 
10611 	switch (codec->core.vendor_id) {
10612 	case 0x10ec0269:
10613 		spec->codec_variant = ALC269_TYPE_ALC269VA;
10614 		switch (alc_get_coef0(codec) & 0x00f0) {
10615 		case 0x0010:
10616 			if (codec->bus->pci &&
10617 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
10618 			    spec->cdefine.platform_type == 1)
10619 				err = alc_codec_rename(codec, "ALC271X");
10620 			spec->codec_variant = ALC269_TYPE_ALC269VB;
10621 			break;
10622 		case 0x0020:
10623 			if (codec->bus->pci &&
10624 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
10625 			    codec->bus->pci->subsystem_device == 0x21f3)
10626 				err = alc_codec_rename(codec, "ALC3202");
10627 			spec->codec_variant = ALC269_TYPE_ALC269VC;
10628 			break;
10629 		case 0x0030:
10630 			spec->codec_variant = ALC269_TYPE_ALC269VD;
10631 			break;
10632 		default:
10633 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
10634 		}
10635 		if (err < 0)
10636 			goto error;
10637 		spec->shutup = alc269_shutup;
10638 		spec->init_hook = alc269_fill_coef;
10639 		alc269_fill_coef(codec);
10640 		break;
10641 
10642 	case 0x10ec0280:
10643 	case 0x10ec0290:
10644 		spec->codec_variant = ALC269_TYPE_ALC280;
10645 		break;
10646 	case 0x10ec0282:
10647 		spec->codec_variant = ALC269_TYPE_ALC282;
10648 		spec->shutup = alc282_shutup;
10649 		spec->init_hook = alc282_init;
10650 		break;
10651 	case 0x10ec0233:
10652 	case 0x10ec0283:
10653 		spec->codec_variant = ALC269_TYPE_ALC283;
10654 		spec->shutup = alc283_shutup;
10655 		spec->init_hook = alc283_init;
10656 		break;
10657 	case 0x10ec0284:
10658 	case 0x10ec0292:
10659 		spec->codec_variant = ALC269_TYPE_ALC284;
10660 		break;
10661 	case 0x10ec0293:
10662 		spec->codec_variant = ALC269_TYPE_ALC293;
10663 		break;
10664 	case 0x10ec0286:
10665 	case 0x10ec0288:
10666 		spec->codec_variant = ALC269_TYPE_ALC286;
10667 		break;
10668 	case 0x10ec0298:
10669 		spec->codec_variant = ALC269_TYPE_ALC298;
10670 		break;
10671 	case 0x10ec0235:
10672 	case 0x10ec0255:
10673 		spec->codec_variant = ALC269_TYPE_ALC255;
10674 		spec->shutup = alc256_shutup;
10675 		spec->init_hook = alc256_init;
10676 		break;
10677 	case 0x10ec0230:
10678 	case 0x10ec0236:
10679 	case 0x10ec0256:
10680 	case 0x19e58326:
10681 		spec->codec_variant = ALC269_TYPE_ALC256;
10682 		spec->shutup = alc256_shutup;
10683 		spec->init_hook = alc256_init;
10684 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
10685 		break;
10686 	case 0x10ec0257:
10687 		spec->codec_variant = ALC269_TYPE_ALC257;
10688 		spec->shutup = alc256_shutup;
10689 		spec->init_hook = alc256_init;
10690 		spec->gen.mixer_nid = 0;
10691 		break;
10692 	case 0x10ec0215:
10693 	case 0x10ec0245:
10694 	case 0x10ec0285:
10695 	case 0x10ec0289:
10696 		if (alc_get_coef0(codec) & 0x0010)
10697 			spec->codec_variant = ALC269_TYPE_ALC245;
10698 		else
10699 			spec->codec_variant = ALC269_TYPE_ALC215;
10700 		spec->shutup = alc225_shutup;
10701 		spec->init_hook = alc225_init;
10702 		spec->gen.mixer_nid = 0;
10703 		break;
10704 	case 0x10ec0225:
10705 	case 0x10ec0295:
10706 	case 0x10ec0299:
10707 		spec->codec_variant = ALC269_TYPE_ALC225;
10708 		spec->shutup = alc225_shutup;
10709 		spec->init_hook = alc225_init;
10710 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
10711 		break;
10712 	case 0x10ec0287:
10713 		spec->codec_variant = ALC269_TYPE_ALC287;
10714 		spec->shutup = alc225_shutup;
10715 		spec->init_hook = alc225_init;
10716 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10717 		break;
10718 	case 0x10ec0234:
10719 	case 0x10ec0274:
10720 	case 0x10ec0294:
10721 		spec->codec_variant = ALC269_TYPE_ALC294;
10722 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
10723 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
10724 		spec->init_hook = alc294_init;
10725 		break;
10726 	case 0x10ec0300:
10727 		spec->codec_variant = ALC269_TYPE_ALC300;
10728 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
10729 		break;
10730 	case 0x10ec0623:
10731 		spec->codec_variant = ALC269_TYPE_ALC623;
10732 		break;
10733 	case 0x10ec0700:
10734 	case 0x10ec0701:
10735 	case 0x10ec0703:
10736 	case 0x10ec0711:
10737 		spec->codec_variant = ALC269_TYPE_ALC700;
10738 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10739 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10740 		spec->init_hook = alc294_init;
10741 		break;
10742 
10743 	}
10744 
10745 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10746 		spec->has_alc5505_dsp = 1;
10747 		spec->init_hook = alc5505_dsp_init;
10748 	}
10749 
10750 	alc_pre_init(codec);
10751 
10752 	snd_hda_pick_fixup(codec, alc269_fixup_models,
10753 		       alc269_fixup_tbl, alc269_fixups);
10754 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10755 	 * the quirk breaks the latter (bko#214101).
10756 	 * Clear the wrong entry.
10757 	 */
10758 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10759 	    codec->core.vendor_id == 0x10ec0294) {
10760 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10761 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10762 	}
10763 
10764 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10765 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10766 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
10767 			   alc269_fixups);
10768 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10769 
10770 	alc_auto_parse_customize_define(codec);
10771 
10772 	if (has_cdefine_beep(codec))
10773 		spec->gen.beep_nid = 0x01;
10774 
10775 	/* automatic parse from the BIOS config */
10776 	err = alc269_parse_auto_config(codec);
10777 	if (err < 0)
10778 		goto error;
10779 
10780 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10781 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10782 		if (err < 0)
10783 			goto error;
10784 	}
10785 
10786 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10787 
10788 	return 0;
10789 
10790  error:
10791 	alc_free(codec);
10792 	return err;
10793 }
10794 
10795 /*
10796  * ALC861
10797  */
10798 
10799 static int alc861_parse_auto_config(struct hda_codec *codec)
10800 {
10801 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10802 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10803 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10804 }
10805 
10806 /* Pin config fixes */
10807 enum {
10808 	ALC861_FIXUP_FSC_AMILO_PI1505,
10809 	ALC861_FIXUP_AMP_VREF_0F,
10810 	ALC861_FIXUP_NO_JACK_DETECT,
10811 	ALC861_FIXUP_ASUS_A6RP,
10812 	ALC660_FIXUP_ASUS_W7J,
10813 };
10814 
10815 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10816 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10817 			const struct hda_fixup *fix, int action)
10818 {
10819 	struct alc_spec *spec = codec->spec;
10820 	unsigned int val;
10821 
10822 	if (action != HDA_FIXUP_ACT_INIT)
10823 		return;
10824 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
10825 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10826 		val |= AC_PINCTL_IN_EN;
10827 	val |= AC_PINCTL_VREF_50;
10828 	snd_hda_set_pin_ctl(codec, 0x0f, val);
10829 	spec->gen.keep_vref_in_automute = 1;
10830 }
10831 
10832 /* suppress the jack-detection */
10833 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10834 				     const struct hda_fixup *fix, int action)
10835 {
10836 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
10837 		codec->no_jack_detect = 1;
10838 }
10839 
10840 static const struct hda_fixup alc861_fixups[] = {
10841 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
10842 		.type = HDA_FIXUP_PINS,
10843 		.v.pins = (const struct hda_pintbl[]) {
10844 			{ 0x0b, 0x0221101f }, /* HP */
10845 			{ 0x0f, 0x90170310 }, /* speaker */
10846 			{ }
10847 		}
10848 	},
10849 	[ALC861_FIXUP_AMP_VREF_0F] = {
10850 		.type = HDA_FIXUP_FUNC,
10851 		.v.func = alc861_fixup_asus_amp_vref_0f,
10852 	},
10853 	[ALC861_FIXUP_NO_JACK_DETECT] = {
10854 		.type = HDA_FIXUP_FUNC,
10855 		.v.func = alc_fixup_no_jack_detect,
10856 	},
10857 	[ALC861_FIXUP_ASUS_A6RP] = {
10858 		.type = HDA_FIXUP_FUNC,
10859 		.v.func = alc861_fixup_asus_amp_vref_0f,
10860 		.chained = true,
10861 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10862 	},
10863 	[ALC660_FIXUP_ASUS_W7J] = {
10864 		.type = HDA_FIXUP_VERBS,
10865 		.v.verbs = (const struct hda_verb[]) {
10866 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
10867 			 * for enabling outputs
10868 			 */
10869 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10870 			{ }
10871 		},
10872 	}
10873 };
10874 
10875 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10876 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10877 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10878 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10879 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10880 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10881 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10882 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10883 	{}
10884 };
10885 
10886 /*
10887  */
10888 static int patch_alc861(struct hda_codec *codec)
10889 {
10890 	struct alc_spec *spec;
10891 	int err;
10892 
10893 	err = alc_alloc_spec(codec, 0x15);
10894 	if (err < 0)
10895 		return err;
10896 
10897 	spec = codec->spec;
10898 	if (has_cdefine_beep(codec))
10899 		spec->gen.beep_nid = 0x23;
10900 
10901 #ifdef CONFIG_PM
10902 	spec->power_hook = alc_power_eapd;
10903 #endif
10904 
10905 	alc_pre_init(codec);
10906 
10907 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10908 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10909 
10910 	/* automatic parse from the BIOS config */
10911 	err = alc861_parse_auto_config(codec);
10912 	if (err < 0)
10913 		goto error;
10914 
10915 	if (!spec->gen.no_analog) {
10916 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10917 		if (err < 0)
10918 			goto error;
10919 	}
10920 
10921 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10922 
10923 	return 0;
10924 
10925  error:
10926 	alc_free(codec);
10927 	return err;
10928 }
10929 
10930 /*
10931  * ALC861-VD support
10932  *
10933  * Based on ALC882
10934  *
10935  * In addition, an independent DAC
10936  */
10937 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10938 {
10939 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10940 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10941 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10942 }
10943 
10944 enum {
10945 	ALC660VD_FIX_ASUS_GPIO1,
10946 	ALC861VD_FIX_DALLAS,
10947 };
10948 
10949 /* exclude VREF80 */
10950 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10951 				  const struct hda_fixup *fix, int action)
10952 {
10953 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10954 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10955 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10956 	}
10957 }
10958 
10959 /* reset GPIO1 */
10960 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10961 				      const struct hda_fixup *fix, int action)
10962 {
10963 	struct alc_spec *spec = codec->spec;
10964 
10965 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
10966 		spec->gpio_mask |= 0x02;
10967 	alc_fixup_gpio(codec, action, 0x01);
10968 }
10969 
10970 static const struct hda_fixup alc861vd_fixups[] = {
10971 	[ALC660VD_FIX_ASUS_GPIO1] = {
10972 		.type = HDA_FIXUP_FUNC,
10973 		.v.func = alc660vd_fixup_asus_gpio1,
10974 	},
10975 	[ALC861VD_FIX_DALLAS] = {
10976 		.type = HDA_FIXUP_FUNC,
10977 		.v.func = alc861vd_fixup_dallas,
10978 	},
10979 };
10980 
10981 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10982 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10983 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10984 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10985 	{}
10986 };
10987 
10988 /*
10989  */
10990 static int patch_alc861vd(struct hda_codec *codec)
10991 {
10992 	struct alc_spec *spec;
10993 	int err;
10994 
10995 	err = alc_alloc_spec(codec, 0x0b);
10996 	if (err < 0)
10997 		return err;
10998 
10999 	spec = codec->spec;
11000 	if (has_cdefine_beep(codec))
11001 		spec->gen.beep_nid = 0x23;
11002 
11003 	spec->shutup = alc_eapd_shutup;
11004 
11005 	alc_pre_init(codec);
11006 
11007 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11008 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11009 
11010 	/* automatic parse from the BIOS config */
11011 	err = alc861vd_parse_auto_config(codec);
11012 	if (err < 0)
11013 		goto error;
11014 
11015 	if (!spec->gen.no_analog) {
11016 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11017 		if (err < 0)
11018 			goto error;
11019 	}
11020 
11021 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11022 
11023 	return 0;
11024 
11025  error:
11026 	alc_free(codec);
11027 	return err;
11028 }
11029 
11030 /*
11031  * ALC662 support
11032  *
11033  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11034  * configuration.  Each pin widget can choose any input DACs and a mixer.
11035  * Each ADC is connected from a mixer of all inputs.  This makes possible
11036  * 6-channel independent captures.
11037  *
11038  * In addition, an independent DAC for the multi-playback (not used in this
11039  * driver yet).
11040  */
11041 
11042 /*
11043  * BIOS auto configuration
11044  */
11045 
11046 static int alc662_parse_auto_config(struct hda_codec *codec)
11047 {
11048 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
11049 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11050 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11051 	const hda_nid_t *ssids;
11052 
11053 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11054 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11055 	    codec->core.vendor_id == 0x10ec0671)
11056 		ssids = alc663_ssids;
11057 	else
11058 		ssids = alc662_ssids;
11059 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
11060 }
11061 
11062 static void alc272_fixup_mario(struct hda_codec *codec,
11063 			       const struct hda_fixup *fix, int action)
11064 {
11065 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
11066 		return;
11067 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11068 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11069 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11070 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11071 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
11072 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
11073 }
11074 
11075 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11076 	{ .channels = 2,
11077 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11078 	{ .channels = 4,
11079 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11080 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11081 	{ }
11082 };
11083 
11084 /* override the 2.1 chmap */
11085 static void alc_fixup_bass_chmap(struct hda_codec *codec,
11086 				    const struct hda_fixup *fix, int action)
11087 {
11088 	if (action == HDA_FIXUP_ACT_BUILD) {
11089 		struct alc_spec *spec = codec->spec;
11090 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
11091 	}
11092 }
11093 
11094 /* avoid D3 for keeping GPIO up */
11095 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11096 					  hda_nid_t nid,
11097 					  unsigned int power_state)
11098 {
11099 	struct alc_spec *spec = codec->spec;
11100 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
11101 		return AC_PWRST_D0;
11102 	return power_state;
11103 }
11104 
11105 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11106 				   const struct hda_fixup *fix, int action)
11107 {
11108 	struct alc_spec *spec = codec->spec;
11109 
11110 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
11111 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11112 		spec->mute_led_polarity = 1;
11113 		codec->power_filter = gpio_led_power_filter;
11114 	}
11115 }
11116 
11117 static void alc662_usi_automute_hook(struct hda_codec *codec,
11118 					 struct hda_jack_callback *jack)
11119 {
11120 	struct alc_spec *spec = codec->spec;
11121 	int vref;
11122 	msleep(200);
11123 	snd_hda_gen_hp_automute(codec, jack);
11124 
11125 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11126 	msleep(100);
11127 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11128 			    vref);
11129 }
11130 
11131 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11132 				     const struct hda_fixup *fix, int action)
11133 {
11134 	struct alc_spec *spec = codec->spec;
11135 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11136 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11137 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11138 	}
11139 }
11140 
11141 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11142 					struct hda_jack_callback *cb)
11143 {
11144 	/* surround speakers at 0x1b already get muted automatically when
11145 	 * headphones are plugged in, but we have to mute/unmute the remaining
11146 	 * channels manually:
11147 	 * 0x15 - front left/front right
11148 	 * 0x18 - front center/ LFE
11149 	 */
11150 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11151 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11152 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11153 	} else {
11154 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11155 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11156 	}
11157 }
11158 
11159 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11160 					const struct hda_fixup *fix, int action)
11161 {
11162     /* Pin 0x1b: shared headphones jack and surround speakers */
11163 	if (!is_jack_detectable(codec, 0x1b))
11164 		return;
11165 
11166 	switch (action) {
11167 	case HDA_FIXUP_ACT_PRE_PROBE:
11168 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
11169 				alc662_aspire_ethos_mute_speakers);
11170 		/* subwoofer needs an extra GPIO setting to become audible */
11171 		alc_setup_gpio(codec, 0x02);
11172 		break;
11173 	case HDA_FIXUP_ACT_INIT:
11174 		/* Make sure to start in a correct state, i.e. if
11175 		 * headphones have been plugged in before powering up the system
11176 		 */
11177 		alc662_aspire_ethos_mute_speakers(codec, NULL);
11178 		break;
11179 	}
11180 }
11181 
11182 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11183 					     const struct hda_fixup *fix, int action)
11184 {
11185 	struct alc_spec *spec = codec->spec;
11186 
11187 	static const struct hda_pintbl pincfgs[] = {
11188 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11189 		{ 0x1b, 0x0181304f },
11190 		{ }
11191 	};
11192 
11193 	switch (action) {
11194 	case HDA_FIXUP_ACT_PRE_PROBE:
11195 		spec->gen.mixer_nid = 0;
11196 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11197 		snd_hda_apply_pincfgs(codec, pincfgs);
11198 		break;
11199 	case HDA_FIXUP_ACT_INIT:
11200 		alc_write_coef_idx(codec, 0x19, 0xa054);
11201 		break;
11202 	}
11203 }
11204 
11205 static void alc897_hp_automute_hook(struct hda_codec *codec,
11206 					 struct hda_jack_callback *jack)
11207 {
11208 	struct alc_spec *spec = codec->spec;
11209 	int vref;
11210 
11211 	snd_hda_gen_hp_automute(codec, jack);
11212 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11213 	snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11214 			    vref);
11215 }
11216 
11217 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11218 				     const struct hda_fixup *fix, int action)
11219 {
11220 	struct alc_spec *spec = codec->spec;
11221 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11222 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11223 	}
11224 }
11225 
11226 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11227 				     const struct hda_fixup *fix, int action)
11228 {
11229 	struct alc_spec *spec = codec->spec;
11230 
11231 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11232 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11233 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11234 	}
11235 }
11236 
11237 static const struct coef_fw alc668_coefs[] = {
11238 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
11239 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
11240 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
11241 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11242 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11243 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11244 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
11245 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
11246 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11247 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11248 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11249 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11250 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
11251 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11252 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
11253 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
11254 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11255 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11256 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11257 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11258 	{}
11259 };
11260 
11261 static void alc668_restore_default_value(struct hda_codec *codec)
11262 {
11263 	alc_process_coef_fw(codec, alc668_coefs);
11264 }
11265 
11266 enum {
11267 	ALC662_FIXUP_ASPIRE,
11268 	ALC662_FIXUP_LED_GPIO1,
11269 	ALC662_FIXUP_IDEAPAD,
11270 	ALC272_FIXUP_MARIO,
11271 	ALC662_FIXUP_CZC_ET26,
11272 	ALC662_FIXUP_CZC_P10T,
11273 	ALC662_FIXUP_SKU_IGNORE,
11274 	ALC662_FIXUP_HP_RP5800,
11275 	ALC662_FIXUP_ASUS_MODE1,
11276 	ALC662_FIXUP_ASUS_MODE2,
11277 	ALC662_FIXUP_ASUS_MODE3,
11278 	ALC662_FIXUP_ASUS_MODE4,
11279 	ALC662_FIXUP_ASUS_MODE5,
11280 	ALC662_FIXUP_ASUS_MODE6,
11281 	ALC662_FIXUP_ASUS_MODE7,
11282 	ALC662_FIXUP_ASUS_MODE8,
11283 	ALC662_FIXUP_NO_JACK_DETECT,
11284 	ALC662_FIXUP_ZOTAC_Z68,
11285 	ALC662_FIXUP_INV_DMIC,
11286 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11287 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
11288 	ALC662_FIXUP_HEADSET_MODE,
11289 	ALC668_FIXUP_HEADSET_MODE,
11290 	ALC662_FIXUP_BASS_MODE4_CHMAP,
11291 	ALC662_FIXUP_BASS_16,
11292 	ALC662_FIXUP_BASS_1A,
11293 	ALC662_FIXUP_BASS_CHMAP,
11294 	ALC668_FIXUP_AUTO_MUTE,
11295 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
11296 	ALC668_FIXUP_DELL_XPS13,
11297 	ALC662_FIXUP_ASUS_Nx50,
11298 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11299 	ALC668_FIXUP_ASUS_Nx51,
11300 	ALC668_FIXUP_MIC_COEF,
11301 	ALC668_FIXUP_ASUS_G751,
11302 	ALC891_FIXUP_HEADSET_MODE,
11303 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11304 	ALC662_FIXUP_ACER_VERITON,
11305 	ALC892_FIXUP_ASROCK_MOBO,
11306 	ALC662_FIXUP_USI_FUNC,
11307 	ALC662_FIXUP_USI_HEADSET_MODE,
11308 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
11309 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
11310 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
11311 	ALC671_FIXUP_HP_HEADSET_MIC2,
11312 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
11313 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
11314 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11315 	ALC668_FIXUP_HEADSET_MIC,
11316 	ALC668_FIXUP_MIC_DET_COEF,
11317 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
11318 	ALC897_FIXUP_HEADSET_MIC_PIN,
11319 	ALC897_FIXUP_HP_HSMIC_VERB,
11320 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
11321 	ALC897_FIXUP_HEADSET_MIC_PIN2,
11322 	ALC897_FIXUP_UNIS_H3C_X500S,
11323 };
11324 
11325 static const struct hda_fixup alc662_fixups[] = {
11326 	[ALC662_FIXUP_ASPIRE] = {
11327 		.type = HDA_FIXUP_PINS,
11328 		.v.pins = (const struct hda_pintbl[]) {
11329 			{ 0x15, 0x99130112 }, /* subwoofer */
11330 			{ }
11331 		}
11332 	},
11333 	[ALC662_FIXUP_LED_GPIO1] = {
11334 		.type = HDA_FIXUP_FUNC,
11335 		.v.func = alc662_fixup_led_gpio1,
11336 	},
11337 	[ALC662_FIXUP_IDEAPAD] = {
11338 		.type = HDA_FIXUP_PINS,
11339 		.v.pins = (const struct hda_pintbl[]) {
11340 			{ 0x17, 0x99130112 }, /* subwoofer */
11341 			{ }
11342 		},
11343 		.chained = true,
11344 		.chain_id = ALC662_FIXUP_LED_GPIO1,
11345 	},
11346 	[ALC272_FIXUP_MARIO] = {
11347 		.type = HDA_FIXUP_FUNC,
11348 		.v.func = alc272_fixup_mario,
11349 	},
11350 	[ALC662_FIXUP_CZC_ET26] = {
11351 		.type = HDA_FIXUP_PINS,
11352 		.v.pins = (const struct hda_pintbl[]) {
11353 			{0x12, 0x403cc000},
11354 			{0x14, 0x90170110}, /* speaker */
11355 			{0x15, 0x411111f0},
11356 			{0x16, 0x411111f0},
11357 			{0x18, 0x01a19030}, /* mic */
11358 			{0x19, 0x90a7013f}, /* int-mic */
11359 			{0x1a, 0x01014020},
11360 			{0x1b, 0x0121401f},
11361 			{0x1c, 0x411111f0},
11362 			{0x1d, 0x411111f0},
11363 			{0x1e, 0x40478e35},
11364 			{}
11365 		},
11366 		.chained = true,
11367 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11368 	},
11369 	[ALC662_FIXUP_CZC_P10T] = {
11370 		.type = HDA_FIXUP_VERBS,
11371 		.v.verbs = (const struct hda_verb[]) {
11372 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11373 			{}
11374 		}
11375 	},
11376 	[ALC662_FIXUP_SKU_IGNORE] = {
11377 		.type = HDA_FIXUP_FUNC,
11378 		.v.func = alc_fixup_sku_ignore,
11379 	},
11380 	[ALC662_FIXUP_HP_RP5800] = {
11381 		.type = HDA_FIXUP_PINS,
11382 		.v.pins = (const struct hda_pintbl[]) {
11383 			{ 0x14, 0x0221201f }, /* HP out */
11384 			{ }
11385 		},
11386 		.chained = true,
11387 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11388 	},
11389 	[ALC662_FIXUP_ASUS_MODE1] = {
11390 		.type = HDA_FIXUP_PINS,
11391 		.v.pins = (const struct hda_pintbl[]) {
11392 			{ 0x14, 0x99130110 }, /* speaker */
11393 			{ 0x18, 0x01a19c20 }, /* mic */
11394 			{ 0x19, 0x99a3092f }, /* int-mic */
11395 			{ 0x21, 0x0121401f }, /* HP out */
11396 			{ }
11397 		},
11398 		.chained = true,
11399 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11400 	},
11401 	[ALC662_FIXUP_ASUS_MODE2] = {
11402 		.type = HDA_FIXUP_PINS,
11403 		.v.pins = (const struct hda_pintbl[]) {
11404 			{ 0x14, 0x99130110 }, /* speaker */
11405 			{ 0x18, 0x01a19820 }, /* mic */
11406 			{ 0x19, 0x99a3092f }, /* int-mic */
11407 			{ 0x1b, 0x0121401f }, /* HP out */
11408 			{ }
11409 		},
11410 		.chained = true,
11411 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11412 	},
11413 	[ALC662_FIXUP_ASUS_MODE3] = {
11414 		.type = HDA_FIXUP_PINS,
11415 		.v.pins = (const struct hda_pintbl[]) {
11416 			{ 0x14, 0x99130110 }, /* speaker */
11417 			{ 0x15, 0x0121441f }, /* HP */
11418 			{ 0x18, 0x01a19840 }, /* mic */
11419 			{ 0x19, 0x99a3094f }, /* int-mic */
11420 			{ 0x21, 0x01211420 }, /* HP2 */
11421 			{ }
11422 		},
11423 		.chained = true,
11424 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11425 	},
11426 	[ALC662_FIXUP_ASUS_MODE4] = {
11427 		.type = HDA_FIXUP_PINS,
11428 		.v.pins = (const struct hda_pintbl[]) {
11429 			{ 0x14, 0x99130110 }, /* speaker */
11430 			{ 0x16, 0x99130111 }, /* speaker */
11431 			{ 0x18, 0x01a19840 }, /* mic */
11432 			{ 0x19, 0x99a3094f }, /* int-mic */
11433 			{ 0x21, 0x0121441f }, /* HP */
11434 			{ }
11435 		},
11436 		.chained = true,
11437 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11438 	},
11439 	[ALC662_FIXUP_ASUS_MODE5] = {
11440 		.type = HDA_FIXUP_PINS,
11441 		.v.pins = (const struct hda_pintbl[]) {
11442 			{ 0x14, 0x99130110 }, /* speaker */
11443 			{ 0x15, 0x0121441f }, /* HP */
11444 			{ 0x16, 0x99130111 }, /* speaker */
11445 			{ 0x18, 0x01a19840 }, /* mic */
11446 			{ 0x19, 0x99a3094f }, /* int-mic */
11447 			{ }
11448 		},
11449 		.chained = true,
11450 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11451 	},
11452 	[ALC662_FIXUP_ASUS_MODE6] = {
11453 		.type = HDA_FIXUP_PINS,
11454 		.v.pins = (const struct hda_pintbl[]) {
11455 			{ 0x14, 0x99130110 }, /* speaker */
11456 			{ 0x15, 0x01211420 }, /* HP2 */
11457 			{ 0x18, 0x01a19840 }, /* mic */
11458 			{ 0x19, 0x99a3094f }, /* int-mic */
11459 			{ 0x1b, 0x0121441f }, /* HP */
11460 			{ }
11461 		},
11462 		.chained = true,
11463 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11464 	},
11465 	[ALC662_FIXUP_ASUS_MODE7] = {
11466 		.type = HDA_FIXUP_PINS,
11467 		.v.pins = (const struct hda_pintbl[]) {
11468 			{ 0x14, 0x99130110 }, /* speaker */
11469 			{ 0x17, 0x99130111 }, /* speaker */
11470 			{ 0x18, 0x01a19840 }, /* mic */
11471 			{ 0x19, 0x99a3094f }, /* int-mic */
11472 			{ 0x1b, 0x01214020 }, /* HP */
11473 			{ 0x21, 0x0121401f }, /* HP */
11474 			{ }
11475 		},
11476 		.chained = true,
11477 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11478 	},
11479 	[ALC662_FIXUP_ASUS_MODE8] = {
11480 		.type = HDA_FIXUP_PINS,
11481 		.v.pins = (const struct hda_pintbl[]) {
11482 			{ 0x14, 0x99130110 }, /* speaker */
11483 			{ 0x12, 0x99a30970 }, /* int-mic */
11484 			{ 0x15, 0x01214020 }, /* HP */
11485 			{ 0x17, 0x99130111 }, /* speaker */
11486 			{ 0x18, 0x01a19840 }, /* mic */
11487 			{ 0x21, 0x0121401f }, /* HP */
11488 			{ }
11489 		},
11490 		.chained = true,
11491 		.chain_id = ALC662_FIXUP_SKU_IGNORE
11492 	},
11493 	[ALC662_FIXUP_NO_JACK_DETECT] = {
11494 		.type = HDA_FIXUP_FUNC,
11495 		.v.func = alc_fixup_no_jack_detect,
11496 	},
11497 	[ALC662_FIXUP_ZOTAC_Z68] = {
11498 		.type = HDA_FIXUP_PINS,
11499 		.v.pins = (const struct hda_pintbl[]) {
11500 			{ 0x1b, 0x02214020 }, /* Front HP */
11501 			{ }
11502 		}
11503 	},
11504 	[ALC662_FIXUP_INV_DMIC] = {
11505 		.type = HDA_FIXUP_FUNC,
11506 		.v.func = alc_fixup_inv_dmic,
11507 	},
11508 	[ALC668_FIXUP_DELL_XPS13] = {
11509 		.type = HDA_FIXUP_FUNC,
11510 		.v.func = alc_fixup_dell_xps13,
11511 		.chained = true,
11512 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11513 	},
11514 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11515 		.type = HDA_FIXUP_FUNC,
11516 		.v.func = alc_fixup_disable_aamix,
11517 		.chained = true,
11518 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11519 	},
11520 	[ALC668_FIXUP_AUTO_MUTE] = {
11521 		.type = HDA_FIXUP_FUNC,
11522 		.v.func = alc_fixup_auto_mute_via_amp,
11523 		.chained = true,
11524 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11525 	},
11526 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11527 		.type = HDA_FIXUP_PINS,
11528 		.v.pins = (const struct hda_pintbl[]) {
11529 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11530 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
11531 			{ }
11532 		},
11533 		.chained = true,
11534 		.chain_id = ALC662_FIXUP_HEADSET_MODE
11535 	},
11536 	[ALC662_FIXUP_HEADSET_MODE] = {
11537 		.type = HDA_FIXUP_FUNC,
11538 		.v.func = alc_fixup_headset_mode_alc662,
11539 	},
11540 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
11541 		.type = HDA_FIXUP_PINS,
11542 		.v.pins = (const struct hda_pintbl[]) {
11543 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11544 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11545 			{ }
11546 		},
11547 		.chained = true,
11548 		.chain_id = ALC668_FIXUP_HEADSET_MODE
11549 	},
11550 	[ALC668_FIXUP_HEADSET_MODE] = {
11551 		.type = HDA_FIXUP_FUNC,
11552 		.v.func = alc_fixup_headset_mode_alc668,
11553 	},
11554 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
11555 		.type = HDA_FIXUP_FUNC,
11556 		.v.func = alc_fixup_bass_chmap,
11557 		.chained = true,
11558 		.chain_id = ALC662_FIXUP_ASUS_MODE4
11559 	},
11560 	[ALC662_FIXUP_BASS_16] = {
11561 		.type = HDA_FIXUP_PINS,
11562 		.v.pins = (const struct hda_pintbl[]) {
11563 			{0x16, 0x80106111}, /* bass speaker */
11564 			{}
11565 		},
11566 		.chained = true,
11567 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
11568 	},
11569 	[ALC662_FIXUP_BASS_1A] = {
11570 		.type = HDA_FIXUP_PINS,
11571 		.v.pins = (const struct hda_pintbl[]) {
11572 			{0x1a, 0x80106111}, /* bass speaker */
11573 			{}
11574 		},
11575 		.chained = true,
11576 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
11577 	},
11578 	[ALC662_FIXUP_BASS_CHMAP] = {
11579 		.type = HDA_FIXUP_FUNC,
11580 		.v.func = alc_fixup_bass_chmap,
11581 	},
11582 	[ALC662_FIXUP_ASUS_Nx50] = {
11583 		.type = HDA_FIXUP_FUNC,
11584 		.v.func = alc_fixup_auto_mute_via_amp,
11585 		.chained = true,
11586 		.chain_id = ALC662_FIXUP_BASS_1A
11587 	},
11588 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
11589 		.type = HDA_FIXUP_FUNC,
11590 		.v.func = alc_fixup_headset_mode_alc668,
11591 		.chain_id = ALC662_FIXUP_BASS_CHMAP
11592 	},
11593 	[ALC668_FIXUP_ASUS_Nx51] = {
11594 		.type = HDA_FIXUP_PINS,
11595 		.v.pins = (const struct hda_pintbl[]) {
11596 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11597 			{ 0x1a, 0x90170151 }, /* bass speaker */
11598 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11599 			{}
11600 		},
11601 		.chained = true,
11602 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11603 	},
11604 	[ALC668_FIXUP_MIC_COEF] = {
11605 		.type = HDA_FIXUP_VERBS,
11606 		.v.verbs = (const struct hda_verb[]) {
11607 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11608 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11609 			{}
11610 		},
11611 	},
11612 	[ALC668_FIXUP_ASUS_G751] = {
11613 		.type = HDA_FIXUP_PINS,
11614 		.v.pins = (const struct hda_pintbl[]) {
11615 			{ 0x16, 0x0421101f }, /* HP */
11616 			{}
11617 		},
11618 		.chained = true,
11619 		.chain_id = ALC668_FIXUP_MIC_COEF
11620 	},
11621 	[ALC891_FIXUP_HEADSET_MODE] = {
11622 		.type = HDA_FIXUP_FUNC,
11623 		.v.func = alc_fixup_headset_mode,
11624 	},
11625 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11626 		.type = HDA_FIXUP_PINS,
11627 		.v.pins = (const struct hda_pintbl[]) {
11628 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11629 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11630 			{ }
11631 		},
11632 		.chained = true,
11633 		.chain_id = ALC891_FIXUP_HEADSET_MODE
11634 	},
11635 	[ALC662_FIXUP_ACER_VERITON] = {
11636 		.type = HDA_FIXUP_PINS,
11637 		.v.pins = (const struct hda_pintbl[]) {
11638 			{ 0x15, 0x50170120 }, /* no internal speaker */
11639 			{ }
11640 		}
11641 	},
11642 	[ALC892_FIXUP_ASROCK_MOBO] = {
11643 		.type = HDA_FIXUP_PINS,
11644 		.v.pins = (const struct hda_pintbl[]) {
11645 			{ 0x15, 0x40f000f0 }, /* disabled */
11646 			{ 0x16, 0x40f000f0 }, /* disabled */
11647 			{ }
11648 		}
11649 	},
11650 	[ALC662_FIXUP_USI_FUNC] = {
11651 		.type = HDA_FIXUP_FUNC,
11652 		.v.func = alc662_fixup_usi_headset_mic,
11653 	},
11654 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
11655 		.type = HDA_FIXUP_PINS,
11656 		.v.pins = (const struct hda_pintbl[]) {
11657 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11658 			{ 0x18, 0x01a1903d },
11659 			{ }
11660 		},
11661 		.chained = true,
11662 		.chain_id = ALC662_FIXUP_USI_FUNC
11663 	},
11664 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11665 		.type = HDA_FIXUP_FUNC,
11666 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11667 	},
11668 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11669 		.type = HDA_FIXUP_FUNC,
11670 		.v.func = alc662_fixup_aspire_ethos_hp,
11671 	},
11672 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11673 		.type = HDA_FIXUP_PINS,
11674 		.v.pins = (const struct hda_pintbl[]) {
11675 			{ 0x15, 0x92130110 }, /* front speakers */
11676 			{ 0x18, 0x99130111 }, /* center/subwoofer */
11677 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
11678 			{ }
11679 		},
11680 		.chained = true,
11681 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
11682 	},
11683 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
11684 		.type = HDA_FIXUP_FUNC,
11685 		.v.func = alc671_fixup_hp_headset_mic2,
11686 	},
11687 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11688 		.type = HDA_FIXUP_PINS,
11689 		.v.pins = (const struct hda_pintbl[]) {
11690 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11691 			{ }
11692 		},
11693 		.chained = true,
11694 		.chain_id = ALC662_FIXUP_USI_FUNC
11695 	},
11696 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11697 		.type = HDA_FIXUP_PINS,
11698 		.v.pins = (const struct hda_pintbl[]) {
11699 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11700 			{ 0x1b, 0x0221144f },
11701 			{ }
11702 		},
11703 		.chained = true,
11704 		.chain_id = ALC662_FIXUP_USI_FUNC
11705 	},
11706 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11707 		.type = HDA_FIXUP_PINS,
11708 		.v.pins = (const struct hda_pintbl[]) {
11709 			{ 0x1b, 0x04a1112c },
11710 			{ }
11711 		},
11712 		.chained = true,
11713 		.chain_id = ALC668_FIXUP_HEADSET_MIC
11714 	},
11715 	[ALC668_FIXUP_HEADSET_MIC] = {
11716 		.type = HDA_FIXUP_FUNC,
11717 		.v.func = alc269_fixup_headset_mic,
11718 		.chained = true,
11719 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
11720 	},
11721 	[ALC668_FIXUP_MIC_DET_COEF] = {
11722 		.type = HDA_FIXUP_VERBS,
11723 		.v.verbs = (const struct hda_verb[]) {
11724 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11725 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11726 			{}
11727 		},
11728 	},
11729 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11730 		.type = HDA_FIXUP_FUNC,
11731 		.v.func = alc897_fixup_lenovo_headset_mic,
11732 	},
11733 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
11734 		.type = HDA_FIXUP_PINS,
11735 		.v.pins = (const struct hda_pintbl[]) {
11736 			{ 0x1a, 0x03a11050 },
11737 			{ }
11738 		},
11739 		.chained = true,
11740 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11741 	},
11742 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
11743 		.type = HDA_FIXUP_PINS,
11744 		.v.pins = (const struct hda_pintbl[]) {
11745 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11746 			{ }
11747 		},
11748 	},
11749 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
11750 		.type = HDA_FIXUP_FUNC,
11751 		.v.func = alc897_fixup_lenovo_headset_mode,
11752 	},
11753 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
11754 		.type = HDA_FIXUP_PINS,
11755 		.v.pins = (const struct hda_pintbl[]) {
11756 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11757 			{ }
11758 		},
11759 		.chained = true,
11760 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
11761 	},
11762 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
11763 		.type = HDA_FIXUP_VERBS,
11764 		.v.verbs = (const struct hda_verb[]) {
11765 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
11766 			{}
11767 		},
11768 	},
11769 };
11770 
11771 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
11772 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
11773 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
11774 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
11775 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
11776 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
11777 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11778 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11779 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11780 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11781 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11782 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11783 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11784 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11785 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11786 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11787 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11788 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11789 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11790 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11791 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11792 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11793 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11794 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11795 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11796 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11797 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11798 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
11799 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
11800 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
11801 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11802 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11803 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11804 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11805 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11806 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11807 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11808 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11809 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11810 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11811 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11812 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11813 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11814 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11815 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11816 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11817 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11818 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11819 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
11820 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
11821 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11822 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11823 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11824 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11825 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
11826 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
11827 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
11828 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11829 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11830 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11831 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11832 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11833 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11834 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11835 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
11836 
11837 #if 0
11838 	/* Below is a quirk table taken from the old code.
11839 	 * Basically the device should work as is without the fixup table.
11840 	 * If BIOS doesn't give a proper info, enable the corresponding
11841 	 * fixup entry.
11842 	 */
11843 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11844 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11845 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11846 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11847 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11848 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11849 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11850 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11851 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11852 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11853 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11854 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11855 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11856 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11857 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11858 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11859 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11860 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11861 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11862 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11863 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11864 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11865 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11866 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11867 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11868 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11869 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11870 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11871 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11872 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11873 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11874 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11875 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11876 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11877 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11878 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11879 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11880 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11881 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11882 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11883 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11884 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11885 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11886 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11887 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11888 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11889 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11890 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11891 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11892 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11893 #endif
11894 	{}
11895 };
11896 
11897 static const struct hda_model_fixup alc662_fixup_models[] = {
11898 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11899 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11900 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
11901 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11902 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11903 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11904 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11905 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11906 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11907 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11908 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11909 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11910 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11911 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11912 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11913 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11914 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11915 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11916 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11917 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11918 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11919 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11920 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11921 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11922 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11923 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11924 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11925 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11926 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11927 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11928 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11929 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11930 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
11931 	{}
11932 };
11933 
11934 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11935 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11936 		{0x17, 0x02211010},
11937 		{0x18, 0x01a19030},
11938 		{0x1a, 0x01813040},
11939 		{0x21, 0x01014020}),
11940 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11941 		{0x16, 0x01813030},
11942 		{0x17, 0x02211010},
11943 		{0x18, 0x01a19040},
11944 		{0x21, 0x01014020}),
11945 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11946 		{0x14, 0x01014010},
11947 		{0x18, 0x01a19020},
11948 		{0x1a, 0x0181302f},
11949 		{0x1b, 0x0221401f}),
11950 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11951 		{0x12, 0x99a30130},
11952 		{0x14, 0x90170110},
11953 		{0x15, 0x0321101f},
11954 		{0x16, 0x03011020}),
11955 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11956 		{0x12, 0x99a30140},
11957 		{0x14, 0x90170110},
11958 		{0x15, 0x0321101f},
11959 		{0x16, 0x03011020}),
11960 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11961 		{0x12, 0x99a30150},
11962 		{0x14, 0x90170110},
11963 		{0x15, 0x0321101f},
11964 		{0x16, 0x03011020}),
11965 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11966 		{0x14, 0x90170110},
11967 		{0x15, 0x0321101f},
11968 		{0x16, 0x03011020}),
11969 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11970 		{0x12, 0x90a60130},
11971 		{0x14, 0x90170110},
11972 		{0x15, 0x0321101f}),
11973 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11974 		{0x14, 0x01014010},
11975 		{0x17, 0x90170150},
11976 		{0x19, 0x02a11060},
11977 		{0x1b, 0x01813030},
11978 		{0x21, 0x02211020}),
11979 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11980 		{0x14, 0x01014010},
11981 		{0x18, 0x01a19040},
11982 		{0x1b, 0x01813030},
11983 		{0x21, 0x02211020}),
11984 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11985 		{0x14, 0x01014020},
11986 		{0x17, 0x90170110},
11987 		{0x18, 0x01a19050},
11988 		{0x1b, 0x01813040},
11989 		{0x21, 0x02211030}),
11990 	{}
11991 };
11992 
11993 /*
11994  */
11995 static int patch_alc662(struct hda_codec *codec)
11996 {
11997 	struct alc_spec *spec;
11998 	int err;
11999 
12000 	err = alc_alloc_spec(codec, 0x0b);
12001 	if (err < 0)
12002 		return err;
12003 
12004 	spec = codec->spec;
12005 
12006 	spec->shutup = alc_eapd_shutup;
12007 
12008 	/* handle multiple HPs as is */
12009 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12010 
12011 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
12012 
12013 	switch (codec->core.vendor_id) {
12014 	case 0x10ec0668:
12015 		spec->init_hook = alc668_restore_default_value;
12016 		break;
12017 	}
12018 
12019 	alc_pre_init(codec);
12020 
12021 	snd_hda_pick_fixup(codec, alc662_fixup_models,
12022 		       alc662_fixup_tbl, alc662_fixups);
12023 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
12024 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12025 
12026 	alc_auto_parse_customize_define(codec);
12027 
12028 	if (has_cdefine_beep(codec))
12029 		spec->gen.beep_nid = 0x01;
12030 
12031 	if ((alc_get_coef0(codec) & (1 << 14)) &&
12032 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
12033 	    spec->cdefine.platform_type == 1) {
12034 		err = alc_codec_rename(codec, "ALC272X");
12035 		if (err < 0)
12036 			goto error;
12037 	}
12038 
12039 	/* automatic parse from the BIOS config */
12040 	err = alc662_parse_auto_config(codec);
12041 	if (err < 0)
12042 		goto error;
12043 
12044 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
12045 		switch (codec->core.vendor_id) {
12046 		case 0x10ec0662:
12047 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12048 			break;
12049 		case 0x10ec0272:
12050 		case 0x10ec0663:
12051 		case 0x10ec0665:
12052 		case 0x10ec0668:
12053 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
12054 			break;
12055 		case 0x10ec0273:
12056 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
12057 			break;
12058 		}
12059 		if (err < 0)
12060 			goto error;
12061 	}
12062 
12063 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12064 
12065 	return 0;
12066 
12067  error:
12068 	alc_free(codec);
12069 	return err;
12070 }
12071 
12072 /*
12073  * ALC680 support
12074  */
12075 
12076 static int alc680_parse_auto_config(struct hda_codec *codec)
12077 {
12078 	return alc_parse_auto_config(codec, NULL, NULL);
12079 }
12080 
12081 /*
12082  */
12083 static int patch_alc680(struct hda_codec *codec)
12084 {
12085 	int err;
12086 
12087 	/* ALC680 has no aa-loopback mixer */
12088 	err = alc_alloc_spec(codec, 0);
12089 	if (err < 0)
12090 		return err;
12091 
12092 	/* automatic parse from the BIOS config */
12093 	err = alc680_parse_auto_config(codec);
12094 	if (err < 0) {
12095 		alc_free(codec);
12096 		return err;
12097 	}
12098 
12099 	return 0;
12100 }
12101 
12102 /*
12103  * patch entries
12104  */
12105 static const struct hda_device_id snd_hda_id_realtek[] = {
12106 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
12107 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
12108 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
12109 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
12110 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
12111 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12112 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
12113 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
12114 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
12115 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
12116 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
12117 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12118 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
12119 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
12120 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12121 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12122 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12123 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12124 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12125 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12126 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
12127 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
12128 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12129 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12130 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12131 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12132 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12133 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
12134 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
12135 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
12136 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
12137 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
12138 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
12139 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12140 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12141 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
12142 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
12143 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
12144 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
12145 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
12146 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
12147 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
12148 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12149 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12150 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12151 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12152 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12153 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12154 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12155 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12156 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12157 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12158 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12159 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12160 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12161 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
12162 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12163 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12164 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
12165 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
12166 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
12167 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12168 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12169 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12170 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12171 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12172 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12173 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12174 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12175 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12176 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12177 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
12178 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
12179 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12180 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
12181 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
12182 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
12183 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
12184 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
12185 	{} /* terminator */
12186 };
12187 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
12188 
12189 MODULE_LICENSE("GPL");
12190 MODULE_DESCRIPTION("Realtek HD-audio codec");
12191 
12192 static struct hda_codec_driver realtek_driver = {
12193 	.id = snd_hda_id_realtek,
12194 };
12195 
12196 module_hda_codec_driver(realtek_driver);
12197