xref: /linux-6.15/sound/pci/hda/patch_realtek.c (revision e3fc2fd7)
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 <[email protected]>
8  *                    PeiSen Hou <[email protected]>
9  *                    Takashi Iwai <[email protected]>
10  *                    Jonathan Woithe <[email protected]>
11  */
12 
13 #include <linux/acpi.h>
14 #include <linux/cleanup.h>
15 #include <linux/init.h>
16 #include <linux/delay.h>
17 #include <linux/slab.h>
18 #include <linux/pci.h>
19 #include <linux/dmi.h>
20 #include <linux/module.h>
21 #include <linux/i2c.h>
22 #include <linux/input.h>
23 #include <linux/leds.h>
24 #include <linux/ctype.h>
25 #include <linux/spi/spi.h>
26 #include <sound/core.h>
27 #include <sound/jack.h>
28 #include <sound/hda_codec.h>
29 #include "hda_local.h"
30 #include "hda_auto_parser.h"
31 #include "hda_jack.h"
32 #include "hda_generic.h"
33 #include "hda_component.h"
34 
35 /* keep halting ALC5505 DSP, for power saving */
36 #define HALT_REALTEK_ALC5505
37 
38 /* extra amp-initialization sequence types */
39 enum {
40 	ALC_INIT_UNDEFINED,
41 	ALC_INIT_NONE,
42 	ALC_INIT_DEFAULT,
43 };
44 
45 enum {
46 	ALC_HEADSET_MODE_UNKNOWN,
47 	ALC_HEADSET_MODE_UNPLUGGED,
48 	ALC_HEADSET_MODE_HEADSET,
49 	ALC_HEADSET_MODE_MIC,
50 	ALC_HEADSET_MODE_HEADPHONE,
51 };
52 
53 enum {
54 	ALC_HEADSET_TYPE_UNKNOWN,
55 	ALC_HEADSET_TYPE_CTIA,
56 	ALC_HEADSET_TYPE_OMTP,
57 };
58 
59 enum {
60 	ALC_KEY_MICMUTE_INDEX,
61 };
62 
63 struct alc_customize_define {
64 	unsigned int  sku_cfg;
65 	unsigned char port_connectivity;
66 	unsigned char check_sum;
67 	unsigned char customization;
68 	unsigned char external_amp;
69 	unsigned int  enable_pcbeep:1;
70 	unsigned int  platform_type:1;
71 	unsigned int  swap:1;
72 	unsigned int  override:1;
73 	unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
74 };
75 
76 struct alc_coef_led {
77 	unsigned int idx;
78 	unsigned int mask;
79 	unsigned int on;
80 	unsigned int off;
81 };
82 
83 struct alc_spec {
84 	struct hda_gen_spec gen; /* must be at head */
85 
86 	/* codec parameterization */
87 	struct alc_customize_define cdefine;
88 	unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
89 
90 	/* GPIO bits */
91 	unsigned int gpio_mask;
92 	unsigned int gpio_dir;
93 	unsigned int gpio_data;
94 	bool gpio_write_delay;	/* add a delay before writing gpio_data */
95 
96 	/* mute LED for HP laptops, see vref_mute_led_set() */
97 	int mute_led_polarity;
98 	int micmute_led_polarity;
99 	hda_nid_t mute_led_nid;
100 	hda_nid_t cap_mute_led_nid;
101 
102 	unsigned int gpio_mute_led_mask;
103 	unsigned int gpio_mic_led_mask;
104 	struct alc_coef_led mute_led_coef;
105 	struct alc_coef_led mic_led_coef;
106 	struct mutex coef_mutex;
107 
108 	hda_nid_t headset_mic_pin;
109 	hda_nid_t headphone_mic_pin;
110 	int current_headset_mode;
111 	int current_headset_type;
112 
113 	/* hooks */
114 	void (*init_hook)(struct hda_codec *codec);
115 	void (*power_hook)(struct hda_codec *codec);
116 	void (*shutup)(struct hda_codec *codec);
117 
118 	int init_amp;
119 	int codec_variant;	/* flag for other variants */
120 	unsigned int has_alc5505_dsp:1;
121 	unsigned int no_depop_delay:1;
122 	unsigned int done_hp_init:1;
123 	unsigned int no_shutup_pins:1;
124 	unsigned int ultra_low_power:1;
125 	unsigned int has_hs_key:1;
126 	unsigned int no_internal_mic_pin:1;
127 	unsigned int en_3kpull_low:1;
128 	int num_speaker_amps;
129 
130 	/* for PLL fix */
131 	hda_nid_t pll_nid;
132 	unsigned int pll_coef_idx, pll_coef_bit;
133 	unsigned int coef0;
134 	struct input_dev *kb_dev;
135 	u8 alc_mute_keycode_map[1];
136 
137 	/* component binding */
138 	struct hda_component_parent comps;
139 };
140 
141 /*
142  * COEF access helper functions
143  */
144 
145 static void coef_mutex_lock(struct hda_codec *codec)
146 {
147 	struct alc_spec *spec = codec->spec;
148 
149 	snd_hda_power_up_pm(codec);
150 	mutex_lock(&spec->coef_mutex);
151 }
152 
153 static void coef_mutex_unlock(struct hda_codec *codec)
154 {
155 	struct alc_spec *spec = codec->spec;
156 
157 	mutex_unlock(&spec->coef_mutex);
158 	snd_hda_power_down_pm(codec);
159 }
160 
161 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
162 				 unsigned int coef_idx)
163 {
164 	unsigned int val;
165 
166 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
167 	val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
168 	return val;
169 }
170 
171 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
172 			       unsigned int coef_idx)
173 {
174 	unsigned int val;
175 
176 	coef_mutex_lock(codec);
177 	val = __alc_read_coefex_idx(codec, nid, coef_idx);
178 	coef_mutex_unlock(codec);
179 	return val;
180 }
181 
182 #define alc_read_coef_idx(codec, coef_idx) \
183 	alc_read_coefex_idx(codec, 0x20, coef_idx)
184 
185 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
186 				   unsigned int coef_idx, unsigned int coef_val)
187 {
188 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
189 	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
190 }
191 
192 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
193 				 unsigned int coef_idx, unsigned int coef_val)
194 {
195 	coef_mutex_lock(codec);
196 	__alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
197 	coef_mutex_unlock(codec);
198 }
199 
200 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
201 	alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
202 
203 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
204 				    unsigned int coef_idx, unsigned int mask,
205 				    unsigned int bits_set)
206 {
207 	unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
208 
209 	if (val != -1)
210 		__alc_write_coefex_idx(codec, nid, coef_idx,
211 				       (val & ~mask) | bits_set);
212 }
213 
214 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
215 				  unsigned int coef_idx, unsigned int mask,
216 				  unsigned int bits_set)
217 {
218 	coef_mutex_lock(codec);
219 	__alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
220 	coef_mutex_unlock(codec);
221 }
222 
223 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set)	\
224 	alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
225 
226 /* a special bypass for COEF 0; read the cached value at the second time */
227 static unsigned int alc_get_coef0(struct hda_codec *codec)
228 {
229 	struct alc_spec *spec = codec->spec;
230 
231 	if (!spec->coef0)
232 		spec->coef0 = alc_read_coef_idx(codec, 0);
233 	return spec->coef0;
234 }
235 
236 /* coef writes/updates batch */
237 struct coef_fw {
238 	unsigned char nid;
239 	unsigned char idx;
240 	unsigned short mask;
241 	unsigned short val;
242 };
243 
244 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
245 	{ .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
246 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
247 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
248 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
249 
250 static void alc_process_coef_fw(struct hda_codec *codec,
251 				const struct coef_fw *fw)
252 {
253 	coef_mutex_lock(codec);
254 	for (; fw->nid; fw++) {
255 		if (fw->mask == (unsigned short)-1)
256 			__alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
257 		else
258 			__alc_update_coefex_idx(codec, fw->nid, fw->idx,
259 						fw->mask, fw->val);
260 	}
261 	coef_mutex_unlock(codec);
262 }
263 
264 /*
265  * GPIO setup tables, used in initialization
266  */
267 
268 /* Enable GPIO mask and set output */
269 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
270 {
271 	struct alc_spec *spec = codec->spec;
272 
273 	spec->gpio_mask |= mask;
274 	spec->gpio_dir |= mask;
275 	spec->gpio_data |= mask;
276 }
277 
278 static void alc_write_gpio_data(struct hda_codec *codec)
279 {
280 	struct alc_spec *spec = codec->spec;
281 
282 	snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
283 			    spec->gpio_data);
284 }
285 
286 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
287 				 bool on)
288 {
289 	struct alc_spec *spec = codec->spec;
290 	unsigned int oldval = spec->gpio_data;
291 
292 	if (on)
293 		spec->gpio_data |= mask;
294 	else
295 		spec->gpio_data &= ~mask;
296 	if (oldval != spec->gpio_data)
297 		alc_write_gpio_data(codec);
298 }
299 
300 static void alc_write_gpio(struct hda_codec *codec)
301 {
302 	struct alc_spec *spec = codec->spec;
303 
304 	if (!spec->gpio_mask)
305 		return;
306 
307 	snd_hda_codec_write(codec, codec->core.afg, 0,
308 			    AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
309 	snd_hda_codec_write(codec, codec->core.afg, 0,
310 			    AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
311 	if (spec->gpio_write_delay)
312 		msleep(1);
313 	alc_write_gpio_data(codec);
314 }
315 
316 static void alc_fixup_gpio(struct hda_codec *codec, int action,
317 			   unsigned int mask)
318 {
319 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
320 		alc_setup_gpio(codec, mask);
321 }
322 
323 static void alc_fixup_gpio1(struct hda_codec *codec,
324 			    const struct hda_fixup *fix, int action)
325 {
326 	alc_fixup_gpio(codec, action, 0x01);
327 }
328 
329 static void alc_fixup_gpio2(struct hda_codec *codec,
330 			    const struct hda_fixup *fix, int action)
331 {
332 	alc_fixup_gpio(codec, action, 0x02);
333 }
334 
335 static void alc_fixup_gpio3(struct hda_codec *codec,
336 			    const struct hda_fixup *fix, int action)
337 {
338 	alc_fixup_gpio(codec, action, 0x03);
339 }
340 
341 static void alc_fixup_gpio4(struct hda_codec *codec,
342 			    const struct hda_fixup *fix, int action)
343 {
344 	alc_fixup_gpio(codec, action, 0x04);
345 }
346 
347 static void alc_fixup_micmute_led(struct hda_codec *codec,
348 				  const struct hda_fixup *fix, int action)
349 {
350 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
351 		snd_hda_gen_add_micmute_led_cdev(codec, NULL);
352 }
353 
354 /*
355  * Fix hardware PLL issue
356  * On some codecs, the analog PLL gating control must be off while
357  * the default value is 1.
358  */
359 static void alc_fix_pll(struct hda_codec *codec)
360 {
361 	struct alc_spec *spec = codec->spec;
362 
363 	if (spec->pll_nid)
364 		alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
365 				      1 << spec->pll_coef_bit, 0);
366 }
367 
368 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
369 			     unsigned int coef_idx, unsigned int coef_bit)
370 {
371 	struct alc_spec *spec = codec->spec;
372 	spec->pll_nid = nid;
373 	spec->pll_coef_idx = coef_idx;
374 	spec->pll_coef_bit = coef_bit;
375 	alc_fix_pll(codec);
376 }
377 
378 /* update the master volume per volume-knob's unsol event */
379 static void alc_update_knob_master(struct hda_codec *codec,
380 				   struct hda_jack_callback *jack)
381 {
382 	unsigned int val;
383 	struct snd_kcontrol *kctl;
384 	struct snd_ctl_elem_value *uctl;
385 
386 	kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
387 	if (!kctl)
388 		return;
389 	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
390 	if (!uctl)
391 		return;
392 	val = snd_hda_codec_read(codec, jack->nid, 0,
393 				 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
394 	val &= HDA_AMP_VOLMASK;
395 	uctl->value.integer.value[0] = val;
396 	uctl->value.integer.value[1] = val;
397 	kctl->put(kctl, uctl);
398 	kfree(uctl);
399 }
400 
401 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
402 {
403 	/* For some reason, the res given from ALC880 is broken.
404 	   Here we adjust it properly. */
405 	snd_hda_jack_unsol_event(codec, res >> 2);
406 }
407 
408 /* Change EAPD to verb control */
409 static void alc_fill_eapd_coef(struct hda_codec *codec)
410 {
411 	int coef;
412 
413 	coef = alc_get_coef0(codec);
414 
415 	switch (codec->core.vendor_id) {
416 	case 0x10ec0262:
417 		alc_update_coef_idx(codec, 0x7, 0, 1<<5);
418 		break;
419 	case 0x10ec0267:
420 	case 0x10ec0268:
421 		alc_update_coef_idx(codec, 0x7, 0, 1<<13);
422 		break;
423 	case 0x10ec0269:
424 		if ((coef & 0x00f0) == 0x0010)
425 			alc_update_coef_idx(codec, 0xd, 0, 1<<14);
426 		if ((coef & 0x00f0) == 0x0020)
427 			alc_update_coef_idx(codec, 0x4, 1<<15, 0);
428 		if ((coef & 0x00f0) == 0x0030)
429 			alc_update_coef_idx(codec, 0x10, 1<<9, 0);
430 		break;
431 	case 0x10ec0280:
432 	case 0x10ec0284:
433 	case 0x10ec0290:
434 	case 0x10ec0292:
435 		alc_update_coef_idx(codec, 0x4, 1<<15, 0);
436 		break;
437 	case 0x10ec0225:
438 	case 0x10ec0295:
439 	case 0x10ec0299:
440 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
441 		fallthrough;
442 	case 0x10ec0215:
443 	case 0x10ec0285:
444 	case 0x10ec0289:
445 		alc_update_coef_idx(codec, 0x36, 1<<13, 0);
446 		fallthrough;
447 	case 0x10ec0230:
448 	case 0x10ec0233:
449 	case 0x10ec0235:
450 	case 0x10ec0236:
451 	case 0x10ec0245:
452 	case 0x10ec0255:
453 	case 0x10ec0256:
454 	case 0x19e58326:
455 	case 0x10ec0257:
456 	case 0x10ec0282:
457 	case 0x10ec0283:
458 	case 0x10ec0286:
459 	case 0x10ec0288:
460 	case 0x10ec0298:
461 	case 0x10ec0300:
462 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
463 		break;
464 	case 0x10ec0275:
465 		alc_update_coef_idx(codec, 0xe, 0, 1<<0);
466 		break;
467 	case 0x10ec0287:
468 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
469 		alc_write_coef_idx(codec, 0x8, 0x4ab7);
470 		break;
471 	case 0x10ec0293:
472 		alc_update_coef_idx(codec, 0xa, 1<<13, 0);
473 		break;
474 	case 0x10ec0234:
475 	case 0x10ec0274:
476 	case 0x10ec0294:
477 	case 0x10ec0700:
478 	case 0x10ec0701:
479 	case 0x10ec0703:
480 	case 0x10ec0711:
481 		alc_update_coef_idx(codec, 0x10, 1<<15, 0);
482 		break;
483 	case 0x10ec0662:
484 		if ((coef & 0x00f0) == 0x0030)
485 			alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
486 		break;
487 	case 0x10ec0272:
488 	case 0x10ec0273:
489 	case 0x10ec0663:
490 	case 0x10ec0665:
491 	case 0x10ec0670:
492 	case 0x10ec0671:
493 	case 0x10ec0672:
494 		alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
495 		break;
496 	case 0x10ec0222:
497 	case 0x10ec0623:
498 		alc_update_coef_idx(codec, 0x19, 1<<13, 0);
499 		break;
500 	case 0x10ec0668:
501 		alc_update_coef_idx(codec, 0x7, 3<<13, 0);
502 		break;
503 	case 0x10ec0867:
504 		alc_update_coef_idx(codec, 0x4, 1<<10, 0);
505 		break;
506 	case 0x10ec0888:
507 		if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
508 			alc_update_coef_idx(codec, 0x7, 1<<5, 0);
509 		break;
510 	case 0x10ec0892:
511 	case 0x10ec0897:
512 		alc_update_coef_idx(codec, 0x7, 1<<5, 0);
513 		break;
514 	case 0x10ec0899:
515 	case 0x10ec0900:
516 	case 0x10ec0b00:
517 	case 0x10ec1168:
518 	case 0x10ec1220:
519 		alc_update_coef_idx(codec, 0x7, 1<<1, 0);
520 		break;
521 	}
522 }
523 
524 /* additional initialization for ALC888 variants */
525 static void alc888_coef_init(struct hda_codec *codec)
526 {
527 	switch (alc_get_coef0(codec) & 0x00f0) {
528 	/* alc888-VA */
529 	case 0x00:
530 	/* alc888-VB */
531 	case 0x10:
532 		alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
533 		break;
534 	}
535 }
536 
537 /* turn on/off EAPD control (only if available) */
538 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
539 {
540 	if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
541 		return;
542 	if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
543 		snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
544 				    on ? 2 : 0);
545 }
546 
547 /* turn on/off EAPD controls of the codec */
548 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
549 {
550 	/* We currently only handle front, HP */
551 	static const hda_nid_t pins[] = {
552 		0x0f, 0x10, 0x14, 0x15, 0x17, 0
553 	};
554 	const hda_nid_t *p;
555 	for (p = pins; *p; p++)
556 		set_eapd(codec, *p, on);
557 }
558 
559 static int find_ext_mic_pin(struct hda_codec *codec);
560 
561 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
562 {
563 	const struct hda_pincfg *pin;
564 	int mic_pin = find_ext_mic_pin(codec);
565 	int i;
566 
567 	/* don't shut up pins when unloading the driver; otherwise it breaks
568 	 * the default pin setup at the next load of the driver
569 	 */
570 	if (codec->bus->shutdown)
571 		return;
572 
573 	snd_array_for_each(&codec->init_pins, i, pin) {
574 		/* use read here for syncing after issuing each verb */
575 		if (pin->nid != mic_pin)
576 			snd_hda_codec_read(codec, pin->nid, 0,
577 					AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
578 	}
579 
580 	codec->pins_shutup = 1;
581 }
582 
583 static void alc_shutup_pins(struct hda_codec *codec)
584 {
585 	struct alc_spec *spec = codec->spec;
586 
587 	switch (codec->core.vendor_id) {
588 	case 0x10ec0236:
589 	case 0x10ec0256:
590 	case 0x10ec0257:
591 	case 0x19e58326:
592 	case 0x10ec0283:
593 	case 0x10ec0285:
594 	case 0x10ec0286:
595 	case 0x10ec0287:
596 	case 0x10ec0288:
597 	case 0x10ec0295:
598 	case 0x10ec0298:
599 		alc_headset_mic_no_shutup(codec);
600 		break;
601 	default:
602 		if (!spec->no_shutup_pins)
603 			snd_hda_shutup_pins(codec);
604 		break;
605 	}
606 }
607 
608 /* generic shutup callback;
609  * just turning off EAPD and a little pause for avoiding pop-noise
610  */
611 static void alc_eapd_shutup(struct hda_codec *codec)
612 {
613 	struct alc_spec *spec = codec->spec;
614 
615 	alc_auto_setup_eapd(codec, false);
616 	if (!spec->no_depop_delay)
617 		msleep(200);
618 	alc_shutup_pins(codec);
619 }
620 
621 /* generic EAPD initialization */
622 static void alc_auto_init_amp(struct hda_codec *codec, int type)
623 {
624 	alc_auto_setup_eapd(codec, true);
625 	alc_write_gpio(codec);
626 	switch (type) {
627 	case ALC_INIT_DEFAULT:
628 		switch (codec->core.vendor_id) {
629 		case 0x10ec0260:
630 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
631 			break;
632 		case 0x10ec0880:
633 		case 0x10ec0882:
634 		case 0x10ec0883:
635 		case 0x10ec0885:
636 			alc_update_coef_idx(codec, 7, 0, 0x2030);
637 			break;
638 		case 0x10ec0888:
639 			alc888_coef_init(codec);
640 			break;
641 		}
642 		break;
643 	}
644 }
645 
646 /* get a primary headphone pin if available */
647 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
648 {
649 	if (spec->gen.autocfg.hp_pins[0])
650 		return spec->gen.autocfg.hp_pins[0];
651 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
652 		return spec->gen.autocfg.line_out_pins[0];
653 	return 0;
654 }
655 
656 /*
657  * Realtek SSID verification
658  */
659 
660 /* Could be any non-zero and even value. When used as fixup, tells
661  * the driver to ignore any present sku defines.
662  */
663 #define ALC_FIXUP_SKU_IGNORE (2)
664 
665 static void alc_fixup_sku_ignore(struct hda_codec *codec,
666 				 const struct hda_fixup *fix, int action)
667 {
668 	struct alc_spec *spec = codec->spec;
669 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
670 		spec->cdefine.fixup = 1;
671 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
672 	}
673 }
674 
675 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
676 				    const struct hda_fixup *fix, int action)
677 {
678 	struct alc_spec *spec = codec->spec;
679 
680 	if (action == HDA_FIXUP_ACT_PROBE) {
681 		spec->no_depop_delay = 1;
682 		codec->depop_delay = 0;
683 	}
684 }
685 
686 static int alc_auto_parse_customize_define(struct hda_codec *codec)
687 {
688 	unsigned int ass, tmp, i;
689 	unsigned nid = 0;
690 	struct alc_spec *spec = codec->spec;
691 
692 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
693 
694 	if (spec->cdefine.fixup) {
695 		ass = spec->cdefine.sku_cfg;
696 		if (ass == ALC_FIXUP_SKU_IGNORE)
697 			return -1;
698 		goto do_sku;
699 	}
700 
701 	if (!codec->bus->pci)
702 		return -1;
703 	ass = codec->core.subsystem_id & 0xffff;
704 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
705 		goto do_sku;
706 
707 	nid = 0x1d;
708 	if (codec->core.vendor_id == 0x10ec0260)
709 		nid = 0x17;
710 	ass = snd_hda_codec_get_pincfg(codec, nid);
711 
712 	if (!(ass & 1)) {
713 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
714 			   codec->core.chip_name, ass);
715 		return -1;
716 	}
717 
718 	/* check sum */
719 	tmp = 0;
720 	for (i = 1; i < 16; i++) {
721 		if ((ass >> i) & 1)
722 			tmp++;
723 	}
724 	if (((ass >> 16) & 0xf) != tmp)
725 		return -1;
726 
727 	spec->cdefine.port_connectivity = ass >> 30;
728 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
729 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
730 	spec->cdefine.customization = ass >> 8;
731 do_sku:
732 	spec->cdefine.sku_cfg = ass;
733 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
734 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
735 	spec->cdefine.swap = (ass & 0x2) >> 1;
736 	spec->cdefine.override = ass & 0x1;
737 
738 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
739 		   nid, spec->cdefine.sku_cfg);
740 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
741 		   spec->cdefine.port_connectivity);
742 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
743 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
744 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
745 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
746 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
747 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
748 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
749 
750 	return 0;
751 }
752 
753 /* return the position of NID in the list, or -1 if not found */
754 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
755 {
756 	int i;
757 	for (i = 0; i < nums; i++)
758 		if (list[i] == nid)
759 			return i;
760 	return -1;
761 }
762 /* return true if the given NID is found in the list */
763 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
764 {
765 	return find_idx_in_nid_list(nid, list, nums) >= 0;
766 }
767 
768 /* check subsystem ID and set up device-specific initialization;
769  * return 1 if initialized, 0 if invalid SSID
770  */
771 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
772  *	31 ~ 16 :	Manufacture ID
773  *	15 ~ 8	:	SKU ID
774  *	7  ~ 0	:	Assembly ID
775  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
776  */
777 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
778 {
779 	unsigned int ass, tmp, i;
780 	unsigned nid;
781 	struct alc_spec *spec = codec->spec;
782 
783 	if (spec->cdefine.fixup) {
784 		ass = spec->cdefine.sku_cfg;
785 		if (ass == ALC_FIXUP_SKU_IGNORE)
786 			return 0;
787 		goto do_sku;
788 	}
789 
790 	ass = codec->core.subsystem_id & 0xffff;
791 	if (codec->bus->pci &&
792 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
793 		goto do_sku;
794 
795 	/* invalid SSID, check the special NID pin defcfg instead */
796 	/*
797 	 * 31~30	: port connectivity
798 	 * 29~21	: reserve
799 	 * 20		: PCBEEP input
800 	 * 19~16	: Check sum (15:1)
801 	 * 15~1		: Custom
802 	 * 0		: override
803 	*/
804 	nid = 0x1d;
805 	if (codec->core.vendor_id == 0x10ec0260)
806 		nid = 0x17;
807 	ass = snd_hda_codec_get_pincfg(codec, nid);
808 	codec_dbg(codec,
809 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
810 		   ass, nid);
811 	if (!(ass & 1))
812 		return 0;
813 	if ((ass >> 30) != 1)	/* no physical connection */
814 		return 0;
815 
816 	/* check sum */
817 	tmp = 0;
818 	for (i = 1; i < 16; i++) {
819 		if ((ass >> i) & 1)
820 			tmp++;
821 	}
822 	if (((ass >> 16) & 0xf) != tmp)
823 		return 0;
824 do_sku:
825 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
826 		   ass & 0xffff, codec->core.vendor_id);
827 	/*
828 	 * 0 : override
829 	 * 1 :	Swap Jack
830 	 * 2 : 0 --> Desktop, 1 --> Laptop
831 	 * 3~5 : External Amplifier control
832 	 * 7~6 : Reserved
833 	*/
834 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
835 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
836 		switch (tmp) {
837 		case 1:
838 			alc_setup_gpio(codec, 0x01);
839 			break;
840 		case 3:
841 			alc_setup_gpio(codec, 0x02);
842 			break;
843 		case 7:
844 			alc_setup_gpio(codec, 0x04);
845 			break;
846 		case 5:
847 		default:
848 			spec->init_amp = ALC_INIT_DEFAULT;
849 			break;
850 		}
851 	}
852 
853 	/* is laptop or Desktop and enable the function "Mute internal speaker
854 	 * when the external headphone out jack is plugged"
855 	 */
856 	if (!(ass & 0x8000))
857 		return 1;
858 	/*
859 	 * 10~8 : Jack location
860 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
861 	 * 14~13: Resvered
862 	 * 15   : 1 --> enable the function "Mute internal speaker
863 	 *	        when the external headphone out jack is plugged"
864 	 */
865 	if (!alc_get_hp_pin(spec)) {
866 		hda_nid_t nid;
867 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
868 		nid = ports[tmp];
869 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
870 				      spec->gen.autocfg.line_outs))
871 			return 1;
872 		spec->gen.autocfg.hp_pins[0] = nid;
873 	}
874 	return 1;
875 }
876 
877 /* Check the validity of ALC subsystem-id
878  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
879 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
880 {
881 	if (!alc_subsystem_id(codec, ports)) {
882 		struct alc_spec *spec = codec->spec;
883 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
884 			codec_dbg(codec,
885 				  "realtek: Enable default setup for auto mode as fallback\n");
886 			spec->init_amp = ALC_INIT_DEFAULT;
887 		}
888 	}
889 }
890 
891 /*
892  */
893 
894 static void alc_fixup_inv_dmic(struct hda_codec *codec,
895 			       const struct hda_fixup *fix, int action)
896 {
897 	struct alc_spec *spec = codec->spec;
898 
899 	spec->gen.inv_dmic_split = 1;
900 }
901 
902 
903 static int alc_build_controls(struct hda_codec *codec)
904 {
905 	int err;
906 
907 	err = snd_hda_gen_build_controls(codec);
908 	if (err < 0)
909 		return err;
910 
911 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
912 	return 0;
913 }
914 
915 
916 /*
917  * Common callbacks
918  */
919 
920 static void alc_pre_init(struct hda_codec *codec)
921 {
922 	alc_fill_eapd_coef(codec);
923 }
924 
925 #define is_s3_resume(codec) \
926 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
927 #define is_s4_resume(codec) \
928 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
929 #define is_s4_suspend(codec) \
930 	((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
931 
932 static int alc_init(struct hda_codec *codec)
933 {
934 	struct alc_spec *spec = codec->spec;
935 
936 	/* hibernation resume needs the full chip initialization */
937 	if (is_s4_resume(codec))
938 		alc_pre_init(codec);
939 
940 	if (spec->init_hook)
941 		spec->init_hook(codec);
942 
943 	spec->gen.skip_verbs = 1; /* applied in below */
944 	snd_hda_gen_init(codec);
945 	alc_fix_pll(codec);
946 	alc_auto_init_amp(codec, spec->init_amp);
947 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
948 
949 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
950 
951 	return 0;
952 }
953 
954 /* forward declaration */
955 static const struct component_master_ops comp_master_ops;
956 
957 static void alc_free(struct hda_codec *codec)
958 {
959 	struct alc_spec *spec = codec->spec;
960 
961 	if (spec)
962 		hda_component_manager_free(&spec->comps, &comp_master_ops);
963 
964 	snd_hda_gen_free(codec);
965 }
966 
967 static inline void alc_shutup(struct hda_codec *codec)
968 {
969 	struct alc_spec *spec = codec->spec;
970 
971 	if (!snd_hda_get_bool_hint(codec, "shutup"))
972 		return; /* disabled explicitly by hints */
973 
974 	if (spec && spec->shutup)
975 		spec->shutup(codec);
976 	else
977 		alc_shutup_pins(codec);
978 }
979 
980 static void alc_power_eapd(struct hda_codec *codec)
981 {
982 	alc_auto_setup_eapd(codec, false);
983 }
984 
985 static int alc_suspend(struct hda_codec *codec)
986 {
987 	struct alc_spec *spec = codec->spec;
988 	alc_shutup(codec);
989 	if (spec && spec->power_hook)
990 		spec->power_hook(codec);
991 	return 0;
992 }
993 
994 static int alc_resume(struct hda_codec *codec)
995 {
996 	struct alc_spec *spec = codec->spec;
997 
998 	if (!spec->no_depop_delay)
999 		msleep(150); /* to avoid pop noise */
1000 	codec->patch_ops.init(codec);
1001 	snd_hda_regmap_sync(codec);
1002 	hda_call_check_power_status(codec, 0x01);
1003 	return 0;
1004 }
1005 
1006 /*
1007  */
1008 static const struct hda_codec_ops alc_patch_ops = {
1009 	.build_controls = alc_build_controls,
1010 	.build_pcms = snd_hda_gen_build_pcms,
1011 	.init = alc_init,
1012 	.free = alc_free,
1013 	.unsol_event = snd_hda_jack_unsol_event,
1014 	.resume = alc_resume,
1015 	.suspend = alc_suspend,
1016 	.check_power_status = snd_hda_gen_check_power_status,
1017 };
1018 
1019 
1020 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1021 
1022 /*
1023  * Rename codecs appropriately from COEF value or subvendor id
1024  */
1025 struct alc_codec_rename_table {
1026 	unsigned int vendor_id;
1027 	unsigned short coef_mask;
1028 	unsigned short coef_bits;
1029 	const char *name;
1030 };
1031 
1032 struct alc_codec_rename_pci_table {
1033 	unsigned int codec_vendor_id;
1034 	unsigned short pci_subvendor;
1035 	unsigned short pci_subdevice;
1036 	const char *name;
1037 };
1038 
1039 static const struct alc_codec_rename_table rename_tbl[] = {
1040 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1041 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1042 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1043 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1044 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1045 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1046 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1047 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1048 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1049 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1050 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1051 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1052 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1053 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1054 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1055 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1056 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1057 	{ } /* terminator */
1058 };
1059 
1060 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1061 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1062 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1063 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1064 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1065 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1066 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1067 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1068 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1069 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1070 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1071 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1072 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1073 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1074 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1075 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1076 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1077 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1078 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1079 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1080 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1081 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1082 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1083 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1084 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1085 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1086 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1087 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1088 	{ } /* terminator */
1089 };
1090 
1091 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1092 {
1093 	const struct alc_codec_rename_table *p;
1094 	const struct alc_codec_rename_pci_table *q;
1095 
1096 	for (p = rename_tbl; p->vendor_id; p++) {
1097 		if (p->vendor_id != codec->core.vendor_id)
1098 			continue;
1099 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1100 			return alc_codec_rename(codec, p->name);
1101 	}
1102 
1103 	if (!codec->bus->pci)
1104 		return 0;
1105 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1106 		if (q->codec_vendor_id != codec->core.vendor_id)
1107 			continue;
1108 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1109 			continue;
1110 		if (!q->pci_subdevice ||
1111 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1112 			return alc_codec_rename(codec, q->name);
1113 	}
1114 
1115 	return 0;
1116 }
1117 
1118 
1119 /*
1120  * Digital-beep handlers
1121  */
1122 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1123 
1124 /* additional beep mixers; private_value will be overwritten */
1125 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1126 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1127 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1128 };
1129 
1130 /* set up and create beep controls */
1131 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1132 			int idx, int dir)
1133 {
1134 	struct snd_kcontrol_new *knew;
1135 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1136 	int i;
1137 
1138 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1139 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1140 					    &alc_beep_mixer[i]);
1141 		if (!knew)
1142 			return -ENOMEM;
1143 		knew->private_value = beep_amp;
1144 	}
1145 	return 0;
1146 }
1147 
1148 static const struct snd_pci_quirk beep_allow_list[] = {
1149 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1150 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1151 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1152 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1153 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1154 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1155 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1156 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1157 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1158 	/* denylist -- no beep available */
1159 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1160 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1161 	{}
1162 };
1163 
1164 static inline int has_cdefine_beep(struct hda_codec *codec)
1165 {
1166 	struct alc_spec *spec = codec->spec;
1167 	const struct snd_pci_quirk *q;
1168 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1169 	if (q)
1170 		return q->value;
1171 	return spec->cdefine.enable_pcbeep;
1172 }
1173 #else
1174 #define set_beep_amp(spec, nid, idx, dir)	0
1175 #define has_cdefine_beep(codec)		0
1176 #endif
1177 
1178 /* parse the BIOS configuration and set up the alc_spec */
1179 /* return 1 if successful, 0 if the proper config is not found,
1180  * or a negative error code
1181  */
1182 static int alc_parse_auto_config(struct hda_codec *codec,
1183 				 const hda_nid_t *ignore_nids,
1184 				 const hda_nid_t *ssid_nids)
1185 {
1186 	struct alc_spec *spec = codec->spec;
1187 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1188 	int err;
1189 
1190 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1191 				       spec->parse_flags);
1192 	if (err < 0)
1193 		return err;
1194 
1195 	if (ssid_nids)
1196 		alc_ssid_check(codec, ssid_nids);
1197 
1198 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1199 	if (err < 0)
1200 		return err;
1201 
1202 	return 1;
1203 }
1204 
1205 /* common preparation job for alc_spec */
1206 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1207 {
1208 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1209 	int err;
1210 
1211 	if (!spec)
1212 		return -ENOMEM;
1213 	codec->spec = spec;
1214 	snd_hda_gen_spec_init(&spec->gen);
1215 	spec->gen.mixer_nid = mixer_nid;
1216 	spec->gen.own_eapd_ctl = 1;
1217 	codec->single_adc_amp = 1;
1218 	/* FIXME: do we need this for all Realtek codec models? */
1219 	codec->spdif_status_reset = 1;
1220 	codec->forced_resume = 1;
1221 	codec->patch_ops = alc_patch_ops;
1222 	mutex_init(&spec->coef_mutex);
1223 
1224 	err = alc_codec_rename_from_preset(codec);
1225 	if (err < 0) {
1226 		kfree(spec);
1227 		return err;
1228 	}
1229 	return 0;
1230 }
1231 
1232 static int alc880_parse_auto_config(struct hda_codec *codec)
1233 {
1234 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1235 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1236 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1237 }
1238 
1239 /*
1240  * ALC880 fix-ups
1241  */
1242 enum {
1243 	ALC880_FIXUP_GPIO1,
1244 	ALC880_FIXUP_GPIO2,
1245 	ALC880_FIXUP_MEDION_RIM,
1246 	ALC880_FIXUP_LG,
1247 	ALC880_FIXUP_LG_LW25,
1248 	ALC880_FIXUP_W810,
1249 	ALC880_FIXUP_EAPD_COEF,
1250 	ALC880_FIXUP_TCL_S700,
1251 	ALC880_FIXUP_VOL_KNOB,
1252 	ALC880_FIXUP_FUJITSU,
1253 	ALC880_FIXUP_F1734,
1254 	ALC880_FIXUP_UNIWILL,
1255 	ALC880_FIXUP_UNIWILL_DIG,
1256 	ALC880_FIXUP_Z71V,
1257 	ALC880_FIXUP_ASUS_W5A,
1258 	ALC880_FIXUP_3ST_BASE,
1259 	ALC880_FIXUP_3ST,
1260 	ALC880_FIXUP_3ST_DIG,
1261 	ALC880_FIXUP_5ST_BASE,
1262 	ALC880_FIXUP_5ST,
1263 	ALC880_FIXUP_5ST_DIG,
1264 	ALC880_FIXUP_6ST_BASE,
1265 	ALC880_FIXUP_6ST,
1266 	ALC880_FIXUP_6ST_DIG,
1267 	ALC880_FIXUP_6ST_AUTOMUTE,
1268 };
1269 
1270 /* enable the volume-knob widget support on NID 0x21 */
1271 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1272 				  const struct hda_fixup *fix, int action)
1273 {
1274 	if (action == HDA_FIXUP_ACT_PROBE)
1275 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1276 						    alc_update_knob_master);
1277 }
1278 
1279 static const struct hda_fixup alc880_fixups[] = {
1280 	[ALC880_FIXUP_GPIO1] = {
1281 		.type = HDA_FIXUP_FUNC,
1282 		.v.func = alc_fixup_gpio1,
1283 	},
1284 	[ALC880_FIXUP_GPIO2] = {
1285 		.type = HDA_FIXUP_FUNC,
1286 		.v.func = alc_fixup_gpio2,
1287 	},
1288 	[ALC880_FIXUP_MEDION_RIM] = {
1289 		.type = HDA_FIXUP_VERBS,
1290 		.v.verbs = (const struct hda_verb[]) {
1291 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1292 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1293 			{ }
1294 		},
1295 		.chained = true,
1296 		.chain_id = ALC880_FIXUP_GPIO2,
1297 	},
1298 	[ALC880_FIXUP_LG] = {
1299 		.type = HDA_FIXUP_PINS,
1300 		.v.pins = (const struct hda_pintbl[]) {
1301 			/* disable bogus unused pins */
1302 			{ 0x16, 0x411111f0 },
1303 			{ 0x18, 0x411111f0 },
1304 			{ 0x1a, 0x411111f0 },
1305 			{ }
1306 		}
1307 	},
1308 	[ALC880_FIXUP_LG_LW25] = {
1309 		.type = HDA_FIXUP_PINS,
1310 		.v.pins = (const struct hda_pintbl[]) {
1311 			{ 0x1a, 0x0181344f }, /* line-in */
1312 			{ 0x1b, 0x0321403f }, /* headphone */
1313 			{ }
1314 		}
1315 	},
1316 	[ALC880_FIXUP_W810] = {
1317 		.type = HDA_FIXUP_PINS,
1318 		.v.pins = (const struct hda_pintbl[]) {
1319 			/* disable bogus unused pins */
1320 			{ 0x17, 0x411111f0 },
1321 			{ }
1322 		},
1323 		.chained = true,
1324 		.chain_id = ALC880_FIXUP_GPIO2,
1325 	},
1326 	[ALC880_FIXUP_EAPD_COEF] = {
1327 		.type = HDA_FIXUP_VERBS,
1328 		.v.verbs = (const struct hda_verb[]) {
1329 			/* change to EAPD mode */
1330 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1331 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1332 			{}
1333 		},
1334 	},
1335 	[ALC880_FIXUP_TCL_S700] = {
1336 		.type = HDA_FIXUP_VERBS,
1337 		.v.verbs = (const struct hda_verb[]) {
1338 			/* change to EAPD mode */
1339 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1340 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1341 			{}
1342 		},
1343 		.chained = true,
1344 		.chain_id = ALC880_FIXUP_GPIO2,
1345 	},
1346 	[ALC880_FIXUP_VOL_KNOB] = {
1347 		.type = HDA_FIXUP_FUNC,
1348 		.v.func = alc880_fixup_vol_knob,
1349 	},
1350 	[ALC880_FIXUP_FUJITSU] = {
1351 		/* override all pins as BIOS on old Amilo is broken */
1352 		.type = HDA_FIXUP_PINS,
1353 		.v.pins = (const struct hda_pintbl[]) {
1354 			{ 0x14, 0x0121401f }, /* HP */
1355 			{ 0x15, 0x99030120 }, /* speaker */
1356 			{ 0x16, 0x99030130 }, /* bass speaker */
1357 			{ 0x17, 0x411111f0 }, /* N/A */
1358 			{ 0x18, 0x411111f0 }, /* N/A */
1359 			{ 0x19, 0x01a19950 }, /* mic-in */
1360 			{ 0x1a, 0x411111f0 }, /* N/A */
1361 			{ 0x1b, 0x411111f0 }, /* N/A */
1362 			{ 0x1c, 0x411111f0 }, /* N/A */
1363 			{ 0x1d, 0x411111f0 }, /* N/A */
1364 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1365 			{ }
1366 		},
1367 		.chained = true,
1368 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1369 	},
1370 	[ALC880_FIXUP_F1734] = {
1371 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1372 		.type = HDA_FIXUP_PINS,
1373 		.v.pins = (const struct hda_pintbl[]) {
1374 			{ 0x14, 0x0121401f }, /* HP */
1375 			{ 0x15, 0x99030120 }, /* speaker */
1376 			{ 0x16, 0x411111f0 }, /* N/A */
1377 			{ 0x17, 0x411111f0 }, /* N/A */
1378 			{ 0x18, 0x411111f0 }, /* N/A */
1379 			{ 0x19, 0x01a19950 }, /* mic-in */
1380 			{ 0x1a, 0x411111f0 }, /* N/A */
1381 			{ 0x1b, 0x411111f0 }, /* N/A */
1382 			{ 0x1c, 0x411111f0 }, /* N/A */
1383 			{ 0x1d, 0x411111f0 }, /* N/A */
1384 			{ 0x1e, 0x411111f0 }, /* N/A */
1385 			{ }
1386 		},
1387 		.chained = true,
1388 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1389 	},
1390 	[ALC880_FIXUP_UNIWILL] = {
1391 		/* need to fix HP and speaker pins to be parsed correctly */
1392 		.type = HDA_FIXUP_PINS,
1393 		.v.pins = (const struct hda_pintbl[]) {
1394 			{ 0x14, 0x0121411f }, /* HP */
1395 			{ 0x15, 0x99030120 }, /* speaker */
1396 			{ 0x16, 0x99030130 }, /* bass speaker */
1397 			{ }
1398 		},
1399 	},
1400 	[ALC880_FIXUP_UNIWILL_DIG] = {
1401 		.type = HDA_FIXUP_PINS,
1402 		.v.pins = (const struct hda_pintbl[]) {
1403 			/* disable bogus unused pins */
1404 			{ 0x17, 0x411111f0 },
1405 			{ 0x19, 0x411111f0 },
1406 			{ 0x1b, 0x411111f0 },
1407 			{ 0x1f, 0x411111f0 },
1408 			{ }
1409 		}
1410 	},
1411 	[ALC880_FIXUP_Z71V] = {
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, 0x99030120 }, /* speaker */
1416 			{ 0x15, 0x0121411f }, /* HP */
1417 			{ 0x16, 0x411111f0 }, /* N/A */
1418 			{ 0x17, 0x411111f0 }, /* N/A */
1419 			{ 0x18, 0x01a19950 }, /* mic-in */
1420 			{ 0x19, 0x411111f0 }, /* N/A */
1421 			{ 0x1a, 0x01813031 }, /* line-in */
1422 			{ 0x1b, 0x411111f0 }, /* N/A */
1423 			{ 0x1c, 0x411111f0 }, /* N/A */
1424 			{ 0x1d, 0x411111f0 }, /* N/A */
1425 			{ 0x1e, 0x0144111e }, /* SPDIF */
1426 			{ }
1427 		}
1428 	},
1429 	[ALC880_FIXUP_ASUS_W5A] = {
1430 		.type = HDA_FIXUP_PINS,
1431 		.v.pins = (const struct hda_pintbl[]) {
1432 			/* set up the whole pins as BIOS is utterly broken */
1433 			{ 0x14, 0x0121411f }, /* HP */
1434 			{ 0x15, 0x411111f0 }, /* N/A */
1435 			{ 0x16, 0x411111f0 }, /* N/A */
1436 			{ 0x17, 0x411111f0 }, /* N/A */
1437 			{ 0x18, 0x90a60160 }, /* mic */
1438 			{ 0x19, 0x411111f0 }, /* N/A */
1439 			{ 0x1a, 0x411111f0 }, /* N/A */
1440 			{ 0x1b, 0x411111f0 }, /* N/A */
1441 			{ 0x1c, 0x411111f0 }, /* N/A */
1442 			{ 0x1d, 0x411111f0 }, /* N/A */
1443 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1444 			{ }
1445 		},
1446 		.chained = true,
1447 		.chain_id = ALC880_FIXUP_GPIO1,
1448 	},
1449 	[ALC880_FIXUP_3ST_BASE] = {
1450 		.type = HDA_FIXUP_PINS,
1451 		.v.pins = (const struct hda_pintbl[]) {
1452 			{ 0x14, 0x01014010 }, /* line-out */
1453 			{ 0x15, 0x411111f0 }, /* N/A */
1454 			{ 0x16, 0x411111f0 }, /* N/A */
1455 			{ 0x17, 0x411111f0 }, /* N/A */
1456 			{ 0x18, 0x01a19c30 }, /* mic-in */
1457 			{ 0x19, 0x0121411f }, /* HP */
1458 			{ 0x1a, 0x01813031 }, /* line-in */
1459 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1460 			{ 0x1c, 0x411111f0 }, /* N/A */
1461 			{ 0x1d, 0x411111f0 }, /* N/A */
1462 			/* 0x1e is filled in below */
1463 			{ 0x1f, 0x411111f0 }, /* N/A */
1464 			{ }
1465 		}
1466 	},
1467 	[ALC880_FIXUP_3ST] = {
1468 		.type = HDA_FIXUP_PINS,
1469 		.v.pins = (const struct hda_pintbl[]) {
1470 			{ 0x1e, 0x411111f0 }, /* N/A */
1471 			{ }
1472 		},
1473 		.chained = true,
1474 		.chain_id = ALC880_FIXUP_3ST_BASE,
1475 	},
1476 	[ALC880_FIXUP_3ST_DIG] = {
1477 		.type = HDA_FIXUP_PINS,
1478 		.v.pins = (const struct hda_pintbl[]) {
1479 			{ 0x1e, 0x0144111e }, /* SPDIF */
1480 			{ }
1481 		},
1482 		.chained = true,
1483 		.chain_id = ALC880_FIXUP_3ST_BASE,
1484 	},
1485 	[ALC880_FIXUP_5ST_BASE] = {
1486 		.type = HDA_FIXUP_PINS,
1487 		.v.pins = (const struct hda_pintbl[]) {
1488 			{ 0x14, 0x01014010 }, /* front */
1489 			{ 0x15, 0x411111f0 }, /* N/A */
1490 			{ 0x16, 0x01011411 }, /* CLFE */
1491 			{ 0x17, 0x01016412 }, /* surr */
1492 			{ 0x18, 0x01a19c30 }, /* mic-in */
1493 			{ 0x19, 0x0121411f }, /* HP */
1494 			{ 0x1a, 0x01813031 }, /* line-in */
1495 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1496 			{ 0x1c, 0x411111f0 }, /* N/A */
1497 			{ 0x1d, 0x411111f0 }, /* N/A */
1498 			/* 0x1e is filled in below */
1499 			{ 0x1f, 0x411111f0 }, /* N/A */
1500 			{ }
1501 		}
1502 	},
1503 	[ALC880_FIXUP_5ST] = {
1504 		.type = HDA_FIXUP_PINS,
1505 		.v.pins = (const struct hda_pintbl[]) {
1506 			{ 0x1e, 0x411111f0 }, /* N/A */
1507 			{ }
1508 		},
1509 		.chained = true,
1510 		.chain_id = ALC880_FIXUP_5ST_BASE,
1511 	},
1512 	[ALC880_FIXUP_5ST_DIG] = {
1513 		.type = HDA_FIXUP_PINS,
1514 		.v.pins = (const struct hda_pintbl[]) {
1515 			{ 0x1e, 0x0144111e }, /* SPDIF */
1516 			{ }
1517 		},
1518 		.chained = true,
1519 		.chain_id = ALC880_FIXUP_5ST_BASE,
1520 	},
1521 	[ALC880_FIXUP_6ST_BASE] = {
1522 		.type = HDA_FIXUP_PINS,
1523 		.v.pins = (const struct hda_pintbl[]) {
1524 			{ 0x14, 0x01014010 }, /* front */
1525 			{ 0x15, 0x01016412 }, /* surr */
1526 			{ 0x16, 0x01011411 }, /* CLFE */
1527 			{ 0x17, 0x01012414 }, /* side */
1528 			{ 0x18, 0x01a19c30 }, /* mic-in */
1529 			{ 0x19, 0x02a19c40 }, /* front-mic */
1530 			{ 0x1a, 0x01813031 }, /* line-in */
1531 			{ 0x1b, 0x0121411f }, /* HP */
1532 			{ 0x1c, 0x411111f0 }, /* N/A */
1533 			{ 0x1d, 0x411111f0 }, /* N/A */
1534 			/* 0x1e is filled in below */
1535 			{ 0x1f, 0x411111f0 }, /* N/A */
1536 			{ }
1537 		}
1538 	},
1539 	[ALC880_FIXUP_6ST] = {
1540 		.type = HDA_FIXUP_PINS,
1541 		.v.pins = (const struct hda_pintbl[]) {
1542 			{ 0x1e, 0x411111f0 }, /* N/A */
1543 			{ }
1544 		},
1545 		.chained = true,
1546 		.chain_id = ALC880_FIXUP_6ST_BASE,
1547 	},
1548 	[ALC880_FIXUP_6ST_DIG] = {
1549 		.type = HDA_FIXUP_PINS,
1550 		.v.pins = (const struct hda_pintbl[]) {
1551 			{ 0x1e, 0x0144111e }, /* SPDIF */
1552 			{ }
1553 		},
1554 		.chained = true,
1555 		.chain_id = ALC880_FIXUP_6ST_BASE,
1556 	},
1557 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1558 		.type = HDA_FIXUP_PINS,
1559 		.v.pins = (const struct hda_pintbl[]) {
1560 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1561 			{ }
1562 		},
1563 		.chained_before = true,
1564 		.chain_id = ALC880_FIXUP_6ST_BASE,
1565 	},
1566 };
1567 
1568 static const struct hda_quirk alc880_fixup_tbl[] = {
1569 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1570 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1571 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1572 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1573 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1574 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1575 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1576 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1577 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1578 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1579 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1580 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1581 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1582 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1583 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1584 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1585 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1586 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1587 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1588 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1589 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1590 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1591 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1592 
1593 	/* Below is the copied entries from alc880_quirks.c.
1594 	 * It's not quite sure whether BIOS sets the correct pin-config table
1595 	 * on these machines, thus they are kept to be compatible with
1596 	 * the old static quirks.  Once when it's confirmed to work without
1597 	 * these overrides, it'd be better to remove.
1598 	 */
1599 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1600 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1601 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1602 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1603 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1605 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1606 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1607 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1608 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1609 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1610 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1611 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1612 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1613 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1614 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1615 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1616 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1617 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1618 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1619 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1620 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1621 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1622 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1623 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1624 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1625 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1626 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1627 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1628 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1629 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1630 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1631 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1632 	/* default Intel */
1633 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1634 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1635 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1636 	{}
1637 };
1638 
1639 static const struct hda_model_fixup alc880_fixup_models[] = {
1640 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1641 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1642 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1643 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1644 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1645 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1646 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1647 	{}
1648 };
1649 
1650 
1651 /*
1652  * OK, here we have finally the patch for ALC880
1653  */
1654 static int patch_alc880(struct hda_codec *codec)
1655 {
1656 	struct alc_spec *spec;
1657 	int err;
1658 
1659 	err = alc_alloc_spec(codec, 0x0b);
1660 	if (err < 0)
1661 		return err;
1662 
1663 	spec = codec->spec;
1664 	spec->gen.need_dac_fix = 1;
1665 	spec->gen.beep_nid = 0x01;
1666 
1667 	codec->patch_ops.unsol_event = alc880_unsol_event;
1668 
1669 	alc_pre_init(codec);
1670 
1671 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1672 		       alc880_fixups);
1673 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1674 
1675 	/* automatic parse from the BIOS config */
1676 	err = alc880_parse_auto_config(codec);
1677 	if (err < 0)
1678 		goto error;
1679 
1680 	if (!spec->gen.no_analog) {
1681 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1682 		if (err < 0)
1683 			goto error;
1684 	}
1685 
1686 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1687 
1688 	return 0;
1689 
1690  error:
1691 	alc_free(codec);
1692 	return err;
1693 }
1694 
1695 
1696 /*
1697  * ALC260 support
1698  */
1699 static int alc260_parse_auto_config(struct hda_codec *codec)
1700 {
1701 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1702 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1703 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1704 }
1705 
1706 /*
1707  * Pin config fixes
1708  */
1709 enum {
1710 	ALC260_FIXUP_HP_DC5750,
1711 	ALC260_FIXUP_HP_PIN_0F,
1712 	ALC260_FIXUP_COEF,
1713 	ALC260_FIXUP_GPIO1,
1714 	ALC260_FIXUP_GPIO1_TOGGLE,
1715 	ALC260_FIXUP_REPLACER,
1716 	ALC260_FIXUP_HP_B1900,
1717 	ALC260_FIXUP_KN1,
1718 	ALC260_FIXUP_FSC_S7020,
1719 	ALC260_FIXUP_FSC_S7020_JWSE,
1720 	ALC260_FIXUP_VAIO_PINS,
1721 };
1722 
1723 static void alc260_gpio1_automute(struct hda_codec *codec)
1724 {
1725 	struct alc_spec *spec = codec->spec;
1726 
1727 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1728 }
1729 
1730 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1731 				      const struct hda_fixup *fix, int action)
1732 {
1733 	struct alc_spec *spec = codec->spec;
1734 	if (action == HDA_FIXUP_ACT_PROBE) {
1735 		/* although the machine has only one output pin, we need to
1736 		 * toggle GPIO1 according to the jack state
1737 		 */
1738 		spec->gen.automute_hook = alc260_gpio1_automute;
1739 		spec->gen.detect_hp = 1;
1740 		spec->gen.automute_speaker = 1;
1741 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1742 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1743 						    snd_hda_gen_hp_automute);
1744 		alc_setup_gpio(codec, 0x01);
1745 	}
1746 }
1747 
1748 static void alc260_fixup_kn1(struct hda_codec *codec,
1749 			     const struct hda_fixup *fix, int action)
1750 {
1751 	struct alc_spec *spec = codec->spec;
1752 	static const struct hda_pintbl pincfgs[] = {
1753 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1754 		{ 0x12, 0x90a60160 }, /* int mic */
1755 		{ 0x13, 0x02a19000 }, /* ext mic */
1756 		{ 0x18, 0x01446000 }, /* SPDIF out */
1757 		/* disable bogus I/O pins */
1758 		{ 0x10, 0x411111f0 },
1759 		{ 0x11, 0x411111f0 },
1760 		{ 0x14, 0x411111f0 },
1761 		{ 0x15, 0x411111f0 },
1762 		{ 0x16, 0x411111f0 },
1763 		{ 0x17, 0x411111f0 },
1764 		{ 0x19, 0x411111f0 },
1765 		{ }
1766 	};
1767 
1768 	switch (action) {
1769 	case HDA_FIXUP_ACT_PRE_PROBE:
1770 		snd_hda_apply_pincfgs(codec, pincfgs);
1771 		spec->init_amp = ALC_INIT_NONE;
1772 		break;
1773 	}
1774 }
1775 
1776 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1777 				   const struct hda_fixup *fix, int action)
1778 {
1779 	struct alc_spec *spec = codec->spec;
1780 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1781 		spec->init_amp = ALC_INIT_NONE;
1782 }
1783 
1784 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1785 				   const struct hda_fixup *fix, int action)
1786 {
1787 	struct alc_spec *spec = codec->spec;
1788 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1789 		spec->gen.add_jack_modes = 1;
1790 		spec->gen.hp_mic = 1;
1791 	}
1792 }
1793 
1794 static const struct hda_fixup alc260_fixups[] = {
1795 	[ALC260_FIXUP_HP_DC5750] = {
1796 		.type = HDA_FIXUP_PINS,
1797 		.v.pins = (const struct hda_pintbl[]) {
1798 			{ 0x11, 0x90130110 }, /* speaker */
1799 			{ }
1800 		}
1801 	},
1802 	[ALC260_FIXUP_HP_PIN_0F] = {
1803 		.type = HDA_FIXUP_PINS,
1804 		.v.pins = (const struct hda_pintbl[]) {
1805 			{ 0x0f, 0x01214000 }, /* HP */
1806 			{ }
1807 		}
1808 	},
1809 	[ALC260_FIXUP_COEF] = {
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,  0x3040 },
1814 			{ }
1815 		},
1816 	},
1817 	[ALC260_FIXUP_GPIO1] = {
1818 		.type = HDA_FIXUP_FUNC,
1819 		.v.func = alc_fixup_gpio1,
1820 	},
1821 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1822 		.type = HDA_FIXUP_FUNC,
1823 		.v.func = alc260_fixup_gpio1_toggle,
1824 		.chained = true,
1825 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1826 	},
1827 	[ALC260_FIXUP_REPLACER] = {
1828 		.type = HDA_FIXUP_VERBS,
1829 		.v.verbs = (const struct hda_verb[]) {
1830 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1831 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1832 			{ }
1833 		},
1834 		.chained = true,
1835 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1836 	},
1837 	[ALC260_FIXUP_HP_B1900] = {
1838 		.type = HDA_FIXUP_FUNC,
1839 		.v.func = alc260_fixup_gpio1_toggle,
1840 		.chained = true,
1841 		.chain_id = ALC260_FIXUP_COEF,
1842 	},
1843 	[ALC260_FIXUP_KN1] = {
1844 		.type = HDA_FIXUP_FUNC,
1845 		.v.func = alc260_fixup_kn1,
1846 	},
1847 	[ALC260_FIXUP_FSC_S7020] = {
1848 		.type = HDA_FIXUP_FUNC,
1849 		.v.func = alc260_fixup_fsc_s7020,
1850 	},
1851 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1852 		.type = HDA_FIXUP_FUNC,
1853 		.v.func = alc260_fixup_fsc_s7020_jwse,
1854 		.chained = true,
1855 		.chain_id = ALC260_FIXUP_FSC_S7020,
1856 	},
1857 	[ALC260_FIXUP_VAIO_PINS] = {
1858 		.type = HDA_FIXUP_PINS,
1859 		.v.pins = (const struct hda_pintbl[]) {
1860 			/* Pin configs are missing completely on some VAIOs */
1861 			{ 0x0f, 0x01211020 },
1862 			{ 0x10, 0x0001003f },
1863 			{ 0x11, 0x411111f0 },
1864 			{ 0x12, 0x01a15930 },
1865 			{ 0x13, 0x411111f0 },
1866 			{ 0x14, 0x411111f0 },
1867 			{ 0x15, 0x411111f0 },
1868 			{ 0x16, 0x411111f0 },
1869 			{ 0x17, 0x411111f0 },
1870 			{ 0x18, 0x411111f0 },
1871 			{ 0x19, 0x411111f0 },
1872 			{ }
1873 		}
1874 	},
1875 };
1876 
1877 static const struct hda_quirk alc260_fixup_tbl[] = {
1878 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1879 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1880 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1881 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1882 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1883 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1884 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1885 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1886 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1887 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1888 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1889 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1890 	{}
1891 };
1892 
1893 static const struct hda_model_fixup alc260_fixup_models[] = {
1894 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1895 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1896 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1897 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1898 	{}
1899 };
1900 
1901 /*
1902  */
1903 static int patch_alc260(struct hda_codec *codec)
1904 {
1905 	struct alc_spec *spec;
1906 	int err;
1907 
1908 	err = alc_alloc_spec(codec, 0x07);
1909 	if (err < 0)
1910 		return err;
1911 
1912 	spec = codec->spec;
1913 	/* as quite a few machines require HP amp for speaker outputs,
1914 	 * it's easier to enable it unconditionally; even if it's unneeded,
1915 	 * it's almost harmless.
1916 	 */
1917 	spec->gen.prefer_hp_amp = 1;
1918 	spec->gen.beep_nid = 0x01;
1919 
1920 	spec->shutup = alc_eapd_shutup;
1921 
1922 	alc_pre_init(codec);
1923 
1924 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1925 			   alc260_fixups);
1926 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1927 
1928 	/* automatic parse from the BIOS config */
1929 	err = alc260_parse_auto_config(codec);
1930 	if (err < 0)
1931 		goto error;
1932 
1933 	if (!spec->gen.no_analog) {
1934 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1935 		if (err < 0)
1936 			goto error;
1937 	}
1938 
1939 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1940 
1941 	return 0;
1942 
1943  error:
1944 	alc_free(codec);
1945 	return err;
1946 }
1947 
1948 
1949 /*
1950  * ALC882/883/885/888/889 support
1951  *
1952  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1953  * configuration.  Each pin widget can choose any input DACs and a mixer.
1954  * Each ADC is connected from a mixer of all inputs.  This makes possible
1955  * 6-channel independent captures.
1956  *
1957  * In addition, an independent DAC for the multi-playback (not used in this
1958  * driver yet).
1959  */
1960 
1961 /*
1962  * Pin config fixes
1963  */
1964 enum {
1965 	ALC882_FIXUP_ABIT_AW9D_MAX,
1966 	ALC882_FIXUP_LENOVO_Y530,
1967 	ALC882_FIXUP_PB_M5210,
1968 	ALC882_FIXUP_ACER_ASPIRE_7736,
1969 	ALC882_FIXUP_ASUS_W90V,
1970 	ALC889_FIXUP_CD,
1971 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1972 	ALC889_FIXUP_VAIO_TT,
1973 	ALC888_FIXUP_EEE1601,
1974 	ALC886_FIXUP_EAPD,
1975 	ALC882_FIXUP_EAPD,
1976 	ALC883_FIXUP_EAPD,
1977 	ALC883_FIXUP_ACER_EAPD,
1978 	ALC882_FIXUP_GPIO1,
1979 	ALC882_FIXUP_GPIO2,
1980 	ALC882_FIXUP_GPIO3,
1981 	ALC889_FIXUP_COEF,
1982 	ALC882_FIXUP_ASUS_W2JC,
1983 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1984 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1985 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1986 	ALC885_FIXUP_MACPRO_GPIO,
1987 	ALC889_FIXUP_DAC_ROUTE,
1988 	ALC889_FIXUP_MBP_VREF,
1989 	ALC889_FIXUP_IMAC91_VREF,
1990 	ALC889_FIXUP_MBA11_VREF,
1991 	ALC889_FIXUP_MBA21_VREF,
1992 	ALC889_FIXUP_MP11_VREF,
1993 	ALC889_FIXUP_MP41_VREF,
1994 	ALC882_FIXUP_INV_DMIC,
1995 	ALC882_FIXUP_NO_PRIMARY_HP,
1996 	ALC887_FIXUP_ASUS_BASS,
1997 	ALC887_FIXUP_BASS_CHMAP,
1998 	ALC1220_FIXUP_GB_DUAL_CODECS,
1999 	ALC1220_FIXUP_GB_X570,
2000 	ALC1220_FIXUP_CLEVO_P950,
2001 	ALC1220_FIXUP_CLEVO_PB51ED,
2002 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
2003 	ALC887_FIXUP_ASUS_AUDIO,
2004 	ALC887_FIXUP_ASUS_HMIC,
2005 	ALCS1200A_FIXUP_MIC_VREF,
2006 	ALC888VD_FIXUP_MIC_100VREF,
2007 };
2008 
2009 static void alc889_fixup_coef(struct hda_codec *codec,
2010 			      const struct hda_fixup *fix, int action)
2011 {
2012 	if (action != HDA_FIXUP_ACT_INIT)
2013 		return;
2014 	alc_update_coef_idx(codec, 7, 0, 0x2030);
2015 }
2016 
2017 /* set up GPIO at initialization */
2018 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2019 				     const struct hda_fixup *fix, int action)
2020 {
2021 	struct alc_spec *spec = codec->spec;
2022 
2023 	spec->gpio_write_delay = true;
2024 	alc_fixup_gpio3(codec, fix, action);
2025 }
2026 
2027 /* Fix the connection of some pins for ALC889:
2028  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2029  * work correctly (bko#42740)
2030  */
2031 static void alc889_fixup_dac_route(struct hda_codec *codec,
2032 				   const struct hda_fixup *fix, int action)
2033 {
2034 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2035 		/* fake the connections during parsing the tree */
2036 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2037 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2038 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2039 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2040 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2041 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2042 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2043 		/* restore the connections */
2044 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2045 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2046 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2047 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2048 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2049 	}
2050 }
2051 
2052 /* Set VREF on HP pin */
2053 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2054 				  const struct hda_fixup *fix, int action)
2055 {
2056 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2057 	struct alc_spec *spec = codec->spec;
2058 	int i;
2059 
2060 	if (action != HDA_FIXUP_ACT_INIT)
2061 		return;
2062 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2063 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2064 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2065 			continue;
2066 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2067 		val |= AC_PINCTL_VREF_80;
2068 		snd_hda_set_pin_ctl(codec, nids[i], val);
2069 		spec->gen.keep_vref_in_automute = 1;
2070 		break;
2071 	}
2072 }
2073 
2074 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2075 				  const hda_nid_t *nids, int num_nids)
2076 {
2077 	struct alc_spec *spec = codec->spec;
2078 	int i;
2079 
2080 	for (i = 0; i < num_nids; i++) {
2081 		unsigned int val;
2082 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2083 		val |= AC_PINCTL_VREF_50;
2084 		snd_hda_set_pin_ctl(codec, nids[i], val);
2085 	}
2086 	spec->gen.keep_vref_in_automute = 1;
2087 }
2088 
2089 /* Set VREF on speaker pins on imac91 */
2090 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2091 				     const struct hda_fixup *fix, int action)
2092 {
2093 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2094 
2095 	if (action == HDA_FIXUP_ACT_INIT)
2096 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2097 }
2098 
2099 /* Set VREF on speaker pins on mba11 */
2100 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2101 				    const struct hda_fixup *fix, int action)
2102 {
2103 	static const hda_nid_t nids[] = { 0x18 };
2104 
2105 	if (action == HDA_FIXUP_ACT_INIT)
2106 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2107 }
2108 
2109 /* Set VREF on speaker pins on mba21 */
2110 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2111 				    const struct hda_fixup *fix, int action)
2112 {
2113 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2114 
2115 	if (action == HDA_FIXUP_ACT_INIT)
2116 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2117 }
2118 
2119 /* Don't take HP output as primary
2120  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2121  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2122  */
2123 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2124 				       const struct hda_fixup *fix, int action)
2125 {
2126 	struct alc_spec *spec = codec->spec;
2127 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2128 		spec->gen.no_primary_hp = 1;
2129 		spec->gen.no_multi_io = 1;
2130 	}
2131 }
2132 
2133 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2134 				 const struct hda_fixup *fix, int action);
2135 
2136 /* For dual-codec configuration, we need to disable some features to avoid
2137  * conflicts of kctls and PCM streams
2138  */
2139 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2140 				  const struct hda_fixup *fix, int action)
2141 {
2142 	struct alc_spec *spec = codec->spec;
2143 
2144 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2145 		return;
2146 	/* disable vmaster */
2147 	spec->gen.suppress_vmaster = 1;
2148 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2149 	spec->gen.suppress_auto_mute = 1;
2150 	spec->gen.suppress_auto_mic = 1;
2151 	/* disable aamix as well */
2152 	spec->gen.mixer_nid = 0;
2153 	/* add location prefix to avoid conflicts */
2154 	codec->force_pin_prefix = 1;
2155 }
2156 
2157 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2158 		       const char *newname)
2159 {
2160 	struct snd_kcontrol *kctl;
2161 
2162 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2163 	if (kctl)
2164 		snd_ctl_rename(codec->card, kctl, newname);
2165 }
2166 
2167 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2168 					 const struct hda_fixup *fix,
2169 					 int action)
2170 {
2171 	alc_fixup_dual_codecs(codec, fix, action);
2172 	switch (action) {
2173 	case HDA_FIXUP_ACT_PRE_PROBE:
2174 		/* override card longname to provide a unique UCM profile */
2175 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2176 		break;
2177 	case HDA_FIXUP_ACT_BUILD:
2178 		/* rename Capture controls depending on the codec */
2179 		rename_ctl(codec, "Capture Volume",
2180 			   codec->addr == 0 ?
2181 			   "Rear-Panel Capture Volume" :
2182 			   "Front-Panel Capture Volume");
2183 		rename_ctl(codec, "Capture Switch",
2184 			   codec->addr == 0 ?
2185 			   "Rear-Panel Capture Switch" :
2186 			   "Front-Panel Capture Switch");
2187 		break;
2188 	}
2189 }
2190 
2191 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2192 				     const struct hda_fixup *fix,
2193 				     int action)
2194 {
2195 	static const hda_nid_t conn1[] = { 0x0c };
2196 	static const struct coef_fw gb_x570_coefs[] = {
2197 		WRITE_COEF(0x07, 0x03c0),
2198 		WRITE_COEF(0x1a, 0x01c1),
2199 		WRITE_COEF(0x1b, 0x0202),
2200 		WRITE_COEF(0x43, 0x3005),
2201 		{}
2202 	};
2203 
2204 	switch (action) {
2205 	case HDA_FIXUP_ACT_PRE_PROBE:
2206 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2207 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2208 		break;
2209 	case HDA_FIXUP_ACT_INIT:
2210 		alc_process_coef_fw(codec, gb_x570_coefs);
2211 		break;
2212 	}
2213 }
2214 
2215 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2216 				     const struct hda_fixup *fix,
2217 				     int action)
2218 {
2219 	static const hda_nid_t conn1[] = { 0x0c };
2220 
2221 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2222 		return;
2223 
2224 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2225 	/* We therefore want to make sure 0x14 (front headphone) and
2226 	 * 0x1b (speakers) use the stereo DAC 0x02
2227 	 */
2228 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2229 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2230 }
2231 
2232 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2233 				const struct hda_fixup *fix, int action);
2234 
2235 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2236 				     const struct hda_fixup *fix,
2237 				     int action)
2238 {
2239 	alc1220_fixup_clevo_p950(codec, fix, action);
2240 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2241 }
2242 
2243 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2244 					 struct hda_jack_callback *jack)
2245 {
2246 	struct alc_spec *spec = codec->spec;
2247 	unsigned int vref;
2248 
2249 	snd_hda_gen_hp_automute(codec, jack);
2250 
2251 	if (spec->gen.hp_jack_present)
2252 		vref = AC_PINCTL_VREF_80;
2253 	else
2254 		vref = AC_PINCTL_VREF_HIZ;
2255 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2256 }
2257 
2258 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2259 				     const struct hda_fixup *fix, int action)
2260 {
2261 	struct alc_spec *spec = codec->spec;
2262 	if (action != HDA_FIXUP_ACT_PROBE)
2263 		return;
2264 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2265 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2266 }
2267 
2268 static const struct hda_fixup alc882_fixups[] = {
2269 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2270 		.type = HDA_FIXUP_PINS,
2271 		.v.pins = (const struct hda_pintbl[]) {
2272 			{ 0x15, 0x01080104 }, /* side */
2273 			{ 0x16, 0x01011012 }, /* rear */
2274 			{ 0x17, 0x01016011 }, /* clfe */
2275 			{ }
2276 		}
2277 	},
2278 	[ALC882_FIXUP_LENOVO_Y530] = {
2279 		.type = HDA_FIXUP_PINS,
2280 		.v.pins = (const struct hda_pintbl[]) {
2281 			{ 0x15, 0x99130112 }, /* rear int speakers */
2282 			{ 0x16, 0x99130111 }, /* subwoofer */
2283 			{ }
2284 		}
2285 	},
2286 	[ALC882_FIXUP_PB_M5210] = {
2287 		.type = HDA_FIXUP_PINCTLS,
2288 		.v.pins = (const struct hda_pintbl[]) {
2289 			{ 0x19, PIN_VREF50 },
2290 			{}
2291 		}
2292 	},
2293 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2294 		.type = HDA_FIXUP_FUNC,
2295 		.v.func = alc_fixup_sku_ignore,
2296 	},
2297 	[ALC882_FIXUP_ASUS_W90V] = {
2298 		.type = HDA_FIXUP_PINS,
2299 		.v.pins = (const struct hda_pintbl[]) {
2300 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2301 			{ }
2302 		}
2303 	},
2304 	[ALC889_FIXUP_CD] = {
2305 		.type = HDA_FIXUP_PINS,
2306 		.v.pins = (const struct hda_pintbl[]) {
2307 			{ 0x1c, 0x993301f0 }, /* CD */
2308 			{ }
2309 		}
2310 	},
2311 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2312 		.type = HDA_FIXUP_PINS,
2313 		.v.pins = (const struct hda_pintbl[]) {
2314 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2315 			{ }
2316 		},
2317 		.chained = true,
2318 		.chain_id = ALC889_FIXUP_CD,
2319 	},
2320 	[ALC889_FIXUP_VAIO_TT] = {
2321 		.type = HDA_FIXUP_PINS,
2322 		.v.pins = (const struct hda_pintbl[]) {
2323 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2324 			{ }
2325 		}
2326 	},
2327 	[ALC888_FIXUP_EEE1601] = {
2328 		.type = HDA_FIXUP_VERBS,
2329 		.v.verbs = (const struct hda_verb[]) {
2330 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2331 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2332 			{ }
2333 		}
2334 	},
2335 	[ALC886_FIXUP_EAPD] = {
2336 		.type = HDA_FIXUP_VERBS,
2337 		.v.verbs = (const struct hda_verb[]) {
2338 			/* change to EAPD mode */
2339 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2340 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2341 			{ }
2342 		}
2343 	},
2344 	[ALC882_FIXUP_EAPD] = {
2345 		.type = HDA_FIXUP_VERBS,
2346 		.v.verbs = (const struct hda_verb[]) {
2347 			/* change to EAPD mode */
2348 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2349 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2350 			{ }
2351 		}
2352 	},
2353 	[ALC883_FIXUP_EAPD] = {
2354 		.type = HDA_FIXUP_VERBS,
2355 		.v.verbs = (const struct hda_verb[]) {
2356 			/* change to EAPD mode */
2357 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2358 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2359 			{ }
2360 		}
2361 	},
2362 	[ALC883_FIXUP_ACER_EAPD] = {
2363 		.type = HDA_FIXUP_VERBS,
2364 		.v.verbs = (const struct hda_verb[]) {
2365 			/* eanable EAPD on Acer laptops */
2366 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2367 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2368 			{ }
2369 		}
2370 	},
2371 	[ALC882_FIXUP_GPIO1] = {
2372 		.type = HDA_FIXUP_FUNC,
2373 		.v.func = alc_fixup_gpio1,
2374 	},
2375 	[ALC882_FIXUP_GPIO2] = {
2376 		.type = HDA_FIXUP_FUNC,
2377 		.v.func = alc_fixup_gpio2,
2378 	},
2379 	[ALC882_FIXUP_GPIO3] = {
2380 		.type = HDA_FIXUP_FUNC,
2381 		.v.func = alc_fixup_gpio3,
2382 	},
2383 	[ALC882_FIXUP_ASUS_W2JC] = {
2384 		.type = HDA_FIXUP_FUNC,
2385 		.v.func = alc_fixup_gpio1,
2386 		.chained = true,
2387 		.chain_id = ALC882_FIXUP_EAPD,
2388 	},
2389 	[ALC889_FIXUP_COEF] = {
2390 		.type = HDA_FIXUP_FUNC,
2391 		.v.func = alc889_fixup_coef,
2392 	},
2393 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2394 		.type = HDA_FIXUP_PINS,
2395 		.v.pins = (const struct hda_pintbl[]) {
2396 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2397 			{ 0x17, 0x99130112 }, /* surround speaker */
2398 			{ }
2399 		},
2400 		.chained = true,
2401 		.chain_id = ALC882_FIXUP_GPIO1,
2402 	},
2403 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2404 		.type = HDA_FIXUP_PINS,
2405 		.v.pins = (const struct hda_pintbl[]) {
2406 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2407 			{ 0x1b, 0x99130112 }, /* surround speaker */
2408 			{ }
2409 		},
2410 		.chained = true,
2411 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2412 	},
2413 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2414 		/* additional init verbs for Acer Aspire 8930G */
2415 		.type = HDA_FIXUP_VERBS,
2416 		.v.verbs = (const struct hda_verb[]) {
2417 			/* Enable all DACs */
2418 			/* DAC DISABLE/MUTE 1? */
2419 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2420 			 *  apparently. Init=0x38 */
2421 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2422 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2423 			/* DAC DISABLE/MUTE 2? */
2424 			/*  some bit here disables the other DACs.
2425 			 *  Init=0x4900 */
2426 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2427 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2428 			/* DMIC fix
2429 			 * This laptop has a stereo digital microphone.
2430 			 * The mics are only 1cm apart which makes the stereo
2431 			 * useless. However, either the mic or the ALC889
2432 			 * makes the signal become a difference/sum signal
2433 			 * instead of standard stereo, which is annoying.
2434 			 * So instead we flip this bit which makes the
2435 			 * codec replicate the sum signal to both channels,
2436 			 * turning it into a normal mono mic.
2437 			 */
2438 			/* DMIC_CONTROL? Init value = 0x0001 */
2439 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2440 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2441 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2442 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2443 			{ }
2444 		},
2445 		.chained = true,
2446 		.chain_id = ALC882_FIXUP_GPIO1,
2447 	},
2448 	[ALC885_FIXUP_MACPRO_GPIO] = {
2449 		.type = HDA_FIXUP_FUNC,
2450 		.v.func = alc885_fixup_macpro_gpio,
2451 	},
2452 	[ALC889_FIXUP_DAC_ROUTE] = {
2453 		.type = HDA_FIXUP_FUNC,
2454 		.v.func = alc889_fixup_dac_route,
2455 	},
2456 	[ALC889_FIXUP_MBP_VREF] = {
2457 		.type = HDA_FIXUP_FUNC,
2458 		.v.func = alc889_fixup_mbp_vref,
2459 		.chained = true,
2460 		.chain_id = ALC882_FIXUP_GPIO1,
2461 	},
2462 	[ALC889_FIXUP_IMAC91_VREF] = {
2463 		.type = HDA_FIXUP_FUNC,
2464 		.v.func = alc889_fixup_imac91_vref,
2465 		.chained = true,
2466 		.chain_id = ALC882_FIXUP_GPIO1,
2467 	},
2468 	[ALC889_FIXUP_MBA11_VREF] = {
2469 		.type = HDA_FIXUP_FUNC,
2470 		.v.func = alc889_fixup_mba11_vref,
2471 		.chained = true,
2472 		.chain_id = ALC889_FIXUP_MBP_VREF,
2473 	},
2474 	[ALC889_FIXUP_MBA21_VREF] = {
2475 		.type = HDA_FIXUP_FUNC,
2476 		.v.func = alc889_fixup_mba21_vref,
2477 		.chained = true,
2478 		.chain_id = ALC889_FIXUP_MBP_VREF,
2479 	},
2480 	[ALC889_FIXUP_MP11_VREF] = {
2481 		.type = HDA_FIXUP_FUNC,
2482 		.v.func = alc889_fixup_mba11_vref,
2483 		.chained = true,
2484 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2485 	},
2486 	[ALC889_FIXUP_MP41_VREF] = {
2487 		.type = HDA_FIXUP_FUNC,
2488 		.v.func = alc889_fixup_mbp_vref,
2489 		.chained = true,
2490 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2491 	},
2492 	[ALC882_FIXUP_INV_DMIC] = {
2493 		.type = HDA_FIXUP_FUNC,
2494 		.v.func = alc_fixup_inv_dmic,
2495 	},
2496 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2497 		.type = HDA_FIXUP_FUNC,
2498 		.v.func = alc882_fixup_no_primary_hp,
2499 	},
2500 	[ALC887_FIXUP_ASUS_BASS] = {
2501 		.type = HDA_FIXUP_PINS,
2502 		.v.pins = (const struct hda_pintbl[]) {
2503 			{0x16, 0x99130130}, /* bass speaker */
2504 			{}
2505 		},
2506 		.chained = true,
2507 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2508 	},
2509 	[ALC887_FIXUP_BASS_CHMAP] = {
2510 		.type = HDA_FIXUP_FUNC,
2511 		.v.func = alc_fixup_bass_chmap,
2512 	},
2513 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2514 		.type = HDA_FIXUP_FUNC,
2515 		.v.func = alc1220_fixup_gb_dual_codecs,
2516 	},
2517 	[ALC1220_FIXUP_GB_X570] = {
2518 		.type = HDA_FIXUP_FUNC,
2519 		.v.func = alc1220_fixup_gb_x570,
2520 	},
2521 	[ALC1220_FIXUP_CLEVO_P950] = {
2522 		.type = HDA_FIXUP_FUNC,
2523 		.v.func = alc1220_fixup_clevo_p950,
2524 	},
2525 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2526 		.type = HDA_FIXUP_FUNC,
2527 		.v.func = alc1220_fixup_clevo_pb51ed,
2528 	},
2529 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2530 		.type = HDA_FIXUP_PINS,
2531 		.v.pins = (const struct hda_pintbl[]) {
2532 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2533 			{}
2534 		},
2535 		.chained = true,
2536 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2537 	},
2538 	[ALC887_FIXUP_ASUS_AUDIO] = {
2539 		.type = HDA_FIXUP_PINS,
2540 		.v.pins = (const struct hda_pintbl[]) {
2541 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2542 			{ 0x19, 0x22219420 },
2543 			{}
2544 		},
2545 	},
2546 	[ALC887_FIXUP_ASUS_HMIC] = {
2547 		.type = HDA_FIXUP_FUNC,
2548 		.v.func = alc887_fixup_asus_jack,
2549 		.chained = true,
2550 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2551 	},
2552 	[ALCS1200A_FIXUP_MIC_VREF] = {
2553 		.type = HDA_FIXUP_PINCTLS,
2554 		.v.pins = (const struct hda_pintbl[]) {
2555 			{ 0x18, PIN_VREF50 }, /* rear mic */
2556 			{ 0x19, PIN_VREF50 }, /* front mic */
2557 			{}
2558 		}
2559 	},
2560 	[ALC888VD_FIXUP_MIC_100VREF] = {
2561 		.type = HDA_FIXUP_PINCTLS,
2562 		.v.pins = (const struct hda_pintbl[]) {
2563 			{ 0x18, PIN_VREF100 }, /* headset mic */
2564 			{}
2565 		}
2566 	},
2567 };
2568 
2569 static const struct hda_quirk alc882_fixup_tbl[] = {
2570 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2571 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2572 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2573 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2574 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2575 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2576 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2577 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2578 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2579 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2580 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2581 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2582 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2583 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2584 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2585 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2586 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2587 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2588 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2589 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2590 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2591 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2592 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2593 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2594 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2595 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2596 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2597 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2598 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2599 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2600 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2601 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2602 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2603 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2604 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2605 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2606 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2607 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2608 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2609 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2610 
2611 	/* All Apple entries are in codec SSIDs */
2612 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2613 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2614 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2615 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2616 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2617 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2618 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2619 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2620 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2621 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2622 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2623 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2624 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2625 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2626 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2627 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2628 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2629 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2630 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2631 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2632 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2633 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2634 
2635 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2636 	SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2637 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2638 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2639 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2640 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2641 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2642 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2643 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2644 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2645 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2646 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2647 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2648 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2649 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2650 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2651 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2652 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2653 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2654 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2660 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2661 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2662 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2663 	SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2664 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2665 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2666 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2667 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2668 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2669 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2670 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2671 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2672 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2673 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2674 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2675 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2676 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2677 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2678 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2679 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2680 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2681 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2682 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2683 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2684 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2685 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2686 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2687 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2688 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2689 	{}
2690 };
2691 
2692 static const struct hda_model_fixup alc882_fixup_models[] = {
2693 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2694 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2695 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2696 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2697 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2698 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2699 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2700 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2701 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2702 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2703 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2704 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2705 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2706 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2707 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2708 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2709 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2710 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2711 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2712 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2713 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2714 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2715 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2716 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2717 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2718 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2719 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2720 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2721 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2722 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2723 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2724 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2725 	{}
2726 };
2727 
2728 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2729 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2730 		{0x14, 0x01014010},
2731 		{0x15, 0x01011012},
2732 		{0x16, 0x01016011},
2733 		{0x18, 0x01a19040},
2734 		{0x19, 0x02a19050},
2735 		{0x1a, 0x0181304f},
2736 		{0x1b, 0x0221401f},
2737 		{0x1e, 0x01456130}),
2738 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2739 		{0x14, 0x01015010},
2740 		{0x15, 0x01011012},
2741 		{0x16, 0x01011011},
2742 		{0x18, 0x01a11040},
2743 		{0x19, 0x02a19050},
2744 		{0x1a, 0x0181104f},
2745 		{0x1b, 0x0221401f},
2746 		{0x1e, 0x01451130}),
2747 	{}
2748 };
2749 
2750 /*
2751  * BIOS auto configuration
2752  */
2753 /* almost identical with ALC880 parser... */
2754 static int alc882_parse_auto_config(struct hda_codec *codec)
2755 {
2756 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2757 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2758 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2759 }
2760 
2761 /*
2762  */
2763 static int patch_alc882(struct hda_codec *codec)
2764 {
2765 	struct alc_spec *spec;
2766 	int err;
2767 
2768 	err = alc_alloc_spec(codec, 0x0b);
2769 	if (err < 0)
2770 		return err;
2771 
2772 	spec = codec->spec;
2773 
2774 	switch (codec->core.vendor_id) {
2775 	case 0x10ec0882:
2776 	case 0x10ec0885:
2777 	case 0x10ec0900:
2778 	case 0x10ec0b00:
2779 	case 0x10ec1220:
2780 		break;
2781 	default:
2782 		/* ALC883 and variants */
2783 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2784 		break;
2785 	}
2786 
2787 	alc_pre_init(codec);
2788 
2789 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2790 		       alc882_fixups);
2791 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2792 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2793 
2794 	alc_auto_parse_customize_define(codec);
2795 
2796 	if (has_cdefine_beep(codec))
2797 		spec->gen.beep_nid = 0x01;
2798 
2799 	/* automatic parse from the BIOS config */
2800 	err = alc882_parse_auto_config(codec);
2801 	if (err < 0)
2802 		goto error;
2803 
2804 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2805 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2806 		if (err < 0)
2807 			goto error;
2808 	}
2809 
2810 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2811 
2812 	return 0;
2813 
2814  error:
2815 	alc_free(codec);
2816 	return err;
2817 }
2818 
2819 
2820 /*
2821  * ALC262 support
2822  */
2823 static int alc262_parse_auto_config(struct hda_codec *codec)
2824 {
2825 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2826 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2827 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2828 }
2829 
2830 /*
2831  * Pin config fixes
2832  */
2833 enum {
2834 	ALC262_FIXUP_FSC_H270,
2835 	ALC262_FIXUP_FSC_S7110,
2836 	ALC262_FIXUP_HP_Z200,
2837 	ALC262_FIXUP_TYAN,
2838 	ALC262_FIXUP_LENOVO_3000,
2839 	ALC262_FIXUP_BENQ,
2840 	ALC262_FIXUP_BENQ_T31,
2841 	ALC262_FIXUP_INV_DMIC,
2842 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2843 };
2844 
2845 static const struct hda_fixup alc262_fixups[] = {
2846 	[ALC262_FIXUP_FSC_H270] = {
2847 		.type = HDA_FIXUP_PINS,
2848 		.v.pins = (const struct hda_pintbl[]) {
2849 			{ 0x14, 0x99130110 }, /* speaker */
2850 			{ 0x15, 0x0221142f }, /* front HP */
2851 			{ 0x1b, 0x0121141f }, /* rear HP */
2852 			{ }
2853 		}
2854 	},
2855 	[ALC262_FIXUP_FSC_S7110] = {
2856 		.type = HDA_FIXUP_PINS,
2857 		.v.pins = (const struct hda_pintbl[]) {
2858 			{ 0x15, 0x90170110 }, /* speaker */
2859 			{ }
2860 		},
2861 		.chained = true,
2862 		.chain_id = ALC262_FIXUP_BENQ,
2863 	},
2864 	[ALC262_FIXUP_HP_Z200] = {
2865 		.type = HDA_FIXUP_PINS,
2866 		.v.pins = (const struct hda_pintbl[]) {
2867 			{ 0x16, 0x99130120 }, /* internal speaker */
2868 			{ }
2869 		}
2870 	},
2871 	[ALC262_FIXUP_TYAN] = {
2872 		.type = HDA_FIXUP_PINS,
2873 		.v.pins = (const struct hda_pintbl[]) {
2874 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2875 			{ }
2876 		}
2877 	},
2878 	[ALC262_FIXUP_LENOVO_3000] = {
2879 		.type = HDA_FIXUP_PINCTLS,
2880 		.v.pins = (const struct hda_pintbl[]) {
2881 			{ 0x19, PIN_VREF50 },
2882 			{}
2883 		},
2884 		.chained = true,
2885 		.chain_id = ALC262_FIXUP_BENQ,
2886 	},
2887 	[ALC262_FIXUP_BENQ] = {
2888 		.type = HDA_FIXUP_VERBS,
2889 		.v.verbs = (const struct hda_verb[]) {
2890 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2891 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2892 			{}
2893 		}
2894 	},
2895 	[ALC262_FIXUP_BENQ_T31] = {
2896 		.type = HDA_FIXUP_VERBS,
2897 		.v.verbs = (const struct hda_verb[]) {
2898 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2899 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2900 			{}
2901 		}
2902 	},
2903 	[ALC262_FIXUP_INV_DMIC] = {
2904 		.type = HDA_FIXUP_FUNC,
2905 		.v.func = alc_fixup_inv_dmic,
2906 	},
2907 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2908 		.type = HDA_FIXUP_FUNC,
2909 		.v.func = alc_fixup_no_depop_delay,
2910 	},
2911 };
2912 
2913 static const struct hda_quirk alc262_fixup_tbl[] = {
2914 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2915 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2916 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2917 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2918 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2919 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2920 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2921 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2922 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2923 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2924 	{}
2925 };
2926 
2927 static const struct hda_model_fixup alc262_fixup_models[] = {
2928 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2929 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2930 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2931 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2932 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2933 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2934 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2935 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2936 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2937 	{}
2938 };
2939 
2940 /*
2941  */
2942 static int patch_alc262(struct hda_codec *codec)
2943 {
2944 	struct alc_spec *spec;
2945 	int err;
2946 
2947 	err = alc_alloc_spec(codec, 0x0b);
2948 	if (err < 0)
2949 		return err;
2950 
2951 	spec = codec->spec;
2952 	spec->gen.shared_mic_vref_pin = 0x18;
2953 
2954 	spec->shutup = alc_eapd_shutup;
2955 
2956 #if 0
2957 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2958 	 * under-run
2959 	 */
2960 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2961 #endif
2962 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2963 
2964 	alc_pre_init(codec);
2965 
2966 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2967 		       alc262_fixups);
2968 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2969 
2970 	alc_auto_parse_customize_define(codec);
2971 
2972 	if (has_cdefine_beep(codec))
2973 		spec->gen.beep_nid = 0x01;
2974 
2975 	/* automatic parse from the BIOS config */
2976 	err = alc262_parse_auto_config(codec);
2977 	if (err < 0)
2978 		goto error;
2979 
2980 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2981 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2982 		if (err < 0)
2983 			goto error;
2984 	}
2985 
2986 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2987 
2988 	return 0;
2989 
2990  error:
2991 	alc_free(codec);
2992 	return err;
2993 }
2994 
2995 /*
2996  *  ALC268
2997  */
2998 /* bind Beep switches of both NID 0x0f and 0x10 */
2999 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
3000 				  struct snd_ctl_elem_value *ucontrol)
3001 {
3002 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3003 	unsigned long pval;
3004 	int err;
3005 
3006 	mutex_lock(&codec->control_mutex);
3007 	pval = kcontrol->private_value;
3008 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
3009 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3010 	if (err >= 0) {
3011 		kcontrol->private_value = (pval & ~0xff) | 0x10;
3012 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3013 	}
3014 	kcontrol->private_value = pval;
3015 	mutex_unlock(&codec->control_mutex);
3016 	return err;
3017 }
3018 
3019 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3020 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3021 	{
3022 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3023 		.name = "Beep Playback Switch",
3024 		.subdevice = HDA_SUBDEV_AMP_FLAG,
3025 		.info = snd_hda_mixer_amp_switch_info,
3026 		.get = snd_hda_mixer_amp_switch_get,
3027 		.put = alc268_beep_switch_put,
3028 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3029 	},
3030 };
3031 
3032 /* set PCBEEP vol = 0, mute connections */
3033 static const struct hda_verb alc268_beep_init_verbs[] = {
3034 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3035 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3036 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3037 	{ }
3038 };
3039 
3040 enum {
3041 	ALC268_FIXUP_INV_DMIC,
3042 	ALC268_FIXUP_HP_EAPD,
3043 	ALC268_FIXUP_SPDIF,
3044 };
3045 
3046 static const struct hda_fixup alc268_fixups[] = {
3047 	[ALC268_FIXUP_INV_DMIC] = {
3048 		.type = HDA_FIXUP_FUNC,
3049 		.v.func = alc_fixup_inv_dmic,
3050 	},
3051 	[ALC268_FIXUP_HP_EAPD] = {
3052 		.type = HDA_FIXUP_VERBS,
3053 		.v.verbs = (const struct hda_verb[]) {
3054 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3055 			{}
3056 		}
3057 	},
3058 	[ALC268_FIXUP_SPDIF] = {
3059 		.type = HDA_FIXUP_PINS,
3060 		.v.pins = (const struct hda_pintbl[]) {
3061 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3062 			{}
3063 		}
3064 	},
3065 };
3066 
3067 static const struct hda_model_fixup alc268_fixup_models[] = {
3068 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3069 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3070 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3071 	{}
3072 };
3073 
3074 static const struct hda_quirk alc268_fixup_tbl[] = {
3075 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3076 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3077 	/* below is codec SSID since multiple Toshiba laptops have the
3078 	 * same PCI SSID 1179:ff00
3079 	 */
3080 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3081 	{}
3082 };
3083 
3084 /*
3085  * BIOS auto configuration
3086  */
3087 static int alc268_parse_auto_config(struct hda_codec *codec)
3088 {
3089 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3090 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3091 }
3092 
3093 /*
3094  */
3095 static int patch_alc268(struct hda_codec *codec)
3096 {
3097 	struct alc_spec *spec;
3098 	int i, err;
3099 
3100 	/* ALC268 has no aa-loopback mixer */
3101 	err = alc_alloc_spec(codec, 0);
3102 	if (err < 0)
3103 		return err;
3104 
3105 	spec = codec->spec;
3106 	if (has_cdefine_beep(codec))
3107 		spec->gen.beep_nid = 0x01;
3108 
3109 	spec->shutup = alc_eapd_shutup;
3110 
3111 	alc_pre_init(codec);
3112 
3113 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3114 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3115 
3116 	/* automatic parse from the BIOS config */
3117 	err = alc268_parse_auto_config(codec);
3118 	if (err < 0)
3119 		goto error;
3120 
3121 	if (err > 0 && !spec->gen.no_analog &&
3122 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3123 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3124 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3125 						  &alc268_beep_mixer[i])) {
3126 				err = -ENOMEM;
3127 				goto error;
3128 			}
3129 		}
3130 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3131 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3132 			/* override the amp caps for beep generator */
3133 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3134 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3135 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3136 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3137 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3138 	}
3139 
3140 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3141 
3142 	return 0;
3143 
3144  error:
3145 	alc_free(codec);
3146 	return err;
3147 }
3148 
3149 /*
3150  * ALC269
3151  */
3152 
3153 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3154 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3155 };
3156 
3157 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3158 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3159 };
3160 
3161 /* different alc269-variants */
3162 enum {
3163 	ALC269_TYPE_ALC269VA,
3164 	ALC269_TYPE_ALC269VB,
3165 	ALC269_TYPE_ALC269VC,
3166 	ALC269_TYPE_ALC269VD,
3167 	ALC269_TYPE_ALC280,
3168 	ALC269_TYPE_ALC282,
3169 	ALC269_TYPE_ALC283,
3170 	ALC269_TYPE_ALC284,
3171 	ALC269_TYPE_ALC293,
3172 	ALC269_TYPE_ALC286,
3173 	ALC269_TYPE_ALC298,
3174 	ALC269_TYPE_ALC255,
3175 	ALC269_TYPE_ALC256,
3176 	ALC269_TYPE_ALC257,
3177 	ALC269_TYPE_ALC215,
3178 	ALC269_TYPE_ALC225,
3179 	ALC269_TYPE_ALC245,
3180 	ALC269_TYPE_ALC287,
3181 	ALC269_TYPE_ALC294,
3182 	ALC269_TYPE_ALC300,
3183 	ALC269_TYPE_ALC623,
3184 	ALC269_TYPE_ALC700,
3185 };
3186 
3187 /*
3188  * BIOS auto configuration
3189  */
3190 static int alc269_parse_auto_config(struct hda_codec *codec)
3191 {
3192 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3193 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3194 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3195 	struct alc_spec *spec = codec->spec;
3196 	const hda_nid_t *ssids;
3197 
3198 	switch (spec->codec_variant) {
3199 	case ALC269_TYPE_ALC269VA:
3200 	case ALC269_TYPE_ALC269VC:
3201 	case ALC269_TYPE_ALC280:
3202 	case ALC269_TYPE_ALC284:
3203 	case ALC269_TYPE_ALC293:
3204 		ssids = alc269va_ssids;
3205 		break;
3206 	case ALC269_TYPE_ALC269VB:
3207 	case ALC269_TYPE_ALC269VD:
3208 	case ALC269_TYPE_ALC282:
3209 	case ALC269_TYPE_ALC283:
3210 	case ALC269_TYPE_ALC286:
3211 	case ALC269_TYPE_ALC298:
3212 	case ALC269_TYPE_ALC255:
3213 	case ALC269_TYPE_ALC256:
3214 	case ALC269_TYPE_ALC257:
3215 	case ALC269_TYPE_ALC215:
3216 	case ALC269_TYPE_ALC225:
3217 	case ALC269_TYPE_ALC245:
3218 	case ALC269_TYPE_ALC287:
3219 	case ALC269_TYPE_ALC294:
3220 	case ALC269_TYPE_ALC300:
3221 	case ALC269_TYPE_ALC623:
3222 	case ALC269_TYPE_ALC700:
3223 		ssids = alc269_ssids;
3224 		break;
3225 	default:
3226 		ssids = alc269_ssids;
3227 		break;
3228 	}
3229 
3230 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3231 }
3232 
3233 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3234 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3235 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3236 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3237 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3238 	{}
3239 };
3240 
3241 static void alc_headset_btn_callback(struct hda_codec *codec,
3242 				     struct hda_jack_callback *jack)
3243 {
3244 	int report = 0;
3245 
3246 	if (jack->unsol_res & (7 << 13))
3247 		report |= SND_JACK_BTN_0;
3248 
3249 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3250 		report |= SND_JACK_BTN_1;
3251 
3252 	/* Volume up key */
3253 	if (jack->unsol_res & (7 << 23))
3254 		report |= SND_JACK_BTN_2;
3255 
3256 	/* Volume down key */
3257 	if (jack->unsol_res & (7 << 10))
3258 		report |= SND_JACK_BTN_3;
3259 
3260 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3261 }
3262 
3263 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3264 {
3265 	struct alc_spec *spec = codec->spec;
3266 
3267 	if (!spec->has_hs_key)
3268 		return;
3269 
3270 	switch (codec->core.vendor_id) {
3271 	case 0x10ec0215:
3272 	case 0x10ec0225:
3273 	case 0x10ec0285:
3274 	case 0x10ec0287:
3275 	case 0x10ec0295:
3276 	case 0x10ec0289:
3277 	case 0x10ec0299:
3278 		alc_write_coef_idx(codec, 0x48, 0x0);
3279 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3280 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3281 		break;
3282 	case 0x10ec0230:
3283 	case 0x10ec0236:
3284 	case 0x10ec0256:
3285 	case 0x10ec0257:
3286 	case 0x19e58326:
3287 		alc_write_coef_idx(codec, 0x48, 0x0);
3288 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3289 		break;
3290 	}
3291 }
3292 
3293 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3294 {
3295 	struct alc_spec *spec = codec->spec;
3296 
3297 	if (!spec->has_hs_key)
3298 		return;
3299 
3300 	switch (codec->core.vendor_id) {
3301 	case 0x10ec0215:
3302 	case 0x10ec0225:
3303 	case 0x10ec0285:
3304 	case 0x10ec0287:
3305 	case 0x10ec0295:
3306 	case 0x10ec0289:
3307 	case 0x10ec0299:
3308 		alc_write_coef_idx(codec, 0x48, 0xd011);
3309 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3310 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3311 		break;
3312 	case 0x10ec0230:
3313 	case 0x10ec0236:
3314 	case 0x10ec0256:
3315 	case 0x10ec0257:
3316 	case 0x19e58326:
3317 		alc_write_coef_idx(codec, 0x48, 0xd011);
3318 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3319 		break;
3320 	}
3321 }
3322 
3323 static void alc_fixup_headset_jack(struct hda_codec *codec,
3324 				    const struct hda_fixup *fix, int action)
3325 {
3326 	struct alc_spec *spec = codec->spec;
3327 	hda_nid_t hp_pin;
3328 
3329 	switch (action) {
3330 	case HDA_FIXUP_ACT_PRE_PROBE:
3331 		spec->has_hs_key = 1;
3332 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3333 						    alc_headset_btn_callback);
3334 		break;
3335 	case HDA_FIXUP_ACT_BUILD:
3336 		hp_pin = alc_get_hp_pin(spec);
3337 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3338 							alc_headset_btn_keymap,
3339 							hp_pin))
3340 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3341 					      false, SND_JACK_HEADSET,
3342 					      alc_headset_btn_keymap);
3343 
3344 		alc_enable_headset_jack_key(codec);
3345 		break;
3346 	}
3347 }
3348 
3349 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3350 {
3351 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3352 }
3353 
3354 static void alc269_shutup(struct hda_codec *codec)
3355 {
3356 	struct alc_spec *spec = codec->spec;
3357 
3358 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3359 		alc269vb_toggle_power_output(codec, 0);
3360 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3361 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3362 		msleep(150);
3363 	}
3364 	alc_shutup_pins(codec);
3365 }
3366 
3367 static const struct coef_fw alc282_coefs[] = {
3368 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3369 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3370 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3371 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3372 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3373 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3374 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3375 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3376 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3377 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3378 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3379 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3380 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3381 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3382 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3383 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3384 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3385 	WRITE_COEF(0x63, 0x2902), /* PLL */
3386 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3387 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3388 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3389 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3390 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3391 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3392 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3393 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3394 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3395 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3396 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3397 	{}
3398 };
3399 
3400 static void alc282_restore_default_value(struct hda_codec *codec)
3401 {
3402 	alc_process_coef_fw(codec, alc282_coefs);
3403 }
3404 
3405 static void alc282_init(struct hda_codec *codec)
3406 {
3407 	struct alc_spec *spec = codec->spec;
3408 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3409 	bool hp_pin_sense;
3410 	int coef78;
3411 
3412 	alc282_restore_default_value(codec);
3413 
3414 	if (!hp_pin)
3415 		return;
3416 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3417 	coef78 = alc_read_coef_idx(codec, 0x78);
3418 
3419 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3420 	/* Headphone capless set to high power mode */
3421 	alc_write_coef_idx(codec, 0x78, 0x9004);
3422 
3423 	if (hp_pin_sense)
3424 		msleep(2);
3425 
3426 	snd_hda_codec_write(codec, hp_pin, 0,
3427 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3428 
3429 	if (hp_pin_sense)
3430 		msleep(85);
3431 
3432 	snd_hda_codec_write(codec, hp_pin, 0,
3433 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3434 
3435 	if (hp_pin_sense)
3436 		msleep(100);
3437 
3438 	/* Headphone capless set to normal mode */
3439 	alc_write_coef_idx(codec, 0x78, coef78);
3440 }
3441 
3442 static void alc282_shutup(struct hda_codec *codec)
3443 {
3444 	struct alc_spec *spec = codec->spec;
3445 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3446 	bool hp_pin_sense;
3447 	int coef78;
3448 
3449 	if (!hp_pin) {
3450 		alc269_shutup(codec);
3451 		return;
3452 	}
3453 
3454 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3455 	coef78 = alc_read_coef_idx(codec, 0x78);
3456 	alc_write_coef_idx(codec, 0x78, 0x9004);
3457 
3458 	if (hp_pin_sense)
3459 		msleep(2);
3460 
3461 	snd_hda_codec_write(codec, hp_pin, 0,
3462 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3463 
3464 	if (hp_pin_sense)
3465 		msleep(85);
3466 
3467 	if (!spec->no_shutup_pins)
3468 		snd_hda_codec_write(codec, hp_pin, 0,
3469 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3470 
3471 	if (hp_pin_sense)
3472 		msleep(100);
3473 
3474 	alc_auto_setup_eapd(codec, false);
3475 	alc_shutup_pins(codec);
3476 	alc_write_coef_idx(codec, 0x78, coef78);
3477 }
3478 
3479 static const struct coef_fw alc283_coefs[] = {
3480 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3481 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3482 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3483 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3484 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3485 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3486 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3487 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3488 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3489 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3490 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3491 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3492 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3493 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3494 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3495 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3496 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3497 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3498 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3499 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3500 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3501 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3502 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3503 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3504 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3505 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3506 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3507 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3508 	WRITE_COEF(0x49, 0x0), /* test mode */
3509 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3510 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3511 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3512 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3513 	{}
3514 };
3515 
3516 static void alc283_restore_default_value(struct hda_codec *codec)
3517 {
3518 	alc_process_coef_fw(codec, alc283_coefs);
3519 }
3520 
3521 static void alc283_init(struct hda_codec *codec)
3522 {
3523 	struct alc_spec *spec = codec->spec;
3524 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3525 	bool hp_pin_sense;
3526 
3527 	alc283_restore_default_value(codec);
3528 
3529 	if (!hp_pin)
3530 		return;
3531 
3532 	msleep(30);
3533 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3534 
3535 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3536 	/* Headphone capless set to high power mode */
3537 	alc_write_coef_idx(codec, 0x43, 0x9004);
3538 
3539 	snd_hda_codec_write(codec, hp_pin, 0,
3540 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3541 
3542 	if (hp_pin_sense)
3543 		msleep(85);
3544 
3545 	snd_hda_codec_write(codec, hp_pin, 0,
3546 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3547 
3548 	if (hp_pin_sense)
3549 		msleep(85);
3550 	/* Index 0x46 Combo jack auto switch control 2 */
3551 	/* 3k pull low control for Headset jack. */
3552 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3553 	/* Headphone capless set to normal mode */
3554 	alc_write_coef_idx(codec, 0x43, 0x9614);
3555 }
3556 
3557 static void alc283_shutup(struct hda_codec *codec)
3558 {
3559 	struct alc_spec *spec = codec->spec;
3560 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3561 	bool hp_pin_sense;
3562 
3563 	if (!hp_pin) {
3564 		alc269_shutup(codec);
3565 		return;
3566 	}
3567 
3568 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3569 
3570 	alc_write_coef_idx(codec, 0x43, 0x9004);
3571 
3572 	/*depop hp during suspend*/
3573 	alc_write_coef_idx(codec, 0x06, 0x2100);
3574 
3575 	snd_hda_codec_write(codec, hp_pin, 0,
3576 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3577 
3578 	if (hp_pin_sense)
3579 		msleep(100);
3580 
3581 	if (!spec->no_shutup_pins)
3582 		snd_hda_codec_write(codec, hp_pin, 0,
3583 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3584 
3585 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3586 
3587 	if (hp_pin_sense)
3588 		msleep(100);
3589 	alc_auto_setup_eapd(codec, false);
3590 	alc_shutup_pins(codec);
3591 	alc_write_coef_idx(codec, 0x43, 0x9614);
3592 }
3593 
3594 static void alc256_init(struct hda_codec *codec)
3595 {
3596 	struct alc_spec *spec = codec->spec;
3597 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3598 	bool hp_pin_sense;
3599 
3600 	if (spec->ultra_low_power) {
3601 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3602 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3603 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3604 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3605 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3606 		msleep(30);
3607 	}
3608 
3609 	if (!hp_pin)
3610 		hp_pin = 0x21;
3611 
3612 	msleep(30);
3613 
3614 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3615 
3616 	if (hp_pin_sense)
3617 		msleep(2);
3618 
3619 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3620 
3621 	snd_hda_codec_write(codec, hp_pin, 0,
3622 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3623 
3624 	if (hp_pin_sense || spec->ultra_low_power)
3625 		msleep(85);
3626 
3627 	snd_hda_codec_write(codec, hp_pin, 0,
3628 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3629 
3630 	if (hp_pin_sense || spec->ultra_low_power)
3631 		msleep(100);
3632 
3633 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3634 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3635 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3636 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3637 	/*
3638 	 * Expose headphone mic (or possibly Line In on some machines) instead
3639 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3640 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3641 	 * this register.
3642 	 */
3643 	alc_write_coef_idx(codec, 0x36, 0x5757);
3644 }
3645 
3646 static void alc256_shutup(struct hda_codec *codec)
3647 {
3648 	struct alc_spec *spec = codec->spec;
3649 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3650 	bool hp_pin_sense;
3651 
3652 	if (!hp_pin)
3653 		hp_pin = 0x21;
3654 
3655 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3656 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3657 
3658 	if (hp_pin_sense)
3659 		msleep(2);
3660 
3661 	snd_hda_codec_write(codec, hp_pin, 0,
3662 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3663 
3664 	if (hp_pin_sense || spec->ultra_low_power)
3665 		msleep(85);
3666 
3667 	/* 3k pull low control for Headset jack. */
3668 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3669 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3670 	 * when booting with headset plugged. So skip setting it for the codec alc257
3671 	 */
3672 	if (spec->en_3kpull_low)
3673 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3674 
3675 	if (!spec->no_shutup_pins)
3676 		snd_hda_codec_write(codec, hp_pin, 0,
3677 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3678 
3679 	if (hp_pin_sense || spec->ultra_low_power)
3680 		msleep(100);
3681 
3682 	alc_auto_setup_eapd(codec, false);
3683 	alc_shutup_pins(codec);
3684 	if (spec->ultra_low_power) {
3685 		msleep(50);
3686 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3687 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3688 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3689 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3690 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3691 		msleep(30);
3692 	}
3693 }
3694 
3695 static void alc285_hp_init(struct hda_codec *codec)
3696 {
3697 	struct alc_spec *spec = codec->spec;
3698 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3699 	int i, val;
3700 	int coef38, coef0d, coef36;
3701 
3702 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3703 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3704 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3705 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3706 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3707 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3708 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3709 
3710 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3711 
3712 	if (hp_pin)
3713 		snd_hda_codec_write(codec, hp_pin, 0,
3714 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3715 
3716 	msleep(130);
3717 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3718 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3719 
3720 	if (hp_pin)
3721 		snd_hda_codec_write(codec, hp_pin, 0,
3722 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3723 	msleep(10);
3724 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3725 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3726 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3727 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3728 
3729 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3730 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3731 	for (i = 0; i < 20 && val & 0x8000; i++) {
3732 		msleep(50);
3733 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3734 	} /* Wait for depop procedure finish  */
3735 
3736 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3737 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3738 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3739 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3740 
3741 	msleep(50);
3742 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3743 }
3744 
3745 static void alc225_init(struct hda_codec *codec)
3746 {
3747 	struct alc_spec *spec = codec->spec;
3748 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3749 	bool hp1_pin_sense, hp2_pin_sense;
3750 
3751 	if (spec->ultra_low_power) {
3752 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3753 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3754 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3755 		msleep(30);
3756 	}
3757 
3758 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3759 		spec->codec_variant != ALC269_TYPE_ALC245)
3760 		/* required only at boot or S3 and S4 resume time */
3761 		if (!spec->done_hp_init ||
3762 			is_s3_resume(codec) ||
3763 			is_s4_resume(codec)) {
3764 			alc285_hp_init(codec);
3765 			spec->done_hp_init = true;
3766 		}
3767 
3768 	if (!hp_pin)
3769 		hp_pin = 0x21;
3770 	msleep(30);
3771 
3772 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3773 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3774 
3775 	if (hp1_pin_sense || hp2_pin_sense)
3776 		msleep(2);
3777 
3778 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3779 
3780 	if (hp1_pin_sense || spec->ultra_low_power)
3781 		snd_hda_codec_write(codec, hp_pin, 0,
3782 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3783 	if (hp2_pin_sense)
3784 		snd_hda_codec_write(codec, 0x16, 0,
3785 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3786 
3787 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3788 		msleep(85);
3789 
3790 	if (hp1_pin_sense || spec->ultra_low_power)
3791 		snd_hda_codec_write(codec, hp_pin, 0,
3792 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3793 	if (hp2_pin_sense)
3794 		snd_hda_codec_write(codec, 0x16, 0,
3795 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3796 
3797 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3798 		msleep(100);
3799 
3800 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3801 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3802 }
3803 
3804 static void alc225_shutup(struct hda_codec *codec)
3805 {
3806 	struct alc_spec *spec = codec->spec;
3807 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3808 	bool hp1_pin_sense, hp2_pin_sense;
3809 
3810 	if (!hp_pin)
3811 		hp_pin = 0x21;
3812 
3813 	alc_disable_headset_jack_key(codec);
3814 	/* 3k pull low control for Headset jack. */
3815 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3816 
3817 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3818 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3819 
3820 	if (hp1_pin_sense || hp2_pin_sense)
3821 		msleep(2);
3822 
3823 	if (hp1_pin_sense || spec->ultra_low_power)
3824 		snd_hda_codec_write(codec, hp_pin, 0,
3825 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3826 	if (hp2_pin_sense)
3827 		snd_hda_codec_write(codec, 0x16, 0,
3828 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3829 
3830 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3831 		msleep(85);
3832 
3833 	if (hp1_pin_sense || spec->ultra_low_power)
3834 		snd_hda_codec_write(codec, hp_pin, 0,
3835 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3836 	if (hp2_pin_sense)
3837 		snd_hda_codec_write(codec, 0x16, 0,
3838 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3839 
3840 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3841 		msleep(100);
3842 
3843 	alc_auto_setup_eapd(codec, false);
3844 	alc_shutup_pins(codec);
3845 	if (spec->ultra_low_power) {
3846 		msleep(50);
3847 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3848 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3849 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3850 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3851 		msleep(30);
3852 	}
3853 
3854 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3855 	alc_enable_headset_jack_key(codec);
3856 }
3857 
3858 static void alc_default_init(struct hda_codec *codec)
3859 {
3860 	struct alc_spec *spec = codec->spec;
3861 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3862 	bool hp_pin_sense;
3863 
3864 	if (!hp_pin)
3865 		return;
3866 
3867 	msleep(30);
3868 
3869 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3870 
3871 	if (hp_pin_sense)
3872 		msleep(2);
3873 
3874 	snd_hda_codec_write(codec, hp_pin, 0,
3875 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3876 
3877 	if (hp_pin_sense)
3878 		msleep(85);
3879 
3880 	snd_hda_codec_write(codec, hp_pin, 0,
3881 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3882 
3883 	if (hp_pin_sense)
3884 		msleep(100);
3885 }
3886 
3887 static void alc_default_shutup(struct hda_codec *codec)
3888 {
3889 	struct alc_spec *spec = codec->spec;
3890 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3891 	bool hp_pin_sense;
3892 
3893 	if (!hp_pin) {
3894 		alc269_shutup(codec);
3895 		return;
3896 	}
3897 
3898 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3899 
3900 	if (hp_pin_sense)
3901 		msleep(2);
3902 
3903 	snd_hda_codec_write(codec, hp_pin, 0,
3904 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3905 
3906 	if (hp_pin_sense)
3907 		msleep(85);
3908 
3909 	if (!spec->no_shutup_pins)
3910 		snd_hda_codec_write(codec, hp_pin, 0,
3911 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3912 
3913 	if (hp_pin_sense)
3914 		msleep(100);
3915 
3916 	alc_auto_setup_eapd(codec, false);
3917 	alc_shutup_pins(codec);
3918 }
3919 
3920 static void alc294_hp_init(struct hda_codec *codec)
3921 {
3922 	struct alc_spec *spec = codec->spec;
3923 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3924 	int i, val;
3925 
3926 	if (!hp_pin)
3927 		return;
3928 
3929 	snd_hda_codec_write(codec, hp_pin, 0,
3930 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3931 
3932 	msleep(100);
3933 
3934 	if (!spec->no_shutup_pins)
3935 		snd_hda_codec_write(codec, hp_pin, 0,
3936 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3937 
3938 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3939 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3940 
3941 	/* Wait for depop procedure finish  */
3942 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3943 	for (i = 0; i < 20 && val & 0x0080; i++) {
3944 		msleep(50);
3945 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3946 	}
3947 	/* Set HP depop to auto mode */
3948 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3949 	msleep(50);
3950 }
3951 
3952 static void alc294_init(struct hda_codec *codec)
3953 {
3954 	struct alc_spec *spec = codec->spec;
3955 
3956 	/* required only at boot or S4 resume time */
3957 	if (!spec->done_hp_init ||
3958 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3959 		alc294_hp_init(codec);
3960 		spec->done_hp_init = true;
3961 	}
3962 	alc_default_init(codec);
3963 }
3964 
3965 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3966 			     unsigned int val)
3967 {
3968 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3969 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3970 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3971 }
3972 
3973 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3974 {
3975 	unsigned int val;
3976 
3977 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3978 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3979 		& 0xffff;
3980 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3981 		<< 16;
3982 	return val;
3983 }
3984 
3985 static void alc5505_dsp_halt(struct hda_codec *codec)
3986 {
3987 	unsigned int val;
3988 
3989 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3990 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3991 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3992 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3993 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3994 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3995 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3996 	val = alc5505_coef_get(codec, 0x6220);
3997 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3998 }
3999 
4000 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
4001 {
4002 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
4003 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
4004 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
4005 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
4006 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
4007 	alc5505_coef_set(codec, 0x880c, 0x00000004);
4008 }
4009 
4010 static void alc5505_dsp_init(struct hda_codec *codec)
4011 {
4012 	unsigned int val;
4013 
4014 	alc5505_dsp_halt(codec);
4015 	alc5505_dsp_back_from_halt(codec);
4016 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4017 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
4018 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4019 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4020 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4021 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4022 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4023 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4024 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
4025 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
4026 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4027 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4028 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4029 
4030 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4031 	if (val <= 3)
4032 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4033 	else
4034 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4035 
4036 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4037 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4038 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4039 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4040 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4041 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4042 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4043 
4044 #ifdef HALT_REALTEK_ALC5505
4045 	alc5505_dsp_halt(codec);
4046 #endif
4047 }
4048 
4049 #ifdef HALT_REALTEK_ALC5505
4050 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4051 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4052 #else
4053 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4054 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4055 #endif
4056 
4057 static int alc269_suspend(struct hda_codec *codec)
4058 {
4059 	struct alc_spec *spec = codec->spec;
4060 
4061 	if (spec->has_alc5505_dsp)
4062 		alc5505_dsp_suspend(codec);
4063 
4064 	return alc_suspend(codec);
4065 }
4066 
4067 static int alc269_resume(struct hda_codec *codec)
4068 {
4069 	struct alc_spec *spec = codec->spec;
4070 
4071 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4072 		alc269vb_toggle_power_output(codec, 0);
4073 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4074 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4075 		msleep(150);
4076 	}
4077 
4078 	codec->patch_ops.init(codec);
4079 
4080 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4081 		alc269vb_toggle_power_output(codec, 1);
4082 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4083 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4084 		msleep(200);
4085 	}
4086 
4087 	snd_hda_regmap_sync(codec);
4088 	hda_call_check_power_status(codec, 0x01);
4089 
4090 	/* on some machine, the BIOS will clear the codec gpio data when enter
4091 	 * suspend, and won't restore the data after resume, so we restore it
4092 	 * in the driver.
4093 	 */
4094 	if (spec->gpio_data)
4095 		alc_write_gpio_data(codec);
4096 
4097 	if (spec->has_alc5505_dsp)
4098 		alc5505_dsp_resume(codec);
4099 
4100 	return 0;
4101 }
4102 
4103 static void alc269_fixup_pincfg_no_hp_to_lineout(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_NO_HP_FIXUP;
4110 }
4111 
4112 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4113 						 const struct hda_fixup *fix,
4114 						 int action)
4115 {
4116 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4117 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4118 
4119 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4120 		snd_hda_codec_set_pincfg(codec, 0x19,
4121 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4122 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4123 }
4124 
4125 static void alc269_fixup_hweq(struct hda_codec *codec,
4126 			       const struct hda_fixup *fix, int action)
4127 {
4128 	if (action == HDA_FIXUP_ACT_INIT)
4129 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4130 }
4131 
4132 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4133 				       const struct hda_fixup *fix, int action)
4134 {
4135 	struct alc_spec *spec = codec->spec;
4136 
4137 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4138 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4139 }
4140 
4141 static void alc271_fixup_dmic(struct hda_codec *codec,
4142 			      const struct hda_fixup *fix, int action)
4143 {
4144 	static const struct hda_verb verbs[] = {
4145 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4146 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4147 		{}
4148 	};
4149 	unsigned int cfg;
4150 
4151 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4152 	    strcmp(codec->core.chip_name, "ALC269VB"))
4153 		return;
4154 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4155 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4156 		snd_hda_sequence_write(codec, verbs);
4157 }
4158 
4159 /* Fix the speaker amp after resume, etc */
4160 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4161 					  const struct hda_fixup *fix,
4162 					  int action)
4163 {
4164 	if (action == HDA_FIXUP_ACT_INIT)
4165 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4166 }
4167 
4168 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4169 				 const struct hda_fixup *fix, int action)
4170 {
4171 	struct alc_spec *spec = codec->spec;
4172 
4173 	if (action != HDA_FIXUP_ACT_PROBE)
4174 		return;
4175 
4176 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4177 	 * fix the sample rate of analog I/O to 44.1kHz
4178 	 */
4179 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4180 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4181 }
4182 
4183 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4184 				     const struct hda_fixup *fix, int action)
4185 {
4186 	/* The digital-mic unit sends PDM (differential signal) instead of
4187 	 * the standard PCM, thus you can't record a valid mono stream as is.
4188 	 * Below is a workaround specific to ALC269 to control the dmic
4189 	 * signal source as mono.
4190 	 */
4191 	if (action == HDA_FIXUP_ACT_INIT)
4192 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4193 }
4194 
4195 static void alc269_quanta_automute(struct hda_codec *codec)
4196 {
4197 	snd_hda_gen_update_outputs(codec);
4198 
4199 	alc_write_coef_idx(codec, 0x0c, 0x680);
4200 	alc_write_coef_idx(codec, 0x0c, 0x480);
4201 }
4202 
4203 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4204 				     const struct hda_fixup *fix, int action)
4205 {
4206 	struct alc_spec *spec = codec->spec;
4207 	if (action != HDA_FIXUP_ACT_PROBE)
4208 		return;
4209 	spec->gen.automute_hook = alc269_quanta_automute;
4210 }
4211 
4212 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4213 					 struct hda_jack_callback *jack)
4214 {
4215 	struct alc_spec *spec = codec->spec;
4216 	int vref;
4217 	msleep(200);
4218 	snd_hda_gen_hp_automute(codec, jack);
4219 
4220 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4221 	msleep(100);
4222 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4223 			    vref);
4224 	msleep(500);
4225 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4226 			    vref);
4227 }
4228 
4229 /*
4230  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4231  */
4232 struct hda_alc298_mbxinit {
4233 	unsigned char value_0x23;
4234 	unsigned char value_0x25;
4235 };
4236 
4237 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4238 					 const struct hda_alc298_mbxinit *initval,
4239 					 bool first)
4240 {
4241 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4242 	alc_write_coef_idx(codec, 0x26, 0xb000);
4243 
4244 	if (first)
4245 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4246 
4247 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4248 	alc_write_coef_idx(codec, 0x26, 0xf000);
4249 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4250 
4251 	if (initval->value_0x23 != 0x1e)
4252 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4253 
4254 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4255 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4256 }
4257 
4258 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4259 					   const struct hda_fixup *fix,
4260 					   int action)
4261 {
4262 	/* Initialization magic */
4263 	static const struct hda_alc298_mbxinit dac_init[] = {
4264 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4265 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4266 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4267 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4268 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4269 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4270 		{0x2f, 0x00},
4271 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4272 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4273 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4274 		{}
4275 	};
4276 	const struct hda_alc298_mbxinit *seq;
4277 
4278 	if (action != HDA_FIXUP_ACT_INIT)
4279 		return;
4280 
4281 	/* Start */
4282 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4283 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4284 	alc_write_coef_idx(codec, 0x26, 0xf000);
4285 	alc_write_coef_idx(codec, 0x22, 0x31);
4286 	alc_write_coef_idx(codec, 0x23, 0x0b);
4287 	alc_write_coef_idx(codec, 0x25, 0x00);
4288 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4289 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4290 
4291 	for (seq = dac_init; seq->value_0x23; seq++)
4292 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4293 }
4294 
4295 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4296 				     const struct hda_fixup *fix, int action)
4297 {
4298 	struct alc_spec *spec = codec->spec;
4299 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4300 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4301 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4302 	}
4303 }
4304 
4305 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4306 				bool polarity, bool on)
4307 {
4308 	unsigned int pinval;
4309 
4310 	if (!pin)
4311 		return;
4312 	if (polarity)
4313 		on = !on;
4314 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4315 	pinval &= ~AC_PINCTL_VREFEN;
4316 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4317 	/* temporarily power up/down for setting VREF */
4318 	snd_hda_power_up_pm(codec);
4319 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4320 	snd_hda_power_down_pm(codec);
4321 }
4322 
4323 /* update mute-LED according to the speaker mute state via mic VREF pin */
4324 static int vref_mute_led_set(struct led_classdev *led_cdev,
4325 			     enum led_brightness brightness)
4326 {
4327 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4328 	struct alc_spec *spec = codec->spec;
4329 
4330 	alc_update_vref_led(codec, spec->mute_led_nid,
4331 			    spec->mute_led_polarity, brightness);
4332 	return 0;
4333 }
4334 
4335 /* Make sure the led works even in runtime suspend */
4336 static unsigned int led_power_filter(struct hda_codec *codec,
4337 						  hda_nid_t nid,
4338 						  unsigned int power_state)
4339 {
4340 	struct alc_spec *spec = codec->spec;
4341 
4342 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4343 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4344 		return power_state;
4345 
4346 	/* Set pin ctl again, it might have just been set to 0 */
4347 	snd_hda_set_pin_ctl(codec, nid,
4348 			    snd_hda_codec_get_pin_target(codec, nid));
4349 
4350 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4351 }
4352 
4353 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4354 				     const struct hda_fixup *fix, int action)
4355 {
4356 	struct alc_spec *spec = codec->spec;
4357 	const struct dmi_device *dev = NULL;
4358 
4359 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4360 		return;
4361 
4362 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4363 		int pol, pin;
4364 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4365 			continue;
4366 		if (pin < 0x0a || pin >= 0x10)
4367 			break;
4368 		spec->mute_led_polarity = pol;
4369 		spec->mute_led_nid = pin - 0x0a + 0x18;
4370 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4371 		codec->power_filter = led_power_filter;
4372 		codec_dbg(codec,
4373 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4374 			   spec->mute_led_polarity);
4375 		break;
4376 	}
4377 }
4378 
4379 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4380 					  const struct hda_fixup *fix,
4381 					  int action, hda_nid_t pin)
4382 {
4383 	struct alc_spec *spec = codec->spec;
4384 
4385 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4386 		spec->mute_led_polarity = 0;
4387 		spec->mute_led_nid = pin;
4388 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4389 		codec->power_filter = led_power_filter;
4390 	}
4391 }
4392 
4393 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4394 				const struct hda_fixup *fix, int action)
4395 {
4396 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4397 }
4398 
4399 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4400 				const struct hda_fixup *fix, int action)
4401 {
4402 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4403 }
4404 
4405 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4406 				const struct hda_fixup *fix, int action)
4407 {
4408 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4409 }
4410 
4411 /* update LED status via GPIO */
4412 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4413 				int polarity, bool enabled)
4414 {
4415 	if (polarity)
4416 		enabled = !enabled;
4417 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4418 }
4419 
4420 /* turn on/off mute LED via GPIO per vmaster hook */
4421 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4422 			     enum led_brightness brightness)
4423 {
4424 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4425 	struct alc_spec *spec = codec->spec;
4426 
4427 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4428 			    spec->mute_led_polarity, !brightness);
4429 	return 0;
4430 }
4431 
4432 /* turn on/off mic-mute LED via GPIO per capture hook */
4433 static int micmute_led_set(struct led_classdev *led_cdev,
4434 			   enum led_brightness brightness)
4435 {
4436 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4437 	struct alc_spec *spec = codec->spec;
4438 
4439 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4440 			    spec->micmute_led_polarity, !brightness);
4441 	return 0;
4442 }
4443 
4444 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4445 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4446 				  int action,
4447 				  unsigned int mute_mask,
4448 				  unsigned int micmute_mask)
4449 {
4450 	struct alc_spec *spec = codec->spec;
4451 
4452 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4453 
4454 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4455 		return;
4456 	if (mute_mask) {
4457 		spec->gpio_mute_led_mask = mute_mask;
4458 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4459 	}
4460 	if (micmute_mask) {
4461 		spec->gpio_mic_led_mask = micmute_mask;
4462 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4463 	}
4464 }
4465 
4466 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4467 				const struct hda_fixup *fix, int action)
4468 {
4469 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4470 }
4471 
4472 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4473 				const struct hda_fixup *fix, int action)
4474 {
4475 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4476 }
4477 
4478 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4479 				const struct hda_fixup *fix, int action)
4480 {
4481 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4482 }
4483 
4484 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4485 				const struct hda_fixup *fix, int action)
4486 {
4487 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4488 }
4489 
4490 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4491 				const struct hda_fixup *fix, int action)
4492 {
4493 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4494 }
4495 
4496 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4497 				const struct hda_fixup *fix, int action)
4498 {
4499 	struct alc_spec *spec = codec->spec;
4500 
4501 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4502 		spec->micmute_led_polarity = 1;
4503 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4504 }
4505 
4506 /* turn on/off mic-mute LED per capture hook via VREF change */
4507 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4508 				enum led_brightness brightness)
4509 {
4510 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4511 	struct alc_spec *spec = codec->spec;
4512 
4513 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4514 			    spec->micmute_led_polarity, brightness);
4515 	return 0;
4516 }
4517 
4518 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4519 				const struct hda_fixup *fix, int action)
4520 {
4521 	struct alc_spec *spec = codec->spec;
4522 
4523 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4524 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4525 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4526 		 * enable headphone amp
4527 		 */
4528 		spec->gpio_mask |= 0x10;
4529 		spec->gpio_dir |= 0x10;
4530 		spec->cap_mute_led_nid = 0x18;
4531 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4532 		codec->power_filter = led_power_filter;
4533 	}
4534 }
4535 
4536 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4537 				   const struct hda_fixup *fix, int action)
4538 {
4539 	struct alc_spec *spec = codec->spec;
4540 
4541 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4542 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4543 		spec->cap_mute_led_nid = 0x18;
4544 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4545 		codec->power_filter = led_power_filter;
4546 	}
4547 }
4548 
4549 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4550  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4551  */
4552 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4553 				     const struct hda_fixup *fix, int action)
4554 {
4555 	struct alc_spec *spec = codec->spec;
4556 
4557 	switch (action) {
4558 	case HDA_FIXUP_ACT_PRE_PROBE:
4559 		spec->gpio_mask |= 0x01;
4560 		spec->gpio_dir |= 0x01;
4561 		break;
4562 	case HDA_FIXUP_ACT_INIT:
4563 		/* need to toggle GPIO to enable the amp */
4564 		alc_update_gpio_data(codec, 0x01, true);
4565 		msleep(100);
4566 		alc_update_gpio_data(codec, 0x01, false);
4567 		break;
4568 	}
4569 }
4570 
4571 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4572 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4573 				    struct hda_codec *codec,
4574 				    struct snd_pcm_substream *substream,
4575 				    int action)
4576 {
4577 	switch (action) {
4578 	case HDA_GEN_PCM_ACT_PREPARE:
4579 		alc_update_gpio_data(codec, 0x04, true);
4580 		break;
4581 	case HDA_GEN_PCM_ACT_CLEANUP:
4582 		alc_update_gpio_data(codec, 0x04, false);
4583 		break;
4584 	}
4585 }
4586 
4587 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4588 				      const struct hda_fixup *fix,
4589 				      int action)
4590 {
4591 	struct alc_spec *spec = codec->spec;
4592 
4593 	if (action == HDA_FIXUP_ACT_PROBE) {
4594 		spec->gpio_mask |= 0x04;
4595 		spec->gpio_dir |= 0x04;
4596 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4597 	}
4598 }
4599 
4600 static void alc_update_coef_led(struct hda_codec *codec,
4601 				struct alc_coef_led *led,
4602 				bool polarity, bool on)
4603 {
4604 	if (polarity)
4605 		on = !on;
4606 	/* temporarily power up/down for setting COEF bit */
4607 	alc_update_coef_idx(codec, led->idx, led->mask,
4608 			    on ? led->on : led->off);
4609 }
4610 
4611 /* update mute-LED according to the speaker mute state via COEF bit */
4612 static int coef_mute_led_set(struct led_classdev *led_cdev,
4613 			     enum led_brightness brightness)
4614 {
4615 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4616 	struct alc_spec *spec = codec->spec;
4617 
4618 	alc_update_coef_led(codec, &spec->mute_led_coef,
4619 			    spec->mute_led_polarity, brightness);
4620 	return 0;
4621 }
4622 
4623 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4624 					  const struct hda_fixup *fix,
4625 					  int action)
4626 {
4627 	struct alc_spec *spec = codec->spec;
4628 
4629 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4630 		spec->mute_led_polarity = 0;
4631 		spec->mute_led_coef.idx = 0x0b;
4632 		spec->mute_led_coef.mask = 1 << 3;
4633 		spec->mute_led_coef.on = 1 << 3;
4634 		spec->mute_led_coef.off = 0;
4635 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4636 	}
4637 }
4638 
4639 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4640 					  const struct hda_fixup *fix,
4641 					  int action)
4642 {
4643 	struct alc_spec *spec = codec->spec;
4644 
4645 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4646 		spec->mute_led_polarity = 0;
4647 		spec->mute_led_coef.idx = 0x34;
4648 		spec->mute_led_coef.mask = 1 << 5;
4649 		spec->mute_led_coef.on = 0;
4650 		spec->mute_led_coef.off = 1 << 5;
4651 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4652 	}
4653 }
4654 
4655 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4656 					  const struct hda_fixup *fix, int action)
4657 {
4658 	struct alc_spec *spec = codec->spec;
4659 
4660 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4661 		spec->mute_led_polarity = 0;
4662 		spec->mute_led_coef.idx = 0x07;
4663 		spec->mute_led_coef.mask = 1;
4664 		spec->mute_led_coef.on = 1;
4665 		spec->mute_led_coef.off = 0;
4666 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4667 	}
4668 }
4669 
4670 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4671 					  const struct hda_fixup *fix,
4672 					  int action)
4673 {
4674 	struct alc_spec *spec = codec->spec;
4675 
4676 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4677 		spec->mute_led_polarity = 0;
4678 		spec->mute_led_coef.idx = 0x0b;
4679 		spec->mute_led_coef.mask = 3 << 2;
4680 		spec->mute_led_coef.on = 2 << 2;
4681 		spec->mute_led_coef.off = 1 << 2;
4682 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4683 	}
4684 }
4685 
4686 /* turn on/off mic-mute LED per capture hook by coef bit */
4687 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4688 				enum led_brightness brightness)
4689 {
4690 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4691 	struct alc_spec *spec = codec->spec;
4692 
4693 	alc_update_coef_led(codec, &spec->mic_led_coef,
4694 			    spec->micmute_led_polarity, brightness);
4695 	return 0;
4696 }
4697 
4698 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4699 				const struct hda_fixup *fix, int action)
4700 {
4701 	struct alc_spec *spec = codec->spec;
4702 
4703 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4704 		spec->mic_led_coef.idx = 0x19;
4705 		spec->mic_led_coef.mask = 1 << 13;
4706 		spec->mic_led_coef.on = 1 << 13;
4707 		spec->mic_led_coef.off = 0;
4708 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4709 	}
4710 }
4711 
4712 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4713 				const struct hda_fixup *fix, int action)
4714 {
4715 	struct alc_spec *spec = codec->spec;
4716 
4717 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4718 		spec->micmute_led_polarity = 1;
4719 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4720 }
4721 
4722 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4723 				const struct hda_fixup *fix, int action)
4724 {
4725 	struct alc_spec *spec = codec->spec;
4726 
4727 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4728 		spec->mic_led_coef.idx = 0x35;
4729 		spec->mic_led_coef.mask = 3 << 2;
4730 		spec->mic_led_coef.on = 2 << 2;
4731 		spec->mic_led_coef.off = 1 << 2;
4732 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4733 	}
4734 }
4735 
4736 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4737 				const struct hda_fixup *fix, int action)
4738 {
4739 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4740 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4741 }
4742 
4743 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4744 				const struct hda_fixup *fix, int action)
4745 {
4746 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4747 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4748 }
4749 
4750 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4751 				const struct hda_fixup *fix, int action)
4752 {
4753 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4754 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4755 }
4756 
4757 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4758 				const struct hda_fixup *fix, int action)
4759 {
4760 	struct alc_spec *spec = codec->spec;
4761 
4762 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4763 		spec->cap_mute_led_nid = 0x1a;
4764 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4765 		codec->power_filter = led_power_filter;
4766 	}
4767 }
4768 
4769 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4770 				const struct hda_fixup *fix, int action)
4771 {
4772 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4773 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4774 }
4775 
4776 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4777 						  const unsigned short coefs[2])
4778 {
4779 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4780 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4781 	alc_write_coef_idx(codec, 0x26, 0xb011);
4782 }
4783 
4784 struct alc298_samsung_amp_desc {
4785 	unsigned char nid;
4786 	unsigned short init_seq[2][2];
4787 };
4788 
4789 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4790 				     const struct hda_fixup *fix, int action)
4791 {
4792 	int i, j;
4793 	static const unsigned short init_seq[][2] = {
4794 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4795 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4796 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4797 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4798 	};
4799 	static const struct alc298_samsung_amp_desc amps[] = {
4800 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4801 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4802 	};
4803 
4804 	if (action != HDA_FIXUP_ACT_INIT)
4805 		return;
4806 
4807 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4808 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4809 
4810 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4811 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4812 
4813 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4814 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4815 	}
4816 }
4817 
4818 struct alc298_samsung_v2_amp_desc {
4819 	unsigned short nid;
4820 	int init_seq_size;
4821 	unsigned short init_seq[18][2];
4822 };
4823 
4824 static const struct alc298_samsung_v2_amp_desc
4825 alc298_samsung_v2_amp_desc_tbl[] = {
4826 	{ 0x38, 18, {
4827 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4828 		{ 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4829 		{ 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4830 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4831 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4832 		{ 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4833 	}},
4834 	{ 0x39, 18, {
4835 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4836 		{ 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4837 		{ 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4838 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4839 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4840 		{ 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4841 	}},
4842 	{ 0x3c, 15, {
4843 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4844 		{ 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4845 		{ 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4846 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4847 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4848 	}},
4849 	{ 0x3d, 15, {
4850 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4851 		{ 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4852 		{ 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4853 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4854 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4855 	}}
4856 };
4857 
4858 static void alc298_samsung_v2_enable_amps(struct hda_codec *codec)
4859 {
4860 	struct alc_spec *spec = codec->spec;
4861 	static const unsigned short enable_seq[][2] = {
4862 		{ 0x203a, 0x0081 }, { 0x23ff, 0x0001 },
4863 	};
4864 	int i, j;
4865 
4866 	for (i = 0; i < spec->num_speaker_amps; i++) {
4867 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4868 		for (j = 0; j < ARRAY_SIZE(enable_seq); j++)
4869 			alc298_samsung_write_coef_pack(codec, enable_seq[j]);
4870 		codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n",
4871 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4872 	}
4873 }
4874 
4875 static void alc298_samsung_v2_disable_amps(struct hda_codec *codec)
4876 {
4877 	struct alc_spec *spec = codec->spec;
4878 	static const unsigned short disable_seq[][2] = {
4879 		{ 0x23ff, 0x0000 }, { 0x203a, 0x0080 },
4880 	};
4881 	int i, j;
4882 
4883 	for (i = 0; i < spec->num_speaker_amps; i++) {
4884 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4885 		for (j = 0; j < ARRAY_SIZE(disable_seq); j++)
4886 			alc298_samsung_write_coef_pack(codec, disable_seq[j]);
4887 		codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n",
4888 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4889 	}
4890 }
4891 
4892 static void alc298_samsung_v2_playback_hook(struct hda_pcm_stream *hinfo,
4893 				struct hda_codec *codec,
4894 				struct snd_pcm_substream *substream,
4895 				int action)
4896 {
4897 	/* Dynamically enable/disable speaker amps before and after playback */
4898 	if (action == HDA_GEN_PCM_ACT_OPEN)
4899 		alc298_samsung_v2_enable_amps(codec);
4900 	if (action == HDA_GEN_PCM_ACT_CLOSE)
4901 		alc298_samsung_v2_disable_amps(codec);
4902 }
4903 
4904 static void alc298_samsung_v2_init_amps(struct hda_codec *codec,
4905 				int num_speaker_amps)
4906 {
4907 	struct alc_spec *spec = codec->spec;
4908 	int i, j;
4909 
4910 	/* Set spec's num_speaker_amps before doing anything else */
4911 	spec->num_speaker_amps = num_speaker_amps;
4912 
4913 	/* Disable speaker amps before init to prevent any physical damage */
4914 	alc298_samsung_v2_disable_amps(codec);
4915 
4916 	/* Initialize the speaker amps */
4917 	for (i = 0; i < spec->num_speaker_amps; i++) {
4918 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4919 		for (j = 0; j < alc298_samsung_v2_amp_desc_tbl[i].init_seq_size; j++) {
4920 			alc298_samsung_write_coef_pack(codec,
4921 					alc298_samsung_v2_amp_desc_tbl[i].init_seq[j]);
4922 		}
4923 		alc_write_coef_idx(codec, 0x89, 0x0);
4924 		codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n",
4925 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4926 	}
4927 
4928 	/* register hook to enable speaker amps only when they are needed */
4929 	spec->gen.pcm_playback_hook = alc298_samsung_v2_playback_hook;
4930 }
4931 
4932 static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec,
4933 				const struct hda_fixup *fix, int action)
4934 {
4935 	if (action == HDA_FIXUP_ACT_PROBE)
4936 		alc298_samsung_v2_init_amps(codec, 2);
4937 }
4938 
4939 static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec,
4940 				const struct hda_fixup *fix, int action)
4941 {
4942 	if (action == HDA_FIXUP_ACT_PROBE)
4943 		alc298_samsung_v2_init_amps(codec, 4);
4944 }
4945 
4946 #if IS_REACHABLE(CONFIG_INPUT)
4947 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4948 				   struct hda_jack_callback *event)
4949 {
4950 	struct alc_spec *spec = codec->spec;
4951 
4952 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4953 	   send both key on and key off event for every interrupt. */
4954 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4955 	input_sync(spec->kb_dev);
4956 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4957 	input_sync(spec->kb_dev);
4958 }
4959 
4960 static int alc_register_micmute_input_device(struct hda_codec *codec)
4961 {
4962 	struct alc_spec *spec = codec->spec;
4963 	int i;
4964 
4965 	spec->kb_dev = input_allocate_device();
4966 	if (!spec->kb_dev) {
4967 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4968 		return -ENOMEM;
4969 	}
4970 
4971 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4972 
4973 	spec->kb_dev->name = "Microphone Mute Button";
4974 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4975 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4976 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4977 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4978 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4979 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4980 
4981 	if (input_register_device(spec->kb_dev)) {
4982 		codec_err(codec, "input_register_device failed\n");
4983 		input_free_device(spec->kb_dev);
4984 		spec->kb_dev = NULL;
4985 		return -ENOMEM;
4986 	}
4987 
4988 	return 0;
4989 }
4990 
4991 /* GPIO1 = set according to SKU external amp
4992  * GPIO2 = mic mute hotkey
4993  * GPIO3 = mute LED
4994  * GPIO4 = mic mute LED
4995  */
4996 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4997 					     const struct hda_fixup *fix, int action)
4998 {
4999 	struct alc_spec *spec = codec->spec;
5000 
5001 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
5002 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5003 		spec->init_amp = ALC_INIT_DEFAULT;
5004 		if (alc_register_micmute_input_device(codec) != 0)
5005 			return;
5006 
5007 		spec->gpio_mask |= 0x06;
5008 		spec->gpio_dir |= 0x02;
5009 		spec->gpio_data |= 0x02;
5010 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
5011 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
5012 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
5013 						    gpio2_mic_hotkey_event);
5014 		return;
5015 	}
5016 
5017 	if (!spec->kb_dev)
5018 		return;
5019 
5020 	switch (action) {
5021 	case HDA_FIXUP_ACT_FREE:
5022 		input_unregister_device(spec->kb_dev);
5023 		spec->kb_dev = NULL;
5024 	}
5025 }
5026 
5027 /* Line2 = mic mute hotkey
5028  * GPIO2 = mic mute LED
5029  */
5030 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
5031 					     const struct hda_fixup *fix, int action)
5032 {
5033 	struct alc_spec *spec = codec->spec;
5034 
5035 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
5036 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5037 		spec->init_amp = ALC_INIT_DEFAULT;
5038 		if (alc_register_micmute_input_device(codec) != 0)
5039 			return;
5040 
5041 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
5042 						    gpio2_mic_hotkey_event);
5043 		return;
5044 	}
5045 
5046 	if (!spec->kb_dev)
5047 		return;
5048 
5049 	switch (action) {
5050 	case HDA_FIXUP_ACT_FREE:
5051 		input_unregister_device(spec->kb_dev);
5052 		spec->kb_dev = NULL;
5053 	}
5054 }
5055 #else /* INPUT */
5056 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
5057 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
5058 #endif /* INPUT */
5059 
5060 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
5061 				const struct hda_fixup *fix, int action)
5062 {
5063 	struct alc_spec *spec = codec->spec;
5064 
5065 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
5066 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5067 		spec->cap_mute_led_nid = 0x18;
5068 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
5069 	}
5070 }
5071 
5072 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
5073 {
5074 	if (delay <= 0)
5075 		delay = 75;
5076 	snd_hda_codec_write(codec, 0x21, 0,
5077 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5078 	msleep(delay);
5079 	snd_hda_codec_write(codec, 0x21, 0,
5080 		    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5081 	msleep(delay);
5082 }
5083 
5084 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
5085 {
5086 	if (delay <= 0)
5087 		delay = 75;
5088 	snd_hda_codec_write(codec, 0x21, 0,
5089 		    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5090 	msleep(delay);
5091 	snd_hda_codec_write(codec, 0x21, 0,
5092 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5093 	msleep(delay);
5094 }
5095 
5096 static const struct coef_fw alc225_pre_hsmode[] = {
5097 	UPDATE_COEF(0x4a, 1<<8, 0),
5098 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
5099 	UPDATE_COEF(0x63, 3<<14, 3<<14),
5100 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
5101 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
5102 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
5103 	UPDATE_COEF(0x4a, 3<<10, 0),
5104 	{}
5105 };
5106 
5107 static void alc_headset_mode_unplugged(struct hda_codec *codec)
5108 {
5109 	struct alc_spec *spec = codec->spec;
5110 	static const struct coef_fw coef0255[] = {
5111 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
5112 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5113 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5114 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5115 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
5116 		{}
5117 	};
5118 	static const struct coef_fw coef0256[] = {
5119 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
5120 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5121 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5122 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
5123 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5124 		{}
5125 	};
5126 	static const struct coef_fw coef0233[] = {
5127 		WRITE_COEF(0x1b, 0x0c0b),
5128 		WRITE_COEF(0x45, 0xc429),
5129 		UPDATE_COEF(0x35, 0x4000, 0),
5130 		WRITE_COEF(0x06, 0x2104),
5131 		WRITE_COEF(0x1a, 0x0001),
5132 		WRITE_COEF(0x26, 0x0004),
5133 		WRITE_COEF(0x32, 0x42a3),
5134 		{}
5135 	};
5136 	static const struct coef_fw coef0288[] = {
5137 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5138 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5139 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5140 		UPDATE_COEF(0x66, 0x0008, 0),
5141 		UPDATE_COEF(0x67, 0x2000, 0),
5142 		{}
5143 	};
5144 	static const struct coef_fw coef0298[] = {
5145 		UPDATE_COEF(0x19, 0x1300, 0x0300),
5146 		{}
5147 	};
5148 	static const struct coef_fw coef0292[] = {
5149 		WRITE_COEF(0x76, 0x000e),
5150 		WRITE_COEF(0x6c, 0x2400),
5151 		WRITE_COEF(0x18, 0x7308),
5152 		WRITE_COEF(0x6b, 0xc429),
5153 		{}
5154 	};
5155 	static const struct coef_fw coef0293[] = {
5156 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
5157 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
5158 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
5159 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
5160 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5161 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5162 		{}
5163 	};
5164 	static const struct coef_fw coef0668[] = {
5165 		WRITE_COEF(0x15, 0x0d40),
5166 		WRITE_COEF(0xb7, 0x802b),
5167 		{}
5168 	};
5169 	static const struct coef_fw coef0225[] = {
5170 		UPDATE_COEF(0x63, 3<<14, 0),
5171 		{}
5172 	};
5173 	static const struct coef_fw coef0274[] = {
5174 		UPDATE_COEF(0x4a, 0x0100, 0),
5175 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5176 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
5177 		UPDATE_COEF(0x4a, 0x0010, 0),
5178 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5179 		WRITE_COEF(0x45, 0x5289),
5180 		UPDATE_COEF(0x4a, 0x0c00, 0),
5181 		{}
5182 	};
5183 
5184 	if (spec->no_internal_mic_pin) {
5185 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5186 		return;
5187 	}
5188 
5189 	switch (codec->core.vendor_id) {
5190 	case 0x10ec0255:
5191 		alc_process_coef_fw(codec, coef0255);
5192 		break;
5193 	case 0x10ec0230:
5194 	case 0x10ec0236:
5195 	case 0x10ec0256:
5196 	case 0x19e58326:
5197 		alc_hp_mute_disable(codec, 75);
5198 		alc_process_coef_fw(codec, coef0256);
5199 		break;
5200 	case 0x10ec0234:
5201 	case 0x10ec0274:
5202 	case 0x10ec0294:
5203 		alc_process_coef_fw(codec, coef0274);
5204 		break;
5205 	case 0x10ec0233:
5206 	case 0x10ec0283:
5207 		alc_process_coef_fw(codec, coef0233);
5208 		break;
5209 	case 0x10ec0286:
5210 	case 0x10ec0288:
5211 		alc_process_coef_fw(codec, coef0288);
5212 		break;
5213 	case 0x10ec0298:
5214 		alc_process_coef_fw(codec, coef0298);
5215 		alc_process_coef_fw(codec, coef0288);
5216 		break;
5217 	case 0x10ec0292:
5218 		alc_process_coef_fw(codec, coef0292);
5219 		break;
5220 	case 0x10ec0293:
5221 		alc_process_coef_fw(codec, coef0293);
5222 		break;
5223 	case 0x10ec0668:
5224 		alc_process_coef_fw(codec, coef0668);
5225 		break;
5226 	case 0x10ec0215:
5227 	case 0x10ec0225:
5228 	case 0x10ec0285:
5229 	case 0x10ec0295:
5230 	case 0x10ec0289:
5231 	case 0x10ec0299:
5232 		alc_hp_mute_disable(codec, 75);
5233 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5234 		alc_process_coef_fw(codec, coef0225);
5235 		break;
5236 	case 0x10ec0867:
5237 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5238 		break;
5239 	}
5240 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5241 }
5242 
5243 
5244 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5245 				    hda_nid_t mic_pin)
5246 {
5247 	static const struct coef_fw coef0255[] = {
5248 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5249 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5250 		{}
5251 	};
5252 	static const struct coef_fw coef0256[] = {
5253 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5254 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5255 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5256 		{}
5257 	};
5258 	static const struct coef_fw coef0233[] = {
5259 		UPDATE_COEF(0x35, 0, 1<<14),
5260 		WRITE_COEF(0x06, 0x2100),
5261 		WRITE_COEF(0x1a, 0x0021),
5262 		WRITE_COEF(0x26, 0x008c),
5263 		{}
5264 	};
5265 	static const struct coef_fw coef0288[] = {
5266 		UPDATE_COEF(0x4f, 0x00c0, 0),
5267 		UPDATE_COEF(0x50, 0x2000, 0),
5268 		UPDATE_COEF(0x56, 0x0006, 0),
5269 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5270 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5271 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5272 		{}
5273 	};
5274 	static const struct coef_fw coef0292[] = {
5275 		WRITE_COEF(0x19, 0xa208),
5276 		WRITE_COEF(0x2e, 0xacf0),
5277 		{}
5278 	};
5279 	static const struct coef_fw coef0293[] = {
5280 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5281 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5282 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5283 		{}
5284 	};
5285 	static const struct coef_fw coef0688[] = {
5286 		WRITE_COEF(0xb7, 0x802b),
5287 		WRITE_COEF(0xb5, 0x1040),
5288 		UPDATE_COEF(0xc3, 0, 1<<12),
5289 		{}
5290 	};
5291 	static const struct coef_fw coef0225[] = {
5292 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5293 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5294 		UPDATE_COEF(0x63, 3<<14, 0),
5295 		{}
5296 	};
5297 	static const struct coef_fw coef0274[] = {
5298 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5299 		UPDATE_COEF(0x4a, 0x0010, 0),
5300 		UPDATE_COEF(0x6b, 0xf000, 0),
5301 		{}
5302 	};
5303 
5304 	switch (codec->core.vendor_id) {
5305 	case 0x10ec0255:
5306 		alc_write_coef_idx(codec, 0x45, 0xc489);
5307 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5308 		alc_process_coef_fw(codec, coef0255);
5309 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5310 		break;
5311 	case 0x10ec0230:
5312 	case 0x10ec0236:
5313 	case 0x10ec0256:
5314 	case 0x19e58326:
5315 		alc_write_coef_idx(codec, 0x45, 0xc489);
5316 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5317 		alc_process_coef_fw(codec, coef0256);
5318 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5319 		break;
5320 	case 0x10ec0234:
5321 	case 0x10ec0274:
5322 	case 0x10ec0294:
5323 		alc_write_coef_idx(codec, 0x45, 0x4689);
5324 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5325 		alc_process_coef_fw(codec, coef0274);
5326 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5327 		break;
5328 	case 0x10ec0233:
5329 	case 0x10ec0283:
5330 		alc_write_coef_idx(codec, 0x45, 0xc429);
5331 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5332 		alc_process_coef_fw(codec, coef0233);
5333 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5334 		break;
5335 	case 0x10ec0286:
5336 	case 0x10ec0288:
5337 	case 0x10ec0298:
5338 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5339 		alc_process_coef_fw(codec, coef0288);
5340 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5341 		break;
5342 	case 0x10ec0292:
5343 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5344 		alc_process_coef_fw(codec, coef0292);
5345 		break;
5346 	case 0x10ec0293:
5347 		/* Set to TRS mode */
5348 		alc_write_coef_idx(codec, 0x45, 0xc429);
5349 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5350 		alc_process_coef_fw(codec, coef0293);
5351 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5352 		break;
5353 	case 0x10ec0867:
5354 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5355 		fallthrough;
5356 	case 0x10ec0221:
5357 	case 0x10ec0662:
5358 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5359 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5360 		break;
5361 	case 0x10ec0668:
5362 		alc_write_coef_idx(codec, 0x11, 0x0001);
5363 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5364 		alc_process_coef_fw(codec, coef0688);
5365 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5366 		break;
5367 	case 0x10ec0215:
5368 	case 0x10ec0225:
5369 	case 0x10ec0285:
5370 	case 0x10ec0295:
5371 	case 0x10ec0289:
5372 	case 0x10ec0299:
5373 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5374 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5375 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5376 		alc_process_coef_fw(codec, coef0225);
5377 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5378 		break;
5379 	}
5380 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5381 }
5382 
5383 static void alc_headset_mode_default(struct hda_codec *codec)
5384 {
5385 	static const struct coef_fw coef0225[] = {
5386 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5387 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5388 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5389 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5390 		UPDATE_COEF(0x63, 3<<14, 0),
5391 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5392 		{}
5393 	};
5394 	static const struct coef_fw coef0255[] = {
5395 		WRITE_COEF(0x45, 0xc089),
5396 		WRITE_COEF(0x45, 0xc489),
5397 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5398 		WRITE_COEF(0x49, 0x0049),
5399 		{}
5400 	};
5401 	static const struct coef_fw coef0256[] = {
5402 		WRITE_COEF(0x45, 0xc489),
5403 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5404 		WRITE_COEF(0x49, 0x0049),
5405 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5406 		WRITE_COEF(0x06, 0x6100),
5407 		{}
5408 	};
5409 	static const struct coef_fw coef0233[] = {
5410 		WRITE_COEF(0x06, 0x2100),
5411 		WRITE_COEF(0x32, 0x4ea3),
5412 		{}
5413 	};
5414 	static const struct coef_fw coef0288[] = {
5415 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5416 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5417 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5418 		UPDATE_COEF(0x66, 0x0008, 0),
5419 		UPDATE_COEF(0x67, 0x2000, 0),
5420 		{}
5421 	};
5422 	static const struct coef_fw coef0292[] = {
5423 		WRITE_COEF(0x76, 0x000e),
5424 		WRITE_COEF(0x6c, 0x2400),
5425 		WRITE_COEF(0x6b, 0xc429),
5426 		WRITE_COEF(0x18, 0x7308),
5427 		{}
5428 	};
5429 	static const struct coef_fw coef0293[] = {
5430 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5431 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5432 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5433 		{}
5434 	};
5435 	static const struct coef_fw coef0688[] = {
5436 		WRITE_COEF(0x11, 0x0041),
5437 		WRITE_COEF(0x15, 0x0d40),
5438 		WRITE_COEF(0xb7, 0x802b),
5439 		{}
5440 	};
5441 	static const struct coef_fw coef0274[] = {
5442 		WRITE_COEF(0x45, 0x4289),
5443 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5444 		UPDATE_COEF(0x6b, 0x0f00, 0),
5445 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5446 		{}
5447 	};
5448 
5449 	switch (codec->core.vendor_id) {
5450 	case 0x10ec0215:
5451 	case 0x10ec0225:
5452 	case 0x10ec0285:
5453 	case 0x10ec0295:
5454 	case 0x10ec0289:
5455 	case 0x10ec0299:
5456 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5457 		alc_process_coef_fw(codec, coef0225);
5458 		alc_hp_enable_unmute(codec, 75);
5459 		break;
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_write_coef_idx(codec, 0x1b, 0x0e4b);
5468 		alc_write_coef_idx(codec, 0x45, 0xc089);
5469 		msleep(50);
5470 		alc_process_coef_fw(codec, coef0256);
5471 		alc_hp_enable_unmute(codec, 75);
5472 		break;
5473 	case 0x10ec0234:
5474 	case 0x10ec0274:
5475 	case 0x10ec0294:
5476 		alc_process_coef_fw(codec, coef0274);
5477 		break;
5478 	case 0x10ec0233:
5479 	case 0x10ec0283:
5480 		alc_process_coef_fw(codec, coef0233);
5481 		break;
5482 	case 0x10ec0286:
5483 	case 0x10ec0288:
5484 	case 0x10ec0298:
5485 		alc_process_coef_fw(codec, coef0288);
5486 		break;
5487 	case 0x10ec0292:
5488 		alc_process_coef_fw(codec, coef0292);
5489 		break;
5490 	case 0x10ec0293:
5491 		alc_process_coef_fw(codec, coef0293);
5492 		break;
5493 	case 0x10ec0668:
5494 		alc_process_coef_fw(codec, coef0688);
5495 		break;
5496 	case 0x10ec0867:
5497 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5498 		break;
5499 	}
5500 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5501 }
5502 
5503 /* Iphone type */
5504 static void alc_headset_mode_ctia(struct hda_codec *codec)
5505 {
5506 	int val;
5507 
5508 	static const struct coef_fw coef0255[] = {
5509 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5510 		WRITE_COEF(0x1b, 0x0c2b),
5511 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5512 		{}
5513 	};
5514 	static const struct coef_fw coef0256[] = {
5515 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5516 		WRITE_COEF(0x1b, 0x0e6b),
5517 		{}
5518 	};
5519 	static const struct coef_fw coef0233[] = {
5520 		WRITE_COEF(0x45, 0xd429),
5521 		WRITE_COEF(0x1b, 0x0c2b),
5522 		WRITE_COEF(0x32, 0x4ea3),
5523 		{}
5524 	};
5525 	static const struct coef_fw coef0288[] = {
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 		{}
5531 	};
5532 	static const struct coef_fw coef0292[] = {
5533 		WRITE_COEF(0x6b, 0xd429),
5534 		WRITE_COEF(0x76, 0x0008),
5535 		WRITE_COEF(0x18, 0x7388),
5536 		{}
5537 	};
5538 	static const struct coef_fw coef0293[] = {
5539 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5540 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5541 		{}
5542 	};
5543 	static const struct coef_fw coef0688[] = {
5544 		WRITE_COEF(0x11, 0x0001),
5545 		WRITE_COEF(0x15, 0x0d60),
5546 		WRITE_COEF(0xc3, 0x0000),
5547 		{}
5548 	};
5549 	static const struct coef_fw coef0225_1[] = {
5550 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5551 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5552 		{}
5553 	};
5554 	static const struct coef_fw coef0225_2[] = {
5555 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5556 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5557 		{}
5558 	};
5559 
5560 	switch (codec->core.vendor_id) {
5561 	case 0x10ec0255:
5562 		alc_process_coef_fw(codec, coef0255);
5563 		break;
5564 	case 0x10ec0230:
5565 	case 0x10ec0236:
5566 	case 0x10ec0256:
5567 	case 0x19e58326:
5568 		alc_process_coef_fw(codec, coef0256);
5569 		alc_hp_enable_unmute(codec, 75);
5570 		break;
5571 	case 0x10ec0234:
5572 	case 0x10ec0274:
5573 	case 0x10ec0294:
5574 		alc_write_coef_idx(codec, 0x45, 0xd689);
5575 		break;
5576 	case 0x10ec0233:
5577 	case 0x10ec0283:
5578 		alc_process_coef_fw(codec, coef0233);
5579 		break;
5580 	case 0x10ec0298:
5581 		val = alc_read_coef_idx(codec, 0x50);
5582 		if (val & (1 << 12)) {
5583 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5584 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5585 			msleep(300);
5586 		} else {
5587 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5588 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5589 			msleep(300);
5590 		}
5591 		break;
5592 	case 0x10ec0286:
5593 	case 0x10ec0288:
5594 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5595 		msleep(300);
5596 		alc_process_coef_fw(codec, coef0288);
5597 		break;
5598 	case 0x10ec0292:
5599 		alc_process_coef_fw(codec, coef0292);
5600 		break;
5601 	case 0x10ec0293:
5602 		alc_process_coef_fw(codec, coef0293);
5603 		break;
5604 	case 0x10ec0668:
5605 		alc_process_coef_fw(codec, coef0688);
5606 		break;
5607 	case 0x10ec0215:
5608 	case 0x10ec0225:
5609 	case 0x10ec0285:
5610 	case 0x10ec0295:
5611 	case 0x10ec0289:
5612 	case 0x10ec0299:
5613 		val = alc_read_coef_idx(codec, 0x45);
5614 		if (val & (1 << 9))
5615 			alc_process_coef_fw(codec, coef0225_2);
5616 		else
5617 			alc_process_coef_fw(codec, coef0225_1);
5618 		alc_hp_enable_unmute(codec, 75);
5619 		break;
5620 	case 0x10ec0867:
5621 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5622 		break;
5623 	}
5624 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5625 }
5626 
5627 /* Nokia type */
5628 static void alc_headset_mode_omtp(struct hda_codec *codec)
5629 {
5630 	static const struct coef_fw coef0255[] = {
5631 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5632 		WRITE_COEF(0x1b, 0x0c2b),
5633 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5634 		{}
5635 	};
5636 	static const struct coef_fw coef0256[] = {
5637 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5638 		WRITE_COEF(0x1b, 0x0e6b),
5639 		{}
5640 	};
5641 	static const struct coef_fw coef0233[] = {
5642 		WRITE_COEF(0x45, 0xe429),
5643 		WRITE_COEF(0x1b, 0x0c2b),
5644 		WRITE_COEF(0x32, 0x4ea3),
5645 		{}
5646 	};
5647 	static const struct coef_fw coef0288[] = {
5648 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5649 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5650 		UPDATE_COEF(0x66, 0x0008, 0),
5651 		UPDATE_COEF(0x67, 0x2000, 0),
5652 		{}
5653 	};
5654 	static const struct coef_fw coef0292[] = {
5655 		WRITE_COEF(0x6b, 0xe429),
5656 		WRITE_COEF(0x76, 0x0008),
5657 		WRITE_COEF(0x18, 0x7388),
5658 		{}
5659 	};
5660 	static const struct coef_fw coef0293[] = {
5661 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5662 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5663 		{}
5664 	};
5665 	static const struct coef_fw coef0688[] = {
5666 		WRITE_COEF(0x11, 0x0001),
5667 		WRITE_COEF(0x15, 0x0d50),
5668 		WRITE_COEF(0xc3, 0x0000),
5669 		{}
5670 	};
5671 	static const struct coef_fw coef0225[] = {
5672 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5673 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5674 		{}
5675 	};
5676 
5677 	switch (codec->core.vendor_id) {
5678 	case 0x10ec0255:
5679 		alc_process_coef_fw(codec, coef0255);
5680 		break;
5681 	case 0x10ec0230:
5682 	case 0x10ec0236:
5683 	case 0x10ec0256:
5684 	case 0x19e58326:
5685 		alc_process_coef_fw(codec, coef0256);
5686 		alc_hp_enable_unmute(codec, 75);
5687 		break;
5688 	case 0x10ec0234:
5689 	case 0x10ec0274:
5690 	case 0x10ec0294:
5691 		alc_write_coef_idx(codec, 0x45, 0xe689);
5692 		break;
5693 	case 0x10ec0233:
5694 	case 0x10ec0283:
5695 		alc_process_coef_fw(codec, coef0233);
5696 		break;
5697 	case 0x10ec0298:
5698 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5699 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5700 		msleep(300);
5701 		break;
5702 	case 0x10ec0286:
5703 	case 0x10ec0288:
5704 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5705 		msleep(300);
5706 		alc_process_coef_fw(codec, coef0288);
5707 		break;
5708 	case 0x10ec0292:
5709 		alc_process_coef_fw(codec, coef0292);
5710 		break;
5711 	case 0x10ec0293:
5712 		alc_process_coef_fw(codec, coef0293);
5713 		break;
5714 	case 0x10ec0668:
5715 		alc_process_coef_fw(codec, coef0688);
5716 		break;
5717 	case 0x10ec0215:
5718 	case 0x10ec0225:
5719 	case 0x10ec0285:
5720 	case 0x10ec0295:
5721 	case 0x10ec0289:
5722 	case 0x10ec0299:
5723 		alc_process_coef_fw(codec, coef0225);
5724 		alc_hp_enable_unmute(codec, 75);
5725 		break;
5726 	}
5727 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5728 }
5729 
5730 static void alc_determine_headset_type(struct hda_codec *codec)
5731 {
5732 	int val;
5733 	bool is_ctia = false;
5734 	struct alc_spec *spec = codec->spec;
5735 	static const struct coef_fw coef0255[] = {
5736 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5737 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5738  conteol) */
5739 		{}
5740 	};
5741 	static const struct coef_fw coef0288[] = {
5742 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5743 		{}
5744 	};
5745 	static const struct coef_fw coef0298[] = {
5746 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5747 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5748 		UPDATE_COEF(0x66, 0x0008, 0),
5749 		UPDATE_COEF(0x67, 0x2000, 0),
5750 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5751 		{}
5752 	};
5753 	static const struct coef_fw coef0293[] = {
5754 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5755 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5756 		{}
5757 	};
5758 	static const struct coef_fw coef0688[] = {
5759 		WRITE_COEF(0x11, 0x0001),
5760 		WRITE_COEF(0xb7, 0x802b),
5761 		WRITE_COEF(0x15, 0x0d60),
5762 		WRITE_COEF(0xc3, 0x0c00),
5763 		{}
5764 	};
5765 	static const struct coef_fw coef0274[] = {
5766 		UPDATE_COEF(0x4a, 0x0010, 0),
5767 		UPDATE_COEF(0x4a, 0x8000, 0),
5768 		WRITE_COEF(0x45, 0xd289),
5769 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5770 		{}
5771 	};
5772 
5773 	if (spec->no_internal_mic_pin) {
5774 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5775 		return;
5776 	}
5777 
5778 	switch (codec->core.vendor_id) {
5779 	case 0x10ec0255:
5780 		alc_process_coef_fw(codec, coef0255);
5781 		msleep(300);
5782 		val = alc_read_coef_idx(codec, 0x46);
5783 		is_ctia = (val & 0x0070) == 0x0070;
5784 		break;
5785 	case 0x10ec0230:
5786 	case 0x10ec0236:
5787 	case 0x10ec0256:
5788 	case 0x19e58326:
5789 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5790 		alc_write_coef_idx(codec, 0x06, 0x6104);
5791 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5792 
5793 		alc_process_coef_fw(codec, coef0255);
5794 		msleep(300);
5795 		val = alc_read_coef_idx(codec, 0x46);
5796 		is_ctia = (val & 0x0070) == 0x0070;
5797 		if (!is_ctia) {
5798 			alc_write_coef_idx(codec, 0x45, 0xe089);
5799 			msleep(100);
5800 			val = alc_read_coef_idx(codec, 0x46);
5801 			if ((val & 0x0070) == 0x0070)
5802 				is_ctia = false;
5803 			else
5804 				is_ctia = true;
5805 		}
5806 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5807 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5808 		break;
5809 	case 0x10ec0234:
5810 	case 0x10ec0274:
5811 	case 0x10ec0294:
5812 		alc_process_coef_fw(codec, coef0274);
5813 		msleep(850);
5814 		val = alc_read_coef_idx(codec, 0x46);
5815 		is_ctia = (val & 0x00f0) == 0x00f0;
5816 		break;
5817 	case 0x10ec0233:
5818 	case 0x10ec0283:
5819 		alc_write_coef_idx(codec, 0x45, 0xd029);
5820 		msleep(300);
5821 		val = alc_read_coef_idx(codec, 0x46);
5822 		is_ctia = (val & 0x0070) == 0x0070;
5823 		break;
5824 	case 0x10ec0298:
5825 		snd_hda_codec_write(codec, 0x21, 0,
5826 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5827 		msleep(100);
5828 		snd_hda_codec_write(codec, 0x21, 0,
5829 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5830 		msleep(200);
5831 
5832 		val = alc_read_coef_idx(codec, 0x50);
5833 		if (val & (1 << 12)) {
5834 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5835 			alc_process_coef_fw(codec, coef0288);
5836 			msleep(350);
5837 			val = alc_read_coef_idx(codec, 0x50);
5838 			is_ctia = (val & 0x0070) == 0x0070;
5839 		} else {
5840 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5841 			alc_process_coef_fw(codec, coef0288);
5842 			msleep(350);
5843 			val = alc_read_coef_idx(codec, 0x50);
5844 			is_ctia = (val & 0x0070) == 0x0070;
5845 		}
5846 		alc_process_coef_fw(codec, coef0298);
5847 		snd_hda_codec_write(codec, 0x21, 0,
5848 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5849 		msleep(75);
5850 		snd_hda_codec_write(codec, 0x21, 0,
5851 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5852 		break;
5853 	case 0x10ec0286:
5854 	case 0x10ec0288:
5855 		alc_process_coef_fw(codec, coef0288);
5856 		msleep(350);
5857 		val = alc_read_coef_idx(codec, 0x50);
5858 		is_ctia = (val & 0x0070) == 0x0070;
5859 		break;
5860 	case 0x10ec0292:
5861 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5862 		msleep(300);
5863 		val = alc_read_coef_idx(codec, 0x6c);
5864 		is_ctia = (val & 0x001c) == 0x001c;
5865 		break;
5866 	case 0x10ec0293:
5867 		alc_process_coef_fw(codec, coef0293);
5868 		msleep(300);
5869 		val = alc_read_coef_idx(codec, 0x46);
5870 		is_ctia = (val & 0x0070) == 0x0070;
5871 		break;
5872 	case 0x10ec0668:
5873 		alc_process_coef_fw(codec, coef0688);
5874 		msleep(300);
5875 		val = alc_read_coef_idx(codec, 0xbe);
5876 		is_ctia = (val & 0x1c02) == 0x1c02;
5877 		break;
5878 	case 0x10ec0215:
5879 	case 0x10ec0225:
5880 	case 0x10ec0285:
5881 	case 0x10ec0295:
5882 	case 0x10ec0289:
5883 	case 0x10ec0299:
5884 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5885 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5886 		val = alc_read_coef_idx(codec, 0x45);
5887 		if (val & (1 << 9)) {
5888 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5889 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5890 			msleep(800);
5891 			val = alc_read_coef_idx(codec, 0x46);
5892 			is_ctia = (val & 0x00f0) == 0x00f0;
5893 		} else {
5894 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5895 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5896 			msleep(800);
5897 			val = alc_read_coef_idx(codec, 0x46);
5898 			is_ctia = (val & 0x00f0) == 0x00f0;
5899 		}
5900 		if (!is_ctia) {
5901 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5902 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5903 			msleep(100);
5904 			val = alc_read_coef_idx(codec, 0x46);
5905 			if ((val & 0x00f0) == 0x00f0)
5906 				is_ctia = false;
5907 			else
5908 				is_ctia = true;
5909 		}
5910 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5911 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5912 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5913 		break;
5914 	case 0x10ec0867:
5915 		is_ctia = true;
5916 		break;
5917 	}
5918 
5919 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5920 		    is_ctia ? "yes" : "no");
5921 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5922 }
5923 
5924 static void alc_update_headset_mode(struct hda_codec *codec)
5925 {
5926 	struct alc_spec *spec = codec->spec;
5927 
5928 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5929 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5930 
5931 	int new_headset_mode;
5932 
5933 	if (!snd_hda_jack_detect(codec, hp_pin))
5934 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5935 	else if (mux_pin == spec->headset_mic_pin)
5936 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5937 	else if (mux_pin == spec->headphone_mic_pin)
5938 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5939 	else
5940 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5941 
5942 	if (new_headset_mode == spec->current_headset_mode) {
5943 		snd_hda_gen_update_outputs(codec);
5944 		return;
5945 	}
5946 
5947 	switch (new_headset_mode) {
5948 	case ALC_HEADSET_MODE_UNPLUGGED:
5949 		alc_headset_mode_unplugged(codec);
5950 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5951 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5952 		spec->gen.hp_jack_present = false;
5953 		break;
5954 	case ALC_HEADSET_MODE_HEADSET:
5955 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5956 			alc_determine_headset_type(codec);
5957 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5958 			alc_headset_mode_ctia(codec);
5959 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5960 			alc_headset_mode_omtp(codec);
5961 		spec->gen.hp_jack_present = true;
5962 		break;
5963 	case ALC_HEADSET_MODE_MIC:
5964 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5965 		spec->gen.hp_jack_present = false;
5966 		break;
5967 	case ALC_HEADSET_MODE_HEADPHONE:
5968 		alc_headset_mode_default(codec);
5969 		spec->gen.hp_jack_present = true;
5970 		break;
5971 	}
5972 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5973 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5974 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5975 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5976 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5977 						  PIN_VREFHIZ);
5978 	}
5979 	spec->current_headset_mode = new_headset_mode;
5980 
5981 	snd_hda_gen_update_outputs(codec);
5982 }
5983 
5984 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5985 					 struct snd_kcontrol *kcontrol,
5986 					 struct snd_ctl_elem_value *ucontrol)
5987 {
5988 	alc_update_headset_mode(codec);
5989 }
5990 
5991 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5992 				       struct hda_jack_callback *jack)
5993 {
5994 	snd_hda_gen_hp_automute(codec, jack);
5995 	alc_update_headset_mode(codec);
5996 }
5997 
5998 static void alc_probe_headset_mode(struct hda_codec *codec)
5999 {
6000 	int i;
6001 	struct alc_spec *spec = codec->spec;
6002 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6003 
6004 	/* Find mic pins */
6005 	for (i = 0; i < cfg->num_inputs; i++) {
6006 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
6007 			spec->headset_mic_pin = cfg->inputs[i].pin;
6008 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
6009 			spec->headphone_mic_pin = cfg->inputs[i].pin;
6010 	}
6011 
6012 	WARN_ON(spec->gen.cap_sync_hook);
6013 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
6014 	spec->gen.automute_hook = alc_update_headset_mode;
6015 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
6016 }
6017 
6018 static void alc_fixup_headset_mode(struct hda_codec *codec,
6019 				const struct hda_fixup *fix, int action)
6020 {
6021 	struct alc_spec *spec = codec->spec;
6022 
6023 	switch (action) {
6024 	case HDA_FIXUP_ACT_PRE_PROBE:
6025 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
6026 		break;
6027 	case HDA_FIXUP_ACT_PROBE:
6028 		alc_probe_headset_mode(codec);
6029 		break;
6030 	case HDA_FIXUP_ACT_INIT:
6031 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
6032 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
6033 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
6034 		}
6035 		alc_update_headset_mode(codec);
6036 		break;
6037 	}
6038 }
6039 
6040 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
6041 				const struct hda_fixup *fix, int action)
6042 {
6043 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6044 		struct alc_spec *spec = codec->spec;
6045 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6046 	}
6047 	else
6048 		alc_fixup_headset_mode(codec, fix, action);
6049 }
6050 
6051 static void alc255_set_default_jack_type(struct hda_codec *codec)
6052 {
6053 	/* Set to iphone type */
6054 	static const struct coef_fw alc255fw[] = {
6055 		WRITE_COEF(0x1b, 0x880b),
6056 		WRITE_COEF(0x45, 0xd089),
6057 		WRITE_COEF(0x1b, 0x080b),
6058 		WRITE_COEF(0x46, 0x0004),
6059 		WRITE_COEF(0x1b, 0x0c0b),
6060 		{}
6061 	};
6062 	static const struct coef_fw alc256fw[] = {
6063 		WRITE_COEF(0x1b, 0x884b),
6064 		WRITE_COEF(0x45, 0xd089),
6065 		WRITE_COEF(0x1b, 0x084b),
6066 		WRITE_COEF(0x46, 0x0004),
6067 		WRITE_COEF(0x1b, 0x0c4b),
6068 		{}
6069 	};
6070 	switch (codec->core.vendor_id) {
6071 	case 0x10ec0255:
6072 		alc_process_coef_fw(codec, alc255fw);
6073 		break;
6074 	case 0x10ec0230:
6075 	case 0x10ec0236:
6076 	case 0x10ec0256:
6077 	case 0x19e58326:
6078 		alc_process_coef_fw(codec, alc256fw);
6079 		break;
6080 	}
6081 	msleep(30);
6082 }
6083 
6084 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
6085 				const struct hda_fixup *fix, int action)
6086 {
6087 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6088 		alc255_set_default_jack_type(codec);
6089 	}
6090 	alc_fixup_headset_mode(codec, fix, action);
6091 }
6092 
6093 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
6094 				const struct hda_fixup *fix, int action)
6095 {
6096 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6097 		struct alc_spec *spec = codec->spec;
6098 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6099 		alc255_set_default_jack_type(codec);
6100 	}
6101 	else
6102 		alc_fixup_headset_mode(codec, fix, action);
6103 }
6104 
6105 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
6106 				       struct hda_jack_callback *jack)
6107 {
6108 	struct alc_spec *spec = codec->spec;
6109 
6110 	alc_update_headset_jack_cb(codec, jack);
6111 	/* Headset Mic enable or disable, only for Dell Dino */
6112 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
6113 }
6114 
6115 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
6116 				const struct hda_fixup *fix, int action)
6117 {
6118 	alc_fixup_headset_mode(codec, fix, action);
6119 	if (action == HDA_FIXUP_ACT_PROBE) {
6120 		struct alc_spec *spec = codec->spec;
6121 		/* toggled via hp_automute_hook */
6122 		spec->gpio_mask |= 0x40;
6123 		spec->gpio_dir |= 0x40;
6124 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
6125 	}
6126 }
6127 
6128 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
6129 					const struct hda_fixup *fix, int action)
6130 {
6131 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6132 		struct alc_spec *spec = codec->spec;
6133 		spec->gen.auto_mute_via_amp = 1;
6134 	}
6135 }
6136 
6137 static void alc_fixup_no_shutup(struct hda_codec *codec,
6138 				const struct hda_fixup *fix, int action)
6139 {
6140 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6141 		struct alc_spec *spec = codec->spec;
6142 		spec->no_shutup_pins = 1;
6143 	}
6144 }
6145 
6146 static void alc_fixup_disable_aamix(struct hda_codec *codec,
6147 				    const struct hda_fixup *fix, int action)
6148 {
6149 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6150 		struct alc_spec *spec = codec->spec;
6151 		/* Disable AA-loopback as it causes white noise */
6152 		spec->gen.mixer_nid = 0;
6153 	}
6154 }
6155 
6156 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
6157 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
6158 				  const struct hda_fixup *fix, int action)
6159 {
6160 	static const struct hda_pintbl pincfgs[] = {
6161 		{ 0x16, 0x21211010 }, /* dock headphone */
6162 		{ 0x19, 0x21a11010 }, /* dock mic */
6163 		{ }
6164 	};
6165 	struct alc_spec *spec = codec->spec;
6166 
6167 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6168 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6169 		codec->power_save_node = 0; /* avoid click noises */
6170 		snd_hda_apply_pincfgs(codec, pincfgs);
6171 	}
6172 }
6173 
6174 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6175 				  const struct hda_fixup *fix, int action)
6176 {
6177 	static const struct hda_pintbl pincfgs[] = {
6178 		{ 0x17, 0x21211010 }, /* dock headphone */
6179 		{ 0x19, 0x21a11010 }, /* dock mic */
6180 		{ }
6181 	};
6182 	struct alc_spec *spec = codec->spec;
6183 
6184 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6185 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6186 		snd_hda_apply_pincfgs(codec, pincfgs);
6187 	} else if (action == HDA_FIXUP_ACT_INIT) {
6188 		/* Enable DOCK device */
6189 		snd_hda_codec_write(codec, 0x17, 0,
6190 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6191 		/* Enable DOCK device */
6192 		snd_hda_codec_write(codec, 0x19, 0,
6193 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6194 	}
6195 }
6196 
6197 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6198 				  const struct hda_fixup *fix, int action)
6199 {
6200 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6201 	 * the speaker output becomes too low by some reason on Thinkpads with
6202 	 * ALC298 codec
6203 	 */
6204 	static const hda_nid_t preferred_pairs[] = {
6205 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6206 		0
6207 	};
6208 	struct alc_spec *spec = codec->spec;
6209 
6210 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6211 		spec->gen.preferred_dacs = preferred_pairs;
6212 }
6213 
6214 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6215 				   const struct hda_fixup *fix, int action)
6216 {
6217 	static const hda_nid_t preferred_pairs[] = {
6218 		0x17, 0x02, 0x21, 0x03, 0
6219 	};
6220 	struct alc_spec *spec = codec->spec;
6221 
6222 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6223 		spec->gen.preferred_dacs = preferred_pairs;
6224 }
6225 
6226 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6227 {
6228 	struct alc_spec *spec = codec->spec;
6229 	int hp_pin = alc_get_hp_pin(spec);
6230 
6231 	/* Prevent pop noises when headphones are plugged in */
6232 	snd_hda_codec_write(codec, hp_pin, 0,
6233 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6234 	msleep(20);
6235 }
6236 
6237 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6238 				const struct hda_fixup *fix, int action)
6239 {
6240 	struct alc_spec *spec = codec->spec;
6241 	struct hda_input_mux *imux = &spec->gen.input_mux;
6242 	int i;
6243 
6244 	switch (action) {
6245 	case HDA_FIXUP_ACT_PRE_PROBE:
6246 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6247 		 * it causes a click noise at start up
6248 		 */
6249 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6250 		spec->shutup = alc_shutup_dell_xps13;
6251 		break;
6252 	case HDA_FIXUP_ACT_PROBE:
6253 		/* Make the internal mic the default input source. */
6254 		for (i = 0; i < imux->num_items; i++) {
6255 			if (spec->gen.imux_pins[i] == 0x12) {
6256 				spec->gen.cur_mux[0] = i;
6257 				break;
6258 			}
6259 		}
6260 		break;
6261 	}
6262 }
6263 
6264 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6265 				const struct hda_fixup *fix, int action)
6266 {
6267 	struct alc_spec *spec = codec->spec;
6268 
6269 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6270 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6271 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6272 
6273 		/* Disable boost for mic-in permanently. (This code is only called
6274 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6275 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6276 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6277 	} else
6278 		alc_fixup_headset_mode(codec, fix, action);
6279 }
6280 
6281 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6282 				const struct hda_fixup *fix, int action)
6283 {
6284 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6285 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6286 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6287 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6288 	}
6289 	alc_fixup_headset_mode(codec, fix, action);
6290 }
6291 
6292 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6293 static int find_ext_mic_pin(struct hda_codec *codec)
6294 {
6295 	struct alc_spec *spec = codec->spec;
6296 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6297 	hda_nid_t nid;
6298 	unsigned int defcfg;
6299 	int i;
6300 
6301 	for (i = 0; i < cfg->num_inputs; i++) {
6302 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6303 			continue;
6304 		nid = cfg->inputs[i].pin;
6305 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6306 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6307 			continue;
6308 		return nid;
6309 	}
6310 
6311 	return 0;
6312 }
6313 
6314 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6315 				    const struct hda_fixup *fix,
6316 				    int action)
6317 {
6318 	struct alc_spec *spec = codec->spec;
6319 
6320 	if (action == HDA_FIXUP_ACT_PROBE) {
6321 		int mic_pin = find_ext_mic_pin(codec);
6322 		int hp_pin = alc_get_hp_pin(spec);
6323 
6324 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6325 			return;
6326 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6327 	}
6328 }
6329 
6330 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6331 					     const struct hda_fixup *fix,
6332 					     int action)
6333 {
6334 	struct alc_spec *spec = codec->spec;
6335 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6336 	int i;
6337 
6338 	/* The mic boosts on level 2 and 3 are too noisy
6339 	   on the internal mic input.
6340 	   Therefore limit the boost to 0 or 1. */
6341 
6342 	if (action != HDA_FIXUP_ACT_PROBE)
6343 		return;
6344 
6345 	for (i = 0; i < cfg->num_inputs; i++) {
6346 		hda_nid_t nid = cfg->inputs[i].pin;
6347 		unsigned int defcfg;
6348 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6349 			continue;
6350 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6351 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6352 			continue;
6353 
6354 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6355 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6356 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6357 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6358 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6359 	}
6360 }
6361 
6362 static void alc283_hp_automute_hook(struct hda_codec *codec,
6363 				    struct hda_jack_callback *jack)
6364 {
6365 	struct alc_spec *spec = codec->spec;
6366 	int vref;
6367 
6368 	msleep(200);
6369 	snd_hda_gen_hp_automute(codec, jack);
6370 
6371 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6372 
6373 	msleep(600);
6374 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6375 			    vref);
6376 }
6377 
6378 static void alc283_fixup_chromebook(struct hda_codec *codec,
6379 				    const struct hda_fixup *fix, int action)
6380 {
6381 	struct alc_spec *spec = codec->spec;
6382 
6383 	switch (action) {
6384 	case HDA_FIXUP_ACT_PRE_PROBE:
6385 		snd_hda_override_wcaps(codec, 0x03, 0);
6386 		/* Disable AA-loopback as it causes white noise */
6387 		spec->gen.mixer_nid = 0;
6388 		break;
6389 	case HDA_FIXUP_ACT_INIT:
6390 		/* MIC2-VREF control */
6391 		/* Set to manual mode */
6392 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6393 		/* Enable Line1 input control by verb */
6394 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6395 		break;
6396 	}
6397 }
6398 
6399 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6400 				    const struct hda_fixup *fix, int action)
6401 {
6402 	struct alc_spec *spec = codec->spec;
6403 
6404 	switch (action) {
6405 	case HDA_FIXUP_ACT_PRE_PROBE:
6406 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6407 		break;
6408 	case HDA_FIXUP_ACT_INIT:
6409 		/* MIC2-VREF control */
6410 		/* Set to manual mode */
6411 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6412 		break;
6413 	}
6414 }
6415 
6416 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6417 static void asus_tx300_automute(struct hda_codec *codec)
6418 {
6419 	struct alc_spec *spec = codec->spec;
6420 	snd_hda_gen_update_outputs(codec);
6421 	if (snd_hda_jack_detect(codec, 0x1b))
6422 		spec->gen.mute_bits |= (1ULL << 0x14);
6423 }
6424 
6425 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6426 				    const struct hda_fixup *fix, int action)
6427 {
6428 	struct alc_spec *spec = codec->spec;
6429 	static const struct hda_pintbl dock_pins[] = {
6430 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6431 		{}
6432 	};
6433 
6434 	switch (action) {
6435 	case HDA_FIXUP_ACT_PRE_PROBE:
6436 		spec->init_amp = ALC_INIT_DEFAULT;
6437 		/* TX300 needs to set up GPIO2 for the speaker amp */
6438 		alc_setup_gpio(codec, 0x04);
6439 		snd_hda_apply_pincfgs(codec, dock_pins);
6440 		spec->gen.auto_mute_via_amp = 1;
6441 		spec->gen.automute_hook = asus_tx300_automute;
6442 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6443 						    snd_hda_gen_hp_automute);
6444 		break;
6445 	case HDA_FIXUP_ACT_PROBE:
6446 		spec->init_amp = ALC_INIT_DEFAULT;
6447 		break;
6448 	case HDA_FIXUP_ACT_BUILD:
6449 		/* this is a bit tricky; give more sane names for the main
6450 		 * (tablet) speaker and the dock speaker, respectively
6451 		 */
6452 		rename_ctl(codec, "Speaker Playback Switch",
6453 			   "Dock Speaker Playback Switch");
6454 		rename_ctl(codec, "Bass Speaker Playback Switch",
6455 			   "Speaker Playback Switch");
6456 		break;
6457 	}
6458 }
6459 
6460 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6461 				       const struct hda_fixup *fix, int action)
6462 {
6463 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6464 		/* DAC node 0x03 is giving mono output. We therefore want to
6465 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6466 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6467 		static const hda_nid_t conn1[] = { 0x0c };
6468 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6469 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6470 	}
6471 }
6472 
6473 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6474 					const struct hda_fixup *fix, int action)
6475 {
6476 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6477 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6478 		   we can't adjust the speaker's volume since this node does not has
6479 		   Amp-out capability. we change the speaker's route to:
6480 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6481 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6482 		   speaker's volume now. */
6483 
6484 		static const hda_nid_t conn1[] = { 0x0c };
6485 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6486 	}
6487 }
6488 
6489 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6490 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6491 				      const struct hda_fixup *fix, int action)
6492 {
6493 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6494 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6495 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6496 	}
6497 }
6498 
6499 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6500 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6501 					  const struct hda_fixup *fix, int action)
6502 {
6503 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6504 		static const hda_nid_t conn[] = { 0x02 };
6505 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6506 	}
6507 }
6508 
6509 /* Hook to update amp GPIO4 for automute */
6510 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6511 					  struct hda_jack_callback *jack)
6512 {
6513 	struct alc_spec *spec = codec->spec;
6514 
6515 	snd_hda_gen_hp_automute(codec, jack);
6516 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6517 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6518 			    !spec->gen.hp_jack_present);
6519 }
6520 
6521 /* Manage GPIOs for HP EliteBook Folio 9480m.
6522  *
6523  * GPIO4 is the headphone amplifier power control
6524  * GPIO3 is the audio output mute indicator LED
6525  */
6526 
6527 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6528 				  const struct hda_fixup *fix,
6529 				  int action)
6530 {
6531 	struct alc_spec *spec = codec->spec;
6532 
6533 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6534 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6535 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6536 		spec->gpio_mask |= 0x10;
6537 		spec->gpio_dir |= 0x10;
6538 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6539 	}
6540 }
6541 
6542 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6543 				   const struct hda_fixup *fix,
6544 				   int action)
6545 {
6546 	struct alc_spec *spec = codec->spec;
6547 
6548 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6549 		spec->gpio_mask |= 0x04;
6550 		spec->gpio_dir |= 0x04;
6551 		/* set data bit low */
6552 	}
6553 }
6554 
6555 /* Quirk for Thinkpad X1 7th and 8th Gen
6556  * The following fixed routing needed
6557  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6558  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6559  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6560  */
6561 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6562 					  const struct hda_fixup *fix, int action)
6563 {
6564 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6565 	static const hda_nid_t preferred_pairs[] = {
6566 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6567 	};
6568 	struct alc_spec *spec = codec->spec;
6569 
6570 	switch (action) {
6571 	case HDA_FIXUP_ACT_PRE_PROBE:
6572 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6573 		spec->gen.preferred_dacs = preferred_pairs;
6574 		break;
6575 	case HDA_FIXUP_ACT_BUILD:
6576 		/* The generic parser creates somewhat unintuitive volume ctls
6577 		 * with the fixed routing above, and the shared DAC2 may be
6578 		 * confusing for PA.
6579 		 * Rename those to unique names so that PA doesn't touch them
6580 		 * and use only Master volume.
6581 		 */
6582 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6583 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6584 		break;
6585 	}
6586 }
6587 
6588 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6589 					 const struct hda_fixup *fix,
6590 					 int action)
6591 {
6592 	alc_fixup_dual_codecs(codec, fix, action);
6593 	switch (action) {
6594 	case HDA_FIXUP_ACT_PRE_PROBE:
6595 		/* override card longname to provide a unique UCM profile */
6596 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6597 		break;
6598 	case HDA_FIXUP_ACT_BUILD:
6599 		/* rename Capture controls depending on the codec */
6600 		rename_ctl(codec, "Capture Volume",
6601 			   codec->addr == 0 ?
6602 			   "Rear-Panel Capture Volume" :
6603 			   "Front-Panel Capture Volume");
6604 		rename_ctl(codec, "Capture Switch",
6605 			   codec->addr == 0 ?
6606 			   "Rear-Panel Capture Switch" :
6607 			   "Front-Panel Capture Switch");
6608 		break;
6609 	}
6610 }
6611 
6612 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6613 				      const struct hda_fixup *fix, int action)
6614 {
6615 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6616 		return;
6617 
6618 	codec->power_save_node = 1;
6619 }
6620 
6621 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6622 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6623 				    const struct hda_fixup *fix, int action)
6624 {
6625 	struct alc_spec *spec = codec->spec;
6626 	static const hda_nid_t preferred_pairs[] = {
6627 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6628 		0
6629 	};
6630 
6631 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6632 		return;
6633 
6634 	spec->gen.preferred_dacs = preferred_pairs;
6635 	spec->gen.auto_mute_via_amp = 1;
6636 	codec->power_save_node = 0;
6637 }
6638 
6639 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6640 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6641 				    const struct hda_fixup *fix, int action)
6642 {
6643 	static const hda_nid_t preferred_pairs[] = {
6644 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6645 	};
6646 	struct alc_spec *spec = codec->spec;
6647 
6648 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6649 		spec->gen.preferred_dacs = preferred_pairs;
6650 }
6651 
6652 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6653 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6654 			      const struct hda_fixup *fix, int action)
6655 {
6656 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6657 		return;
6658 
6659 	snd_hda_override_wcaps(codec, 0x03, 0);
6660 }
6661 
6662 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6663 {
6664 	switch (codec->core.vendor_id) {
6665 	case 0x10ec0274:
6666 	case 0x10ec0294:
6667 	case 0x10ec0225:
6668 	case 0x10ec0295:
6669 	case 0x10ec0299:
6670 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6671 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6672 		break;
6673 	case 0x10ec0230:
6674 	case 0x10ec0235:
6675 	case 0x10ec0236:
6676 	case 0x10ec0255:
6677 	case 0x10ec0256:
6678 	case 0x10ec0257:
6679 	case 0x19e58326:
6680 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6681 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6682 		break;
6683 	}
6684 }
6685 
6686 static void alc295_fixup_chromebook(struct hda_codec *codec,
6687 				    const struct hda_fixup *fix, int action)
6688 {
6689 	struct alc_spec *spec = codec->spec;
6690 
6691 	switch (action) {
6692 	case HDA_FIXUP_ACT_PRE_PROBE:
6693 		spec->ultra_low_power = true;
6694 		break;
6695 	case HDA_FIXUP_ACT_INIT:
6696 		alc_combo_jack_hp_jd_restart(codec);
6697 		break;
6698 	}
6699 }
6700 
6701 static void alc256_fixup_chromebook(struct hda_codec *codec,
6702 				    const struct hda_fixup *fix, int action)
6703 {
6704 	struct alc_spec *spec = codec->spec;
6705 
6706 	switch (action) {
6707 	case HDA_FIXUP_ACT_PRE_PROBE:
6708 		spec->gen.suppress_auto_mute = 1;
6709 		spec->gen.suppress_auto_mic = 1;
6710 		spec->en_3kpull_low = false;
6711 		break;
6712 	}
6713 }
6714 
6715 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6716 				  const struct hda_fixup *fix, int action)
6717 {
6718 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6719 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6720 }
6721 
6722 
6723 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6724 					struct hda_jack_callback *cb)
6725 {
6726 	/* The Windows driver sets the codec up in a very different way where
6727 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6728 	 */
6729 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6730 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6731 	else
6732 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6733 }
6734 
6735 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6736 					const struct hda_fixup *fix, int action)
6737 {
6738 	/* Pin 0x21: headphones/headset mic */
6739 	if (!is_jack_detectable(codec, 0x21))
6740 		return;
6741 
6742 	switch (action) {
6743 	case HDA_FIXUP_ACT_PRE_PROBE:
6744 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6745 				alc294_gx502_toggle_output);
6746 		break;
6747 	case HDA_FIXUP_ACT_INIT:
6748 		/* Make sure to start in a correct state, i.e. if
6749 		 * headphones have been plugged in before powering up the system
6750 		 */
6751 		alc294_gx502_toggle_output(codec, NULL);
6752 		break;
6753 	}
6754 }
6755 
6756 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6757 				       struct hda_jack_callback *cb)
6758 {
6759 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6760 	 * responsible from changes between speakers and headphones
6761 	 */
6762 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6763 		alc_write_coef_idx(codec, 0x10, 0x8420);
6764 	else
6765 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6766 }
6767 
6768 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6769 				  const struct hda_fixup *fix, int action)
6770 {
6771 	if (!is_jack_detectable(codec, 0x21))
6772 		return;
6773 
6774 	switch (action) {
6775 	case HDA_FIXUP_ACT_PRE_PROBE:
6776 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6777 				alc294_gu502_toggle_output);
6778 		break;
6779 	case HDA_FIXUP_ACT_INIT:
6780 		alc294_gu502_toggle_output(codec, NULL);
6781 		break;
6782 	}
6783 }
6784 
6785 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6786 			      const struct hda_fixup *fix, int action)
6787 {
6788 	if (action != HDA_FIXUP_ACT_INIT)
6789 		return;
6790 
6791 	msleep(100);
6792 	alc_write_coef_idx(codec, 0x65, 0x0);
6793 }
6794 
6795 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6796 				    const struct hda_fixup *fix, int action)
6797 {
6798 	switch (action) {
6799 	case HDA_FIXUP_ACT_INIT:
6800 		alc_combo_jack_hp_jd_restart(codec);
6801 		break;
6802 	}
6803 }
6804 
6805 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6806 				    const struct hda_fixup *fix, int action)
6807 {
6808 	struct alc_spec *spec = codec->spec;
6809 
6810 	switch (action) {
6811 	case HDA_FIXUP_ACT_PRE_PROBE:
6812 		/* Mic RING SLEEVE swap for combo jack */
6813 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6814 		spec->no_internal_mic_pin = true;
6815 		break;
6816 	case HDA_FIXUP_ACT_INIT:
6817 		alc_combo_jack_hp_jd_restart(codec);
6818 		break;
6819 	}
6820 }
6821 
6822 /* GPIO1 = amplifier on/off
6823  * GPIO3 = mic mute LED
6824  */
6825 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6826 					  const struct hda_fixup *fix, int action)
6827 {
6828 	static const hda_nid_t conn[] = { 0x02 };
6829 
6830 	struct alc_spec *spec = codec->spec;
6831 	static const struct hda_pintbl pincfgs[] = {
6832 		{ 0x14, 0x90170110 },  /* front/high speakers */
6833 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6834 		{ }
6835 	};
6836 
6837 	//enable micmute led
6838 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6839 
6840 	switch (action) {
6841 	case HDA_FIXUP_ACT_PRE_PROBE:
6842 		spec->micmute_led_polarity = 1;
6843 		/* needed for amp of back speakers */
6844 		spec->gpio_mask |= 0x01;
6845 		spec->gpio_dir |= 0x01;
6846 		snd_hda_apply_pincfgs(codec, pincfgs);
6847 		/* share DAC to have unified volume control */
6848 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6849 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6850 		break;
6851 	case HDA_FIXUP_ACT_INIT:
6852 		/* need to toggle GPIO to enable the amp of back speakers */
6853 		alc_update_gpio_data(codec, 0x01, true);
6854 		msleep(100);
6855 		alc_update_gpio_data(codec, 0x01, false);
6856 		break;
6857 	}
6858 }
6859 
6860 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6861 					  const struct hda_fixup *fix, int action)
6862 {
6863 	static const hda_nid_t conn[] = { 0x02 };
6864 	static const struct hda_pintbl pincfgs[] = {
6865 		{ 0x14, 0x90170110 },  /* rear speaker */
6866 		{ }
6867 	};
6868 
6869 	switch (action) {
6870 	case HDA_FIXUP_ACT_PRE_PROBE:
6871 		snd_hda_apply_pincfgs(codec, pincfgs);
6872 		/* force front speaker to DAC1 */
6873 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6874 		break;
6875 	}
6876 }
6877 
6878 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6879 				      const struct hda_fixup *fix,
6880 				      int action)
6881 {
6882 	static const struct coef_fw coefs[] = {
6883 		WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6884 		WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6885 		WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6886 		WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6887 		WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6888 		WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6889 		WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6890 		WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6891 		WRITE_COEF(0x6e, 0x1005), { }
6892 	};
6893 
6894 	static const struct hda_pintbl pincfgs[] = {
6895 		{ 0x12, 0xb7a60130 },  /* Internal microphone*/
6896 		{ 0x14, 0x90170150 },  /* B&O soundbar speakers */
6897 		{ 0x17, 0x90170153 },  /* Side speakers */
6898 		{ 0x19, 0x03a11040 },  /* Headset microphone */
6899 		{ }
6900 	};
6901 
6902 	switch (action) {
6903 	case HDA_FIXUP_ACT_PRE_PROBE:
6904 		snd_hda_apply_pincfgs(codec, pincfgs);
6905 
6906 		/* Fixes volume control problem for side speakers */
6907 		alc295_fixup_disable_dac3(codec, fix, action);
6908 
6909 		/* Fixes no sound from headset speaker */
6910 		snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6911 
6912 		/* Auto-enable headset mic when plugged */
6913 		snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6914 
6915 		/* Headset mic volume enhancement */
6916 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6917 		break;
6918 	case HDA_FIXUP_ACT_INIT:
6919 		alc_process_coef_fw(codec, coefs);
6920 		break;
6921 	case HDA_FIXUP_ACT_BUILD:
6922 		rename_ctl(codec, "Bass Speaker Playback Volume",
6923 			   "B&O-Tuned Playback Volume");
6924 		rename_ctl(codec, "Front Playback Switch",
6925 			   "B&O Soundbar Playback Switch");
6926 		rename_ctl(codec, "Bass Speaker Playback Switch",
6927 			   "Side Speaker Playback Switch");
6928 		break;
6929 	}
6930 }
6931 
6932 /* for hda_fixup_thinkpad_acpi() */
6933 #include "thinkpad_helper.c"
6934 
6935 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6936 				    const struct hda_fixup *fix, int action)
6937 {
6938 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6939 	hda_fixup_thinkpad_acpi(codec, fix, action);
6940 }
6941 
6942 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6943 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6944 						  const struct hda_fixup *fix,
6945 						  int action)
6946 {
6947 	struct alc_spec *spec = codec->spec;
6948 
6949 	switch (action) {
6950 	case HDA_FIXUP_ACT_PRE_PROBE:
6951 		spec->gen.suppress_auto_mute = 1;
6952 		break;
6953 	}
6954 }
6955 
6956 static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
6957 {
6958 	struct hda_codec *cdc = data;
6959 	struct alc_spec *spec = cdc->spec;
6960 
6961 	codec_info(cdc, "ACPI Notification %d\n", event);
6962 
6963 	hda_component_acpi_device_notify(&spec->comps, handle, event, data);
6964 }
6965 
6966 static int comp_bind(struct device *dev)
6967 {
6968 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6969 	struct alc_spec *spec = cdc->spec;
6970 	int ret;
6971 
6972 	ret = hda_component_manager_bind(cdc, &spec->comps);
6973 	if (ret)
6974 		return ret;
6975 
6976 	return hda_component_manager_bind_acpi_notifications(cdc,
6977 							     &spec->comps,
6978 							     comp_acpi_device_notify, cdc);
6979 }
6980 
6981 static void comp_unbind(struct device *dev)
6982 {
6983 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6984 	struct alc_spec *spec = cdc->spec;
6985 
6986 	hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify);
6987 	hda_component_manager_unbind(cdc, &spec->comps);
6988 }
6989 
6990 static const struct component_master_ops comp_master_ops = {
6991 	.bind = comp_bind,
6992 	.unbind = comp_unbind,
6993 };
6994 
6995 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6996 				       struct snd_pcm_substream *sub, int action)
6997 {
6998 	struct alc_spec *spec = cdc->spec;
6999 
7000 	hda_component_manager_playback_hook(&spec->comps, action);
7001 }
7002 
7003 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
7004 			       const char *hid, const char *match_str, int count)
7005 {
7006 	struct alc_spec *spec = cdc->spec;
7007 	int ret;
7008 
7009 	switch (action) {
7010 	case HDA_FIXUP_ACT_PRE_PROBE:
7011 		ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid,
7012 						 match_str, &comp_master_ops);
7013 		if (ret)
7014 			return;
7015 
7016 		spec->gen.pcm_playback_hook = comp_generic_playback_hook;
7017 		break;
7018 	case HDA_FIXUP_ACT_FREE:
7019 		hda_component_manager_free(&spec->comps, &comp_master_ops);
7020 		break;
7021 	}
7022 }
7023 
7024 static void find_cirrus_companion_amps(struct hda_codec *cdc)
7025 {
7026 	struct device *dev = hda_codec_dev(cdc);
7027 	struct acpi_device *adev;
7028 	struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
7029 	const char *bus = NULL;
7030 	static const struct {
7031 		const char *hid;
7032 		const char *name;
7033 	} acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
7034 			{ "CSC3556", "cs35l56-hda" },
7035 			{ "CSC3557", "cs35l57-hda" }};
7036 	char *match;
7037 	int i, count = 0, count_devindex = 0;
7038 
7039 	for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
7040 		adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
7041 		if (adev)
7042 			break;
7043 	}
7044 	if (!adev) {
7045 		codec_dbg(cdc, "Did not find ACPI entry for a Cirrus Amp\n");
7046 		return;
7047 	}
7048 
7049 	count = i2c_acpi_client_count(adev);
7050 	if (count > 0) {
7051 		bus = "i2c";
7052 	} else {
7053 		count = acpi_spi_count_resources(adev);
7054 		if (count > 0)
7055 			bus = "spi";
7056 	}
7057 
7058 	fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
7059 	acpi_dev_put(adev);
7060 
7061 	if (!bus) {
7062 		codec_err(cdc, "Did not find any buses for %s\n", acpi_ids[i].hid);
7063 		return;
7064 	}
7065 
7066 	if (!fwnode) {
7067 		codec_err(cdc, "Could not get fwnode for %s\n", acpi_ids[i].hid);
7068 		return;
7069 	}
7070 
7071 	/*
7072 	 * When available the cirrus,dev-index property is an accurate
7073 	 * count of the amps in a system and is used in preference to
7074 	 * the count of bus devices that can contain additional address
7075 	 * alias entries.
7076 	 */
7077 	count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
7078 	if (count_devindex > 0)
7079 		count = count_devindex;
7080 
7081 	match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
7082 	if (!match)
7083 		return;
7084 	codec_info(cdc, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
7085 	comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
7086 }
7087 
7088 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7089 {
7090 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
7091 }
7092 
7093 static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7094 {
7095 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
7096 }
7097 
7098 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7099 {
7100 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
7101 }
7102 
7103 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7104 {
7105 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
7106 }
7107 
7108 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7109 						 int action)
7110 {
7111 	comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
7112 }
7113 
7114 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7115 						 int action)
7116 {
7117 	comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
7118 }
7119 
7120 static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7121 {
7122 	/*
7123 	 * The same SSID has been re-used in different hardware, they have
7124 	 * different codecs and the newer GA403U has a ALC285.
7125 	 */
7126 	if (cdc->core.vendor_id != 0x10ec0285)
7127 		alc_fixup_inv_dmic(cdc, fix, action);
7128 }
7129 
7130 static void tas2781_fixup_i2c(struct hda_codec *cdc,
7131 	const struct hda_fixup *fix, int action)
7132 {
7133 	comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
7134 }
7135 
7136 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
7137 	const struct hda_fixup *fix, int action)
7138 {
7139 	comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
7140 }
7141 
7142 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
7143 	const struct hda_fixup *fix, int action)
7144 {
7145 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
7146 }
7147 
7148 
7149 /* for alc295_fixup_hp_top_speakers */
7150 #include "hp_x360_helper.c"
7151 
7152 /* for alc285_fixup_ideapad_s740_coef() */
7153 #include "ideapad_s740_helper.c"
7154 
7155 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7156 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7157 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7158 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7159 	{}
7160 };
7161 
7162 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7163 					   const struct hda_fixup *fix,
7164 					   int action)
7165 {
7166 	/*
7167 	 * A certain other OS sets these coeffs to different values. On at least
7168 	 * one TongFang barebone these settings might survive even a cold
7169 	 * reboot. So to restore a clean slate the values are explicitly reset
7170 	 * to default here. Without this, the external microphone is always in a
7171 	 * plugged-in state, while the internal microphone is always in an
7172 	 * unplugged state, breaking the ability to use the internal microphone.
7173 	 */
7174 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
7175 }
7176 
7177 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7178 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7179 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7180 	WRITE_COEF(0x49, 0x0149),
7181 	{}
7182 };
7183 
7184 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7185 				       const struct hda_fixup *fix,
7186 				       int action)
7187 {
7188 	/*
7189 	 * The audio jack input and output is not detected on the ASRock NUC Box
7190 	 * 1100 series when cold booting without this fix. Warm rebooting from a
7191 	 * certain other OS makes the audio functional, as COEF settings are
7192 	 * preserved in this case. This fix sets these altered COEF values as
7193 	 * the default.
7194 	 */
7195 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7196 }
7197 
7198 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7199 						    const struct hda_fixup *fix,
7200 						    int action)
7201 {
7202 	/*
7203 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7204 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7205 	 * needs an additional quirk for sound working after suspend and resume.
7206 	 */
7207 	if (codec->core.vendor_id == 0x10ec0256) {
7208 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7209 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7210 	} else {
7211 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7212 	}
7213 }
7214 
7215 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
7216 					      const struct hda_fixup *fix, int action)
7217 {
7218 	u32 caps;
7219 	u8 nsteps, offs;
7220 
7221 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7222 		return;
7223 
7224 	caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
7225 	nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
7226 	offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
7227 	caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
7228 	caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
7229 
7230 	if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
7231 		codec_warn(codec, "failed to override amp caps for NID 0x3\n");
7232 }
7233 
7234 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7235 						  const struct hda_fixup *fix,
7236 						  int action)
7237 {
7238 	struct alc_spec *spec = codec->spec;
7239 	struct hda_input_mux *imux = &spec->gen.input_mux;
7240 	int i;
7241 
7242 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
7243 
7244 	switch (action) {
7245 	case HDA_FIXUP_ACT_PRE_PROBE:
7246 		/**
7247 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7248 		 * to Hi-Z to avoid pop noises at startup and when plugging and
7249 		 * unplugging headphones.
7250 		 */
7251 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7252 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7253 		break;
7254 	case HDA_FIXUP_ACT_PROBE:
7255 		/**
7256 		 * Make the internal mic (0x12) the default input source to
7257 		 * prevent pop noises on cold boot.
7258 		 */
7259 		for (i = 0; i < imux->num_items; i++) {
7260 			if (spec->gen.imux_pins[i] == 0x12) {
7261 				spec->gen.cur_mux[0] = i;
7262 				break;
7263 			}
7264 		}
7265 		break;
7266 	}
7267 }
7268 
7269 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7270 					  const struct hda_fixup *fix, int action)
7271 {
7272 	/*
7273 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7274 	 * unconnected.
7275 	 */
7276 	static const struct hda_pintbl pincfgs[] = {
7277 		{ 0x17, 0x90170121 },
7278 		{ }
7279 	};
7280 	/*
7281 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7282 	 * DAC 0x02 and 0x03 would be fine.
7283 	 */
7284 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7285 	/*
7286 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7287 	 * Headphones (0x21) are connected to DAC 0x03.
7288 	 */
7289 	static const hda_nid_t preferred_pairs[] = {
7290 		0x14, 0x02,
7291 		0x17, 0x02,
7292 		0x21, 0x03,
7293 		0
7294 	};
7295 	struct alc_spec *spec = codec->spec;
7296 
7297 	switch (action) {
7298 	case HDA_FIXUP_ACT_PRE_PROBE:
7299 		snd_hda_apply_pincfgs(codec, pincfgs);
7300 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7301 		spec->gen.preferred_dacs = preferred_pairs;
7302 		break;
7303 	}
7304 }
7305 
7306 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7307 					  const struct hda_fixup *fix, int action)
7308 {
7309 	static const struct hda_pintbl pincfgs[] = {
7310 		{ 0x14, 0x90170151 },
7311 		{ 0x17, 0x90170150 },
7312 		{ }
7313 	};
7314 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7315 	static const hda_nid_t preferred_pairs[] = {
7316 		0x14, 0x02,
7317 		0x17, 0x03,
7318 		0x21, 0x02,
7319 		0
7320 	};
7321 	struct alc_spec *spec = codec->spec;
7322 
7323 	alc_fixup_no_shutup(codec, fix, action);
7324 
7325 	switch (action) {
7326 	case HDA_FIXUP_ACT_PRE_PROBE:
7327 		snd_hda_apply_pincfgs(codec, pincfgs);
7328 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7329 		spec->gen.preferred_dacs = preferred_pairs;
7330 		break;
7331 	}
7332 }
7333 
7334 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7335 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7336 				    const struct hda_fixup *fix, int action)
7337 {
7338 	struct alc_spec *spec = codec->spec;
7339 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7340 	static const hda_nid_t preferred_pairs[] = {
7341 		0x17, 0x02, 0x21, 0x03, 0
7342 	};
7343 
7344 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7345 		return;
7346 
7347 	snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7348 	spec->gen.preferred_dacs = preferred_pairs;
7349 	spec->gen.auto_mute_via_amp = 1;
7350 	if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7351 		snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7352 					0x0); /* Make sure 0x14 was disable */
7353 	}
7354 }
7355 /* Fix none verb table of Headset Mic pin */
7356 static void alc_fixup_headset_mic(struct hda_codec *codec,
7357 				   const struct hda_fixup *fix, int action)
7358 {
7359 	struct alc_spec *spec = codec->spec;
7360 	static const struct hda_pintbl pincfgs[] = {
7361 		{ 0x19, 0x03a1103c },
7362 		{ }
7363 	};
7364 
7365 	switch (action) {
7366 	case HDA_FIXUP_ACT_PRE_PROBE:
7367 		snd_hda_apply_pincfgs(codec, pincfgs);
7368 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7369 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7370 		break;
7371 	}
7372 }
7373 
7374 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
7375 					  const struct hda_fixup *fix, int action)
7376 {
7377 	/*
7378 	 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7379 	 * unconnected.
7380 	 * The Pin Complex 0x17 for the bass speakers has the lowest association
7381 	 * and sequence values so shift it up a bit to squeeze 0x14 in.
7382 	 */
7383 	static const struct hda_pintbl pincfgs[] = {
7384 		{ 0x14, 0x90170110 }, // top/treble
7385 		{ 0x17, 0x90170111 }, // bottom/bass
7386 		{ }
7387 	};
7388 
7389 	/*
7390 	 * Force DAC 0x02 for the bass speakers 0x17.
7391 	 */
7392 	static const hda_nid_t conn[] = { 0x02 };
7393 
7394 	switch (action) {
7395 	case HDA_FIXUP_ACT_PRE_PROBE:
7396 		snd_hda_apply_pincfgs(codec, pincfgs);
7397 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7398 		break;
7399 	}
7400 
7401 	cs35l41_fixup_i2c_two(codec, fix, action);
7402 	alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7403 	alc245_fixup_hp_gpio_led(codec, fix, action);
7404 }
7405 
7406 /* some changes for Spectre x360 16, 2024 model */
7407 static void alc245_fixup_hp_spectre_x360_16_aa0xxx(struct hda_codec *codec,
7408 					  const struct hda_fixup *fix, int action)
7409 {
7410 	/*
7411 	 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7412 	 * unconnected.
7413 	 * The Pin Complex 0x17 for the bass speakers has the lowest association
7414 	 * and sequence values so shift it up a bit to squeeze 0x14 in.
7415 	 */
7416 	struct alc_spec *spec = codec->spec;
7417 	static const struct hda_pintbl pincfgs[] = {
7418 		{ 0x14, 0x90170110 }, // top/treble
7419 		{ 0x17, 0x90170111 }, // bottom/bass
7420 		{ }
7421 	};
7422 
7423 	/*
7424 	 * Force DAC 0x02 for the bass speakers 0x17.
7425 	 */
7426 	static const hda_nid_t conn[] = { 0x02 };
7427 
7428 	switch (action) {
7429 	case HDA_FIXUP_ACT_PRE_PROBE:
7430 		/* needed for amp of back speakers */
7431 		spec->gpio_mask |= 0x01;
7432 		spec->gpio_dir |= 0x01;
7433 		snd_hda_apply_pincfgs(codec, pincfgs);
7434 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7435 		break;
7436 	case HDA_FIXUP_ACT_INIT:
7437 		/* need to toggle GPIO to enable the amp of back speakers */
7438 		alc_update_gpio_data(codec, 0x01, true);
7439 		msleep(100);
7440 		alc_update_gpio_data(codec, 0x01, false);
7441 		break;
7442 	}
7443 
7444 	cs35l41_fixup_i2c_two(codec, fix, action);
7445 	alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7446 	alc245_fixup_hp_gpio_led(codec, fix, action);
7447 }
7448 
7449 /*
7450  * ALC287 PCM hooks
7451  */
7452 static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
7453 				   struct hda_codec *codec,
7454 				   struct snd_pcm_substream *substream,
7455 				   int action)
7456 {
7457 	alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7458 	switch (action) {
7459 	case HDA_GEN_PCM_ACT_OPEN:
7460 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
7461 		break;
7462 	case HDA_GEN_PCM_ACT_CLOSE:
7463 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7464 		break;
7465 	}
7466 }
7467 
7468 static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
7469 {
7470 	if (is_s4_suspend(codec)) {
7471 		alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7472 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7473 	}
7474 }
7475 
7476 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
7477 			       const struct hda_fixup *fix, int action)
7478 {
7479 	struct alc_spec *spec = codec->spec;
7480 
7481 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7482 		return;
7483 	spec->power_hook = alc287_s4_power_gpio3_default;
7484 	spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
7485 }
7486 
7487 
7488 enum {
7489 	ALC269_FIXUP_GPIO2,
7490 	ALC269_FIXUP_SONY_VAIO,
7491 	ALC275_FIXUP_SONY_VAIO_GPIO2,
7492 	ALC269_FIXUP_DELL_M101Z,
7493 	ALC269_FIXUP_SKU_IGNORE,
7494 	ALC269_FIXUP_ASUS_G73JW,
7495 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
7496 	ALC269_FIXUP_ASUS_N7601ZM,
7497 	ALC269_FIXUP_LENOVO_EAPD,
7498 	ALC275_FIXUP_SONY_HWEQ,
7499 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
7500 	ALC271_FIXUP_DMIC,
7501 	ALC269_FIXUP_PCM_44K,
7502 	ALC269_FIXUP_STEREO_DMIC,
7503 	ALC269_FIXUP_HEADSET_MIC,
7504 	ALC269_FIXUP_QUANTA_MUTE,
7505 	ALC269_FIXUP_LIFEBOOK,
7506 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
7507 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
7508 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7509 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7510 	ALC269_FIXUP_AMIC,
7511 	ALC269_FIXUP_DMIC,
7512 	ALC269VB_FIXUP_AMIC,
7513 	ALC269VB_FIXUP_DMIC,
7514 	ALC269_FIXUP_HP_MUTE_LED,
7515 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
7516 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
7517 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
7518 	ALC269_FIXUP_HP_GPIO_LED,
7519 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
7520 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
7521 	ALC269_FIXUP_INV_DMIC,
7522 	ALC269_FIXUP_LENOVO_DOCK,
7523 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7524 	ALC269_FIXUP_NO_SHUTUP,
7525 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7526 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7527 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7528 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7529 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7530 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7531 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7532 	ALC269_FIXUP_HEADSET_MODE,
7533 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7534 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7535 	ALC269_FIXUP_ASUS_X101_FUNC,
7536 	ALC269_FIXUP_ASUS_X101_VERB,
7537 	ALC269_FIXUP_ASUS_X101,
7538 	ALC271_FIXUP_AMIC_MIC2,
7539 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7540 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7541 	ALC269_FIXUP_ACER_AC700,
7542 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7543 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7544 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7545 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7546 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7547 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7548 	ALC283_FIXUP_CHROME_BOOK,
7549 	ALC283_FIXUP_SENSE_COMBO_JACK,
7550 	ALC282_FIXUP_ASUS_TX300,
7551 	ALC283_FIXUP_INT_MIC,
7552 	ALC290_FIXUP_MONO_SPEAKERS,
7553 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7554 	ALC290_FIXUP_SUBWOOFER,
7555 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7556 	ALC269_FIXUP_THINKPAD_ACPI,
7557 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7558 	ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7559 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7560 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7561 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7562 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7563 	ALC255_FIXUP_HEADSET_MODE,
7564 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7565 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7566 	ALC292_FIXUP_TPT440_DOCK,
7567 	ALC292_FIXUP_TPT440,
7568 	ALC283_FIXUP_HEADSET_MIC,
7569 	ALC255_FIXUP_MIC_MUTE_LED,
7570 	ALC282_FIXUP_ASPIRE_V5_PINS,
7571 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7572 	ALC280_FIXUP_HP_GPIO4,
7573 	ALC286_FIXUP_HP_GPIO_LED,
7574 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7575 	ALC280_FIXUP_HP_DOCK_PINS,
7576 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7577 	ALC280_FIXUP_HP_9480M,
7578 	ALC245_FIXUP_HP_X360_AMP,
7579 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7580 	ALC285_FIXUP_HP_ENVY_X360,
7581 	ALC288_FIXUP_DELL_HEADSET_MODE,
7582 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7583 	ALC288_FIXUP_DELL_XPS_13,
7584 	ALC288_FIXUP_DISABLE_AAMIX,
7585 	ALC292_FIXUP_DELL_E7X_AAMIX,
7586 	ALC292_FIXUP_DELL_E7X,
7587 	ALC292_FIXUP_DISABLE_AAMIX,
7588 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7589 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7590 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7591 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7592 	ALC275_FIXUP_DELL_XPS,
7593 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7594 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7595 	ALC255_FIXUP_DELL_SPK_NOISE,
7596 	ALC225_FIXUP_DISABLE_MIC_VREF,
7597 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7598 	ALC295_FIXUP_DISABLE_DAC3,
7599 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7600 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7601 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7602 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7603 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7604 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7605 	ALC280_FIXUP_HP_HEADSET_MIC,
7606 	ALC221_FIXUP_HP_FRONT_MIC,
7607 	ALC292_FIXUP_TPT460,
7608 	ALC298_FIXUP_SPK_VOLUME,
7609 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7610 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7611 	ALC269_FIXUP_ATIV_BOOK_8,
7612 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7613 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7614 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7615 	ALC256_FIXUP_ASUS_MIC,
7616 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7617 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7618 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7619 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7620 	ALC233_FIXUP_ACER_HEADSET_MIC,
7621 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7622 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7623 	ALC225_FIXUP_S3_POP_NOISE,
7624 	ALC700_FIXUP_INTEL_REFERENCE,
7625 	ALC274_FIXUP_DELL_BIND_DACS,
7626 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7627 	ALC298_FIXUP_TPT470_DOCK_FIX,
7628 	ALC298_FIXUP_TPT470_DOCK,
7629 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7630 	ALC255_FIXUP_DELL_HEADSET_MIC,
7631 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7632 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7633 	ALC295_FIXUP_HP_X360,
7634 	ALC221_FIXUP_HP_HEADSET_MIC,
7635 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7636 	ALC295_FIXUP_HP_AUTO_MUTE,
7637 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7638 	ALC294_FIXUP_ASUS_MIC,
7639 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7640 	ALC294_FIXUP_ASUS_SPK,
7641 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7642 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7643 	ALC255_FIXUP_ACER_HEADSET_MIC,
7644 	ALC295_FIXUP_CHROME_BOOK,
7645 	ALC225_FIXUP_HEADSET_JACK,
7646 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7647 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7648 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7649 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7650 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7651 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7652 	ALC299_FIXUP_PREDATOR_SPK,
7653 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7654 	ALC289_FIXUP_DELL_SPK1,
7655 	ALC289_FIXUP_DELL_SPK2,
7656 	ALC289_FIXUP_DUAL_SPK,
7657 	ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7658 	ALC294_FIXUP_SPK2_TO_DAC1,
7659 	ALC294_FIXUP_ASUS_DUAL_SPK,
7660 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7661 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7662 	ALC294_FIXUP_ASUS_ALLY,
7663 	ALC294_FIXUP_ASUS_ALLY_X,
7664 	ALC294_FIXUP_ASUS_ALLY_PINS,
7665 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7666 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7667 	ALC294_FIXUP_ASUS_HPE,
7668 	ALC294_FIXUP_ASUS_COEF_1B,
7669 	ALC294_FIXUP_ASUS_GX502_HP,
7670 	ALC294_FIXUP_ASUS_GX502_PINS,
7671 	ALC294_FIXUP_ASUS_GX502_VERBS,
7672 	ALC294_FIXUP_ASUS_GU502_HP,
7673 	ALC294_FIXUP_ASUS_GU502_PINS,
7674 	ALC294_FIXUP_ASUS_GU502_VERBS,
7675 	ALC294_FIXUP_ASUS_G513_PINS,
7676 	ALC285_FIXUP_ASUS_G533Z_PINS,
7677 	ALC285_FIXUP_HP_GPIO_LED,
7678 	ALC285_FIXUP_HP_MUTE_LED,
7679 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7680 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7681 	ALC236_FIXUP_HP_GPIO_LED,
7682 	ALC236_FIXUP_HP_MUTE_LED,
7683 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7684 	ALC236_FIXUP_LENOVO_INV_DMIC,
7685 	ALC298_FIXUP_SAMSUNG_AMP,
7686 	ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS,
7687 	ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS,
7688 	ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7689 	ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7690 	ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7691 	ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7692 	ALC269VC_FIXUP_ACER_HEADSET_MIC,
7693 	ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7694 	ALC289_FIXUP_ASUS_GA401,
7695 	ALC289_FIXUP_ASUS_GA502,
7696 	ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7697 	ALC285_FIXUP_HP_GPIO_AMP_INIT,
7698 	ALC269_FIXUP_CZC_B20,
7699 	ALC269_FIXUP_CZC_TMI,
7700 	ALC269_FIXUP_CZC_L101,
7701 	ALC269_FIXUP_LEMOTE_A1802,
7702 	ALC269_FIXUP_LEMOTE_A190X,
7703 	ALC256_FIXUP_INTEL_NUC8_RUGGED,
7704 	ALC233_FIXUP_INTEL_NUC8_DMIC,
7705 	ALC233_FIXUP_INTEL_NUC8_BOOST,
7706 	ALC256_FIXUP_INTEL_NUC10,
7707 	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7708 	ALC274_FIXUP_HP_MIC,
7709 	ALC274_FIXUP_HP_HEADSET_MIC,
7710 	ALC274_FIXUP_HP_ENVY_GPIO,
7711 	ALC256_FIXUP_ASUS_HPE,
7712 	ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7713 	ALC287_FIXUP_HP_GPIO_LED,
7714 	ALC256_FIXUP_HP_HEADSET_MIC,
7715 	ALC245_FIXUP_HP_GPIO_LED,
7716 	ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7717 	ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7718 	ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7719 	ALC256_FIXUP_ACER_HEADSET_MIC,
7720 	ALC285_FIXUP_IDEAPAD_S740_COEF,
7721 	ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7722 	ALC295_FIXUP_ASUS_DACS,
7723 	ALC295_FIXUP_HP_OMEN,
7724 	ALC285_FIXUP_HP_SPECTRE_X360,
7725 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7726 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7727 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7728 	ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7729 	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7730 	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7731 	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7732 	ALC298_FIXUP_LENOVO_C940_DUET7,
7733 	ALC287_FIXUP_13S_GEN2_SPEAKERS,
7734 	ALC256_FIXUP_SET_COEF_DEFAULTS,
7735 	ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7736 	ALC233_FIXUP_NO_AUDIO_JACK,
7737 	ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7738 	ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7739 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7740 	ALC287_FIXUP_LEGION_16ACHG6,
7741 	ALC287_FIXUP_CS35L41_I2C_2,
7742 	ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7743 	ALC287_FIXUP_CS35L41_I2C_4,
7744 	ALC245_FIXUP_CS35L41_SPI_2,
7745 	ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7746 	ALC245_FIXUP_CS35L41_SPI_4,
7747 	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7748 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7749 	ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7750 	ALC287_FIXUP_LEGION_16ITHG6,
7751 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7752 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7753 	ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
7754 	ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7755 	ALC236_FIXUP_DELL_DUAL_CODECS,
7756 	ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
7757 	ALC287_FIXUP_TAS2781_I2C,
7758 	ALC287_FIXUP_YOGA7_14ARB7_I2C,
7759 	ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
7760 	ALC245_FIXUP_HP_X360_MUTE_LEDS,
7761 	ALC287_FIXUP_THINKPAD_I2S_SPK,
7762 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
7763 	ALC2XX_FIXUP_HEADSET_MIC,
7764 	ALC289_FIXUP_DELL_CS35L41_SPI_2,
7765 	ALC294_FIXUP_CS35L41_I2C_2,
7766 	ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
7767 	ALC256_FIXUP_HEADPHONE_AMP_VOL,
7768 	ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
7769 	ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX,
7770 	ALC285_FIXUP_ASUS_GA403U,
7771 	ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
7772 	ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
7773 	ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
7774 	ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
7775 	ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
7776 	ALC256_FIXUP_CHROME_BOOK,
7777 	ALC245_FIXUP_CLEVO_NOISY_MIC,
7778 	ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
7779 };
7780 
7781 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7782  * both have the very same PCI SSID, and we need to apply different fixups
7783  * depending on the codec ID
7784  */
7785 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7786 					   const struct hda_fixup *fix,
7787 					   int action)
7788 {
7789 	int id;
7790 
7791 	if (codec->core.vendor_id == 0x10ec0298)
7792 		id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7793 	else
7794 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7795 	__snd_hda_apply_fixup(codec, id, action, 0);
7796 }
7797 
7798 static const struct hda_fixup alc269_fixups[] = {
7799 	[ALC269_FIXUP_GPIO2] = {
7800 		.type = HDA_FIXUP_FUNC,
7801 		.v.func = alc_fixup_gpio2,
7802 	},
7803 	[ALC269_FIXUP_SONY_VAIO] = {
7804 		.type = HDA_FIXUP_PINCTLS,
7805 		.v.pins = (const struct hda_pintbl[]) {
7806 			{0x19, PIN_VREFGRD},
7807 			{}
7808 		}
7809 	},
7810 	[ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7811 		.type = HDA_FIXUP_FUNC,
7812 		.v.func = alc275_fixup_gpio4_off,
7813 		.chained = true,
7814 		.chain_id = ALC269_FIXUP_SONY_VAIO
7815 	},
7816 	[ALC269_FIXUP_DELL_M101Z] = {
7817 		.type = HDA_FIXUP_VERBS,
7818 		.v.verbs = (const struct hda_verb[]) {
7819 			/* Enables internal speaker */
7820 			{0x20, AC_VERB_SET_COEF_INDEX, 13},
7821 			{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7822 			{}
7823 		}
7824 	},
7825 	[ALC269_FIXUP_SKU_IGNORE] = {
7826 		.type = HDA_FIXUP_FUNC,
7827 		.v.func = alc_fixup_sku_ignore,
7828 	},
7829 	[ALC269_FIXUP_ASUS_G73JW] = {
7830 		.type = HDA_FIXUP_PINS,
7831 		.v.pins = (const struct hda_pintbl[]) {
7832 			{ 0x17, 0x99130111 }, /* subwoofer */
7833 			{ }
7834 		}
7835 	},
7836 	[ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7837 		.type = HDA_FIXUP_PINS,
7838 		.v.pins = (const struct hda_pintbl[]) {
7839 			{ 0x19, 0x03A11050 },
7840 			{ 0x1a, 0x03A11C30 },
7841 			{ 0x21, 0x03211420 },
7842 			{ }
7843 		}
7844 	},
7845 	[ALC269_FIXUP_ASUS_N7601ZM] = {
7846 		.type = HDA_FIXUP_VERBS,
7847 		.v.verbs = (const struct hda_verb[]) {
7848 			{0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7849 			{0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7850 			{0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7851 			{0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7852 			{0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7853 			{0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7854 			{ }
7855 		},
7856 		.chained = true,
7857 		.chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7858 	},
7859 	[ALC269_FIXUP_LENOVO_EAPD] = {
7860 		.type = HDA_FIXUP_VERBS,
7861 		.v.verbs = (const struct hda_verb[]) {
7862 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7863 			{}
7864 		}
7865 	},
7866 	[ALC275_FIXUP_SONY_HWEQ] = {
7867 		.type = HDA_FIXUP_FUNC,
7868 		.v.func = alc269_fixup_hweq,
7869 		.chained = true,
7870 		.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7871 	},
7872 	[ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7873 		.type = HDA_FIXUP_FUNC,
7874 		.v.func = alc_fixup_disable_aamix,
7875 		.chained = true,
7876 		.chain_id = ALC269_FIXUP_SONY_VAIO
7877 	},
7878 	[ALC271_FIXUP_DMIC] = {
7879 		.type = HDA_FIXUP_FUNC,
7880 		.v.func = alc271_fixup_dmic,
7881 	},
7882 	[ALC269_FIXUP_PCM_44K] = {
7883 		.type = HDA_FIXUP_FUNC,
7884 		.v.func = alc269_fixup_pcm_44k,
7885 		.chained = true,
7886 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7887 	},
7888 	[ALC269_FIXUP_STEREO_DMIC] = {
7889 		.type = HDA_FIXUP_FUNC,
7890 		.v.func = alc269_fixup_stereo_dmic,
7891 	},
7892 	[ALC269_FIXUP_HEADSET_MIC] = {
7893 		.type = HDA_FIXUP_FUNC,
7894 		.v.func = alc269_fixup_headset_mic,
7895 	},
7896 	[ALC269_FIXUP_QUANTA_MUTE] = {
7897 		.type = HDA_FIXUP_FUNC,
7898 		.v.func = alc269_fixup_quanta_mute,
7899 	},
7900 	[ALC269_FIXUP_LIFEBOOK] = {
7901 		.type = HDA_FIXUP_PINS,
7902 		.v.pins = (const struct hda_pintbl[]) {
7903 			{ 0x1a, 0x2101103f }, /* dock line-out */
7904 			{ 0x1b, 0x23a11040 }, /* dock mic-in */
7905 			{ }
7906 		},
7907 		.chained = true,
7908 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7909 	},
7910 	[ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7911 		.type = HDA_FIXUP_PINS,
7912 		.v.pins = (const struct hda_pintbl[]) {
7913 			{ 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7914 			{ }
7915 		},
7916 	},
7917 	[ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7918 		.type = HDA_FIXUP_PINS,
7919 		.v.pins = (const struct hda_pintbl[]) {
7920 			{ 0x21, 0x0221102f }, /* HP out */
7921 			{ }
7922 		},
7923 	},
7924 	[ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7925 		.type = HDA_FIXUP_FUNC,
7926 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7927 	},
7928 	[ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7929 		.type = HDA_FIXUP_FUNC,
7930 		.v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7931 	},
7932 	[ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7933 		.type = HDA_FIXUP_PINS,
7934 		.v.pins = (const struct hda_pintbl[]) {
7935 			{ 0x18, 0x03a19020 }, /* headset mic */
7936 			{ 0x1b, 0x90170150 }, /* speaker */
7937 			{ }
7938 		},
7939 	},
7940 	[ALC269_FIXUP_AMIC] = {
7941 		.type = HDA_FIXUP_PINS,
7942 		.v.pins = (const struct hda_pintbl[]) {
7943 			{ 0x14, 0x99130110 }, /* speaker */
7944 			{ 0x15, 0x0121401f }, /* HP out */
7945 			{ 0x18, 0x01a19c20 }, /* mic */
7946 			{ 0x19, 0x99a3092f }, /* int-mic */
7947 			{ }
7948 		},
7949 	},
7950 	[ALC269_FIXUP_DMIC] = {
7951 		.type = HDA_FIXUP_PINS,
7952 		.v.pins = (const struct hda_pintbl[]) {
7953 			{ 0x12, 0x99a3092f }, /* int-mic */
7954 			{ 0x14, 0x99130110 }, /* speaker */
7955 			{ 0x15, 0x0121401f }, /* HP out */
7956 			{ 0x18, 0x01a19c20 }, /* mic */
7957 			{ }
7958 		},
7959 	},
7960 	[ALC269VB_FIXUP_AMIC] = {
7961 		.type = HDA_FIXUP_PINS,
7962 		.v.pins = (const struct hda_pintbl[]) {
7963 			{ 0x14, 0x99130110 }, /* speaker */
7964 			{ 0x18, 0x01a19c20 }, /* mic */
7965 			{ 0x19, 0x99a3092f }, /* int-mic */
7966 			{ 0x21, 0x0121401f }, /* HP out */
7967 			{ }
7968 		},
7969 	},
7970 	[ALC269VB_FIXUP_DMIC] = {
7971 		.type = HDA_FIXUP_PINS,
7972 		.v.pins = (const struct hda_pintbl[]) {
7973 			{ 0x12, 0x99a3092f }, /* int-mic */
7974 			{ 0x14, 0x99130110 }, /* speaker */
7975 			{ 0x18, 0x01a19c20 }, /* mic */
7976 			{ 0x21, 0x0121401f }, /* HP out */
7977 			{ }
7978 		},
7979 	},
7980 	[ALC269_FIXUP_HP_MUTE_LED] = {
7981 		.type = HDA_FIXUP_FUNC,
7982 		.v.func = alc269_fixup_hp_mute_led,
7983 	},
7984 	[ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7985 		.type = HDA_FIXUP_FUNC,
7986 		.v.func = alc269_fixup_hp_mute_led_mic1,
7987 	},
7988 	[ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7989 		.type = HDA_FIXUP_FUNC,
7990 		.v.func = alc269_fixup_hp_mute_led_mic2,
7991 	},
7992 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7993 		.type = HDA_FIXUP_FUNC,
7994 		.v.func = alc269_fixup_hp_mute_led_mic3,
7995 		.chained = true,
7996 		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7997 	},
7998 	[ALC269_FIXUP_HP_GPIO_LED] = {
7999 		.type = HDA_FIXUP_FUNC,
8000 		.v.func = alc269_fixup_hp_gpio_led,
8001 	},
8002 	[ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
8003 		.type = HDA_FIXUP_FUNC,
8004 		.v.func = alc269_fixup_hp_gpio_mic1_led,
8005 	},
8006 	[ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
8007 		.type = HDA_FIXUP_FUNC,
8008 		.v.func = alc269_fixup_hp_line1_mic1_led,
8009 	},
8010 	[ALC269_FIXUP_INV_DMIC] = {
8011 		.type = HDA_FIXUP_FUNC,
8012 		.v.func = alc_fixup_inv_dmic,
8013 	},
8014 	[ALC269_FIXUP_NO_SHUTUP] = {
8015 		.type = HDA_FIXUP_FUNC,
8016 		.v.func = alc_fixup_no_shutup,
8017 	},
8018 	[ALC269_FIXUP_LENOVO_DOCK] = {
8019 		.type = HDA_FIXUP_PINS,
8020 		.v.pins = (const struct hda_pintbl[]) {
8021 			{ 0x19, 0x23a11040 }, /* dock mic */
8022 			{ 0x1b, 0x2121103f }, /* dock headphone */
8023 			{ }
8024 		},
8025 		.chained = true,
8026 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
8027 	},
8028 	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
8029 		.type = HDA_FIXUP_FUNC,
8030 		.v.func = alc269_fixup_limit_int_mic_boost,
8031 		.chained = true,
8032 		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
8033 	},
8034 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
8035 		.type = HDA_FIXUP_FUNC,
8036 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
8037 		.chained = true,
8038 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8039 	},
8040 	[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8041 		.type = HDA_FIXUP_PINS,
8042 		.v.pins = (const struct hda_pintbl[]) {
8043 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8044 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8045 			{ }
8046 		},
8047 		.chained = true,
8048 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8049 	},
8050 	[ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8051 		.type = HDA_FIXUP_PINS,
8052 		.v.pins = (const struct hda_pintbl[]) {
8053 			{ 0x16, 0x21014020 }, /* dock line out */
8054 			{ 0x19, 0x21a19030 }, /* dock mic */
8055 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8056 			{ }
8057 		},
8058 		.chained = true,
8059 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8060 	},
8061 	[ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
8062 		.type = HDA_FIXUP_PINS,
8063 		.v.pins = (const struct hda_pintbl[]) {
8064 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8065 			{ }
8066 		},
8067 		.chained = true,
8068 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8069 	},
8070 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
8071 		.type = HDA_FIXUP_PINS,
8072 		.v.pins = (const struct hda_pintbl[]) {
8073 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8074 			{ 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8075 			{ }
8076 		},
8077 		.chained = true,
8078 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8079 	},
8080 	[ALC269_FIXUP_HEADSET_MODE] = {
8081 		.type = HDA_FIXUP_FUNC,
8082 		.v.func = alc_fixup_headset_mode,
8083 		.chained = true,
8084 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8085 	},
8086 	[ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8087 		.type = HDA_FIXUP_FUNC,
8088 		.v.func = alc_fixup_headset_mode_no_hp_mic,
8089 	},
8090 	[ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
8091 		.type = HDA_FIXUP_PINS,
8092 		.v.pins = (const struct hda_pintbl[]) {
8093 			{ 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
8094 			{ }
8095 		},
8096 		.chained = true,
8097 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8098 	},
8099 	[ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
8100 		.type = HDA_FIXUP_PINS,
8101 		.v.pins = (const struct hda_pintbl[]) {
8102 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8103 			{ }
8104 		},
8105 		.chained = true,
8106 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8107 	},
8108 	[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8109 		.type = HDA_FIXUP_PINS,
8110 		.v.pins = (const struct hda_pintbl[]) {
8111 			{0x12, 0x90a60130},
8112 			{0x13, 0x40000000},
8113 			{0x14, 0x90170110},
8114 			{0x18, 0x411111f0},
8115 			{0x19, 0x04a11040},
8116 			{0x1a, 0x411111f0},
8117 			{0x1b, 0x90170112},
8118 			{0x1d, 0x40759a05},
8119 			{0x1e, 0x411111f0},
8120 			{0x21, 0x04211020},
8121 			{ }
8122 		},
8123 		.chained = true,
8124 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8125 	},
8126 	[ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
8127 		.type = HDA_FIXUP_FUNC,
8128 		.v.func = alc298_fixup_huawei_mbx_stereo,
8129 		.chained = true,
8130 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8131 	},
8132 	[ALC269_FIXUP_ASUS_X101_FUNC] = {
8133 		.type = HDA_FIXUP_FUNC,
8134 		.v.func = alc269_fixup_x101_headset_mic,
8135 	},
8136 	[ALC269_FIXUP_ASUS_X101_VERB] = {
8137 		.type = HDA_FIXUP_VERBS,
8138 		.v.verbs = (const struct hda_verb[]) {
8139 			{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
8140 			{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8141 			{0x20, AC_VERB_SET_PROC_COEF,  0x0310},
8142 			{ }
8143 		},
8144 		.chained = true,
8145 		.chain_id = ALC269_FIXUP_ASUS_X101_FUNC
8146 	},
8147 	[ALC269_FIXUP_ASUS_X101] = {
8148 		.type = HDA_FIXUP_PINS,
8149 		.v.pins = (const struct hda_pintbl[]) {
8150 			{ 0x18, 0x04a1182c }, /* Headset mic */
8151 			{ }
8152 		},
8153 		.chained = true,
8154 		.chain_id = ALC269_FIXUP_ASUS_X101_VERB
8155 	},
8156 	[ALC271_FIXUP_AMIC_MIC2] = {
8157 		.type = HDA_FIXUP_PINS,
8158 		.v.pins = (const struct hda_pintbl[]) {
8159 			{ 0x14, 0x99130110 }, /* speaker */
8160 			{ 0x19, 0x01a19c20 }, /* mic */
8161 			{ 0x1b, 0x99a7012f }, /* int-mic */
8162 			{ 0x21, 0x0121401f }, /* HP out */
8163 			{ }
8164 		},
8165 	},
8166 	[ALC271_FIXUP_HP_GATE_MIC_JACK] = {
8167 		.type = HDA_FIXUP_FUNC,
8168 		.v.func = alc271_hp_gate_mic_jack,
8169 		.chained = true,
8170 		.chain_id = ALC271_FIXUP_AMIC_MIC2,
8171 	},
8172 	[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
8173 		.type = HDA_FIXUP_FUNC,
8174 		.v.func = alc269_fixup_limit_int_mic_boost,
8175 		.chained = true,
8176 		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
8177 	},
8178 	[ALC269_FIXUP_ACER_AC700] = {
8179 		.type = HDA_FIXUP_PINS,
8180 		.v.pins = (const struct hda_pintbl[]) {
8181 			{ 0x12, 0x99a3092f }, /* int-mic */
8182 			{ 0x14, 0x99130110 }, /* speaker */
8183 			{ 0x18, 0x03a11c20 }, /* mic */
8184 			{ 0x1e, 0x0346101e }, /* SPDIF1 */
8185 			{ 0x21, 0x0321101f }, /* HP out */
8186 			{ }
8187 		},
8188 		.chained = true,
8189 		.chain_id = ALC271_FIXUP_DMIC,
8190 	},
8191 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
8192 		.type = HDA_FIXUP_FUNC,
8193 		.v.func = alc269_fixup_limit_int_mic_boost,
8194 		.chained = true,
8195 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8196 	},
8197 	[ALC269VB_FIXUP_ASUS_ZENBOOK] = {
8198 		.type = HDA_FIXUP_FUNC,
8199 		.v.func = alc269_fixup_limit_int_mic_boost,
8200 		.chained = true,
8201 		.chain_id = ALC269VB_FIXUP_DMIC,
8202 	},
8203 	[ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
8204 		.type = HDA_FIXUP_VERBS,
8205 		.v.verbs = (const struct hda_verb[]) {
8206 			/* class-D output amp +5dB */
8207 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
8208 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
8209 			{}
8210 		},
8211 		.chained = true,
8212 		.chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
8213 	},
8214 	[ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8215 		.type = HDA_FIXUP_PINS,
8216 		.v.pins = (const struct hda_pintbl[]) {
8217 			{ 0x18, 0x01a110f0 },  /* use as headset mic */
8218 			{ }
8219 		},
8220 		.chained = true,
8221 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8222 	},
8223 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8224 		.type = HDA_FIXUP_FUNC,
8225 		.v.func = alc269_fixup_limit_int_mic_boost,
8226 		.chained = true,
8227 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8228 	},
8229 	[ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8230 		.type = HDA_FIXUP_PINS,
8231 		.v.pins = (const struct hda_pintbl[]) {
8232 			{ 0x12, 0x99a3092f }, /* int-mic */
8233 			{ 0x18, 0x03a11d20 }, /* mic */
8234 			{ 0x19, 0x411111f0 }, /* Unused bogus pin */
8235 			{ }
8236 		},
8237 	},
8238 	[ALC283_FIXUP_CHROME_BOOK] = {
8239 		.type = HDA_FIXUP_FUNC,
8240 		.v.func = alc283_fixup_chromebook,
8241 	},
8242 	[ALC283_FIXUP_SENSE_COMBO_JACK] = {
8243 		.type = HDA_FIXUP_FUNC,
8244 		.v.func = alc283_fixup_sense_combo_jack,
8245 		.chained = true,
8246 		.chain_id = ALC283_FIXUP_CHROME_BOOK,
8247 	},
8248 	[ALC282_FIXUP_ASUS_TX300] = {
8249 		.type = HDA_FIXUP_FUNC,
8250 		.v.func = alc282_fixup_asus_tx300,
8251 	},
8252 	[ALC283_FIXUP_INT_MIC] = {
8253 		.type = HDA_FIXUP_VERBS,
8254 		.v.verbs = (const struct hda_verb[]) {
8255 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8256 			{0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8257 			{ }
8258 		},
8259 		.chained = true,
8260 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8261 	},
8262 	[ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8263 		.type = HDA_FIXUP_PINS,
8264 		.v.pins = (const struct hda_pintbl[]) {
8265 			{ 0x17, 0x90170112 }, /* subwoofer */
8266 			{ }
8267 		},
8268 		.chained = true,
8269 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8270 	},
8271 	[ALC290_FIXUP_SUBWOOFER] = {
8272 		.type = HDA_FIXUP_PINS,
8273 		.v.pins = (const struct hda_pintbl[]) {
8274 			{ 0x17, 0x90170112 }, /* subwoofer */
8275 			{ }
8276 		},
8277 		.chained = true,
8278 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8279 	},
8280 	[ALC290_FIXUP_MONO_SPEAKERS] = {
8281 		.type = HDA_FIXUP_FUNC,
8282 		.v.func = alc290_fixup_mono_speakers,
8283 	},
8284 	[ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8285 		.type = HDA_FIXUP_FUNC,
8286 		.v.func = alc290_fixup_mono_speakers,
8287 		.chained = true,
8288 		.chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8289 	},
8290 	[ALC269_FIXUP_THINKPAD_ACPI] = {
8291 		.type = HDA_FIXUP_FUNC,
8292 		.v.func = alc_fixup_thinkpad_acpi,
8293 		.chained = true,
8294 		.chain_id = ALC269_FIXUP_SKU_IGNORE,
8295 	},
8296 	[ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8297 		.type = HDA_FIXUP_FUNC,
8298 		.v.func = alc_fixup_inv_dmic,
8299 		.chained = true,
8300 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8301 	},
8302 	[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
8303 		.type = HDA_FIXUP_PINS,
8304 		.v.pins = (const struct hda_pintbl[]) {
8305 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8306 			{ }
8307 		},
8308 		.chained = true,
8309 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8310 	},
8311 	[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8312 		.type = HDA_FIXUP_PINS,
8313 		.v.pins = (const struct hda_pintbl[]) {
8314 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8315 			{ }
8316 		},
8317 		.chained = true,
8318 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8319 	},
8320 	[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8321 		.type = HDA_FIXUP_PINS,
8322 		.v.pins = (const struct hda_pintbl[]) {
8323 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8324 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8325 			{ }
8326 		},
8327 		.chained = true,
8328 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8329 	},
8330 	[ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8331 		.type = HDA_FIXUP_PINS,
8332 		.v.pins = (const struct hda_pintbl[]) {
8333 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8334 			{ }
8335 		},
8336 		.chained = true,
8337 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8338 	},
8339 	[ALC255_FIXUP_HEADSET_MODE] = {
8340 		.type = HDA_FIXUP_FUNC,
8341 		.v.func = alc_fixup_headset_mode_alc255,
8342 		.chained = true,
8343 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8344 	},
8345 	[ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8346 		.type = HDA_FIXUP_FUNC,
8347 		.v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8348 	},
8349 	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8350 		.type = HDA_FIXUP_PINS,
8351 		.v.pins = (const struct hda_pintbl[]) {
8352 			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8353 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8354 			{ }
8355 		},
8356 		.chained = true,
8357 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8358 	},
8359 	[ALC292_FIXUP_TPT440_DOCK] = {
8360 		.type = HDA_FIXUP_FUNC,
8361 		.v.func = alc_fixup_tpt440_dock,
8362 		.chained = true,
8363 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8364 	},
8365 	[ALC292_FIXUP_TPT440] = {
8366 		.type = HDA_FIXUP_FUNC,
8367 		.v.func = alc_fixup_disable_aamix,
8368 		.chained = true,
8369 		.chain_id = ALC292_FIXUP_TPT440_DOCK,
8370 	},
8371 	[ALC283_FIXUP_HEADSET_MIC] = {
8372 		.type = HDA_FIXUP_PINS,
8373 		.v.pins = (const struct hda_pintbl[]) {
8374 			{ 0x19, 0x04a110f0 },
8375 			{ },
8376 		},
8377 	},
8378 	[ALC255_FIXUP_MIC_MUTE_LED] = {
8379 		.type = HDA_FIXUP_FUNC,
8380 		.v.func = alc_fixup_micmute_led,
8381 	},
8382 	[ALC282_FIXUP_ASPIRE_V5_PINS] = {
8383 		.type = HDA_FIXUP_PINS,
8384 		.v.pins = (const struct hda_pintbl[]) {
8385 			{ 0x12, 0x90a60130 },
8386 			{ 0x14, 0x90170110 },
8387 			{ 0x17, 0x40000008 },
8388 			{ 0x18, 0x411111f0 },
8389 			{ 0x19, 0x01a1913c },
8390 			{ 0x1a, 0x411111f0 },
8391 			{ 0x1b, 0x411111f0 },
8392 			{ 0x1d, 0x40f89b2d },
8393 			{ 0x1e, 0x411111f0 },
8394 			{ 0x21, 0x0321101f },
8395 			{ },
8396 		},
8397 	},
8398 	[ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8399 		.type = HDA_FIXUP_FUNC,
8400 		.v.func = alc269vb_fixup_aspire_e1_coef,
8401 	},
8402 	[ALC280_FIXUP_HP_GPIO4] = {
8403 		.type = HDA_FIXUP_FUNC,
8404 		.v.func = alc280_fixup_hp_gpio4,
8405 	},
8406 	[ALC286_FIXUP_HP_GPIO_LED] = {
8407 		.type = HDA_FIXUP_FUNC,
8408 		.v.func = alc286_fixup_hp_gpio_led,
8409 	},
8410 	[ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8411 		.type = HDA_FIXUP_FUNC,
8412 		.v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8413 	},
8414 	[ALC280_FIXUP_HP_DOCK_PINS] = {
8415 		.type = HDA_FIXUP_PINS,
8416 		.v.pins = (const struct hda_pintbl[]) {
8417 			{ 0x1b, 0x21011020 }, /* line-out */
8418 			{ 0x1a, 0x01a1903c }, /* headset mic */
8419 			{ 0x18, 0x2181103f }, /* line-in */
8420 			{ },
8421 		},
8422 		.chained = true,
8423 		.chain_id = ALC280_FIXUP_HP_GPIO4
8424 	},
8425 	[ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8426 		.type = HDA_FIXUP_PINS,
8427 		.v.pins = (const struct hda_pintbl[]) {
8428 			{ 0x1b, 0x21011020 }, /* line-out */
8429 			{ 0x18, 0x2181103f }, /* line-in */
8430 			{ },
8431 		},
8432 		.chained = true,
8433 		.chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8434 	},
8435 	[ALC280_FIXUP_HP_9480M] = {
8436 		.type = HDA_FIXUP_FUNC,
8437 		.v.func = alc280_fixup_hp_9480m,
8438 	},
8439 	[ALC245_FIXUP_HP_X360_AMP] = {
8440 		.type = HDA_FIXUP_FUNC,
8441 		.v.func = alc245_fixup_hp_x360_amp,
8442 		.chained = true,
8443 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
8444 	},
8445 	[ALC288_FIXUP_DELL_HEADSET_MODE] = {
8446 		.type = HDA_FIXUP_FUNC,
8447 		.v.func = alc_fixup_headset_mode_dell_alc288,
8448 		.chained = true,
8449 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8450 	},
8451 	[ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8452 		.type = HDA_FIXUP_PINS,
8453 		.v.pins = (const struct hda_pintbl[]) {
8454 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8455 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8456 			{ }
8457 		},
8458 		.chained = true,
8459 		.chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8460 	},
8461 	[ALC288_FIXUP_DISABLE_AAMIX] = {
8462 		.type = HDA_FIXUP_FUNC,
8463 		.v.func = alc_fixup_disable_aamix,
8464 		.chained = true,
8465 		.chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
8466 	},
8467 	[ALC288_FIXUP_DELL_XPS_13] = {
8468 		.type = HDA_FIXUP_FUNC,
8469 		.v.func = alc_fixup_dell_xps13,
8470 		.chained = true,
8471 		.chain_id = ALC288_FIXUP_DISABLE_AAMIX
8472 	},
8473 	[ALC292_FIXUP_DISABLE_AAMIX] = {
8474 		.type = HDA_FIXUP_FUNC,
8475 		.v.func = alc_fixup_disable_aamix,
8476 		.chained = true,
8477 		.chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8478 	},
8479 	[ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8480 		.type = HDA_FIXUP_FUNC,
8481 		.v.func = alc_fixup_disable_aamix,
8482 		.chained = true,
8483 		.chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8484 	},
8485 	[ALC292_FIXUP_DELL_E7X_AAMIX] = {
8486 		.type = HDA_FIXUP_FUNC,
8487 		.v.func = alc_fixup_dell_xps13,
8488 		.chained = true,
8489 		.chain_id = ALC292_FIXUP_DISABLE_AAMIX
8490 	},
8491 	[ALC292_FIXUP_DELL_E7X] = {
8492 		.type = HDA_FIXUP_FUNC,
8493 		.v.func = alc_fixup_micmute_led,
8494 		/* micmute fixup must be applied at last */
8495 		.chained_before = true,
8496 		.chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8497 	},
8498 	[ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8499 		.type = HDA_FIXUP_PINS,
8500 		.v.pins = (const struct hda_pintbl[]) {
8501 			{ 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8502 			{ }
8503 		},
8504 		.chained_before = true,
8505 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8506 	},
8507 	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8508 		.type = HDA_FIXUP_PINS,
8509 		.v.pins = (const struct hda_pintbl[]) {
8510 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8511 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8512 			{ }
8513 		},
8514 		.chained = true,
8515 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8516 	},
8517 	[ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8518 		.type = HDA_FIXUP_PINS,
8519 		.v.pins = (const struct hda_pintbl[]) {
8520 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8521 			{ }
8522 		},
8523 		.chained = true,
8524 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8525 	},
8526 	[ALC275_FIXUP_DELL_XPS] = {
8527 		.type = HDA_FIXUP_VERBS,
8528 		.v.verbs = (const struct hda_verb[]) {
8529 			/* Enables internal speaker */
8530 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8531 			{0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8532 			{0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8533 			{0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8534 			{}
8535 		}
8536 	},
8537 	[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8538 		.type = HDA_FIXUP_FUNC,
8539 		.v.func = alc_fixup_disable_aamix,
8540 		.chained = true,
8541 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8542 	},
8543 	[ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8544 		.type = HDA_FIXUP_FUNC,
8545 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8546 	},
8547 	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8548 		.type = HDA_FIXUP_FUNC,
8549 		.v.func = alc_fixup_inv_dmic,
8550 		.chained = true,
8551 		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8552 	},
8553 	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8554 		.type = HDA_FIXUP_FUNC,
8555 		.v.func = alc269_fixup_limit_int_mic_boost
8556 	},
8557 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
8558 		.type = HDA_FIXUP_FUNC,
8559 		.v.func = alc_fixup_disable_aamix,
8560 		.chained = true,
8561 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8562 	},
8563 	[ALC225_FIXUP_DISABLE_MIC_VREF] = {
8564 		.type = HDA_FIXUP_FUNC,
8565 		.v.func = alc_fixup_disable_mic_vref,
8566 		.chained = true,
8567 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8568 	},
8569 	[ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8570 		.type = HDA_FIXUP_VERBS,
8571 		.v.verbs = (const struct hda_verb[]) {
8572 			/* Disable pass-through path for FRONT 14h */
8573 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8574 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8575 			{}
8576 		},
8577 		.chained = true,
8578 		.chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8579 	},
8580 	[ALC280_FIXUP_HP_HEADSET_MIC] = {
8581 		.type = HDA_FIXUP_FUNC,
8582 		.v.func = alc_fixup_disable_aamix,
8583 		.chained = true,
8584 		.chain_id = ALC269_FIXUP_HEADSET_MIC,
8585 	},
8586 	[ALC221_FIXUP_HP_FRONT_MIC] = {
8587 		.type = HDA_FIXUP_PINS,
8588 		.v.pins = (const struct hda_pintbl[]) {
8589 			{ 0x19, 0x02a19020 }, /* Front Mic */
8590 			{ }
8591 		},
8592 	},
8593 	[ALC292_FIXUP_TPT460] = {
8594 		.type = HDA_FIXUP_FUNC,
8595 		.v.func = alc_fixup_tpt440_dock,
8596 		.chained = true,
8597 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8598 	},
8599 	[ALC298_FIXUP_SPK_VOLUME] = {
8600 		.type = HDA_FIXUP_FUNC,
8601 		.v.func = alc298_fixup_speaker_volume,
8602 		.chained = true,
8603 		.chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8604 	},
8605 	[ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8606 		.type = HDA_FIXUP_FUNC,
8607 		.v.func = alc298_fixup_speaker_volume,
8608 	},
8609 	[ALC295_FIXUP_DISABLE_DAC3] = {
8610 		.type = HDA_FIXUP_FUNC,
8611 		.v.func = alc295_fixup_disable_dac3,
8612 	},
8613 	[ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8614 		.type = HDA_FIXUP_FUNC,
8615 		.v.func = alc285_fixup_speaker2_to_dac1,
8616 		.chained = true,
8617 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8618 	},
8619 	[ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8620 		.type = HDA_FIXUP_FUNC,
8621 		.v.func = alc285_fixup_speaker2_to_dac1,
8622 		.chained = true,
8623 		.chain_id = ALC245_FIXUP_CS35L41_SPI_2
8624 	},
8625 	[ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8626 		.type = HDA_FIXUP_PINS,
8627 		.v.pins = (const struct hda_pintbl[]) {
8628 			{ 0x19, 0x03a11050 },
8629 			{ 0x1b, 0x03a11c30 },
8630 			{ }
8631 		},
8632 		.chained = true,
8633 		.chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8634 	},
8635 	[ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8636 		.type = HDA_FIXUP_PINS,
8637 		.v.pins = (const struct hda_pintbl[]) {
8638 			{ 0x14, 0x90170120 },
8639 			{ }
8640 		},
8641 		.chained = true,
8642 		.chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8643 	},
8644 	[ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8645 		.type = HDA_FIXUP_FUNC,
8646 		.v.func = alc285_fixup_speaker2_to_dac1,
8647 		.chained = true,
8648 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2
8649 	},
8650 	[ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8651 		.type = HDA_FIXUP_PINS,
8652 		.v.pins = (const struct hda_pintbl[]) {
8653 			{ 0x19, 0x03a11050 },
8654 			{ 0x1b, 0x03a11c30 },
8655 			{ }
8656 		},
8657 		.chained = true,
8658 		.chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8659 	},
8660 	[ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8661 		.type = HDA_FIXUP_PINS,
8662 		.v.pins = (const struct hda_pintbl[]) {
8663 			{ 0x1b, 0x90170151 },
8664 			{ }
8665 		},
8666 		.chained = true,
8667 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8668 	},
8669 	[ALC269_FIXUP_ATIV_BOOK_8] = {
8670 		.type = HDA_FIXUP_FUNC,
8671 		.v.func = alc_fixup_auto_mute_via_amp,
8672 		.chained = true,
8673 		.chain_id = ALC269_FIXUP_NO_SHUTUP
8674 	},
8675 	[ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8676 		.type = HDA_FIXUP_PINS,
8677 		.v.pins = (const struct hda_pintbl[]) {
8678 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8679 			{ 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8680 			{ }
8681 		},
8682 		.chained = true,
8683 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8684 	},
8685 	[ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8686 		.type = HDA_FIXUP_PINS,
8687 		.v.pins = (const struct hda_pintbl[]) {
8688 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8689 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8690 			{ }
8691 		},
8692 		.chained = true,
8693 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8694 	},
8695 	[ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8696 		.type = HDA_FIXUP_FUNC,
8697 		.v.func = alc_fixup_headset_mode,
8698 	},
8699 	[ALC256_FIXUP_ASUS_MIC] = {
8700 		.type = HDA_FIXUP_PINS,
8701 		.v.pins = (const struct hda_pintbl[]) {
8702 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8703 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8704 			{ }
8705 		},
8706 		.chained = true,
8707 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8708 	},
8709 	[ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8710 		.type = HDA_FIXUP_FUNC,
8711 		/* Set up GPIO2 for the speaker amp */
8712 		.v.func = alc_fixup_gpio4,
8713 	},
8714 	[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8715 		.type = HDA_FIXUP_PINS,
8716 		.v.pins = (const struct hda_pintbl[]) {
8717 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8718 			{ }
8719 		},
8720 		.chained = true,
8721 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8722 	},
8723 	[ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8724 		.type = HDA_FIXUP_VERBS,
8725 		.v.verbs = (const struct hda_verb[]) {
8726 			/* Enables internal speaker */
8727 			{0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8728 			{0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8729 			{}
8730 		},
8731 		.chained = true,
8732 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8733 	},
8734 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8735 		.type = HDA_FIXUP_FUNC,
8736 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8737 		.chained = true,
8738 		.chain_id = ALC269_FIXUP_GPIO2
8739 	},
8740 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
8741 		.type = HDA_FIXUP_VERBS,
8742 		.v.verbs = (const struct hda_verb[]) {
8743 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8744 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8745 			{ }
8746 		},
8747 		.chained = true,
8748 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8749 	},
8750 	[ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8751 		.type = HDA_FIXUP_PINS,
8752 		.v.pins = (const struct hda_pintbl[]) {
8753 			/* Change the mic location from front to right, otherwise there are
8754 			   two front mics with the same name, pulseaudio can't handle them.
8755 			   This is just a temporary workaround, after applying this fixup,
8756 			   there will be one "Front Mic" and one "Mic" in this machine.
8757 			 */
8758 			{ 0x1a, 0x04a19040 },
8759 			{ }
8760 		},
8761 	},
8762 	[ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8763 		.type = HDA_FIXUP_PINS,
8764 		.v.pins = (const struct hda_pintbl[]) {
8765 			{ 0x16, 0x0101102f }, /* Rear Headset HP */
8766 			{ 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8767 			{ 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8768 			{ 0x1b, 0x02011020 },
8769 			{ }
8770 		},
8771 		.chained = true,
8772 		.chain_id = ALC225_FIXUP_S3_POP_NOISE
8773 	},
8774 	[ALC225_FIXUP_S3_POP_NOISE] = {
8775 		.type = HDA_FIXUP_FUNC,
8776 		.v.func = alc225_fixup_s3_pop_noise,
8777 		.chained = true,
8778 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8779 	},
8780 	[ALC700_FIXUP_INTEL_REFERENCE] = {
8781 		.type = HDA_FIXUP_VERBS,
8782 		.v.verbs = (const struct hda_verb[]) {
8783 			/* Enables internal speaker */
8784 			{0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8785 			{0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8786 			{0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8787 			{0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8788 			{0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8789 			{0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8790 			{0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8791 			{0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8792 			{}
8793 		}
8794 	},
8795 	[ALC274_FIXUP_DELL_BIND_DACS] = {
8796 		.type = HDA_FIXUP_FUNC,
8797 		.v.func = alc274_fixup_bind_dacs,
8798 		.chained = true,
8799 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8800 	},
8801 	[ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8802 		.type = HDA_FIXUP_PINS,
8803 		.v.pins = (const struct hda_pintbl[]) {
8804 			{ 0x1b, 0x0401102f },
8805 			{ }
8806 		},
8807 		.chained = true,
8808 		.chain_id = ALC274_FIXUP_DELL_BIND_DACS
8809 	},
8810 	[ALC298_FIXUP_TPT470_DOCK_FIX] = {
8811 		.type = HDA_FIXUP_FUNC,
8812 		.v.func = alc_fixup_tpt470_dock,
8813 		.chained = true,
8814 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8815 	},
8816 	[ALC298_FIXUP_TPT470_DOCK] = {
8817 		.type = HDA_FIXUP_FUNC,
8818 		.v.func = alc_fixup_tpt470_dacs,
8819 		.chained = true,
8820 		.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8821 	},
8822 	[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8823 		.type = HDA_FIXUP_PINS,
8824 		.v.pins = (const struct hda_pintbl[]) {
8825 			{ 0x14, 0x0201101f },
8826 			{ }
8827 		},
8828 		.chained = true,
8829 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8830 	},
8831 	[ALC255_FIXUP_DELL_HEADSET_MIC] = {
8832 		.type = HDA_FIXUP_PINS,
8833 		.v.pins = (const struct hda_pintbl[]) {
8834 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8835 			{ }
8836 		},
8837 		.chained = true,
8838 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8839 	},
8840 	[ALC295_FIXUP_HP_X360] = {
8841 		.type = HDA_FIXUP_FUNC,
8842 		.v.func = alc295_fixup_hp_top_speakers,
8843 		.chained = true,
8844 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8845 	},
8846 	[ALC221_FIXUP_HP_HEADSET_MIC] = {
8847 		.type = HDA_FIXUP_PINS,
8848 		.v.pins = (const struct hda_pintbl[]) {
8849 			{ 0x19, 0x0181313f},
8850 			{ }
8851 		},
8852 		.chained = true,
8853 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8854 	},
8855 	[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8856 		.type = HDA_FIXUP_FUNC,
8857 		.v.func = alc285_fixup_invalidate_dacs,
8858 		.chained = true,
8859 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8860 	},
8861 	[ALC295_FIXUP_HP_AUTO_MUTE] = {
8862 		.type = HDA_FIXUP_FUNC,
8863 		.v.func = alc_fixup_auto_mute_via_amp,
8864 	},
8865 	[ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8866 		.type = HDA_FIXUP_PINS,
8867 		.v.pins = (const struct hda_pintbl[]) {
8868 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8869 			{ }
8870 		},
8871 		.chained = true,
8872 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8873 	},
8874 	[ALC294_FIXUP_ASUS_MIC] = {
8875 		.type = HDA_FIXUP_PINS,
8876 		.v.pins = (const struct hda_pintbl[]) {
8877 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8878 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8879 			{ }
8880 		},
8881 		.chained = true,
8882 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8883 	},
8884 	[ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8885 		.type = HDA_FIXUP_PINS,
8886 		.v.pins = (const struct hda_pintbl[]) {
8887 			{ 0x19, 0x01a1103c }, /* use as headset mic */
8888 			{ }
8889 		},
8890 		.chained = true,
8891 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8892 	},
8893 	[ALC294_FIXUP_ASUS_SPK] = {
8894 		.type = HDA_FIXUP_VERBS,
8895 		.v.verbs = (const struct hda_verb[]) {
8896 			/* Set EAPD high */
8897 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8898 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8899 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8900 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8901 			{ }
8902 		},
8903 		.chained = true,
8904 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8905 	},
8906 	[ALC295_FIXUP_CHROME_BOOK] = {
8907 		.type = HDA_FIXUP_FUNC,
8908 		.v.func = alc295_fixup_chromebook,
8909 		.chained = true,
8910 		.chain_id = ALC225_FIXUP_HEADSET_JACK
8911 	},
8912 	[ALC225_FIXUP_HEADSET_JACK] = {
8913 		.type = HDA_FIXUP_FUNC,
8914 		.v.func = alc_fixup_headset_jack,
8915 	},
8916 	[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8917 		.type = HDA_FIXUP_PINS,
8918 		.v.pins = (const struct hda_pintbl[]) {
8919 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8920 			{ }
8921 		},
8922 		.chained = true,
8923 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8924 	},
8925 	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8926 		.type = HDA_FIXUP_VERBS,
8927 		.v.verbs = (const struct hda_verb[]) {
8928 			/* Disable PCBEEP-IN passthrough */
8929 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8930 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8931 			{ }
8932 		},
8933 		.chained = true,
8934 		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8935 	},
8936 	[ALC255_FIXUP_ACER_HEADSET_MIC] = {
8937 		.type = HDA_FIXUP_PINS,
8938 		.v.pins = (const struct hda_pintbl[]) {
8939 			{ 0x19, 0x03a11130 },
8940 			{ 0x1a, 0x90a60140 }, /* use as internal mic */
8941 			{ }
8942 		},
8943 		.chained = true,
8944 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8945 	},
8946 	[ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8947 		.type = HDA_FIXUP_PINS,
8948 		.v.pins = (const struct hda_pintbl[]) {
8949 			{ 0x16, 0x01011020 }, /* Rear Line out */
8950 			{ 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8951 			{ }
8952 		},
8953 		.chained = true,
8954 		.chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8955 	},
8956 	[ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8957 		.type = HDA_FIXUP_FUNC,
8958 		.v.func = alc_fixup_auto_mute_via_amp,
8959 		.chained = true,
8960 		.chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8961 	},
8962 	[ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8963 		.type = HDA_FIXUP_FUNC,
8964 		.v.func = alc_fixup_disable_mic_vref,
8965 		.chained = true,
8966 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8967 	},
8968 	[ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8969 		.type = HDA_FIXUP_VERBS,
8970 		.v.verbs = (const struct hda_verb[]) {
8971 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8972 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8973 			{ }
8974 		},
8975 		.chained = true,
8976 		.chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8977 	},
8978 	[ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8979 		.type = HDA_FIXUP_PINS,
8980 		.v.pins = (const struct hda_pintbl[]) {
8981 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
8982 			{ }
8983 		},
8984 		.chained = true,
8985 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8986 	},
8987 	[ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8988 		.type = HDA_FIXUP_PINS,
8989 		.v.pins = (const struct hda_pintbl[]) {
8990 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8991 			{ }
8992 		},
8993 		.chained = true,
8994 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8995 	},
8996 	[ALC299_FIXUP_PREDATOR_SPK] = {
8997 		.type = HDA_FIXUP_PINS,
8998 		.v.pins = (const struct hda_pintbl[]) {
8999 			{ 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
9000 			{ }
9001 		}
9002 	},
9003 	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
9004 		.type = HDA_FIXUP_PINS,
9005 		.v.pins = (const struct hda_pintbl[]) {
9006 			{ 0x19, 0x04a11040 },
9007 			{ 0x21, 0x04211020 },
9008 			{ }
9009 		},
9010 		.chained = true,
9011 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9012 	},
9013 	[ALC289_FIXUP_DELL_SPK1] = {
9014 		.type = HDA_FIXUP_PINS,
9015 		.v.pins = (const struct hda_pintbl[]) {
9016 			{ 0x14, 0x90170140 },
9017 			{ }
9018 		},
9019 		.chained = true,
9020 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
9021 	},
9022 	[ALC289_FIXUP_DELL_SPK2] = {
9023 		.type = HDA_FIXUP_PINS,
9024 		.v.pins = (const struct hda_pintbl[]) {
9025 			{ 0x17, 0x90170130 }, /* bass spk */
9026 			{ }
9027 		},
9028 		.chained = true,
9029 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
9030 	},
9031 	[ALC289_FIXUP_DUAL_SPK] = {
9032 		.type = HDA_FIXUP_FUNC,
9033 		.v.func = alc285_fixup_speaker2_to_dac1,
9034 		.chained = true,
9035 		.chain_id = ALC289_FIXUP_DELL_SPK2
9036 	},
9037 	[ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
9038 		.type = HDA_FIXUP_FUNC,
9039 		.v.func = alc285_fixup_speaker2_to_dac1,
9040 		.chained = true,
9041 		.chain_id = ALC289_FIXUP_DELL_SPK1
9042 	},
9043 	[ALC294_FIXUP_SPK2_TO_DAC1] = {
9044 		.type = HDA_FIXUP_FUNC,
9045 		.v.func = alc285_fixup_speaker2_to_dac1,
9046 		.chained = true,
9047 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9048 	},
9049 	[ALC294_FIXUP_ASUS_DUAL_SPK] = {
9050 		.type = HDA_FIXUP_FUNC,
9051 		/* The GPIO must be pulled to initialize the AMP */
9052 		.v.func = alc_fixup_gpio4,
9053 		.chained = true,
9054 		.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
9055 	},
9056 	[ALC294_FIXUP_ASUS_ALLY] = {
9057 		.type = HDA_FIXUP_FUNC,
9058 		.v.func = cs35l41_fixup_i2c_two,
9059 		.chained = true,
9060 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
9061 	},
9062 	[ALC294_FIXUP_ASUS_ALLY_X] = {
9063 		.type = HDA_FIXUP_FUNC,
9064 		.v.func = tas2781_fixup_i2c,
9065 		.chained = true,
9066 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
9067 	},
9068 	[ALC294_FIXUP_ASUS_ALLY_PINS] = {
9069 		.type = HDA_FIXUP_PINS,
9070 		.v.pins = (const struct hda_pintbl[]) {
9071 			{ 0x19, 0x03a11050 },
9072 			{ 0x1a, 0x03a11c30 },
9073 			{ 0x21, 0x03211420 },
9074 			{ }
9075 		},
9076 		.chained = true,
9077 		.chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
9078 	},
9079 	[ALC294_FIXUP_ASUS_ALLY_VERBS] = {
9080 		.type = HDA_FIXUP_VERBS,
9081 		.v.verbs = (const struct hda_verb[]) {
9082 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9083 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9084 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
9085 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
9086 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
9087 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
9088 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
9089 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
9090 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
9091 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
9092 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
9093 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
9094 			{ }
9095 		},
9096 		.chained = true,
9097 		.chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
9098 	},
9099 	[ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
9100 		.type = HDA_FIXUP_FUNC,
9101 		.v.func = alc285_fixup_speaker2_to_dac1,
9102 	},
9103 	[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
9104 		.type = HDA_FIXUP_FUNC,
9105 		.v.func = alc285_fixup_thinkpad_x1_gen7,
9106 		.chained = true,
9107 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9108 	},
9109 	[ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
9110 		.type = HDA_FIXUP_FUNC,
9111 		.v.func = alc_fixup_headset_jack,
9112 		.chained = true,
9113 		.chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
9114 	},
9115 	[ALC294_FIXUP_ASUS_HPE] = {
9116 		.type = HDA_FIXUP_VERBS,
9117 		.v.verbs = (const struct hda_verb[]) {
9118 			/* Set EAPD high */
9119 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9120 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
9121 			{ }
9122 		},
9123 		.chained = true,
9124 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9125 	},
9126 	[ALC294_FIXUP_ASUS_GX502_PINS] = {
9127 		.type = HDA_FIXUP_PINS,
9128 		.v.pins = (const struct hda_pintbl[]) {
9129 			{ 0x19, 0x03a11050 }, /* front HP mic */
9130 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9131 			{ 0x21, 0x03211020 }, /* front HP out */
9132 			{ }
9133 		},
9134 		.chained = true,
9135 		.chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
9136 	},
9137 	[ALC294_FIXUP_ASUS_GX502_VERBS] = {
9138 		.type = HDA_FIXUP_VERBS,
9139 		.v.verbs = (const struct hda_verb[]) {
9140 			/* set 0x15 to HP-OUT ctrl */
9141 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9142 			/* unmute the 0x15 amp */
9143 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9144 			{ }
9145 		},
9146 		.chained = true,
9147 		.chain_id = ALC294_FIXUP_ASUS_GX502_HP
9148 	},
9149 	[ALC294_FIXUP_ASUS_GX502_HP] = {
9150 		.type = HDA_FIXUP_FUNC,
9151 		.v.func = alc294_fixup_gx502_hp,
9152 	},
9153 	[ALC294_FIXUP_ASUS_GU502_PINS] = {
9154 		.type = HDA_FIXUP_PINS,
9155 		.v.pins = (const struct hda_pintbl[]) {
9156 			{ 0x19, 0x01a11050 }, /* rear HP mic */
9157 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9158 			{ 0x21, 0x012110f0 }, /* rear HP out */
9159 			{ }
9160 		},
9161 		.chained = true,
9162 		.chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
9163 	},
9164 	[ALC294_FIXUP_ASUS_GU502_VERBS] = {
9165 		.type = HDA_FIXUP_VERBS,
9166 		.v.verbs = (const struct hda_verb[]) {
9167 			/* set 0x15 to HP-OUT ctrl */
9168 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9169 			/* unmute the 0x15 amp */
9170 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9171 			/* set 0x1b to HP-OUT */
9172 			{ 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
9173 			{ }
9174 		},
9175 		.chained = true,
9176 		.chain_id = ALC294_FIXUP_ASUS_GU502_HP
9177 	},
9178 	[ALC294_FIXUP_ASUS_GU502_HP] = {
9179 		.type = HDA_FIXUP_FUNC,
9180 		.v.func = alc294_fixup_gu502_hp,
9181 	},
9182 	 [ALC294_FIXUP_ASUS_G513_PINS] = {
9183 		.type = HDA_FIXUP_PINS,
9184 		.v.pins = (const struct hda_pintbl[]) {
9185 				{ 0x19, 0x03a11050 }, /* front HP mic */
9186 				{ 0x1a, 0x03a11c30 }, /* rear external mic */
9187 				{ 0x21, 0x03211420 }, /* front HP out */
9188 				{ }
9189 		},
9190 	},
9191 	[ALC285_FIXUP_ASUS_G533Z_PINS] = {
9192 		.type = HDA_FIXUP_PINS,
9193 		.v.pins = (const struct hda_pintbl[]) {
9194 			{ 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
9195 			{ 0x19, 0x03a19020 }, /* Mic Boost Volume */
9196 			{ 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
9197 			{ 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
9198 			{ 0x21, 0x03211420 },
9199 			{ }
9200 		},
9201 	},
9202 	[ALC294_FIXUP_ASUS_COEF_1B] = {
9203 		.type = HDA_FIXUP_VERBS,
9204 		.v.verbs = (const struct hda_verb[]) {
9205 			/* Set bit 10 to correct noisy output after reboot from
9206 			 * Windows 10 (due to pop noise reduction?)
9207 			 */
9208 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
9209 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
9210 			{ }
9211 		},
9212 		.chained = true,
9213 		.chain_id = ALC289_FIXUP_ASUS_GA401,
9214 	},
9215 	[ALC285_FIXUP_HP_GPIO_LED] = {
9216 		.type = HDA_FIXUP_FUNC,
9217 		.v.func = alc285_fixup_hp_gpio_led,
9218 	},
9219 	[ALC285_FIXUP_HP_MUTE_LED] = {
9220 		.type = HDA_FIXUP_FUNC,
9221 		.v.func = alc285_fixup_hp_mute_led,
9222 	},
9223 	[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
9224 		.type = HDA_FIXUP_FUNC,
9225 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
9226 	},
9227 	[ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
9228 	    .type = HDA_FIXUP_FUNC,
9229 	    .v.func = alc236_fixup_hp_mute_led_coefbit2,
9230 	},
9231 	[ALC236_FIXUP_HP_GPIO_LED] = {
9232 		.type = HDA_FIXUP_FUNC,
9233 		.v.func = alc236_fixup_hp_gpio_led,
9234 	},
9235 	[ALC236_FIXUP_HP_MUTE_LED] = {
9236 		.type = HDA_FIXUP_FUNC,
9237 		.v.func = alc236_fixup_hp_mute_led,
9238 	},
9239 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9240 		.type = HDA_FIXUP_FUNC,
9241 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
9242 	},
9243 	[ALC236_FIXUP_LENOVO_INV_DMIC] = {
9244 		.type = HDA_FIXUP_FUNC,
9245 		.v.func = alc_fixup_inv_dmic,
9246 		.chained = true,
9247 		.chain_id = ALC283_FIXUP_INT_MIC,
9248 	},
9249 	[ALC298_FIXUP_SAMSUNG_AMP] = {
9250 		.type = HDA_FIXUP_FUNC,
9251 		.v.func = alc298_fixup_samsung_amp,
9252 		.chained = true,
9253 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9254 	},
9255 	[ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS] = {
9256 		.type = HDA_FIXUP_FUNC,
9257 		.v.func = alc298_fixup_samsung_amp_v2_2_amps
9258 	},
9259 	[ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS] = {
9260 		.type = HDA_FIXUP_FUNC,
9261 		.v.func = alc298_fixup_samsung_amp_v2_4_amps
9262 	},
9263 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9264 		.type = HDA_FIXUP_VERBS,
9265 		.v.verbs = (const struct hda_verb[]) {
9266 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9267 			{ }
9268 		},
9269 	},
9270 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9271 		.type = HDA_FIXUP_VERBS,
9272 		.v.verbs = (const struct hda_verb[]) {
9273 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9274 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9275 			{ }
9276 		},
9277 	},
9278 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9279 		.type = HDA_FIXUP_PINS,
9280 		.v.pins = (const struct hda_pintbl[]) {
9281 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9282 			{ }
9283 		},
9284 		.chained = true,
9285 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9286 	},
9287 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9288 		.type = HDA_FIXUP_PINS,
9289 		.v.pins = (const struct hda_pintbl[]) {
9290 			{ 0x14, 0x90100120 }, /* use as internal speaker */
9291 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9292 			{ 0x1a, 0x01011020 }, /* use as line out */
9293 			{ },
9294 		},
9295 		.chained = true,
9296 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9297 	},
9298 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9299 		.type = HDA_FIXUP_PINS,
9300 		.v.pins = (const struct hda_pintbl[]) {
9301 			{ 0x18, 0x02a11030 }, /* use as headset mic */
9302 			{ }
9303 		},
9304 		.chained = true,
9305 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9306 	},
9307 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9308 		.type = HDA_FIXUP_PINS,
9309 		.v.pins = (const struct hda_pintbl[]) {
9310 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9311 			{ }
9312 		},
9313 		.chained = true,
9314 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9315 	},
9316 	[ALC289_FIXUP_ASUS_GA401] = {
9317 		.type = HDA_FIXUP_FUNC,
9318 		.v.func = alc289_fixup_asus_ga401,
9319 		.chained = true,
9320 		.chain_id = ALC289_FIXUP_ASUS_GA502,
9321 	},
9322 	[ALC289_FIXUP_ASUS_GA502] = {
9323 		.type = HDA_FIXUP_PINS,
9324 		.v.pins = (const struct hda_pintbl[]) {
9325 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
9326 			{ }
9327 		},
9328 	},
9329 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9330 		.type = HDA_FIXUP_PINS,
9331 		.v.pins = (const struct hda_pintbl[]) {
9332 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9333 			{ }
9334 		},
9335 		.chained = true,
9336 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9337 	},
9338 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9339 		.type = HDA_FIXUP_FUNC,
9340 		.v.func = alc285_fixup_hp_gpio_amp_init,
9341 		.chained = true,
9342 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
9343 	},
9344 	[ALC269_FIXUP_CZC_B20] = {
9345 		.type = HDA_FIXUP_PINS,
9346 		.v.pins = (const struct hda_pintbl[]) {
9347 			{ 0x12, 0x411111f0 },
9348 			{ 0x14, 0x90170110 }, /* speaker */
9349 			{ 0x15, 0x032f1020 }, /* HP out */
9350 			{ 0x17, 0x411111f0 },
9351 			{ 0x18, 0x03ab1040 }, /* mic */
9352 			{ 0x19, 0xb7a7013f },
9353 			{ 0x1a, 0x0181305f },
9354 			{ 0x1b, 0x411111f0 },
9355 			{ 0x1d, 0x411111f0 },
9356 			{ 0x1e, 0x411111f0 },
9357 			{ }
9358 		},
9359 		.chain_id = ALC269_FIXUP_DMIC,
9360 	},
9361 	[ALC269_FIXUP_CZC_TMI] = {
9362 		.type = HDA_FIXUP_PINS,
9363 		.v.pins = (const struct hda_pintbl[]) {
9364 			{ 0x12, 0x4000c000 },
9365 			{ 0x14, 0x90170110 }, /* speaker */
9366 			{ 0x15, 0x0421401f }, /* HP out */
9367 			{ 0x17, 0x411111f0 },
9368 			{ 0x18, 0x04a19020 }, /* mic */
9369 			{ 0x19, 0x411111f0 },
9370 			{ 0x1a, 0x411111f0 },
9371 			{ 0x1b, 0x411111f0 },
9372 			{ 0x1d, 0x40448505 },
9373 			{ 0x1e, 0x411111f0 },
9374 			{ 0x20, 0x8000ffff },
9375 			{ }
9376 		},
9377 		.chain_id = ALC269_FIXUP_DMIC,
9378 	},
9379 	[ALC269_FIXUP_CZC_L101] = {
9380 		.type = HDA_FIXUP_PINS,
9381 		.v.pins = (const struct hda_pintbl[]) {
9382 			{ 0x12, 0x40000000 },
9383 			{ 0x14, 0x01014010 }, /* speaker */
9384 			{ 0x15, 0x411111f0 }, /* HP out */
9385 			{ 0x16, 0x411111f0 },
9386 			{ 0x18, 0x01a19020 }, /* mic */
9387 			{ 0x19, 0x02a19021 },
9388 			{ 0x1a, 0x0181302f },
9389 			{ 0x1b, 0x0221401f },
9390 			{ 0x1c, 0x411111f0 },
9391 			{ 0x1d, 0x4044c601 },
9392 			{ 0x1e, 0x411111f0 },
9393 			{ }
9394 		},
9395 		.chain_id = ALC269_FIXUP_DMIC,
9396 	},
9397 	[ALC269_FIXUP_LEMOTE_A1802] = {
9398 		.type = HDA_FIXUP_PINS,
9399 		.v.pins = (const struct hda_pintbl[]) {
9400 			{ 0x12, 0x40000000 },
9401 			{ 0x14, 0x90170110 }, /* speaker */
9402 			{ 0x17, 0x411111f0 },
9403 			{ 0x18, 0x03a19040 }, /* mic1 */
9404 			{ 0x19, 0x90a70130 }, /* mic2 */
9405 			{ 0x1a, 0x411111f0 },
9406 			{ 0x1b, 0x411111f0 },
9407 			{ 0x1d, 0x40489d2d },
9408 			{ 0x1e, 0x411111f0 },
9409 			{ 0x20, 0x0003ffff },
9410 			{ 0x21, 0x03214020 },
9411 			{ }
9412 		},
9413 		.chain_id = ALC269_FIXUP_DMIC,
9414 	},
9415 	[ALC269_FIXUP_LEMOTE_A190X] = {
9416 		.type = HDA_FIXUP_PINS,
9417 		.v.pins = (const struct hda_pintbl[]) {
9418 			{ 0x14, 0x99130110 }, /* speaker */
9419 			{ 0x15, 0x0121401f }, /* HP out */
9420 			{ 0x18, 0x01a19c20 }, /* rear  mic */
9421 			{ 0x19, 0x99a3092f }, /* front mic */
9422 			{ 0x1b, 0x0201401f }, /* front lineout */
9423 			{ }
9424 		},
9425 		.chain_id = ALC269_FIXUP_DMIC,
9426 	},
9427 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9428 		.type = HDA_FIXUP_PINS,
9429 		.v.pins = (const struct hda_pintbl[]) {
9430 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9431 			{ }
9432 		},
9433 		.chained = true,
9434 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9435 	},
9436 	[ALC256_FIXUP_INTEL_NUC10] = {
9437 		.type = HDA_FIXUP_PINS,
9438 		.v.pins = (const struct hda_pintbl[]) {
9439 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9440 			{ }
9441 		},
9442 		.chained = true,
9443 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9444 	},
9445 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9446 		.type = HDA_FIXUP_VERBS,
9447 		.v.verbs = (const struct hda_verb[]) {
9448 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9449 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9450 			{ }
9451 		},
9452 		.chained = true,
9453 		.chain_id = ALC289_FIXUP_ASUS_GA502
9454 	},
9455 	[ALC274_FIXUP_HP_MIC] = {
9456 		.type = HDA_FIXUP_VERBS,
9457 		.v.verbs = (const struct hda_verb[]) {
9458 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9459 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9460 			{ }
9461 		},
9462 	},
9463 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
9464 		.type = HDA_FIXUP_FUNC,
9465 		.v.func = alc274_fixup_hp_headset_mic,
9466 		.chained = true,
9467 		.chain_id = ALC274_FIXUP_HP_MIC
9468 	},
9469 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
9470 		.type = HDA_FIXUP_FUNC,
9471 		.v.func = alc274_fixup_hp_envy_gpio,
9472 	},
9473 	[ALC256_FIXUP_ASUS_HPE] = {
9474 		.type = HDA_FIXUP_VERBS,
9475 		.v.verbs = (const struct hda_verb[]) {
9476 			/* Set EAPD high */
9477 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9478 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9479 			{ }
9480 		},
9481 		.chained = true,
9482 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9483 	},
9484 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9485 		.type = HDA_FIXUP_FUNC,
9486 		.v.func = alc_fixup_headset_jack,
9487 		.chained = true,
9488 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9489 	},
9490 	[ALC287_FIXUP_HP_GPIO_LED] = {
9491 		.type = HDA_FIXUP_FUNC,
9492 		.v.func = alc287_fixup_hp_gpio_led,
9493 	},
9494 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
9495 		.type = HDA_FIXUP_FUNC,
9496 		.v.func = alc274_fixup_hp_headset_mic,
9497 	},
9498 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9499 		.type = HDA_FIXUP_FUNC,
9500 		.v.func = alc_fixup_no_int_mic,
9501 		.chained = true,
9502 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9503 	},
9504 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9505 		.type = HDA_FIXUP_PINS,
9506 		.v.pins = (const struct hda_pintbl[]) {
9507 			{ 0x1b, 0x411111f0 },
9508 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9509 			{ },
9510 		},
9511 		.chained = true,
9512 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9513 	},
9514 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9515 		.type = HDA_FIXUP_FUNC,
9516 		.v.func = alc269_fixup_limit_int_mic_boost,
9517 		.chained = true,
9518 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9519 	},
9520 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
9521 		.type = HDA_FIXUP_PINS,
9522 		.v.pins = (const struct hda_pintbl[]) {
9523 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9524 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
9525 			{ }
9526 		},
9527 		.chained = true,
9528 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9529 	},
9530 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9531 		.type = HDA_FIXUP_FUNC,
9532 		.v.func = alc285_fixup_ideapad_s740_coef,
9533 		.chained = true,
9534 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9535 	},
9536 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9537 		.type = HDA_FIXUP_FUNC,
9538 		.v.func = alc269_fixup_limit_int_mic_boost,
9539 		.chained = true,
9540 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9541 	},
9542 	[ALC295_FIXUP_ASUS_DACS] = {
9543 		.type = HDA_FIXUP_FUNC,
9544 		.v.func = alc295_fixup_asus_dacs,
9545 	},
9546 	[ALC295_FIXUP_HP_OMEN] = {
9547 		.type = HDA_FIXUP_PINS,
9548 		.v.pins = (const struct hda_pintbl[]) {
9549 			{ 0x12, 0xb7a60130 },
9550 			{ 0x13, 0x40000000 },
9551 			{ 0x14, 0x411111f0 },
9552 			{ 0x16, 0x411111f0 },
9553 			{ 0x17, 0x90170110 },
9554 			{ 0x18, 0x411111f0 },
9555 			{ 0x19, 0x02a11030 },
9556 			{ 0x1a, 0x411111f0 },
9557 			{ 0x1b, 0x04a19030 },
9558 			{ 0x1d, 0x40600001 },
9559 			{ 0x1e, 0x411111f0 },
9560 			{ 0x21, 0x03211020 },
9561 			{}
9562 		},
9563 		.chained = true,
9564 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9565 	},
9566 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
9567 		.type = HDA_FIXUP_FUNC,
9568 		.v.func = alc285_fixup_hp_spectre_x360,
9569 	},
9570 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9571 		.type = HDA_FIXUP_FUNC,
9572 		.v.func = alc285_fixup_hp_spectre_x360_eb1
9573 	},
9574 	[ALC285_FIXUP_HP_ENVY_X360] = {
9575 		.type = HDA_FIXUP_FUNC,
9576 		.v.func = alc285_fixup_hp_envy_x360,
9577 		.chained = true,
9578 		.chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9579 	},
9580 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9581 		.type = HDA_FIXUP_FUNC,
9582 		.v.func = alc285_fixup_ideapad_s740_coef,
9583 		.chained = true,
9584 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9585 	},
9586 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9587 		.type = HDA_FIXUP_FUNC,
9588 		.v.func = alc_fixup_no_shutup,
9589 		.chained = true,
9590 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
9591 	},
9592 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9593 		.type = HDA_FIXUP_PINS,
9594 		.v.pins = (const struct hda_pintbl[]) {
9595 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9596 			{ }
9597 		},
9598 		.chained = true,
9599 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9600 	},
9601 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9602 		.type = HDA_FIXUP_FUNC,
9603 		.v.func = alc269_fixup_limit_int_mic_boost,
9604 		.chained = true,
9605 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9606 	},
9607 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9608 		.type = HDA_FIXUP_FUNC,
9609 		.v.func = alc285_fixup_ideapad_s740_coef,
9610 		.chained = true,
9611 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9612 	},
9613 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9614 		.type = HDA_FIXUP_FUNC,
9615 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9616 		.chained = true,
9617 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9618 	},
9619 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9620 		.type = HDA_FIXUP_VERBS,
9621 		//.v.verbs = legion_15imhg05_coefs,
9622 		.v.verbs = (const struct hda_verb[]) {
9623 			 // set left speaker Legion 7i.
9624 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9625 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9626 
9627 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9628 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9629 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9630 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9631 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9632 
9633 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9634 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9635 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9636 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9637 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9638 
9639 			 // set right speaker Legion 7i.
9640 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9641 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9642 
9643 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9644 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9645 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9646 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9647 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9648 
9649 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9650 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9651 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9652 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9653 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9654 			 {}
9655 		},
9656 		.chained = true,
9657 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9658 	},
9659 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9660 		.type = HDA_FIXUP_FUNC,
9661 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9662 		.chained = true,
9663 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9664 	},
9665 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9666 		.type = HDA_FIXUP_VERBS,
9667 		.v.verbs = (const struct hda_verb[]) {
9668 			 // set left speaker Yoga 7i.
9669 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9670 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9671 
9672 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9673 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9674 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9675 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9676 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9677 
9678 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9679 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9680 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9681 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9682 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9683 
9684 			 // set right speaker Yoga 7i.
9685 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9686 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9687 
9688 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9689 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9690 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9691 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9692 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9693 
9694 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9695 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9696 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9697 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9698 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9699 			 {}
9700 		},
9701 		.chained = true,
9702 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9703 	},
9704 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9705 		.type = HDA_FIXUP_FUNC,
9706 		.v.func = alc298_fixup_lenovo_c940_duet7,
9707 	},
9708 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9709 		.type = HDA_FIXUP_VERBS,
9710 		.v.verbs = (const struct hda_verb[]) {
9711 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9712 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9713 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9714 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9715 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9716 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9717 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9718 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9719 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9720 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9721 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9722 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9723 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9724 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9725 			{}
9726 		},
9727 		.chained = true,
9728 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9729 	},
9730 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9731 		.type = HDA_FIXUP_FUNC,
9732 		.v.func = alc256_fixup_set_coef_defaults,
9733 	},
9734 	[ALC245_FIXUP_HP_GPIO_LED] = {
9735 		.type = HDA_FIXUP_FUNC,
9736 		.v.func = alc245_fixup_hp_gpio_led,
9737 	},
9738 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9739 		.type = HDA_FIXUP_PINS,
9740 		.v.pins = (const struct hda_pintbl[]) {
9741 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9742 			{ }
9743 		},
9744 		.chained = true,
9745 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9746 	},
9747 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9748 		.type = HDA_FIXUP_FUNC,
9749 		.v.func = alc233_fixup_no_audio_jack,
9750 	},
9751 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9752 		.type = HDA_FIXUP_FUNC,
9753 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9754 		.chained = true,
9755 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9756 	},
9757 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9758 		.type = HDA_FIXUP_FUNC,
9759 		.v.func = alc287_fixup_legion_16achg6_speakers,
9760 	},
9761 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9762 		.type = HDA_FIXUP_FUNC,
9763 		.v.func = cs35l41_fixup_i2c_two,
9764 	},
9765 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9766 		.type = HDA_FIXUP_FUNC,
9767 		.v.func = cs35l41_fixup_i2c_two,
9768 		.chained = true,
9769 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9770 	},
9771 	[ALC287_FIXUP_CS35L41_I2C_4] = {
9772 		.type = HDA_FIXUP_FUNC,
9773 		.v.func = cs35l41_fixup_i2c_four,
9774 	},
9775 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9776 		.type = HDA_FIXUP_FUNC,
9777 		.v.func = cs35l41_fixup_spi_two,
9778 	},
9779 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9780 		.type = HDA_FIXUP_FUNC,
9781 		.v.func = cs35l41_fixup_spi_two,
9782 		.chained = true,
9783 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9784 	},
9785 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9786 		.type = HDA_FIXUP_FUNC,
9787 		.v.func = cs35l41_fixup_spi_four,
9788 	},
9789 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9790 		.type = HDA_FIXUP_FUNC,
9791 		.v.func = cs35l41_fixup_spi_four,
9792 		.chained = true,
9793 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9794 	},
9795 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9796 		.type = HDA_FIXUP_VERBS,
9797 		.v.verbs = (const struct hda_verb[]) {
9798 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9799 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9800 			 { }
9801 		},
9802 		.chained = true,
9803 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9804 	},
9805 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9806 		.type = HDA_FIXUP_FUNC,
9807 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9808 		.chained = true,
9809 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9810 	},
9811 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9812 		.type = HDA_FIXUP_PINS,
9813 		.v.pins = (const struct hda_pintbl[]) {
9814 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9815 			{ }
9816 		},
9817 		.chained = true,
9818 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9819 	},
9820 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9821 		.type = HDA_FIXUP_FUNC,
9822 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9823 	},
9824 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9825 		.type = HDA_FIXUP_VERBS,
9826 		.v.verbs = (const struct hda_verb[]) {
9827 			// enable left speaker
9828 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9829 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9830 
9831 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9832 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9833 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9834 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9835 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9836 
9837 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9838 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9839 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9840 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9841 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9842 
9843 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9844 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9845 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9846 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9847 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9848 
9849 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9850 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9851 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9852 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9853 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9854 
9855 			// enable right speaker
9856 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9857 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9858 
9859 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9860 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9861 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9862 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9863 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9864 
9865 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9866 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9867 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9868 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9869 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9870 
9871 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9872 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9873 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9874 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9875 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9876 
9877 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9878 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9879 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9880 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9881 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9882 
9883 			{ },
9884 		},
9885 	},
9886 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9887 		.type = HDA_FIXUP_FUNC,
9888 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9889 		.chained = true,
9890 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9891 	},
9892 	[ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9893 		.type = HDA_FIXUP_FUNC,
9894 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9895 		.chained = true,
9896 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9897 	},
9898 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9899 		.type = HDA_FIXUP_FUNC,
9900 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9901 		.chained = true,
9902 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9903 	},
9904 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9905 		.type = HDA_FIXUP_PINS,
9906 		.v.func = alc1220_fixup_gb_dual_codecs,
9907 		.chained = true,
9908 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9909 	},
9910 	[ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9911 		.type = HDA_FIXUP_FUNC,
9912 		.v.func = cs35l41_fixup_i2c_two,
9913 		.chained = true,
9914 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9915 	},
9916 	[ALC287_FIXUP_TAS2781_I2C] = {
9917 		.type = HDA_FIXUP_FUNC,
9918 		.v.func = tas2781_fixup_i2c,
9919 		.chained = true,
9920 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9921 	},
9922 	[ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
9923 		.type = HDA_FIXUP_FUNC,
9924 		.v.func = yoga7_14arb7_fixup_i2c,
9925 		.chained = true,
9926 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9927 	},
9928 	[ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9929 		.type = HDA_FIXUP_FUNC,
9930 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9931 	},
9932 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9933 		.type = HDA_FIXUP_FUNC,
9934 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9935 		.chained = true,
9936 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
9937 	},
9938 	[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9939 		.type = HDA_FIXUP_FUNC,
9940 		.v.func = alc287_fixup_bind_dacs,
9941 		.chained = true,
9942 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9943 	},
9944 	[ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9945 		.type = HDA_FIXUP_FUNC,
9946 		.v.func = alc287_fixup_bind_dacs,
9947 		.chained = true,
9948 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9949 	},
9950 	[ALC2XX_FIXUP_HEADSET_MIC] = {
9951 		.type = HDA_FIXUP_FUNC,
9952 		.v.func = alc_fixup_headset_mic,
9953 	},
9954 	[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9955 		.type = HDA_FIXUP_FUNC,
9956 		.v.func = cs35l41_fixup_spi_two,
9957 		.chained = true,
9958 		.chain_id = ALC289_FIXUP_DUAL_SPK
9959 	},
9960 	[ALC294_FIXUP_CS35L41_I2C_2] = {
9961 		.type = HDA_FIXUP_FUNC,
9962 		.v.func = cs35l41_fixup_i2c_two,
9963 	},
9964 	[ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
9965 		.type = HDA_FIXUP_FUNC,
9966 		.v.func = alc256_fixup_acer_sfg16_micmute_led,
9967 	},
9968 	[ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
9969 		.type = HDA_FIXUP_FUNC,
9970 		.v.func = alc256_decrease_headphone_amp_val,
9971 	},
9972 	[ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
9973 		.type = HDA_FIXUP_FUNC,
9974 		.v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
9975 	},
9976 	[ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX] = {
9977 		.type = HDA_FIXUP_FUNC,
9978 		.v.func = alc245_fixup_hp_spectre_x360_16_aa0xxx,
9979 	},
9980 	[ALC285_FIXUP_ASUS_GA403U] = {
9981 		.type = HDA_FIXUP_FUNC,
9982 		.v.func = alc285_fixup_asus_ga403u,
9983 	},
9984 	[ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
9985 		.type = HDA_FIXUP_PINS,
9986 		.v.pins = (const struct hda_pintbl[]) {
9987 			{ 0x19, 0x03a11050 },
9988 			{ 0x1b, 0x03a11c30 },
9989 			{ }
9990 		},
9991 		.chained = true,
9992 		.chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
9993 	},
9994 	[ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
9995 		.type = HDA_FIXUP_FUNC,
9996 		.v.func = alc285_fixup_speaker2_to_dac1,
9997 		.chained = true,
9998 		.chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
9999 	},
10000 	[ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
10001 		.type = HDA_FIXUP_PINS,
10002 		.v.pins = (const struct hda_pintbl[]) {
10003 			{ 0x19, 0x03a11050 },
10004 			{ 0x1b, 0x03a11c30 },
10005 			{ }
10006 		},
10007 	},
10008 	[ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
10009 		.type = HDA_FIXUP_FUNC,
10010 		.v.func = alc285_fixup_speaker2_to_dac1,
10011 		.chained = true,
10012 		.chain_id = ALC285_FIXUP_ASUS_GA403U,
10013 	},
10014 	[ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
10015 		.type = HDA_FIXUP_FUNC,
10016 		.v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
10017 		.chained = true,
10018 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
10019 	},
10020 	[ALC256_FIXUP_CHROME_BOOK] = {
10021 		.type = HDA_FIXUP_FUNC,
10022 		.v.func = alc256_fixup_chromebook,
10023 		.chained = true,
10024 		.chain_id = ALC225_FIXUP_HEADSET_JACK
10025 	},
10026 	[ALC245_FIXUP_CLEVO_NOISY_MIC] = {
10027 		.type = HDA_FIXUP_FUNC,
10028 		.v.func = alc269_fixup_limit_int_mic_boost,
10029 		.chained = true,
10030 		.chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
10031 	},
10032 	[ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = {
10033 		.type = HDA_FIXUP_PINS,
10034 		.v.pins = (const struct hda_pintbl[]) {
10035 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10036 			{ 0x1b, 0x20a11040 }, /* dock mic */
10037 			{ }
10038 		},
10039 		.chained = true,
10040 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
10041 	},
10042 };
10043 
10044 static const struct hda_quirk alc269_fixup_tbl[] = {
10045 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
10046 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
10047 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
10048 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
10049 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10050 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
10051 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
10052 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
10053 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
10054 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
10055 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10056 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
10057 	SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
10058 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
10059 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
10060 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
10061 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
10062 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
10063 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10064 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10065 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
10066 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
10067 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
10068 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10069 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
10070 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
10071 	SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10072 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10073 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10074 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10075 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
10076 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10077 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10078 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10079 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
10080 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
10081 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10082 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10083 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10084 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
10085 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10086 	SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
10087 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
10088 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
10089 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
10090 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
10091 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
10092 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
10093 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
10094 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
10095 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10096 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10097 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10098 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10099 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10100 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
10101 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
10102 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
10103 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10104 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10105 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
10106 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10107 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
10108 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10109 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10110 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10111 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10112 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10113 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10114 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10115 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10116 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10117 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
10118 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
10119 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
10120 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
10121 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10122 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
10123 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
10124 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10125 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10126 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10127 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10128 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
10129 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
10130 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
10131 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10132 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10133 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10134 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10135 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10136 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10137 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10138 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
10139 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
10140 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
10141 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
10142 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10143 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10144 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
10145 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
10146 	SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10147 	SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10148 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10149 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10150 	SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10151 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10152 	SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10153 	SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10154 	SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10155 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10156 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10157 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10158 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10159 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10160 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10161 	SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10162 	SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
10163 	SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC287_FIXUP_TAS2781_I2C),
10164 	SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC287_FIXUP_TAS2781_I2C),
10165 	SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10166 	SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10167 	SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10168 	SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10169 	SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10170 	SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10171 	SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10172 	SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10173 	SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10174 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10175 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10176 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
10177 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
10178 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
10179 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10180 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10181 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10182 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10183 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
10184 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10185 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10186 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10187 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10188 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10189 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10190 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10191 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10192 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10193 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10194 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10195 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10196 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10197 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
10198 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
10199 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10200 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10201 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10202 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10203 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10204 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10205 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10206 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10207 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
10208 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10209 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10210 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10211 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10212 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10213 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10214 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10215 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10216 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10217 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10218 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10219 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10220 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10221 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10222 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10223 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10224 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10225 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10226 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
10227 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10228 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10229 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10230 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10231 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10232 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10233 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
10234 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10235 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10236 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10237 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10238 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
10239 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
10240 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
10241 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10242 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10243 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10244 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10245 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10246 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10247 	SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10248 	SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10249 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
10250 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10251 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
10252 	SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10253 	SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
10254 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10255 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10256 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10257 	SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10258 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
10259 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10260 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10261 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
10262 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10263 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10264 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
10265 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
10266 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
10267 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10268 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10269 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10270 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
10271 	SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10272 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
10273 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10274 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10275 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10276 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10277 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10278 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10279 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10280 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10281 	SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10282 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
10283 	SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10284 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10285 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10286 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10287 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10288 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10289 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
10290 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10291 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10292 	SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10293 	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10294 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10295 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10296 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10297 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10298 	SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10299 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10300 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10301 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10302 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10303 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10304 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10305 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10306 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10307 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10308 	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10309 	SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10310 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
10311 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
10312 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
10313 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10314 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
10315 	SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
10316 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
10317 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10318 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
10319 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10320 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10321 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10322 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10323 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10324 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10325 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10326 	SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
10327 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10328 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10329 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10330 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10331 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
10332 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10333 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
10334 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10335 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
10336 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
10337 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10338 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
10339 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10340 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10341 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10342 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10343 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10344 	SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10345 	SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
10346 	SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10347 	SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10348 	SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
10349 	SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10350 	SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10351 	SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10352 	SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10353 	SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10354 	SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10355 	SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10356 	SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10357 	SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
10358 	SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10359 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10360 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10361 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10362 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10363 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
10364 	SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
10365 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10366 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10367 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10368 	SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10369 	SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10370 	SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10371 	SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10372 	SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
10373 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10374 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10375 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10376 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10377 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10378 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10379 	SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10380 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10381 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10382 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10383 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10384 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10385 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10386 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10387 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10388 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
10389 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10390 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10391 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
10392 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10393 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10394 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10395 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10396 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10397 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10398 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10399 	SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10400 	SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10401 	SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10402 	SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10403 	SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10404 	SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10405 	SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10406 	SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10407 	SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10408 	SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10409 	SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10410 	SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10411 	SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10412 	SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10413 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
10414 	SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
10415 	SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre x360 2-in-1 Laptop 16-aa0xxx", ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX),
10416 	SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10417 	SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10418 	SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10419 	SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10420 	SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10421 	SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10422 	SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10423 	SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10424 	SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10425 	SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10426 	SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10427 	SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10428 	SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC285_FIXUP_HP_GPIO_LED),
10429 	SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC285_FIXUP_HP_GPIO_LED),
10430 	SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10431 	SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10432 	SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10433 	SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10434 	SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10435 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10436 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10437 	SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10438 	SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10439 	SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10440 	SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10441 	SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10442 	SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10443 	SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10444 	SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10445 	SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10446 	SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10447 	SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
10448 	SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10449 	SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10450 	SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10451 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10452 	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10453 	SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10454 	SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10455 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10456 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10457 	SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10458 	SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10459 	SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10460 	SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10461 	SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10462 	SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10463 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10464 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10465 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
10466 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10467 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
10468 	SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C),
10469 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10470 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10471 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
10472 	SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C),
10473 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10474 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10475 	SND_PCI_QUIRK(0x1043, 0x1204, "ASUS Strix G615JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
10476 	SND_PCI_QUIRK(0x1043, 0x1214, "ASUS Strix G615LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
10477 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10478 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10479 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10480 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10481 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10482 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10483 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10484 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10485 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10486 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10487 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10488 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10489 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10490 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10491 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10492 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10493 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10494 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
10495 	SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
10496 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10497 	SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10498 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
10499 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10500 	SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10501 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10502 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10503 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10504 	SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
10505 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10506 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
10507 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10508 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10509 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
10510 	SND_PCI_QUIRK(0x1043, 0x1eb3, "ROG Ally X RC72LA", ALC294_FIXUP_ASUS_ALLY_X),
10511 	SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
10512 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10513 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10514 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10515 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10516 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10517 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10518 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10519 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10520 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10521 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10522 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
10523 	SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10524 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10525 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10526 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10527 	SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
10528 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10529 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10530 	SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10531 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10532 	SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10533 	SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10534 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10535 	SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
10536 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10537 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10538 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10539 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10540 	SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10541 	SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10542 	SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10543 	SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
10544 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10545 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10546 	SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10547 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10548 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10549 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10550 	SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
10551 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10552 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10553 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10554 	SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C),
10555 	SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
10556 	SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10557 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10558 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10559 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10560 	SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
10561 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10562 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10563 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10564 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10565 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10566 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10567 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10568 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10569 	SND_PCI_QUIRK(0x1043, 0x3e30, "ASUS TP3607SA", ALC287_FIXUP_TAS2781_I2C),
10570 	SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
10571 	SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
10572 	SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
10573 	SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
10574 	SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TAS2781_I2C),
10575 	SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TAS2781_I2C),
10576 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10577 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10578 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10579 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10580 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10581 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10582 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10583 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10584 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10585 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10586 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10587 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10588 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10589 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10590 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10591 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10592 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10593 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10594 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10595 	SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10596 	SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10597 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10598 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10599 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10600 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10601 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10602 	SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10603 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10604 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10605 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10606 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10607 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10608 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10609 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10610 	SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10611 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10612 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10613 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10614 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10615 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10616 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10617 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10618 	SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
10619 	SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
10620 	SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10621 	SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10622 	SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10623 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10624 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10625 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10626 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10627 	SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10628 	SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10629 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10630 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10631 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10632 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10633 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10634 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10635 	SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10636 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10637 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10638 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10639 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10640 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10641 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10642 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10643 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10644 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10645 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10646 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10647 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10648 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10649 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10650 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10651 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10652 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10653 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10654 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10655 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10656 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10657 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10658 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10659 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10660 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10661 	SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10662 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10663 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10664 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10665 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10666 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10667 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10668 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10669 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10670 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10671 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10672 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10673 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10674 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10675 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10676 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10677 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10678 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10679 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10680 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10681 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10682 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10683 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10684 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10685 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10686 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10687 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10688 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10689 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10690 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10691 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10692 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10693 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10694 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10695 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10696 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10697 	SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE),
10698 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10699 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10700 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10701 	SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC),
10702 	SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
10703 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10704 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10705 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10706 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10707 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10708 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10709 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10710 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10711 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10712 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10713 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10714 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10715 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10716 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10717 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10718 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10719 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10720 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10721 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10722 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10723 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10724 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10725 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10726 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10727 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10728 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10729 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10730 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10731 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10732 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10733 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10734 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10735 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10736 	SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10737 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10738 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10739 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10740 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10741 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10742 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10743 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10744 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10745 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10746 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10747 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10748 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10749 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10750 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10751 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10752 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10753 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10754 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10755 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10756 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10757 	SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10758 	SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10759 	SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C),
10760 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10761 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10762 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10763 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10764 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10765 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10766 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10767 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10768 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10769 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10770 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10771 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10772 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10773 	HDA_CODEC_QUIRK(0x17aa, 0x3802, "DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10774 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8", ALC287_FIXUP_TAS2781_I2C),
10775 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10776 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10777 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10778 	HDA_CODEC_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10779 	SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10780 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10781 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10782 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10783 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10784 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10785 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10786 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10787 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10788 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10789 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10790 	SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10791 	SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10792 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10793 	HDA_CODEC_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
10794 	SND_PCI_QUIRK(0x17aa, 0x386e, "Yoga Pro 7 14ARP8", ALC285_FIXUP_SPEAKER2_TO_DAC1),
10795 	HDA_CODEC_QUIRK(0x17aa, 0x386f, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C),
10796 	SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
10797 	SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
10798 	SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10799 	SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10800 	SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10801 	SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10802 	SND_PCI_QUIRK(0x17aa, 0x387f, "Yoga S780-16 pro dual LX", ALC287_FIXUP_TAS2781_I2C),
10803 	SND_PCI_QUIRK(0x17aa, 0x3880, "Yoga S780-16 pro dual YC", ALC287_FIXUP_TAS2781_I2C),
10804 	SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10805 	SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10806 	SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10807 	SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10808 	SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10809 	SND_PCI_QUIRK(0x17aa, 0x38a5, "Y580P AMD dual", ALC287_FIXUP_TAS2781_I2C),
10810 	SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10811 	SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10812 	SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10813 	SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10814 	SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10815 	SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10816 	SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10817 	SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10818 	SND_PCI_QUIRK(0x17aa, 0x38b8, "Yoga S780-14.5 proX AMD YC Dual", ALC287_FIXUP_TAS2781_I2C),
10819 	SND_PCI_QUIRK(0x17aa, 0x38b9, "Yoga S780-14.5 proX AMD LX Dual", ALC287_FIXUP_TAS2781_I2C),
10820 	SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10821 	SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10822 	SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10823 	SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10824 	SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10825 	SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10826 	SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10827 	SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10828 	SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10829 	SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10830 	SND_PCI_QUIRK(0x17aa, 0x38d3, "Yoga S990-16 Pro IMH YC Dual", ALC287_FIXUP_TAS2781_I2C),
10831 	SND_PCI_QUIRK(0x17aa, 0x38d4, "Yoga S990-16 Pro IMH VECO Dual", ALC287_FIXUP_TAS2781_I2C),
10832 	SND_PCI_QUIRK(0x17aa, 0x38d5, "Yoga S990-16 Pro IMH YC Quad", ALC287_FIXUP_TAS2781_I2C),
10833 	SND_PCI_QUIRK(0x17aa, 0x38d6, "Yoga S990-16 Pro IMH VECO Quad", ALC287_FIXUP_TAS2781_I2C),
10834 	SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10835 	SND_PCI_QUIRK(0x17aa, 0x38df, "Yoga Y990 Intel YC Dual", ALC287_FIXUP_TAS2781_I2C),
10836 	SND_PCI_QUIRK(0x17aa, 0x38e0, "Yoga Y990 Intel VECO Dual", ALC287_FIXUP_TAS2781_I2C),
10837 	SND_PCI_QUIRK(0x17aa, 0x38f8, "Yoga Book 9i", ALC287_FIXUP_TAS2781_I2C),
10838 	SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10839 	SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10840 	SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10841 	SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
10842 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10843 	SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
10844 	SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
10845 	SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
10846 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10847 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10848 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10849 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10850 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10851 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10852 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10853 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10854 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10855 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10856 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10857 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10858 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10859 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10860 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10861 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10862 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10863 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10864 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10865 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10866 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10867 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10868 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10869 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10870 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10871 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10872 	SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10873 	SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10874 	SND_PCI_QUIRK(0x1854, 0x0488, "LG gram 16 (16Z90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10875 	SND_PCI_QUIRK(0x1854, 0x048a, "LG gram 17 (17ZD90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10876 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10877 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10878 	SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC),
10879 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10880 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10881 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10882 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10883 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10884 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10885 	SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10886 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10887 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10888 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10889 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10890 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10891 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10892 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10893 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10894 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10895 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10896 	SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10897 	SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10898 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10899 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10900 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10901 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10902 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10903 	SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10904 	SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10905 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10906 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10907 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10908 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10909 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10910 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10911 	SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10912 	SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10913 
10914 #if 0
10915 	/* Below is a quirk table taken from the old code.
10916 	 * Basically the device should work as is without the fixup table.
10917 	 * If BIOS doesn't give a proper info, enable the corresponding
10918 	 * fixup entry.
10919 	 */
10920 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10921 		      ALC269_FIXUP_AMIC),
10922 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10923 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10924 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10925 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10926 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10927 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10928 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10929 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10930 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10931 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10932 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10933 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10934 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10935 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10936 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10937 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10938 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10939 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10940 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10941 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10942 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10943 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10944 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10945 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10946 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10947 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10948 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10949 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10950 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10951 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10952 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10953 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10954 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10955 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10956 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10957 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10958 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10959 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10960 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10961 #endif
10962 	{}
10963 };
10964 
10965 static const struct hda_quirk alc269_fixup_vendor_tbl[] = {
10966 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10967 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10968 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10969 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10970 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10971 	{}
10972 };
10973 
10974 static const struct hda_model_fixup alc269_fixup_models[] = {
10975 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10976 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10977 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10978 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10979 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10980 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10981 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10982 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10983 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10984 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10985 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10986 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10987 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10988 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10989 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10990 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10991 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10992 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10993 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10994 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10995 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10996 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10997 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
10998 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10999 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
11000 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
11001 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
11002 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
11003 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
11004 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
11005 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
11006 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
11007 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
11008 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
11009 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
11010 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
11011 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
11012 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
11013 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
11014 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
11015 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
11016 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
11017 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
11018 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
11019 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
11020 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
11021 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
11022 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
11023 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
11024 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
11025 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
11026 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
11027 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
11028 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
11029 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
11030 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
11031 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
11032 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
11033 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
11034 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
11035 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
11036 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
11037 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
11038 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
11039 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
11040 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
11041 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
11042 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
11043 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
11044 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
11045 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
11046 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
11047 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
11048 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
11049 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
11050 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
11051 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
11052 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
11053 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
11054 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
11055 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
11056 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
11057 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
11058 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
11059 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
11060 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
11061 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
11062 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
11063 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
11064 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
11065 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
11066 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
11067 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
11068 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
11069 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
11070 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
11071 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
11072 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
11073 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
11074 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
11075 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
11076 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
11077 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
11078 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
11079 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
11080 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
11081 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
11082 	{.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"},
11083 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
11084 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
11085 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
11086 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
11087 	{.id = ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, .name = "alc298-samsung-amp-v2-2-amps"},
11088 	{.id = ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, .name = "alc298-samsung-amp-v2-4-amps"},
11089 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
11090 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
11091 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
11092 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
11093 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
11094 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
11095 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
11096 	{.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
11097 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
11098 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
11099 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
11100 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
11101 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
11102 	{.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
11103 	{}
11104 };
11105 #define ALC225_STANDARD_PINS \
11106 	{0x21, 0x04211020}
11107 
11108 #define ALC256_STANDARD_PINS \
11109 	{0x12, 0x90a60140}, \
11110 	{0x14, 0x90170110}, \
11111 	{0x21, 0x02211020}
11112 
11113 #define ALC282_STANDARD_PINS \
11114 	{0x14, 0x90170110}
11115 
11116 #define ALC290_STANDARD_PINS \
11117 	{0x12, 0x99a30130}
11118 
11119 #define ALC292_STANDARD_PINS \
11120 	{0x14, 0x90170110}, \
11121 	{0x15, 0x0221401f}
11122 
11123 #define ALC295_STANDARD_PINS \
11124 	{0x12, 0xb7a60130}, \
11125 	{0x14, 0x90170110}, \
11126 	{0x21, 0x04211020}
11127 
11128 #define ALC298_STANDARD_PINS \
11129 	{0x12, 0x90a60130}, \
11130 	{0x21, 0x03211020}
11131 
11132 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
11133 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
11134 		{0x14, 0x01014020},
11135 		{0x17, 0x90170110},
11136 		{0x18, 0x02a11030},
11137 		{0x19, 0x0181303F},
11138 		{0x21, 0x0221102f}),
11139 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
11140 		{0x12, 0x90a601c0},
11141 		{0x14, 0x90171120},
11142 		{0x21, 0x02211030}),
11143 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11144 		{0x14, 0x90170110},
11145 		{0x1b, 0x90a70130},
11146 		{0x21, 0x03211020}),
11147 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11148 		{0x1a, 0x90a70130},
11149 		{0x1b, 0x90170110},
11150 		{0x21, 0x03211020}),
11151 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11152 		ALC225_STANDARD_PINS,
11153 		{0x12, 0xb7a60130},
11154 		{0x14, 0x901701a0}),
11155 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11156 		ALC225_STANDARD_PINS,
11157 		{0x12, 0xb7a60130},
11158 		{0x14, 0x901701b0}),
11159 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11160 		ALC225_STANDARD_PINS,
11161 		{0x12, 0xb7a60150},
11162 		{0x14, 0x901701a0}),
11163 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11164 		ALC225_STANDARD_PINS,
11165 		{0x12, 0xb7a60150},
11166 		{0x14, 0x901701b0}),
11167 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11168 		ALC225_STANDARD_PINS,
11169 		{0x12, 0xb7a60130},
11170 		{0x1b, 0x90170110}),
11171 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11172 		{0x1b, 0x01111010},
11173 		{0x1e, 0x01451130},
11174 		{0x21, 0x02211020}),
11175 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
11176 		{0x12, 0x90a60140},
11177 		{0x14, 0x90170110},
11178 		{0x19, 0x02a11030},
11179 		{0x21, 0x02211020}),
11180 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11181 		{0x14, 0x90170110},
11182 		{0x19, 0x02a11030},
11183 		{0x1a, 0x02a11040},
11184 		{0x1b, 0x01014020},
11185 		{0x21, 0x0221101f}),
11186 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11187 		{0x14, 0x90170110},
11188 		{0x19, 0x02a11030},
11189 		{0x1a, 0x02a11040},
11190 		{0x1b, 0x01011020},
11191 		{0x21, 0x0221101f}),
11192 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11193 		{0x14, 0x90170110},
11194 		{0x19, 0x02a11020},
11195 		{0x1a, 0x02a11030},
11196 		{0x21, 0x0221101f}),
11197 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
11198 		{0x21, 0x02211010}),
11199 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11200 		{0x14, 0x90170110},
11201 		{0x19, 0x02a11020},
11202 		{0x21, 0x02211030}),
11203 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
11204 		{0x14, 0x90170110},
11205 		{0x21, 0x02211020}),
11206 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11207 		{0x14, 0x90170130},
11208 		{0x21, 0x02211040}),
11209 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11210 		{0x12, 0x90a60140},
11211 		{0x14, 0x90170110},
11212 		{0x21, 0x02211020}),
11213 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11214 		{0x12, 0x90a60160},
11215 		{0x14, 0x90170120},
11216 		{0x21, 0x02211030}),
11217 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11218 		{0x14, 0x90170110},
11219 		{0x1b, 0x02011020},
11220 		{0x21, 0x0221101f}),
11221 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11222 		{0x14, 0x90170110},
11223 		{0x1b, 0x01011020},
11224 		{0x21, 0x0221101f}),
11225 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11226 		{0x14, 0x90170130},
11227 		{0x1b, 0x01014020},
11228 		{0x21, 0x0221103f}),
11229 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11230 		{0x14, 0x90170130},
11231 		{0x1b, 0x01011020},
11232 		{0x21, 0x0221103f}),
11233 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11234 		{0x14, 0x90170130},
11235 		{0x1b, 0x02011020},
11236 		{0x21, 0x0221103f}),
11237 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11238 		{0x14, 0x90170150},
11239 		{0x1b, 0x02011020},
11240 		{0x21, 0x0221105f}),
11241 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11242 		{0x14, 0x90170110},
11243 		{0x1b, 0x01014020},
11244 		{0x21, 0x0221101f}),
11245 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11246 		{0x12, 0x90a60160},
11247 		{0x14, 0x90170120},
11248 		{0x17, 0x90170140},
11249 		{0x21, 0x0321102f}),
11250 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11251 		{0x12, 0x90a60160},
11252 		{0x14, 0x90170130},
11253 		{0x21, 0x02211040}),
11254 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11255 		{0x12, 0x90a60160},
11256 		{0x14, 0x90170140},
11257 		{0x21, 0x02211050}),
11258 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11259 		{0x12, 0x90a60170},
11260 		{0x14, 0x90170120},
11261 		{0x21, 0x02211030}),
11262 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11263 		{0x12, 0x90a60170},
11264 		{0x14, 0x90170130},
11265 		{0x21, 0x02211040}),
11266 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11267 		{0x12, 0x90a60170},
11268 		{0x14, 0x90171130},
11269 		{0x21, 0x02211040}),
11270 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11271 		{0x12, 0x90a60170},
11272 		{0x14, 0x90170140},
11273 		{0x21, 0x02211050}),
11274 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11275 		{0x12, 0x90a60180},
11276 		{0x14, 0x90170130},
11277 		{0x21, 0x02211040}),
11278 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11279 		{0x12, 0x90a60180},
11280 		{0x14, 0x90170120},
11281 		{0x21, 0x02211030}),
11282 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11283 		{0x1b, 0x01011020},
11284 		{0x21, 0x02211010}),
11285 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11286 		{0x14, 0x90170110},
11287 		{0x1b, 0x90a70130},
11288 		{0x21, 0x04211020}),
11289 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11290 		{0x14, 0x90170110},
11291 		{0x1b, 0x90a70130},
11292 		{0x21, 0x03211020}),
11293 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11294 		{0x12, 0x90a60130},
11295 		{0x14, 0x90170110},
11296 		{0x21, 0x03211020}),
11297 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11298 		{0x12, 0x90a60130},
11299 		{0x14, 0x90170110},
11300 		{0x21, 0x04211020}),
11301 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11302 		{0x1a, 0x90a70130},
11303 		{0x1b, 0x90170110},
11304 		{0x21, 0x03211020}),
11305        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11306 		{0x14, 0x90170110},
11307 		{0x19, 0x02a11020},
11308 		{0x21, 0x0221101f}),
11309        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
11310 		{0x17, 0x90170110},
11311 		{0x19, 0x03a11030},
11312 		{0x21, 0x03211020}),
11313 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
11314 		{0x12, 0x90a60130},
11315 		{0x14, 0x90170110},
11316 		{0x15, 0x0421101f},
11317 		{0x1a, 0x04a11020}),
11318 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
11319 		{0x12, 0x90a60140},
11320 		{0x14, 0x90170110},
11321 		{0x15, 0x0421101f},
11322 		{0x18, 0x02811030},
11323 		{0x1a, 0x04a1103f},
11324 		{0x1b, 0x02011020}),
11325 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11326 		ALC282_STANDARD_PINS,
11327 		{0x12, 0x99a30130},
11328 		{0x19, 0x03a11020},
11329 		{0x21, 0x0321101f}),
11330 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11331 		ALC282_STANDARD_PINS,
11332 		{0x12, 0x99a30130},
11333 		{0x19, 0x03a11020},
11334 		{0x21, 0x03211040}),
11335 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11336 		ALC282_STANDARD_PINS,
11337 		{0x12, 0x99a30130},
11338 		{0x19, 0x03a11030},
11339 		{0x21, 0x03211020}),
11340 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11341 		ALC282_STANDARD_PINS,
11342 		{0x12, 0x99a30130},
11343 		{0x19, 0x04a11020},
11344 		{0x21, 0x0421101f}),
11345 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
11346 		ALC282_STANDARD_PINS,
11347 		{0x12, 0x90a60140},
11348 		{0x19, 0x04a11030},
11349 		{0x21, 0x04211020}),
11350 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11351 		ALC282_STANDARD_PINS,
11352 		{0x12, 0x90a609c0},
11353 		{0x18, 0x03a11830},
11354 		{0x19, 0x04a19831},
11355 		{0x1a, 0x0481303f},
11356 		{0x1b, 0x04211020},
11357 		{0x21, 0x0321101f}),
11358 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11359 		ALC282_STANDARD_PINS,
11360 		{0x12, 0x90a60940},
11361 		{0x18, 0x03a11830},
11362 		{0x19, 0x04a19831},
11363 		{0x1a, 0x0481303f},
11364 		{0x1b, 0x04211020},
11365 		{0x21, 0x0321101f}),
11366 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11367 		ALC282_STANDARD_PINS,
11368 		{0x12, 0x90a60130},
11369 		{0x21, 0x0321101f}),
11370 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11371 		{0x12, 0x90a60160},
11372 		{0x14, 0x90170120},
11373 		{0x21, 0x02211030}),
11374 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11375 		ALC282_STANDARD_PINS,
11376 		{0x12, 0x90a60130},
11377 		{0x19, 0x03a11020},
11378 		{0x21, 0x0321101f}),
11379 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11380 		{0x12, 0x90a60130},
11381 		{0x14, 0x90170110},
11382 		{0x19, 0x04a11040},
11383 		{0x21, 0x04211020}),
11384 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11385 		{0x14, 0x90170110},
11386 		{0x19, 0x04a11040},
11387 		{0x1d, 0x40600001},
11388 		{0x21, 0x04211020}),
11389 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
11390 		{0x14, 0x90170110},
11391 		{0x19, 0x04a11040},
11392 		{0x21, 0x04211020}),
11393 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11394 		{0x14, 0x90170110},
11395 		{0x17, 0x90170111},
11396 		{0x19, 0x03a11030},
11397 		{0x21, 0x03211020}),
11398 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11399 		{0x17, 0x90170110},
11400 		{0x19, 0x03a11030},
11401 		{0x21, 0x03211020}),
11402 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11403 		{0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11404 		{0x19, 0x04a11040},
11405 		{0x21, 0x04211020}),
11406 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11407 		{0x12, 0x90a60130},
11408 		{0x17, 0x90170110},
11409 		{0x21, 0x02211020}),
11410 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
11411 		{0x12, 0x90a60120},
11412 		{0x14, 0x90170110},
11413 		{0x21, 0x0321101f}),
11414 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11415 		ALC290_STANDARD_PINS,
11416 		{0x15, 0x04211040},
11417 		{0x18, 0x90170112},
11418 		{0x1a, 0x04a11020}),
11419 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11420 		ALC290_STANDARD_PINS,
11421 		{0x15, 0x04211040},
11422 		{0x18, 0x90170110},
11423 		{0x1a, 0x04a11020}),
11424 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11425 		ALC290_STANDARD_PINS,
11426 		{0x15, 0x0421101f},
11427 		{0x1a, 0x04a11020}),
11428 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11429 		ALC290_STANDARD_PINS,
11430 		{0x15, 0x04211020},
11431 		{0x1a, 0x04a11040}),
11432 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11433 		ALC290_STANDARD_PINS,
11434 		{0x14, 0x90170110},
11435 		{0x15, 0x04211020},
11436 		{0x1a, 0x04a11040}),
11437 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11438 		ALC290_STANDARD_PINS,
11439 		{0x14, 0x90170110},
11440 		{0x15, 0x04211020},
11441 		{0x1a, 0x04a11020}),
11442 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11443 		ALC290_STANDARD_PINS,
11444 		{0x14, 0x90170110},
11445 		{0x15, 0x0421101f},
11446 		{0x1a, 0x04a11020}),
11447 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11448 		ALC292_STANDARD_PINS,
11449 		{0x12, 0x90a60140},
11450 		{0x16, 0x01014020},
11451 		{0x19, 0x01a19030}),
11452 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11453 		ALC292_STANDARD_PINS,
11454 		{0x12, 0x90a60140},
11455 		{0x16, 0x01014020},
11456 		{0x18, 0x02a19031},
11457 		{0x19, 0x01a1903e}),
11458 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
11459 		ALC292_STANDARD_PINS,
11460 		{0x12, 0x90a60140}),
11461 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11462 		ALC292_STANDARD_PINS,
11463 		{0x13, 0x90a60140},
11464 		{0x16, 0x21014020},
11465 		{0x19, 0x21a19030}),
11466 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11467 		ALC292_STANDARD_PINS,
11468 		{0x13, 0x90a60140}),
11469 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
11470 		{0x17, 0x90170110},
11471 		{0x21, 0x04211020}),
11472 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
11473 		{0x14, 0x90170110},
11474 		{0x1b, 0x90a70130},
11475 		{0x21, 0x04211020}),
11476 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11477 		{0x12, 0x90a60130},
11478 		{0x17, 0x90170110},
11479 		{0x21, 0x03211020}),
11480 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11481 		{0x12, 0x90a60130},
11482 		{0x17, 0x90170110},
11483 		{0x21, 0x04211020}),
11484 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11485 		{0x12, 0x90a60130},
11486 		{0x17, 0x90170110},
11487 		{0x21, 0x03211020}),
11488 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11489 		{0x12, 0x90a60120},
11490 		{0x17, 0x90170110},
11491 		{0x21, 0x04211030}),
11492 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11493 		{0x12, 0x90a60130},
11494 		{0x17, 0x90170110},
11495 		{0x21, 0x03211020}),
11496 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11497 		{0x12, 0x90a60130},
11498 		{0x17, 0x90170110},
11499 		{0x21, 0x03211020}),
11500 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11501 		ALC298_STANDARD_PINS,
11502 		{0x17, 0x90170110}),
11503 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11504 		ALC298_STANDARD_PINS,
11505 		{0x17, 0x90170140}),
11506 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11507 		ALC298_STANDARD_PINS,
11508 		{0x17, 0x90170150}),
11509 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
11510 		{0x12, 0xb7a60140},
11511 		{0x13, 0xb7a60150},
11512 		{0x17, 0x90170110},
11513 		{0x1a, 0x03011020},
11514 		{0x21, 0x03211030}),
11515 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
11516 		{0x12, 0xb7a60140},
11517 		{0x17, 0x90170110},
11518 		{0x1a, 0x03a11030},
11519 		{0x21, 0x03211020}),
11520 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11521 		ALC225_STANDARD_PINS,
11522 		{0x12, 0xb7a60130},
11523 		{0x17, 0x90170110}),
11524 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
11525 		{0x14, 0x01014010},
11526 		{0x17, 0x90170120},
11527 		{0x18, 0x02a11030},
11528 		{0x19, 0x02a1103f},
11529 		{0x21, 0x0221101f}),
11530 	{}
11531 };
11532 
11533 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
11534  * more machines, don't need to match all valid pins, just need to match
11535  * all the pins defined in the tbl. Just because of this reason, it is possible
11536  * that a single machine matches multiple tbls, so there is one limitation:
11537  *   at most one tbl is allowed to define for the same vendor and same codec
11538  */
11539 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
11540 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
11541 		{0x19, 0x40000000}),
11542 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11543 		{0x19, 0x40000000},
11544 		{0x1b, 0x40000000}),
11545 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11546 		{0x19, 0x40000000},
11547 		{0x1b, 0x40000000}),
11548 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11549 		{0x19, 0x40000000},
11550 		{0x1a, 0x40000000}),
11551 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11552 		{0x19, 0x40000000},
11553 		{0x1a, 0x40000000}),
11554 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11555 		{0x19, 0x40000000},
11556 		{0x1a, 0x40000000}),
11557 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11558 		{0x19, 0x40000000}),
11559 	{}
11560 };
11561 
11562 static void alc269_fill_coef(struct hda_codec *codec)
11563 {
11564 	struct alc_spec *spec = codec->spec;
11565 	int val;
11566 
11567 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11568 		return;
11569 
11570 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11571 		alc_write_coef_idx(codec, 0xf, 0x960b);
11572 		alc_write_coef_idx(codec, 0xe, 0x8817);
11573 	}
11574 
11575 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11576 		alc_write_coef_idx(codec, 0xf, 0x960b);
11577 		alc_write_coef_idx(codec, 0xe, 0x8814);
11578 	}
11579 
11580 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11581 		/* Power up output pin */
11582 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11583 	}
11584 
11585 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11586 		val = alc_read_coef_idx(codec, 0xd);
11587 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11588 			/* Capless ramp up clock control */
11589 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
11590 		}
11591 		val = alc_read_coef_idx(codec, 0x17);
11592 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11593 			/* Class D power on reset */
11594 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
11595 		}
11596 	}
11597 
11598 	/* HP */
11599 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11600 }
11601 
11602 /*
11603  */
11604 static int patch_alc269(struct hda_codec *codec)
11605 {
11606 	struct alc_spec *spec;
11607 	int err;
11608 
11609 	err = alc_alloc_spec(codec, 0x0b);
11610 	if (err < 0)
11611 		return err;
11612 
11613 	spec = codec->spec;
11614 	spec->gen.shared_mic_vref_pin = 0x18;
11615 	codec->power_save_node = 0;
11616 	spec->en_3kpull_low = true;
11617 
11618 	codec->patch_ops.suspend = alc269_suspend;
11619 	codec->patch_ops.resume = alc269_resume;
11620 	spec->shutup = alc_default_shutup;
11621 	spec->init_hook = alc_default_init;
11622 
11623 	switch (codec->core.vendor_id) {
11624 	case 0x10ec0269:
11625 		spec->codec_variant = ALC269_TYPE_ALC269VA;
11626 		switch (alc_get_coef0(codec) & 0x00f0) {
11627 		case 0x0010:
11628 			if (codec->bus->pci &&
11629 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
11630 			    spec->cdefine.platform_type == 1)
11631 				err = alc_codec_rename(codec, "ALC271X");
11632 			spec->codec_variant = ALC269_TYPE_ALC269VB;
11633 			break;
11634 		case 0x0020:
11635 			if (codec->bus->pci &&
11636 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
11637 			    codec->bus->pci->subsystem_device == 0x21f3)
11638 				err = alc_codec_rename(codec, "ALC3202");
11639 			spec->codec_variant = ALC269_TYPE_ALC269VC;
11640 			break;
11641 		case 0x0030:
11642 			spec->codec_variant = ALC269_TYPE_ALC269VD;
11643 			break;
11644 		default:
11645 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
11646 		}
11647 		if (err < 0)
11648 			goto error;
11649 		spec->shutup = alc269_shutup;
11650 		spec->init_hook = alc269_fill_coef;
11651 		alc269_fill_coef(codec);
11652 		break;
11653 
11654 	case 0x10ec0280:
11655 	case 0x10ec0290:
11656 		spec->codec_variant = ALC269_TYPE_ALC280;
11657 		break;
11658 	case 0x10ec0282:
11659 		spec->codec_variant = ALC269_TYPE_ALC282;
11660 		spec->shutup = alc282_shutup;
11661 		spec->init_hook = alc282_init;
11662 		break;
11663 	case 0x10ec0233:
11664 	case 0x10ec0283:
11665 		spec->codec_variant = ALC269_TYPE_ALC283;
11666 		spec->shutup = alc283_shutup;
11667 		spec->init_hook = alc283_init;
11668 		break;
11669 	case 0x10ec0284:
11670 	case 0x10ec0292:
11671 		spec->codec_variant = ALC269_TYPE_ALC284;
11672 		break;
11673 	case 0x10ec0293:
11674 		spec->codec_variant = ALC269_TYPE_ALC293;
11675 		break;
11676 	case 0x10ec0286:
11677 	case 0x10ec0288:
11678 		spec->codec_variant = ALC269_TYPE_ALC286;
11679 		break;
11680 	case 0x10ec0298:
11681 		spec->codec_variant = ALC269_TYPE_ALC298;
11682 		break;
11683 	case 0x10ec0235:
11684 	case 0x10ec0255:
11685 		spec->codec_variant = ALC269_TYPE_ALC255;
11686 		spec->shutup = alc256_shutup;
11687 		spec->init_hook = alc256_init;
11688 		break;
11689 	case 0x10ec0230:
11690 	case 0x10ec0236:
11691 	case 0x10ec0256:
11692 	case 0x19e58326:
11693 		spec->codec_variant = ALC269_TYPE_ALC256;
11694 		spec->shutup = alc256_shutup;
11695 		spec->init_hook = alc256_init;
11696 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11697 		if (codec->core.vendor_id == 0x10ec0236 &&
11698 		    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11699 			spec->en_3kpull_low = false;
11700 		break;
11701 	case 0x10ec0257:
11702 		spec->codec_variant = ALC269_TYPE_ALC257;
11703 		spec->shutup = alc256_shutup;
11704 		spec->init_hook = alc256_init;
11705 		spec->gen.mixer_nid = 0;
11706 		spec->en_3kpull_low = false;
11707 		break;
11708 	case 0x10ec0215:
11709 	case 0x10ec0245:
11710 	case 0x10ec0285:
11711 	case 0x10ec0289:
11712 		if (alc_get_coef0(codec) & 0x0010)
11713 			spec->codec_variant = ALC269_TYPE_ALC245;
11714 		else
11715 			spec->codec_variant = ALC269_TYPE_ALC215;
11716 		spec->shutup = alc225_shutup;
11717 		spec->init_hook = alc225_init;
11718 		spec->gen.mixer_nid = 0;
11719 		break;
11720 	case 0x10ec0225:
11721 	case 0x10ec0295:
11722 	case 0x10ec0299:
11723 		spec->codec_variant = ALC269_TYPE_ALC225;
11724 		spec->shutup = alc225_shutup;
11725 		spec->init_hook = alc225_init;
11726 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11727 		break;
11728 	case 0x10ec0287:
11729 		spec->codec_variant = ALC269_TYPE_ALC287;
11730 		spec->shutup = alc225_shutup;
11731 		spec->init_hook = alc225_init;
11732 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11733 		break;
11734 	case 0x10ec0234:
11735 	case 0x10ec0274:
11736 	case 0x10ec0294:
11737 		spec->codec_variant = ALC269_TYPE_ALC294;
11738 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11739 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11740 		spec->init_hook = alc294_init;
11741 		break;
11742 	case 0x10ec0300:
11743 		spec->codec_variant = ALC269_TYPE_ALC300;
11744 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11745 		break;
11746 	case 0x10ec0623:
11747 		spec->codec_variant = ALC269_TYPE_ALC623;
11748 		break;
11749 	case 0x10ec0700:
11750 	case 0x10ec0701:
11751 	case 0x10ec0703:
11752 	case 0x10ec0711:
11753 		spec->codec_variant = ALC269_TYPE_ALC700;
11754 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11755 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11756 		spec->init_hook = alc294_init;
11757 		break;
11758 
11759 	}
11760 
11761 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11762 		spec->has_alc5505_dsp = 1;
11763 		spec->init_hook = alc5505_dsp_init;
11764 	}
11765 
11766 	alc_pre_init(codec);
11767 
11768 	snd_hda_pick_fixup(codec, alc269_fixup_models,
11769 		       alc269_fixup_tbl, alc269_fixups);
11770 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11771 	 * the quirk breaks the latter (bko#214101).
11772 	 * Clear the wrong entry.
11773 	 */
11774 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11775 	    codec->core.vendor_id == 0x10ec0294) {
11776 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11777 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11778 	}
11779 
11780 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11781 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11782 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
11783 			   alc269_fixups);
11784 
11785 	/*
11786 	 * Check whether ACPI describes companion amplifiers that require
11787 	 * component binding
11788 	 */
11789 	find_cirrus_companion_amps(codec);
11790 
11791 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11792 
11793 	alc_auto_parse_customize_define(codec);
11794 
11795 	if (has_cdefine_beep(codec))
11796 		spec->gen.beep_nid = 0x01;
11797 
11798 	/* automatic parse from the BIOS config */
11799 	err = alc269_parse_auto_config(codec);
11800 	if (err < 0)
11801 		goto error;
11802 
11803 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11804 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11805 		if (err < 0)
11806 			goto error;
11807 	}
11808 
11809 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11810 
11811 	return 0;
11812 
11813  error:
11814 	alc_free(codec);
11815 	return err;
11816 }
11817 
11818 /*
11819  * ALC861
11820  */
11821 
11822 static int alc861_parse_auto_config(struct hda_codec *codec)
11823 {
11824 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11825 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11826 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11827 }
11828 
11829 /* Pin config fixes */
11830 enum {
11831 	ALC861_FIXUP_FSC_AMILO_PI1505,
11832 	ALC861_FIXUP_AMP_VREF_0F,
11833 	ALC861_FIXUP_NO_JACK_DETECT,
11834 	ALC861_FIXUP_ASUS_A6RP,
11835 	ALC660_FIXUP_ASUS_W7J,
11836 };
11837 
11838 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11839 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11840 			const struct hda_fixup *fix, int action)
11841 {
11842 	struct alc_spec *spec = codec->spec;
11843 	unsigned int val;
11844 
11845 	if (action != HDA_FIXUP_ACT_INIT)
11846 		return;
11847 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
11848 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11849 		val |= AC_PINCTL_IN_EN;
11850 	val |= AC_PINCTL_VREF_50;
11851 	snd_hda_set_pin_ctl(codec, 0x0f, val);
11852 	spec->gen.keep_vref_in_automute = 1;
11853 }
11854 
11855 /* suppress the jack-detection */
11856 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11857 				     const struct hda_fixup *fix, int action)
11858 {
11859 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11860 		codec->no_jack_detect = 1;
11861 }
11862 
11863 static const struct hda_fixup alc861_fixups[] = {
11864 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
11865 		.type = HDA_FIXUP_PINS,
11866 		.v.pins = (const struct hda_pintbl[]) {
11867 			{ 0x0b, 0x0221101f }, /* HP */
11868 			{ 0x0f, 0x90170310 }, /* speaker */
11869 			{ }
11870 		}
11871 	},
11872 	[ALC861_FIXUP_AMP_VREF_0F] = {
11873 		.type = HDA_FIXUP_FUNC,
11874 		.v.func = alc861_fixup_asus_amp_vref_0f,
11875 	},
11876 	[ALC861_FIXUP_NO_JACK_DETECT] = {
11877 		.type = HDA_FIXUP_FUNC,
11878 		.v.func = alc_fixup_no_jack_detect,
11879 	},
11880 	[ALC861_FIXUP_ASUS_A6RP] = {
11881 		.type = HDA_FIXUP_FUNC,
11882 		.v.func = alc861_fixup_asus_amp_vref_0f,
11883 		.chained = true,
11884 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11885 	},
11886 	[ALC660_FIXUP_ASUS_W7J] = {
11887 		.type = HDA_FIXUP_VERBS,
11888 		.v.verbs = (const struct hda_verb[]) {
11889 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
11890 			 * for enabling outputs
11891 			 */
11892 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11893 			{ }
11894 		},
11895 	}
11896 };
11897 
11898 static const struct hda_quirk alc861_fixup_tbl[] = {
11899 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11900 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11901 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11902 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11903 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11904 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11905 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11906 	{}
11907 };
11908 
11909 /*
11910  */
11911 static int patch_alc861(struct hda_codec *codec)
11912 {
11913 	struct alc_spec *spec;
11914 	int err;
11915 
11916 	err = alc_alloc_spec(codec, 0x15);
11917 	if (err < 0)
11918 		return err;
11919 
11920 	spec = codec->spec;
11921 	if (has_cdefine_beep(codec))
11922 		spec->gen.beep_nid = 0x23;
11923 
11924 	spec->power_hook = alc_power_eapd;
11925 
11926 	alc_pre_init(codec);
11927 
11928 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11929 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11930 
11931 	/* automatic parse from the BIOS config */
11932 	err = alc861_parse_auto_config(codec);
11933 	if (err < 0)
11934 		goto error;
11935 
11936 	if (!spec->gen.no_analog) {
11937 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11938 		if (err < 0)
11939 			goto error;
11940 	}
11941 
11942 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11943 
11944 	return 0;
11945 
11946  error:
11947 	alc_free(codec);
11948 	return err;
11949 }
11950 
11951 /*
11952  * ALC861-VD support
11953  *
11954  * Based on ALC882
11955  *
11956  * In addition, an independent DAC
11957  */
11958 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11959 {
11960 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11961 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11962 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11963 }
11964 
11965 enum {
11966 	ALC660VD_FIX_ASUS_GPIO1,
11967 	ALC861VD_FIX_DALLAS,
11968 };
11969 
11970 /* exclude VREF80 */
11971 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11972 				  const struct hda_fixup *fix, int action)
11973 {
11974 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11975 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11976 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11977 	}
11978 }
11979 
11980 /* reset GPIO1 */
11981 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11982 				      const struct hda_fixup *fix, int action)
11983 {
11984 	struct alc_spec *spec = codec->spec;
11985 
11986 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11987 		spec->gpio_mask |= 0x02;
11988 	alc_fixup_gpio(codec, action, 0x01);
11989 }
11990 
11991 static const struct hda_fixup alc861vd_fixups[] = {
11992 	[ALC660VD_FIX_ASUS_GPIO1] = {
11993 		.type = HDA_FIXUP_FUNC,
11994 		.v.func = alc660vd_fixup_asus_gpio1,
11995 	},
11996 	[ALC861VD_FIX_DALLAS] = {
11997 		.type = HDA_FIXUP_FUNC,
11998 		.v.func = alc861vd_fixup_dallas,
11999 	},
12000 };
12001 
12002 static const struct hda_quirk alc861vd_fixup_tbl[] = {
12003 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
12004 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
12005 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
12006 	{}
12007 };
12008 
12009 /*
12010  */
12011 static int patch_alc861vd(struct hda_codec *codec)
12012 {
12013 	struct alc_spec *spec;
12014 	int err;
12015 
12016 	err = alc_alloc_spec(codec, 0x0b);
12017 	if (err < 0)
12018 		return err;
12019 
12020 	spec = codec->spec;
12021 	if (has_cdefine_beep(codec))
12022 		spec->gen.beep_nid = 0x23;
12023 
12024 	spec->shutup = alc_eapd_shutup;
12025 
12026 	alc_pre_init(codec);
12027 
12028 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
12029 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12030 
12031 	/* automatic parse from the BIOS config */
12032 	err = alc861vd_parse_auto_config(codec);
12033 	if (err < 0)
12034 		goto error;
12035 
12036 	if (!spec->gen.no_analog) {
12037 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12038 		if (err < 0)
12039 			goto error;
12040 	}
12041 
12042 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12043 
12044 	return 0;
12045 
12046  error:
12047 	alc_free(codec);
12048 	return err;
12049 }
12050 
12051 /*
12052  * ALC662 support
12053  *
12054  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
12055  * configuration.  Each pin widget can choose any input DACs and a mixer.
12056  * Each ADC is connected from a mixer of all inputs.  This makes possible
12057  * 6-channel independent captures.
12058  *
12059  * In addition, an independent DAC for the multi-playback (not used in this
12060  * driver yet).
12061  */
12062 
12063 /*
12064  * BIOS auto configuration
12065  */
12066 
12067 static int alc662_parse_auto_config(struct hda_codec *codec)
12068 {
12069 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
12070 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
12071 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
12072 	const hda_nid_t *ssids;
12073 
12074 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
12075 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
12076 	    codec->core.vendor_id == 0x10ec0671)
12077 		ssids = alc663_ssids;
12078 	else
12079 		ssids = alc662_ssids;
12080 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
12081 }
12082 
12083 static void alc272_fixup_mario(struct hda_codec *codec,
12084 			       const struct hda_fixup *fix, int action)
12085 {
12086 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
12087 		return;
12088 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
12089 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
12090 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
12091 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
12092 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
12093 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
12094 }
12095 
12096 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
12097 	{ .channels = 2,
12098 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
12099 	{ .channels = 4,
12100 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
12101 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
12102 	{ }
12103 };
12104 
12105 /* override the 2.1 chmap */
12106 static void alc_fixup_bass_chmap(struct hda_codec *codec,
12107 				    const struct hda_fixup *fix, int action)
12108 {
12109 	if (action == HDA_FIXUP_ACT_BUILD) {
12110 		struct alc_spec *spec = codec->spec;
12111 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
12112 	}
12113 }
12114 
12115 /* avoid D3 for keeping GPIO up */
12116 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
12117 					  hda_nid_t nid,
12118 					  unsigned int power_state)
12119 {
12120 	struct alc_spec *spec = codec->spec;
12121 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
12122 		return AC_PWRST_D0;
12123 	return power_state;
12124 }
12125 
12126 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
12127 				   const struct hda_fixup *fix, int action)
12128 {
12129 	struct alc_spec *spec = codec->spec;
12130 
12131 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
12132 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12133 		spec->mute_led_polarity = 1;
12134 		codec->power_filter = gpio_led_power_filter;
12135 	}
12136 }
12137 
12138 static void alc662_usi_automute_hook(struct hda_codec *codec,
12139 					 struct hda_jack_callback *jack)
12140 {
12141 	struct alc_spec *spec = codec->spec;
12142 	int vref;
12143 	msleep(200);
12144 	snd_hda_gen_hp_automute(codec, jack);
12145 
12146 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
12147 	msleep(100);
12148 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
12149 			    vref);
12150 }
12151 
12152 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
12153 				     const struct hda_fixup *fix, int action)
12154 {
12155 	struct alc_spec *spec = codec->spec;
12156 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12157 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12158 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
12159 	}
12160 }
12161 
12162 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
12163 					struct hda_jack_callback *cb)
12164 {
12165 	/* surround speakers at 0x1b already get muted automatically when
12166 	 * headphones are plugged in, but we have to mute/unmute the remaining
12167 	 * channels manually:
12168 	 * 0x15 - front left/front right
12169 	 * 0x18 - front center/ LFE
12170 	 */
12171 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
12172 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
12173 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
12174 	} else {
12175 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
12176 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
12177 	}
12178 }
12179 
12180 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
12181 					const struct hda_fixup *fix, int action)
12182 {
12183     /* Pin 0x1b: shared headphones jack and surround speakers */
12184 	if (!is_jack_detectable(codec, 0x1b))
12185 		return;
12186 
12187 	switch (action) {
12188 	case HDA_FIXUP_ACT_PRE_PROBE:
12189 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
12190 				alc662_aspire_ethos_mute_speakers);
12191 		/* subwoofer needs an extra GPIO setting to become audible */
12192 		alc_setup_gpio(codec, 0x02);
12193 		break;
12194 	case HDA_FIXUP_ACT_INIT:
12195 		/* Make sure to start in a correct state, i.e. if
12196 		 * headphones have been plugged in before powering up the system
12197 		 */
12198 		alc662_aspire_ethos_mute_speakers(codec, NULL);
12199 		break;
12200 	}
12201 }
12202 
12203 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
12204 					     const struct hda_fixup *fix, int action)
12205 {
12206 	struct alc_spec *spec = codec->spec;
12207 
12208 	static const struct hda_pintbl pincfgs[] = {
12209 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
12210 		{ 0x1b, 0x0181304f },
12211 		{ }
12212 	};
12213 
12214 	switch (action) {
12215 	case HDA_FIXUP_ACT_PRE_PROBE:
12216 		spec->gen.mixer_nid = 0;
12217 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12218 		snd_hda_apply_pincfgs(codec, pincfgs);
12219 		break;
12220 	case HDA_FIXUP_ACT_INIT:
12221 		alc_write_coef_idx(codec, 0x19, 0xa054);
12222 		break;
12223 	}
12224 }
12225 
12226 static void alc897_hp_automute_hook(struct hda_codec *codec,
12227 					 struct hda_jack_callback *jack)
12228 {
12229 	struct alc_spec *spec = codec->spec;
12230 	int vref;
12231 
12232 	snd_hda_gen_hp_automute(codec, jack);
12233 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
12234 	snd_hda_set_pin_ctl(codec, 0x1b, vref);
12235 }
12236 
12237 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
12238 				     const struct hda_fixup *fix, int action)
12239 {
12240 	struct alc_spec *spec = codec->spec;
12241 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12242 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12243 		spec->no_shutup_pins = 1;
12244 	}
12245 	if (action == HDA_FIXUP_ACT_PROBE) {
12246 		snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
12247 	}
12248 }
12249 
12250 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
12251 				     const struct hda_fixup *fix, int action)
12252 {
12253 	struct alc_spec *spec = codec->spec;
12254 
12255 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12256 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12257 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12258 	}
12259 }
12260 
12261 static const struct coef_fw alc668_coefs[] = {
12262 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
12263 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
12264 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
12265 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
12266 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
12267 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
12268 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
12269 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
12270 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
12271 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
12272 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
12273 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
12274 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
12275 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
12276 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
12277 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
12278 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
12279 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
12280 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
12281 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
12282 	{}
12283 };
12284 
12285 static void alc668_restore_default_value(struct hda_codec *codec)
12286 {
12287 	alc_process_coef_fw(codec, alc668_coefs);
12288 }
12289 
12290 enum {
12291 	ALC662_FIXUP_ASPIRE,
12292 	ALC662_FIXUP_LED_GPIO1,
12293 	ALC662_FIXUP_IDEAPAD,
12294 	ALC272_FIXUP_MARIO,
12295 	ALC662_FIXUP_CZC_ET26,
12296 	ALC662_FIXUP_CZC_P10T,
12297 	ALC662_FIXUP_SKU_IGNORE,
12298 	ALC662_FIXUP_HP_RP5800,
12299 	ALC662_FIXUP_ASUS_MODE1,
12300 	ALC662_FIXUP_ASUS_MODE2,
12301 	ALC662_FIXUP_ASUS_MODE3,
12302 	ALC662_FIXUP_ASUS_MODE4,
12303 	ALC662_FIXUP_ASUS_MODE5,
12304 	ALC662_FIXUP_ASUS_MODE6,
12305 	ALC662_FIXUP_ASUS_MODE7,
12306 	ALC662_FIXUP_ASUS_MODE8,
12307 	ALC662_FIXUP_NO_JACK_DETECT,
12308 	ALC662_FIXUP_ZOTAC_Z68,
12309 	ALC662_FIXUP_INV_DMIC,
12310 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12311 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
12312 	ALC662_FIXUP_HEADSET_MODE,
12313 	ALC668_FIXUP_HEADSET_MODE,
12314 	ALC662_FIXUP_BASS_MODE4_CHMAP,
12315 	ALC662_FIXUP_BASS_16,
12316 	ALC662_FIXUP_BASS_1A,
12317 	ALC662_FIXUP_BASS_CHMAP,
12318 	ALC668_FIXUP_AUTO_MUTE,
12319 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
12320 	ALC668_FIXUP_DELL_XPS13,
12321 	ALC662_FIXUP_ASUS_Nx50,
12322 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12323 	ALC668_FIXUP_ASUS_Nx51,
12324 	ALC668_FIXUP_MIC_COEF,
12325 	ALC668_FIXUP_ASUS_G751,
12326 	ALC891_FIXUP_HEADSET_MODE,
12327 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12328 	ALC662_FIXUP_ACER_VERITON,
12329 	ALC892_FIXUP_ASROCK_MOBO,
12330 	ALC662_FIXUP_USI_FUNC,
12331 	ALC662_FIXUP_USI_HEADSET_MODE,
12332 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
12333 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
12334 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
12335 	ALC671_FIXUP_HP_HEADSET_MIC2,
12336 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
12337 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
12338 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12339 	ALC668_FIXUP_HEADSET_MIC,
12340 	ALC668_FIXUP_MIC_DET_COEF,
12341 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
12342 	ALC897_FIXUP_HEADSET_MIC_PIN,
12343 	ALC897_FIXUP_HP_HSMIC_VERB,
12344 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
12345 	ALC897_FIXUP_HEADSET_MIC_PIN2,
12346 	ALC897_FIXUP_UNIS_H3C_X500S,
12347 	ALC897_FIXUP_HEADSET_MIC_PIN3,
12348 };
12349 
12350 static const struct hda_fixup alc662_fixups[] = {
12351 	[ALC662_FIXUP_ASPIRE] = {
12352 		.type = HDA_FIXUP_PINS,
12353 		.v.pins = (const struct hda_pintbl[]) {
12354 			{ 0x15, 0x99130112 }, /* subwoofer */
12355 			{ }
12356 		}
12357 	},
12358 	[ALC662_FIXUP_LED_GPIO1] = {
12359 		.type = HDA_FIXUP_FUNC,
12360 		.v.func = alc662_fixup_led_gpio1,
12361 	},
12362 	[ALC662_FIXUP_IDEAPAD] = {
12363 		.type = HDA_FIXUP_PINS,
12364 		.v.pins = (const struct hda_pintbl[]) {
12365 			{ 0x17, 0x99130112 }, /* subwoofer */
12366 			{ }
12367 		},
12368 		.chained = true,
12369 		.chain_id = ALC662_FIXUP_LED_GPIO1,
12370 	},
12371 	[ALC272_FIXUP_MARIO] = {
12372 		.type = HDA_FIXUP_FUNC,
12373 		.v.func = alc272_fixup_mario,
12374 	},
12375 	[ALC662_FIXUP_CZC_ET26] = {
12376 		.type = HDA_FIXUP_PINS,
12377 		.v.pins = (const struct hda_pintbl[]) {
12378 			{0x12, 0x403cc000},
12379 			{0x14, 0x90170110}, /* speaker */
12380 			{0x15, 0x411111f0},
12381 			{0x16, 0x411111f0},
12382 			{0x18, 0x01a19030}, /* mic */
12383 			{0x19, 0x90a7013f}, /* int-mic */
12384 			{0x1a, 0x01014020},
12385 			{0x1b, 0x0121401f},
12386 			{0x1c, 0x411111f0},
12387 			{0x1d, 0x411111f0},
12388 			{0x1e, 0x40478e35},
12389 			{}
12390 		},
12391 		.chained = true,
12392 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12393 	},
12394 	[ALC662_FIXUP_CZC_P10T] = {
12395 		.type = HDA_FIXUP_VERBS,
12396 		.v.verbs = (const struct hda_verb[]) {
12397 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12398 			{}
12399 		}
12400 	},
12401 	[ALC662_FIXUP_SKU_IGNORE] = {
12402 		.type = HDA_FIXUP_FUNC,
12403 		.v.func = alc_fixup_sku_ignore,
12404 	},
12405 	[ALC662_FIXUP_HP_RP5800] = {
12406 		.type = HDA_FIXUP_PINS,
12407 		.v.pins = (const struct hda_pintbl[]) {
12408 			{ 0x14, 0x0221201f }, /* HP out */
12409 			{ }
12410 		},
12411 		.chained = true,
12412 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12413 	},
12414 	[ALC662_FIXUP_ASUS_MODE1] = {
12415 		.type = HDA_FIXUP_PINS,
12416 		.v.pins = (const struct hda_pintbl[]) {
12417 			{ 0x14, 0x99130110 }, /* speaker */
12418 			{ 0x18, 0x01a19c20 }, /* mic */
12419 			{ 0x19, 0x99a3092f }, /* int-mic */
12420 			{ 0x21, 0x0121401f }, /* HP out */
12421 			{ }
12422 		},
12423 		.chained = true,
12424 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12425 	},
12426 	[ALC662_FIXUP_ASUS_MODE2] = {
12427 		.type = HDA_FIXUP_PINS,
12428 		.v.pins = (const struct hda_pintbl[]) {
12429 			{ 0x14, 0x99130110 }, /* speaker */
12430 			{ 0x18, 0x01a19820 }, /* mic */
12431 			{ 0x19, 0x99a3092f }, /* int-mic */
12432 			{ 0x1b, 0x0121401f }, /* HP out */
12433 			{ }
12434 		},
12435 		.chained = true,
12436 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12437 	},
12438 	[ALC662_FIXUP_ASUS_MODE3] = {
12439 		.type = HDA_FIXUP_PINS,
12440 		.v.pins = (const struct hda_pintbl[]) {
12441 			{ 0x14, 0x99130110 }, /* speaker */
12442 			{ 0x15, 0x0121441f }, /* HP */
12443 			{ 0x18, 0x01a19840 }, /* mic */
12444 			{ 0x19, 0x99a3094f }, /* int-mic */
12445 			{ 0x21, 0x01211420 }, /* HP2 */
12446 			{ }
12447 		},
12448 		.chained = true,
12449 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12450 	},
12451 	[ALC662_FIXUP_ASUS_MODE4] = {
12452 		.type = HDA_FIXUP_PINS,
12453 		.v.pins = (const struct hda_pintbl[]) {
12454 			{ 0x14, 0x99130110 }, /* speaker */
12455 			{ 0x16, 0x99130111 }, /* speaker */
12456 			{ 0x18, 0x01a19840 }, /* mic */
12457 			{ 0x19, 0x99a3094f }, /* int-mic */
12458 			{ 0x21, 0x0121441f }, /* HP */
12459 			{ }
12460 		},
12461 		.chained = true,
12462 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12463 	},
12464 	[ALC662_FIXUP_ASUS_MODE5] = {
12465 		.type = HDA_FIXUP_PINS,
12466 		.v.pins = (const struct hda_pintbl[]) {
12467 			{ 0x14, 0x99130110 }, /* speaker */
12468 			{ 0x15, 0x0121441f }, /* HP */
12469 			{ 0x16, 0x99130111 }, /* speaker */
12470 			{ 0x18, 0x01a19840 }, /* mic */
12471 			{ 0x19, 0x99a3094f }, /* int-mic */
12472 			{ }
12473 		},
12474 		.chained = true,
12475 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12476 	},
12477 	[ALC662_FIXUP_ASUS_MODE6] = {
12478 		.type = HDA_FIXUP_PINS,
12479 		.v.pins = (const struct hda_pintbl[]) {
12480 			{ 0x14, 0x99130110 }, /* speaker */
12481 			{ 0x15, 0x01211420 }, /* HP2 */
12482 			{ 0x18, 0x01a19840 }, /* mic */
12483 			{ 0x19, 0x99a3094f }, /* int-mic */
12484 			{ 0x1b, 0x0121441f }, /* HP */
12485 			{ }
12486 		},
12487 		.chained = true,
12488 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12489 	},
12490 	[ALC662_FIXUP_ASUS_MODE7] = {
12491 		.type = HDA_FIXUP_PINS,
12492 		.v.pins = (const struct hda_pintbl[]) {
12493 			{ 0x14, 0x99130110 }, /* speaker */
12494 			{ 0x17, 0x99130111 }, /* speaker */
12495 			{ 0x18, 0x01a19840 }, /* mic */
12496 			{ 0x19, 0x99a3094f }, /* int-mic */
12497 			{ 0x1b, 0x01214020 }, /* HP */
12498 			{ 0x21, 0x0121401f }, /* HP */
12499 			{ }
12500 		},
12501 		.chained = true,
12502 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12503 	},
12504 	[ALC662_FIXUP_ASUS_MODE8] = {
12505 		.type = HDA_FIXUP_PINS,
12506 		.v.pins = (const struct hda_pintbl[]) {
12507 			{ 0x14, 0x99130110 }, /* speaker */
12508 			{ 0x12, 0x99a30970 }, /* int-mic */
12509 			{ 0x15, 0x01214020 }, /* HP */
12510 			{ 0x17, 0x99130111 }, /* speaker */
12511 			{ 0x18, 0x01a19840 }, /* mic */
12512 			{ 0x21, 0x0121401f }, /* HP */
12513 			{ }
12514 		},
12515 		.chained = true,
12516 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12517 	},
12518 	[ALC662_FIXUP_NO_JACK_DETECT] = {
12519 		.type = HDA_FIXUP_FUNC,
12520 		.v.func = alc_fixup_no_jack_detect,
12521 	},
12522 	[ALC662_FIXUP_ZOTAC_Z68] = {
12523 		.type = HDA_FIXUP_PINS,
12524 		.v.pins = (const struct hda_pintbl[]) {
12525 			{ 0x1b, 0x02214020 }, /* Front HP */
12526 			{ }
12527 		}
12528 	},
12529 	[ALC662_FIXUP_INV_DMIC] = {
12530 		.type = HDA_FIXUP_FUNC,
12531 		.v.func = alc_fixup_inv_dmic,
12532 	},
12533 	[ALC668_FIXUP_DELL_XPS13] = {
12534 		.type = HDA_FIXUP_FUNC,
12535 		.v.func = alc_fixup_dell_xps13,
12536 		.chained = true,
12537 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
12538 	},
12539 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
12540 		.type = HDA_FIXUP_FUNC,
12541 		.v.func = alc_fixup_disable_aamix,
12542 		.chained = true,
12543 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12544 	},
12545 	[ALC668_FIXUP_AUTO_MUTE] = {
12546 		.type = HDA_FIXUP_FUNC,
12547 		.v.func = alc_fixup_auto_mute_via_amp,
12548 		.chained = true,
12549 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12550 	},
12551 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12552 		.type = HDA_FIXUP_PINS,
12553 		.v.pins = (const struct hda_pintbl[]) {
12554 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12555 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12556 			{ }
12557 		},
12558 		.chained = true,
12559 		.chain_id = ALC662_FIXUP_HEADSET_MODE
12560 	},
12561 	[ALC662_FIXUP_HEADSET_MODE] = {
12562 		.type = HDA_FIXUP_FUNC,
12563 		.v.func = alc_fixup_headset_mode_alc662,
12564 	},
12565 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12566 		.type = HDA_FIXUP_PINS,
12567 		.v.pins = (const struct hda_pintbl[]) {
12568 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12569 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12570 			{ }
12571 		},
12572 		.chained = true,
12573 		.chain_id = ALC668_FIXUP_HEADSET_MODE
12574 	},
12575 	[ALC668_FIXUP_HEADSET_MODE] = {
12576 		.type = HDA_FIXUP_FUNC,
12577 		.v.func = alc_fixup_headset_mode_alc668,
12578 	},
12579 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12580 		.type = HDA_FIXUP_FUNC,
12581 		.v.func = alc_fixup_bass_chmap,
12582 		.chained = true,
12583 		.chain_id = ALC662_FIXUP_ASUS_MODE4
12584 	},
12585 	[ALC662_FIXUP_BASS_16] = {
12586 		.type = HDA_FIXUP_PINS,
12587 		.v.pins = (const struct hda_pintbl[]) {
12588 			{0x16, 0x80106111}, /* bass speaker */
12589 			{}
12590 		},
12591 		.chained = true,
12592 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12593 	},
12594 	[ALC662_FIXUP_BASS_1A] = {
12595 		.type = HDA_FIXUP_PINS,
12596 		.v.pins = (const struct hda_pintbl[]) {
12597 			{0x1a, 0x80106111}, /* bass speaker */
12598 			{}
12599 		},
12600 		.chained = true,
12601 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12602 	},
12603 	[ALC662_FIXUP_BASS_CHMAP] = {
12604 		.type = HDA_FIXUP_FUNC,
12605 		.v.func = alc_fixup_bass_chmap,
12606 	},
12607 	[ALC662_FIXUP_ASUS_Nx50] = {
12608 		.type = HDA_FIXUP_FUNC,
12609 		.v.func = alc_fixup_auto_mute_via_amp,
12610 		.chained = true,
12611 		.chain_id = ALC662_FIXUP_BASS_1A
12612 	},
12613 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12614 		.type = HDA_FIXUP_FUNC,
12615 		.v.func = alc_fixup_headset_mode_alc668,
12616 		.chain_id = ALC662_FIXUP_BASS_CHMAP
12617 	},
12618 	[ALC668_FIXUP_ASUS_Nx51] = {
12619 		.type = HDA_FIXUP_PINS,
12620 		.v.pins = (const struct hda_pintbl[]) {
12621 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12622 			{ 0x1a, 0x90170151 }, /* bass speaker */
12623 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12624 			{}
12625 		},
12626 		.chained = true,
12627 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12628 	},
12629 	[ALC668_FIXUP_MIC_COEF] = {
12630 		.type = HDA_FIXUP_VERBS,
12631 		.v.verbs = (const struct hda_verb[]) {
12632 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12633 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12634 			{}
12635 		},
12636 	},
12637 	[ALC668_FIXUP_ASUS_G751] = {
12638 		.type = HDA_FIXUP_PINS,
12639 		.v.pins = (const struct hda_pintbl[]) {
12640 			{ 0x16, 0x0421101f }, /* HP */
12641 			{}
12642 		},
12643 		.chained = true,
12644 		.chain_id = ALC668_FIXUP_MIC_COEF
12645 	},
12646 	[ALC891_FIXUP_HEADSET_MODE] = {
12647 		.type = HDA_FIXUP_FUNC,
12648 		.v.func = alc_fixup_headset_mode,
12649 	},
12650 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12651 		.type = HDA_FIXUP_PINS,
12652 		.v.pins = (const struct hda_pintbl[]) {
12653 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12654 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12655 			{ }
12656 		},
12657 		.chained = true,
12658 		.chain_id = ALC891_FIXUP_HEADSET_MODE
12659 	},
12660 	[ALC662_FIXUP_ACER_VERITON] = {
12661 		.type = HDA_FIXUP_PINS,
12662 		.v.pins = (const struct hda_pintbl[]) {
12663 			{ 0x15, 0x50170120 }, /* no internal speaker */
12664 			{ }
12665 		}
12666 	},
12667 	[ALC892_FIXUP_ASROCK_MOBO] = {
12668 		.type = HDA_FIXUP_PINS,
12669 		.v.pins = (const struct hda_pintbl[]) {
12670 			{ 0x15, 0x40f000f0 }, /* disabled */
12671 			{ 0x16, 0x40f000f0 }, /* disabled */
12672 			{ }
12673 		}
12674 	},
12675 	[ALC662_FIXUP_USI_FUNC] = {
12676 		.type = HDA_FIXUP_FUNC,
12677 		.v.func = alc662_fixup_usi_headset_mic,
12678 	},
12679 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
12680 		.type = HDA_FIXUP_PINS,
12681 		.v.pins = (const struct hda_pintbl[]) {
12682 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12683 			{ 0x18, 0x01a1903d },
12684 			{ }
12685 		},
12686 		.chained = true,
12687 		.chain_id = ALC662_FIXUP_USI_FUNC
12688 	},
12689 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12690 		.type = HDA_FIXUP_FUNC,
12691 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12692 	},
12693 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12694 		.type = HDA_FIXUP_FUNC,
12695 		.v.func = alc662_fixup_aspire_ethos_hp,
12696 	},
12697 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12698 		.type = HDA_FIXUP_PINS,
12699 		.v.pins = (const struct hda_pintbl[]) {
12700 			{ 0x15, 0x92130110 }, /* front speakers */
12701 			{ 0x18, 0x99130111 }, /* center/subwoofer */
12702 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
12703 			{ }
12704 		},
12705 		.chained = true,
12706 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12707 	},
12708 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
12709 		.type = HDA_FIXUP_FUNC,
12710 		.v.func = alc671_fixup_hp_headset_mic2,
12711 	},
12712 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12713 		.type = HDA_FIXUP_PINS,
12714 		.v.pins = (const struct hda_pintbl[]) {
12715 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12716 			{ }
12717 		},
12718 		.chained = true,
12719 		.chain_id = ALC662_FIXUP_USI_FUNC
12720 	},
12721 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12722 		.type = HDA_FIXUP_PINS,
12723 		.v.pins = (const struct hda_pintbl[]) {
12724 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12725 			{ 0x1b, 0x0221144f },
12726 			{ }
12727 		},
12728 		.chained = true,
12729 		.chain_id = ALC662_FIXUP_USI_FUNC
12730 	},
12731 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12732 		.type = HDA_FIXUP_PINS,
12733 		.v.pins = (const struct hda_pintbl[]) {
12734 			{ 0x1b, 0x04a1112c },
12735 			{ }
12736 		},
12737 		.chained = true,
12738 		.chain_id = ALC668_FIXUP_HEADSET_MIC
12739 	},
12740 	[ALC668_FIXUP_HEADSET_MIC] = {
12741 		.type = HDA_FIXUP_FUNC,
12742 		.v.func = alc269_fixup_headset_mic,
12743 		.chained = true,
12744 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
12745 	},
12746 	[ALC668_FIXUP_MIC_DET_COEF] = {
12747 		.type = HDA_FIXUP_VERBS,
12748 		.v.verbs = (const struct hda_verb[]) {
12749 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12750 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12751 			{}
12752 		},
12753 	},
12754 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12755 		.type = HDA_FIXUP_FUNC,
12756 		.v.func = alc897_fixup_lenovo_headset_mic,
12757 	},
12758 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
12759 		.type = HDA_FIXUP_PINS,
12760 		.v.pins = (const struct hda_pintbl[]) {
12761 			{ 0x1a, 0x03a11050 },
12762 			{ }
12763 		},
12764 		.chained = true,
12765 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12766 	},
12767 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
12768 		.type = HDA_FIXUP_PINS,
12769 		.v.pins = (const struct hda_pintbl[]) {
12770 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12771 			{ }
12772 		},
12773 	},
12774 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12775 		.type = HDA_FIXUP_FUNC,
12776 		.v.func = alc897_fixup_lenovo_headset_mode,
12777 	},
12778 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12779 		.type = HDA_FIXUP_PINS,
12780 		.v.pins = (const struct hda_pintbl[]) {
12781 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12782 			{ }
12783 		},
12784 		.chained = true,
12785 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12786 	},
12787 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
12788 		.type = HDA_FIXUP_VERBS,
12789 		.v.verbs = (const struct hda_verb[]) {
12790 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12791 			{}
12792 		},
12793 	},
12794 	[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12795 		.type = HDA_FIXUP_PINS,
12796 		.v.pins = (const struct hda_pintbl[]) {
12797 			{ 0x19, 0x03a11050 }, /* use as headset mic */
12798 			{ }
12799 		},
12800 	},
12801 };
12802 
12803 static const struct hda_quirk alc662_fixup_tbl[] = {
12804 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12805 	SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12806 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12807 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12808 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12809 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12810 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12811 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12812 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12813 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12814 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12815 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12816 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12817 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12818 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12819 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12820 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12821 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12822 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12823 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12824 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12825 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12826 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12827 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12828 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12829 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12830 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12831 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12832 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12833 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12834 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12835 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12836 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12837 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12838 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12839 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12840 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12841 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12842 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12843 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12844 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12845 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12846 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12847 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12848 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12849 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12850 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12851 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12852 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12853 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12854 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12855 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12856 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12857 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12858 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12859 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12860 	SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12861 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12862 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12863 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12864 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12865 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12866 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12867 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12868 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12869 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12870 
12871 #if 0
12872 	/* Below is a quirk table taken from the old code.
12873 	 * Basically the device should work as is without the fixup table.
12874 	 * If BIOS doesn't give a proper info, enable the corresponding
12875 	 * fixup entry.
12876 	 */
12877 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12878 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12879 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12880 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12881 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12882 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12883 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12884 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12885 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12886 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12887 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12888 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12889 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12890 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12891 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12892 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12893 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12894 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12895 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12896 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12897 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12898 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12899 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12900 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12901 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12902 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12903 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12904 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12905 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12906 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12907 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12908 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12909 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12910 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12911 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12912 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12913 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12914 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12915 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12916 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12917 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12918 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12919 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12920 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12921 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12922 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12923 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12924 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12925 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12926 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12927 #endif
12928 	{}
12929 };
12930 
12931 static const struct hda_model_fixup alc662_fixup_models[] = {
12932 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12933 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12934 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
12935 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12936 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12937 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12938 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12939 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12940 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12941 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12942 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12943 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12944 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12945 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12946 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12947 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12948 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12949 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12950 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12951 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12952 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12953 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12954 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12955 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12956 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12957 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12958 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12959 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12960 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12961 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12962 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12963 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12964 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12965 	{}
12966 };
12967 
12968 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12969 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12970 		{0x17, 0x02211010},
12971 		{0x18, 0x01a19030},
12972 		{0x1a, 0x01813040},
12973 		{0x21, 0x01014020}),
12974 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12975 		{0x16, 0x01813030},
12976 		{0x17, 0x02211010},
12977 		{0x18, 0x01a19040},
12978 		{0x21, 0x01014020}),
12979 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12980 		{0x14, 0x01014010},
12981 		{0x18, 0x01a19020},
12982 		{0x1a, 0x0181302f},
12983 		{0x1b, 0x0221401f}),
12984 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12985 		{0x12, 0x99a30130},
12986 		{0x14, 0x90170110},
12987 		{0x15, 0x0321101f},
12988 		{0x16, 0x03011020}),
12989 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12990 		{0x12, 0x99a30140},
12991 		{0x14, 0x90170110},
12992 		{0x15, 0x0321101f},
12993 		{0x16, 0x03011020}),
12994 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12995 		{0x12, 0x99a30150},
12996 		{0x14, 0x90170110},
12997 		{0x15, 0x0321101f},
12998 		{0x16, 0x03011020}),
12999 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
13000 		{0x14, 0x90170110},
13001 		{0x15, 0x0321101f},
13002 		{0x16, 0x03011020}),
13003 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
13004 		{0x12, 0x90a60130},
13005 		{0x14, 0x90170110},
13006 		{0x15, 0x0321101f}),
13007 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13008 		{0x14, 0x01014010},
13009 		{0x17, 0x90170150},
13010 		{0x19, 0x02a11060},
13011 		{0x1b, 0x01813030},
13012 		{0x21, 0x02211020}),
13013 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13014 		{0x14, 0x01014010},
13015 		{0x18, 0x01a19040},
13016 		{0x1b, 0x01813030},
13017 		{0x21, 0x02211020}),
13018 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13019 		{0x14, 0x01014020},
13020 		{0x17, 0x90170110},
13021 		{0x18, 0x01a19050},
13022 		{0x1b, 0x01813040},
13023 		{0x21, 0x02211030}),
13024 	{}
13025 };
13026 
13027 /*
13028  */
13029 static int patch_alc662(struct hda_codec *codec)
13030 {
13031 	struct alc_spec *spec;
13032 	int err;
13033 
13034 	err = alc_alloc_spec(codec, 0x0b);
13035 	if (err < 0)
13036 		return err;
13037 
13038 	spec = codec->spec;
13039 
13040 	spec->shutup = alc_eapd_shutup;
13041 
13042 	/* handle multiple HPs as is */
13043 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
13044 
13045 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
13046 
13047 	switch (codec->core.vendor_id) {
13048 	case 0x10ec0668:
13049 		spec->init_hook = alc668_restore_default_value;
13050 		break;
13051 	}
13052 
13053 	alc_pre_init(codec);
13054 
13055 	snd_hda_pick_fixup(codec, alc662_fixup_models,
13056 		       alc662_fixup_tbl, alc662_fixups);
13057 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
13058 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
13059 
13060 	alc_auto_parse_customize_define(codec);
13061 
13062 	if (has_cdefine_beep(codec))
13063 		spec->gen.beep_nid = 0x01;
13064 
13065 	if ((alc_get_coef0(codec) & (1 << 14)) &&
13066 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
13067 	    spec->cdefine.platform_type == 1) {
13068 		err = alc_codec_rename(codec, "ALC272X");
13069 		if (err < 0)
13070 			goto error;
13071 	}
13072 
13073 	/* automatic parse from the BIOS config */
13074 	err = alc662_parse_auto_config(codec);
13075 	if (err < 0)
13076 		goto error;
13077 
13078 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
13079 		switch (codec->core.vendor_id) {
13080 		case 0x10ec0662:
13081 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
13082 			break;
13083 		case 0x10ec0272:
13084 		case 0x10ec0663:
13085 		case 0x10ec0665:
13086 		case 0x10ec0668:
13087 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
13088 			break;
13089 		case 0x10ec0273:
13090 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
13091 			break;
13092 		}
13093 		if (err < 0)
13094 			goto error;
13095 	}
13096 
13097 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
13098 
13099 	return 0;
13100 
13101  error:
13102 	alc_free(codec);
13103 	return err;
13104 }
13105 
13106 /*
13107  * ALC680 support
13108  */
13109 
13110 static int alc680_parse_auto_config(struct hda_codec *codec)
13111 {
13112 	return alc_parse_auto_config(codec, NULL, NULL);
13113 }
13114 
13115 /*
13116  */
13117 static int patch_alc680(struct hda_codec *codec)
13118 {
13119 	int err;
13120 
13121 	/* ALC680 has no aa-loopback mixer */
13122 	err = alc_alloc_spec(codec, 0);
13123 	if (err < 0)
13124 		return err;
13125 
13126 	/* automatic parse from the BIOS config */
13127 	err = alc680_parse_auto_config(codec);
13128 	if (err < 0) {
13129 		alc_free(codec);
13130 		return err;
13131 	}
13132 
13133 	return 0;
13134 }
13135 
13136 /*
13137  * patch entries
13138  */
13139 static const struct hda_device_id snd_hda_id_realtek[] = {
13140 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
13141 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
13142 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
13143 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
13144 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
13145 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
13146 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
13147 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
13148 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
13149 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
13150 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
13151 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
13152 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
13153 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
13154 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
13155 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
13156 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
13157 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
13158 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
13159 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
13160 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
13161 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
13162 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
13163 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
13164 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
13165 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
13166 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
13167 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
13168 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
13169 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
13170 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
13171 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
13172 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
13173 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
13174 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
13175 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
13176 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
13177 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
13178 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
13179 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
13180 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
13181 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
13182 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
13183 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
13184 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
13185 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
13186 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
13187 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
13188 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
13189 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
13190 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
13191 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
13192 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
13193 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
13194 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
13195 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
13196 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
13197 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
13198 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
13199 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
13200 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
13201 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
13202 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
13203 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
13204 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
13205 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
13206 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
13207 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
13208 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
13209 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
13210 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
13211 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
13212 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
13213 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
13214 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
13215 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
13216 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
13217 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
13218 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
13219 	{} /* terminator */
13220 };
13221 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
13222 
13223 MODULE_LICENSE("GPL");
13224 MODULE_DESCRIPTION("Realtek HD-audio codec");
13225 MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT);
13226 
13227 static struct hda_codec_driver realtek_driver = {
13228 	.id = snd_hda_id_realtek,
13229 };
13230 
13231 module_hda_codec_driver(realtek_driver);
13232