xref: /linux/sound/pci/hda/patch_realtek.c (revision c94cd9508b1335b949fd13ebd269313c65492df0)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Universal Interface for Intel High Definition Audio Codec
4  *
5  * HD audio interface patch for Realtek ALC codecs
6  *
7  * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8  *                    PeiSen Hou <pshou@realtek.com.tw>
9  *                    Takashi Iwai <tiwai@suse.de>
10  *                    Jonathan Woithe <jwoithe@just42.net>
11  */
12 
13 #include <linux/acpi.h>
14 #include <linux/cleanup.h>
15 #include <linux/init.h>
16 #include <linux/delay.h>
17 #include <linux/slab.h>
18 #include <linux/pci.h>
19 #include <linux/dmi.h>
20 #include <linux/module.h>
21 #include <linux/i2c.h>
22 #include <linux/input.h>
23 #include <linux/leds.h>
24 #include <linux/ctype.h>
25 #include <linux/spi/spi.h>
26 #include <sound/core.h>
27 #include <sound/jack.h>
28 #include <sound/hda_codec.h>
29 #include "hda_local.h"
30 #include "hda_auto_parser.h"
31 #include "hda_jack.h"
32 #include "hda_generic.h"
33 #include "hda_component.h"
34 
35 /* keep halting ALC5505 DSP, for power saving */
36 #define HALT_REALTEK_ALC5505
37 
38 /* extra amp-initialization sequence types */
39 enum {
40 	ALC_INIT_UNDEFINED,
41 	ALC_INIT_NONE,
42 	ALC_INIT_DEFAULT,
43 };
44 
45 enum {
46 	ALC_HEADSET_MODE_UNKNOWN,
47 	ALC_HEADSET_MODE_UNPLUGGED,
48 	ALC_HEADSET_MODE_HEADSET,
49 	ALC_HEADSET_MODE_MIC,
50 	ALC_HEADSET_MODE_HEADPHONE,
51 };
52 
53 enum {
54 	ALC_HEADSET_TYPE_UNKNOWN,
55 	ALC_HEADSET_TYPE_CTIA,
56 	ALC_HEADSET_TYPE_OMTP,
57 };
58 
59 enum {
60 	ALC_KEY_MICMUTE_INDEX,
61 };
62 
63 struct alc_customize_define {
64 	unsigned int  sku_cfg;
65 	unsigned char port_connectivity;
66 	unsigned char check_sum;
67 	unsigned char customization;
68 	unsigned char external_amp;
69 	unsigned int  enable_pcbeep:1;
70 	unsigned int  platform_type:1;
71 	unsigned int  swap:1;
72 	unsigned int  override:1;
73 	unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
74 };
75 
76 struct alc_coef_led {
77 	unsigned int idx;
78 	unsigned int mask;
79 	unsigned int on;
80 	unsigned int off;
81 };
82 
83 struct alc_spec {
84 	struct hda_gen_spec gen; /* must be at head */
85 
86 	/* codec parameterization */
87 	struct alc_customize_define cdefine;
88 	unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
89 
90 	/* GPIO bits */
91 	unsigned int gpio_mask;
92 	unsigned int gpio_dir;
93 	unsigned int gpio_data;
94 	bool gpio_write_delay;	/* add a delay before writing gpio_data */
95 
96 	/* mute LED for HP laptops, see vref_mute_led_set() */
97 	int mute_led_polarity;
98 	int micmute_led_polarity;
99 	hda_nid_t mute_led_nid;
100 	hda_nid_t cap_mute_led_nid;
101 
102 	unsigned int gpio_mute_led_mask;
103 	unsigned int gpio_mic_led_mask;
104 	struct alc_coef_led mute_led_coef;
105 	struct alc_coef_led mic_led_coef;
106 	struct mutex coef_mutex;
107 
108 	hda_nid_t headset_mic_pin;
109 	hda_nid_t headphone_mic_pin;
110 	int current_headset_mode;
111 	int current_headset_type;
112 
113 	/* hooks */
114 	void (*init_hook)(struct hda_codec *codec);
115 	void (*power_hook)(struct hda_codec *codec);
116 	void (*shutup)(struct hda_codec *codec);
117 
118 	int init_amp;
119 	int codec_variant;	/* flag for other variants */
120 	unsigned int has_alc5505_dsp:1;
121 	unsigned int no_depop_delay:1;
122 	unsigned int done_hp_init:1;
123 	unsigned int no_shutup_pins:1;
124 	unsigned int ultra_low_power:1;
125 	unsigned int has_hs_key:1;
126 	unsigned int no_internal_mic_pin:1;
127 	unsigned int en_3kpull_low:1;
128 	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 0x19e58326:
591 	case 0x10ec0283:
592 	case 0x10ec0285:
593 	case 0x10ec0286:
594 	case 0x10ec0287:
595 	case 0x10ec0288:
596 	case 0x10ec0295:
597 	case 0x10ec0298:
598 		alc_headset_mic_no_shutup(codec);
599 		break;
600 	default:
601 		if (!spec->no_shutup_pins)
602 			snd_hda_shutup_pins(codec);
603 		break;
604 	}
605 }
606 
607 /* generic shutup callback;
608  * just turning off EAPD and a little pause for avoiding pop-noise
609  */
610 static void alc_eapd_shutup(struct hda_codec *codec)
611 {
612 	struct alc_spec *spec = codec->spec;
613 
614 	alc_auto_setup_eapd(codec, false);
615 	if (!spec->no_depop_delay)
616 		msleep(200);
617 	alc_shutup_pins(codec);
618 }
619 
620 /* generic EAPD initialization */
621 static void alc_auto_init_amp(struct hda_codec *codec, int type)
622 {
623 	alc_auto_setup_eapd(codec, true);
624 	alc_write_gpio(codec);
625 	switch (type) {
626 	case ALC_INIT_DEFAULT:
627 		switch (codec->core.vendor_id) {
628 		case 0x10ec0260:
629 			alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
630 			break;
631 		case 0x10ec0880:
632 		case 0x10ec0882:
633 		case 0x10ec0883:
634 		case 0x10ec0885:
635 			alc_update_coef_idx(codec, 7, 0, 0x2030);
636 			break;
637 		case 0x10ec0888:
638 			alc888_coef_init(codec);
639 			break;
640 		}
641 		break;
642 	}
643 }
644 
645 /* get a primary headphone pin if available */
646 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
647 {
648 	if (spec->gen.autocfg.hp_pins[0])
649 		return spec->gen.autocfg.hp_pins[0];
650 	if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
651 		return spec->gen.autocfg.line_out_pins[0];
652 	return 0;
653 }
654 
655 /*
656  * Realtek SSID verification
657  */
658 
659 /* Could be any non-zero and even value. When used as fixup, tells
660  * the driver to ignore any present sku defines.
661  */
662 #define ALC_FIXUP_SKU_IGNORE (2)
663 
664 static void alc_fixup_sku_ignore(struct hda_codec *codec,
665 				 const struct hda_fixup *fix, int action)
666 {
667 	struct alc_spec *spec = codec->spec;
668 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
669 		spec->cdefine.fixup = 1;
670 		spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
671 	}
672 }
673 
674 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
675 				    const struct hda_fixup *fix, int action)
676 {
677 	struct alc_spec *spec = codec->spec;
678 
679 	if (action == HDA_FIXUP_ACT_PROBE) {
680 		spec->no_depop_delay = 1;
681 		codec->depop_delay = 0;
682 	}
683 }
684 
685 static int alc_auto_parse_customize_define(struct hda_codec *codec)
686 {
687 	unsigned int ass, tmp, i;
688 	unsigned nid = 0;
689 	struct alc_spec *spec = codec->spec;
690 
691 	spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
692 
693 	if (spec->cdefine.fixup) {
694 		ass = spec->cdefine.sku_cfg;
695 		if (ass == ALC_FIXUP_SKU_IGNORE)
696 			return -1;
697 		goto do_sku;
698 	}
699 
700 	if (!codec->bus->pci)
701 		return -1;
702 	ass = codec->core.subsystem_id & 0xffff;
703 	if (ass != codec->bus->pci->subsystem_device && (ass & 1))
704 		goto do_sku;
705 
706 	nid = 0x1d;
707 	if (codec->core.vendor_id == 0x10ec0260)
708 		nid = 0x17;
709 	ass = snd_hda_codec_get_pincfg(codec, nid);
710 
711 	if (!(ass & 1)) {
712 		codec_info(codec, "%s: SKU not ready 0x%08x\n",
713 			   codec->core.chip_name, ass);
714 		return -1;
715 	}
716 
717 	/* check sum */
718 	tmp = 0;
719 	for (i = 1; i < 16; i++) {
720 		if ((ass >> i) & 1)
721 			tmp++;
722 	}
723 	if (((ass >> 16) & 0xf) != tmp)
724 		return -1;
725 
726 	spec->cdefine.port_connectivity = ass >> 30;
727 	spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
728 	spec->cdefine.check_sum = (ass >> 16) & 0xf;
729 	spec->cdefine.customization = ass >> 8;
730 do_sku:
731 	spec->cdefine.sku_cfg = ass;
732 	spec->cdefine.external_amp = (ass & 0x38) >> 3;
733 	spec->cdefine.platform_type = (ass & 0x4) >> 2;
734 	spec->cdefine.swap = (ass & 0x2) >> 1;
735 	spec->cdefine.override = ass & 0x1;
736 
737 	codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
738 		   nid, spec->cdefine.sku_cfg);
739 	codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
740 		   spec->cdefine.port_connectivity);
741 	codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
742 	codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
743 	codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
744 	codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
745 	codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
746 	codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
747 	codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
748 
749 	return 0;
750 }
751 
752 /* return the position of NID in the list, or -1 if not found */
753 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
754 {
755 	int i;
756 	for (i = 0; i < nums; i++)
757 		if (list[i] == nid)
758 			return i;
759 	return -1;
760 }
761 /* return true if the given NID is found in the list */
762 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
763 {
764 	return find_idx_in_nid_list(nid, list, nums) >= 0;
765 }
766 
767 /* check subsystem ID and set up device-specific initialization;
768  * return 1 if initialized, 0 if invalid SSID
769  */
770 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
771  *	31 ~ 16 :	Manufacture ID
772  *	15 ~ 8	:	SKU ID
773  *	7  ~ 0	:	Assembly ID
774  *	port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
775  */
776 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
777 {
778 	unsigned int ass, tmp, i;
779 	unsigned nid;
780 	struct alc_spec *spec = codec->spec;
781 
782 	if (spec->cdefine.fixup) {
783 		ass = spec->cdefine.sku_cfg;
784 		if (ass == ALC_FIXUP_SKU_IGNORE)
785 			return 0;
786 		goto do_sku;
787 	}
788 
789 	ass = codec->core.subsystem_id & 0xffff;
790 	if (codec->bus->pci &&
791 	    ass != codec->bus->pci->subsystem_device && (ass & 1))
792 		goto do_sku;
793 
794 	/* invalid SSID, check the special NID pin defcfg instead */
795 	/*
796 	 * 31~30	: port connectivity
797 	 * 29~21	: reserve
798 	 * 20		: PCBEEP input
799 	 * 19~16	: Check sum (15:1)
800 	 * 15~1		: Custom
801 	 * 0		: override
802 	*/
803 	nid = 0x1d;
804 	if (codec->core.vendor_id == 0x10ec0260)
805 		nid = 0x17;
806 	ass = snd_hda_codec_get_pincfg(codec, nid);
807 	codec_dbg(codec,
808 		  "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
809 		   ass, nid);
810 	if (!(ass & 1))
811 		return 0;
812 	if ((ass >> 30) != 1)	/* no physical connection */
813 		return 0;
814 
815 	/* check sum */
816 	tmp = 0;
817 	for (i = 1; i < 16; i++) {
818 		if ((ass >> i) & 1)
819 			tmp++;
820 	}
821 	if (((ass >> 16) & 0xf) != tmp)
822 		return 0;
823 do_sku:
824 	codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
825 		   ass & 0xffff, codec->core.vendor_id);
826 	/*
827 	 * 0 : override
828 	 * 1 :	Swap Jack
829 	 * 2 : 0 --> Desktop, 1 --> Laptop
830 	 * 3~5 : External Amplifier control
831 	 * 7~6 : Reserved
832 	*/
833 	tmp = (ass & 0x38) >> 3;	/* external Amp control */
834 	if (spec->init_amp == ALC_INIT_UNDEFINED) {
835 		switch (tmp) {
836 		case 1:
837 			alc_setup_gpio(codec, 0x01);
838 			break;
839 		case 3:
840 			alc_setup_gpio(codec, 0x02);
841 			break;
842 		case 7:
843 			alc_setup_gpio(codec, 0x04);
844 			break;
845 		case 5:
846 		default:
847 			spec->init_amp = ALC_INIT_DEFAULT;
848 			break;
849 		}
850 	}
851 
852 	/* is laptop or Desktop and enable the function "Mute internal speaker
853 	 * when the external headphone out jack is plugged"
854 	 */
855 	if (!(ass & 0x8000))
856 		return 1;
857 	/*
858 	 * 10~8 : Jack location
859 	 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
860 	 * 14~13: Resvered
861 	 * 15   : 1 --> enable the function "Mute internal speaker
862 	 *	        when the external headphone out jack is plugged"
863 	 */
864 	if (!alc_get_hp_pin(spec)) {
865 		hda_nid_t nid;
866 		tmp = (ass >> 11) & 0x3;	/* HP to chassis */
867 		nid = ports[tmp];
868 		if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
869 				      spec->gen.autocfg.line_outs))
870 			return 1;
871 		spec->gen.autocfg.hp_pins[0] = nid;
872 	}
873 	return 1;
874 }
875 
876 /* Check the validity of ALC subsystem-id
877  * ports contains an array of 4 pin NIDs for port-A, E, D and I */
878 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
879 {
880 	if (!alc_subsystem_id(codec, ports)) {
881 		struct alc_spec *spec = codec->spec;
882 		if (spec->init_amp == ALC_INIT_UNDEFINED) {
883 			codec_dbg(codec,
884 				  "realtek: Enable default setup for auto mode as fallback\n");
885 			spec->init_amp = ALC_INIT_DEFAULT;
886 		}
887 	}
888 }
889 
890 /*
891  */
892 
893 static void alc_fixup_inv_dmic(struct hda_codec *codec,
894 			       const struct hda_fixup *fix, int action)
895 {
896 	struct alc_spec *spec = codec->spec;
897 
898 	spec->gen.inv_dmic_split = 1;
899 }
900 
901 
902 static int alc_build_controls(struct hda_codec *codec)
903 {
904 	int err;
905 
906 	err = snd_hda_gen_build_controls(codec);
907 	if (err < 0)
908 		return err;
909 
910 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
911 	return 0;
912 }
913 
914 
915 /*
916  * Common callbacks
917  */
918 
919 static void alc_pre_init(struct hda_codec *codec)
920 {
921 	alc_fill_eapd_coef(codec);
922 }
923 
924 #define is_s3_resume(codec) \
925 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
926 #define is_s4_resume(codec) \
927 	((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
928 #define is_s4_suspend(codec) \
929 	((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
930 
931 static int alc_init(struct hda_codec *codec)
932 {
933 	struct alc_spec *spec = codec->spec;
934 
935 	/* hibernation resume needs the full chip initialization */
936 	if (is_s4_resume(codec))
937 		alc_pre_init(codec);
938 
939 	if (spec->init_hook)
940 		spec->init_hook(codec);
941 
942 	spec->gen.skip_verbs = 1; /* applied in below */
943 	snd_hda_gen_init(codec);
944 	alc_fix_pll(codec);
945 	alc_auto_init_amp(codec, spec->init_amp);
946 	snd_hda_apply_verbs(codec); /* apply verbs here after own init */
947 
948 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
949 
950 	return 0;
951 }
952 
953 /* forward declaration */
954 static const struct component_master_ops comp_master_ops;
955 
956 static void alc_free(struct hda_codec *codec)
957 {
958 	struct alc_spec *spec = codec->spec;
959 
960 	if (spec)
961 		hda_component_manager_free(&spec->comps, &comp_master_ops);
962 
963 	snd_hda_gen_free(codec);
964 }
965 
966 static inline void alc_shutup(struct hda_codec *codec)
967 {
968 	struct alc_spec *spec = codec->spec;
969 
970 	if (!snd_hda_get_bool_hint(codec, "shutup"))
971 		return; /* disabled explicitly by hints */
972 
973 	if (spec && spec->shutup)
974 		spec->shutup(codec);
975 	else
976 		alc_shutup_pins(codec);
977 }
978 
979 static void alc_power_eapd(struct hda_codec *codec)
980 {
981 	alc_auto_setup_eapd(codec, false);
982 }
983 
984 static int alc_suspend(struct hda_codec *codec)
985 {
986 	struct alc_spec *spec = codec->spec;
987 	alc_shutup(codec);
988 	if (spec && spec->power_hook)
989 		spec->power_hook(codec);
990 	return 0;
991 }
992 
993 static int alc_resume(struct hda_codec *codec)
994 {
995 	struct alc_spec *spec = codec->spec;
996 
997 	if (!spec->no_depop_delay)
998 		msleep(150); /* to avoid pop noise */
999 	codec->patch_ops.init(codec);
1000 	snd_hda_regmap_sync(codec);
1001 	hda_call_check_power_status(codec, 0x01);
1002 	return 0;
1003 }
1004 
1005 /*
1006  */
1007 static const struct hda_codec_ops alc_patch_ops = {
1008 	.build_controls = alc_build_controls,
1009 	.build_pcms = snd_hda_gen_build_pcms,
1010 	.init = alc_init,
1011 	.free = alc_free,
1012 	.unsol_event = snd_hda_jack_unsol_event,
1013 	.resume = alc_resume,
1014 	.suspend = alc_suspend,
1015 	.check_power_status = snd_hda_gen_check_power_status,
1016 };
1017 
1018 
1019 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1020 
1021 /*
1022  * Rename codecs appropriately from COEF value or subvendor id
1023  */
1024 struct alc_codec_rename_table {
1025 	unsigned int vendor_id;
1026 	unsigned short coef_mask;
1027 	unsigned short coef_bits;
1028 	const char *name;
1029 };
1030 
1031 struct alc_codec_rename_pci_table {
1032 	unsigned int codec_vendor_id;
1033 	unsigned short pci_subvendor;
1034 	unsigned short pci_subdevice;
1035 	const char *name;
1036 };
1037 
1038 static const struct alc_codec_rename_table rename_tbl[] = {
1039 	{ 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1040 	{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1041 	{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1042 	{ 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1043 	{ 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1044 	{ 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1045 	{ 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1046 	{ 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1047 	{ 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1048 	{ 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1049 	{ 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1050 	{ 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1051 	{ 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1052 	{ 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1053 	{ 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1054 	{ 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1055 	{ 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1056 	{ } /* terminator */
1057 };
1058 
1059 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1060 	{ 0x10ec0280, 0x1028, 0, "ALC3220" },
1061 	{ 0x10ec0282, 0x1028, 0, "ALC3221" },
1062 	{ 0x10ec0283, 0x1028, 0, "ALC3223" },
1063 	{ 0x10ec0288, 0x1028, 0, "ALC3263" },
1064 	{ 0x10ec0292, 0x1028, 0, "ALC3226" },
1065 	{ 0x10ec0293, 0x1028, 0, "ALC3235" },
1066 	{ 0x10ec0255, 0x1028, 0, "ALC3234" },
1067 	{ 0x10ec0668, 0x1028, 0, "ALC3661" },
1068 	{ 0x10ec0275, 0x1028, 0, "ALC3260" },
1069 	{ 0x10ec0899, 0x1028, 0, "ALC3861" },
1070 	{ 0x10ec0298, 0x1028, 0, "ALC3266" },
1071 	{ 0x10ec0236, 0x1028, 0, "ALC3204" },
1072 	{ 0x10ec0256, 0x1028, 0, "ALC3246" },
1073 	{ 0x10ec0225, 0x1028, 0, "ALC3253" },
1074 	{ 0x10ec0295, 0x1028, 0, "ALC3254" },
1075 	{ 0x10ec0299, 0x1028, 0, "ALC3271" },
1076 	{ 0x10ec0670, 0x1025, 0, "ALC669X" },
1077 	{ 0x10ec0676, 0x1025, 0, "ALC679X" },
1078 	{ 0x10ec0282, 0x1043, 0, "ALC3229" },
1079 	{ 0x10ec0233, 0x1043, 0, "ALC3236" },
1080 	{ 0x10ec0280, 0x103c, 0, "ALC3228" },
1081 	{ 0x10ec0282, 0x103c, 0, "ALC3227" },
1082 	{ 0x10ec0286, 0x103c, 0, "ALC3242" },
1083 	{ 0x10ec0290, 0x103c, 0, "ALC3241" },
1084 	{ 0x10ec0668, 0x103c, 0, "ALC3662" },
1085 	{ 0x10ec0283, 0x17aa, 0, "ALC3239" },
1086 	{ 0x10ec0292, 0x17aa, 0, "ALC3232" },
1087 	{ } /* terminator */
1088 };
1089 
1090 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1091 {
1092 	const struct alc_codec_rename_table *p;
1093 	const struct alc_codec_rename_pci_table *q;
1094 
1095 	for (p = rename_tbl; p->vendor_id; p++) {
1096 		if (p->vendor_id != codec->core.vendor_id)
1097 			continue;
1098 		if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1099 			return alc_codec_rename(codec, p->name);
1100 	}
1101 
1102 	if (!codec->bus->pci)
1103 		return 0;
1104 	for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1105 		if (q->codec_vendor_id != codec->core.vendor_id)
1106 			continue;
1107 		if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1108 			continue;
1109 		if (!q->pci_subdevice ||
1110 		    q->pci_subdevice == codec->bus->pci->subsystem_device)
1111 			return alc_codec_rename(codec, q->name);
1112 	}
1113 
1114 	return 0;
1115 }
1116 
1117 
1118 /*
1119  * Digital-beep handlers
1120  */
1121 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1122 
1123 /* additional beep mixers; private_value will be overwritten */
1124 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1125 	HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1126 	HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1127 };
1128 
1129 /* set up and create beep controls */
1130 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1131 			int idx, int dir)
1132 {
1133 	struct snd_kcontrol_new *knew;
1134 	unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1135 	int i;
1136 
1137 	for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1138 		knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1139 					    &alc_beep_mixer[i]);
1140 		if (!knew)
1141 			return -ENOMEM;
1142 		knew->private_value = beep_amp;
1143 	}
1144 	return 0;
1145 }
1146 
1147 static const struct snd_pci_quirk beep_allow_list[] = {
1148 	SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1149 	SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1150 	SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1151 	SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1152 	SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1153 	SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1154 	SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1155 	SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1156 	SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1157 	/* denylist -- no beep available */
1158 	SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1159 	SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1160 	{}
1161 };
1162 
1163 static inline int has_cdefine_beep(struct hda_codec *codec)
1164 {
1165 	struct alc_spec *spec = codec->spec;
1166 	const struct snd_pci_quirk *q;
1167 	q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1168 	if (q)
1169 		return q->value;
1170 	return spec->cdefine.enable_pcbeep;
1171 }
1172 #else
1173 #define set_beep_amp(spec, nid, idx, dir)	0
1174 #define has_cdefine_beep(codec)		0
1175 #endif
1176 
1177 /* parse the BIOS configuration and set up the alc_spec */
1178 /* return 1 if successful, 0 if the proper config is not found,
1179  * or a negative error code
1180  */
1181 static int alc_parse_auto_config(struct hda_codec *codec,
1182 				 const hda_nid_t *ignore_nids,
1183 				 const hda_nid_t *ssid_nids)
1184 {
1185 	struct alc_spec *spec = codec->spec;
1186 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1187 	int err;
1188 
1189 	err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1190 				       spec->parse_flags);
1191 	if (err < 0)
1192 		return err;
1193 
1194 	if (ssid_nids)
1195 		alc_ssid_check(codec, ssid_nids);
1196 
1197 	err = snd_hda_gen_parse_auto_config(codec, cfg);
1198 	if (err < 0)
1199 		return err;
1200 
1201 	return 1;
1202 }
1203 
1204 /* common preparation job for alc_spec */
1205 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1206 {
1207 	struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1208 	int err;
1209 
1210 	if (!spec)
1211 		return -ENOMEM;
1212 	codec->spec = spec;
1213 	snd_hda_gen_spec_init(&spec->gen);
1214 	spec->gen.mixer_nid = mixer_nid;
1215 	spec->gen.own_eapd_ctl = 1;
1216 	codec->single_adc_amp = 1;
1217 	/* FIXME: do we need this for all Realtek codec models? */
1218 	codec->spdif_status_reset = 1;
1219 	codec->forced_resume = 1;
1220 	codec->patch_ops = alc_patch_ops;
1221 	mutex_init(&spec->coef_mutex);
1222 
1223 	err = alc_codec_rename_from_preset(codec);
1224 	if (err < 0) {
1225 		kfree(spec);
1226 		return err;
1227 	}
1228 	return 0;
1229 }
1230 
1231 static int alc880_parse_auto_config(struct hda_codec *codec)
1232 {
1233 	static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1234 	static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1235 	return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1236 }
1237 
1238 /*
1239  * ALC880 fix-ups
1240  */
1241 enum {
1242 	ALC880_FIXUP_GPIO1,
1243 	ALC880_FIXUP_GPIO2,
1244 	ALC880_FIXUP_MEDION_RIM,
1245 	ALC880_FIXUP_LG,
1246 	ALC880_FIXUP_LG_LW25,
1247 	ALC880_FIXUP_W810,
1248 	ALC880_FIXUP_EAPD_COEF,
1249 	ALC880_FIXUP_TCL_S700,
1250 	ALC880_FIXUP_VOL_KNOB,
1251 	ALC880_FIXUP_FUJITSU,
1252 	ALC880_FIXUP_F1734,
1253 	ALC880_FIXUP_UNIWILL,
1254 	ALC880_FIXUP_UNIWILL_DIG,
1255 	ALC880_FIXUP_Z71V,
1256 	ALC880_FIXUP_ASUS_W5A,
1257 	ALC880_FIXUP_3ST_BASE,
1258 	ALC880_FIXUP_3ST,
1259 	ALC880_FIXUP_3ST_DIG,
1260 	ALC880_FIXUP_5ST_BASE,
1261 	ALC880_FIXUP_5ST,
1262 	ALC880_FIXUP_5ST_DIG,
1263 	ALC880_FIXUP_6ST_BASE,
1264 	ALC880_FIXUP_6ST,
1265 	ALC880_FIXUP_6ST_DIG,
1266 	ALC880_FIXUP_6ST_AUTOMUTE,
1267 };
1268 
1269 /* enable the volume-knob widget support on NID 0x21 */
1270 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1271 				  const struct hda_fixup *fix, int action)
1272 {
1273 	if (action == HDA_FIXUP_ACT_PROBE)
1274 		snd_hda_jack_detect_enable_callback(codec, 0x21,
1275 						    alc_update_knob_master);
1276 }
1277 
1278 static const struct hda_fixup alc880_fixups[] = {
1279 	[ALC880_FIXUP_GPIO1] = {
1280 		.type = HDA_FIXUP_FUNC,
1281 		.v.func = alc_fixup_gpio1,
1282 	},
1283 	[ALC880_FIXUP_GPIO2] = {
1284 		.type = HDA_FIXUP_FUNC,
1285 		.v.func = alc_fixup_gpio2,
1286 	},
1287 	[ALC880_FIXUP_MEDION_RIM] = {
1288 		.type = HDA_FIXUP_VERBS,
1289 		.v.verbs = (const struct hda_verb[]) {
1290 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1291 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1292 			{ }
1293 		},
1294 		.chained = true,
1295 		.chain_id = ALC880_FIXUP_GPIO2,
1296 	},
1297 	[ALC880_FIXUP_LG] = {
1298 		.type = HDA_FIXUP_PINS,
1299 		.v.pins = (const struct hda_pintbl[]) {
1300 			/* disable bogus unused pins */
1301 			{ 0x16, 0x411111f0 },
1302 			{ 0x18, 0x411111f0 },
1303 			{ 0x1a, 0x411111f0 },
1304 			{ }
1305 		}
1306 	},
1307 	[ALC880_FIXUP_LG_LW25] = {
1308 		.type = HDA_FIXUP_PINS,
1309 		.v.pins = (const struct hda_pintbl[]) {
1310 			{ 0x1a, 0x0181344f }, /* line-in */
1311 			{ 0x1b, 0x0321403f }, /* headphone */
1312 			{ }
1313 		}
1314 	},
1315 	[ALC880_FIXUP_W810] = {
1316 		.type = HDA_FIXUP_PINS,
1317 		.v.pins = (const struct hda_pintbl[]) {
1318 			/* disable bogus unused pins */
1319 			{ 0x17, 0x411111f0 },
1320 			{ }
1321 		},
1322 		.chained = true,
1323 		.chain_id = ALC880_FIXUP_GPIO2,
1324 	},
1325 	[ALC880_FIXUP_EAPD_COEF] = {
1326 		.type = HDA_FIXUP_VERBS,
1327 		.v.verbs = (const struct hda_verb[]) {
1328 			/* change to EAPD mode */
1329 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1330 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3060 },
1331 			{}
1332 		},
1333 	},
1334 	[ALC880_FIXUP_TCL_S700] = {
1335 		.type = HDA_FIXUP_VERBS,
1336 		.v.verbs = (const struct hda_verb[]) {
1337 			/* change to EAPD mode */
1338 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1339 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x3070 },
1340 			{}
1341 		},
1342 		.chained = true,
1343 		.chain_id = ALC880_FIXUP_GPIO2,
1344 	},
1345 	[ALC880_FIXUP_VOL_KNOB] = {
1346 		.type = HDA_FIXUP_FUNC,
1347 		.v.func = alc880_fixup_vol_knob,
1348 	},
1349 	[ALC880_FIXUP_FUJITSU] = {
1350 		/* override all pins as BIOS on old Amilo is broken */
1351 		.type = HDA_FIXUP_PINS,
1352 		.v.pins = (const struct hda_pintbl[]) {
1353 			{ 0x14, 0x0121401f }, /* HP */
1354 			{ 0x15, 0x99030120 }, /* speaker */
1355 			{ 0x16, 0x99030130 }, /* bass speaker */
1356 			{ 0x17, 0x411111f0 }, /* N/A */
1357 			{ 0x18, 0x411111f0 }, /* N/A */
1358 			{ 0x19, 0x01a19950 }, /* mic-in */
1359 			{ 0x1a, 0x411111f0 }, /* N/A */
1360 			{ 0x1b, 0x411111f0 }, /* N/A */
1361 			{ 0x1c, 0x411111f0 }, /* N/A */
1362 			{ 0x1d, 0x411111f0 }, /* N/A */
1363 			{ 0x1e, 0x01454140 }, /* SPDIF out */
1364 			{ }
1365 		},
1366 		.chained = true,
1367 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1368 	},
1369 	[ALC880_FIXUP_F1734] = {
1370 		/* almost compatible with FUJITSU, but no bass and SPDIF */
1371 		.type = HDA_FIXUP_PINS,
1372 		.v.pins = (const struct hda_pintbl[]) {
1373 			{ 0x14, 0x0121401f }, /* HP */
1374 			{ 0x15, 0x99030120 }, /* speaker */
1375 			{ 0x16, 0x411111f0 }, /* N/A */
1376 			{ 0x17, 0x411111f0 }, /* N/A */
1377 			{ 0x18, 0x411111f0 }, /* N/A */
1378 			{ 0x19, 0x01a19950 }, /* mic-in */
1379 			{ 0x1a, 0x411111f0 }, /* N/A */
1380 			{ 0x1b, 0x411111f0 }, /* N/A */
1381 			{ 0x1c, 0x411111f0 }, /* N/A */
1382 			{ 0x1d, 0x411111f0 }, /* N/A */
1383 			{ 0x1e, 0x411111f0 }, /* N/A */
1384 			{ }
1385 		},
1386 		.chained = true,
1387 		.chain_id = ALC880_FIXUP_VOL_KNOB,
1388 	},
1389 	[ALC880_FIXUP_UNIWILL] = {
1390 		/* need to fix HP and speaker pins to be parsed correctly */
1391 		.type = HDA_FIXUP_PINS,
1392 		.v.pins = (const struct hda_pintbl[]) {
1393 			{ 0x14, 0x0121411f }, /* HP */
1394 			{ 0x15, 0x99030120 }, /* speaker */
1395 			{ 0x16, 0x99030130 }, /* bass speaker */
1396 			{ }
1397 		},
1398 	},
1399 	[ALC880_FIXUP_UNIWILL_DIG] = {
1400 		.type = HDA_FIXUP_PINS,
1401 		.v.pins = (const struct hda_pintbl[]) {
1402 			/* disable bogus unused pins */
1403 			{ 0x17, 0x411111f0 },
1404 			{ 0x19, 0x411111f0 },
1405 			{ 0x1b, 0x411111f0 },
1406 			{ 0x1f, 0x411111f0 },
1407 			{ }
1408 		}
1409 	},
1410 	[ALC880_FIXUP_Z71V] = {
1411 		.type = HDA_FIXUP_PINS,
1412 		.v.pins = (const struct hda_pintbl[]) {
1413 			/* set up the whole pins as BIOS is utterly broken */
1414 			{ 0x14, 0x99030120 }, /* speaker */
1415 			{ 0x15, 0x0121411f }, /* HP */
1416 			{ 0x16, 0x411111f0 }, /* N/A */
1417 			{ 0x17, 0x411111f0 }, /* N/A */
1418 			{ 0x18, 0x01a19950 }, /* mic-in */
1419 			{ 0x19, 0x411111f0 }, /* N/A */
1420 			{ 0x1a, 0x01813031 }, /* line-in */
1421 			{ 0x1b, 0x411111f0 }, /* N/A */
1422 			{ 0x1c, 0x411111f0 }, /* N/A */
1423 			{ 0x1d, 0x411111f0 }, /* N/A */
1424 			{ 0x1e, 0x0144111e }, /* SPDIF */
1425 			{ }
1426 		}
1427 	},
1428 	[ALC880_FIXUP_ASUS_W5A] = {
1429 		.type = HDA_FIXUP_PINS,
1430 		.v.pins = (const struct hda_pintbl[]) {
1431 			/* set up the whole pins as BIOS is utterly broken */
1432 			{ 0x14, 0x0121411f }, /* HP */
1433 			{ 0x15, 0x411111f0 }, /* N/A */
1434 			{ 0x16, 0x411111f0 }, /* N/A */
1435 			{ 0x17, 0x411111f0 }, /* N/A */
1436 			{ 0x18, 0x90a60160 }, /* mic */
1437 			{ 0x19, 0x411111f0 }, /* N/A */
1438 			{ 0x1a, 0x411111f0 }, /* N/A */
1439 			{ 0x1b, 0x411111f0 }, /* N/A */
1440 			{ 0x1c, 0x411111f0 }, /* N/A */
1441 			{ 0x1d, 0x411111f0 }, /* N/A */
1442 			{ 0x1e, 0xb743111e }, /* SPDIF out */
1443 			{ }
1444 		},
1445 		.chained = true,
1446 		.chain_id = ALC880_FIXUP_GPIO1,
1447 	},
1448 	[ALC880_FIXUP_3ST_BASE] = {
1449 		.type = HDA_FIXUP_PINS,
1450 		.v.pins = (const struct hda_pintbl[]) {
1451 			{ 0x14, 0x01014010 }, /* line-out */
1452 			{ 0x15, 0x411111f0 }, /* N/A */
1453 			{ 0x16, 0x411111f0 }, /* N/A */
1454 			{ 0x17, 0x411111f0 }, /* N/A */
1455 			{ 0x18, 0x01a19c30 }, /* mic-in */
1456 			{ 0x19, 0x0121411f }, /* HP */
1457 			{ 0x1a, 0x01813031 }, /* line-in */
1458 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1459 			{ 0x1c, 0x411111f0 }, /* N/A */
1460 			{ 0x1d, 0x411111f0 }, /* N/A */
1461 			/* 0x1e is filled in below */
1462 			{ 0x1f, 0x411111f0 }, /* N/A */
1463 			{ }
1464 		}
1465 	},
1466 	[ALC880_FIXUP_3ST] = {
1467 		.type = HDA_FIXUP_PINS,
1468 		.v.pins = (const struct hda_pintbl[]) {
1469 			{ 0x1e, 0x411111f0 }, /* N/A */
1470 			{ }
1471 		},
1472 		.chained = true,
1473 		.chain_id = ALC880_FIXUP_3ST_BASE,
1474 	},
1475 	[ALC880_FIXUP_3ST_DIG] = {
1476 		.type = HDA_FIXUP_PINS,
1477 		.v.pins = (const struct hda_pintbl[]) {
1478 			{ 0x1e, 0x0144111e }, /* SPDIF */
1479 			{ }
1480 		},
1481 		.chained = true,
1482 		.chain_id = ALC880_FIXUP_3ST_BASE,
1483 	},
1484 	[ALC880_FIXUP_5ST_BASE] = {
1485 		.type = HDA_FIXUP_PINS,
1486 		.v.pins = (const struct hda_pintbl[]) {
1487 			{ 0x14, 0x01014010 }, /* front */
1488 			{ 0x15, 0x411111f0 }, /* N/A */
1489 			{ 0x16, 0x01011411 }, /* CLFE */
1490 			{ 0x17, 0x01016412 }, /* surr */
1491 			{ 0x18, 0x01a19c30 }, /* mic-in */
1492 			{ 0x19, 0x0121411f }, /* HP */
1493 			{ 0x1a, 0x01813031 }, /* line-in */
1494 			{ 0x1b, 0x02a19c40 }, /* front-mic */
1495 			{ 0x1c, 0x411111f0 }, /* N/A */
1496 			{ 0x1d, 0x411111f0 }, /* N/A */
1497 			/* 0x1e is filled in below */
1498 			{ 0x1f, 0x411111f0 }, /* N/A */
1499 			{ }
1500 		}
1501 	},
1502 	[ALC880_FIXUP_5ST] = {
1503 		.type = HDA_FIXUP_PINS,
1504 		.v.pins = (const struct hda_pintbl[]) {
1505 			{ 0x1e, 0x411111f0 }, /* N/A */
1506 			{ }
1507 		},
1508 		.chained = true,
1509 		.chain_id = ALC880_FIXUP_5ST_BASE,
1510 	},
1511 	[ALC880_FIXUP_5ST_DIG] = {
1512 		.type = HDA_FIXUP_PINS,
1513 		.v.pins = (const struct hda_pintbl[]) {
1514 			{ 0x1e, 0x0144111e }, /* SPDIF */
1515 			{ }
1516 		},
1517 		.chained = true,
1518 		.chain_id = ALC880_FIXUP_5ST_BASE,
1519 	},
1520 	[ALC880_FIXUP_6ST_BASE] = {
1521 		.type = HDA_FIXUP_PINS,
1522 		.v.pins = (const struct hda_pintbl[]) {
1523 			{ 0x14, 0x01014010 }, /* front */
1524 			{ 0x15, 0x01016412 }, /* surr */
1525 			{ 0x16, 0x01011411 }, /* CLFE */
1526 			{ 0x17, 0x01012414 }, /* side */
1527 			{ 0x18, 0x01a19c30 }, /* mic-in */
1528 			{ 0x19, 0x02a19c40 }, /* front-mic */
1529 			{ 0x1a, 0x01813031 }, /* line-in */
1530 			{ 0x1b, 0x0121411f }, /* HP */
1531 			{ 0x1c, 0x411111f0 }, /* N/A */
1532 			{ 0x1d, 0x411111f0 }, /* N/A */
1533 			/* 0x1e is filled in below */
1534 			{ 0x1f, 0x411111f0 }, /* N/A */
1535 			{ }
1536 		}
1537 	},
1538 	[ALC880_FIXUP_6ST] = {
1539 		.type = HDA_FIXUP_PINS,
1540 		.v.pins = (const struct hda_pintbl[]) {
1541 			{ 0x1e, 0x411111f0 }, /* N/A */
1542 			{ }
1543 		},
1544 		.chained = true,
1545 		.chain_id = ALC880_FIXUP_6ST_BASE,
1546 	},
1547 	[ALC880_FIXUP_6ST_DIG] = {
1548 		.type = HDA_FIXUP_PINS,
1549 		.v.pins = (const struct hda_pintbl[]) {
1550 			{ 0x1e, 0x0144111e }, /* SPDIF */
1551 			{ }
1552 		},
1553 		.chained = true,
1554 		.chain_id = ALC880_FIXUP_6ST_BASE,
1555 	},
1556 	[ALC880_FIXUP_6ST_AUTOMUTE] = {
1557 		.type = HDA_FIXUP_PINS,
1558 		.v.pins = (const struct hda_pintbl[]) {
1559 			{ 0x1b, 0x0121401f }, /* HP with jack detect */
1560 			{ }
1561 		},
1562 		.chained_before = true,
1563 		.chain_id = ALC880_FIXUP_6ST_BASE,
1564 	},
1565 };
1566 
1567 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1568 	SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1569 	SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1570 	SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1571 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1572 	SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1573 	SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1574 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1575 	SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1576 	SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1577 	SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1578 	SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1579 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1580 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1581 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1582 	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1583 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1584 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1585 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1586 	SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1587 	SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1588 	SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1589 	SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1590 	SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1591 
1592 	/* Below is the copied entries from alc880_quirks.c.
1593 	 * It's not quite sure whether BIOS sets the correct pin-config table
1594 	 * on these machines, thus they are kept to be compatible with
1595 	 * the old static quirks.  Once when it's confirmed to work without
1596 	 * these overrides, it'd be better to remove.
1597 	 */
1598 	SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1599 	SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1600 	SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1601 	SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1602 	SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1603 	SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1604 	SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1605 	SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1606 	SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1607 	SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1608 	SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1609 	SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1610 	SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1611 	SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1612 	SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1613 	SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1614 	SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1615 	SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1616 	SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1617 	SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1618 	SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1619 	SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1620 	SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1621 	SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1622 	SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1623 	SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1624 	SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1625 	SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1626 	SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1627 	SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1628 	SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1629 	SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1630 	SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1631 	/* default Intel */
1632 	SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1633 	SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1634 	SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1635 	{}
1636 };
1637 
1638 static const struct hda_model_fixup alc880_fixup_models[] = {
1639 	{.id = ALC880_FIXUP_3ST, .name = "3stack"},
1640 	{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1641 	{.id = ALC880_FIXUP_5ST, .name = "5stack"},
1642 	{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1643 	{.id = ALC880_FIXUP_6ST, .name = "6stack"},
1644 	{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1645 	{.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1646 	{}
1647 };
1648 
1649 
1650 /*
1651  * OK, here we have finally the patch for ALC880
1652  */
1653 static int patch_alc880(struct hda_codec *codec)
1654 {
1655 	struct alc_spec *spec;
1656 	int err;
1657 
1658 	err = alc_alloc_spec(codec, 0x0b);
1659 	if (err < 0)
1660 		return err;
1661 
1662 	spec = codec->spec;
1663 	spec->gen.need_dac_fix = 1;
1664 	spec->gen.beep_nid = 0x01;
1665 
1666 	codec->patch_ops.unsol_event = alc880_unsol_event;
1667 
1668 	alc_pre_init(codec);
1669 
1670 	snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1671 		       alc880_fixups);
1672 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1673 
1674 	/* automatic parse from the BIOS config */
1675 	err = alc880_parse_auto_config(codec);
1676 	if (err < 0)
1677 		goto error;
1678 
1679 	if (!spec->gen.no_analog) {
1680 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1681 		if (err < 0)
1682 			goto error;
1683 	}
1684 
1685 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1686 
1687 	return 0;
1688 
1689  error:
1690 	alc_free(codec);
1691 	return err;
1692 }
1693 
1694 
1695 /*
1696  * ALC260 support
1697  */
1698 static int alc260_parse_auto_config(struct hda_codec *codec)
1699 {
1700 	static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1701 	static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1702 	return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1703 }
1704 
1705 /*
1706  * Pin config fixes
1707  */
1708 enum {
1709 	ALC260_FIXUP_HP_DC5750,
1710 	ALC260_FIXUP_HP_PIN_0F,
1711 	ALC260_FIXUP_COEF,
1712 	ALC260_FIXUP_GPIO1,
1713 	ALC260_FIXUP_GPIO1_TOGGLE,
1714 	ALC260_FIXUP_REPLACER,
1715 	ALC260_FIXUP_HP_B1900,
1716 	ALC260_FIXUP_KN1,
1717 	ALC260_FIXUP_FSC_S7020,
1718 	ALC260_FIXUP_FSC_S7020_JWSE,
1719 	ALC260_FIXUP_VAIO_PINS,
1720 };
1721 
1722 static void alc260_gpio1_automute(struct hda_codec *codec)
1723 {
1724 	struct alc_spec *spec = codec->spec;
1725 
1726 	alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1727 }
1728 
1729 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1730 				      const struct hda_fixup *fix, int action)
1731 {
1732 	struct alc_spec *spec = codec->spec;
1733 	if (action == HDA_FIXUP_ACT_PROBE) {
1734 		/* although the machine has only one output pin, we need to
1735 		 * toggle GPIO1 according to the jack state
1736 		 */
1737 		spec->gen.automute_hook = alc260_gpio1_automute;
1738 		spec->gen.detect_hp = 1;
1739 		spec->gen.automute_speaker = 1;
1740 		spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1741 		snd_hda_jack_detect_enable_callback(codec, 0x0f,
1742 						    snd_hda_gen_hp_automute);
1743 		alc_setup_gpio(codec, 0x01);
1744 	}
1745 }
1746 
1747 static void alc260_fixup_kn1(struct hda_codec *codec,
1748 			     const struct hda_fixup *fix, int action)
1749 {
1750 	struct alc_spec *spec = codec->spec;
1751 	static const struct hda_pintbl pincfgs[] = {
1752 		{ 0x0f, 0x02214000 }, /* HP/speaker */
1753 		{ 0x12, 0x90a60160 }, /* int mic */
1754 		{ 0x13, 0x02a19000 }, /* ext mic */
1755 		{ 0x18, 0x01446000 }, /* SPDIF out */
1756 		/* disable bogus I/O pins */
1757 		{ 0x10, 0x411111f0 },
1758 		{ 0x11, 0x411111f0 },
1759 		{ 0x14, 0x411111f0 },
1760 		{ 0x15, 0x411111f0 },
1761 		{ 0x16, 0x411111f0 },
1762 		{ 0x17, 0x411111f0 },
1763 		{ 0x19, 0x411111f0 },
1764 		{ }
1765 	};
1766 
1767 	switch (action) {
1768 	case HDA_FIXUP_ACT_PRE_PROBE:
1769 		snd_hda_apply_pincfgs(codec, pincfgs);
1770 		spec->init_amp = ALC_INIT_NONE;
1771 		break;
1772 	}
1773 }
1774 
1775 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1776 				   const struct hda_fixup *fix, int action)
1777 {
1778 	struct alc_spec *spec = codec->spec;
1779 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
1780 		spec->init_amp = ALC_INIT_NONE;
1781 }
1782 
1783 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1784 				   const struct hda_fixup *fix, int action)
1785 {
1786 	struct alc_spec *spec = codec->spec;
1787 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1788 		spec->gen.add_jack_modes = 1;
1789 		spec->gen.hp_mic = 1;
1790 	}
1791 }
1792 
1793 static const struct hda_fixup alc260_fixups[] = {
1794 	[ALC260_FIXUP_HP_DC5750] = {
1795 		.type = HDA_FIXUP_PINS,
1796 		.v.pins = (const struct hda_pintbl[]) {
1797 			{ 0x11, 0x90130110 }, /* speaker */
1798 			{ }
1799 		}
1800 	},
1801 	[ALC260_FIXUP_HP_PIN_0F] = {
1802 		.type = HDA_FIXUP_PINS,
1803 		.v.pins = (const struct hda_pintbl[]) {
1804 			{ 0x0f, 0x01214000 }, /* HP */
1805 			{ }
1806 		}
1807 	},
1808 	[ALC260_FIXUP_COEF] = {
1809 		.type = HDA_FIXUP_VERBS,
1810 		.v.verbs = (const struct hda_verb[]) {
1811 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1812 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3040 },
1813 			{ }
1814 		},
1815 	},
1816 	[ALC260_FIXUP_GPIO1] = {
1817 		.type = HDA_FIXUP_FUNC,
1818 		.v.func = alc_fixup_gpio1,
1819 	},
1820 	[ALC260_FIXUP_GPIO1_TOGGLE] = {
1821 		.type = HDA_FIXUP_FUNC,
1822 		.v.func = alc260_fixup_gpio1_toggle,
1823 		.chained = true,
1824 		.chain_id = ALC260_FIXUP_HP_PIN_0F,
1825 	},
1826 	[ALC260_FIXUP_REPLACER] = {
1827 		.type = HDA_FIXUP_VERBS,
1828 		.v.verbs = (const struct hda_verb[]) {
1829 			{ 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1830 			{ 0x1a, AC_VERB_SET_PROC_COEF,  0x3050 },
1831 			{ }
1832 		},
1833 		.chained = true,
1834 		.chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1835 	},
1836 	[ALC260_FIXUP_HP_B1900] = {
1837 		.type = HDA_FIXUP_FUNC,
1838 		.v.func = alc260_fixup_gpio1_toggle,
1839 		.chained = true,
1840 		.chain_id = ALC260_FIXUP_COEF,
1841 	},
1842 	[ALC260_FIXUP_KN1] = {
1843 		.type = HDA_FIXUP_FUNC,
1844 		.v.func = alc260_fixup_kn1,
1845 	},
1846 	[ALC260_FIXUP_FSC_S7020] = {
1847 		.type = HDA_FIXUP_FUNC,
1848 		.v.func = alc260_fixup_fsc_s7020,
1849 	},
1850 	[ALC260_FIXUP_FSC_S7020_JWSE] = {
1851 		.type = HDA_FIXUP_FUNC,
1852 		.v.func = alc260_fixup_fsc_s7020_jwse,
1853 		.chained = true,
1854 		.chain_id = ALC260_FIXUP_FSC_S7020,
1855 	},
1856 	[ALC260_FIXUP_VAIO_PINS] = {
1857 		.type = HDA_FIXUP_PINS,
1858 		.v.pins = (const struct hda_pintbl[]) {
1859 			/* Pin configs are missing completely on some VAIOs */
1860 			{ 0x0f, 0x01211020 },
1861 			{ 0x10, 0x0001003f },
1862 			{ 0x11, 0x411111f0 },
1863 			{ 0x12, 0x01a15930 },
1864 			{ 0x13, 0x411111f0 },
1865 			{ 0x14, 0x411111f0 },
1866 			{ 0x15, 0x411111f0 },
1867 			{ 0x16, 0x411111f0 },
1868 			{ 0x17, 0x411111f0 },
1869 			{ 0x18, 0x411111f0 },
1870 			{ 0x19, 0x411111f0 },
1871 			{ }
1872 		}
1873 	},
1874 };
1875 
1876 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1877 	SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1878 	SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1879 	SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1880 	SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1881 	SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1882 	SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1883 	SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1884 	SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1885 	SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1886 	SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1887 	SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1888 	SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1889 	{}
1890 };
1891 
1892 static const struct hda_model_fixup alc260_fixup_models[] = {
1893 	{.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1894 	{.id = ALC260_FIXUP_COEF, .name = "coef"},
1895 	{.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1896 	{.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1897 	{}
1898 };
1899 
1900 /*
1901  */
1902 static int patch_alc260(struct hda_codec *codec)
1903 {
1904 	struct alc_spec *spec;
1905 	int err;
1906 
1907 	err = alc_alloc_spec(codec, 0x07);
1908 	if (err < 0)
1909 		return err;
1910 
1911 	spec = codec->spec;
1912 	/* as quite a few machines require HP amp for speaker outputs,
1913 	 * it's easier to enable it unconditionally; even if it's unneeded,
1914 	 * it's almost harmless.
1915 	 */
1916 	spec->gen.prefer_hp_amp = 1;
1917 	spec->gen.beep_nid = 0x01;
1918 
1919 	spec->shutup = alc_eapd_shutup;
1920 
1921 	alc_pre_init(codec);
1922 
1923 	snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1924 			   alc260_fixups);
1925 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1926 
1927 	/* automatic parse from the BIOS config */
1928 	err = alc260_parse_auto_config(codec);
1929 	if (err < 0)
1930 		goto error;
1931 
1932 	if (!spec->gen.no_analog) {
1933 		err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1934 		if (err < 0)
1935 			goto error;
1936 	}
1937 
1938 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1939 
1940 	return 0;
1941 
1942  error:
1943 	alc_free(codec);
1944 	return err;
1945 }
1946 
1947 
1948 /*
1949  * ALC882/883/885/888/889 support
1950  *
1951  * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1952  * configuration.  Each pin widget can choose any input DACs and a mixer.
1953  * Each ADC is connected from a mixer of all inputs.  This makes possible
1954  * 6-channel independent captures.
1955  *
1956  * In addition, an independent DAC for the multi-playback (not used in this
1957  * driver yet).
1958  */
1959 
1960 /*
1961  * Pin config fixes
1962  */
1963 enum {
1964 	ALC882_FIXUP_ABIT_AW9D_MAX,
1965 	ALC882_FIXUP_LENOVO_Y530,
1966 	ALC882_FIXUP_PB_M5210,
1967 	ALC882_FIXUP_ACER_ASPIRE_7736,
1968 	ALC882_FIXUP_ASUS_W90V,
1969 	ALC889_FIXUP_CD,
1970 	ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1971 	ALC889_FIXUP_VAIO_TT,
1972 	ALC888_FIXUP_EEE1601,
1973 	ALC886_FIXUP_EAPD,
1974 	ALC882_FIXUP_EAPD,
1975 	ALC883_FIXUP_EAPD,
1976 	ALC883_FIXUP_ACER_EAPD,
1977 	ALC882_FIXUP_GPIO1,
1978 	ALC882_FIXUP_GPIO2,
1979 	ALC882_FIXUP_GPIO3,
1980 	ALC889_FIXUP_COEF,
1981 	ALC882_FIXUP_ASUS_W2JC,
1982 	ALC882_FIXUP_ACER_ASPIRE_4930G,
1983 	ALC882_FIXUP_ACER_ASPIRE_8930G,
1984 	ALC882_FIXUP_ASPIRE_8930G_VERBS,
1985 	ALC885_FIXUP_MACPRO_GPIO,
1986 	ALC889_FIXUP_DAC_ROUTE,
1987 	ALC889_FIXUP_MBP_VREF,
1988 	ALC889_FIXUP_IMAC91_VREF,
1989 	ALC889_FIXUP_MBA11_VREF,
1990 	ALC889_FIXUP_MBA21_VREF,
1991 	ALC889_FIXUP_MP11_VREF,
1992 	ALC889_FIXUP_MP41_VREF,
1993 	ALC882_FIXUP_INV_DMIC,
1994 	ALC882_FIXUP_NO_PRIMARY_HP,
1995 	ALC887_FIXUP_ASUS_BASS,
1996 	ALC887_FIXUP_BASS_CHMAP,
1997 	ALC1220_FIXUP_GB_DUAL_CODECS,
1998 	ALC1220_FIXUP_GB_X570,
1999 	ALC1220_FIXUP_CLEVO_P950,
2000 	ALC1220_FIXUP_CLEVO_PB51ED,
2001 	ALC1220_FIXUP_CLEVO_PB51ED_PINS,
2002 	ALC887_FIXUP_ASUS_AUDIO,
2003 	ALC887_FIXUP_ASUS_HMIC,
2004 	ALCS1200A_FIXUP_MIC_VREF,
2005 	ALC888VD_FIXUP_MIC_100VREF,
2006 };
2007 
2008 static void alc889_fixup_coef(struct hda_codec *codec,
2009 			      const struct hda_fixup *fix, int action)
2010 {
2011 	if (action != HDA_FIXUP_ACT_INIT)
2012 		return;
2013 	alc_update_coef_idx(codec, 7, 0, 0x2030);
2014 }
2015 
2016 /* set up GPIO at initialization */
2017 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
2018 				     const struct hda_fixup *fix, int action)
2019 {
2020 	struct alc_spec *spec = codec->spec;
2021 
2022 	spec->gpio_write_delay = true;
2023 	alc_fixup_gpio3(codec, fix, action);
2024 }
2025 
2026 /* Fix the connection of some pins for ALC889:
2027  * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2028  * work correctly (bko#42740)
2029  */
2030 static void alc889_fixup_dac_route(struct hda_codec *codec,
2031 				   const struct hda_fixup *fix, int action)
2032 {
2033 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2034 		/* fake the connections during parsing the tree */
2035 		static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2036 		static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2037 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2038 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2039 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2040 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2041 	} else if (action == HDA_FIXUP_ACT_PROBE) {
2042 		/* restore the connections */
2043 		static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2044 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2045 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2046 		snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2047 		snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2048 	}
2049 }
2050 
2051 /* Set VREF on HP pin */
2052 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2053 				  const struct hda_fixup *fix, int action)
2054 {
2055 	static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2056 	struct alc_spec *spec = codec->spec;
2057 	int i;
2058 
2059 	if (action != HDA_FIXUP_ACT_INIT)
2060 		return;
2061 	for (i = 0; i < ARRAY_SIZE(nids); i++) {
2062 		unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2063 		if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2064 			continue;
2065 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2066 		val |= AC_PINCTL_VREF_80;
2067 		snd_hda_set_pin_ctl(codec, nids[i], val);
2068 		spec->gen.keep_vref_in_automute = 1;
2069 		break;
2070 	}
2071 }
2072 
2073 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2074 				  const hda_nid_t *nids, int num_nids)
2075 {
2076 	struct alc_spec *spec = codec->spec;
2077 	int i;
2078 
2079 	for (i = 0; i < num_nids; i++) {
2080 		unsigned int val;
2081 		val = snd_hda_codec_get_pin_target(codec, nids[i]);
2082 		val |= AC_PINCTL_VREF_50;
2083 		snd_hda_set_pin_ctl(codec, nids[i], val);
2084 	}
2085 	spec->gen.keep_vref_in_automute = 1;
2086 }
2087 
2088 /* Set VREF on speaker pins on imac91 */
2089 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2090 				     const struct hda_fixup *fix, int action)
2091 {
2092 	static const hda_nid_t nids[] = { 0x18, 0x1a };
2093 
2094 	if (action == HDA_FIXUP_ACT_INIT)
2095 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2096 }
2097 
2098 /* Set VREF on speaker pins on mba11 */
2099 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2100 				    const struct hda_fixup *fix, int action)
2101 {
2102 	static const hda_nid_t nids[] = { 0x18 };
2103 
2104 	if (action == HDA_FIXUP_ACT_INIT)
2105 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2106 }
2107 
2108 /* Set VREF on speaker pins on mba21 */
2109 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2110 				    const struct hda_fixup *fix, int action)
2111 {
2112 	static const hda_nid_t nids[] = { 0x18, 0x19 };
2113 
2114 	if (action == HDA_FIXUP_ACT_INIT)
2115 		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2116 }
2117 
2118 /* Don't take HP output as primary
2119  * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2120  * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2121  */
2122 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2123 				       const struct hda_fixup *fix, int action)
2124 {
2125 	struct alc_spec *spec = codec->spec;
2126 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2127 		spec->gen.no_primary_hp = 1;
2128 		spec->gen.no_multi_io = 1;
2129 	}
2130 }
2131 
2132 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2133 				 const struct hda_fixup *fix, int action);
2134 
2135 /* For dual-codec configuration, we need to disable some features to avoid
2136  * conflicts of kctls and PCM streams
2137  */
2138 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2139 				  const struct hda_fixup *fix, int action)
2140 {
2141 	struct alc_spec *spec = codec->spec;
2142 
2143 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2144 		return;
2145 	/* disable vmaster */
2146 	spec->gen.suppress_vmaster = 1;
2147 	/* auto-mute and auto-mic switch don't work with multiple codecs */
2148 	spec->gen.suppress_auto_mute = 1;
2149 	spec->gen.suppress_auto_mic = 1;
2150 	/* disable aamix as well */
2151 	spec->gen.mixer_nid = 0;
2152 	/* add location prefix to avoid conflicts */
2153 	codec->force_pin_prefix = 1;
2154 }
2155 
2156 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2157 		       const char *newname)
2158 {
2159 	struct snd_kcontrol *kctl;
2160 
2161 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
2162 	if (kctl)
2163 		snd_ctl_rename(codec->card, kctl, newname);
2164 }
2165 
2166 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2167 					 const struct hda_fixup *fix,
2168 					 int action)
2169 {
2170 	alc_fixup_dual_codecs(codec, fix, action);
2171 	switch (action) {
2172 	case HDA_FIXUP_ACT_PRE_PROBE:
2173 		/* override card longname to provide a unique UCM profile */
2174 		strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2175 		break;
2176 	case HDA_FIXUP_ACT_BUILD:
2177 		/* rename Capture controls depending on the codec */
2178 		rename_ctl(codec, "Capture Volume",
2179 			   codec->addr == 0 ?
2180 			   "Rear-Panel Capture Volume" :
2181 			   "Front-Panel Capture Volume");
2182 		rename_ctl(codec, "Capture Switch",
2183 			   codec->addr == 0 ?
2184 			   "Rear-Panel Capture Switch" :
2185 			   "Front-Panel Capture Switch");
2186 		break;
2187 	}
2188 }
2189 
2190 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2191 				     const struct hda_fixup *fix,
2192 				     int action)
2193 {
2194 	static const hda_nid_t conn1[] = { 0x0c };
2195 	static const struct coef_fw gb_x570_coefs[] = {
2196 		WRITE_COEF(0x07, 0x03c0),
2197 		WRITE_COEF(0x1a, 0x01c1),
2198 		WRITE_COEF(0x1b, 0x0202),
2199 		WRITE_COEF(0x43, 0x3005),
2200 		{}
2201 	};
2202 
2203 	switch (action) {
2204 	case HDA_FIXUP_ACT_PRE_PROBE:
2205 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2206 		snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2207 		break;
2208 	case HDA_FIXUP_ACT_INIT:
2209 		alc_process_coef_fw(codec, gb_x570_coefs);
2210 		break;
2211 	}
2212 }
2213 
2214 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2215 				     const struct hda_fixup *fix,
2216 				     int action)
2217 {
2218 	static const hda_nid_t conn1[] = { 0x0c };
2219 
2220 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
2221 		return;
2222 
2223 	alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2224 	/* We therefore want to make sure 0x14 (front headphone) and
2225 	 * 0x1b (speakers) use the stereo DAC 0x02
2226 	 */
2227 	snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2228 	snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2229 }
2230 
2231 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2232 				const struct hda_fixup *fix, int action);
2233 
2234 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2235 				     const struct hda_fixup *fix,
2236 				     int action)
2237 {
2238 	alc1220_fixup_clevo_p950(codec, fix, action);
2239 	alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2240 }
2241 
2242 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2243 					 struct hda_jack_callback *jack)
2244 {
2245 	struct alc_spec *spec = codec->spec;
2246 	unsigned int vref;
2247 
2248 	snd_hda_gen_hp_automute(codec, jack);
2249 
2250 	if (spec->gen.hp_jack_present)
2251 		vref = AC_PINCTL_VREF_80;
2252 	else
2253 		vref = AC_PINCTL_VREF_HIZ;
2254 	snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2255 }
2256 
2257 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2258 				     const struct hda_fixup *fix, int action)
2259 {
2260 	struct alc_spec *spec = codec->spec;
2261 	if (action != HDA_FIXUP_ACT_PROBE)
2262 		return;
2263 	snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2264 	spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2265 }
2266 
2267 static const struct hda_fixup alc882_fixups[] = {
2268 	[ALC882_FIXUP_ABIT_AW9D_MAX] = {
2269 		.type = HDA_FIXUP_PINS,
2270 		.v.pins = (const struct hda_pintbl[]) {
2271 			{ 0x15, 0x01080104 }, /* side */
2272 			{ 0x16, 0x01011012 }, /* rear */
2273 			{ 0x17, 0x01016011 }, /* clfe */
2274 			{ }
2275 		}
2276 	},
2277 	[ALC882_FIXUP_LENOVO_Y530] = {
2278 		.type = HDA_FIXUP_PINS,
2279 		.v.pins = (const struct hda_pintbl[]) {
2280 			{ 0x15, 0x99130112 }, /* rear int speakers */
2281 			{ 0x16, 0x99130111 }, /* subwoofer */
2282 			{ }
2283 		}
2284 	},
2285 	[ALC882_FIXUP_PB_M5210] = {
2286 		.type = HDA_FIXUP_PINCTLS,
2287 		.v.pins = (const struct hda_pintbl[]) {
2288 			{ 0x19, PIN_VREF50 },
2289 			{}
2290 		}
2291 	},
2292 	[ALC882_FIXUP_ACER_ASPIRE_7736] = {
2293 		.type = HDA_FIXUP_FUNC,
2294 		.v.func = alc_fixup_sku_ignore,
2295 	},
2296 	[ALC882_FIXUP_ASUS_W90V] = {
2297 		.type = HDA_FIXUP_PINS,
2298 		.v.pins = (const struct hda_pintbl[]) {
2299 			{ 0x16, 0x99130110 }, /* fix sequence for CLFE */
2300 			{ }
2301 		}
2302 	},
2303 	[ALC889_FIXUP_CD] = {
2304 		.type = HDA_FIXUP_PINS,
2305 		.v.pins = (const struct hda_pintbl[]) {
2306 			{ 0x1c, 0x993301f0 }, /* CD */
2307 			{ }
2308 		}
2309 	},
2310 	[ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2311 		.type = HDA_FIXUP_PINS,
2312 		.v.pins = (const struct hda_pintbl[]) {
2313 			{ 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2314 			{ }
2315 		},
2316 		.chained = true,
2317 		.chain_id = ALC889_FIXUP_CD,
2318 	},
2319 	[ALC889_FIXUP_VAIO_TT] = {
2320 		.type = HDA_FIXUP_PINS,
2321 		.v.pins = (const struct hda_pintbl[]) {
2322 			{ 0x17, 0x90170111 }, /* hidden surround speaker */
2323 			{ }
2324 		}
2325 	},
2326 	[ALC888_FIXUP_EEE1601] = {
2327 		.type = HDA_FIXUP_VERBS,
2328 		.v.verbs = (const struct hda_verb[]) {
2329 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2330 			{ 0x20, AC_VERB_SET_PROC_COEF,  0x0838 },
2331 			{ }
2332 		}
2333 	},
2334 	[ALC886_FIXUP_EAPD] = {
2335 		.type = HDA_FIXUP_VERBS,
2336 		.v.verbs = (const struct hda_verb[]) {
2337 			/* change to EAPD mode */
2338 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2339 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2340 			{ }
2341 		}
2342 	},
2343 	[ALC882_FIXUP_EAPD] = {
2344 		.type = HDA_FIXUP_VERBS,
2345 		.v.verbs = (const struct hda_verb[]) {
2346 			/* change to EAPD mode */
2347 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2348 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2349 			{ }
2350 		}
2351 	},
2352 	[ALC883_FIXUP_EAPD] = {
2353 		.type = HDA_FIXUP_VERBS,
2354 		.v.verbs = (const struct hda_verb[]) {
2355 			/* change to EAPD mode */
2356 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2357 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2358 			{ }
2359 		}
2360 	},
2361 	[ALC883_FIXUP_ACER_EAPD] = {
2362 		.type = HDA_FIXUP_VERBS,
2363 		.v.verbs = (const struct hda_verb[]) {
2364 			/* eanable EAPD on Acer laptops */
2365 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2366 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2367 			{ }
2368 		}
2369 	},
2370 	[ALC882_FIXUP_GPIO1] = {
2371 		.type = HDA_FIXUP_FUNC,
2372 		.v.func = alc_fixup_gpio1,
2373 	},
2374 	[ALC882_FIXUP_GPIO2] = {
2375 		.type = HDA_FIXUP_FUNC,
2376 		.v.func = alc_fixup_gpio2,
2377 	},
2378 	[ALC882_FIXUP_GPIO3] = {
2379 		.type = HDA_FIXUP_FUNC,
2380 		.v.func = alc_fixup_gpio3,
2381 	},
2382 	[ALC882_FIXUP_ASUS_W2JC] = {
2383 		.type = HDA_FIXUP_FUNC,
2384 		.v.func = alc_fixup_gpio1,
2385 		.chained = true,
2386 		.chain_id = ALC882_FIXUP_EAPD,
2387 	},
2388 	[ALC889_FIXUP_COEF] = {
2389 		.type = HDA_FIXUP_FUNC,
2390 		.v.func = alc889_fixup_coef,
2391 	},
2392 	[ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2393 		.type = HDA_FIXUP_PINS,
2394 		.v.pins = (const struct hda_pintbl[]) {
2395 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2396 			{ 0x17, 0x99130112 }, /* surround speaker */
2397 			{ }
2398 		},
2399 		.chained = true,
2400 		.chain_id = ALC882_FIXUP_GPIO1,
2401 	},
2402 	[ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2403 		.type = HDA_FIXUP_PINS,
2404 		.v.pins = (const struct hda_pintbl[]) {
2405 			{ 0x16, 0x99130111 }, /* CLFE speaker */
2406 			{ 0x1b, 0x99130112 }, /* surround speaker */
2407 			{ }
2408 		},
2409 		.chained = true,
2410 		.chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2411 	},
2412 	[ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2413 		/* additional init verbs for Acer Aspire 8930G */
2414 		.type = HDA_FIXUP_VERBS,
2415 		.v.verbs = (const struct hda_verb[]) {
2416 			/* Enable all DACs */
2417 			/* DAC DISABLE/MUTE 1? */
2418 			/*  setting bits 1-5 disables DAC nids 0x02-0x06
2419 			 *  apparently. Init=0x38 */
2420 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2421 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2422 			/* DAC DISABLE/MUTE 2? */
2423 			/*  some bit here disables the other DACs.
2424 			 *  Init=0x4900 */
2425 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2426 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2427 			/* DMIC fix
2428 			 * This laptop has a stereo digital microphone.
2429 			 * The mics are only 1cm apart which makes the stereo
2430 			 * useless. However, either the mic or the ALC889
2431 			 * makes the signal become a difference/sum signal
2432 			 * instead of standard stereo, which is annoying.
2433 			 * So instead we flip this bit which makes the
2434 			 * codec replicate the sum signal to both channels,
2435 			 * turning it into a normal mono mic.
2436 			 */
2437 			/* DMIC_CONTROL? Init value = 0x0001 */
2438 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2439 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2440 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2441 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2442 			{ }
2443 		},
2444 		.chained = true,
2445 		.chain_id = ALC882_FIXUP_GPIO1,
2446 	},
2447 	[ALC885_FIXUP_MACPRO_GPIO] = {
2448 		.type = HDA_FIXUP_FUNC,
2449 		.v.func = alc885_fixup_macpro_gpio,
2450 	},
2451 	[ALC889_FIXUP_DAC_ROUTE] = {
2452 		.type = HDA_FIXUP_FUNC,
2453 		.v.func = alc889_fixup_dac_route,
2454 	},
2455 	[ALC889_FIXUP_MBP_VREF] = {
2456 		.type = HDA_FIXUP_FUNC,
2457 		.v.func = alc889_fixup_mbp_vref,
2458 		.chained = true,
2459 		.chain_id = ALC882_FIXUP_GPIO1,
2460 	},
2461 	[ALC889_FIXUP_IMAC91_VREF] = {
2462 		.type = HDA_FIXUP_FUNC,
2463 		.v.func = alc889_fixup_imac91_vref,
2464 		.chained = true,
2465 		.chain_id = ALC882_FIXUP_GPIO1,
2466 	},
2467 	[ALC889_FIXUP_MBA11_VREF] = {
2468 		.type = HDA_FIXUP_FUNC,
2469 		.v.func = alc889_fixup_mba11_vref,
2470 		.chained = true,
2471 		.chain_id = ALC889_FIXUP_MBP_VREF,
2472 	},
2473 	[ALC889_FIXUP_MBA21_VREF] = {
2474 		.type = HDA_FIXUP_FUNC,
2475 		.v.func = alc889_fixup_mba21_vref,
2476 		.chained = true,
2477 		.chain_id = ALC889_FIXUP_MBP_VREF,
2478 	},
2479 	[ALC889_FIXUP_MP11_VREF] = {
2480 		.type = HDA_FIXUP_FUNC,
2481 		.v.func = alc889_fixup_mba11_vref,
2482 		.chained = true,
2483 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2484 	},
2485 	[ALC889_FIXUP_MP41_VREF] = {
2486 		.type = HDA_FIXUP_FUNC,
2487 		.v.func = alc889_fixup_mbp_vref,
2488 		.chained = true,
2489 		.chain_id = ALC885_FIXUP_MACPRO_GPIO,
2490 	},
2491 	[ALC882_FIXUP_INV_DMIC] = {
2492 		.type = HDA_FIXUP_FUNC,
2493 		.v.func = alc_fixup_inv_dmic,
2494 	},
2495 	[ALC882_FIXUP_NO_PRIMARY_HP] = {
2496 		.type = HDA_FIXUP_FUNC,
2497 		.v.func = alc882_fixup_no_primary_hp,
2498 	},
2499 	[ALC887_FIXUP_ASUS_BASS] = {
2500 		.type = HDA_FIXUP_PINS,
2501 		.v.pins = (const struct hda_pintbl[]) {
2502 			{0x16, 0x99130130}, /* bass speaker */
2503 			{}
2504 		},
2505 		.chained = true,
2506 		.chain_id = ALC887_FIXUP_BASS_CHMAP,
2507 	},
2508 	[ALC887_FIXUP_BASS_CHMAP] = {
2509 		.type = HDA_FIXUP_FUNC,
2510 		.v.func = alc_fixup_bass_chmap,
2511 	},
2512 	[ALC1220_FIXUP_GB_DUAL_CODECS] = {
2513 		.type = HDA_FIXUP_FUNC,
2514 		.v.func = alc1220_fixup_gb_dual_codecs,
2515 	},
2516 	[ALC1220_FIXUP_GB_X570] = {
2517 		.type = HDA_FIXUP_FUNC,
2518 		.v.func = alc1220_fixup_gb_x570,
2519 	},
2520 	[ALC1220_FIXUP_CLEVO_P950] = {
2521 		.type = HDA_FIXUP_FUNC,
2522 		.v.func = alc1220_fixup_clevo_p950,
2523 	},
2524 	[ALC1220_FIXUP_CLEVO_PB51ED] = {
2525 		.type = HDA_FIXUP_FUNC,
2526 		.v.func = alc1220_fixup_clevo_pb51ed,
2527 	},
2528 	[ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2529 		.type = HDA_FIXUP_PINS,
2530 		.v.pins = (const struct hda_pintbl[]) {
2531 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2532 			{}
2533 		},
2534 		.chained = true,
2535 		.chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2536 	},
2537 	[ALC887_FIXUP_ASUS_AUDIO] = {
2538 		.type = HDA_FIXUP_PINS,
2539 		.v.pins = (const struct hda_pintbl[]) {
2540 			{ 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2541 			{ 0x19, 0x22219420 },
2542 			{}
2543 		},
2544 	},
2545 	[ALC887_FIXUP_ASUS_HMIC] = {
2546 		.type = HDA_FIXUP_FUNC,
2547 		.v.func = alc887_fixup_asus_jack,
2548 		.chained = true,
2549 		.chain_id = ALC887_FIXUP_ASUS_AUDIO,
2550 	},
2551 	[ALCS1200A_FIXUP_MIC_VREF] = {
2552 		.type = HDA_FIXUP_PINCTLS,
2553 		.v.pins = (const struct hda_pintbl[]) {
2554 			{ 0x18, PIN_VREF50 }, /* rear mic */
2555 			{ 0x19, PIN_VREF50 }, /* front mic */
2556 			{}
2557 		}
2558 	},
2559 	[ALC888VD_FIXUP_MIC_100VREF] = {
2560 		.type = HDA_FIXUP_PINCTLS,
2561 		.v.pins = (const struct hda_pintbl[]) {
2562 			{ 0x18, PIN_VREF100 }, /* headset mic */
2563 			{}
2564 		}
2565 	},
2566 };
2567 
2568 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2569 	SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2570 	SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2571 	SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2572 	SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2573 	SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2574 	SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2575 	SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2576 	SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2577 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2578 	SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2579 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2580 	SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2581 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2582 	SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2583 		      ALC882_FIXUP_ACER_ASPIRE_8930G),
2584 	SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2585 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2586 	SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2587 	SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2588 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2589 	SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2590 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2591 	SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2592 		      ALC882_FIXUP_ACER_ASPIRE_4930G),
2593 	SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2594 	SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2595 	SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2596 	SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2597 	SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2598 	SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2599 	SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2600 	SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2601 	SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2602 	SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2603 	SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2604 	SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2605 	SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2606 	SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2607 	SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2608 	SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2609 
2610 	/* All Apple entries are in codec SSIDs */
2611 	SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2612 	SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2613 	SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2614 	SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2615 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2616 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2617 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2618 	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2619 	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2620 	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2621 	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2622 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2623 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2624 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2625 	SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2626 	SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2627 	SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2628 	SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2629 	SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2630 	SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2631 	SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2632 	SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2633 
2634 	SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2635 	SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2636 	SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2637 	SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2638 	SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2639 	SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2640 	SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2641 	SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2642 	SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2643 	SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2644 	SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2645 	SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2646 	SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2647 	SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2648 	SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2649 	SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2650 	SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2651 	SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2652 	SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2653 	SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2654 	SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2655 	SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2656 	SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2657 	SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2658 	SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2659 	SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2660 	SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2661 	SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2662 	SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2663 	SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2664 	SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2665 	SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2666 	SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2667 	SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2668 	SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2669 	SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2670 	SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2671 	SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2672 	SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2673 	SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2674 	SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2675 	SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2676 	SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2677 	SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2678 	SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2679 	SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2680 	SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2681 	SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2682 	SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2683 	SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2684 	SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2685 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2686 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2687 	SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2688 	{}
2689 };
2690 
2691 static const struct hda_model_fixup alc882_fixup_models[] = {
2692 	{.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2693 	{.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2694 	{.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2695 	{.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2696 	{.id = ALC889_FIXUP_CD, .name = "cd"},
2697 	{.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2698 	{.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2699 	{.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2700 	{.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2701 	{.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2702 	{.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2703 	{.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2704 	{.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2705 	{.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2706 	{.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2707 	{.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2708 	{.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2709 	{.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2710 	{.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2711 	{.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2712 	{.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2713 	{.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2714 	{.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2715 	{.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2716 	{.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2717 	{.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2718 	{.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2719 	{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2720 	{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2721 	{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2722 	{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2723 	{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2724 	{}
2725 };
2726 
2727 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2728 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2729 		{0x14, 0x01014010},
2730 		{0x15, 0x01011012},
2731 		{0x16, 0x01016011},
2732 		{0x18, 0x01a19040},
2733 		{0x19, 0x02a19050},
2734 		{0x1a, 0x0181304f},
2735 		{0x1b, 0x0221401f},
2736 		{0x1e, 0x01456130}),
2737 	SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2738 		{0x14, 0x01015010},
2739 		{0x15, 0x01011012},
2740 		{0x16, 0x01011011},
2741 		{0x18, 0x01a11040},
2742 		{0x19, 0x02a19050},
2743 		{0x1a, 0x0181104f},
2744 		{0x1b, 0x0221401f},
2745 		{0x1e, 0x01451130}),
2746 	{}
2747 };
2748 
2749 /*
2750  * BIOS auto configuration
2751  */
2752 /* almost identical with ALC880 parser... */
2753 static int alc882_parse_auto_config(struct hda_codec *codec)
2754 {
2755 	static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2756 	static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2757 	return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2758 }
2759 
2760 /*
2761  */
2762 static int patch_alc882(struct hda_codec *codec)
2763 {
2764 	struct alc_spec *spec;
2765 	int err;
2766 
2767 	err = alc_alloc_spec(codec, 0x0b);
2768 	if (err < 0)
2769 		return err;
2770 
2771 	spec = codec->spec;
2772 
2773 	switch (codec->core.vendor_id) {
2774 	case 0x10ec0882:
2775 	case 0x10ec0885:
2776 	case 0x10ec0900:
2777 	case 0x10ec0b00:
2778 	case 0x10ec1220:
2779 		break;
2780 	default:
2781 		/* ALC883 and variants */
2782 		alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2783 		break;
2784 	}
2785 
2786 	alc_pre_init(codec);
2787 
2788 	snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2789 		       alc882_fixups);
2790 	snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2791 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2792 
2793 	alc_auto_parse_customize_define(codec);
2794 
2795 	if (has_cdefine_beep(codec))
2796 		spec->gen.beep_nid = 0x01;
2797 
2798 	/* automatic parse from the BIOS config */
2799 	err = alc882_parse_auto_config(codec);
2800 	if (err < 0)
2801 		goto error;
2802 
2803 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2804 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2805 		if (err < 0)
2806 			goto error;
2807 	}
2808 
2809 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2810 
2811 	return 0;
2812 
2813  error:
2814 	alc_free(codec);
2815 	return err;
2816 }
2817 
2818 
2819 /*
2820  * ALC262 support
2821  */
2822 static int alc262_parse_auto_config(struct hda_codec *codec)
2823 {
2824 	static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2825 	static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2826 	return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2827 }
2828 
2829 /*
2830  * Pin config fixes
2831  */
2832 enum {
2833 	ALC262_FIXUP_FSC_H270,
2834 	ALC262_FIXUP_FSC_S7110,
2835 	ALC262_FIXUP_HP_Z200,
2836 	ALC262_FIXUP_TYAN,
2837 	ALC262_FIXUP_LENOVO_3000,
2838 	ALC262_FIXUP_BENQ,
2839 	ALC262_FIXUP_BENQ_T31,
2840 	ALC262_FIXUP_INV_DMIC,
2841 	ALC262_FIXUP_INTEL_BAYLEYBAY,
2842 };
2843 
2844 static const struct hda_fixup alc262_fixups[] = {
2845 	[ALC262_FIXUP_FSC_H270] = {
2846 		.type = HDA_FIXUP_PINS,
2847 		.v.pins = (const struct hda_pintbl[]) {
2848 			{ 0x14, 0x99130110 }, /* speaker */
2849 			{ 0x15, 0x0221142f }, /* front HP */
2850 			{ 0x1b, 0x0121141f }, /* rear HP */
2851 			{ }
2852 		}
2853 	},
2854 	[ALC262_FIXUP_FSC_S7110] = {
2855 		.type = HDA_FIXUP_PINS,
2856 		.v.pins = (const struct hda_pintbl[]) {
2857 			{ 0x15, 0x90170110 }, /* speaker */
2858 			{ }
2859 		},
2860 		.chained = true,
2861 		.chain_id = ALC262_FIXUP_BENQ,
2862 	},
2863 	[ALC262_FIXUP_HP_Z200] = {
2864 		.type = HDA_FIXUP_PINS,
2865 		.v.pins = (const struct hda_pintbl[]) {
2866 			{ 0x16, 0x99130120 }, /* internal speaker */
2867 			{ }
2868 		}
2869 	},
2870 	[ALC262_FIXUP_TYAN] = {
2871 		.type = HDA_FIXUP_PINS,
2872 		.v.pins = (const struct hda_pintbl[]) {
2873 			{ 0x14, 0x1993e1f0 }, /* int AUX */
2874 			{ }
2875 		}
2876 	},
2877 	[ALC262_FIXUP_LENOVO_3000] = {
2878 		.type = HDA_FIXUP_PINCTLS,
2879 		.v.pins = (const struct hda_pintbl[]) {
2880 			{ 0x19, PIN_VREF50 },
2881 			{}
2882 		},
2883 		.chained = true,
2884 		.chain_id = ALC262_FIXUP_BENQ,
2885 	},
2886 	[ALC262_FIXUP_BENQ] = {
2887 		.type = HDA_FIXUP_VERBS,
2888 		.v.verbs = (const struct hda_verb[]) {
2889 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2890 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2891 			{}
2892 		}
2893 	},
2894 	[ALC262_FIXUP_BENQ_T31] = {
2895 		.type = HDA_FIXUP_VERBS,
2896 		.v.verbs = (const struct hda_verb[]) {
2897 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2898 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2899 			{}
2900 		}
2901 	},
2902 	[ALC262_FIXUP_INV_DMIC] = {
2903 		.type = HDA_FIXUP_FUNC,
2904 		.v.func = alc_fixup_inv_dmic,
2905 	},
2906 	[ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2907 		.type = HDA_FIXUP_FUNC,
2908 		.v.func = alc_fixup_no_depop_delay,
2909 	},
2910 };
2911 
2912 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2913 	SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2914 	SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2915 	SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2916 	SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2917 	SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2918 	SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2919 	SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2920 	SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2921 	SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2922 	SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2923 	{}
2924 };
2925 
2926 static const struct hda_model_fixup alc262_fixup_models[] = {
2927 	{.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2928 	{.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2929 	{.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2930 	{.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2931 	{.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2932 	{.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2933 	{.id = ALC262_FIXUP_BENQ, .name = "benq"},
2934 	{.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2935 	{.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2936 	{}
2937 };
2938 
2939 /*
2940  */
2941 static int patch_alc262(struct hda_codec *codec)
2942 {
2943 	struct alc_spec *spec;
2944 	int err;
2945 
2946 	err = alc_alloc_spec(codec, 0x0b);
2947 	if (err < 0)
2948 		return err;
2949 
2950 	spec = codec->spec;
2951 	spec->gen.shared_mic_vref_pin = 0x18;
2952 
2953 	spec->shutup = alc_eapd_shutup;
2954 
2955 #if 0
2956 	/* pshou 07/11/05  set a zero PCM sample to DAC when FIFO is
2957 	 * under-run
2958 	 */
2959 	alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2960 #endif
2961 	alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2962 
2963 	alc_pre_init(codec);
2964 
2965 	snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2966 		       alc262_fixups);
2967 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2968 
2969 	alc_auto_parse_customize_define(codec);
2970 
2971 	if (has_cdefine_beep(codec))
2972 		spec->gen.beep_nid = 0x01;
2973 
2974 	/* automatic parse from the BIOS config */
2975 	err = alc262_parse_auto_config(codec);
2976 	if (err < 0)
2977 		goto error;
2978 
2979 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
2980 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2981 		if (err < 0)
2982 			goto error;
2983 	}
2984 
2985 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2986 
2987 	return 0;
2988 
2989  error:
2990 	alc_free(codec);
2991 	return err;
2992 }
2993 
2994 /*
2995  *  ALC268
2996  */
2997 /* bind Beep switches of both NID 0x0f and 0x10 */
2998 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2999 				  struct snd_ctl_elem_value *ucontrol)
3000 {
3001 	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3002 	unsigned long pval;
3003 	int err;
3004 
3005 	mutex_lock(&codec->control_mutex);
3006 	pval = kcontrol->private_value;
3007 	kcontrol->private_value = (pval & ~0xff) | 0x0f;
3008 	err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3009 	if (err >= 0) {
3010 		kcontrol->private_value = (pval & ~0xff) | 0x10;
3011 		err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3012 	}
3013 	kcontrol->private_value = pval;
3014 	mutex_unlock(&codec->control_mutex);
3015 	return err;
3016 }
3017 
3018 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3019 	HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
3020 	{
3021 		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3022 		.name = "Beep Playback Switch",
3023 		.subdevice = HDA_SUBDEV_AMP_FLAG,
3024 		.info = snd_hda_mixer_amp_switch_info,
3025 		.get = snd_hda_mixer_amp_switch_get,
3026 		.put = alc268_beep_switch_put,
3027 		.private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3028 	},
3029 };
3030 
3031 /* set PCBEEP vol = 0, mute connections */
3032 static const struct hda_verb alc268_beep_init_verbs[] = {
3033 	{0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3034 	{0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3035 	{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3036 	{ }
3037 };
3038 
3039 enum {
3040 	ALC268_FIXUP_INV_DMIC,
3041 	ALC268_FIXUP_HP_EAPD,
3042 	ALC268_FIXUP_SPDIF,
3043 };
3044 
3045 static const struct hda_fixup alc268_fixups[] = {
3046 	[ALC268_FIXUP_INV_DMIC] = {
3047 		.type = HDA_FIXUP_FUNC,
3048 		.v.func = alc_fixup_inv_dmic,
3049 	},
3050 	[ALC268_FIXUP_HP_EAPD] = {
3051 		.type = HDA_FIXUP_VERBS,
3052 		.v.verbs = (const struct hda_verb[]) {
3053 			{0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3054 			{}
3055 		}
3056 	},
3057 	[ALC268_FIXUP_SPDIF] = {
3058 		.type = HDA_FIXUP_PINS,
3059 		.v.pins = (const struct hda_pintbl[]) {
3060 			{ 0x1e, 0x014b1180 }, /* enable SPDIF out */
3061 			{}
3062 		}
3063 	},
3064 };
3065 
3066 static const struct hda_model_fixup alc268_fixup_models[] = {
3067 	{.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3068 	{.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3069 	{.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3070 	{}
3071 };
3072 
3073 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3074 	SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3075 	SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3076 	/* below is codec SSID since multiple Toshiba laptops have the
3077 	 * same PCI SSID 1179:ff00
3078 	 */
3079 	SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3080 	{}
3081 };
3082 
3083 /*
3084  * BIOS auto configuration
3085  */
3086 static int alc268_parse_auto_config(struct hda_codec *codec)
3087 {
3088 	static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3089 	return alc_parse_auto_config(codec, NULL, alc268_ssids);
3090 }
3091 
3092 /*
3093  */
3094 static int patch_alc268(struct hda_codec *codec)
3095 {
3096 	struct alc_spec *spec;
3097 	int i, err;
3098 
3099 	/* ALC268 has no aa-loopback mixer */
3100 	err = alc_alloc_spec(codec, 0);
3101 	if (err < 0)
3102 		return err;
3103 
3104 	spec = codec->spec;
3105 	if (has_cdefine_beep(codec))
3106 		spec->gen.beep_nid = 0x01;
3107 
3108 	spec->shutup = alc_eapd_shutup;
3109 
3110 	alc_pre_init(codec);
3111 
3112 	snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3113 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3114 
3115 	/* automatic parse from the BIOS config */
3116 	err = alc268_parse_auto_config(codec);
3117 	if (err < 0)
3118 		goto error;
3119 
3120 	if (err > 0 && !spec->gen.no_analog &&
3121 	    spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3122 		for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3123 			if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3124 						  &alc268_beep_mixer[i])) {
3125 				err = -ENOMEM;
3126 				goto error;
3127 			}
3128 		}
3129 		snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3130 		if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3131 			/* override the amp caps for beep generator */
3132 			snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3133 					  (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3134 					  (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3135 					  (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3136 					  (0 << AC_AMPCAP_MUTE_SHIFT));
3137 	}
3138 
3139 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3140 
3141 	return 0;
3142 
3143  error:
3144 	alc_free(codec);
3145 	return err;
3146 }
3147 
3148 /*
3149  * ALC269
3150  */
3151 
3152 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3153 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3154 };
3155 
3156 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3157 	.rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3158 };
3159 
3160 /* different alc269-variants */
3161 enum {
3162 	ALC269_TYPE_ALC269VA,
3163 	ALC269_TYPE_ALC269VB,
3164 	ALC269_TYPE_ALC269VC,
3165 	ALC269_TYPE_ALC269VD,
3166 	ALC269_TYPE_ALC280,
3167 	ALC269_TYPE_ALC282,
3168 	ALC269_TYPE_ALC283,
3169 	ALC269_TYPE_ALC284,
3170 	ALC269_TYPE_ALC293,
3171 	ALC269_TYPE_ALC286,
3172 	ALC269_TYPE_ALC298,
3173 	ALC269_TYPE_ALC255,
3174 	ALC269_TYPE_ALC256,
3175 	ALC269_TYPE_ALC257,
3176 	ALC269_TYPE_ALC215,
3177 	ALC269_TYPE_ALC225,
3178 	ALC269_TYPE_ALC245,
3179 	ALC269_TYPE_ALC287,
3180 	ALC269_TYPE_ALC294,
3181 	ALC269_TYPE_ALC300,
3182 	ALC269_TYPE_ALC623,
3183 	ALC269_TYPE_ALC700,
3184 };
3185 
3186 /*
3187  * BIOS auto configuration
3188  */
3189 static int alc269_parse_auto_config(struct hda_codec *codec)
3190 {
3191 	static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3192 	static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3193 	static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3194 	struct alc_spec *spec = codec->spec;
3195 	const hda_nid_t *ssids;
3196 
3197 	switch (spec->codec_variant) {
3198 	case ALC269_TYPE_ALC269VA:
3199 	case ALC269_TYPE_ALC269VC:
3200 	case ALC269_TYPE_ALC280:
3201 	case ALC269_TYPE_ALC284:
3202 	case ALC269_TYPE_ALC293:
3203 		ssids = alc269va_ssids;
3204 		break;
3205 	case ALC269_TYPE_ALC269VB:
3206 	case ALC269_TYPE_ALC269VD:
3207 	case ALC269_TYPE_ALC282:
3208 	case ALC269_TYPE_ALC283:
3209 	case ALC269_TYPE_ALC286:
3210 	case ALC269_TYPE_ALC298:
3211 	case ALC269_TYPE_ALC255:
3212 	case ALC269_TYPE_ALC256:
3213 	case ALC269_TYPE_ALC257:
3214 	case ALC269_TYPE_ALC215:
3215 	case ALC269_TYPE_ALC225:
3216 	case ALC269_TYPE_ALC245:
3217 	case ALC269_TYPE_ALC287:
3218 	case ALC269_TYPE_ALC294:
3219 	case ALC269_TYPE_ALC300:
3220 	case ALC269_TYPE_ALC623:
3221 	case ALC269_TYPE_ALC700:
3222 		ssids = alc269_ssids;
3223 		break;
3224 	default:
3225 		ssids = alc269_ssids;
3226 		break;
3227 	}
3228 
3229 	return alc_parse_auto_config(codec, alc269_ignore, ssids);
3230 }
3231 
3232 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3233 	{ SND_JACK_BTN_0, KEY_PLAYPAUSE },
3234 	{ SND_JACK_BTN_1, KEY_VOICECOMMAND },
3235 	{ SND_JACK_BTN_2, KEY_VOLUMEUP },
3236 	{ SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3237 	{}
3238 };
3239 
3240 static void alc_headset_btn_callback(struct hda_codec *codec,
3241 				     struct hda_jack_callback *jack)
3242 {
3243 	int report = 0;
3244 
3245 	if (jack->unsol_res & (7 << 13))
3246 		report |= SND_JACK_BTN_0;
3247 
3248 	if (jack->unsol_res  & (1 << 16 | 3 << 8))
3249 		report |= SND_JACK_BTN_1;
3250 
3251 	/* Volume up key */
3252 	if (jack->unsol_res & (7 << 23))
3253 		report |= SND_JACK_BTN_2;
3254 
3255 	/* Volume down key */
3256 	if (jack->unsol_res & (7 << 10))
3257 		report |= SND_JACK_BTN_3;
3258 
3259 	snd_hda_jack_set_button_state(codec, jack->nid, report);
3260 }
3261 
3262 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3263 {
3264 	struct alc_spec *spec = codec->spec;
3265 
3266 	if (!spec->has_hs_key)
3267 		return;
3268 
3269 	switch (codec->core.vendor_id) {
3270 	case 0x10ec0215:
3271 	case 0x10ec0225:
3272 	case 0x10ec0285:
3273 	case 0x10ec0287:
3274 	case 0x10ec0295:
3275 	case 0x10ec0289:
3276 	case 0x10ec0299:
3277 		alc_write_coef_idx(codec, 0x48, 0x0);
3278 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3279 		alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3280 		break;
3281 	case 0x10ec0230:
3282 	case 0x10ec0236:
3283 	case 0x10ec0256:
3284 	case 0x10ec0257:
3285 	case 0x19e58326:
3286 		alc_write_coef_idx(codec, 0x48, 0x0);
3287 		alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3288 		break;
3289 	}
3290 }
3291 
3292 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3293 {
3294 	struct alc_spec *spec = codec->spec;
3295 
3296 	if (!spec->has_hs_key)
3297 		return;
3298 
3299 	switch (codec->core.vendor_id) {
3300 	case 0x10ec0215:
3301 	case 0x10ec0225:
3302 	case 0x10ec0285:
3303 	case 0x10ec0287:
3304 	case 0x10ec0295:
3305 	case 0x10ec0289:
3306 	case 0x10ec0299:
3307 		alc_write_coef_idx(codec, 0x48, 0xd011);
3308 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3309 		alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3310 		break;
3311 	case 0x10ec0230:
3312 	case 0x10ec0236:
3313 	case 0x10ec0256:
3314 	case 0x10ec0257:
3315 	case 0x19e58326:
3316 		alc_write_coef_idx(codec, 0x48, 0xd011);
3317 		alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3318 		break;
3319 	}
3320 }
3321 
3322 static void alc_fixup_headset_jack(struct hda_codec *codec,
3323 				    const struct hda_fixup *fix, int action)
3324 {
3325 	struct alc_spec *spec = codec->spec;
3326 	hda_nid_t hp_pin;
3327 
3328 	switch (action) {
3329 	case HDA_FIXUP_ACT_PRE_PROBE:
3330 		spec->has_hs_key = 1;
3331 		snd_hda_jack_detect_enable_callback(codec, 0x55,
3332 						    alc_headset_btn_callback);
3333 		break;
3334 	case HDA_FIXUP_ACT_BUILD:
3335 		hp_pin = alc_get_hp_pin(spec);
3336 		if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3337 							alc_headset_btn_keymap,
3338 							hp_pin))
3339 			snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3340 					      false, SND_JACK_HEADSET,
3341 					      alc_headset_btn_keymap);
3342 
3343 		alc_enable_headset_jack_key(codec);
3344 		break;
3345 	}
3346 }
3347 
3348 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3349 {
3350 	alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3351 }
3352 
3353 static void alc269_shutup(struct hda_codec *codec)
3354 {
3355 	struct alc_spec *spec = codec->spec;
3356 
3357 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3358 		alc269vb_toggle_power_output(codec, 0);
3359 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3360 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
3361 		msleep(150);
3362 	}
3363 	alc_shutup_pins(codec);
3364 }
3365 
3366 static const struct coef_fw alc282_coefs[] = {
3367 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3368 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3369 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3370 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3371 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3372 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3373 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3374 	WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3375 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3376 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3377 	WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3378 	UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3379 	WRITE_COEF(0x34, 0xa0c0), /* ANC */
3380 	UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3381 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3382 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3383 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3384 	WRITE_COEF(0x63, 0x2902), /* PLL */
3385 	WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3386 	WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3387 	WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3388 	WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3389 	UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3390 	WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3391 	UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3392 	WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3393 	WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3394 	UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3395 	WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3396 	{}
3397 };
3398 
3399 static void alc282_restore_default_value(struct hda_codec *codec)
3400 {
3401 	alc_process_coef_fw(codec, alc282_coefs);
3402 }
3403 
3404 static void alc282_init(struct hda_codec *codec)
3405 {
3406 	struct alc_spec *spec = codec->spec;
3407 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3408 	bool hp_pin_sense;
3409 	int coef78;
3410 
3411 	alc282_restore_default_value(codec);
3412 
3413 	if (!hp_pin)
3414 		return;
3415 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3416 	coef78 = alc_read_coef_idx(codec, 0x78);
3417 
3418 	/* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3419 	/* Headphone capless set to high power mode */
3420 	alc_write_coef_idx(codec, 0x78, 0x9004);
3421 
3422 	if (hp_pin_sense)
3423 		msleep(2);
3424 
3425 	snd_hda_codec_write(codec, hp_pin, 0,
3426 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3427 
3428 	if (hp_pin_sense)
3429 		msleep(85);
3430 
3431 	snd_hda_codec_write(codec, hp_pin, 0,
3432 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3433 
3434 	if (hp_pin_sense)
3435 		msleep(100);
3436 
3437 	/* Headphone capless set to normal mode */
3438 	alc_write_coef_idx(codec, 0x78, coef78);
3439 }
3440 
3441 static void alc282_shutup(struct hda_codec *codec)
3442 {
3443 	struct alc_spec *spec = codec->spec;
3444 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3445 	bool hp_pin_sense;
3446 	int coef78;
3447 
3448 	if (!hp_pin) {
3449 		alc269_shutup(codec);
3450 		return;
3451 	}
3452 
3453 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3454 	coef78 = alc_read_coef_idx(codec, 0x78);
3455 	alc_write_coef_idx(codec, 0x78, 0x9004);
3456 
3457 	if (hp_pin_sense)
3458 		msleep(2);
3459 
3460 	snd_hda_codec_write(codec, hp_pin, 0,
3461 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3462 
3463 	if (hp_pin_sense)
3464 		msleep(85);
3465 
3466 	if (!spec->no_shutup_pins)
3467 		snd_hda_codec_write(codec, hp_pin, 0,
3468 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3469 
3470 	if (hp_pin_sense)
3471 		msleep(100);
3472 
3473 	alc_auto_setup_eapd(codec, false);
3474 	alc_shutup_pins(codec);
3475 	alc_write_coef_idx(codec, 0x78, coef78);
3476 }
3477 
3478 static const struct coef_fw alc283_coefs[] = {
3479 	WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3480 	UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3481 	WRITE_COEF(0x07, 0x0200), /* DMIC control */
3482 	UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3483 	UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3484 	WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3485 	WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3486 	WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3487 	UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3488 	UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3489 	WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3490 	UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3491 	WRITE_COEF(0x22, 0xa0c0), /* ANC */
3492 	UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3493 	UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3494 	UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3495 	WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3496 	WRITE_COEF(0x2e, 0x2902), /* PLL */
3497 	WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3498 	WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3499 	WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3500 	WRITE_COEF(0x36, 0x0), /* capless control 5 */
3501 	UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3502 	WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3503 	UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3504 	WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3505 	WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3506 	UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3507 	WRITE_COEF(0x49, 0x0), /* test mode */
3508 	UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3509 	UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3510 	WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3511 	UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3512 	{}
3513 };
3514 
3515 static void alc283_restore_default_value(struct hda_codec *codec)
3516 {
3517 	alc_process_coef_fw(codec, alc283_coefs);
3518 }
3519 
3520 static void alc283_init(struct hda_codec *codec)
3521 {
3522 	struct alc_spec *spec = codec->spec;
3523 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3524 	bool hp_pin_sense;
3525 
3526 	alc283_restore_default_value(codec);
3527 
3528 	if (!hp_pin)
3529 		return;
3530 
3531 	msleep(30);
3532 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3533 
3534 	/* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3535 	/* Headphone capless set to high power mode */
3536 	alc_write_coef_idx(codec, 0x43, 0x9004);
3537 
3538 	snd_hda_codec_write(codec, hp_pin, 0,
3539 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3540 
3541 	if (hp_pin_sense)
3542 		msleep(85);
3543 
3544 	snd_hda_codec_write(codec, hp_pin, 0,
3545 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3546 
3547 	if (hp_pin_sense)
3548 		msleep(85);
3549 	/* Index 0x46 Combo jack auto switch control 2 */
3550 	/* 3k pull low control for Headset jack. */
3551 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3552 	/* Headphone capless set to normal mode */
3553 	alc_write_coef_idx(codec, 0x43, 0x9614);
3554 }
3555 
3556 static void alc283_shutup(struct hda_codec *codec)
3557 {
3558 	struct alc_spec *spec = codec->spec;
3559 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3560 	bool hp_pin_sense;
3561 
3562 	if (!hp_pin) {
3563 		alc269_shutup(codec);
3564 		return;
3565 	}
3566 
3567 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3568 
3569 	alc_write_coef_idx(codec, 0x43, 0x9004);
3570 
3571 	/*depop hp during suspend*/
3572 	alc_write_coef_idx(codec, 0x06, 0x2100);
3573 
3574 	snd_hda_codec_write(codec, hp_pin, 0,
3575 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3576 
3577 	if (hp_pin_sense)
3578 		msleep(100);
3579 
3580 	if (!spec->no_shutup_pins)
3581 		snd_hda_codec_write(codec, hp_pin, 0,
3582 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3583 
3584 	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3585 
3586 	if (hp_pin_sense)
3587 		msleep(100);
3588 	alc_auto_setup_eapd(codec, false);
3589 	alc_shutup_pins(codec);
3590 	alc_write_coef_idx(codec, 0x43, 0x9614);
3591 }
3592 
3593 static void alc256_init(struct hda_codec *codec)
3594 {
3595 	struct alc_spec *spec = codec->spec;
3596 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3597 	bool hp_pin_sense;
3598 
3599 	if (spec->ultra_low_power) {
3600 		alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3601 		alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3602 		alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3603 		alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3604 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3605 		msleep(30);
3606 	}
3607 
3608 	if (!hp_pin)
3609 		hp_pin = 0x21;
3610 
3611 	msleep(30);
3612 
3613 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3614 
3615 	if (hp_pin_sense)
3616 		msleep(2);
3617 
3618 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3619 
3620 	snd_hda_codec_write(codec, hp_pin, 0,
3621 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3622 
3623 	if (hp_pin_sense || spec->ultra_low_power)
3624 		msleep(85);
3625 
3626 	snd_hda_codec_write(codec, hp_pin, 0,
3627 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3628 
3629 	if (hp_pin_sense || spec->ultra_low_power)
3630 		msleep(100);
3631 
3632 	alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3633 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3634 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3635 	alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3636 	/*
3637 	 * Expose headphone mic (or possibly Line In on some machines) instead
3638 	 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3639 	 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3640 	 * this register.
3641 	 */
3642 	alc_write_coef_idx(codec, 0x36, 0x5757);
3643 }
3644 
3645 static void alc256_shutup(struct hda_codec *codec)
3646 {
3647 	struct alc_spec *spec = codec->spec;
3648 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3649 	bool hp_pin_sense;
3650 
3651 	if (!hp_pin)
3652 		hp_pin = 0x21;
3653 
3654 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3655 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3656 
3657 	if (hp_pin_sense)
3658 		msleep(2);
3659 
3660 	snd_hda_codec_write(codec, hp_pin, 0,
3661 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3662 
3663 	if (hp_pin_sense || spec->ultra_low_power)
3664 		msleep(85);
3665 
3666 	/* 3k pull low control for Headset jack. */
3667 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
3668 	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3669 	 * when booting with headset plugged. So skip setting it for the codec alc257
3670 	 */
3671 	if (spec->en_3kpull_low)
3672 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3673 
3674 	if (!spec->no_shutup_pins)
3675 		snd_hda_codec_write(codec, hp_pin, 0,
3676 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3677 
3678 	if (hp_pin_sense || spec->ultra_low_power)
3679 		msleep(100);
3680 
3681 	alc_auto_setup_eapd(codec, false);
3682 	alc_shutup_pins(codec);
3683 	if (spec->ultra_low_power) {
3684 		msleep(50);
3685 		alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3686 		alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3687 		alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3688 		alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3689 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3690 		msleep(30);
3691 	}
3692 }
3693 
3694 static void alc285_hp_init(struct hda_codec *codec)
3695 {
3696 	struct alc_spec *spec = codec->spec;
3697 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3698 	int i, val;
3699 	int coef38, coef0d, coef36;
3700 
3701 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3702 	alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3703 	coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3704 	coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3705 	coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3706 	alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3707 	alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3708 
3709 	alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3710 
3711 	if (hp_pin)
3712 		snd_hda_codec_write(codec, hp_pin, 0,
3713 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3714 
3715 	msleep(130);
3716 	alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3717 	alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3718 
3719 	if (hp_pin)
3720 		snd_hda_codec_write(codec, hp_pin, 0,
3721 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3722 	msleep(10);
3723 	alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3724 	alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3725 	alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3726 	alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3727 
3728 	alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3729 	val = alc_read_coefex_idx(codec, 0x58, 0x00);
3730 	for (i = 0; i < 20 && val & 0x8000; i++) {
3731 		msleep(50);
3732 		val = alc_read_coefex_idx(codec, 0x58, 0x00);
3733 	} /* Wait for depop procedure finish  */
3734 
3735 	alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3736 	alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3737 	alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3738 	alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3739 
3740 	msleep(50);
3741 	alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3742 }
3743 
3744 static void alc225_init(struct hda_codec *codec)
3745 {
3746 	struct alc_spec *spec = codec->spec;
3747 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3748 	bool hp1_pin_sense, hp2_pin_sense;
3749 
3750 	if (spec->ultra_low_power) {
3751 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3752 		alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3753 		alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3754 		msleep(30);
3755 	}
3756 
3757 	if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3758 		spec->codec_variant != ALC269_TYPE_ALC245)
3759 		/* required only at boot or S3 and S4 resume time */
3760 		if (!spec->done_hp_init ||
3761 			is_s3_resume(codec) ||
3762 			is_s4_resume(codec)) {
3763 			alc285_hp_init(codec);
3764 			spec->done_hp_init = true;
3765 		}
3766 
3767 	if (!hp_pin)
3768 		hp_pin = 0x21;
3769 	msleep(30);
3770 
3771 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3772 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3773 
3774 	if (hp1_pin_sense || hp2_pin_sense)
3775 		msleep(2);
3776 
3777 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3778 
3779 	if (hp1_pin_sense || spec->ultra_low_power)
3780 		snd_hda_codec_write(codec, hp_pin, 0,
3781 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3782 	if (hp2_pin_sense)
3783 		snd_hda_codec_write(codec, 0x16, 0,
3784 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3785 
3786 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3787 		msleep(85);
3788 
3789 	if (hp1_pin_sense || spec->ultra_low_power)
3790 		snd_hda_codec_write(codec, hp_pin, 0,
3791 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3792 	if (hp2_pin_sense)
3793 		snd_hda_codec_write(codec, 0x16, 0,
3794 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3795 
3796 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3797 		msleep(100);
3798 
3799 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3800 	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3801 }
3802 
3803 static void alc225_shutup(struct hda_codec *codec)
3804 {
3805 	struct alc_spec *spec = codec->spec;
3806 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3807 	bool hp1_pin_sense, hp2_pin_sense;
3808 
3809 	if (!hp_pin)
3810 		hp_pin = 0x21;
3811 
3812 	alc_disable_headset_jack_key(codec);
3813 	/* 3k pull low control for Headset jack. */
3814 	alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3815 
3816 	hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3817 	hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3818 
3819 	if (hp1_pin_sense || hp2_pin_sense)
3820 		msleep(2);
3821 
3822 	if (hp1_pin_sense || spec->ultra_low_power)
3823 		snd_hda_codec_write(codec, hp_pin, 0,
3824 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3825 	if (hp2_pin_sense)
3826 		snd_hda_codec_write(codec, 0x16, 0,
3827 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3828 
3829 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3830 		msleep(85);
3831 
3832 	if (hp1_pin_sense || spec->ultra_low_power)
3833 		snd_hda_codec_write(codec, hp_pin, 0,
3834 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3835 	if (hp2_pin_sense)
3836 		snd_hda_codec_write(codec, 0x16, 0,
3837 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3838 
3839 	if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3840 		msleep(100);
3841 
3842 	alc_auto_setup_eapd(codec, false);
3843 	alc_shutup_pins(codec);
3844 	if (spec->ultra_low_power) {
3845 		msleep(50);
3846 		alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3847 		alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3848 		alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3849 		alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3850 		msleep(30);
3851 	}
3852 
3853 	alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3854 	alc_enable_headset_jack_key(codec);
3855 }
3856 
3857 static void alc_default_init(struct hda_codec *codec)
3858 {
3859 	struct alc_spec *spec = codec->spec;
3860 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3861 	bool hp_pin_sense;
3862 
3863 	if (!hp_pin)
3864 		return;
3865 
3866 	msleep(30);
3867 
3868 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3869 
3870 	if (hp_pin_sense)
3871 		msleep(2);
3872 
3873 	snd_hda_codec_write(codec, hp_pin, 0,
3874 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3875 
3876 	if (hp_pin_sense)
3877 		msleep(85);
3878 
3879 	snd_hda_codec_write(codec, hp_pin, 0,
3880 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3881 
3882 	if (hp_pin_sense)
3883 		msleep(100);
3884 }
3885 
3886 static void alc_default_shutup(struct hda_codec *codec)
3887 {
3888 	struct alc_spec *spec = codec->spec;
3889 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3890 	bool hp_pin_sense;
3891 
3892 	if (!hp_pin) {
3893 		alc269_shutup(codec);
3894 		return;
3895 	}
3896 
3897 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3898 
3899 	if (hp_pin_sense)
3900 		msleep(2);
3901 
3902 	snd_hda_codec_write(codec, hp_pin, 0,
3903 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3904 
3905 	if (hp_pin_sense)
3906 		msleep(85);
3907 
3908 	if (!spec->no_shutup_pins)
3909 		snd_hda_codec_write(codec, hp_pin, 0,
3910 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3911 
3912 	if (hp_pin_sense)
3913 		msleep(100);
3914 
3915 	alc_auto_setup_eapd(codec, false);
3916 	alc_shutup_pins(codec);
3917 }
3918 
3919 static void alc294_hp_init(struct hda_codec *codec)
3920 {
3921 	struct alc_spec *spec = codec->spec;
3922 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
3923 	int i, val;
3924 
3925 	if (!hp_pin)
3926 		return;
3927 
3928 	snd_hda_codec_write(codec, hp_pin, 0,
3929 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3930 
3931 	msleep(100);
3932 
3933 	if (!spec->no_shutup_pins)
3934 		snd_hda_codec_write(codec, hp_pin, 0,
3935 				    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3936 
3937 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3938 	alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3939 
3940 	/* Wait for depop procedure finish  */
3941 	val = alc_read_coefex_idx(codec, 0x58, 0x01);
3942 	for (i = 0; i < 20 && val & 0x0080; i++) {
3943 		msleep(50);
3944 		val = alc_read_coefex_idx(codec, 0x58, 0x01);
3945 	}
3946 	/* Set HP depop to auto mode */
3947 	alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3948 	msleep(50);
3949 }
3950 
3951 static void alc294_init(struct hda_codec *codec)
3952 {
3953 	struct alc_spec *spec = codec->spec;
3954 
3955 	/* required only at boot or S4 resume time */
3956 	if (!spec->done_hp_init ||
3957 	    codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3958 		alc294_hp_init(codec);
3959 		spec->done_hp_init = true;
3960 	}
3961 	alc_default_init(codec);
3962 }
3963 
3964 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3965 			     unsigned int val)
3966 {
3967 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3968 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3969 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3970 }
3971 
3972 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3973 {
3974 	unsigned int val;
3975 
3976 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3977 	val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3978 		& 0xffff;
3979 	val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3980 		<< 16;
3981 	return val;
3982 }
3983 
3984 static void alc5505_dsp_halt(struct hda_codec *codec)
3985 {
3986 	unsigned int val;
3987 
3988 	alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3989 	alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3990 	alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3991 	alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3992 	alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3993 	alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3994 	alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3995 	val = alc5505_coef_get(codec, 0x6220);
3996 	alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3997 }
3998 
3999 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
4000 {
4001 	alc5505_coef_set(codec, 0x61b8, 0x04133302);
4002 	alc5505_coef_set(codec, 0x61b0, 0x00005b16);
4003 	alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
4004 	alc5505_coef_set(codec, 0x6230, 0xf80d4011);
4005 	alc5505_coef_set(codec, 0x6220, 0x2002010f);
4006 	alc5505_coef_set(codec, 0x880c, 0x00000004);
4007 }
4008 
4009 static void alc5505_dsp_init(struct hda_codec *codec)
4010 {
4011 	unsigned int val;
4012 
4013 	alc5505_dsp_halt(codec);
4014 	alc5505_dsp_back_from_halt(codec);
4015 	alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4016 	alc5505_coef_set(codec, 0x61b0, 0x5b16);
4017 	alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4018 	alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4019 	alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4020 	alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4021 	snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4022 	alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4023 	alc5505_coef_set(codec, 0x61b8, 0x04173302);
4024 	alc5505_coef_set(codec, 0x61b8, 0x04163302);
4025 	alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4026 	alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4027 	alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4028 
4029 	val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4030 	if (val <= 3)
4031 		alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4032 	else
4033 		alc5505_coef_set(codec, 0x6220, 0x6002018f);
4034 
4035 	alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4036 	alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4037 	alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4038 	alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4039 	alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4040 	alc5505_coef_set(codec, 0x880c, 0x00000003);
4041 	alc5505_coef_set(codec, 0x880c, 0x00000010);
4042 
4043 #ifdef HALT_REALTEK_ALC5505
4044 	alc5505_dsp_halt(codec);
4045 #endif
4046 }
4047 
4048 #ifdef HALT_REALTEK_ALC5505
4049 #define alc5505_dsp_suspend(codec)	do { } while (0) /* NOP */
4050 #define alc5505_dsp_resume(codec)	do { } while (0) /* NOP */
4051 #else
4052 #define alc5505_dsp_suspend(codec)	alc5505_dsp_halt(codec)
4053 #define alc5505_dsp_resume(codec)	alc5505_dsp_back_from_halt(codec)
4054 #endif
4055 
4056 static int alc269_suspend(struct hda_codec *codec)
4057 {
4058 	struct alc_spec *spec = codec->spec;
4059 
4060 	if (spec->has_alc5505_dsp)
4061 		alc5505_dsp_suspend(codec);
4062 
4063 	return alc_suspend(codec);
4064 }
4065 
4066 static int alc269_resume(struct hda_codec *codec)
4067 {
4068 	struct alc_spec *spec = codec->spec;
4069 
4070 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4071 		alc269vb_toggle_power_output(codec, 0);
4072 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4073 			(alc_get_coef0(codec) & 0x00ff) == 0x018) {
4074 		msleep(150);
4075 	}
4076 
4077 	codec->patch_ops.init(codec);
4078 
4079 	if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4080 		alc269vb_toggle_power_output(codec, 1);
4081 	if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4082 			(alc_get_coef0(codec) & 0x00ff) == 0x017) {
4083 		msleep(200);
4084 	}
4085 
4086 	snd_hda_regmap_sync(codec);
4087 	hda_call_check_power_status(codec, 0x01);
4088 
4089 	/* on some machine, the BIOS will clear the codec gpio data when enter
4090 	 * suspend, and won't restore the data after resume, so we restore it
4091 	 * in the driver.
4092 	 */
4093 	if (spec->gpio_data)
4094 		alc_write_gpio_data(codec);
4095 
4096 	if (spec->has_alc5505_dsp)
4097 		alc5505_dsp_resume(codec);
4098 
4099 	return 0;
4100 }
4101 
4102 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4103 						 const struct hda_fixup *fix, int action)
4104 {
4105 	struct alc_spec *spec = codec->spec;
4106 
4107 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4108 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4109 }
4110 
4111 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4112 						 const struct hda_fixup *fix,
4113 						 int action)
4114 {
4115 	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4116 	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4117 
4118 	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4119 		snd_hda_codec_set_pincfg(codec, 0x19,
4120 			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
4121 			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4122 }
4123 
4124 static void alc269_fixup_hweq(struct hda_codec *codec,
4125 			       const struct hda_fixup *fix, int action)
4126 {
4127 	if (action == HDA_FIXUP_ACT_INIT)
4128 		alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4129 }
4130 
4131 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4132 				       const struct hda_fixup *fix, int action)
4133 {
4134 	struct alc_spec *spec = codec->spec;
4135 
4136 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4137 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4138 }
4139 
4140 static void alc271_fixup_dmic(struct hda_codec *codec,
4141 			      const struct hda_fixup *fix, int action)
4142 {
4143 	static const struct hda_verb verbs[] = {
4144 		{0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4145 		{0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4146 		{}
4147 	};
4148 	unsigned int cfg;
4149 
4150 	if (strcmp(codec->core.chip_name, "ALC271X") &&
4151 	    strcmp(codec->core.chip_name, "ALC269VB"))
4152 		return;
4153 	cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4154 	if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4155 		snd_hda_sequence_write(codec, verbs);
4156 }
4157 
4158 /* Fix the speaker amp after resume, etc */
4159 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4160 					  const struct hda_fixup *fix,
4161 					  int action)
4162 {
4163 	if (action == HDA_FIXUP_ACT_INIT)
4164 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4165 }
4166 
4167 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4168 				 const struct hda_fixup *fix, int action)
4169 {
4170 	struct alc_spec *spec = codec->spec;
4171 
4172 	if (action != HDA_FIXUP_ACT_PROBE)
4173 		return;
4174 
4175 	/* Due to a hardware problem on Lenovo Ideadpad, we need to
4176 	 * fix the sample rate of analog I/O to 44.1kHz
4177 	 */
4178 	spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4179 	spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4180 }
4181 
4182 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4183 				     const struct hda_fixup *fix, int action)
4184 {
4185 	/* The digital-mic unit sends PDM (differential signal) instead of
4186 	 * the standard PCM, thus you can't record a valid mono stream as is.
4187 	 * Below is a workaround specific to ALC269 to control the dmic
4188 	 * signal source as mono.
4189 	 */
4190 	if (action == HDA_FIXUP_ACT_INIT)
4191 		alc_update_coef_idx(codec, 0x07, 0, 0x80);
4192 }
4193 
4194 static void alc269_quanta_automute(struct hda_codec *codec)
4195 {
4196 	snd_hda_gen_update_outputs(codec);
4197 
4198 	alc_write_coef_idx(codec, 0x0c, 0x680);
4199 	alc_write_coef_idx(codec, 0x0c, 0x480);
4200 }
4201 
4202 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4203 				     const struct hda_fixup *fix, int action)
4204 {
4205 	struct alc_spec *spec = codec->spec;
4206 	if (action != HDA_FIXUP_ACT_PROBE)
4207 		return;
4208 	spec->gen.automute_hook = alc269_quanta_automute;
4209 }
4210 
4211 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4212 					 struct hda_jack_callback *jack)
4213 {
4214 	struct alc_spec *spec = codec->spec;
4215 	int vref;
4216 	msleep(200);
4217 	snd_hda_gen_hp_automute(codec, jack);
4218 
4219 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4220 	msleep(100);
4221 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4222 			    vref);
4223 	msleep(500);
4224 	snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4225 			    vref);
4226 }
4227 
4228 /*
4229  * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4230  */
4231 struct hda_alc298_mbxinit {
4232 	unsigned char value_0x23;
4233 	unsigned char value_0x25;
4234 };
4235 
4236 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4237 					 const struct hda_alc298_mbxinit *initval,
4238 					 bool first)
4239 {
4240 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4241 	alc_write_coef_idx(codec, 0x26, 0xb000);
4242 
4243 	if (first)
4244 		snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4245 
4246 	snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4247 	alc_write_coef_idx(codec, 0x26, 0xf000);
4248 	alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4249 
4250 	if (initval->value_0x23 != 0x1e)
4251 		alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4252 
4253 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4254 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4255 }
4256 
4257 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4258 					   const struct hda_fixup *fix,
4259 					   int action)
4260 {
4261 	/* Initialization magic */
4262 	static const struct hda_alc298_mbxinit dac_init[] = {
4263 		{0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4264 		{0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4265 		{0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4266 		{0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4267 		{0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4268 		{0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4269 		{0x2f, 0x00},
4270 		{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4271 		{0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4272 		{0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4273 		{}
4274 	};
4275 	const struct hda_alc298_mbxinit *seq;
4276 
4277 	if (action != HDA_FIXUP_ACT_INIT)
4278 		return;
4279 
4280 	/* Start */
4281 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4282 	snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4283 	alc_write_coef_idx(codec, 0x26, 0xf000);
4284 	alc_write_coef_idx(codec, 0x22, 0x31);
4285 	alc_write_coef_idx(codec, 0x23, 0x0b);
4286 	alc_write_coef_idx(codec, 0x25, 0x00);
4287 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4288 	snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4289 
4290 	for (seq = dac_init; seq->value_0x23; seq++)
4291 		alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4292 }
4293 
4294 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4295 				     const struct hda_fixup *fix, int action)
4296 {
4297 	struct alc_spec *spec = codec->spec;
4298 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4299 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4300 		spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4301 	}
4302 }
4303 
4304 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4305 				bool polarity, bool on)
4306 {
4307 	unsigned int pinval;
4308 
4309 	if (!pin)
4310 		return;
4311 	if (polarity)
4312 		on = !on;
4313 	pinval = snd_hda_codec_get_pin_target(codec, pin);
4314 	pinval &= ~AC_PINCTL_VREFEN;
4315 	pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4316 	/* temporarily power up/down for setting VREF */
4317 	snd_hda_power_up_pm(codec);
4318 	snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4319 	snd_hda_power_down_pm(codec);
4320 }
4321 
4322 /* update mute-LED according to the speaker mute state via mic VREF pin */
4323 static int vref_mute_led_set(struct led_classdev *led_cdev,
4324 			     enum led_brightness brightness)
4325 {
4326 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4327 	struct alc_spec *spec = codec->spec;
4328 
4329 	alc_update_vref_led(codec, spec->mute_led_nid,
4330 			    spec->mute_led_polarity, brightness);
4331 	return 0;
4332 }
4333 
4334 /* Make sure the led works even in runtime suspend */
4335 static unsigned int led_power_filter(struct hda_codec *codec,
4336 						  hda_nid_t nid,
4337 						  unsigned int power_state)
4338 {
4339 	struct alc_spec *spec = codec->spec;
4340 
4341 	if (power_state != AC_PWRST_D3 || nid == 0 ||
4342 	    (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4343 		return power_state;
4344 
4345 	/* Set pin ctl again, it might have just been set to 0 */
4346 	snd_hda_set_pin_ctl(codec, nid,
4347 			    snd_hda_codec_get_pin_target(codec, nid));
4348 
4349 	return snd_hda_gen_path_power_filter(codec, nid, power_state);
4350 }
4351 
4352 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4353 				     const struct hda_fixup *fix, int action)
4354 {
4355 	struct alc_spec *spec = codec->spec;
4356 	const struct dmi_device *dev = NULL;
4357 
4358 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4359 		return;
4360 
4361 	while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4362 		int pol, pin;
4363 		if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4364 			continue;
4365 		if (pin < 0x0a || pin >= 0x10)
4366 			break;
4367 		spec->mute_led_polarity = pol;
4368 		spec->mute_led_nid = pin - 0x0a + 0x18;
4369 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4370 		codec->power_filter = led_power_filter;
4371 		codec_dbg(codec,
4372 			  "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4373 			   spec->mute_led_polarity);
4374 		break;
4375 	}
4376 }
4377 
4378 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4379 					  const struct hda_fixup *fix,
4380 					  int action, hda_nid_t pin)
4381 {
4382 	struct alc_spec *spec = codec->spec;
4383 
4384 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4385 		spec->mute_led_polarity = 0;
4386 		spec->mute_led_nid = pin;
4387 		snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4388 		codec->power_filter = led_power_filter;
4389 	}
4390 }
4391 
4392 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4393 				const struct hda_fixup *fix, int action)
4394 {
4395 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4396 }
4397 
4398 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4399 				const struct hda_fixup *fix, int action)
4400 {
4401 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4402 }
4403 
4404 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4405 				const struct hda_fixup *fix, int action)
4406 {
4407 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4408 }
4409 
4410 /* update LED status via GPIO */
4411 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4412 				int polarity, bool enabled)
4413 {
4414 	if (polarity)
4415 		enabled = !enabled;
4416 	alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4417 }
4418 
4419 /* turn on/off mute LED via GPIO per vmaster hook */
4420 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4421 			     enum led_brightness brightness)
4422 {
4423 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4424 	struct alc_spec *spec = codec->spec;
4425 
4426 	alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4427 			    spec->mute_led_polarity, !brightness);
4428 	return 0;
4429 }
4430 
4431 /* turn on/off mic-mute LED via GPIO per capture hook */
4432 static int micmute_led_set(struct led_classdev *led_cdev,
4433 			   enum led_brightness brightness)
4434 {
4435 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4436 	struct alc_spec *spec = codec->spec;
4437 
4438 	alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4439 			    spec->micmute_led_polarity, !brightness);
4440 	return 0;
4441 }
4442 
4443 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4444 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4445 				  int action,
4446 				  unsigned int mute_mask,
4447 				  unsigned int micmute_mask)
4448 {
4449 	struct alc_spec *spec = codec->spec;
4450 
4451 	alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4452 
4453 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
4454 		return;
4455 	if (mute_mask) {
4456 		spec->gpio_mute_led_mask = mute_mask;
4457 		snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4458 	}
4459 	if (micmute_mask) {
4460 		spec->gpio_mic_led_mask = micmute_mask;
4461 		snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4462 	}
4463 }
4464 
4465 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4466 				const struct hda_fixup *fix, int action)
4467 {
4468 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4469 }
4470 
4471 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4472 				const struct hda_fixup *fix, int action)
4473 {
4474 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4475 }
4476 
4477 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4478 				const struct hda_fixup *fix, int action)
4479 {
4480 	alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4481 }
4482 
4483 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4484 				const struct hda_fixup *fix, int action)
4485 {
4486 	alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4487 }
4488 
4489 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4490 				const struct hda_fixup *fix, int action)
4491 {
4492 	alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4493 }
4494 
4495 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4496 				const struct hda_fixup *fix, int action)
4497 {
4498 	struct alc_spec *spec = codec->spec;
4499 
4500 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4501 		spec->micmute_led_polarity = 1;
4502 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4503 }
4504 
4505 /* turn on/off mic-mute LED per capture hook via VREF change */
4506 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4507 				enum led_brightness brightness)
4508 {
4509 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4510 	struct alc_spec *spec = codec->spec;
4511 
4512 	alc_update_vref_led(codec, spec->cap_mute_led_nid,
4513 			    spec->micmute_led_polarity, brightness);
4514 	return 0;
4515 }
4516 
4517 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4518 				const struct hda_fixup *fix, int action)
4519 {
4520 	struct alc_spec *spec = codec->spec;
4521 
4522 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4523 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4524 		/* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4525 		 * enable headphone amp
4526 		 */
4527 		spec->gpio_mask |= 0x10;
4528 		spec->gpio_dir |= 0x10;
4529 		spec->cap_mute_led_nid = 0x18;
4530 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4531 		codec->power_filter = led_power_filter;
4532 	}
4533 }
4534 
4535 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4536 				   const struct hda_fixup *fix, int action)
4537 {
4538 	struct alc_spec *spec = codec->spec;
4539 
4540 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4541 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4542 		spec->cap_mute_led_nid = 0x18;
4543 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4544 		codec->power_filter = led_power_filter;
4545 	}
4546 }
4547 
4548 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4549  * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4550  */
4551 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4552 				     const struct hda_fixup *fix, int action)
4553 {
4554 	struct alc_spec *spec = codec->spec;
4555 
4556 	switch (action) {
4557 	case HDA_FIXUP_ACT_PRE_PROBE:
4558 		spec->gpio_mask |= 0x01;
4559 		spec->gpio_dir |= 0x01;
4560 		break;
4561 	case HDA_FIXUP_ACT_INIT:
4562 		/* need to toggle GPIO to enable the amp */
4563 		alc_update_gpio_data(codec, 0x01, true);
4564 		msleep(100);
4565 		alc_update_gpio_data(codec, 0x01, false);
4566 		break;
4567 	}
4568 }
4569 
4570 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4571 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4572 				    struct hda_codec *codec,
4573 				    struct snd_pcm_substream *substream,
4574 				    int action)
4575 {
4576 	switch (action) {
4577 	case HDA_GEN_PCM_ACT_PREPARE:
4578 		alc_update_gpio_data(codec, 0x04, true);
4579 		break;
4580 	case HDA_GEN_PCM_ACT_CLEANUP:
4581 		alc_update_gpio_data(codec, 0x04, false);
4582 		break;
4583 	}
4584 }
4585 
4586 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4587 				      const struct hda_fixup *fix,
4588 				      int action)
4589 {
4590 	struct alc_spec *spec = codec->spec;
4591 
4592 	if (action == HDA_FIXUP_ACT_PROBE) {
4593 		spec->gpio_mask |= 0x04;
4594 		spec->gpio_dir |= 0x04;
4595 		spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4596 	}
4597 }
4598 
4599 static void alc_update_coef_led(struct hda_codec *codec,
4600 				struct alc_coef_led *led,
4601 				bool polarity, bool on)
4602 {
4603 	if (polarity)
4604 		on = !on;
4605 	/* temporarily power up/down for setting COEF bit */
4606 	alc_update_coef_idx(codec, led->idx, led->mask,
4607 			    on ? led->on : led->off);
4608 }
4609 
4610 /* update mute-LED according to the speaker mute state via COEF bit */
4611 static int coef_mute_led_set(struct led_classdev *led_cdev,
4612 			     enum led_brightness brightness)
4613 {
4614 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4615 	struct alc_spec *spec = codec->spec;
4616 
4617 	alc_update_coef_led(codec, &spec->mute_led_coef,
4618 			    spec->mute_led_polarity, brightness);
4619 	return 0;
4620 }
4621 
4622 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4623 					  const struct hda_fixup *fix,
4624 					  int action)
4625 {
4626 	struct alc_spec *spec = codec->spec;
4627 
4628 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4629 		spec->mute_led_polarity = 0;
4630 		spec->mute_led_coef.idx = 0x0b;
4631 		spec->mute_led_coef.mask = 1 << 3;
4632 		spec->mute_led_coef.on = 1 << 3;
4633 		spec->mute_led_coef.off = 0;
4634 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4635 	}
4636 }
4637 
4638 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4639 					  const struct hda_fixup *fix,
4640 					  int action)
4641 {
4642 	struct alc_spec *spec = codec->spec;
4643 
4644 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4645 		spec->mute_led_polarity = 0;
4646 		spec->mute_led_coef.idx = 0x34;
4647 		spec->mute_led_coef.mask = 1 << 5;
4648 		spec->mute_led_coef.on = 0;
4649 		spec->mute_led_coef.off = 1 << 5;
4650 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4651 	}
4652 }
4653 
4654 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4655 					  const struct hda_fixup *fix, int action)
4656 {
4657 	struct alc_spec *spec = codec->spec;
4658 
4659 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4660 		spec->mute_led_polarity = 0;
4661 		spec->mute_led_coef.idx = 0x07;
4662 		spec->mute_led_coef.mask = 1;
4663 		spec->mute_led_coef.on = 1;
4664 		spec->mute_led_coef.off = 0;
4665 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4666 	}
4667 }
4668 
4669 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4670 					  const struct hda_fixup *fix,
4671 					  int action)
4672 {
4673 	struct alc_spec *spec = codec->spec;
4674 
4675 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4676 		spec->mute_led_polarity = 0;
4677 		spec->mute_led_coef.idx = 0x0b;
4678 		spec->mute_led_coef.mask = 3 << 2;
4679 		spec->mute_led_coef.on = 2 << 2;
4680 		spec->mute_led_coef.off = 1 << 2;
4681 		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4682 	}
4683 }
4684 
4685 /* turn on/off mic-mute LED per capture hook by coef bit */
4686 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4687 				enum led_brightness brightness)
4688 {
4689 	struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4690 	struct alc_spec *spec = codec->spec;
4691 
4692 	alc_update_coef_led(codec, &spec->mic_led_coef,
4693 			    spec->micmute_led_polarity, brightness);
4694 	return 0;
4695 }
4696 
4697 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4698 				const struct hda_fixup *fix, int action)
4699 {
4700 	struct alc_spec *spec = codec->spec;
4701 
4702 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4703 		spec->mic_led_coef.idx = 0x19;
4704 		spec->mic_led_coef.mask = 1 << 13;
4705 		spec->mic_led_coef.on = 1 << 13;
4706 		spec->mic_led_coef.off = 0;
4707 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4708 	}
4709 }
4710 
4711 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4712 				const struct hda_fixup *fix, int action)
4713 {
4714 	struct alc_spec *spec = codec->spec;
4715 
4716 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
4717 		spec->micmute_led_polarity = 1;
4718 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4719 }
4720 
4721 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4722 				const struct hda_fixup *fix, int action)
4723 {
4724 	struct alc_spec *spec = codec->spec;
4725 
4726 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4727 		spec->mic_led_coef.idx = 0x35;
4728 		spec->mic_led_coef.mask = 3 << 2;
4729 		spec->mic_led_coef.on = 2 << 2;
4730 		spec->mic_led_coef.off = 1 << 2;
4731 		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4732 	}
4733 }
4734 
4735 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4736 				const struct hda_fixup *fix, int action)
4737 {
4738 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4739 	alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4740 }
4741 
4742 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4743 				const struct hda_fixup *fix, int action)
4744 {
4745 	alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4746 	alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4747 }
4748 
4749 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4750 				const struct hda_fixup *fix, int action)
4751 {
4752 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4753 	alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4754 }
4755 
4756 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4757 				const struct hda_fixup *fix, int action)
4758 {
4759 	struct alc_spec *spec = codec->spec;
4760 
4761 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4762 		spec->cap_mute_led_nid = 0x1a;
4763 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4764 		codec->power_filter = led_power_filter;
4765 	}
4766 }
4767 
4768 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4769 				const struct hda_fixup *fix, int action)
4770 {
4771 	alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4772 	alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4773 }
4774 
4775 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4776 						  const unsigned short coefs[2])
4777 {
4778 	alc_write_coef_idx(codec, 0x23, coefs[0]);
4779 	alc_write_coef_idx(codec, 0x25, coefs[1]);
4780 	alc_write_coef_idx(codec, 0x26, 0xb011);
4781 }
4782 
4783 struct alc298_samsung_amp_desc {
4784 	unsigned char nid;
4785 	unsigned short init_seq[2][2];
4786 };
4787 
4788 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4789 				     const struct hda_fixup *fix, int action)
4790 {
4791 	int i, j;
4792 	static const unsigned short init_seq[][2] = {
4793 		{ 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4794 		{ 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4795 		{ 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4796 		{ 0x41, 0x07 }, { 0x400, 0x1 }
4797 	};
4798 	static const struct alc298_samsung_amp_desc amps[] = {
4799 		{ 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4800 		{ 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4801 	};
4802 
4803 	if (action != HDA_FIXUP_ACT_INIT)
4804 		return;
4805 
4806 	for (i = 0; i < ARRAY_SIZE(amps); i++) {
4807 		alc_write_coef_idx(codec, 0x22, amps[i].nid);
4808 
4809 		for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4810 			alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4811 
4812 		for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4813 			alc298_samsung_write_coef_pack(codec, init_seq[j]);
4814 	}
4815 }
4816 
4817 struct alc298_samsung_v2_amp_desc {
4818 	unsigned short nid;
4819 	int init_seq_size;
4820 	unsigned short init_seq[18][2];
4821 };
4822 
4823 static const struct alc298_samsung_v2_amp_desc
4824 alc298_samsung_v2_amp_desc_tbl[] = {
4825 	{ 0x38, 18, {
4826 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4827 		{ 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4828 		{ 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4829 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4830 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4831 		{ 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4832 	}},
4833 	{ 0x39, 18, {
4834 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4835 		{ 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4836 		{ 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4837 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4838 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4839 		{ 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4840 	}},
4841 	{ 0x3c, 15, {
4842 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4843 		{ 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4844 		{ 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4845 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4846 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4847 	}},
4848 	{ 0x3d, 15, {
4849 		{ 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4850 		{ 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4851 		{ 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4852 		{ 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4853 		{ 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4854 	}}
4855 };
4856 
4857 static void alc298_samsung_v2_enable_amps(struct hda_codec *codec)
4858 {
4859 	struct alc_spec *spec = codec->spec;
4860 	static const unsigned short enable_seq[][2] = {
4861 		{ 0x203a, 0x0081 }, { 0x23ff, 0x0001 },
4862 	};
4863 	int i, j;
4864 
4865 	for (i = 0; i < spec->num_speaker_amps; i++) {
4866 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4867 		for (j = 0; j < ARRAY_SIZE(enable_seq); j++)
4868 			alc298_samsung_write_coef_pack(codec, enable_seq[j]);
4869 		codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n",
4870 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4871 	}
4872 }
4873 
4874 static void alc298_samsung_v2_disable_amps(struct hda_codec *codec)
4875 {
4876 	struct alc_spec *spec = codec->spec;
4877 	static const unsigned short disable_seq[][2] = {
4878 		{ 0x23ff, 0x0000 }, { 0x203a, 0x0080 },
4879 	};
4880 	int i, j;
4881 
4882 	for (i = 0; i < spec->num_speaker_amps; i++) {
4883 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4884 		for (j = 0; j < ARRAY_SIZE(disable_seq); j++)
4885 			alc298_samsung_write_coef_pack(codec, disable_seq[j]);
4886 		codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n",
4887 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4888 	}
4889 }
4890 
4891 static void alc298_samsung_v2_playback_hook(struct hda_pcm_stream *hinfo,
4892 				struct hda_codec *codec,
4893 				struct snd_pcm_substream *substream,
4894 				int action)
4895 {
4896 	/* Dynamically enable/disable speaker amps before and after playback */
4897 	if (action == HDA_GEN_PCM_ACT_OPEN)
4898 		alc298_samsung_v2_enable_amps(codec);
4899 	if (action == HDA_GEN_PCM_ACT_CLOSE)
4900 		alc298_samsung_v2_disable_amps(codec);
4901 }
4902 
4903 static void alc298_samsung_v2_init_amps(struct hda_codec *codec,
4904 				int num_speaker_amps)
4905 {
4906 	struct alc_spec *spec = codec->spec;
4907 	int i, j;
4908 
4909 	/* Set spec's num_speaker_amps before doing anything else */
4910 	spec->num_speaker_amps = num_speaker_amps;
4911 
4912 	/* Disable speaker amps before init to prevent any physical damage */
4913 	alc298_samsung_v2_disable_amps(codec);
4914 
4915 	/* Initialize the speaker amps */
4916 	for (i = 0; i < spec->num_speaker_amps; i++) {
4917 		alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4918 		for (j = 0; j < alc298_samsung_v2_amp_desc_tbl[i].init_seq_size; j++) {
4919 			alc298_samsung_write_coef_pack(codec,
4920 					alc298_samsung_v2_amp_desc_tbl[i].init_seq[j]);
4921 		}
4922 		alc_write_coef_idx(codec, 0x89, 0x0);
4923 		codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n",
4924 				alc298_samsung_v2_amp_desc_tbl[i].nid);
4925 	}
4926 
4927 	/* register hook to enable speaker amps only when they are needed */
4928 	spec->gen.pcm_playback_hook = alc298_samsung_v2_playback_hook;
4929 }
4930 
4931 static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec,
4932 				const struct hda_fixup *fix, int action)
4933 {
4934 	if (action == HDA_FIXUP_ACT_PROBE)
4935 		alc298_samsung_v2_init_amps(codec, 2);
4936 }
4937 
4938 static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec,
4939 				const struct hda_fixup *fix, int action)
4940 {
4941 	if (action == HDA_FIXUP_ACT_PROBE)
4942 		alc298_samsung_v2_init_amps(codec, 4);
4943 }
4944 
4945 #if IS_REACHABLE(CONFIG_INPUT)
4946 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4947 				   struct hda_jack_callback *event)
4948 {
4949 	struct alc_spec *spec = codec->spec;
4950 
4951 	/* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4952 	   send both key on and key off event for every interrupt. */
4953 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4954 	input_sync(spec->kb_dev);
4955 	input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4956 	input_sync(spec->kb_dev);
4957 }
4958 
4959 static int alc_register_micmute_input_device(struct hda_codec *codec)
4960 {
4961 	struct alc_spec *spec = codec->spec;
4962 	int i;
4963 
4964 	spec->kb_dev = input_allocate_device();
4965 	if (!spec->kb_dev) {
4966 		codec_err(codec, "Out of memory (input_allocate_device)\n");
4967 		return -ENOMEM;
4968 	}
4969 
4970 	spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4971 
4972 	spec->kb_dev->name = "Microphone Mute Button";
4973 	spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4974 	spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4975 	spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4976 	spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4977 	for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4978 		set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4979 
4980 	if (input_register_device(spec->kb_dev)) {
4981 		codec_err(codec, "input_register_device failed\n");
4982 		input_free_device(spec->kb_dev);
4983 		spec->kb_dev = NULL;
4984 		return -ENOMEM;
4985 	}
4986 
4987 	return 0;
4988 }
4989 
4990 /* GPIO1 = set according to SKU external amp
4991  * GPIO2 = mic mute hotkey
4992  * GPIO3 = mute LED
4993  * GPIO4 = mic mute LED
4994  */
4995 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4996 					     const struct hda_fixup *fix, int action)
4997 {
4998 	struct alc_spec *spec = codec->spec;
4999 
5000 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
5001 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5002 		spec->init_amp = ALC_INIT_DEFAULT;
5003 		if (alc_register_micmute_input_device(codec) != 0)
5004 			return;
5005 
5006 		spec->gpio_mask |= 0x06;
5007 		spec->gpio_dir |= 0x02;
5008 		spec->gpio_data |= 0x02;
5009 		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
5010 					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
5011 		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
5012 						    gpio2_mic_hotkey_event);
5013 		return;
5014 	}
5015 
5016 	if (!spec->kb_dev)
5017 		return;
5018 
5019 	switch (action) {
5020 	case HDA_FIXUP_ACT_FREE:
5021 		input_unregister_device(spec->kb_dev);
5022 		spec->kb_dev = NULL;
5023 	}
5024 }
5025 
5026 /* Line2 = mic mute hotkey
5027  * GPIO2 = mic mute LED
5028  */
5029 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
5030 					     const struct hda_fixup *fix, int action)
5031 {
5032 	struct alc_spec *spec = codec->spec;
5033 
5034 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
5035 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5036 		spec->init_amp = ALC_INIT_DEFAULT;
5037 		if (alc_register_micmute_input_device(codec) != 0)
5038 			return;
5039 
5040 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
5041 						    gpio2_mic_hotkey_event);
5042 		return;
5043 	}
5044 
5045 	if (!spec->kb_dev)
5046 		return;
5047 
5048 	switch (action) {
5049 	case HDA_FIXUP_ACT_FREE:
5050 		input_unregister_device(spec->kb_dev);
5051 		spec->kb_dev = NULL;
5052 	}
5053 }
5054 #else /* INPUT */
5055 #define alc280_fixup_hp_gpio2_mic_hotkey	NULL
5056 #define alc233_fixup_lenovo_line2_mic_hotkey	NULL
5057 #endif /* INPUT */
5058 
5059 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
5060 				const struct hda_fixup *fix, int action)
5061 {
5062 	struct alc_spec *spec = codec->spec;
5063 
5064 	alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
5065 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5066 		spec->cap_mute_led_nid = 0x18;
5067 		snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
5068 	}
5069 }
5070 
5071 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
5072 {
5073 	if (delay <= 0)
5074 		delay = 75;
5075 	snd_hda_codec_write(codec, 0x21, 0,
5076 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5077 	msleep(delay);
5078 	snd_hda_codec_write(codec, 0x21, 0,
5079 		    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5080 	msleep(delay);
5081 }
5082 
5083 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
5084 {
5085 	if (delay <= 0)
5086 		delay = 75;
5087 	snd_hda_codec_write(codec, 0x21, 0,
5088 		    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5089 	msleep(delay);
5090 	snd_hda_codec_write(codec, 0x21, 0,
5091 		    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5092 	msleep(delay);
5093 }
5094 
5095 static const struct coef_fw alc225_pre_hsmode[] = {
5096 	UPDATE_COEF(0x4a, 1<<8, 0),
5097 	UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
5098 	UPDATE_COEF(0x63, 3<<14, 3<<14),
5099 	UPDATE_COEF(0x4a, 3<<4, 2<<4),
5100 	UPDATE_COEF(0x4a, 3<<10, 3<<10),
5101 	UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
5102 	UPDATE_COEF(0x4a, 3<<10, 0),
5103 	{}
5104 };
5105 
5106 static void alc_headset_mode_unplugged(struct hda_codec *codec)
5107 {
5108 	struct alc_spec *spec = codec->spec;
5109 	static const struct coef_fw coef0255[] = {
5110 		WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
5111 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5112 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5113 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5114 		WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
5115 		{}
5116 	};
5117 	static const struct coef_fw coef0256[] = {
5118 		WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
5119 		WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5120 		WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5121 		WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
5122 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5123 		{}
5124 	};
5125 	static const struct coef_fw coef0233[] = {
5126 		WRITE_COEF(0x1b, 0x0c0b),
5127 		WRITE_COEF(0x45, 0xc429),
5128 		UPDATE_COEF(0x35, 0x4000, 0),
5129 		WRITE_COEF(0x06, 0x2104),
5130 		WRITE_COEF(0x1a, 0x0001),
5131 		WRITE_COEF(0x26, 0x0004),
5132 		WRITE_COEF(0x32, 0x42a3),
5133 		{}
5134 	};
5135 	static const struct coef_fw coef0288[] = {
5136 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5137 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5138 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5139 		UPDATE_COEF(0x66, 0x0008, 0),
5140 		UPDATE_COEF(0x67, 0x2000, 0),
5141 		{}
5142 	};
5143 	static const struct coef_fw coef0298[] = {
5144 		UPDATE_COEF(0x19, 0x1300, 0x0300),
5145 		{}
5146 	};
5147 	static const struct coef_fw coef0292[] = {
5148 		WRITE_COEF(0x76, 0x000e),
5149 		WRITE_COEF(0x6c, 0x2400),
5150 		WRITE_COEF(0x18, 0x7308),
5151 		WRITE_COEF(0x6b, 0xc429),
5152 		{}
5153 	};
5154 	static const struct coef_fw coef0293[] = {
5155 		UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
5156 		UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
5157 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
5158 		UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
5159 		WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5160 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5161 		{}
5162 	};
5163 	static const struct coef_fw coef0668[] = {
5164 		WRITE_COEF(0x15, 0x0d40),
5165 		WRITE_COEF(0xb7, 0x802b),
5166 		{}
5167 	};
5168 	static const struct coef_fw coef0225[] = {
5169 		UPDATE_COEF(0x63, 3<<14, 0),
5170 		{}
5171 	};
5172 	static const struct coef_fw coef0274[] = {
5173 		UPDATE_COEF(0x4a, 0x0100, 0),
5174 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5175 		UPDATE_COEF(0x6b, 0xf000, 0x5000),
5176 		UPDATE_COEF(0x4a, 0x0010, 0),
5177 		UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5178 		WRITE_COEF(0x45, 0x5289),
5179 		UPDATE_COEF(0x4a, 0x0c00, 0),
5180 		{}
5181 	};
5182 
5183 	if (spec->no_internal_mic_pin) {
5184 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5185 		return;
5186 	}
5187 
5188 	switch (codec->core.vendor_id) {
5189 	case 0x10ec0255:
5190 		alc_process_coef_fw(codec, coef0255);
5191 		break;
5192 	case 0x10ec0230:
5193 	case 0x10ec0236:
5194 	case 0x10ec0256:
5195 	case 0x19e58326:
5196 		alc_hp_mute_disable(codec, 75);
5197 		alc_process_coef_fw(codec, coef0256);
5198 		break;
5199 	case 0x10ec0234:
5200 	case 0x10ec0274:
5201 	case 0x10ec0294:
5202 		alc_process_coef_fw(codec, coef0274);
5203 		break;
5204 	case 0x10ec0233:
5205 	case 0x10ec0283:
5206 		alc_process_coef_fw(codec, coef0233);
5207 		break;
5208 	case 0x10ec0286:
5209 	case 0x10ec0288:
5210 		alc_process_coef_fw(codec, coef0288);
5211 		break;
5212 	case 0x10ec0298:
5213 		alc_process_coef_fw(codec, coef0298);
5214 		alc_process_coef_fw(codec, coef0288);
5215 		break;
5216 	case 0x10ec0292:
5217 		alc_process_coef_fw(codec, coef0292);
5218 		break;
5219 	case 0x10ec0293:
5220 		alc_process_coef_fw(codec, coef0293);
5221 		break;
5222 	case 0x10ec0668:
5223 		alc_process_coef_fw(codec, coef0668);
5224 		break;
5225 	case 0x10ec0215:
5226 	case 0x10ec0225:
5227 	case 0x10ec0285:
5228 	case 0x10ec0295:
5229 	case 0x10ec0289:
5230 	case 0x10ec0299:
5231 		alc_hp_mute_disable(codec, 75);
5232 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5233 		alc_process_coef_fw(codec, coef0225);
5234 		break;
5235 	case 0x10ec0867:
5236 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5237 		break;
5238 	}
5239 	codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5240 }
5241 
5242 
5243 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5244 				    hda_nid_t mic_pin)
5245 {
5246 	static const struct coef_fw coef0255[] = {
5247 		WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5248 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5249 		{}
5250 	};
5251 	static const struct coef_fw coef0256[] = {
5252 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5253 		WRITE_COEFEX(0x57, 0x03, 0x09a3),
5254 		WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5255 		{}
5256 	};
5257 	static const struct coef_fw coef0233[] = {
5258 		UPDATE_COEF(0x35, 0, 1<<14),
5259 		WRITE_COEF(0x06, 0x2100),
5260 		WRITE_COEF(0x1a, 0x0021),
5261 		WRITE_COEF(0x26, 0x008c),
5262 		{}
5263 	};
5264 	static const struct coef_fw coef0288[] = {
5265 		UPDATE_COEF(0x4f, 0x00c0, 0),
5266 		UPDATE_COEF(0x50, 0x2000, 0),
5267 		UPDATE_COEF(0x56, 0x0006, 0),
5268 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5269 		UPDATE_COEF(0x66, 0x0008, 0x0008),
5270 		UPDATE_COEF(0x67, 0x2000, 0x2000),
5271 		{}
5272 	};
5273 	static const struct coef_fw coef0292[] = {
5274 		WRITE_COEF(0x19, 0xa208),
5275 		WRITE_COEF(0x2e, 0xacf0),
5276 		{}
5277 	};
5278 	static const struct coef_fw coef0293[] = {
5279 		UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5280 		UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5281 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5282 		{}
5283 	};
5284 	static const struct coef_fw coef0688[] = {
5285 		WRITE_COEF(0xb7, 0x802b),
5286 		WRITE_COEF(0xb5, 0x1040),
5287 		UPDATE_COEF(0xc3, 0, 1<<12),
5288 		{}
5289 	};
5290 	static const struct coef_fw coef0225[] = {
5291 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5292 		UPDATE_COEF(0x4a, 3<<4, 2<<4),
5293 		UPDATE_COEF(0x63, 3<<14, 0),
5294 		{}
5295 	};
5296 	static const struct coef_fw coef0274[] = {
5297 		UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5298 		UPDATE_COEF(0x4a, 0x0010, 0),
5299 		UPDATE_COEF(0x6b, 0xf000, 0),
5300 		{}
5301 	};
5302 
5303 	switch (codec->core.vendor_id) {
5304 	case 0x10ec0255:
5305 		alc_write_coef_idx(codec, 0x45, 0xc489);
5306 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5307 		alc_process_coef_fw(codec, coef0255);
5308 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5309 		break;
5310 	case 0x10ec0230:
5311 	case 0x10ec0236:
5312 	case 0x10ec0256:
5313 	case 0x19e58326:
5314 		alc_write_coef_idx(codec, 0x45, 0xc489);
5315 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5316 		alc_process_coef_fw(codec, coef0256);
5317 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5318 		break;
5319 	case 0x10ec0234:
5320 	case 0x10ec0274:
5321 	case 0x10ec0294:
5322 		alc_write_coef_idx(codec, 0x45, 0x4689);
5323 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5324 		alc_process_coef_fw(codec, coef0274);
5325 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5326 		break;
5327 	case 0x10ec0233:
5328 	case 0x10ec0283:
5329 		alc_write_coef_idx(codec, 0x45, 0xc429);
5330 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5331 		alc_process_coef_fw(codec, coef0233);
5332 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5333 		break;
5334 	case 0x10ec0286:
5335 	case 0x10ec0288:
5336 	case 0x10ec0298:
5337 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5338 		alc_process_coef_fw(codec, coef0288);
5339 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5340 		break;
5341 	case 0x10ec0292:
5342 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5343 		alc_process_coef_fw(codec, coef0292);
5344 		break;
5345 	case 0x10ec0293:
5346 		/* Set to TRS mode */
5347 		alc_write_coef_idx(codec, 0x45, 0xc429);
5348 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5349 		alc_process_coef_fw(codec, coef0293);
5350 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5351 		break;
5352 	case 0x10ec0867:
5353 		alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5354 		fallthrough;
5355 	case 0x10ec0221:
5356 	case 0x10ec0662:
5357 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5358 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5359 		break;
5360 	case 0x10ec0668:
5361 		alc_write_coef_idx(codec, 0x11, 0x0001);
5362 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5363 		alc_process_coef_fw(codec, coef0688);
5364 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5365 		break;
5366 	case 0x10ec0215:
5367 	case 0x10ec0225:
5368 	case 0x10ec0285:
5369 	case 0x10ec0295:
5370 	case 0x10ec0289:
5371 	case 0x10ec0299:
5372 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5373 		alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5374 		snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5375 		alc_process_coef_fw(codec, coef0225);
5376 		snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5377 		break;
5378 	}
5379 	codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5380 }
5381 
5382 static void alc_headset_mode_default(struct hda_codec *codec)
5383 {
5384 	static const struct coef_fw coef0225[] = {
5385 		UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5386 		UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5387 		UPDATE_COEF(0x49, 3<<8, 0<<8),
5388 		UPDATE_COEF(0x4a, 3<<4, 3<<4),
5389 		UPDATE_COEF(0x63, 3<<14, 0),
5390 		UPDATE_COEF(0x67, 0xf000, 0x3000),
5391 		{}
5392 	};
5393 	static const struct coef_fw coef0255[] = {
5394 		WRITE_COEF(0x45, 0xc089),
5395 		WRITE_COEF(0x45, 0xc489),
5396 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5397 		WRITE_COEF(0x49, 0x0049),
5398 		{}
5399 	};
5400 	static const struct coef_fw coef0256[] = {
5401 		WRITE_COEF(0x45, 0xc489),
5402 		WRITE_COEFEX(0x57, 0x03, 0x0da3),
5403 		WRITE_COEF(0x49, 0x0049),
5404 		UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5405 		WRITE_COEF(0x06, 0x6100),
5406 		{}
5407 	};
5408 	static const struct coef_fw coef0233[] = {
5409 		WRITE_COEF(0x06, 0x2100),
5410 		WRITE_COEF(0x32, 0x4ea3),
5411 		{}
5412 	};
5413 	static const struct coef_fw coef0288[] = {
5414 		UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5415 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5416 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5417 		UPDATE_COEF(0x66, 0x0008, 0),
5418 		UPDATE_COEF(0x67, 0x2000, 0),
5419 		{}
5420 	};
5421 	static const struct coef_fw coef0292[] = {
5422 		WRITE_COEF(0x76, 0x000e),
5423 		WRITE_COEF(0x6c, 0x2400),
5424 		WRITE_COEF(0x6b, 0xc429),
5425 		WRITE_COEF(0x18, 0x7308),
5426 		{}
5427 	};
5428 	static const struct coef_fw coef0293[] = {
5429 		UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5430 		WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5431 		UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5432 		{}
5433 	};
5434 	static const struct coef_fw coef0688[] = {
5435 		WRITE_COEF(0x11, 0x0041),
5436 		WRITE_COEF(0x15, 0x0d40),
5437 		WRITE_COEF(0xb7, 0x802b),
5438 		{}
5439 	};
5440 	static const struct coef_fw coef0274[] = {
5441 		WRITE_COEF(0x45, 0x4289),
5442 		UPDATE_COEF(0x4a, 0x0010, 0x0010),
5443 		UPDATE_COEF(0x6b, 0x0f00, 0),
5444 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5445 		{}
5446 	};
5447 
5448 	switch (codec->core.vendor_id) {
5449 	case 0x10ec0215:
5450 	case 0x10ec0225:
5451 	case 0x10ec0285:
5452 	case 0x10ec0295:
5453 	case 0x10ec0289:
5454 	case 0x10ec0299:
5455 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5456 		alc_process_coef_fw(codec, coef0225);
5457 		alc_hp_enable_unmute(codec, 75);
5458 		break;
5459 	case 0x10ec0255:
5460 		alc_process_coef_fw(codec, coef0255);
5461 		break;
5462 	case 0x10ec0230:
5463 	case 0x10ec0236:
5464 	case 0x10ec0256:
5465 	case 0x19e58326:
5466 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5467 		alc_write_coef_idx(codec, 0x45, 0xc089);
5468 		msleep(50);
5469 		alc_process_coef_fw(codec, coef0256);
5470 		alc_hp_enable_unmute(codec, 75);
5471 		break;
5472 	case 0x10ec0234:
5473 	case 0x10ec0274:
5474 	case 0x10ec0294:
5475 		alc_process_coef_fw(codec, coef0274);
5476 		break;
5477 	case 0x10ec0233:
5478 	case 0x10ec0283:
5479 		alc_process_coef_fw(codec, coef0233);
5480 		break;
5481 	case 0x10ec0286:
5482 	case 0x10ec0288:
5483 	case 0x10ec0298:
5484 		alc_process_coef_fw(codec, coef0288);
5485 		break;
5486 	case 0x10ec0292:
5487 		alc_process_coef_fw(codec, coef0292);
5488 		break;
5489 	case 0x10ec0293:
5490 		alc_process_coef_fw(codec, coef0293);
5491 		break;
5492 	case 0x10ec0668:
5493 		alc_process_coef_fw(codec, coef0688);
5494 		break;
5495 	case 0x10ec0867:
5496 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5497 		break;
5498 	}
5499 	codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5500 }
5501 
5502 /* Iphone type */
5503 static void alc_headset_mode_ctia(struct hda_codec *codec)
5504 {
5505 	int val;
5506 
5507 	static const struct coef_fw coef0255[] = {
5508 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5509 		WRITE_COEF(0x1b, 0x0c2b),
5510 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5511 		{}
5512 	};
5513 	static const struct coef_fw coef0256[] = {
5514 		WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5515 		WRITE_COEF(0x1b, 0x0e6b),
5516 		{}
5517 	};
5518 	static const struct coef_fw coef0233[] = {
5519 		WRITE_COEF(0x45, 0xd429),
5520 		WRITE_COEF(0x1b, 0x0c2b),
5521 		WRITE_COEF(0x32, 0x4ea3),
5522 		{}
5523 	};
5524 	static const struct coef_fw coef0288[] = {
5525 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5526 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5527 		UPDATE_COEF(0x66, 0x0008, 0),
5528 		UPDATE_COEF(0x67, 0x2000, 0),
5529 		{}
5530 	};
5531 	static const struct coef_fw coef0292[] = {
5532 		WRITE_COEF(0x6b, 0xd429),
5533 		WRITE_COEF(0x76, 0x0008),
5534 		WRITE_COEF(0x18, 0x7388),
5535 		{}
5536 	};
5537 	static const struct coef_fw coef0293[] = {
5538 		WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5539 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5540 		{}
5541 	};
5542 	static const struct coef_fw coef0688[] = {
5543 		WRITE_COEF(0x11, 0x0001),
5544 		WRITE_COEF(0x15, 0x0d60),
5545 		WRITE_COEF(0xc3, 0x0000),
5546 		{}
5547 	};
5548 	static const struct coef_fw coef0225_1[] = {
5549 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5550 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5551 		{}
5552 	};
5553 	static const struct coef_fw coef0225_2[] = {
5554 		UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5555 		UPDATE_COEF(0x63, 3<<14, 1<<14),
5556 		{}
5557 	};
5558 
5559 	switch (codec->core.vendor_id) {
5560 	case 0x10ec0255:
5561 		alc_process_coef_fw(codec, coef0255);
5562 		break;
5563 	case 0x10ec0230:
5564 	case 0x10ec0236:
5565 	case 0x10ec0256:
5566 	case 0x19e58326:
5567 		alc_process_coef_fw(codec, coef0256);
5568 		alc_hp_enable_unmute(codec, 75);
5569 		break;
5570 	case 0x10ec0234:
5571 	case 0x10ec0274:
5572 	case 0x10ec0294:
5573 		alc_write_coef_idx(codec, 0x45, 0xd689);
5574 		break;
5575 	case 0x10ec0233:
5576 	case 0x10ec0283:
5577 		alc_process_coef_fw(codec, coef0233);
5578 		break;
5579 	case 0x10ec0298:
5580 		val = alc_read_coef_idx(codec, 0x50);
5581 		if (val & (1 << 12)) {
5582 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5583 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5584 			msleep(300);
5585 		} else {
5586 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5587 			alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5588 			msleep(300);
5589 		}
5590 		break;
5591 	case 0x10ec0286:
5592 	case 0x10ec0288:
5593 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5594 		msleep(300);
5595 		alc_process_coef_fw(codec, coef0288);
5596 		break;
5597 	case 0x10ec0292:
5598 		alc_process_coef_fw(codec, coef0292);
5599 		break;
5600 	case 0x10ec0293:
5601 		alc_process_coef_fw(codec, coef0293);
5602 		break;
5603 	case 0x10ec0668:
5604 		alc_process_coef_fw(codec, coef0688);
5605 		break;
5606 	case 0x10ec0215:
5607 	case 0x10ec0225:
5608 	case 0x10ec0285:
5609 	case 0x10ec0295:
5610 	case 0x10ec0289:
5611 	case 0x10ec0299:
5612 		val = alc_read_coef_idx(codec, 0x45);
5613 		if (val & (1 << 9))
5614 			alc_process_coef_fw(codec, coef0225_2);
5615 		else
5616 			alc_process_coef_fw(codec, coef0225_1);
5617 		alc_hp_enable_unmute(codec, 75);
5618 		break;
5619 	case 0x10ec0867:
5620 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5621 		break;
5622 	}
5623 	codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5624 }
5625 
5626 /* Nokia type */
5627 static void alc_headset_mode_omtp(struct hda_codec *codec)
5628 {
5629 	static const struct coef_fw coef0255[] = {
5630 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5631 		WRITE_COEF(0x1b, 0x0c2b),
5632 		WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5633 		{}
5634 	};
5635 	static const struct coef_fw coef0256[] = {
5636 		WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5637 		WRITE_COEF(0x1b, 0x0e6b),
5638 		{}
5639 	};
5640 	static const struct coef_fw coef0233[] = {
5641 		WRITE_COEF(0x45, 0xe429),
5642 		WRITE_COEF(0x1b, 0x0c2b),
5643 		WRITE_COEF(0x32, 0x4ea3),
5644 		{}
5645 	};
5646 	static const struct coef_fw coef0288[] = {
5647 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5648 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5649 		UPDATE_COEF(0x66, 0x0008, 0),
5650 		UPDATE_COEF(0x67, 0x2000, 0),
5651 		{}
5652 	};
5653 	static const struct coef_fw coef0292[] = {
5654 		WRITE_COEF(0x6b, 0xe429),
5655 		WRITE_COEF(0x76, 0x0008),
5656 		WRITE_COEF(0x18, 0x7388),
5657 		{}
5658 	};
5659 	static const struct coef_fw coef0293[] = {
5660 		WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5661 		UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5662 		{}
5663 	};
5664 	static const struct coef_fw coef0688[] = {
5665 		WRITE_COEF(0x11, 0x0001),
5666 		WRITE_COEF(0x15, 0x0d50),
5667 		WRITE_COEF(0xc3, 0x0000),
5668 		{}
5669 	};
5670 	static const struct coef_fw coef0225[] = {
5671 		UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5672 		UPDATE_COEF(0x63, 3<<14, 2<<14),
5673 		{}
5674 	};
5675 
5676 	switch (codec->core.vendor_id) {
5677 	case 0x10ec0255:
5678 		alc_process_coef_fw(codec, coef0255);
5679 		break;
5680 	case 0x10ec0230:
5681 	case 0x10ec0236:
5682 	case 0x10ec0256:
5683 	case 0x19e58326:
5684 		alc_process_coef_fw(codec, coef0256);
5685 		alc_hp_enable_unmute(codec, 75);
5686 		break;
5687 	case 0x10ec0234:
5688 	case 0x10ec0274:
5689 	case 0x10ec0294:
5690 		alc_write_coef_idx(codec, 0x45, 0xe689);
5691 		break;
5692 	case 0x10ec0233:
5693 	case 0x10ec0283:
5694 		alc_process_coef_fw(codec, coef0233);
5695 		break;
5696 	case 0x10ec0298:
5697 		alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5698 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5699 		msleep(300);
5700 		break;
5701 	case 0x10ec0286:
5702 	case 0x10ec0288:
5703 		alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5704 		msleep(300);
5705 		alc_process_coef_fw(codec, coef0288);
5706 		break;
5707 	case 0x10ec0292:
5708 		alc_process_coef_fw(codec, coef0292);
5709 		break;
5710 	case 0x10ec0293:
5711 		alc_process_coef_fw(codec, coef0293);
5712 		break;
5713 	case 0x10ec0668:
5714 		alc_process_coef_fw(codec, coef0688);
5715 		break;
5716 	case 0x10ec0215:
5717 	case 0x10ec0225:
5718 	case 0x10ec0285:
5719 	case 0x10ec0295:
5720 	case 0x10ec0289:
5721 	case 0x10ec0299:
5722 		alc_process_coef_fw(codec, coef0225);
5723 		alc_hp_enable_unmute(codec, 75);
5724 		break;
5725 	}
5726 	codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5727 }
5728 
5729 static void alc_determine_headset_type(struct hda_codec *codec)
5730 {
5731 	int val;
5732 	bool is_ctia = false;
5733 	struct alc_spec *spec = codec->spec;
5734 	static const struct coef_fw coef0255[] = {
5735 		WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5736 		WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5737  conteol) */
5738 		{}
5739 	};
5740 	static const struct coef_fw coef0288[] = {
5741 		UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5742 		{}
5743 	};
5744 	static const struct coef_fw coef0298[] = {
5745 		UPDATE_COEF(0x50, 0x2000, 0x2000),
5746 		UPDATE_COEF(0x56, 0x0006, 0x0006),
5747 		UPDATE_COEF(0x66, 0x0008, 0),
5748 		UPDATE_COEF(0x67, 0x2000, 0),
5749 		UPDATE_COEF(0x19, 0x1300, 0x1300),
5750 		{}
5751 	};
5752 	static const struct coef_fw coef0293[] = {
5753 		UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5754 		WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5755 		{}
5756 	};
5757 	static const struct coef_fw coef0688[] = {
5758 		WRITE_COEF(0x11, 0x0001),
5759 		WRITE_COEF(0xb7, 0x802b),
5760 		WRITE_COEF(0x15, 0x0d60),
5761 		WRITE_COEF(0xc3, 0x0c00),
5762 		{}
5763 	};
5764 	static const struct coef_fw coef0274[] = {
5765 		UPDATE_COEF(0x4a, 0x0010, 0),
5766 		UPDATE_COEF(0x4a, 0x8000, 0),
5767 		WRITE_COEF(0x45, 0xd289),
5768 		UPDATE_COEF(0x49, 0x0300, 0x0300),
5769 		{}
5770 	};
5771 
5772 	if (spec->no_internal_mic_pin) {
5773 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5774 		return;
5775 	}
5776 
5777 	switch (codec->core.vendor_id) {
5778 	case 0x10ec0255:
5779 		alc_process_coef_fw(codec, coef0255);
5780 		msleep(300);
5781 		val = alc_read_coef_idx(codec, 0x46);
5782 		is_ctia = (val & 0x0070) == 0x0070;
5783 		break;
5784 	case 0x10ec0230:
5785 	case 0x10ec0236:
5786 	case 0x10ec0256:
5787 	case 0x19e58326:
5788 		alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5789 		alc_write_coef_idx(codec, 0x06, 0x6104);
5790 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5791 
5792 		alc_process_coef_fw(codec, coef0255);
5793 		msleep(300);
5794 		val = alc_read_coef_idx(codec, 0x46);
5795 		is_ctia = (val & 0x0070) == 0x0070;
5796 		if (!is_ctia) {
5797 			alc_write_coef_idx(codec, 0x45, 0xe089);
5798 			msleep(100);
5799 			val = alc_read_coef_idx(codec, 0x46);
5800 			if ((val & 0x0070) == 0x0070)
5801 				is_ctia = false;
5802 			else
5803 				is_ctia = true;
5804 		}
5805 		alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5806 		alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5807 		break;
5808 	case 0x10ec0234:
5809 	case 0x10ec0274:
5810 	case 0x10ec0294:
5811 		alc_process_coef_fw(codec, coef0274);
5812 		msleep(850);
5813 		val = alc_read_coef_idx(codec, 0x46);
5814 		is_ctia = (val & 0x00f0) == 0x00f0;
5815 		break;
5816 	case 0x10ec0233:
5817 	case 0x10ec0283:
5818 		alc_write_coef_idx(codec, 0x45, 0xd029);
5819 		msleep(300);
5820 		val = alc_read_coef_idx(codec, 0x46);
5821 		is_ctia = (val & 0x0070) == 0x0070;
5822 		break;
5823 	case 0x10ec0298:
5824 		snd_hda_codec_write(codec, 0x21, 0,
5825 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5826 		msleep(100);
5827 		snd_hda_codec_write(codec, 0x21, 0,
5828 			    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5829 		msleep(200);
5830 
5831 		val = alc_read_coef_idx(codec, 0x50);
5832 		if (val & (1 << 12)) {
5833 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5834 			alc_process_coef_fw(codec, coef0288);
5835 			msleep(350);
5836 			val = alc_read_coef_idx(codec, 0x50);
5837 			is_ctia = (val & 0x0070) == 0x0070;
5838 		} else {
5839 			alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5840 			alc_process_coef_fw(codec, coef0288);
5841 			msleep(350);
5842 			val = alc_read_coef_idx(codec, 0x50);
5843 			is_ctia = (val & 0x0070) == 0x0070;
5844 		}
5845 		alc_process_coef_fw(codec, coef0298);
5846 		snd_hda_codec_write(codec, 0x21, 0,
5847 			    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5848 		msleep(75);
5849 		snd_hda_codec_write(codec, 0x21, 0,
5850 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5851 		break;
5852 	case 0x10ec0286:
5853 	case 0x10ec0288:
5854 		alc_process_coef_fw(codec, coef0288);
5855 		msleep(350);
5856 		val = alc_read_coef_idx(codec, 0x50);
5857 		is_ctia = (val & 0x0070) == 0x0070;
5858 		break;
5859 	case 0x10ec0292:
5860 		alc_write_coef_idx(codec, 0x6b, 0xd429);
5861 		msleep(300);
5862 		val = alc_read_coef_idx(codec, 0x6c);
5863 		is_ctia = (val & 0x001c) == 0x001c;
5864 		break;
5865 	case 0x10ec0293:
5866 		alc_process_coef_fw(codec, coef0293);
5867 		msleep(300);
5868 		val = alc_read_coef_idx(codec, 0x46);
5869 		is_ctia = (val & 0x0070) == 0x0070;
5870 		break;
5871 	case 0x10ec0668:
5872 		alc_process_coef_fw(codec, coef0688);
5873 		msleep(300);
5874 		val = alc_read_coef_idx(codec, 0xbe);
5875 		is_ctia = (val & 0x1c02) == 0x1c02;
5876 		break;
5877 	case 0x10ec0215:
5878 	case 0x10ec0225:
5879 	case 0x10ec0285:
5880 	case 0x10ec0295:
5881 	case 0x10ec0289:
5882 	case 0x10ec0299:
5883 		alc_process_coef_fw(codec, alc225_pre_hsmode);
5884 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5885 		val = alc_read_coef_idx(codec, 0x45);
5886 		if (val & (1 << 9)) {
5887 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5888 			alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5889 			msleep(800);
5890 			val = alc_read_coef_idx(codec, 0x46);
5891 			is_ctia = (val & 0x00f0) == 0x00f0;
5892 		} else {
5893 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5894 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5895 			msleep(800);
5896 			val = alc_read_coef_idx(codec, 0x46);
5897 			is_ctia = (val & 0x00f0) == 0x00f0;
5898 		}
5899 		if (!is_ctia) {
5900 			alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5901 			alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5902 			msleep(100);
5903 			val = alc_read_coef_idx(codec, 0x46);
5904 			if ((val & 0x00f0) == 0x00f0)
5905 				is_ctia = false;
5906 			else
5907 				is_ctia = true;
5908 		}
5909 		alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5910 		alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5911 		alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5912 		break;
5913 	case 0x10ec0867:
5914 		is_ctia = true;
5915 		break;
5916 	}
5917 
5918 	codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5919 		    is_ctia ? "yes" : "no");
5920 	spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5921 }
5922 
5923 static void alc_update_headset_mode(struct hda_codec *codec)
5924 {
5925 	struct alc_spec *spec = codec->spec;
5926 
5927 	hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5928 	hda_nid_t hp_pin = alc_get_hp_pin(spec);
5929 
5930 	int new_headset_mode;
5931 
5932 	if (!snd_hda_jack_detect(codec, hp_pin))
5933 		new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5934 	else if (mux_pin == spec->headset_mic_pin)
5935 		new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5936 	else if (mux_pin == spec->headphone_mic_pin)
5937 		new_headset_mode = ALC_HEADSET_MODE_MIC;
5938 	else
5939 		new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5940 
5941 	if (new_headset_mode == spec->current_headset_mode) {
5942 		snd_hda_gen_update_outputs(codec);
5943 		return;
5944 	}
5945 
5946 	switch (new_headset_mode) {
5947 	case ALC_HEADSET_MODE_UNPLUGGED:
5948 		alc_headset_mode_unplugged(codec);
5949 		spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5950 		spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5951 		spec->gen.hp_jack_present = false;
5952 		break;
5953 	case ALC_HEADSET_MODE_HEADSET:
5954 		if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5955 			alc_determine_headset_type(codec);
5956 		if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5957 			alc_headset_mode_ctia(codec);
5958 		else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5959 			alc_headset_mode_omtp(codec);
5960 		spec->gen.hp_jack_present = true;
5961 		break;
5962 	case ALC_HEADSET_MODE_MIC:
5963 		alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5964 		spec->gen.hp_jack_present = false;
5965 		break;
5966 	case ALC_HEADSET_MODE_HEADPHONE:
5967 		alc_headset_mode_default(codec);
5968 		spec->gen.hp_jack_present = true;
5969 		break;
5970 	}
5971 	if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5972 		snd_hda_set_pin_ctl_cache(codec, hp_pin,
5973 					  AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5974 		if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5975 			snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5976 						  PIN_VREFHIZ);
5977 	}
5978 	spec->current_headset_mode = new_headset_mode;
5979 
5980 	snd_hda_gen_update_outputs(codec);
5981 }
5982 
5983 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5984 					 struct snd_kcontrol *kcontrol,
5985 					 struct snd_ctl_elem_value *ucontrol)
5986 {
5987 	alc_update_headset_mode(codec);
5988 }
5989 
5990 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5991 				       struct hda_jack_callback *jack)
5992 {
5993 	snd_hda_gen_hp_automute(codec, jack);
5994 	alc_update_headset_mode(codec);
5995 }
5996 
5997 static void alc_probe_headset_mode(struct hda_codec *codec)
5998 {
5999 	int i;
6000 	struct alc_spec *spec = codec->spec;
6001 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6002 
6003 	/* Find mic pins */
6004 	for (i = 0; i < cfg->num_inputs; i++) {
6005 		if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
6006 			spec->headset_mic_pin = cfg->inputs[i].pin;
6007 		if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
6008 			spec->headphone_mic_pin = cfg->inputs[i].pin;
6009 	}
6010 
6011 	WARN_ON(spec->gen.cap_sync_hook);
6012 	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
6013 	spec->gen.automute_hook = alc_update_headset_mode;
6014 	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
6015 }
6016 
6017 static void alc_fixup_headset_mode(struct hda_codec *codec,
6018 				const struct hda_fixup *fix, int action)
6019 {
6020 	struct alc_spec *spec = codec->spec;
6021 
6022 	switch (action) {
6023 	case HDA_FIXUP_ACT_PRE_PROBE:
6024 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
6025 		break;
6026 	case HDA_FIXUP_ACT_PROBE:
6027 		alc_probe_headset_mode(codec);
6028 		break;
6029 	case HDA_FIXUP_ACT_INIT:
6030 		if (is_s3_resume(codec) || is_s4_resume(codec)) {
6031 			spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
6032 			spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
6033 		}
6034 		alc_update_headset_mode(codec);
6035 		break;
6036 	}
6037 }
6038 
6039 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
6040 				const struct hda_fixup *fix, int action)
6041 {
6042 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6043 		struct alc_spec *spec = codec->spec;
6044 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6045 	}
6046 	else
6047 		alc_fixup_headset_mode(codec, fix, action);
6048 }
6049 
6050 static void alc255_set_default_jack_type(struct hda_codec *codec)
6051 {
6052 	/* Set to iphone type */
6053 	static const struct coef_fw alc255fw[] = {
6054 		WRITE_COEF(0x1b, 0x880b),
6055 		WRITE_COEF(0x45, 0xd089),
6056 		WRITE_COEF(0x1b, 0x080b),
6057 		WRITE_COEF(0x46, 0x0004),
6058 		WRITE_COEF(0x1b, 0x0c0b),
6059 		{}
6060 	};
6061 	static const struct coef_fw alc256fw[] = {
6062 		WRITE_COEF(0x1b, 0x884b),
6063 		WRITE_COEF(0x45, 0xd089),
6064 		WRITE_COEF(0x1b, 0x084b),
6065 		WRITE_COEF(0x46, 0x0004),
6066 		WRITE_COEF(0x1b, 0x0c4b),
6067 		{}
6068 	};
6069 	switch (codec->core.vendor_id) {
6070 	case 0x10ec0255:
6071 		alc_process_coef_fw(codec, alc255fw);
6072 		break;
6073 	case 0x10ec0230:
6074 	case 0x10ec0236:
6075 	case 0x10ec0256:
6076 	case 0x19e58326:
6077 		alc_process_coef_fw(codec, alc256fw);
6078 		break;
6079 	}
6080 	msleep(30);
6081 }
6082 
6083 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
6084 				const struct hda_fixup *fix, int action)
6085 {
6086 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6087 		alc255_set_default_jack_type(codec);
6088 	}
6089 	alc_fixup_headset_mode(codec, fix, action);
6090 }
6091 
6092 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
6093 				const struct hda_fixup *fix, int action)
6094 {
6095 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6096 		struct alc_spec *spec = codec->spec;
6097 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6098 		alc255_set_default_jack_type(codec);
6099 	}
6100 	else
6101 		alc_fixup_headset_mode(codec, fix, action);
6102 }
6103 
6104 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
6105 				       struct hda_jack_callback *jack)
6106 {
6107 	struct alc_spec *spec = codec->spec;
6108 
6109 	alc_update_headset_jack_cb(codec, jack);
6110 	/* Headset Mic enable or disable, only for Dell Dino */
6111 	alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
6112 }
6113 
6114 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
6115 				const struct hda_fixup *fix, int action)
6116 {
6117 	alc_fixup_headset_mode(codec, fix, action);
6118 	if (action == HDA_FIXUP_ACT_PROBE) {
6119 		struct alc_spec *spec = codec->spec;
6120 		/* toggled via hp_automute_hook */
6121 		spec->gpio_mask |= 0x40;
6122 		spec->gpio_dir |= 0x40;
6123 		spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
6124 	}
6125 }
6126 
6127 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
6128 					const struct hda_fixup *fix, int action)
6129 {
6130 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6131 		struct alc_spec *spec = codec->spec;
6132 		spec->gen.auto_mute_via_amp = 1;
6133 	}
6134 }
6135 
6136 static void alc_fixup_no_shutup(struct hda_codec *codec,
6137 				const struct hda_fixup *fix, int action)
6138 {
6139 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6140 		struct alc_spec *spec = codec->spec;
6141 		spec->no_shutup_pins = 1;
6142 	}
6143 }
6144 
6145 static void alc_fixup_disable_aamix(struct hda_codec *codec,
6146 				    const struct hda_fixup *fix, int action)
6147 {
6148 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6149 		struct alc_spec *spec = codec->spec;
6150 		/* Disable AA-loopback as it causes white noise */
6151 		spec->gen.mixer_nid = 0;
6152 	}
6153 }
6154 
6155 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
6156 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
6157 				  const struct hda_fixup *fix, int action)
6158 {
6159 	static const struct hda_pintbl pincfgs[] = {
6160 		{ 0x16, 0x21211010 }, /* dock headphone */
6161 		{ 0x19, 0x21a11010 }, /* dock mic */
6162 		{ }
6163 	};
6164 	struct alc_spec *spec = codec->spec;
6165 
6166 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6167 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6168 		codec->power_save_node = 0; /* avoid click noises */
6169 		snd_hda_apply_pincfgs(codec, pincfgs);
6170 	}
6171 }
6172 
6173 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6174 				  const struct hda_fixup *fix, int action)
6175 {
6176 	static const struct hda_pintbl pincfgs[] = {
6177 		{ 0x17, 0x21211010 }, /* dock headphone */
6178 		{ 0x19, 0x21a11010 }, /* dock mic */
6179 		{ }
6180 	};
6181 	struct alc_spec *spec = codec->spec;
6182 
6183 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6184 		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6185 		snd_hda_apply_pincfgs(codec, pincfgs);
6186 	} else if (action == HDA_FIXUP_ACT_INIT) {
6187 		/* Enable DOCK device */
6188 		snd_hda_codec_write(codec, 0x17, 0,
6189 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6190 		/* Enable DOCK device */
6191 		snd_hda_codec_write(codec, 0x19, 0,
6192 			    AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6193 	}
6194 }
6195 
6196 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6197 				  const struct hda_fixup *fix, int action)
6198 {
6199 	/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6200 	 * the speaker output becomes too low by some reason on Thinkpads with
6201 	 * ALC298 codec
6202 	 */
6203 	static const hda_nid_t preferred_pairs[] = {
6204 		0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6205 		0
6206 	};
6207 	struct alc_spec *spec = codec->spec;
6208 
6209 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6210 		spec->gen.preferred_dacs = preferred_pairs;
6211 }
6212 
6213 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6214 				   const struct hda_fixup *fix, int action)
6215 {
6216 	static const hda_nid_t preferred_pairs[] = {
6217 		0x17, 0x02, 0x21, 0x03, 0
6218 	};
6219 	struct alc_spec *spec = codec->spec;
6220 
6221 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6222 		spec->gen.preferred_dacs = preferred_pairs;
6223 }
6224 
6225 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6226 {
6227 	struct alc_spec *spec = codec->spec;
6228 	int hp_pin = alc_get_hp_pin(spec);
6229 
6230 	/* Prevent pop noises when headphones are plugged in */
6231 	snd_hda_codec_write(codec, hp_pin, 0,
6232 			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6233 	msleep(20);
6234 }
6235 
6236 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6237 				const struct hda_fixup *fix, int action)
6238 {
6239 	struct alc_spec *spec = codec->spec;
6240 	struct hda_input_mux *imux = &spec->gen.input_mux;
6241 	int i;
6242 
6243 	switch (action) {
6244 	case HDA_FIXUP_ACT_PRE_PROBE:
6245 		/* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6246 		 * it causes a click noise at start up
6247 		 */
6248 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6249 		spec->shutup = alc_shutup_dell_xps13;
6250 		break;
6251 	case HDA_FIXUP_ACT_PROBE:
6252 		/* Make the internal mic the default input source. */
6253 		for (i = 0; i < imux->num_items; i++) {
6254 			if (spec->gen.imux_pins[i] == 0x12) {
6255 				spec->gen.cur_mux[0] = i;
6256 				break;
6257 			}
6258 		}
6259 		break;
6260 	}
6261 }
6262 
6263 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6264 				const struct hda_fixup *fix, int action)
6265 {
6266 	struct alc_spec *spec = codec->spec;
6267 
6268 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6269 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6270 		spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6271 
6272 		/* Disable boost for mic-in permanently. (This code is only called
6273 		   from quirks that guarantee that the headphone is at NID 0x1b.) */
6274 		snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6275 		snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6276 	} else
6277 		alc_fixup_headset_mode(codec, fix, action);
6278 }
6279 
6280 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6281 				const struct hda_fixup *fix, int action)
6282 {
6283 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6284 		alc_write_coef_idx(codec, 0xc4, 0x8000);
6285 		alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6286 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6287 	}
6288 	alc_fixup_headset_mode(codec, fix, action);
6289 }
6290 
6291 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6292 static int find_ext_mic_pin(struct hda_codec *codec)
6293 {
6294 	struct alc_spec *spec = codec->spec;
6295 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6296 	hda_nid_t nid;
6297 	unsigned int defcfg;
6298 	int i;
6299 
6300 	for (i = 0; i < cfg->num_inputs; i++) {
6301 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6302 			continue;
6303 		nid = cfg->inputs[i].pin;
6304 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6305 		if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6306 			continue;
6307 		return nid;
6308 	}
6309 
6310 	return 0;
6311 }
6312 
6313 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6314 				    const struct hda_fixup *fix,
6315 				    int action)
6316 {
6317 	struct alc_spec *spec = codec->spec;
6318 
6319 	if (action == HDA_FIXUP_ACT_PROBE) {
6320 		int mic_pin = find_ext_mic_pin(codec);
6321 		int hp_pin = alc_get_hp_pin(spec);
6322 
6323 		if (snd_BUG_ON(!mic_pin || !hp_pin))
6324 			return;
6325 		snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6326 	}
6327 }
6328 
6329 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6330 					     const struct hda_fixup *fix,
6331 					     int action)
6332 {
6333 	struct alc_spec *spec = codec->spec;
6334 	struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6335 	int i;
6336 
6337 	/* The mic boosts on level 2 and 3 are too noisy
6338 	   on the internal mic input.
6339 	   Therefore limit the boost to 0 or 1. */
6340 
6341 	if (action != HDA_FIXUP_ACT_PROBE)
6342 		return;
6343 
6344 	for (i = 0; i < cfg->num_inputs; i++) {
6345 		hda_nid_t nid = cfg->inputs[i].pin;
6346 		unsigned int defcfg;
6347 		if (cfg->inputs[i].type != AUTO_PIN_MIC)
6348 			continue;
6349 		defcfg = snd_hda_codec_get_pincfg(codec, nid);
6350 		if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6351 			continue;
6352 
6353 		snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6354 					  (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6355 					  (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6356 					  (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6357 					  (0 << AC_AMPCAP_MUTE_SHIFT));
6358 	}
6359 }
6360 
6361 static void alc283_hp_automute_hook(struct hda_codec *codec,
6362 				    struct hda_jack_callback *jack)
6363 {
6364 	struct alc_spec *spec = codec->spec;
6365 	int vref;
6366 
6367 	msleep(200);
6368 	snd_hda_gen_hp_automute(codec, jack);
6369 
6370 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6371 
6372 	msleep(600);
6373 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6374 			    vref);
6375 }
6376 
6377 static void alc283_fixup_chromebook(struct hda_codec *codec,
6378 				    const struct hda_fixup *fix, int action)
6379 {
6380 	struct alc_spec *spec = codec->spec;
6381 
6382 	switch (action) {
6383 	case HDA_FIXUP_ACT_PRE_PROBE:
6384 		snd_hda_override_wcaps(codec, 0x03, 0);
6385 		/* Disable AA-loopback as it causes white noise */
6386 		spec->gen.mixer_nid = 0;
6387 		break;
6388 	case HDA_FIXUP_ACT_INIT:
6389 		/* MIC2-VREF control */
6390 		/* Set to manual mode */
6391 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6392 		/* Enable Line1 input control by verb */
6393 		alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6394 		break;
6395 	}
6396 }
6397 
6398 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6399 				    const struct hda_fixup *fix, int action)
6400 {
6401 	struct alc_spec *spec = codec->spec;
6402 
6403 	switch (action) {
6404 	case HDA_FIXUP_ACT_PRE_PROBE:
6405 		spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6406 		break;
6407 	case HDA_FIXUP_ACT_INIT:
6408 		/* MIC2-VREF control */
6409 		/* Set to manual mode */
6410 		alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6411 		break;
6412 	}
6413 }
6414 
6415 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6416 static void asus_tx300_automute(struct hda_codec *codec)
6417 {
6418 	struct alc_spec *spec = codec->spec;
6419 	snd_hda_gen_update_outputs(codec);
6420 	if (snd_hda_jack_detect(codec, 0x1b))
6421 		spec->gen.mute_bits |= (1ULL << 0x14);
6422 }
6423 
6424 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6425 				    const struct hda_fixup *fix, int action)
6426 {
6427 	struct alc_spec *spec = codec->spec;
6428 	static const struct hda_pintbl dock_pins[] = {
6429 		{ 0x1b, 0x21114000 }, /* dock speaker pin */
6430 		{}
6431 	};
6432 
6433 	switch (action) {
6434 	case HDA_FIXUP_ACT_PRE_PROBE:
6435 		spec->init_amp = ALC_INIT_DEFAULT;
6436 		/* TX300 needs to set up GPIO2 for the speaker amp */
6437 		alc_setup_gpio(codec, 0x04);
6438 		snd_hda_apply_pincfgs(codec, dock_pins);
6439 		spec->gen.auto_mute_via_amp = 1;
6440 		spec->gen.automute_hook = asus_tx300_automute;
6441 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
6442 						    snd_hda_gen_hp_automute);
6443 		break;
6444 	case HDA_FIXUP_ACT_PROBE:
6445 		spec->init_amp = ALC_INIT_DEFAULT;
6446 		break;
6447 	case HDA_FIXUP_ACT_BUILD:
6448 		/* this is a bit tricky; give more sane names for the main
6449 		 * (tablet) speaker and the dock speaker, respectively
6450 		 */
6451 		rename_ctl(codec, "Speaker Playback Switch",
6452 			   "Dock Speaker Playback Switch");
6453 		rename_ctl(codec, "Bass Speaker Playback Switch",
6454 			   "Speaker Playback Switch");
6455 		break;
6456 	}
6457 }
6458 
6459 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6460 				       const struct hda_fixup *fix, int action)
6461 {
6462 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6463 		/* DAC node 0x03 is giving mono output. We therefore want to
6464 		   make sure 0x14 (front speaker) and 0x15 (headphones) use the
6465 		   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6466 		static const hda_nid_t conn1[] = { 0x0c };
6467 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6468 		snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6469 	}
6470 }
6471 
6472 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6473 					const struct hda_fixup *fix, int action)
6474 {
6475 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6476 		/* The speaker is routed to the Node 0x06 by a mistake, as a result
6477 		   we can't adjust the speaker's volume since this node does not has
6478 		   Amp-out capability. we change the speaker's route to:
6479 		   Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6480 		   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6481 		   speaker's volume now. */
6482 
6483 		static const hda_nid_t conn1[] = { 0x0c };
6484 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6485 	}
6486 }
6487 
6488 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6489 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6490 				      const struct hda_fixup *fix, int action)
6491 {
6492 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6493 		static const hda_nid_t conn[] = { 0x02, 0x03 };
6494 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6495 	}
6496 }
6497 
6498 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6499 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6500 					  const struct hda_fixup *fix, int action)
6501 {
6502 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6503 		static const hda_nid_t conn[] = { 0x02 };
6504 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6505 	}
6506 }
6507 
6508 /* Hook to update amp GPIO4 for automute */
6509 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6510 					  struct hda_jack_callback *jack)
6511 {
6512 	struct alc_spec *spec = codec->spec;
6513 
6514 	snd_hda_gen_hp_automute(codec, jack);
6515 	/* mute_led_polarity is set to 0, so we pass inverted value here */
6516 	alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6517 			    !spec->gen.hp_jack_present);
6518 }
6519 
6520 /* Manage GPIOs for HP EliteBook Folio 9480m.
6521  *
6522  * GPIO4 is the headphone amplifier power control
6523  * GPIO3 is the audio output mute indicator LED
6524  */
6525 
6526 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6527 				  const struct hda_fixup *fix,
6528 				  int action)
6529 {
6530 	struct alc_spec *spec = codec->spec;
6531 
6532 	alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6533 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6534 		/* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6535 		spec->gpio_mask |= 0x10;
6536 		spec->gpio_dir |= 0x10;
6537 		spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6538 	}
6539 }
6540 
6541 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6542 				   const struct hda_fixup *fix,
6543 				   int action)
6544 {
6545 	struct alc_spec *spec = codec->spec;
6546 
6547 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6548 		spec->gpio_mask |= 0x04;
6549 		spec->gpio_dir |= 0x04;
6550 		/* set data bit low */
6551 	}
6552 }
6553 
6554 /* Quirk for Thinkpad X1 7th and 8th Gen
6555  * The following fixed routing needed
6556  * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6557  * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6558  * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6559  */
6560 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6561 					  const struct hda_fixup *fix, int action)
6562 {
6563 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6564 	static const hda_nid_t preferred_pairs[] = {
6565 		0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6566 	};
6567 	struct alc_spec *spec = codec->spec;
6568 
6569 	switch (action) {
6570 	case HDA_FIXUP_ACT_PRE_PROBE:
6571 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6572 		spec->gen.preferred_dacs = preferred_pairs;
6573 		break;
6574 	case HDA_FIXUP_ACT_BUILD:
6575 		/* The generic parser creates somewhat unintuitive volume ctls
6576 		 * with the fixed routing above, and the shared DAC2 may be
6577 		 * confusing for PA.
6578 		 * Rename those to unique names so that PA doesn't touch them
6579 		 * and use only Master volume.
6580 		 */
6581 		rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6582 		rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6583 		break;
6584 	}
6585 }
6586 
6587 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6588 					 const struct hda_fixup *fix,
6589 					 int action)
6590 {
6591 	alc_fixup_dual_codecs(codec, fix, action);
6592 	switch (action) {
6593 	case HDA_FIXUP_ACT_PRE_PROBE:
6594 		/* override card longname to provide a unique UCM profile */
6595 		strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6596 		break;
6597 	case HDA_FIXUP_ACT_BUILD:
6598 		/* rename Capture controls depending on the codec */
6599 		rename_ctl(codec, "Capture Volume",
6600 			   codec->addr == 0 ?
6601 			   "Rear-Panel Capture Volume" :
6602 			   "Front-Panel Capture Volume");
6603 		rename_ctl(codec, "Capture Switch",
6604 			   codec->addr == 0 ?
6605 			   "Rear-Panel Capture Switch" :
6606 			   "Front-Panel Capture Switch");
6607 		break;
6608 	}
6609 }
6610 
6611 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6612 				      const struct hda_fixup *fix, int action)
6613 {
6614 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6615 		return;
6616 
6617 	codec->power_save_node = 1;
6618 }
6619 
6620 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6621 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6622 				    const struct hda_fixup *fix, int action)
6623 {
6624 	struct alc_spec *spec = codec->spec;
6625 	static const hda_nid_t preferred_pairs[] = {
6626 		0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6627 		0
6628 	};
6629 
6630 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6631 		return;
6632 
6633 	spec->gen.preferred_dacs = preferred_pairs;
6634 	spec->gen.auto_mute_via_amp = 1;
6635 	codec->power_save_node = 0;
6636 }
6637 
6638 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6639 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6640 				    const struct hda_fixup *fix, int action)
6641 {
6642 	static const hda_nid_t preferred_pairs[] = {
6643 		0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6644 	};
6645 	struct alc_spec *spec = codec->spec;
6646 
6647 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6648 		spec->gen.preferred_dacs = preferred_pairs;
6649 		spec->gen.obey_preferred_dacs = 1;
6650 	}
6651 }
6652 
6653 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6654 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6655 			      const struct hda_fixup *fix, int action)
6656 {
6657 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
6658 		return;
6659 
6660 	snd_hda_override_wcaps(codec, 0x03, 0);
6661 }
6662 
6663 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6664 {
6665 	switch (codec->core.vendor_id) {
6666 	case 0x10ec0274:
6667 	case 0x10ec0294:
6668 	case 0x10ec0225:
6669 	case 0x10ec0295:
6670 	case 0x10ec0299:
6671 		alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6672 		alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6673 		break;
6674 	case 0x10ec0230:
6675 	case 0x10ec0235:
6676 	case 0x10ec0236:
6677 	case 0x10ec0255:
6678 	case 0x10ec0256:
6679 	case 0x10ec0257:
6680 	case 0x19e58326:
6681 		alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6682 		alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6683 		break;
6684 	}
6685 }
6686 
6687 static void alc295_fixup_chromebook(struct hda_codec *codec,
6688 				    const struct hda_fixup *fix, int action)
6689 {
6690 	struct alc_spec *spec = codec->spec;
6691 
6692 	switch (action) {
6693 	case HDA_FIXUP_ACT_PRE_PROBE:
6694 		spec->ultra_low_power = true;
6695 		break;
6696 	case HDA_FIXUP_ACT_INIT:
6697 		alc_combo_jack_hp_jd_restart(codec);
6698 		break;
6699 	}
6700 }
6701 
6702 static void alc256_fixup_chromebook(struct hda_codec *codec,
6703 				    const struct hda_fixup *fix, int action)
6704 {
6705 	struct alc_spec *spec = codec->spec;
6706 
6707 	switch (action) {
6708 	case HDA_FIXUP_ACT_PRE_PROBE:
6709 		spec->gen.suppress_auto_mute = 1;
6710 		spec->gen.suppress_auto_mic = 1;
6711 		spec->en_3kpull_low = false;
6712 		break;
6713 	}
6714 }
6715 
6716 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6717 				  const struct hda_fixup *fix, int action)
6718 {
6719 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
6720 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6721 }
6722 
6723 
6724 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6725 					struct hda_jack_callback *cb)
6726 {
6727 	/* The Windows driver sets the codec up in a very different way where
6728 	 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6729 	 */
6730 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6731 		alc_write_coef_idx(codec, 0x10, 0x8a20);
6732 	else
6733 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6734 }
6735 
6736 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6737 					const struct hda_fixup *fix, int action)
6738 {
6739 	/* Pin 0x21: headphones/headset mic */
6740 	if (!is_jack_detectable(codec, 0x21))
6741 		return;
6742 
6743 	switch (action) {
6744 	case HDA_FIXUP_ACT_PRE_PROBE:
6745 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6746 				alc294_gx502_toggle_output);
6747 		break;
6748 	case HDA_FIXUP_ACT_INIT:
6749 		/* Make sure to start in a correct state, i.e. if
6750 		 * headphones have been plugged in before powering up the system
6751 		 */
6752 		alc294_gx502_toggle_output(codec, NULL);
6753 		break;
6754 	}
6755 }
6756 
6757 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6758 				       struct hda_jack_callback *cb)
6759 {
6760 	/* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6761 	 * responsible from changes between speakers and headphones
6762 	 */
6763 	if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6764 		alc_write_coef_idx(codec, 0x10, 0x8420);
6765 	else
6766 		alc_write_coef_idx(codec, 0x10, 0x0a20);
6767 }
6768 
6769 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6770 				  const struct hda_fixup *fix, int action)
6771 {
6772 	if (!is_jack_detectable(codec, 0x21))
6773 		return;
6774 
6775 	switch (action) {
6776 	case HDA_FIXUP_ACT_PRE_PROBE:
6777 		snd_hda_jack_detect_enable_callback(codec, 0x21,
6778 				alc294_gu502_toggle_output);
6779 		break;
6780 	case HDA_FIXUP_ACT_INIT:
6781 		alc294_gu502_toggle_output(codec, NULL);
6782 		break;
6783 	}
6784 }
6785 
6786 static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6787 			      const struct hda_fixup *fix, int action)
6788 {
6789 	if (action != HDA_FIXUP_ACT_INIT)
6790 		return;
6791 
6792 	msleep(100);
6793 	alc_write_coef_idx(codec, 0x65, 0x0);
6794 }
6795 
6796 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6797 				    const struct hda_fixup *fix, int action)
6798 {
6799 	switch (action) {
6800 	case HDA_FIXUP_ACT_INIT:
6801 		alc_combo_jack_hp_jd_restart(codec);
6802 		break;
6803 	}
6804 }
6805 
6806 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6807 				    const struct hda_fixup *fix, int action)
6808 {
6809 	struct alc_spec *spec = codec->spec;
6810 
6811 	switch (action) {
6812 	case HDA_FIXUP_ACT_PRE_PROBE:
6813 		/* Mic RING SLEEVE swap for combo jack */
6814 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6815 		spec->no_internal_mic_pin = true;
6816 		break;
6817 	case HDA_FIXUP_ACT_INIT:
6818 		alc_combo_jack_hp_jd_restart(codec);
6819 		break;
6820 	}
6821 }
6822 
6823 /* GPIO1 = amplifier on/off
6824  * GPIO3 = mic mute LED
6825  */
6826 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6827 					  const struct hda_fixup *fix, int action)
6828 {
6829 	static const hda_nid_t conn[] = { 0x02 };
6830 
6831 	struct alc_spec *spec = codec->spec;
6832 	static const struct hda_pintbl pincfgs[] = {
6833 		{ 0x14, 0x90170110 },  /* front/high speakers */
6834 		{ 0x17, 0x90170130 },  /* back/bass speakers */
6835 		{ }
6836 	};
6837 
6838 	//enable micmute led
6839 	alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6840 
6841 	switch (action) {
6842 	case HDA_FIXUP_ACT_PRE_PROBE:
6843 		spec->micmute_led_polarity = 1;
6844 		/* needed for amp of back speakers */
6845 		spec->gpio_mask |= 0x01;
6846 		spec->gpio_dir |= 0x01;
6847 		snd_hda_apply_pincfgs(codec, pincfgs);
6848 		/* share DAC to have unified volume control */
6849 		snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6850 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6851 		break;
6852 	case HDA_FIXUP_ACT_INIT:
6853 		/* need to toggle GPIO to enable the amp of back speakers */
6854 		alc_update_gpio_data(codec, 0x01, true);
6855 		msleep(100);
6856 		alc_update_gpio_data(codec, 0x01, false);
6857 		break;
6858 	}
6859 }
6860 
6861 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6862 					  const struct hda_fixup *fix, int action)
6863 {
6864 	static const hda_nid_t conn[] = { 0x02 };
6865 	static const struct hda_pintbl pincfgs[] = {
6866 		{ 0x14, 0x90170110 },  /* rear speaker */
6867 		{ }
6868 	};
6869 
6870 	switch (action) {
6871 	case HDA_FIXUP_ACT_PRE_PROBE:
6872 		snd_hda_apply_pincfgs(codec, pincfgs);
6873 		/* force front speaker to DAC1 */
6874 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6875 		break;
6876 	}
6877 }
6878 
6879 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6880 				      const struct hda_fixup *fix,
6881 				      int action)
6882 {
6883 	static const struct coef_fw coefs[] = {
6884 		WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6885 		WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6886 		WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6887 		WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6888 		WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6889 		WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6890 		WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6891 		WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6892 		WRITE_COEF(0x6e, 0x1005), { }
6893 	};
6894 
6895 	static const struct hda_pintbl pincfgs[] = {
6896 		{ 0x12, 0xb7a60130 },  /* Internal microphone*/
6897 		{ 0x14, 0x90170150 },  /* B&O soundbar speakers */
6898 		{ 0x17, 0x90170153 },  /* Side speakers */
6899 		{ 0x19, 0x03a11040 },  /* Headset microphone */
6900 		{ }
6901 	};
6902 
6903 	switch (action) {
6904 	case HDA_FIXUP_ACT_PRE_PROBE:
6905 		snd_hda_apply_pincfgs(codec, pincfgs);
6906 
6907 		/* Fixes volume control problem for side speakers */
6908 		alc295_fixup_disable_dac3(codec, fix, action);
6909 
6910 		/* Fixes no sound from headset speaker */
6911 		snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6912 
6913 		/* Auto-enable headset mic when plugged */
6914 		snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6915 
6916 		/* Headset mic volume enhancement */
6917 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6918 		break;
6919 	case HDA_FIXUP_ACT_INIT:
6920 		alc_process_coef_fw(codec, coefs);
6921 		break;
6922 	case HDA_FIXUP_ACT_BUILD:
6923 		rename_ctl(codec, "Bass Speaker Playback Volume",
6924 			   "B&O-Tuned Playback Volume");
6925 		rename_ctl(codec, "Front Playback Switch",
6926 			   "B&O Soundbar Playback Switch");
6927 		rename_ctl(codec, "Bass Speaker Playback Switch",
6928 			   "Side Speaker Playback Switch");
6929 		break;
6930 	}
6931 }
6932 
6933 /* for hda_fixup_thinkpad_acpi() */
6934 #include "thinkpad_helper.c"
6935 
6936 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6937 				    const struct hda_fixup *fix, int action)
6938 {
6939 	alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6940 	hda_fixup_thinkpad_acpi(codec, fix, action);
6941 }
6942 
6943 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6944 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6945 						  const struct hda_fixup *fix,
6946 						  int action)
6947 {
6948 	struct alc_spec *spec = codec->spec;
6949 
6950 	switch (action) {
6951 	case HDA_FIXUP_ACT_PRE_PROBE:
6952 		spec->gen.suppress_auto_mute = 1;
6953 		break;
6954 	}
6955 }
6956 
6957 static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
6958 {
6959 	struct hda_codec *cdc = data;
6960 	struct alc_spec *spec = cdc->spec;
6961 
6962 	codec_info(cdc, "ACPI Notification %d\n", event);
6963 
6964 	hda_component_acpi_device_notify(&spec->comps, handle, event, data);
6965 }
6966 
6967 static int comp_bind(struct device *dev)
6968 {
6969 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6970 	struct alc_spec *spec = cdc->spec;
6971 	int ret;
6972 
6973 	ret = hda_component_manager_bind(cdc, &spec->comps);
6974 	if (ret)
6975 		return ret;
6976 
6977 	return hda_component_manager_bind_acpi_notifications(cdc,
6978 							     &spec->comps,
6979 							     comp_acpi_device_notify, cdc);
6980 }
6981 
6982 static void comp_unbind(struct device *dev)
6983 {
6984 	struct hda_codec *cdc = dev_to_hda_codec(dev);
6985 	struct alc_spec *spec = cdc->spec;
6986 
6987 	hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify);
6988 	hda_component_manager_unbind(cdc, &spec->comps);
6989 }
6990 
6991 static const struct component_master_ops comp_master_ops = {
6992 	.bind = comp_bind,
6993 	.unbind = comp_unbind,
6994 };
6995 
6996 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6997 				       struct snd_pcm_substream *sub, int action)
6998 {
6999 	struct alc_spec *spec = cdc->spec;
7000 
7001 	hda_component_manager_playback_hook(&spec->comps, action);
7002 }
7003 
7004 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
7005 			       const char *hid, const char *match_str, int count)
7006 {
7007 	struct alc_spec *spec = cdc->spec;
7008 	int ret;
7009 
7010 	switch (action) {
7011 	case HDA_FIXUP_ACT_PRE_PROBE:
7012 		ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid,
7013 						 match_str, &comp_master_ops);
7014 		if (ret)
7015 			return;
7016 
7017 		spec->gen.pcm_playback_hook = comp_generic_playback_hook;
7018 		break;
7019 	case HDA_FIXUP_ACT_FREE:
7020 		hda_component_manager_free(&spec->comps, &comp_master_ops);
7021 		break;
7022 	}
7023 }
7024 
7025 static void find_cirrus_companion_amps(struct hda_codec *cdc)
7026 {
7027 	struct device *dev = hda_codec_dev(cdc);
7028 	struct acpi_device *adev;
7029 	struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
7030 	const char *bus = NULL;
7031 	static const struct {
7032 		const char *hid;
7033 		const char *name;
7034 	} acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
7035 			{ "CSC3556", "cs35l56-hda" },
7036 			{ "CSC3557", "cs35l57-hda" }};
7037 	char *match;
7038 	int i, count = 0, count_devindex = 0;
7039 
7040 	for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
7041 		adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
7042 		if (adev)
7043 			break;
7044 	}
7045 	if (!adev) {
7046 		codec_dbg(cdc, "Did not find ACPI entry for a Cirrus Amp\n");
7047 		return;
7048 	}
7049 
7050 	count = i2c_acpi_client_count(adev);
7051 	if (count > 0) {
7052 		bus = "i2c";
7053 	} else {
7054 		count = acpi_spi_count_resources(adev);
7055 		if (count > 0)
7056 			bus = "spi";
7057 	}
7058 
7059 	fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
7060 	acpi_dev_put(adev);
7061 
7062 	if (!bus) {
7063 		codec_err(cdc, "Did not find any buses for %s\n", acpi_ids[i].hid);
7064 		return;
7065 	}
7066 
7067 	if (!fwnode) {
7068 		codec_err(cdc, "Could not get fwnode for %s\n", acpi_ids[i].hid);
7069 		return;
7070 	}
7071 
7072 	/*
7073 	 * When available the cirrus,dev-index property is an accurate
7074 	 * count of the amps in a system and is used in preference to
7075 	 * the count of bus devices that can contain additional address
7076 	 * alias entries.
7077 	 */
7078 	count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
7079 	if (count_devindex > 0)
7080 		count = count_devindex;
7081 
7082 	match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
7083 	if (!match)
7084 		return;
7085 	codec_info(cdc, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
7086 	comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
7087 }
7088 
7089 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7090 {
7091 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
7092 }
7093 
7094 static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7095 {
7096 	comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
7097 }
7098 
7099 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7100 {
7101 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
7102 }
7103 
7104 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7105 {
7106 	comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
7107 }
7108 
7109 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7110 						 int action)
7111 {
7112 	comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
7113 }
7114 
7115 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7116 						 int action)
7117 {
7118 	comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
7119 }
7120 
7121 static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7122 {
7123 	/*
7124 	 * The same SSID has been re-used in different hardware, they have
7125 	 * different codecs and the newer GA403U has a ALC285.
7126 	 */
7127 	if (cdc->core.vendor_id != 0x10ec0285)
7128 		alc_fixup_inv_dmic(cdc, fix, action);
7129 }
7130 
7131 static void tas2781_fixup_i2c(struct hda_codec *cdc,
7132 	const struct hda_fixup *fix, int action)
7133 {
7134 	comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
7135 }
7136 
7137 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
7138 	const struct hda_fixup *fix, int action)
7139 {
7140 	comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
7141 }
7142 
7143 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
7144 	const struct hda_fixup *fix, int action)
7145 {
7146 	alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
7147 }
7148 
7149 
7150 /* for alc295_fixup_hp_top_speakers */
7151 #include "hp_x360_helper.c"
7152 
7153 /* for alc285_fixup_ideapad_s740_coef() */
7154 #include "ideapad_s740_helper.c"
7155 
7156 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7157 	WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7158 	WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7159 	WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7160 	{}
7161 };
7162 
7163 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7164 					   const struct hda_fixup *fix,
7165 					   int action)
7166 {
7167 	/*
7168 	 * A certain other OS sets these coeffs to different values. On at least
7169 	 * one TongFang barebone these settings might survive even a cold
7170 	 * reboot. So to restore a clean slate the values are explicitly reset
7171 	 * to default here. Without this, the external microphone is always in a
7172 	 * plugged-in state, while the internal microphone is always in an
7173 	 * unplugged state, breaking the ability to use the internal microphone.
7174 	 */
7175 	alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
7176 }
7177 
7178 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7179 	WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7180 	WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7181 	WRITE_COEF(0x49, 0x0149),
7182 	{}
7183 };
7184 
7185 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7186 				       const struct hda_fixup *fix,
7187 				       int action)
7188 {
7189 	/*
7190 	 * The audio jack input and output is not detected on the ASRock NUC Box
7191 	 * 1100 series when cold booting without this fix. Warm rebooting from a
7192 	 * certain other OS makes the audio functional, as COEF settings are
7193 	 * preserved in this case. This fix sets these altered COEF values as
7194 	 * the default.
7195 	 */
7196 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7197 }
7198 
7199 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7200 						    const struct hda_fixup *fix,
7201 						    int action)
7202 {
7203 	/*
7204 	 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7205 	 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7206 	 * needs an additional quirk for sound working after suspend and resume.
7207 	 */
7208 	if (codec->core.vendor_id == 0x10ec0256) {
7209 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7210 		snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7211 	} else {
7212 		snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7213 	}
7214 }
7215 
7216 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
7217 					      const struct hda_fixup *fix, int action)
7218 {
7219 	u32 caps;
7220 	u8 nsteps, offs;
7221 
7222 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7223 		return;
7224 
7225 	caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
7226 	nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
7227 	offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
7228 	caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
7229 	caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
7230 
7231 	if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
7232 		codec_warn(codec, "failed to override amp caps for NID 0x3\n");
7233 }
7234 
7235 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7236 						  const struct hda_fixup *fix,
7237 						  int action)
7238 {
7239 	struct alc_spec *spec = codec->spec;
7240 	struct hda_input_mux *imux = &spec->gen.input_mux;
7241 	int i;
7242 
7243 	alc269_fixup_limit_int_mic_boost(codec, fix, action);
7244 
7245 	switch (action) {
7246 	case HDA_FIXUP_ACT_PRE_PROBE:
7247 		/**
7248 		 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7249 		 * to Hi-Z to avoid pop noises at startup and when plugging and
7250 		 * unplugging headphones.
7251 		 */
7252 		snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7253 		snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7254 		break;
7255 	case HDA_FIXUP_ACT_PROBE:
7256 		/**
7257 		 * Make the internal mic (0x12) the default input source to
7258 		 * prevent pop noises on cold boot.
7259 		 */
7260 		for (i = 0; i < imux->num_items; i++) {
7261 			if (spec->gen.imux_pins[i] == 0x12) {
7262 				spec->gen.cur_mux[0] = i;
7263 				break;
7264 			}
7265 		}
7266 		break;
7267 	}
7268 }
7269 
7270 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7271 					  const struct hda_fixup *fix, int action)
7272 {
7273 	/*
7274 	 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7275 	 * unconnected.
7276 	 */
7277 	static const struct hda_pintbl pincfgs[] = {
7278 		{ 0x17, 0x90170121 },
7279 		{ }
7280 	};
7281 	/*
7282 	 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7283 	 * DAC 0x02 and 0x03 would be fine.
7284 	 */
7285 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7286 	/*
7287 	 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7288 	 * Headphones (0x21) are connected to DAC 0x03.
7289 	 */
7290 	static const hda_nid_t preferred_pairs[] = {
7291 		0x14, 0x02,
7292 		0x17, 0x02,
7293 		0x21, 0x03,
7294 		0
7295 	};
7296 	struct alc_spec *spec = codec->spec;
7297 
7298 	switch (action) {
7299 	case HDA_FIXUP_ACT_PRE_PROBE:
7300 		snd_hda_apply_pincfgs(codec, pincfgs);
7301 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7302 		spec->gen.preferred_dacs = preferred_pairs;
7303 		break;
7304 	}
7305 }
7306 
7307 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7308 					  const struct hda_fixup *fix, int action)
7309 {
7310 	static const struct hda_pintbl pincfgs[] = {
7311 		{ 0x14, 0x90170151 },
7312 		{ 0x17, 0x90170150 },
7313 		{ }
7314 	};
7315 	static const hda_nid_t conn[] = { 0x02, 0x03 };
7316 	static const hda_nid_t preferred_pairs[] = {
7317 		0x14, 0x02,
7318 		0x17, 0x03,
7319 		0x21, 0x02,
7320 		0
7321 	};
7322 	struct alc_spec *spec = codec->spec;
7323 
7324 	alc_fixup_no_shutup(codec, fix, action);
7325 
7326 	switch (action) {
7327 	case HDA_FIXUP_ACT_PRE_PROBE:
7328 		snd_hda_apply_pincfgs(codec, pincfgs);
7329 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7330 		spec->gen.preferred_dacs = preferred_pairs;
7331 		break;
7332 	}
7333 }
7334 
7335 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7336 static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7337 				    const struct hda_fixup *fix, int action)
7338 {
7339 	struct alc_spec *spec = codec->spec;
7340 	static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7341 	static const hda_nid_t preferred_pairs[] = {
7342 		0x17, 0x02, 0x21, 0x03, 0
7343 	};
7344 
7345 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7346 		return;
7347 
7348 	snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7349 	spec->gen.preferred_dacs = preferred_pairs;
7350 	spec->gen.auto_mute_via_amp = 1;
7351 	if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7352 		snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7353 					0x0); /* Make sure 0x14 was disable */
7354 	}
7355 }
7356 /* Fix none verb table of Headset Mic pin */
7357 static void alc_fixup_headset_mic(struct hda_codec *codec,
7358 				   const struct hda_fixup *fix, int action)
7359 {
7360 	struct alc_spec *spec = codec->spec;
7361 	static const struct hda_pintbl pincfgs[] = {
7362 		{ 0x19, 0x03a1103c },
7363 		{ }
7364 	};
7365 
7366 	switch (action) {
7367 	case HDA_FIXUP_ACT_PRE_PROBE:
7368 		snd_hda_apply_pincfgs(codec, pincfgs);
7369 		alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7370 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7371 		break;
7372 	}
7373 }
7374 
7375 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
7376 					  const struct hda_fixup *fix, int action)
7377 {
7378 	/*
7379 	 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7380 	 * unconnected.
7381 	 * The Pin Complex 0x17 for the bass speakers has the lowest association
7382 	 * and sequence values so shift it up a bit to squeeze 0x14 in.
7383 	 */
7384 	static const struct hda_pintbl pincfgs[] = {
7385 		{ 0x14, 0x90170110 }, // top/treble
7386 		{ 0x17, 0x90170111 }, // bottom/bass
7387 		{ }
7388 	};
7389 
7390 	/*
7391 	 * Force DAC 0x02 for the bass speakers 0x17.
7392 	 */
7393 	static const hda_nid_t conn[] = { 0x02 };
7394 
7395 	switch (action) {
7396 	case HDA_FIXUP_ACT_PRE_PROBE:
7397 		snd_hda_apply_pincfgs(codec, pincfgs);
7398 		snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7399 		break;
7400 	}
7401 
7402 	cs35l41_fixup_i2c_two(codec, fix, action);
7403 	alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7404 	alc245_fixup_hp_gpio_led(codec, fix, action);
7405 }
7406 
7407 /*
7408  * ALC287 PCM hooks
7409  */
7410 static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
7411 				   struct hda_codec *codec,
7412 				   struct snd_pcm_substream *substream,
7413 				   int action)
7414 {
7415 	alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7416 	switch (action) {
7417 	case HDA_GEN_PCM_ACT_OPEN:
7418 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
7419 		break;
7420 	case HDA_GEN_PCM_ACT_CLOSE:
7421 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7422 		break;
7423 	}
7424 }
7425 
7426 static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
7427 {
7428 	if (is_s4_suspend(codec)) {
7429 		alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7430 		alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7431 	}
7432 }
7433 
7434 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
7435 			       const struct hda_fixup *fix, int action)
7436 {
7437 	struct alc_spec *spec = codec->spec;
7438 
7439 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
7440 		return;
7441 	spec->power_hook = alc287_s4_power_gpio3_default;
7442 	spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
7443 }
7444 
7445 
7446 enum {
7447 	ALC269_FIXUP_GPIO2,
7448 	ALC269_FIXUP_SONY_VAIO,
7449 	ALC275_FIXUP_SONY_VAIO_GPIO2,
7450 	ALC269_FIXUP_DELL_M101Z,
7451 	ALC269_FIXUP_SKU_IGNORE,
7452 	ALC269_FIXUP_ASUS_G73JW,
7453 	ALC269_FIXUP_ASUS_N7601ZM_PINS,
7454 	ALC269_FIXUP_ASUS_N7601ZM,
7455 	ALC269_FIXUP_LENOVO_EAPD,
7456 	ALC275_FIXUP_SONY_HWEQ,
7457 	ALC275_FIXUP_SONY_DISABLE_AAMIX,
7458 	ALC271_FIXUP_DMIC,
7459 	ALC269_FIXUP_PCM_44K,
7460 	ALC269_FIXUP_STEREO_DMIC,
7461 	ALC269_FIXUP_HEADSET_MIC,
7462 	ALC269_FIXUP_QUANTA_MUTE,
7463 	ALC269_FIXUP_LIFEBOOK,
7464 	ALC269_FIXUP_LIFEBOOK_EXTMIC,
7465 	ALC269_FIXUP_LIFEBOOK_HP_PIN,
7466 	ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
7467 	ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
7468 	ALC269_FIXUP_AMIC,
7469 	ALC269_FIXUP_DMIC,
7470 	ALC269VB_FIXUP_AMIC,
7471 	ALC269VB_FIXUP_DMIC,
7472 	ALC269_FIXUP_HP_MUTE_LED,
7473 	ALC269_FIXUP_HP_MUTE_LED_MIC1,
7474 	ALC269_FIXUP_HP_MUTE_LED_MIC2,
7475 	ALC269_FIXUP_HP_MUTE_LED_MIC3,
7476 	ALC269_FIXUP_HP_GPIO_LED,
7477 	ALC269_FIXUP_HP_GPIO_MIC1_LED,
7478 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
7479 	ALC269_FIXUP_INV_DMIC,
7480 	ALC269_FIXUP_LENOVO_DOCK,
7481 	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
7482 	ALC269_FIXUP_NO_SHUTUP,
7483 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
7484 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
7485 	ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7486 	ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7487 	ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7488 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7489 	ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
7490 	ALC269_FIXUP_HEADSET_MODE,
7491 	ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7492 	ALC269_FIXUP_ASPIRE_HEADSET_MIC,
7493 	ALC269_FIXUP_ASUS_X101_FUNC,
7494 	ALC269_FIXUP_ASUS_X101_VERB,
7495 	ALC269_FIXUP_ASUS_X101,
7496 	ALC271_FIXUP_AMIC_MIC2,
7497 	ALC271_FIXUP_HP_GATE_MIC_JACK,
7498 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
7499 	ALC269_FIXUP_ACER_AC700,
7500 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
7501 	ALC269VB_FIXUP_ASUS_ZENBOOK,
7502 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
7503 	ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
7504 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
7505 	ALC269VB_FIXUP_ORDISSIMO_EVE2,
7506 	ALC283_FIXUP_CHROME_BOOK,
7507 	ALC283_FIXUP_SENSE_COMBO_JACK,
7508 	ALC282_FIXUP_ASUS_TX300,
7509 	ALC283_FIXUP_INT_MIC,
7510 	ALC290_FIXUP_MONO_SPEAKERS,
7511 	ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7512 	ALC290_FIXUP_SUBWOOFER,
7513 	ALC290_FIXUP_SUBWOOFER_HSJACK,
7514 	ALC269_FIXUP_THINKPAD_ACPI,
7515 	ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7516 	ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
7517 	ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7518 	ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7519 	ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7520 	ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7521 	ALC255_FIXUP_HEADSET_MODE,
7522 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
7523 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7524 	ALC292_FIXUP_TPT440_DOCK,
7525 	ALC292_FIXUP_TPT440,
7526 	ALC283_FIXUP_HEADSET_MIC,
7527 	ALC255_FIXUP_MIC_MUTE_LED,
7528 	ALC282_FIXUP_ASPIRE_V5_PINS,
7529 	ALC269VB_FIXUP_ASPIRE_E1_COEF,
7530 	ALC280_FIXUP_HP_GPIO4,
7531 	ALC286_FIXUP_HP_GPIO_LED,
7532 	ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
7533 	ALC280_FIXUP_HP_DOCK_PINS,
7534 	ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
7535 	ALC280_FIXUP_HP_9480M,
7536 	ALC245_FIXUP_HP_X360_AMP,
7537 	ALC285_FIXUP_HP_SPECTRE_X360_EB1,
7538 	ALC285_FIXUP_HP_ENVY_X360,
7539 	ALC288_FIXUP_DELL_HEADSET_MODE,
7540 	ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7541 	ALC288_FIXUP_DELL_XPS_13,
7542 	ALC288_FIXUP_DISABLE_AAMIX,
7543 	ALC292_FIXUP_DELL_E7X_AAMIX,
7544 	ALC292_FIXUP_DELL_E7X,
7545 	ALC292_FIXUP_DISABLE_AAMIX,
7546 	ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
7547 	ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
7548 	ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7549 	ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7550 	ALC275_FIXUP_DELL_XPS,
7551 	ALC293_FIXUP_LENOVO_SPK_NOISE,
7552 	ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7553 	ALC255_FIXUP_DELL_SPK_NOISE,
7554 	ALC225_FIXUP_DISABLE_MIC_VREF,
7555 	ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7556 	ALC295_FIXUP_DISABLE_DAC3,
7557 	ALC285_FIXUP_SPEAKER2_TO_DAC1,
7558 	ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7559 	ALC285_FIXUP_ASUS_HEADSET_MIC,
7560 	ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
7561 	ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7562 	ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
7563 	ALC280_FIXUP_HP_HEADSET_MIC,
7564 	ALC221_FIXUP_HP_FRONT_MIC,
7565 	ALC292_FIXUP_TPT460,
7566 	ALC298_FIXUP_SPK_VOLUME,
7567 	ALC298_FIXUP_LENOVO_SPK_VOLUME,
7568 	ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
7569 	ALC269_FIXUP_ATIV_BOOK_8,
7570 	ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
7571 	ALC221_FIXUP_HP_MIC_NO_PRESENCE,
7572 	ALC256_FIXUP_ASUS_HEADSET_MODE,
7573 	ALC256_FIXUP_ASUS_MIC,
7574 	ALC256_FIXUP_ASUS_AIO_GPIO2,
7575 	ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7576 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
7577 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
7578 	ALC233_FIXUP_ACER_HEADSET_MIC,
7579 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
7580 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
7581 	ALC225_FIXUP_S3_POP_NOISE,
7582 	ALC700_FIXUP_INTEL_REFERENCE,
7583 	ALC274_FIXUP_DELL_BIND_DACS,
7584 	ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7585 	ALC298_FIXUP_TPT470_DOCK_FIX,
7586 	ALC298_FIXUP_TPT470_DOCK,
7587 	ALC255_FIXUP_DUMMY_LINEOUT_VERB,
7588 	ALC255_FIXUP_DELL_HEADSET_MIC,
7589 	ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
7590 	ALC298_FIXUP_HUAWEI_MBX_STEREO,
7591 	ALC295_FIXUP_HP_X360,
7592 	ALC221_FIXUP_HP_HEADSET_MIC,
7593 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7594 	ALC295_FIXUP_HP_AUTO_MUTE,
7595 	ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7596 	ALC294_FIXUP_ASUS_MIC,
7597 	ALC294_FIXUP_ASUS_HEADSET_MIC,
7598 	ALC294_FIXUP_ASUS_SPK,
7599 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7600 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7601 	ALC255_FIXUP_ACER_HEADSET_MIC,
7602 	ALC295_FIXUP_CHROME_BOOK,
7603 	ALC225_FIXUP_HEADSET_JACK,
7604 	ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7605 	ALC225_FIXUP_WYSE_AUTO_MUTE,
7606 	ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
7607 	ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
7608 	ALC256_FIXUP_ASUS_HEADSET_MIC,
7609 	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7610 	ALC299_FIXUP_PREDATOR_SPK,
7611 	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
7612 	ALC289_FIXUP_DELL_SPK1,
7613 	ALC289_FIXUP_DELL_SPK2,
7614 	ALC289_FIXUP_DUAL_SPK,
7615 	ALC289_FIXUP_RTK_AMP_DUAL_SPK,
7616 	ALC294_FIXUP_SPK2_TO_DAC1,
7617 	ALC294_FIXUP_ASUS_DUAL_SPK,
7618 	ALC285_FIXUP_THINKPAD_X1_GEN7,
7619 	ALC285_FIXUP_THINKPAD_HEADSET_JACK,
7620 	ALC294_FIXUP_ASUS_ALLY,
7621 	ALC294_FIXUP_ASUS_ALLY_X,
7622 	ALC294_FIXUP_ASUS_ALLY_PINS,
7623 	ALC294_FIXUP_ASUS_ALLY_VERBS,
7624 	ALC294_FIXUP_ASUS_ALLY_SPEAKER,
7625 	ALC294_FIXUP_ASUS_HPE,
7626 	ALC294_FIXUP_ASUS_COEF_1B,
7627 	ALC294_FIXUP_ASUS_GX502_HP,
7628 	ALC294_FIXUP_ASUS_GX502_PINS,
7629 	ALC294_FIXUP_ASUS_GX502_VERBS,
7630 	ALC294_FIXUP_ASUS_GU502_HP,
7631 	ALC294_FIXUP_ASUS_GU502_PINS,
7632 	ALC294_FIXUP_ASUS_GU502_VERBS,
7633 	ALC294_FIXUP_ASUS_G513_PINS,
7634 	ALC285_FIXUP_ASUS_G533Z_PINS,
7635 	ALC285_FIXUP_HP_GPIO_LED,
7636 	ALC285_FIXUP_HP_MUTE_LED,
7637 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
7638 	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
7639 	ALC236_FIXUP_HP_GPIO_LED,
7640 	ALC236_FIXUP_HP_MUTE_LED,
7641 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
7642 	ALC236_FIXUP_LENOVO_INV_DMIC,
7643 	ALC298_FIXUP_SAMSUNG_AMP,
7644 	ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS,
7645 	ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS,
7646 	ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7647 	ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
7648 	ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
7649 	ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
7650 	ALC269VC_FIXUP_ACER_HEADSET_MIC,
7651 	ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
7652 	ALC289_FIXUP_ASUS_GA401,
7653 	ALC289_FIXUP_ASUS_GA502,
7654 	ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
7655 	ALC285_FIXUP_HP_GPIO_AMP_INIT,
7656 	ALC269_FIXUP_CZC_B20,
7657 	ALC269_FIXUP_CZC_TMI,
7658 	ALC269_FIXUP_CZC_L101,
7659 	ALC269_FIXUP_LEMOTE_A1802,
7660 	ALC269_FIXUP_LEMOTE_A190X,
7661 	ALC256_FIXUP_INTEL_NUC8_RUGGED,
7662 	ALC233_FIXUP_INTEL_NUC8_DMIC,
7663 	ALC233_FIXUP_INTEL_NUC8_BOOST,
7664 	ALC256_FIXUP_INTEL_NUC10,
7665 	ALC255_FIXUP_XIAOMI_HEADSET_MIC,
7666 	ALC274_FIXUP_HP_MIC,
7667 	ALC274_FIXUP_HP_HEADSET_MIC,
7668 	ALC274_FIXUP_HP_ENVY_GPIO,
7669 	ALC256_FIXUP_ASUS_HPE,
7670 	ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
7671 	ALC287_FIXUP_HP_GPIO_LED,
7672 	ALC256_FIXUP_HP_HEADSET_MIC,
7673 	ALC245_FIXUP_HP_GPIO_LED,
7674 	ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
7675 	ALC282_FIXUP_ACER_DISABLE_LINEOUT,
7676 	ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
7677 	ALC256_FIXUP_ACER_HEADSET_MIC,
7678 	ALC285_FIXUP_IDEAPAD_S740_COEF,
7679 	ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7680 	ALC295_FIXUP_ASUS_DACS,
7681 	ALC295_FIXUP_HP_OMEN,
7682 	ALC285_FIXUP_HP_SPECTRE_X360,
7683 	ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
7684 	ALC623_FIXUP_LENOVO_THINKSTATION_P340,
7685 	ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
7686 	ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
7687 	ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7688 	ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7689 	ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7690 	ALC298_FIXUP_LENOVO_C940_DUET7,
7691 	ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
7692 	ALC287_FIXUP_LENOVO_LEGION_7,
7693 	ALC287_FIXUP_13S_GEN2_SPEAKERS,
7694 	ALC256_FIXUP_SET_COEF_DEFAULTS,
7695 	ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7696 	ALC233_FIXUP_NO_AUDIO_JACK,
7697 	ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7698 	ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7699 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7700 	ALC287_FIXUP_LEGION_16ACHG6,
7701 	ALC287_FIXUP_CS35L41_I2C_2,
7702 	ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7703 	ALC287_FIXUP_CS35L41_I2C_4,
7704 	ALC245_FIXUP_CS35L41_SPI_2,
7705 	ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7706 	ALC245_FIXUP_CS35L41_SPI_4,
7707 	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7708 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7709 	ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7710 	ALC287_FIXUP_LEGION_16ITHG6,
7711 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7712 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
7713 	ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
7714 	ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7715 	ALC236_FIXUP_DELL_DUAL_CODECS,
7716 	ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
7717 	ALC287_FIXUP_TAS2781_I2C,
7718 	ALC287_FIXUP_YOGA7_14ARB7_I2C,
7719 	ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
7720 	ALC245_FIXUP_HP_X360_MUTE_LEDS,
7721 	ALC287_FIXUP_THINKPAD_I2S_SPK,
7722 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
7723 	ALC2XX_FIXUP_HEADSET_MIC,
7724 	ALC289_FIXUP_DELL_CS35L41_SPI_2,
7725 	ALC294_FIXUP_CS35L41_I2C_2,
7726 	ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
7727 	ALC256_FIXUP_HEADPHONE_AMP_VOL,
7728 	ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
7729 	ALC285_FIXUP_ASUS_GA403U,
7730 	ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
7731 	ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
7732 	ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
7733 	ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
7734 	ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
7735 	ALC256_FIXUP_CHROME_BOOK,
7736 	ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7,
7737 	ALC287_FIXUP_LENOVO_SSID_17AA3820,
7738 	ALC245_FIXUP_CLEVO_NOISY_MIC,
7739 	ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
7740 };
7741 
7742 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7743  * both have the very same PCI SSID, and we need to apply different fixups
7744  * depending on the codec ID
7745  */
7746 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7747 					   const struct hda_fixup *fix,
7748 					   int action)
7749 {
7750 	int id;
7751 
7752 	if (codec->core.vendor_id == 0x10ec0298)
7753 		id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7754 	else
7755 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7756 	__snd_hda_apply_fixup(codec, id, action, 0);
7757 }
7758 
7759 /* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
7760  * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
7761  * so we need to apply a different fixup in this case. The only DuetITL codec
7762  * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
7763  * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
7764  * have matched correctly by their codecs.
7765  */
7766 static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
7767 					      const struct hda_fixup *fix,
7768 					      int action)
7769 {
7770 	int id;
7771 
7772 	if (codec->core.subsystem_id == 0x17aa3802)
7773 		id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
7774 	else
7775 		id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
7776 	__snd_hda_apply_fixup(codec, id, action, 0);
7777 }
7778 
7779 /* Similar to above the Lenovo Yoga Pro 7 14ARP8 PCI SSID matches the codec SSID of the
7780    Legion Y9000X 2022 IAH7.*/
7781 static void alc287_fixup_lenovo_14arp8_legion_iah7(struct hda_codec *codec,
7782 					   const struct hda_fixup *fix,
7783 					   int action)
7784 {
7785 	int id;
7786 
7787 	if (codec->core.subsystem_id == 0x17aa386e)
7788 		id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion Y9000X 2022 IAH7 */
7789 	else
7790 		id = ALC285_FIXUP_SPEAKER2_TO_DAC1; /* Yoga Pro 7 14ARP8 */
7791 	__snd_hda_apply_fixup(codec, id, action, 0);
7792 }
7793 
7794 /* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with
7795  * TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec);
7796  * we apply a corresponding fixup depending on the codec SSID instead
7797  */
7798 static void alc287_fixup_lenovo_legion_7(struct hda_codec *codec,
7799 					 const struct hda_fixup *fix,
7800 					 int action)
7801 {
7802 	int id;
7803 
7804 	if (codec->core.subsystem_id == 0x17aa38a8)
7805 		id = ALC287_FIXUP_TAS2781_I2C; /* Legion Pro 7 16ARX8H */
7806 	else
7807 		id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion 7i 16IAX7 */
7808 	__snd_hda_apply_fixup(codec, id, action, 0);
7809 }
7810 
7811 /* Yet more conflicting PCI SSID (17aa:3820) on two Lenovo models */
7812 static void alc287_fixup_lenovo_ssid_17aa3820(struct hda_codec *codec,
7813 					      const struct hda_fixup *fix,
7814 					      int action)
7815 {
7816 	int id;
7817 
7818 	if (codec->core.subsystem_id == 0x17aa3820)
7819 		id = ALC269_FIXUP_ASPIRE_HEADSET_MIC; /* IdeaPad 330-17IKB 81DM */
7820 	else /* 0x17aa3802 */
7821 		id =  ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* "Yoga Duet 7 13ITL6 */
7822 	__snd_hda_apply_fixup(codec, id, action, 0);
7823 }
7824 
7825 static const struct hda_fixup alc269_fixups[] = {
7826 	[ALC269_FIXUP_GPIO2] = {
7827 		.type = HDA_FIXUP_FUNC,
7828 		.v.func = alc_fixup_gpio2,
7829 	},
7830 	[ALC269_FIXUP_SONY_VAIO] = {
7831 		.type = HDA_FIXUP_PINCTLS,
7832 		.v.pins = (const struct hda_pintbl[]) {
7833 			{0x19, PIN_VREFGRD},
7834 			{}
7835 		}
7836 	},
7837 	[ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7838 		.type = HDA_FIXUP_FUNC,
7839 		.v.func = alc275_fixup_gpio4_off,
7840 		.chained = true,
7841 		.chain_id = ALC269_FIXUP_SONY_VAIO
7842 	},
7843 	[ALC269_FIXUP_DELL_M101Z] = {
7844 		.type = HDA_FIXUP_VERBS,
7845 		.v.verbs = (const struct hda_verb[]) {
7846 			/* Enables internal speaker */
7847 			{0x20, AC_VERB_SET_COEF_INDEX, 13},
7848 			{0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7849 			{}
7850 		}
7851 	},
7852 	[ALC269_FIXUP_SKU_IGNORE] = {
7853 		.type = HDA_FIXUP_FUNC,
7854 		.v.func = alc_fixup_sku_ignore,
7855 	},
7856 	[ALC269_FIXUP_ASUS_G73JW] = {
7857 		.type = HDA_FIXUP_PINS,
7858 		.v.pins = (const struct hda_pintbl[]) {
7859 			{ 0x17, 0x99130111 }, /* subwoofer */
7860 			{ }
7861 		}
7862 	},
7863 	[ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7864 		.type = HDA_FIXUP_PINS,
7865 		.v.pins = (const struct hda_pintbl[]) {
7866 			{ 0x19, 0x03A11050 },
7867 			{ 0x1a, 0x03A11C30 },
7868 			{ 0x21, 0x03211420 },
7869 			{ }
7870 		}
7871 	},
7872 	[ALC269_FIXUP_ASUS_N7601ZM] = {
7873 		.type = HDA_FIXUP_VERBS,
7874 		.v.verbs = (const struct hda_verb[]) {
7875 			{0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7876 			{0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7877 			{0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7878 			{0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7879 			{0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7880 			{0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7881 			{ }
7882 		},
7883 		.chained = true,
7884 		.chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7885 	},
7886 	[ALC269_FIXUP_LENOVO_EAPD] = {
7887 		.type = HDA_FIXUP_VERBS,
7888 		.v.verbs = (const struct hda_verb[]) {
7889 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7890 			{}
7891 		}
7892 	},
7893 	[ALC275_FIXUP_SONY_HWEQ] = {
7894 		.type = HDA_FIXUP_FUNC,
7895 		.v.func = alc269_fixup_hweq,
7896 		.chained = true,
7897 		.chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7898 	},
7899 	[ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7900 		.type = HDA_FIXUP_FUNC,
7901 		.v.func = alc_fixup_disable_aamix,
7902 		.chained = true,
7903 		.chain_id = ALC269_FIXUP_SONY_VAIO
7904 	},
7905 	[ALC271_FIXUP_DMIC] = {
7906 		.type = HDA_FIXUP_FUNC,
7907 		.v.func = alc271_fixup_dmic,
7908 	},
7909 	[ALC269_FIXUP_PCM_44K] = {
7910 		.type = HDA_FIXUP_FUNC,
7911 		.v.func = alc269_fixup_pcm_44k,
7912 		.chained = true,
7913 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7914 	},
7915 	[ALC269_FIXUP_STEREO_DMIC] = {
7916 		.type = HDA_FIXUP_FUNC,
7917 		.v.func = alc269_fixup_stereo_dmic,
7918 	},
7919 	[ALC269_FIXUP_HEADSET_MIC] = {
7920 		.type = HDA_FIXUP_FUNC,
7921 		.v.func = alc269_fixup_headset_mic,
7922 	},
7923 	[ALC269_FIXUP_QUANTA_MUTE] = {
7924 		.type = HDA_FIXUP_FUNC,
7925 		.v.func = alc269_fixup_quanta_mute,
7926 	},
7927 	[ALC269_FIXUP_LIFEBOOK] = {
7928 		.type = HDA_FIXUP_PINS,
7929 		.v.pins = (const struct hda_pintbl[]) {
7930 			{ 0x1a, 0x2101103f }, /* dock line-out */
7931 			{ 0x1b, 0x23a11040 }, /* dock mic-in */
7932 			{ }
7933 		},
7934 		.chained = true,
7935 		.chain_id = ALC269_FIXUP_QUANTA_MUTE
7936 	},
7937 	[ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7938 		.type = HDA_FIXUP_PINS,
7939 		.v.pins = (const struct hda_pintbl[]) {
7940 			{ 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7941 			{ }
7942 		},
7943 	},
7944 	[ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7945 		.type = HDA_FIXUP_PINS,
7946 		.v.pins = (const struct hda_pintbl[]) {
7947 			{ 0x21, 0x0221102f }, /* HP out */
7948 			{ }
7949 		},
7950 	},
7951 	[ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7952 		.type = HDA_FIXUP_FUNC,
7953 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7954 	},
7955 	[ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7956 		.type = HDA_FIXUP_FUNC,
7957 		.v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7958 	},
7959 	[ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7960 		.type = HDA_FIXUP_PINS,
7961 		.v.pins = (const struct hda_pintbl[]) {
7962 			{ 0x18, 0x03a19020 }, /* headset mic */
7963 			{ 0x1b, 0x90170150 }, /* speaker */
7964 			{ }
7965 		},
7966 	},
7967 	[ALC269_FIXUP_AMIC] = {
7968 		.type = HDA_FIXUP_PINS,
7969 		.v.pins = (const struct hda_pintbl[]) {
7970 			{ 0x14, 0x99130110 }, /* speaker */
7971 			{ 0x15, 0x0121401f }, /* HP out */
7972 			{ 0x18, 0x01a19c20 }, /* mic */
7973 			{ 0x19, 0x99a3092f }, /* int-mic */
7974 			{ }
7975 		},
7976 	},
7977 	[ALC269_FIXUP_DMIC] = {
7978 		.type = HDA_FIXUP_PINS,
7979 		.v.pins = (const struct hda_pintbl[]) {
7980 			{ 0x12, 0x99a3092f }, /* int-mic */
7981 			{ 0x14, 0x99130110 }, /* speaker */
7982 			{ 0x15, 0x0121401f }, /* HP out */
7983 			{ 0x18, 0x01a19c20 }, /* mic */
7984 			{ }
7985 		},
7986 	},
7987 	[ALC269VB_FIXUP_AMIC] = {
7988 		.type = HDA_FIXUP_PINS,
7989 		.v.pins = (const struct hda_pintbl[]) {
7990 			{ 0x14, 0x99130110 }, /* speaker */
7991 			{ 0x18, 0x01a19c20 }, /* mic */
7992 			{ 0x19, 0x99a3092f }, /* int-mic */
7993 			{ 0x21, 0x0121401f }, /* HP out */
7994 			{ }
7995 		},
7996 	},
7997 	[ALC269VB_FIXUP_DMIC] = {
7998 		.type = HDA_FIXUP_PINS,
7999 		.v.pins = (const struct hda_pintbl[]) {
8000 			{ 0x12, 0x99a3092f }, /* int-mic */
8001 			{ 0x14, 0x99130110 }, /* speaker */
8002 			{ 0x18, 0x01a19c20 }, /* mic */
8003 			{ 0x21, 0x0121401f }, /* HP out */
8004 			{ }
8005 		},
8006 	},
8007 	[ALC269_FIXUP_HP_MUTE_LED] = {
8008 		.type = HDA_FIXUP_FUNC,
8009 		.v.func = alc269_fixup_hp_mute_led,
8010 	},
8011 	[ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
8012 		.type = HDA_FIXUP_FUNC,
8013 		.v.func = alc269_fixup_hp_mute_led_mic1,
8014 	},
8015 	[ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
8016 		.type = HDA_FIXUP_FUNC,
8017 		.v.func = alc269_fixup_hp_mute_led_mic2,
8018 	},
8019 	[ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
8020 		.type = HDA_FIXUP_FUNC,
8021 		.v.func = alc269_fixup_hp_mute_led_mic3,
8022 		.chained = true,
8023 		.chain_id = ALC295_FIXUP_HP_AUTO_MUTE
8024 	},
8025 	[ALC269_FIXUP_HP_GPIO_LED] = {
8026 		.type = HDA_FIXUP_FUNC,
8027 		.v.func = alc269_fixup_hp_gpio_led,
8028 	},
8029 	[ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
8030 		.type = HDA_FIXUP_FUNC,
8031 		.v.func = alc269_fixup_hp_gpio_mic1_led,
8032 	},
8033 	[ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
8034 		.type = HDA_FIXUP_FUNC,
8035 		.v.func = alc269_fixup_hp_line1_mic1_led,
8036 	},
8037 	[ALC269_FIXUP_INV_DMIC] = {
8038 		.type = HDA_FIXUP_FUNC,
8039 		.v.func = alc_fixup_inv_dmic,
8040 	},
8041 	[ALC269_FIXUP_NO_SHUTUP] = {
8042 		.type = HDA_FIXUP_FUNC,
8043 		.v.func = alc_fixup_no_shutup,
8044 	},
8045 	[ALC269_FIXUP_LENOVO_DOCK] = {
8046 		.type = HDA_FIXUP_PINS,
8047 		.v.pins = (const struct hda_pintbl[]) {
8048 			{ 0x19, 0x23a11040 }, /* dock mic */
8049 			{ 0x1b, 0x2121103f }, /* dock headphone */
8050 			{ }
8051 		},
8052 		.chained = true,
8053 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
8054 	},
8055 	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
8056 		.type = HDA_FIXUP_FUNC,
8057 		.v.func = alc269_fixup_limit_int_mic_boost,
8058 		.chained = true,
8059 		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
8060 	},
8061 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
8062 		.type = HDA_FIXUP_FUNC,
8063 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
8064 		.chained = true,
8065 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8066 	},
8067 	[ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8068 		.type = HDA_FIXUP_PINS,
8069 		.v.pins = (const struct hda_pintbl[]) {
8070 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8071 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8072 			{ }
8073 		},
8074 		.chained = true,
8075 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8076 	},
8077 	[ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8078 		.type = HDA_FIXUP_PINS,
8079 		.v.pins = (const struct hda_pintbl[]) {
8080 			{ 0x16, 0x21014020 }, /* dock line out */
8081 			{ 0x19, 0x21a19030 }, /* dock mic */
8082 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8083 			{ }
8084 		},
8085 		.chained = true,
8086 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8087 	},
8088 	[ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
8089 		.type = HDA_FIXUP_PINS,
8090 		.v.pins = (const struct hda_pintbl[]) {
8091 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8092 			{ }
8093 		},
8094 		.chained = true,
8095 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8096 	},
8097 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
8098 		.type = HDA_FIXUP_PINS,
8099 		.v.pins = (const struct hda_pintbl[]) {
8100 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8101 			{ 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8102 			{ }
8103 		},
8104 		.chained = true,
8105 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8106 	},
8107 	[ALC269_FIXUP_HEADSET_MODE] = {
8108 		.type = HDA_FIXUP_FUNC,
8109 		.v.func = alc_fixup_headset_mode,
8110 		.chained = true,
8111 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8112 	},
8113 	[ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8114 		.type = HDA_FIXUP_FUNC,
8115 		.v.func = alc_fixup_headset_mode_no_hp_mic,
8116 	},
8117 	[ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
8118 		.type = HDA_FIXUP_PINS,
8119 		.v.pins = (const struct hda_pintbl[]) {
8120 			{ 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
8121 			{ }
8122 		},
8123 		.chained = true,
8124 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8125 	},
8126 	[ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
8127 		.type = HDA_FIXUP_PINS,
8128 		.v.pins = (const struct hda_pintbl[]) {
8129 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8130 			{ }
8131 		},
8132 		.chained = true,
8133 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8134 	},
8135 	[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8136 		.type = HDA_FIXUP_PINS,
8137 		.v.pins = (const struct hda_pintbl[]) {
8138 			{0x12, 0x90a60130},
8139 			{0x13, 0x40000000},
8140 			{0x14, 0x90170110},
8141 			{0x18, 0x411111f0},
8142 			{0x19, 0x04a11040},
8143 			{0x1a, 0x411111f0},
8144 			{0x1b, 0x90170112},
8145 			{0x1d, 0x40759a05},
8146 			{0x1e, 0x411111f0},
8147 			{0x21, 0x04211020},
8148 			{ }
8149 		},
8150 		.chained = true,
8151 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8152 	},
8153 	[ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
8154 		.type = HDA_FIXUP_FUNC,
8155 		.v.func = alc298_fixup_huawei_mbx_stereo,
8156 		.chained = true,
8157 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8158 	},
8159 	[ALC269_FIXUP_ASUS_X101_FUNC] = {
8160 		.type = HDA_FIXUP_FUNC,
8161 		.v.func = alc269_fixup_x101_headset_mic,
8162 	},
8163 	[ALC269_FIXUP_ASUS_X101_VERB] = {
8164 		.type = HDA_FIXUP_VERBS,
8165 		.v.verbs = (const struct hda_verb[]) {
8166 			{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
8167 			{0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8168 			{0x20, AC_VERB_SET_PROC_COEF,  0x0310},
8169 			{ }
8170 		},
8171 		.chained = true,
8172 		.chain_id = ALC269_FIXUP_ASUS_X101_FUNC
8173 	},
8174 	[ALC269_FIXUP_ASUS_X101] = {
8175 		.type = HDA_FIXUP_PINS,
8176 		.v.pins = (const struct hda_pintbl[]) {
8177 			{ 0x18, 0x04a1182c }, /* Headset mic */
8178 			{ }
8179 		},
8180 		.chained = true,
8181 		.chain_id = ALC269_FIXUP_ASUS_X101_VERB
8182 	},
8183 	[ALC271_FIXUP_AMIC_MIC2] = {
8184 		.type = HDA_FIXUP_PINS,
8185 		.v.pins = (const struct hda_pintbl[]) {
8186 			{ 0x14, 0x99130110 }, /* speaker */
8187 			{ 0x19, 0x01a19c20 }, /* mic */
8188 			{ 0x1b, 0x99a7012f }, /* int-mic */
8189 			{ 0x21, 0x0121401f }, /* HP out */
8190 			{ }
8191 		},
8192 	},
8193 	[ALC271_FIXUP_HP_GATE_MIC_JACK] = {
8194 		.type = HDA_FIXUP_FUNC,
8195 		.v.func = alc271_hp_gate_mic_jack,
8196 		.chained = true,
8197 		.chain_id = ALC271_FIXUP_AMIC_MIC2,
8198 	},
8199 	[ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
8200 		.type = HDA_FIXUP_FUNC,
8201 		.v.func = alc269_fixup_limit_int_mic_boost,
8202 		.chained = true,
8203 		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
8204 	},
8205 	[ALC269_FIXUP_ACER_AC700] = {
8206 		.type = HDA_FIXUP_PINS,
8207 		.v.pins = (const struct hda_pintbl[]) {
8208 			{ 0x12, 0x99a3092f }, /* int-mic */
8209 			{ 0x14, 0x99130110 }, /* speaker */
8210 			{ 0x18, 0x03a11c20 }, /* mic */
8211 			{ 0x1e, 0x0346101e }, /* SPDIF1 */
8212 			{ 0x21, 0x0321101f }, /* HP out */
8213 			{ }
8214 		},
8215 		.chained = true,
8216 		.chain_id = ALC271_FIXUP_DMIC,
8217 	},
8218 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
8219 		.type = HDA_FIXUP_FUNC,
8220 		.v.func = alc269_fixup_limit_int_mic_boost,
8221 		.chained = true,
8222 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8223 	},
8224 	[ALC269VB_FIXUP_ASUS_ZENBOOK] = {
8225 		.type = HDA_FIXUP_FUNC,
8226 		.v.func = alc269_fixup_limit_int_mic_boost,
8227 		.chained = true,
8228 		.chain_id = ALC269VB_FIXUP_DMIC,
8229 	},
8230 	[ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
8231 		.type = HDA_FIXUP_VERBS,
8232 		.v.verbs = (const struct hda_verb[]) {
8233 			/* class-D output amp +5dB */
8234 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
8235 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
8236 			{}
8237 		},
8238 		.chained = true,
8239 		.chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
8240 	},
8241 	[ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8242 		.type = HDA_FIXUP_PINS,
8243 		.v.pins = (const struct hda_pintbl[]) {
8244 			{ 0x18, 0x01a110f0 },  /* use as headset mic */
8245 			{ }
8246 		},
8247 		.chained = true,
8248 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8249 	},
8250 	[ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8251 		.type = HDA_FIXUP_FUNC,
8252 		.v.func = alc269_fixup_limit_int_mic_boost,
8253 		.chained = true,
8254 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8255 	},
8256 	[ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8257 		.type = HDA_FIXUP_PINS,
8258 		.v.pins = (const struct hda_pintbl[]) {
8259 			{ 0x12, 0x99a3092f }, /* int-mic */
8260 			{ 0x18, 0x03a11d20 }, /* mic */
8261 			{ 0x19, 0x411111f0 }, /* Unused bogus pin */
8262 			{ }
8263 		},
8264 	},
8265 	[ALC283_FIXUP_CHROME_BOOK] = {
8266 		.type = HDA_FIXUP_FUNC,
8267 		.v.func = alc283_fixup_chromebook,
8268 	},
8269 	[ALC283_FIXUP_SENSE_COMBO_JACK] = {
8270 		.type = HDA_FIXUP_FUNC,
8271 		.v.func = alc283_fixup_sense_combo_jack,
8272 		.chained = true,
8273 		.chain_id = ALC283_FIXUP_CHROME_BOOK,
8274 	},
8275 	[ALC282_FIXUP_ASUS_TX300] = {
8276 		.type = HDA_FIXUP_FUNC,
8277 		.v.func = alc282_fixup_asus_tx300,
8278 	},
8279 	[ALC283_FIXUP_INT_MIC] = {
8280 		.type = HDA_FIXUP_VERBS,
8281 		.v.verbs = (const struct hda_verb[]) {
8282 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8283 			{0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8284 			{ }
8285 		},
8286 		.chained = true,
8287 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8288 	},
8289 	[ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8290 		.type = HDA_FIXUP_PINS,
8291 		.v.pins = (const struct hda_pintbl[]) {
8292 			{ 0x17, 0x90170112 }, /* subwoofer */
8293 			{ }
8294 		},
8295 		.chained = true,
8296 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8297 	},
8298 	[ALC290_FIXUP_SUBWOOFER] = {
8299 		.type = HDA_FIXUP_PINS,
8300 		.v.pins = (const struct hda_pintbl[]) {
8301 			{ 0x17, 0x90170112 }, /* subwoofer */
8302 			{ }
8303 		},
8304 		.chained = true,
8305 		.chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8306 	},
8307 	[ALC290_FIXUP_MONO_SPEAKERS] = {
8308 		.type = HDA_FIXUP_FUNC,
8309 		.v.func = alc290_fixup_mono_speakers,
8310 	},
8311 	[ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8312 		.type = HDA_FIXUP_FUNC,
8313 		.v.func = alc290_fixup_mono_speakers,
8314 		.chained = true,
8315 		.chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8316 	},
8317 	[ALC269_FIXUP_THINKPAD_ACPI] = {
8318 		.type = HDA_FIXUP_FUNC,
8319 		.v.func = alc_fixup_thinkpad_acpi,
8320 		.chained = true,
8321 		.chain_id = ALC269_FIXUP_SKU_IGNORE,
8322 	},
8323 	[ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8324 		.type = HDA_FIXUP_FUNC,
8325 		.v.func = alc_fixup_inv_dmic,
8326 		.chained = true,
8327 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8328 	},
8329 	[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
8330 		.type = HDA_FIXUP_PINS,
8331 		.v.pins = (const struct hda_pintbl[]) {
8332 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8333 			{ }
8334 		},
8335 		.chained = true,
8336 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8337 	},
8338 	[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8339 		.type = HDA_FIXUP_PINS,
8340 		.v.pins = (const struct hda_pintbl[]) {
8341 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8342 			{ }
8343 		},
8344 		.chained = true,
8345 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8346 	},
8347 	[ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8348 		.type = HDA_FIXUP_PINS,
8349 		.v.pins = (const struct hda_pintbl[]) {
8350 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8351 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8352 			{ }
8353 		},
8354 		.chained = true,
8355 		.chain_id = ALC255_FIXUP_HEADSET_MODE
8356 	},
8357 	[ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8358 		.type = HDA_FIXUP_PINS,
8359 		.v.pins = (const struct hda_pintbl[]) {
8360 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8361 			{ }
8362 		},
8363 		.chained = true,
8364 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8365 	},
8366 	[ALC255_FIXUP_HEADSET_MODE] = {
8367 		.type = HDA_FIXUP_FUNC,
8368 		.v.func = alc_fixup_headset_mode_alc255,
8369 		.chained = true,
8370 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8371 	},
8372 	[ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8373 		.type = HDA_FIXUP_FUNC,
8374 		.v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8375 	},
8376 	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8377 		.type = HDA_FIXUP_PINS,
8378 		.v.pins = (const struct hda_pintbl[]) {
8379 			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8380 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8381 			{ }
8382 		},
8383 		.chained = true,
8384 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8385 	},
8386 	[ALC292_FIXUP_TPT440_DOCK] = {
8387 		.type = HDA_FIXUP_FUNC,
8388 		.v.func = alc_fixup_tpt440_dock,
8389 		.chained = true,
8390 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8391 	},
8392 	[ALC292_FIXUP_TPT440] = {
8393 		.type = HDA_FIXUP_FUNC,
8394 		.v.func = alc_fixup_disable_aamix,
8395 		.chained = true,
8396 		.chain_id = ALC292_FIXUP_TPT440_DOCK,
8397 	},
8398 	[ALC283_FIXUP_HEADSET_MIC] = {
8399 		.type = HDA_FIXUP_PINS,
8400 		.v.pins = (const struct hda_pintbl[]) {
8401 			{ 0x19, 0x04a110f0 },
8402 			{ },
8403 		},
8404 	},
8405 	[ALC255_FIXUP_MIC_MUTE_LED] = {
8406 		.type = HDA_FIXUP_FUNC,
8407 		.v.func = alc_fixup_micmute_led,
8408 	},
8409 	[ALC282_FIXUP_ASPIRE_V5_PINS] = {
8410 		.type = HDA_FIXUP_PINS,
8411 		.v.pins = (const struct hda_pintbl[]) {
8412 			{ 0x12, 0x90a60130 },
8413 			{ 0x14, 0x90170110 },
8414 			{ 0x17, 0x40000008 },
8415 			{ 0x18, 0x411111f0 },
8416 			{ 0x19, 0x01a1913c },
8417 			{ 0x1a, 0x411111f0 },
8418 			{ 0x1b, 0x411111f0 },
8419 			{ 0x1d, 0x40f89b2d },
8420 			{ 0x1e, 0x411111f0 },
8421 			{ 0x21, 0x0321101f },
8422 			{ },
8423 		},
8424 	},
8425 	[ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8426 		.type = HDA_FIXUP_FUNC,
8427 		.v.func = alc269vb_fixup_aspire_e1_coef,
8428 	},
8429 	[ALC280_FIXUP_HP_GPIO4] = {
8430 		.type = HDA_FIXUP_FUNC,
8431 		.v.func = alc280_fixup_hp_gpio4,
8432 	},
8433 	[ALC286_FIXUP_HP_GPIO_LED] = {
8434 		.type = HDA_FIXUP_FUNC,
8435 		.v.func = alc286_fixup_hp_gpio_led,
8436 	},
8437 	[ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8438 		.type = HDA_FIXUP_FUNC,
8439 		.v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8440 	},
8441 	[ALC280_FIXUP_HP_DOCK_PINS] = {
8442 		.type = HDA_FIXUP_PINS,
8443 		.v.pins = (const struct hda_pintbl[]) {
8444 			{ 0x1b, 0x21011020 }, /* line-out */
8445 			{ 0x1a, 0x01a1903c }, /* headset mic */
8446 			{ 0x18, 0x2181103f }, /* line-in */
8447 			{ },
8448 		},
8449 		.chained = true,
8450 		.chain_id = ALC280_FIXUP_HP_GPIO4
8451 	},
8452 	[ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8453 		.type = HDA_FIXUP_PINS,
8454 		.v.pins = (const struct hda_pintbl[]) {
8455 			{ 0x1b, 0x21011020 }, /* line-out */
8456 			{ 0x18, 0x2181103f }, /* line-in */
8457 			{ },
8458 		},
8459 		.chained = true,
8460 		.chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8461 	},
8462 	[ALC280_FIXUP_HP_9480M] = {
8463 		.type = HDA_FIXUP_FUNC,
8464 		.v.func = alc280_fixup_hp_9480m,
8465 	},
8466 	[ALC245_FIXUP_HP_X360_AMP] = {
8467 		.type = HDA_FIXUP_FUNC,
8468 		.v.func = alc245_fixup_hp_x360_amp,
8469 		.chained = true,
8470 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
8471 	},
8472 	[ALC288_FIXUP_DELL_HEADSET_MODE] = {
8473 		.type = HDA_FIXUP_FUNC,
8474 		.v.func = alc_fixup_headset_mode_dell_alc288,
8475 		.chained = true,
8476 		.chain_id = ALC255_FIXUP_MIC_MUTE_LED
8477 	},
8478 	[ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8479 		.type = HDA_FIXUP_PINS,
8480 		.v.pins = (const struct hda_pintbl[]) {
8481 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8482 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8483 			{ }
8484 		},
8485 		.chained = true,
8486 		.chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8487 	},
8488 	[ALC288_FIXUP_DISABLE_AAMIX] = {
8489 		.type = HDA_FIXUP_FUNC,
8490 		.v.func = alc_fixup_disable_aamix,
8491 		.chained = true,
8492 		.chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
8493 	},
8494 	[ALC288_FIXUP_DELL_XPS_13] = {
8495 		.type = HDA_FIXUP_FUNC,
8496 		.v.func = alc_fixup_dell_xps13,
8497 		.chained = true,
8498 		.chain_id = ALC288_FIXUP_DISABLE_AAMIX
8499 	},
8500 	[ALC292_FIXUP_DISABLE_AAMIX] = {
8501 		.type = HDA_FIXUP_FUNC,
8502 		.v.func = alc_fixup_disable_aamix,
8503 		.chained = true,
8504 		.chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8505 	},
8506 	[ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8507 		.type = HDA_FIXUP_FUNC,
8508 		.v.func = alc_fixup_disable_aamix,
8509 		.chained = true,
8510 		.chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8511 	},
8512 	[ALC292_FIXUP_DELL_E7X_AAMIX] = {
8513 		.type = HDA_FIXUP_FUNC,
8514 		.v.func = alc_fixup_dell_xps13,
8515 		.chained = true,
8516 		.chain_id = ALC292_FIXUP_DISABLE_AAMIX
8517 	},
8518 	[ALC292_FIXUP_DELL_E7X] = {
8519 		.type = HDA_FIXUP_FUNC,
8520 		.v.func = alc_fixup_micmute_led,
8521 		/* micmute fixup must be applied at last */
8522 		.chained_before = true,
8523 		.chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8524 	},
8525 	[ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8526 		.type = HDA_FIXUP_PINS,
8527 		.v.pins = (const struct hda_pintbl[]) {
8528 			{ 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8529 			{ }
8530 		},
8531 		.chained_before = true,
8532 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
8533 	},
8534 	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8535 		.type = HDA_FIXUP_PINS,
8536 		.v.pins = (const struct hda_pintbl[]) {
8537 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8538 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8539 			{ }
8540 		},
8541 		.chained = true,
8542 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8543 	},
8544 	[ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8545 		.type = HDA_FIXUP_PINS,
8546 		.v.pins = (const struct hda_pintbl[]) {
8547 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8548 			{ }
8549 		},
8550 		.chained = true,
8551 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8552 	},
8553 	[ALC275_FIXUP_DELL_XPS] = {
8554 		.type = HDA_FIXUP_VERBS,
8555 		.v.verbs = (const struct hda_verb[]) {
8556 			/* Enables internal speaker */
8557 			{0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8558 			{0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8559 			{0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8560 			{0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8561 			{}
8562 		}
8563 	},
8564 	[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8565 		.type = HDA_FIXUP_FUNC,
8566 		.v.func = alc_fixup_disable_aamix,
8567 		.chained = true,
8568 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8569 	},
8570 	[ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8571 		.type = HDA_FIXUP_FUNC,
8572 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8573 	},
8574 	[ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8575 		.type = HDA_FIXUP_FUNC,
8576 		.v.func = alc_fixup_inv_dmic,
8577 		.chained = true,
8578 		.chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8579 	},
8580 	[ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8581 		.type = HDA_FIXUP_FUNC,
8582 		.v.func = alc269_fixup_limit_int_mic_boost
8583 	},
8584 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
8585 		.type = HDA_FIXUP_FUNC,
8586 		.v.func = alc_fixup_disable_aamix,
8587 		.chained = true,
8588 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8589 	},
8590 	[ALC225_FIXUP_DISABLE_MIC_VREF] = {
8591 		.type = HDA_FIXUP_FUNC,
8592 		.v.func = alc_fixup_disable_mic_vref,
8593 		.chained = true,
8594 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8595 	},
8596 	[ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8597 		.type = HDA_FIXUP_VERBS,
8598 		.v.verbs = (const struct hda_verb[]) {
8599 			/* Disable pass-through path for FRONT 14h */
8600 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8601 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8602 			{}
8603 		},
8604 		.chained = true,
8605 		.chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
8606 	},
8607 	[ALC280_FIXUP_HP_HEADSET_MIC] = {
8608 		.type = HDA_FIXUP_FUNC,
8609 		.v.func = alc_fixup_disable_aamix,
8610 		.chained = true,
8611 		.chain_id = ALC269_FIXUP_HEADSET_MIC,
8612 	},
8613 	[ALC221_FIXUP_HP_FRONT_MIC] = {
8614 		.type = HDA_FIXUP_PINS,
8615 		.v.pins = (const struct hda_pintbl[]) {
8616 			{ 0x19, 0x02a19020 }, /* Front Mic */
8617 			{ }
8618 		},
8619 	},
8620 	[ALC292_FIXUP_TPT460] = {
8621 		.type = HDA_FIXUP_FUNC,
8622 		.v.func = alc_fixup_tpt440_dock,
8623 		.chained = true,
8624 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8625 	},
8626 	[ALC298_FIXUP_SPK_VOLUME] = {
8627 		.type = HDA_FIXUP_FUNC,
8628 		.v.func = alc298_fixup_speaker_volume,
8629 		.chained = true,
8630 		.chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
8631 	},
8632 	[ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8633 		.type = HDA_FIXUP_FUNC,
8634 		.v.func = alc298_fixup_speaker_volume,
8635 	},
8636 	[ALC295_FIXUP_DISABLE_DAC3] = {
8637 		.type = HDA_FIXUP_FUNC,
8638 		.v.func = alc295_fixup_disable_dac3,
8639 	},
8640 	[ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8641 		.type = HDA_FIXUP_FUNC,
8642 		.v.func = alc285_fixup_speaker2_to_dac1,
8643 		.chained = true,
8644 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8645 	},
8646 	[ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8647 		.type = HDA_FIXUP_FUNC,
8648 		.v.func = alc285_fixup_speaker2_to_dac1,
8649 		.chained = true,
8650 		.chain_id = ALC245_FIXUP_CS35L41_SPI_2
8651 	},
8652 	[ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8653 		.type = HDA_FIXUP_PINS,
8654 		.v.pins = (const struct hda_pintbl[]) {
8655 			{ 0x19, 0x03a11050 },
8656 			{ 0x1b, 0x03a11c30 },
8657 			{ }
8658 		},
8659 		.chained = true,
8660 		.chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8661 	},
8662 	[ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8663 		.type = HDA_FIXUP_PINS,
8664 		.v.pins = (const struct hda_pintbl[]) {
8665 			{ 0x14, 0x90170120 },
8666 			{ }
8667 		},
8668 		.chained = true,
8669 		.chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8670 	},
8671 	[ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8672 		.type = HDA_FIXUP_FUNC,
8673 		.v.func = alc285_fixup_speaker2_to_dac1,
8674 		.chained = true,
8675 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2
8676 	},
8677 	[ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8678 		.type = HDA_FIXUP_PINS,
8679 		.v.pins = (const struct hda_pintbl[]) {
8680 			{ 0x19, 0x03a11050 },
8681 			{ 0x1b, 0x03a11c30 },
8682 			{ }
8683 		},
8684 		.chained = true,
8685 		.chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8686 	},
8687 	[ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8688 		.type = HDA_FIXUP_PINS,
8689 		.v.pins = (const struct hda_pintbl[]) {
8690 			{ 0x1b, 0x90170151 },
8691 			{ }
8692 		},
8693 		.chained = true,
8694 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8695 	},
8696 	[ALC269_FIXUP_ATIV_BOOK_8] = {
8697 		.type = HDA_FIXUP_FUNC,
8698 		.v.func = alc_fixup_auto_mute_via_amp,
8699 		.chained = true,
8700 		.chain_id = ALC269_FIXUP_NO_SHUTUP
8701 	},
8702 	[ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8703 		.type = HDA_FIXUP_PINS,
8704 		.v.pins = (const struct hda_pintbl[]) {
8705 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8706 			{ 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8707 			{ }
8708 		},
8709 		.chained = true,
8710 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8711 	},
8712 	[ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8713 		.type = HDA_FIXUP_PINS,
8714 		.v.pins = (const struct hda_pintbl[]) {
8715 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8716 			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8717 			{ }
8718 		},
8719 		.chained = true,
8720 		.chain_id = ALC269_FIXUP_HEADSET_MODE
8721 	},
8722 	[ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8723 		.type = HDA_FIXUP_FUNC,
8724 		.v.func = alc_fixup_headset_mode,
8725 	},
8726 	[ALC256_FIXUP_ASUS_MIC] = {
8727 		.type = HDA_FIXUP_PINS,
8728 		.v.pins = (const struct hda_pintbl[]) {
8729 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8730 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8731 			{ }
8732 		},
8733 		.chained = true,
8734 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8735 	},
8736 	[ALC256_FIXUP_ASUS_AIO_GPIO2] = {
8737 		.type = HDA_FIXUP_FUNC,
8738 		/* Set up GPIO2 for the speaker amp */
8739 		.v.func = alc_fixup_gpio4,
8740 	},
8741 	[ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8742 		.type = HDA_FIXUP_PINS,
8743 		.v.pins = (const struct hda_pintbl[]) {
8744 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8745 			{ }
8746 		},
8747 		.chained = true,
8748 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8749 	},
8750 	[ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8751 		.type = HDA_FIXUP_VERBS,
8752 		.v.verbs = (const struct hda_verb[]) {
8753 			/* Enables internal speaker */
8754 			{0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8755 			{0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8756 			{}
8757 		},
8758 		.chained = true,
8759 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8760 	},
8761 	[ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8762 		.type = HDA_FIXUP_FUNC,
8763 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8764 		.chained = true,
8765 		.chain_id = ALC269_FIXUP_GPIO2
8766 	},
8767 	[ALC233_FIXUP_ACER_HEADSET_MIC] = {
8768 		.type = HDA_FIXUP_VERBS,
8769 		.v.verbs = (const struct hda_verb[]) {
8770 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8771 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8772 			{ }
8773 		},
8774 		.chained = true,
8775 		.chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8776 	},
8777 	[ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8778 		.type = HDA_FIXUP_PINS,
8779 		.v.pins = (const struct hda_pintbl[]) {
8780 			/* Change the mic location from front to right, otherwise there are
8781 			   two front mics with the same name, pulseaudio can't handle them.
8782 			   This is just a temporary workaround, after applying this fixup,
8783 			   there will be one "Front Mic" and one "Mic" in this machine.
8784 			 */
8785 			{ 0x1a, 0x04a19040 },
8786 			{ }
8787 		},
8788 	},
8789 	[ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8790 		.type = HDA_FIXUP_PINS,
8791 		.v.pins = (const struct hda_pintbl[]) {
8792 			{ 0x16, 0x0101102f }, /* Rear Headset HP */
8793 			{ 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8794 			{ 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8795 			{ 0x1b, 0x02011020 },
8796 			{ }
8797 		},
8798 		.chained = true,
8799 		.chain_id = ALC225_FIXUP_S3_POP_NOISE
8800 	},
8801 	[ALC225_FIXUP_S3_POP_NOISE] = {
8802 		.type = HDA_FIXUP_FUNC,
8803 		.v.func = alc225_fixup_s3_pop_noise,
8804 		.chained = true,
8805 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8806 	},
8807 	[ALC700_FIXUP_INTEL_REFERENCE] = {
8808 		.type = HDA_FIXUP_VERBS,
8809 		.v.verbs = (const struct hda_verb[]) {
8810 			/* Enables internal speaker */
8811 			{0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8812 			{0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8813 			{0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8814 			{0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8815 			{0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8816 			{0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8817 			{0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8818 			{0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8819 			{}
8820 		}
8821 	},
8822 	[ALC274_FIXUP_DELL_BIND_DACS] = {
8823 		.type = HDA_FIXUP_FUNC,
8824 		.v.func = alc274_fixup_bind_dacs,
8825 		.chained = true,
8826 		.chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8827 	},
8828 	[ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8829 		.type = HDA_FIXUP_PINS,
8830 		.v.pins = (const struct hda_pintbl[]) {
8831 			{ 0x1b, 0x0401102f },
8832 			{ }
8833 		},
8834 		.chained = true,
8835 		.chain_id = ALC274_FIXUP_DELL_BIND_DACS
8836 	},
8837 	[ALC298_FIXUP_TPT470_DOCK_FIX] = {
8838 		.type = HDA_FIXUP_FUNC,
8839 		.v.func = alc_fixup_tpt470_dock,
8840 		.chained = true,
8841 		.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8842 	},
8843 	[ALC298_FIXUP_TPT470_DOCK] = {
8844 		.type = HDA_FIXUP_FUNC,
8845 		.v.func = alc_fixup_tpt470_dacs,
8846 		.chained = true,
8847 		.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8848 	},
8849 	[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8850 		.type = HDA_FIXUP_PINS,
8851 		.v.pins = (const struct hda_pintbl[]) {
8852 			{ 0x14, 0x0201101f },
8853 			{ }
8854 		},
8855 		.chained = true,
8856 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8857 	},
8858 	[ALC255_FIXUP_DELL_HEADSET_MIC] = {
8859 		.type = HDA_FIXUP_PINS,
8860 		.v.pins = (const struct hda_pintbl[]) {
8861 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8862 			{ }
8863 		},
8864 		.chained = true,
8865 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8866 	},
8867 	[ALC295_FIXUP_HP_X360] = {
8868 		.type = HDA_FIXUP_FUNC,
8869 		.v.func = alc295_fixup_hp_top_speakers,
8870 		.chained = true,
8871 		.chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8872 	},
8873 	[ALC221_FIXUP_HP_HEADSET_MIC] = {
8874 		.type = HDA_FIXUP_PINS,
8875 		.v.pins = (const struct hda_pintbl[]) {
8876 			{ 0x19, 0x0181313f},
8877 			{ }
8878 		},
8879 		.chained = true,
8880 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8881 	},
8882 	[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8883 		.type = HDA_FIXUP_FUNC,
8884 		.v.func = alc285_fixup_invalidate_dacs,
8885 		.chained = true,
8886 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
8887 	},
8888 	[ALC295_FIXUP_HP_AUTO_MUTE] = {
8889 		.type = HDA_FIXUP_FUNC,
8890 		.v.func = alc_fixup_auto_mute_via_amp,
8891 	},
8892 	[ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8893 		.type = HDA_FIXUP_PINS,
8894 		.v.pins = (const struct hda_pintbl[]) {
8895 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8896 			{ }
8897 		},
8898 		.chained = true,
8899 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8900 	},
8901 	[ALC294_FIXUP_ASUS_MIC] = {
8902 		.type = HDA_FIXUP_PINS,
8903 		.v.pins = (const struct hda_pintbl[]) {
8904 			{ 0x13, 0x90a60160 }, /* use as internal mic */
8905 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8906 			{ }
8907 		},
8908 		.chained = true,
8909 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8910 	},
8911 	[ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8912 		.type = HDA_FIXUP_PINS,
8913 		.v.pins = (const struct hda_pintbl[]) {
8914 			{ 0x19, 0x01a1103c }, /* use as headset mic */
8915 			{ }
8916 		},
8917 		.chained = true,
8918 		.chain_id = ALC269_FIXUP_HEADSET_MIC
8919 	},
8920 	[ALC294_FIXUP_ASUS_SPK] = {
8921 		.type = HDA_FIXUP_VERBS,
8922 		.v.verbs = (const struct hda_verb[]) {
8923 			/* Set EAPD high */
8924 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8925 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8926 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8927 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8928 			{ }
8929 		},
8930 		.chained = true,
8931 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8932 	},
8933 	[ALC295_FIXUP_CHROME_BOOK] = {
8934 		.type = HDA_FIXUP_FUNC,
8935 		.v.func = alc295_fixup_chromebook,
8936 		.chained = true,
8937 		.chain_id = ALC225_FIXUP_HEADSET_JACK
8938 	},
8939 	[ALC225_FIXUP_HEADSET_JACK] = {
8940 		.type = HDA_FIXUP_FUNC,
8941 		.v.func = alc_fixup_headset_jack,
8942 	},
8943 	[ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8944 		.type = HDA_FIXUP_PINS,
8945 		.v.pins = (const struct hda_pintbl[]) {
8946 			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8947 			{ }
8948 		},
8949 		.chained = true,
8950 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8951 	},
8952 	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8953 		.type = HDA_FIXUP_VERBS,
8954 		.v.verbs = (const struct hda_verb[]) {
8955 			/* Disable PCBEEP-IN passthrough */
8956 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8957 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8958 			{ }
8959 		},
8960 		.chained = true,
8961 		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8962 	},
8963 	[ALC255_FIXUP_ACER_HEADSET_MIC] = {
8964 		.type = HDA_FIXUP_PINS,
8965 		.v.pins = (const struct hda_pintbl[]) {
8966 			{ 0x19, 0x03a11130 },
8967 			{ 0x1a, 0x90a60140 }, /* use as internal mic */
8968 			{ }
8969 		},
8970 		.chained = true,
8971 		.chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8972 	},
8973 	[ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8974 		.type = HDA_FIXUP_PINS,
8975 		.v.pins = (const struct hda_pintbl[]) {
8976 			{ 0x16, 0x01011020 }, /* Rear Line out */
8977 			{ 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8978 			{ }
8979 		},
8980 		.chained = true,
8981 		.chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8982 	},
8983 	[ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8984 		.type = HDA_FIXUP_FUNC,
8985 		.v.func = alc_fixup_auto_mute_via_amp,
8986 		.chained = true,
8987 		.chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8988 	},
8989 	[ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8990 		.type = HDA_FIXUP_FUNC,
8991 		.v.func = alc_fixup_disable_mic_vref,
8992 		.chained = true,
8993 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8994 	},
8995 	[ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8996 		.type = HDA_FIXUP_VERBS,
8997 		.v.verbs = (const struct hda_verb[]) {
8998 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8999 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
9000 			{ }
9001 		},
9002 		.chained = true,
9003 		.chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
9004 	},
9005 	[ALC256_FIXUP_ASUS_HEADSET_MIC] = {
9006 		.type = HDA_FIXUP_PINS,
9007 		.v.pins = (const struct hda_pintbl[]) {
9008 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
9009 			{ }
9010 		},
9011 		.chained = true,
9012 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9013 	},
9014 	[ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9015 		.type = HDA_FIXUP_PINS,
9016 		.v.pins = (const struct hda_pintbl[]) {
9017 			{ 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
9018 			{ }
9019 		},
9020 		.chained = true,
9021 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9022 	},
9023 	[ALC299_FIXUP_PREDATOR_SPK] = {
9024 		.type = HDA_FIXUP_PINS,
9025 		.v.pins = (const struct hda_pintbl[]) {
9026 			{ 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
9027 			{ }
9028 		}
9029 	},
9030 	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
9031 		.type = HDA_FIXUP_PINS,
9032 		.v.pins = (const struct hda_pintbl[]) {
9033 			{ 0x19, 0x04a11040 },
9034 			{ 0x21, 0x04211020 },
9035 			{ }
9036 		},
9037 		.chained = true,
9038 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9039 	},
9040 	[ALC289_FIXUP_DELL_SPK1] = {
9041 		.type = HDA_FIXUP_PINS,
9042 		.v.pins = (const struct hda_pintbl[]) {
9043 			{ 0x14, 0x90170140 },
9044 			{ }
9045 		},
9046 		.chained = true,
9047 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
9048 	},
9049 	[ALC289_FIXUP_DELL_SPK2] = {
9050 		.type = HDA_FIXUP_PINS,
9051 		.v.pins = (const struct hda_pintbl[]) {
9052 			{ 0x17, 0x90170130 }, /* bass spk */
9053 			{ }
9054 		},
9055 		.chained = true,
9056 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
9057 	},
9058 	[ALC289_FIXUP_DUAL_SPK] = {
9059 		.type = HDA_FIXUP_FUNC,
9060 		.v.func = alc285_fixup_speaker2_to_dac1,
9061 		.chained = true,
9062 		.chain_id = ALC289_FIXUP_DELL_SPK2
9063 	},
9064 	[ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
9065 		.type = HDA_FIXUP_FUNC,
9066 		.v.func = alc285_fixup_speaker2_to_dac1,
9067 		.chained = true,
9068 		.chain_id = ALC289_FIXUP_DELL_SPK1
9069 	},
9070 	[ALC294_FIXUP_SPK2_TO_DAC1] = {
9071 		.type = HDA_FIXUP_FUNC,
9072 		.v.func = alc285_fixup_speaker2_to_dac1,
9073 		.chained = true,
9074 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9075 	},
9076 	[ALC294_FIXUP_ASUS_DUAL_SPK] = {
9077 		.type = HDA_FIXUP_FUNC,
9078 		/* The GPIO must be pulled to initialize the AMP */
9079 		.v.func = alc_fixup_gpio4,
9080 		.chained = true,
9081 		.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
9082 	},
9083 	[ALC294_FIXUP_ASUS_ALLY] = {
9084 		.type = HDA_FIXUP_FUNC,
9085 		.v.func = cs35l41_fixup_i2c_two,
9086 		.chained = true,
9087 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
9088 	},
9089 	[ALC294_FIXUP_ASUS_ALLY_X] = {
9090 		.type = HDA_FIXUP_FUNC,
9091 		.v.func = tas2781_fixup_i2c,
9092 		.chained = true,
9093 		.chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
9094 	},
9095 	[ALC294_FIXUP_ASUS_ALLY_PINS] = {
9096 		.type = HDA_FIXUP_PINS,
9097 		.v.pins = (const struct hda_pintbl[]) {
9098 			{ 0x19, 0x03a11050 },
9099 			{ 0x1a, 0x03a11c30 },
9100 			{ 0x21, 0x03211420 },
9101 			{ }
9102 		},
9103 		.chained = true,
9104 		.chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
9105 	},
9106 	[ALC294_FIXUP_ASUS_ALLY_VERBS] = {
9107 		.type = HDA_FIXUP_VERBS,
9108 		.v.verbs = (const struct hda_verb[]) {
9109 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9110 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9111 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
9112 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
9113 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
9114 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
9115 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
9116 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
9117 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
9118 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
9119 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
9120 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
9121 			{ }
9122 		},
9123 		.chained = true,
9124 		.chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
9125 	},
9126 	[ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
9127 		.type = HDA_FIXUP_FUNC,
9128 		.v.func = alc285_fixup_speaker2_to_dac1,
9129 	},
9130 	[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
9131 		.type = HDA_FIXUP_FUNC,
9132 		.v.func = alc285_fixup_thinkpad_x1_gen7,
9133 		.chained = true,
9134 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9135 	},
9136 	[ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
9137 		.type = HDA_FIXUP_FUNC,
9138 		.v.func = alc_fixup_headset_jack,
9139 		.chained = true,
9140 		.chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
9141 	},
9142 	[ALC294_FIXUP_ASUS_HPE] = {
9143 		.type = HDA_FIXUP_VERBS,
9144 		.v.verbs = (const struct hda_verb[]) {
9145 			/* Set EAPD high */
9146 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9147 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
9148 			{ }
9149 		},
9150 		.chained = true,
9151 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9152 	},
9153 	[ALC294_FIXUP_ASUS_GX502_PINS] = {
9154 		.type = HDA_FIXUP_PINS,
9155 		.v.pins = (const struct hda_pintbl[]) {
9156 			{ 0x19, 0x03a11050 }, /* front HP mic */
9157 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9158 			{ 0x21, 0x03211020 }, /* front HP out */
9159 			{ }
9160 		},
9161 		.chained = true,
9162 		.chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
9163 	},
9164 	[ALC294_FIXUP_ASUS_GX502_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 			{ }
9172 		},
9173 		.chained = true,
9174 		.chain_id = ALC294_FIXUP_ASUS_GX502_HP
9175 	},
9176 	[ALC294_FIXUP_ASUS_GX502_HP] = {
9177 		.type = HDA_FIXUP_FUNC,
9178 		.v.func = alc294_fixup_gx502_hp,
9179 	},
9180 	[ALC294_FIXUP_ASUS_GU502_PINS] = {
9181 		.type = HDA_FIXUP_PINS,
9182 		.v.pins = (const struct hda_pintbl[]) {
9183 			{ 0x19, 0x01a11050 }, /* rear HP mic */
9184 			{ 0x1a, 0x01a11830 }, /* rear external mic */
9185 			{ 0x21, 0x012110f0 }, /* rear HP out */
9186 			{ }
9187 		},
9188 		.chained = true,
9189 		.chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
9190 	},
9191 	[ALC294_FIXUP_ASUS_GU502_VERBS] = {
9192 		.type = HDA_FIXUP_VERBS,
9193 		.v.verbs = (const struct hda_verb[]) {
9194 			/* set 0x15 to HP-OUT ctrl */
9195 			{ 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9196 			/* unmute the 0x15 amp */
9197 			{ 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9198 			/* set 0x1b to HP-OUT */
9199 			{ 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
9200 			{ }
9201 		},
9202 		.chained = true,
9203 		.chain_id = ALC294_FIXUP_ASUS_GU502_HP
9204 	},
9205 	[ALC294_FIXUP_ASUS_GU502_HP] = {
9206 		.type = HDA_FIXUP_FUNC,
9207 		.v.func = alc294_fixup_gu502_hp,
9208 	},
9209 	 [ALC294_FIXUP_ASUS_G513_PINS] = {
9210 		.type = HDA_FIXUP_PINS,
9211 		.v.pins = (const struct hda_pintbl[]) {
9212 				{ 0x19, 0x03a11050 }, /* front HP mic */
9213 				{ 0x1a, 0x03a11c30 }, /* rear external mic */
9214 				{ 0x21, 0x03211420 }, /* front HP out */
9215 				{ }
9216 		},
9217 	},
9218 	[ALC285_FIXUP_ASUS_G533Z_PINS] = {
9219 		.type = HDA_FIXUP_PINS,
9220 		.v.pins = (const struct hda_pintbl[]) {
9221 			{ 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
9222 			{ 0x19, 0x03a19020 }, /* Mic Boost Volume */
9223 			{ 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
9224 			{ 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
9225 			{ 0x21, 0x03211420 },
9226 			{ }
9227 		},
9228 	},
9229 	[ALC294_FIXUP_ASUS_COEF_1B] = {
9230 		.type = HDA_FIXUP_VERBS,
9231 		.v.verbs = (const struct hda_verb[]) {
9232 			/* Set bit 10 to correct noisy output after reboot from
9233 			 * Windows 10 (due to pop noise reduction?)
9234 			 */
9235 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
9236 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
9237 			{ }
9238 		},
9239 		.chained = true,
9240 		.chain_id = ALC289_FIXUP_ASUS_GA401,
9241 	},
9242 	[ALC285_FIXUP_HP_GPIO_LED] = {
9243 		.type = HDA_FIXUP_FUNC,
9244 		.v.func = alc285_fixup_hp_gpio_led,
9245 	},
9246 	[ALC285_FIXUP_HP_MUTE_LED] = {
9247 		.type = HDA_FIXUP_FUNC,
9248 		.v.func = alc285_fixup_hp_mute_led,
9249 	},
9250 	[ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
9251 		.type = HDA_FIXUP_FUNC,
9252 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
9253 	},
9254 	[ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
9255 	    .type = HDA_FIXUP_FUNC,
9256 	    .v.func = alc236_fixup_hp_mute_led_coefbit2,
9257 	},
9258 	[ALC236_FIXUP_HP_GPIO_LED] = {
9259 		.type = HDA_FIXUP_FUNC,
9260 		.v.func = alc236_fixup_hp_gpio_led,
9261 	},
9262 	[ALC236_FIXUP_HP_MUTE_LED] = {
9263 		.type = HDA_FIXUP_FUNC,
9264 		.v.func = alc236_fixup_hp_mute_led,
9265 	},
9266 	[ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9267 		.type = HDA_FIXUP_FUNC,
9268 		.v.func = alc236_fixup_hp_mute_led_micmute_vref,
9269 	},
9270 	[ALC236_FIXUP_LENOVO_INV_DMIC] = {
9271 		.type = HDA_FIXUP_FUNC,
9272 		.v.func = alc_fixup_inv_dmic,
9273 		.chained = true,
9274 		.chain_id = ALC283_FIXUP_INT_MIC,
9275 	},
9276 	[ALC298_FIXUP_SAMSUNG_AMP] = {
9277 		.type = HDA_FIXUP_FUNC,
9278 		.v.func = alc298_fixup_samsung_amp,
9279 		.chained = true,
9280 		.chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9281 	},
9282 	[ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS] = {
9283 		.type = HDA_FIXUP_FUNC,
9284 		.v.func = alc298_fixup_samsung_amp_v2_2_amps
9285 	},
9286 	[ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS] = {
9287 		.type = HDA_FIXUP_FUNC,
9288 		.v.func = alc298_fixup_samsung_amp_v2_4_amps
9289 	},
9290 	[ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9291 		.type = HDA_FIXUP_VERBS,
9292 		.v.verbs = (const struct hda_verb[]) {
9293 			{ 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9294 			{ }
9295 		},
9296 	},
9297 	[ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9298 		.type = HDA_FIXUP_VERBS,
9299 		.v.verbs = (const struct hda_verb[]) {
9300 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9301 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9302 			{ }
9303 		},
9304 	},
9305 	[ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9306 		.type = HDA_FIXUP_PINS,
9307 		.v.pins = (const struct hda_pintbl[]) {
9308 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9309 			{ }
9310 		},
9311 		.chained = true,
9312 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9313 	},
9314 	[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9315 		.type = HDA_FIXUP_PINS,
9316 		.v.pins = (const struct hda_pintbl[]) {
9317 			{ 0x14, 0x90100120 }, /* use as internal speaker */
9318 			{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9319 			{ 0x1a, 0x01011020 }, /* use as line out */
9320 			{ },
9321 		},
9322 		.chained = true,
9323 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9324 	},
9325 	[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9326 		.type = HDA_FIXUP_PINS,
9327 		.v.pins = (const struct hda_pintbl[]) {
9328 			{ 0x18, 0x02a11030 }, /* use as headset mic */
9329 			{ }
9330 		},
9331 		.chained = true,
9332 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9333 	},
9334 	[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9335 		.type = HDA_FIXUP_PINS,
9336 		.v.pins = (const struct hda_pintbl[]) {
9337 			{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9338 			{ }
9339 		},
9340 		.chained = true,
9341 		.chain_id = ALC269_FIXUP_HEADSET_MIC
9342 	},
9343 	[ALC289_FIXUP_ASUS_GA401] = {
9344 		.type = HDA_FIXUP_FUNC,
9345 		.v.func = alc289_fixup_asus_ga401,
9346 		.chained = true,
9347 		.chain_id = ALC289_FIXUP_ASUS_GA502,
9348 	},
9349 	[ALC289_FIXUP_ASUS_GA502] = {
9350 		.type = HDA_FIXUP_PINS,
9351 		.v.pins = (const struct hda_pintbl[]) {
9352 			{ 0x19, 0x03a11020 }, /* headset mic with jack detect */
9353 			{ }
9354 		},
9355 	},
9356 	[ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9357 		.type = HDA_FIXUP_PINS,
9358 		.v.pins = (const struct hda_pintbl[]) {
9359 			{ 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9360 			{ }
9361 		},
9362 		.chained = true,
9363 		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9364 	},
9365 	[ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9366 		.type = HDA_FIXUP_FUNC,
9367 		.v.func = alc285_fixup_hp_gpio_amp_init,
9368 		.chained = true,
9369 		.chain_id = ALC285_FIXUP_HP_GPIO_LED
9370 	},
9371 	[ALC269_FIXUP_CZC_B20] = {
9372 		.type = HDA_FIXUP_PINS,
9373 		.v.pins = (const struct hda_pintbl[]) {
9374 			{ 0x12, 0x411111f0 },
9375 			{ 0x14, 0x90170110 }, /* speaker */
9376 			{ 0x15, 0x032f1020 }, /* HP out */
9377 			{ 0x17, 0x411111f0 },
9378 			{ 0x18, 0x03ab1040 }, /* mic */
9379 			{ 0x19, 0xb7a7013f },
9380 			{ 0x1a, 0x0181305f },
9381 			{ 0x1b, 0x411111f0 },
9382 			{ 0x1d, 0x411111f0 },
9383 			{ 0x1e, 0x411111f0 },
9384 			{ }
9385 		},
9386 		.chain_id = ALC269_FIXUP_DMIC,
9387 	},
9388 	[ALC269_FIXUP_CZC_TMI] = {
9389 		.type = HDA_FIXUP_PINS,
9390 		.v.pins = (const struct hda_pintbl[]) {
9391 			{ 0x12, 0x4000c000 },
9392 			{ 0x14, 0x90170110 }, /* speaker */
9393 			{ 0x15, 0x0421401f }, /* HP out */
9394 			{ 0x17, 0x411111f0 },
9395 			{ 0x18, 0x04a19020 }, /* mic */
9396 			{ 0x19, 0x411111f0 },
9397 			{ 0x1a, 0x411111f0 },
9398 			{ 0x1b, 0x411111f0 },
9399 			{ 0x1d, 0x40448505 },
9400 			{ 0x1e, 0x411111f0 },
9401 			{ 0x20, 0x8000ffff },
9402 			{ }
9403 		},
9404 		.chain_id = ALC269_FIXUP_DMIC,
9405 	},
9406 	[ALC269_FIXUP_CZC_L101] = {
9407 		.type = HDA_FIXUP_PINS,
9408 		.v.pins = (const struct hda_pintbl[]) {
9409 			{ 0x12, 0x40000000 },
9410 			{ 0x14, 0x01014010 }, /* speaker */
9411 			{ 0x15, 0x411111f0 }, /* HP out */
9412 			{ 0x16, 0x411111f0 },
9413 			{ 0x18, 0x01a19020 }, /* mic */
9414 			{ 0x19, 0x02a19021 },
9415 			{ 0x1a, 0x0181302f },
9416 			{ 0x1b, 0x0221401f },
9417 			{ 0x1c, 0x411111f0 },
9418 			{ 0x1d, 0x4044c601 },
9419 			{ 0x1e, 0x411111f0 },
9420 			{ }
9421 		},
9422 		.chain_id = ALC269_FIXUP_DMIC,
9423 	},
9424 	[ALC269_FIXUP_LEMOTE_A1802] = {
9425 		.type = HDA_FIXUP_PINS,
9426 		.v.pins = (const struct hda_pintbl[]) {
9427 			{ 0x12, 0x40000000 },
9428 			{ 0x14, 0x90170110 }, /* speaker */
9429 			{ 0x17, 0x411111f0 },
9430 			{ 0x18, 0x03a19040 }, /* mic1 */
9431 			{ 0x19, 0x90a70130 }, /* mic2 */
9432 			{ 0x1a, 0x411111f0 },
9433 			{ 0x1b, 0x411111f0 },
9434 			{ 0x1d, 0x40489d2d },
9435 			{ 0x1e, 0x411111f0 },
9436 			{ 0x20, 0x0003ffff },
9437 			{ 0x21, 0x03214020 },
9438 			{ }
9439 		},
9440 		.chain_id = ALC269_FIXUP_DMIC,
9441 	},
9442 	[ALC269_FIXUP_LEMOTE_A190X] = {
9443 		.type = HDA_FIXUP_PINS,
9444 		.v.pins = (const struct hda_pintbl[]) {
9445 			{ 0x14, 0x99130110 }, /* speaker */
9446 			{ 0x15, 0x0121401f }, /* HP out */
9447 			{ 0x18, 0x01a19c20 }, /* rear  mic */
9448 			{ 0x19, 0x99a3092f }, /* front mic */
9449 			{ 0x1b, 0x0201401f }, /* front lineout */
9450 			{ }
9451 		},
9452 		.chain_id = ALC269_FIXUP_DMIC,
9453 	},
9454 	[ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9455 		.type = HDA_FIXUP_PINS,
9456 		.v.pins = (const struct hda_pintbl[]) {
9457 			{ 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9458 			{ }
9459 		},
9460 		.chained = true,
9461 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9462 	},
9463 	[ALC256_FIXUP_INTEL_NUC10] = {
9464 		.type = HDA_FIXUP_PINS,
9465 		.v.pins = (const struct hda_pintbl[]) {
9466 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9467 			{ }
9468 		},
9469 		.chained = true,
9470 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9471 	},
9472 	[ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9473 		.type = HDA_FIXUP_VERBS,
9474 		.v.verbs = (const struct hda_verb[]) {
9475 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9476 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9477 			{ }
9478 		},
9479 		.chained = true,
9480 		.chain_id = ALC289_FIXUP_ASUS_GA502
9481 	},
9482 	[ALC274_FIXUP_HP_MIC] = {
9483 		.type = HDA_FIXUP_VERBS,
9484 		.v.verbs = (const struct hda_verb[]) {
9485 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9486 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9487 			{ }
9488 		},
9489 	},
9490 	[ALC274_FIXUP_HP_HEADSET_MIC] = {
9491 		.type = HDA_FIXUP_FUNC,
9492 		.v.func = alc274_fixup_hp_headset_mic,
9493 		.chained = true,
9494 		.chain_id = ALC274_FIXUP_HP_MIC
9495 	},
9496 	[ALC274_FIXUP_HP_ENVY_GPIO] = {
9497 		.type = HDA_FIXUP_FUNC,
9498 		.v.func = alc274_fixup_hp_envy_gpio,
9499 	},
9500 	[ALC256_FIXUP_ASUS_HPE] = {
9501 		.type = HDA_FIXUP_VERBS,
9502 		.v.verbs = (const struct hda_verb[]) {
9503 			/* Set EAPD high */
9504 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9505 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9506 			{ }
9507 		},
9508 		.chained = true,
9509 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9510 	},
9511 	[ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9512 		.type = HDA_FIXUP_FUNC,
9513 		.v.func = alc_fixup_headset_jack,
9514 		.chained = true,
9515 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
9516 	},
9517 	[ALC287_FIXUP_HP_GPIO_LED] = {
9518 		.type = HDA_FIXUP_FUNC,
9519 		.v.func = alc287_fixup_hp_gpio_led,
9520 	},
9521 	[ALC256_FIXUP_HP_HEADSET_MIC] = {
9522 		.type = HDA_FIXUP_FUNC,
9523 		.v.func = alc274_fixup_hp_headset_mic,
9524 	},
9525 	[ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9526 		.type = HDA_FIXUP_FUNC,
9527 		.v.func = alc_fixup_no_int_mic,
9528 		.chained = true,
9529 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9530 	},
9531 	[ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9532 		.type = HDA_FIXUP_PINS,
9533 		.v.pins = (const struct hda_pintbl[]) {
9534 			{ 0x1b, 0x411111f0 },
9535 			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9536 			{ },
9537 		},
9538 		.chained = true,
9539 		.chain_id = ALC269_FIXUP_HEADSET_MODE
9540 	},
9541 	[ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9542 		.type = HDA_FIXUP_FUNC,
9543 		.v.func = alc269_fixup_limit_int_mic_boost,
9544 		.chained = true,
9545 		.chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9546 	},
9547 	[ALC256_FIXUP_ACER_HEADSET_MIC] = {
9548 		.type = HDA_FIXUP_PINS,
9549 		.v.pins = (const struct hda_pintbl[]) {
9550 			{ 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9551 			{ 0x1a, 0x90a1092f }, /* use as internal mic */
9552 			{ }
9553 		},
9554 		.chained = true,
9555 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9556 	},
9557 	[ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9558 		.type = HDA_FIXUP_FUNC,
9559 		.v.func = alc285_fixup_ideapad_s740_coef,
9560 		.chained = true,
9561 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9562 	},
9563 	[ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9564 		.type = HDA_FIXUP_FUNC,
9565 		.v.func = alc269_fixup_limit_int_mic_boost,
9566 		.chained = true,
9567 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9568 	},
9569 	[ALC295_FIXUP_ASUS_DACS] = {
9570 		.type = HDA_FIXUP_FUNC,
9571 		.v.func = alc295_fixup_asus_dacs,
9572 	},
9573 	[ALC295_FIXUP_HP_OMEN] = {
9574 		.type = HDA_FIXUP_PINS,
9575 		.v.pins = (const struct hda_pintbl[]) {
9576 			{ 0x12, 0xb7a60130 },
9577 			{ 0x13, 0x40000000 },
9578 			{ 0x14, 0x411111f0 },
9579 			{ 0x16, 0x411111f0 },
9580 			{ 0x17, 0x90170110 },
9581 			{ 0x18, 0x411111f0 },
9582 			{ 0x19, 0x02a11030 },
9583 			{ 0x1a, 0x411111f0 },
9584 			{ 0x1b, 0x04a19030 },
9585 			{ 0x1d, 0x40600001 },
9586 			{ 0x1e, 0x411111f0 },
9587 			{ 0x21, 0x03211020 },
9588 			{}
9589 		},
9590 		.chained = true,
9591 		.chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9592 	},
9593 	[ALC285_FIXUP_HP_SPECTRE_X360] = {
9594 		.type = HDA_FIXUP_FUNC,
9595 		.v.func = alc285_fixup_hp_spectre_x360,
9596 	},
9597 	[ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9598 		.type = HDA_FIXUP_FUNC,
9599 		.v.func = alc285_fixup_hp_spectre_x360_eb1
9600 	},
9601 	[ALC285_FIXUP_HP_ENVY_X360] = {
9602 		.type = HDA_FIXUP_FUNC,
9603 		.v.func = alc285_fixup_hp_envy_x360,
9604 		.chained = true,
9605 		.chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9606 	},
9607 	[ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9608 		.type = HDA_FIXUP_FUNC,
9609 		.v.func = alc285_fixup_ideapad_s740_coef,
9610 		.chained = true,
9611 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9612 	},
9613 	[ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9614 		.type = HDA_FIXUP_FUNC,
9615 		.v.func = alc_fixup_no_shutup,
9616 		.chained = true,
9617 		.chain_id = ALC283_FIXUP_HEADSET_MIC,
9618 	},
9619 	[ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9620 		.type = HDA_FIXUP_PINS,
9621 		.v.pins = (const struct hda_pintbl[]) {
9622 			{ 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9623 			{ }
9624 		},
9625 		.chained = true,
9626 		.chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9627 	},
9628 	[ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9629 		.type = HDA_FIXUP_FUNC,
9630 		.v.func = alc269_fixup_limit_int_mic_boost,
9631 		.chained = true,
9632 		.chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9633 	},
9634 	[ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9635 		.type = HDA_FIXUP_FUNC,
9636 		.v.func = alc285_fixup_ideapad_s740_coef,
9637 		.chained = true,
9638 		.chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9639 	},
9640 	[ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9641 		.type = HDA_FIXUP_FUNC,
9642 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9643 		.chained = true,
9644 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9645 	},
9646 	[ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9647 		.type = HDA_FIXUP_VERBS,
9648 		//.v.verbs = legion_15imhg05_coefs,
9649 		.v.verbs = (const struct hda_verb[]) {
9650 			 // set left speaker Legion 7i.
9651 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9652 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9653 
9654 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9655 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9656 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9657 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9658 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9659 
9660 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9661 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9662 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9663 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9664 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9665 
9666 			 // set right speaker Legion 7i.
9667 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9668 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9669 
9670 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9671 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9672 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9673 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9674 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9675 
9676 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9677 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9678 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9679 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9680 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9681 			 {}
9682 		},
9683 		.chained = true,
9684 		.chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9685 	},
9686 	[ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9687 		.type = HDA_FIXUP_FUNC,
9688 		.v.func = alc287_fixup_legion_15imhg05_speakers,
9689 		.chained = true,
9690 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9691 	},
9692 	[ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9693 		.type = HDA_FIXUP_VERBS,
9694 		.v.verbs = (const struct hda_verb[]) {
9695 			 // set left speaker Yoga 7i.
9696 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9697 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9698 
9699 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9700 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9701 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9702 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9703 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9704 
9705 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9706 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9707 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9708 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9709 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9710 
9711 			 // set right speaker Yoga 7i.
9712 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9713 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9714 
9715 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9716 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9717 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9718 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9719 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9720 
9721 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9722 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9723 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9724 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9725 			 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9726 			 {}
9727 		},
9728 		.chained = true,
9729 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9730 	},
9731 	[ALC298_FIXUP_LENOVO_C940_DUET7] = {
9732 		.type = HDA_FIXUP_FUNC,
9733 		.v.func = alc298_fixup_lenovo_c940_duet7,
9734 	},
9735 	[ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9736 		.type = HDA_FIXUP_FUNC,
9737 		.v.func = alc287_fixup_lenovo_14irp8_duetitl,
9738 	},
9739 	[ALC287_FIXUP_LENOVO_LEGION_7] = {
9740 		.type = HDA_FIXUP_FUNC,
9741 		.v.func = alc287_fixup_lenovo_legion_7,
9742 	},
9743 	[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9744 		.type = HDA_FIXUP_VERBS,
9745 		.v.verbs = (const struct hda_verb[]) {
9746 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9747 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9748 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9749 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9750 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9751 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9752 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9753 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9754 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9755 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9756 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9757 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9758 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9759 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9760 			{}
9761 		},
9762 		.chained = true,
9763 		.chain_id = ALC269_FIXUP_HEADSET_MODE,
9764 	},
9765 	[ALC256_FIXUP_SET_COEF_DEFAULTS] = {
9766 		.type = HDA_FIXUP_FUNC,
9767 		.v.func = alc256_fixup_set_coef_defaults,
9768 	},
9769 	[ALC245_FIXUP_HP_GPIO_LED] = {
9770 		.type = HDA_FIXUP_FUNC,
9771 		.v.func = alc245_fixup_hp_gpio_led,
9772 	},
9773 	[ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9774 		.type = HDA_FIXUP_PINS,
9775 		.v.pins = (const struct hda_pintbl[]) {
9776 			{ 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9777 			{ }
9778 		},
9779 		.chained = true,
9780 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9781 	},
9782 	[ALC233_FIXUP_NO_AUDIO_JACK] = {
9783 		.type = HDA_FIXUP_FUNC,
9784 		.v.func = alc233_fixup_no_audio_jack,
9785 	},
9786 	[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9787 		.type = HDA_FIXUP_FUNC,
9788 		.v.func = alc256_fixup_mic_no_presence_and_resume,
9789 		.chained = true,
9790 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9791 	},
9792 	[ALC287_FIXUP_LEGION_16ACHG6] = {
9793 		.type = HDA_FIXUP_FUNC,
9794 		.v.func = alc287_fixup_legion_16achg6_speakers,
9795 	},
9796 	[ALC287_FIXUP_CS35L41_I2C_2] = {
9797 		.type = HDA_FIXUP_FUNC,
9798 		.v.func = cs35l41_fixup_i2c_two,
9799 	},
9800 	[ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9801 		.type = HDA_FIXUP_FUNC,
9802 		.v.func = cs35l41_fixup_i2c_two,
9803 		.chained = true,
9804 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9805 	},
9806 	[ALC287_FIXUP_CS35L41_I2C_4] = {
9807 		.type = HDA_FIXUP_FUNC,
9808 		.v.func = cs35l41_fixup_i2c_four,
9809 	},
9810 	[ALC245_FIXUP_CS35L41_SPI_2] = {
9811 		.type = HDA_FIXUP_FUNC,
9812 		.v.func = cs35l41_fixup_spi_two,
9813 	},
9814 	[ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9815 		.type = HDA_FIXUP_FUNC,
9816 		.v.func = cs35l41_fixup_spi_two,
9817 		.chained = true,
9818 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9819 	},
9820 	[ALC245_FIXUP_CS35L41_SPI_4] = {
9821 		.type = HDA_FIXUP_FUNC,
9822 		.v.func = cs35l41_fixup_spi_four,
9823 	},
9824 	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9825 		.type = HDA_FIXUP_FUNC,
9826 		.v.func = cs35l41_fixup_spi_four,
9827 		.chained = true,
9828 		.chain_id = ALC285_FIXUP_HP_GPIO_LED,
9829 	},
9830 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9831 		.type = HDA_FIXUP_VERBS,
9832 		.v.verbs = (const struct hda_verb[]) {
9833 			 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9834 			 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9835 			 { }
9836 		},
9837 		.chained = true,
9838 		.chain_id = ALC285_FIXUP_HP_MUTE_LED,
9839 	},
9840 	[ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9841 		.type = HDA_FIXUP_FUNC,
9842 		.v.func = alc_fixup_dell4_mic_no_presence_quiet,
9843 		.chained = true,
9844 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9845 	},
9846 	[ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9847 		.type = HDA_FIXUP_PINS,
9848 		.v.pins = (const struct hda_pintbl[]) {
9849 			{ 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9850 			{ }
9851 		},
9852 		.chained = true,
9853 		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9854 	},
9855 	[ALC287_FIXUP_LEGION_16ITHG6] = {
9856 		.type = HDA_FIXUP_FUNC,
9857 		.v.func = alc287_fixup_legion_16ithg6_speakers,
9858 	},
9859 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9860 		.type = HDA_FIXUP_VERBS,
9861 		.v.verbs = (const struct hda_verb[]) {
9862 			// enable left speaker
9863 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9864 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9865 
9866 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9867 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9868 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9869 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9870 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9871 
9872 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9873 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9874 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9875 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9876 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9877 
9878 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9879 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9880 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9881 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9882 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9883 
9884 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9885 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9886 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9887 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9888 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9889 
9890 			// enable right speaker
9891 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9892 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9893 
9894 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9895 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9896 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9897 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9898 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9899 
9900 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9901 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9902 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9903 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9904 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9905 
9906 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9907 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9908 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9909 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9910 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9911 
9912 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9913 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9914 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9915 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9916 			{ 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9917 
9918 			{ },
9919 		},
9920 	},
9921 	[ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9922 		.type = HDA_FIXUP_FUNC,
9923 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9924 		.chained = true,
9925 		.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9926 	},
9927 	[ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7] = {
9928 		.type = HDA_FIXUP_FUNC,
9929 		.v.func = alc287_fixup_lenovo_14arp8_legion_iah7,
9930 	},
9931 	[ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9932 		.type = HDA_FIXUP_FUNC,
9933 		.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9934 		.chained = true,
9935 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9936 	},
9937 	[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9938 		.type = HDA_FIXUP_FUNC,
9939 		.v.func = alc295_fixup_dell_inspiron_top_speakers,
9940 		.chained = true,
9941 		.chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9942 	},
9943 	[ALC236_FIXUP_DELL_DUAL_CODECS] = {
9944 		.type = HDA_FIXUP_PINS,
9945 		.v.func = alc1220_fixup_gb_dual_codecs,
9946 		.chained = true,
9947 		.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9948 	},
9949 	[ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9950 		.type = HDA_FIXUP_FUNC,
9951 		.v.func = cs35l41_fixup_i2c_two,
9952 		.chained = true,
9953 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9954 	},
9955 	[ALC287_FIXUP_TAS2781_I2C] = {
9956 		.type = HDA_FIXUP_FUNC,
9957 		.v.func = tas2781_fixup_i2c,
9958 		.chained = true,
9959 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9960 	},
9961 	[ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
9962 		.type = HDA_FIXUP_FUNC,
9963 		.v.func = yoga7_14arb7_fixup_i2c,
9964 		.chained = true,
9965 		.chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9966 	},
9967 	[ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9968 		.type = HDA_FIXUP_FUNC,
9969 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9970 	},
9971 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9972 		.type = HDA_FIXUP_FUNC,
9973 		.v.func = alc245_fixup_hp_mute_led_coefbit,
9974 		.chained = true,
9975 		.chain_id = ALC245_FIXUP_HP_GPIO_LED
9976 	},
9977 	[ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9978 		.type = HDA_FIXUP_FUNC,
9979 		.v.func = alc287_fixup_bind_dacs,
9980 		.chained = true,
9981 		.chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9982 	},
9983 	[ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9984 		.type = HDA_FIXUP_FUNC,
9985 		.v.func = alc287_fixup_bind_dacs,
9986 		.chained = true,
9987 		.chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9988 	},
9989 	[ALC2XX_FIXUP_HEADSET_MIC] = {
9990 		.type = HDA_FIXUP_FUNC,
9991 		.v.func = alc_fixup_headset_mic,
9992 	},
9993 	[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9994 		.type = HDA_FIXUP_FUNC,
9995 		.v.func = cs35l41_fixup_spi_two,
9996 		.chained = true,
9997 		.chain_id = ALC289_FIXUP_DUAL_SPK
9998 	},
9999 	[ALC294_FIXUP_CS35L41_I2C_2] = {
10000 		.type = HDA_FIXUP_FUNC,
10001 		.v.func = cs35l41_fixup_i2c_two,
10002 	},
10003 	[ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
10004 		.type = HDA_FIXUP_FUNC,
10005 		.v.func = alc256_fixup_acer_sfg16_micmute_led,
10006 	},
10007 	[ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
10008 		.type = HDA_FIXUP_FUNC,
10009 		.v.func = alc256_decrease_headphone_amp_val,
10010 	},
10011 	[ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
10012 		.type = HDA_FIXUP_FUNC,
10013 		.v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
10014 	},
10015 	[ALC285_FIXUP_ASUS_GA403U] = {
10016 		.type = HDA_FIXUP_FUNC,
10017 		.v.func = alc285_fixup_asus_ga403u,
10018 	},
10019 	[ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
10020 		.type = HDA_FIXUP_PINS,
10021 		.v.pins = (const struct hda_pintbl[]) {
10022 			{ 0x19, 0x03a11050 },
10023 			{ 0x1b, 0x03a11c30 },
10024 			{ }
10025 		},
10026 		.chained = true,
10027 		.chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
10028 	},
10029 	[ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
10030 		.type = HDA_FIXUP_FUNC,
10031 		.v.func = alc285_fixup_speaker2_to_dac1,
10032 		.chained = true,
10033 		.chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
10034 	},
10035 	[ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
10036 		.type = HDA_FIXUP_PINS,
10037 		.v.pins = (const struct hda_pintbl[]) {
10038 			{ 0x19, 0x03a11050 },
10039 			{ 0x1b, 0x03a11c30 },
10040 			{ }
10041 		},
10042 	},
10043 	[ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
10044 		.type = HDA_FIXUP_FUNC,
10045 		.v.func = alc285_fixup_speaker2_to_dac1,
10046 		.chained = true,
10047 		.chain_id = ALC285_FIXUP_ASUS_GA403U,
10048 	},
10049 	[ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
10050 		.type = HDA_FIXUP_FUNC,
10051 		.v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
10052 		.chained = true,
10053 		.chain_id = ALC269_FIXUP_THINKPAD_ACPI
10054 	},
10055 	[ALC256_FIXUP_CHROME_BOOK] = {
10056 		.type = HDA_FIXUP_FUNC,
10057 		.v.func = alc256_fixup_chromebook,
10058 		.chained = true,
10059 		.chain_id = ALC225_FIXUP_HEADSET_JACK
10060 	},
10061 	[ALC287_FIXUP_LENOVO_SSID_17AA3820] = {
10062 		.type = HDA_FIXUP_FUNC,
10063 		.v.func = alc287_fixup_lenovo_ssid_17aa3820,
10064 	},
10065 	[ALC245_FIXUP_CLEVO_NOISY_MIC] = {
10066 		.type = HDA_FIXUP_FUNC,
10067 		.v.func = alc269_fixup_limit_int_mic_boost,
10068 		.chained = true,
10069 		.chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
10070 	},
10071 	[ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = {
10072 		.type = HDA_FIXUP_PINS,
10073 		.v.pins = (const struct hda_pintbl[]) {
10074 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10075 			{ 0x1b, 0x20a11040 }, /* dock mic */
10076 			{ }
10077 		},
10078 		.chained = true,
10079 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
10080 	},
10081 };
10082 
10083 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
10084 	SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
10085 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
10086 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
10087 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
10088 	SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10089 	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
10090 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
10091 	SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
10092 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
10093 	SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
10094 	SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10095 	SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
10096 	SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
10097 	SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
10098 	SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
10099 	SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
10100 	SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
10101 	SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
10102 	SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10103 	SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10104 	SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
10105 	SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
10106 	SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
10107 	SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10108 	SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
10109 	SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
10110 	SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10111 	SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10112 	SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10113 	SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10114 	SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
10115 	SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10116 	SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10117 	SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10118 	SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
10119 	SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
10120 	SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10121 	SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10122 	SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
10123 	SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
10124 	SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10125 	SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
10126 	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
10127 	SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
10128 	SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
10129 	SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
10130 	SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
10131 	SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
10132 	SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
10133 	SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
10134 	SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10135 	SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10136 	SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10137 	SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10138 	SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10139 	SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
10140 	SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
10141 	SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
10142 	SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10143 	SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10144 	SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
10145 	SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10146 	SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
10147 	SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
10148 	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10149 	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10150 	SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10151 	SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10152 	SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10153 	SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10154 	SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10155 	SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10156 	SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
10157 	SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
10158 	SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
10159 	SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
10160 	SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
10161 	SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
10162 	SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
10163 	SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10164 	SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10165 	SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10166 	SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10167 	SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
10168 	SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
10169 	SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
10170 	SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10171 	SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10172 	SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
10173 	SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10174 	SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10175 	SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10176 	SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10177 	SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
10178 	SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
10179 	SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
10180 	SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
10181 	SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10182 	SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10183 	SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
10184 	SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
10185 	SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10186 	SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10187 	SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10188 	SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10189 	SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10190 	SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10191 	SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10192 	SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10193 	SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10194 	SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10195 	SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10196 	SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10197 	SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10198 	SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10199 	SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10200 	SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10201 	SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
10202 	SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10203 	SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10204 	SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10205 	SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10206 	SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10207 	SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10208 	SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10209 	SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10210 	SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10211 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10212 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10213 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
10214 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
10215 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
10216 	SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10217 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10218 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10219 	SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10220 	SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
10221 	SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10222 	SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10223 	SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10224 	SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10225 	SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10226 	SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10227 	SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10228 	SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10229 	SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10230 	SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10231 	SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10232 	SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10233 	SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10234 	SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
10235 	SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
10236 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10237 	SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10238 	SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10239 	SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10240 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10241 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10242 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10243 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10244 	SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
10245 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10246 	SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10247 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10248 	SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
10249 	SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10250 	SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10251 	SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10252 	SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10253 	SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10254 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10255 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10256 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10257 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10258 	SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10259 	SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10260 	SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10261 	SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10262 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10263 	SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
10264 	SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10265 	SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10266 	SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10267 	SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10268 	SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10269 	SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10270 	SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
10271 	SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10272 	SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10273 	SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10274 	SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10275 	SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
10276 	SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
10277 	SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
10278 	SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10279 	SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10280 	SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10281 	SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10282 	SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10283 	SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10284 	SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10285 	SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10286 	SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
10287 	SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
10288 	SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
10289 	SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10290 	SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
10291 	SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10292 	SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10293 	SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10294 	SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10295 	SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
10296 	SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10297 	SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10298 	SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
10299 	SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10300 	SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10301 	SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
10302 	SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
10303 	SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
10304 	SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10305 	SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10306 	SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10307 	SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
10308 	SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10309 	SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
10310 	SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
10311 	SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10312 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10313 	SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10314 		      ALC285_FIXUP_HP_GPIO_AMP_INIT),
10315 	SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10316 	SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10317 	SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
10318 	SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10319 	SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
10320 	SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10321 	SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10322 	SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10323 	SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10324 	SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10325 	SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10326 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
10327 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10328 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
10329 	SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10330 	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10331 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10332 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10333 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10334 	SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10335 	SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10336 	SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10337 	SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10338 	SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10339 	SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
10340 	SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10341 	SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10342 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10343 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10344 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
10345 	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10346 	SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10347 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
10348 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
10349 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
10350 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10351 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
10352 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
10353 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10354 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
10355 	SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10356 	SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10357 	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10358 	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10359 	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10360 	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10361 	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10362 	SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
10363 	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10364 	SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10365 	SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10366 	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10367 	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
10368 	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10369 	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
10370 	SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10371 	SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
10372 	SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
10373 	SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10374 	SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
10375 	SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10376 	SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10377 	SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10378 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10379 	SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10380 	SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10381 	SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
10382 	SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10383 	SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10384 	SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
10385 	SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10386 	SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10387 	SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10388 	SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10389 	SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10390 	SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10391 	SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10392 	SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10393 	SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
10394 	SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
10395 	SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10396 	SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10397 	SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10398 	SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10399 	SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
10400 	SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
10401 	SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10402 	SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10403 	SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10404 	SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10405 	SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10406 	SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
10407 	SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10408 	SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
10409 	SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10410 	SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10411 	SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10412 	SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10413 	SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10414 	SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10415 	SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10416 	SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10417 	SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10418 	SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10419 	SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10420 	SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10421 	SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10422 	SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10423 	SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10424 	SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
10425 	SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10426 	SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10427 	SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
10428 	SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10429 	SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10430 	SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
10431 	SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10432 	SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10433 	SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10434 	SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10435 	SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10436 	SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10437 	SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10438 	SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10439 	SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10440 	SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10441 	SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10442 	SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10443 	SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10444 	SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10445 	SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10446 	SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10447 	SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10448 	SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10449 	SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
10450 	SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
10451 	SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10452 	SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10453 	SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10454 	SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
10455 	SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10456 	SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10457 	SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10458 	SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10459 	SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10460 	SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10461 	SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10462 	SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10463 	SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10464 	SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC285_FIXUP_HP_GPIO_LED),
10465 	SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC285_FIXUP_HP_GPIO_LED),
10466 	SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10467 	SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10468 	SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10469 	SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10470 	SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10471 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10472 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10473 	SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10474 	SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10475 	SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10476 	SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10477 	SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10478 	SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10479 	SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10480 	SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10481 	SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10482 	SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10483 	SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
10484 	SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
10485 	SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10486 	SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10487 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10488 	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10489 	SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10490 	SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10491 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10492 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10493 	SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
10494 	SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10495 	SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10496 	SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10497 	SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10498 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10499 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10500 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
10501 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10502 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
10503 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
10504 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10505 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
10506 	SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10507 	SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10508 	SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10509 	SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10510 	SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10511 	SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10512 	SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
10513 	SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10514 	SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
10515 	SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
10516 	SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
10517 	SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
10518 	SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
10519 	SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10520 	SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10521 	SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10522 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10523 	SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10524 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10525 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
10526 	SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
10527 	SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
10528 	SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10529 	SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
10530 	SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
10531 	SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
10532 	SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
10533 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
10534 	SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10535 	SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
10536 	SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
10537 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
10538 	SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
10539 	SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
10540 	SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
10541 	SND_PCI_QUIRK(0x1043, 0x1eb3, "ROG Ally X RC72LA", ALC294_FIXUP_ASUS_ALLY_X),
10542 	SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
10543 	SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
10544 	SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
10545 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
10546 	SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
10547 	SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
10548 	SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
10549 	SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
10550 	SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
10551 	SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
10552 	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
10553 	SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
10554 	SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
10555 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
10556 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
10557 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
10558 	SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
10559 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10560 	SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
10561 	SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
10562 	SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10563 	SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10564 	SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
10565 	SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
10566 	SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
10567 	SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
10568 	SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10569 	SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10570 	SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
10571 	SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10572 	SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10573 	SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10574 	SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
10575 	SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
10576 	SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
10577 	SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
10578 	SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10579 	SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
10580 	SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
10581 	SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
10582 	SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
10583 	SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
10584 	SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
10585 	SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
10586 	SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
10587 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
10588 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10589 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
10590 	SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
10591 	SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
10592 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
10593 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
10594 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10595 	SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10596 	SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10597 	SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10598 	SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
10599 	SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10600 	SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10601 	SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10602 	SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10603 	SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
10604 	SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10605 	SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10606 	SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10607 	SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
10608 	SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10609 	SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10610 	SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
10611 	SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
10612 	SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10613 	SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
10614 	SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
10615 	SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
10616 	SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
10617 	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
10618 	SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10619 	SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10620 	SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10621 	SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10622 	SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10623 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10624 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10625 	SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10626 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
10627 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
10628 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10629 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10630 	SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10631 	SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10632 	SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
10633 	SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10634 	SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
10635 	SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
10636 	SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10637 	SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
10638 	SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
10639 	SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
10640 	SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
10641 	SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
10642 	SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
10643 	SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10644 	SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10645 	SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10646 	SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10647 	SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
10648 	SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
10649 	SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
10650 	SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
10651 	SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10652 	SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10653 	SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10654 	SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10655 	SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10656 	SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10657 	SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10658 	SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10659 	SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10660 	SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10661 	SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10662 	SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10663 	SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10664 	SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10665 	SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10666 	SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10667 	SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10668 	SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10669 	SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10670 	SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10671 	SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10672 	SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10673 	SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10674 	SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10675 	SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10676 	SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10677 	SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10678 	SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10679 	SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10680 	SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10681 	SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10682 	SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10683 	SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10684 	SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10685 	SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10686 	SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10687 	SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10688 	SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10689 	SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10690 	SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10691 	SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10692 	SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10693 	SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10694 	SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10695 	SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10696 	SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10697 	SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10698 	SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10699 	SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10700 	SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10701 	SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10702 	SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10703 	SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10704 	SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10705 	SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
10706 	SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10707 	SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10708 	SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10709 	SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10710 	SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10711 	SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
10712 	SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10713 	SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10714 	SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10715 	SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10716 	SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10717 	SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10718 	SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10719 	SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10720 	SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE),
10721 	SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10722 	SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10723 	SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10724 	SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC),
10725 	SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
10726 	SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10727 	SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10728 	SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10729 	SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10730 	SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10731 	SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10732 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
10733 	SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10734 	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10735 	SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10736 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10737 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10738 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
10739 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
10740 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
10741 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
10742 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
10743 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
10744 	SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
10745 	SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
10746 	SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
10747 	SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
10748 	SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
10749 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
10750 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
10751 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10752 	SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
10753 	SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
10754 	SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
10755 	SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10756 	SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10757 	SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
10758 	SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
10759 	SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
10760 	SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10761 	SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10762 	SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10763 	SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
10764 	SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10765 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10766 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10767 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10768 	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10769 	SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
10770 	SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10771 	SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10772 	SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10773 	SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10774 	SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10775 	SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10776 	SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10777 	SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10778 	SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10779 	SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10780 	SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10781 	SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10782 	SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C),
10783 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10784 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
10785 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10786 	SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10787 	SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10788 	SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10789 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
10790 	SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10791 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10792 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10793 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
10794 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
10795 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10796 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
10797 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10798 	SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
10799 	SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
10800 	SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330 / Yoga Duet 7", ALC287_FIXUP_LENOVO_SSID_17AA3820),
10801 	SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10802 	SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
10803 	SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10804 	SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
10805 	SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
10806 	SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
10807 	SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10808 	SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10809 	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10810 	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
10811 	SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10812 	SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
10813 	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10814 	SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7 / Yoga Pro 7 14ARP8",  ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7),
10815 	SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7),
10816 	SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
10817 	SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10818 	SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10819 	SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10820 	SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
10821 	SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
10822 	SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10823 	SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10824 	SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10825 	SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
10826 	SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10827 	SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
10828 	SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10829 	SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10830 	SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10831 	SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10832 	SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10833 	SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10834 	SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10835 	SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10836 	SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10837 	SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10838 	SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10839 	SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10840 	SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
10841 	SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10842 	SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10843 	SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10844 	SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10845 	SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10846 	SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
10847 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10848 	SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
10849 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
10850 	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
10851 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
10852 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10853 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
10854 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
10855 	SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10856 	SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
10857 	SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
10858 	SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
10859 	SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
10860 	SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
10861 	SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
10862 	SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
10863 	SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
10864 	SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10865 	SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10866 	SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10867 	SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
10868 	SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10869 	SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10870 	SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10871 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
10872 	SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10873 	SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
10874 	SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
10875 	SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10876 	SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10877 	SND_PCI_QUIRK(0x1854, 0x0488, "LG gram 16 (16Z90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10878 	SND_PCI_QUIRK(0x1854, 0x048a, "LG gram 17 (17ZD90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
10879 	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
10880 	SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10881 	SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10882 	SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10883 	SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
10884 	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
10885 	SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10886 	SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
10887 	SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10888 	SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
10889 	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
10890 	SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10891 	SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10892 	SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10893 	SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10894 	SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10895 	SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10896 	SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10897 	SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
10898 	SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
10899 	SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
10900 	SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10901 	SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
10902 	SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
10903 	SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
10904 	SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
10905 	SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
10906 	SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
10907 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
10908 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
10909 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
10910 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
10911 	SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
10912 	SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10913 	SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10914 	SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
10915 
10916 #if 0
10917 	/* Below is a quirk table taken from the old code.
10918 	 * Basically the device should work as is without the fixup table.
10919 	 * If BIOS doesn't give a proper info, enable the corresponding
10920 	 * fixup entry.
10921 	 */
10922 	SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10923 		      ALC269_FIXUP_AMIC),
10924 	SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
10925 	SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10926 	SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10927 	SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10928 	SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10929 	SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10930 	SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10931 	SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10932 	SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10933 	SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10934 	SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10935 	SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10936 	SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10937 	SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10938 	SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10939 	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10940 	SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10941 	SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10942 	SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10943 	SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10944 	SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10945 	SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10946 	SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10947 	SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10948 	SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10949 	SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10950 	SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10951 	SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10952 	SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10953 	SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10954 	SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10955 	SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10956 	SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10957 	SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10958 	SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10959 	SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10960 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10961 	SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10962 	SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10963 #endif
10964 	{}
10965 };
10966 
10967 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10968 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10969 	SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10970 	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10971 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
10972 	SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
10973 	{}
10974 };
10975 
10976 static const struct hda_model_fixup alc269_fixup_models[] = {
10977 	{.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10978 	{.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
10979 	{.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10980 	{.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10981 	{.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
10982 	{.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
10983 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10984 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
10985 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
10986 	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
10987 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10988 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
10989 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10990 	{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
10991 	{.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10992 	{.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
10993 	{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
10994 	{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
10995 	{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
10996 	{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
10997 	{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
10998 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
10999 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
11000 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11001 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
11002 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
11003 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
11004 	{.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
11005 	{.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
11006 	{.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
11007 	{.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
11008 	{.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
11009 	{.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
11010 	{.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
11011 	{.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
11012 	{.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
11013 	{.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
11014 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
11015 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
11016 	{.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
11017 	{.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
11018 	{.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
11019 	{.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
11020 	{.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
11021 	{.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
11022 	{.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
11023 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
11024 	{.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
11025 	{.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
11026 	{.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
11027 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
11028 	{.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
11029 	{.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
11030 	{.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
11031 	{.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
11032 	{.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
11033 	{.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
11034 	{.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
11035 	{.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
11036 	{.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
11037 	{.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
11038 	{.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
11039 	{.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
11040 	{.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
11041 	{.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
11042 	{.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
11043 	{.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
11044 	{.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
11045 	{.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
11046 	{.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
11047 	{.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
11048 	{.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
11049 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
11050 	{.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
11051 	{.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
11052 	{.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
11053 	{.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
11054 	{.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
11055 	{.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
11056 	{.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
11057 	{.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
11058 	{.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
11059 	{.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
11060 	{.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
11061 	{.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
11062 	{.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
11063 	{.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
11064 	{.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
11065 	{.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
11066 	{.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
11067 	{.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
11068 	{.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
11069 	{.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
11070 	{.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
11071 	{.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
11072 	{.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
11073 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
11074 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
11075 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
11076 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
11077 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
11078 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
11079 	{.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
11080 	{.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
11081 	{.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
11082 	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
11083 	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
11084 	{.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"},
11085 	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
11086 	{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
11087 	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
11088 	{.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
11089 	{.id = ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, .name = "alc298-samsung-amp-v2-2-amps"},
11090 	{.id = ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, .name = "alc298-samsung-amp-v2-4-amps"},
11091 	{.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
11092 	{.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
11093 	{.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
11094 	{.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
11095 	{.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
11096 	{.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
11097 	{.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
11098 	{.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
11099 	{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
11100 	{.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
11101 	{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
11102 	{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
11103 	{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
11104 	{.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
11105 	{}
11106 };
11107 #define ALC225_STANDARD_PINS \
11108 	{0x21, 0x04211020}
11109 
11110 #define ALC256_STANDARD_PINS \
11111 	{0x12, 0x90a60140}, \
11112 	{0x14, 0x90170110}, \
11113 	{0x21, 0x02211020}
11114 
11115 #define ALC282_STANDARD_PINS \
11116 	{0x14, 0x90170110}
11117 
11118 #define ALC290_STANDARD_PINS \
11119 	{0x12, 0x99a30130}
11120 
11121 #define ALC292_STANDARD_PINS \
11122 	{0x14, 0x90170110}, \
11123 	{0x15, 0x0221401f}
11124 
11125 #define ALC295_STANDARD_PINS \
11126 	{0x12, 0xb7a60130}, \
11127 	{0x14, 0x90170110}, \
11128 	{0x21, 0x04211020}
11129 
11130 #define ALC298_STANDARD_PINS \
11131 	{0x12, 0x90a60130}, \
11132 	{0x21, 0x03211020}
11133 
11134 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
11135 	SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
11136 		{0x14, 0x01014020},
11137 		{0x17, 0x90170110},
11138 		{0x18, 0x02a11030},
11139 		{0x19, 0x0181303F},
11140 		{0x21, 0x0221102f}),
11141 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
11142 		{0x12, 0x90a601c0},
11143 		{0x14, 0x90171120},
11144 		{0x21, 0x02211030}),
11145 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11146 		{0x14, 0x90170110},
11147 		{0x1b, 0x90a70130},
11148 		{0x21, 0x03211020}),
11149 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11150 		{0x1a, 0x90a70130},
11151 		{0x1b, 0x90170110},
11152 		{0x21, 0x03211020}),
11153 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11154 		ALC225_STANDARD_PINS,
11155 		{0x12, 0xb7a60130},
11156 		{0x14, 0x901701a0}),
11157 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11158 		ALC225_STANDARD_PINS,
11159 		{0x12, 0xb7a60130},
11160 		{0x14, 0x901701b0}),
11161 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11162 		ALC225_STANDARD_PINS,
11163 		{0x12, 0xb7a60150},
11164 		{0x14, 0x901701a0}),
11165 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11166 		ALC225_STANDARD_PINS,
11167 		{0x12, 0xb7a60150},
11168 		{0x14, 0x901701b0}),
11169 	SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11170 		ALC225_STANDARD_PINS,
11171 		{0x12, 0xb7a60130},
11172 		{0x1b, 0x90170110}),
11173 	SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11174 		{0x1b, 0x01111010},
11175 		{0x1e, 0x01451130},
11176 		{0x21, 0x02211020}),
11177 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
11178 		{0x12, 0x90a60140},
11179 		{0x14, 0x90170110},
11180 		{0x19, 0x02a11030},
11181 		{0x21, 0x02211020}),
11182 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11183 		{0x14, 0x90170110},
11184 		{0x19, 0x02a11030},
11185 		{0x1a, 0x02a11040},
11186 		{0x1b, 0x01014020},
11187 		{0x21, 0x0221101f}),
11188 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11189 		{0x14, 0x90170110},
11190 		{0x19, 0x02a11030},
11191 		{0x1a, 0x02a11040},
11192 		{0x1b, 0x01011020},
11193 		{0x21, 0x0221101f}),
11194 	SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11195 		{0x14, 0x90170110},
11196 		{0x19, 0x02a11020},
11197 		{0x1a, 0x02a11030},
11198 		{0x21, 0x0221101f}),
11199 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
11200 		{0x21, 0x02211010}),
11201 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11202 		{0x14, 0x90170110},
11203 		{0x19, 0x02a11020},
11204 		{0x21, 0x02211030}),
11205 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
11206 		{0x14, 0x90170110},
11207 		{0x21, 0x02211020}),
11208 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11209 		{0x14, 0x90170130},
11210 		{0x21, 0x02211040}),
11211 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11212 		{0x12, 0x90a60140},
11213 		{0x14, 0x90170110},
11214 		{0x21, 0x02211020}),
11215 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11216 		{0x12, 0x90a60160},
11217 		{0x14, 0x90170120},
11218 		{0x21, 0x02211030}),
11219 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11220 		{0x14, 0x90170110},
11221 		{0x1b, 0x02011020},
11222 		{0x21, 0x0221101f}),
11223 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11224 		{0x14, 0x90170110},
11225 		{0x1b, 0x01011020},
11226 		{0x21, 0x0221101f}),
11227 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11228 		{0x14, 0x90170130},
11229 		{0x1b, 0x01014020},
11230 		{0x21, 0x0221103f}),
11231 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11232 		{0x14, 0x90170130},
11233 		{0x1b, 0x01011020},
11234 		{0x21, 0x0221103f}),
11235 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11236 		{0x14, 0x90170130},
11237 		{0x1b, 0x02011020},
11238 		{0x21, 0x0221103f}),
11239 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11240 		{0x14, 0x90170150},
11241 		{0x1b, 0x02011020},
11242 		{0x21, 0x0221105f}),
11243 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11244 		{0x14, 0x90170110},
11245 		{0x1b, 0x01014020},
11246 		{0x21, 0x0221101f}),
11247 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11248 		{0x12, 0x90a60160},
11249 		{0x14, 0x90170120},
11250 		{0x17, 0x90170140},
11251 		{0x21, 0x0321102f}),
11252 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11253 		{0x12, 0x90a60160},
11254 		{0x14, 0x90170130},
11255 		{0x21, 0x02211040}),
11256 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11257 		{0x12, 0x90a60160},
11258 		{0x14, 0x90170140},
11259 		{0x21, 0x02211050}),
11260 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11261 		{0x12, 0x90a60170},
11262 		{0x14, 0x90170120},
11263 		{0x21, 0x02211030}),
11264 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11265 		{0x12, 0x90a60170},
11266 		{0x14, 0x90170130},
11267 		{0x21, 0x02211040}),
11268 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11269 		{0x12, 0x90a60170},
11270 		{0x14, 0x90171130},
11271 		{0x21, 0x02211040}),
11272 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11273 		{0x12, 0x90a60170},
11274 		{0x14, 0x90170140},
11275 		{0x21, 0x02211050}),
11276 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11277 		{0x12, 0x90a60180},
11278 		{0x14, 0x90170130},
11279 		{0x21, 0x02211040}),
11280 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11281 		{0x12, 0x90a60180},
11282 		{0x14, 0x90170120},
11283 		{0x21, 0x02211030}),
11284 	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11285 		{0x1b, 0x01011020},
11286 		{0x21, 0x02211010}),
11287 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11288 		{0x14, 0x90170110},
11289 		{0x1b, 0x90a70130},
11290 		{0x21, 0x04211020}),
11291 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11292 		{0x14, 0x90170110},
11293 		{0x1b, 0x90a70130},
11294 		{0x21, 0x03211020}),
11295 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11296 		{0x12, 0x90a60130},
11297 		{0x14, 0x90170110},
11298 		{0x21, 0x03211020}),
11299 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11300 		{0x12, 0x90a60130},
11301 		{0x14, 0x90170110},
11302 		{0x21, 0x04211020}),
11303 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11304 		{0x1a, 0x90a70130},
11305 		{0x1b, 0x90170110},
11306 		{0x21, 0x03211020}),
11307        SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11308 		{0x14, 0x90170110},
11309 		{0x19, 0x02a11020},
11310 		{0x21, 0x0221101f}),
11311        SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
11312 		{0x17, 0x90170110},
11313 		{0x19, 0x03a11030},
11314 		{0x21, 0x03211020}),
11315 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
11316 		{0x12, 0x90a60130},
11317 		{0x14, 0x90170110},
11318 		{0x15, 0x0421101f},
11319 		{0x1a, 0x04a11020}),
11320 	SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
11321 		{0x12, 0x90a60140},
11322 		{0x14, 0x90170110},
11323 		{0x15, 0x0421101f},
11324 		{0x18, 0x02811030},
11325 		{0x1a, 0x04a1103f},
11326 		{0x1b, 0x02011020}),
11327 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11328 		ALC282_STANDARD_PINS,
11329 		{0x12, 0x99a30130},
11330 		{0x19, 0x03a11020},
11331 		{0x21, 0x0321101f}),
11332 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11333 		ALC282_STANDARD_PINS,
11334 		{0x12, 0x99a30130},
11335 		{0x19, 0x03a11020},
11336 		{0x21, 0x03211040}),
11337 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11338 		ALC282_STANDARD_PINS,
11339 		{0x12, 0x99a30130},
11340 		{0x19, 0x03a11030},
11341 		{0x21, 0x03211020}),
11342 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11343 		ALC282_STANDARD_PINS,
11344 		{0x12, 0x99a30130},
11345 		{0x19, 0x04a11020},
11346 		{0x21, 0x0421101f}),
11347 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
11348 		ALC282_STANDARD_PINS,
11349 		{0x12, 0x90a60140},
11350 		{0x19, 0x04a11030},
11351 		{0x21, 0x04211020}),
11352 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11353 		ALC282_STANDARD_PINS,
11354 		{0x12, 0x90a609c0},
11355 		{0x18, 0x03a11830},
11356 		{0x19, 0x04a19831},
11357 		{0x1a, 0x0481303f},
11358 		{0x1b, 0x04211020},
11359 		{0x21, 0x0321101f}),
11360 	SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11361 		ALC282_STANDARD_PINS,
11362 		{0x12, 0x90a60940},
11363 		{0x18, 0x03a11830},
11364 		{0x19, 0x04a19831},
11365 		{0x1a, 0x0481303f},
11366 		{0x1b, 0x04211020},
11367 		{0x21, 0x0321101f}),
11368 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11369 		ALC282_STANDARD_PINS,
11370 		{0x12, 0x90a60130},
11371 		{0x21, 0x0321101f}),
11372 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11373 		{0x12, 0x90a60160},
11374 		{0x14, 0x90170120},
11375 		{0x21, 0x02211030}),
11376 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11377 		ALC282_STANDARD_PINS,
11378 		{0x12, 0x90a60130},
11379 		{0x19, 0x03a11020},
11380 		{0x21, 0x0321101f}),
11381 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11382 		{0x12, 0x90a60130},
11383 		{0x14, 0x90170110},
11384 		{0x19, 0x04a11040},
11385 		{0x21, 0x04211020}),
11386 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11387 		{0x14, 0x90170110},
11388 		{0x19, 0x04a11040},
11389 		{0x1d, 0x40600001},
11390 		{0x21, 0x04211020}),
11391 	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
11392 		{0x14, 0x90170110},
11393 		{0x19, 0x04a11040},
11394 		{0x21, 0x04211020}),
11395 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11396 		{0x14, 0x90170110},
11397 		{0x17, 0x90170111},
11398 		{0x19, 0x03a11030},
11399 		{0x21, 0x03211020}),
11400 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11401 		{0x17, 0x90170110},
11402 		{0x19, 0x03a11030},
11403 		{0x21, 0x03211020}),
11404 	SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11405 		{0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11406 		{0x19, 0x04a11040},
11407 		{0x21, 0x04211020}),
11408 	SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11409 		{0x12, 0x90a60130},
11410 		{0x17, 0x90170110},
11411 		{0x21, 0x02211020}),
11412 	SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
11413 		{0x12, 0x90a60120},
11414 		{0x14, 0x90170110},
11415 		{0x21, 0x0321101f}),
11416 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11417 		ALC290_STANDARD_PINS,
11418 		{0x15, 0x04211040},
11419 		{0x18, 0x90170112},
11420 		{0x1a, 0x04a11020}),
11421 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11422 		ALC290_STANDARD_PINS,
11423 		{0x15, 0x04211040},
11424 		{0x18, 0x90170110},
11425 		{0x1a, 0x04a11020}),
11426 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11427 		ALC290_STANDARD_PINS,
11428 		{0x15, 0x0421101f},
11429 		{0x1a, 0x04a11020}),
11430 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11431 		ALC290_STANDARD_PINS,
11432 		{0x15, 0x04211020},
11433 		{0x1a, 0x04a11040}),
11434 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11435 		ALC290_STANDARD_PINS,
11436 		{0x14, 0x90170110},
11437 		{0x15, 0x04211020},
11438 		{0x1a, 0x04a11040}),
11439 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11440 		ALC290_STANDARD_PINS,
11441 		{0x14, 0x90170110},
11442 		{0x15, 0x04211020},
11443 		{0x1a, 0x04a11020}),
11444 	SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
11445 		ALC290_STANDARD_PINS,
11446 		{0x14, 0x90170110},
11447 		{0x15, 0x0421101f},
11448 		{0x1a, 0x04a11020}),
11449 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11450 		ALC292_STANDARD_PINS,
11451 		{0x12, 0x90a60140},
11452 		{0x16, 0x01014020},
11453 		{0x19, 0x01a19030}),
11454 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
11455 		ALC292_STANDARD_PINS,
11456 		{0x12, 0x90a60140},
11457 		{0x16, 0x01014020},
11458 		{0x18, 0x02a19031},
11459 		{0x19, 0x01a1903e}),
11460 	SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
11461 		ALC292_STANDARD_PINS,
11462 		{0x12, 0x90a60140}),
11463 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11464 		ALC292_STANDARD_PINS,
11465 		{0x13, 0x90a60140},
11466 		{0x16, 0x21014020},
11467 		{0x19, 0x21a19030}),
11468 	SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
11469 		ALC292_STANDARD_PINS,
11470 		{0x13, 0x90a60140}),
11471 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
11472 		{0x17, 0x90170110},
11473 		{0x21, 0x04211020}),
11474 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
11475 		{0x14, 0x90170110},
11476 		{0x1b, 0x90a70130},
11477 		{0x21, 0x04211020}),
11478 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11479 		{0x12, 0x90a60130},
11480 		{0x17, 0x90170110},
11481 		{0x21, 0x03211020}),
11482 	SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11483 		{0x12, 0x90a60130},
11484 		{0x17, 0x90170110},
11485 		{0x21, 0x04211020}),
11486 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11487 		{0x12, 0x90a60130},
11488 		{0x17, 0x90170110},
11489 		{0x21, 0x03211020}),
11490 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11491 		{0x12, 0x90a60120},
11492 		{0x17, 0x90170110},
11493 		{0x21, 0x04211030}),
11494 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11495 		{0x12, 0x90a60130},
11496 		{0x17, 0x90170110},
11497 		{0x21, 0x03211020}),
11498 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11499 		{0x12, 0x90a60130},
11500 		{0x17, 0x90170110},
11501 		{0x21, 0x03211020}),
11502 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11503 		ALC298_STANDARD_PINS,
11504 		{0x17, 0x90170110}),
11505 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11506 		ALC298_STANDARD_PINS,
11507 		{0x17, 0x90170140}),
11508 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11509 		ALC298_STANDARD_PINS,
11510 		{0x17, 0x90170150}),
11511 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
11512 		{0x12, 0xb7a60140},
11513 		{0x13, 0xb7a60150},
11514 		{0x17, 0x90170110},
11515 		{0x1a, 0x03011020},
11516 		{0x21, 0x03211030}),
11517 	SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
11518 		{0x12, 0xb7a60140},
11519 		{0x17, 0x90170110},
11520 		{0x1a, 0x03a11030},
11521 		{0x21, 0x03211020}),
11522 	SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11523 		ALC225_STANDARD_PINS,
11524 		{0x12, 0xb7a60130},
11525 		{0x17, 0x90170110}),
11526 	SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
11527 		{0x14, 0x01014010},
11528 		{0x17, 0x90170120},
11529 		{0x18, 0x02a11030},
11530 		{0x19, 0x02a1103f},
11531 		{0x21, 0x0221101f}),
11532 	{}
11533 };
11534 
11535 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
11536  * more machines, don't need to match all valid pins, just need to match
11537  * all the pins defined in the tbl. Just because of this reason, it is possible
11538  * that a single machine matches multiple tbls, so there is one limitation:
11539  *   at most one tbl is allowed to define for the same vendor and same codec
11540  */
11541 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
11542 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
11543 		{0x19, 0x40000000}),
11544 	SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11545 		{0x19, 0x40000000},
11546 		{0x1b, 0x40000000}),
11547 	SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11548 		{0x19, 0x40000000},
11549 		{0x1b, 0x40000000}),
11550 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11551 		{0x19, 0x40000000},
11552 		{0x1a, 0x40000000}),
11553 	SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11554 		{0x19, 0x40000000},
11555 		{0x1a, 0x40000000}),
11556 	SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11557 		{0x19, 0x40000000},
11558 		{0x1a, 0x40000000}),
11559 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11560 		{0x19, 0x40000000}),
11561 	{}
11562 };
11563 
11564 static void alc269_fill_coef(struct hda_codec *codec)
11565 {
11566 	struct alc_spec *spec = codec->spec;
11567 	int val;
11568 
11569 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
11570 		return;
11571 
11572 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
11573 		alc_write_coef_idx(codec, 0xf, 0x960b);
11574 		alc_write_coef_idx(codec, 0xe, 0x8817);
11575 	}
11576 
11577 	if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
11578 		alc_write_coef_idx(codec, 0xf, 0x960b);
11579 		alc_write_coef_idx(codec, 0xe, 0x8814);
11580 	}
11581 
11582 	if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
11583 		/* Power up output pin */
11584 		alc_update_coef_idx(codec, 0x04, 0, 1<<11);
11585 	}
11586 
11587 	if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
11588 		val = alc_read_coef_idx(codec, 0xd);
11589 		if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
11590 			/* Capless ramp up clock control */
11591 			alc_write_coef_idx(codec, 0xd, val | (1<<10));
11592 		}
11593 		val = alc_read_coef_idx(codec, 0x17);
11594 		if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
11595 			/* Class D power on reset */
11596 			alc_write_coef_idx(codec, 0x17, val | (1<<7));
11597 		}
11598 	}
11599 
11600 	/* HP */
11601 	alc_update_coef_idx(codec, 0x4, 0, 1<<11);
11602 }
11603 
11604 /*
11605  */
11606 static int patch_alc269(struct hda_codec *codec)
11607 {
11608 	struct alc_spec *spec;
11609 	int err;
11610 
11611 	err = alc_alloc_spec(codec, 0x0b);
11612 	if (err < 0)
11613 		return err;
11614 
11615 	spec = codec->spec;
11616 	spec->gen.shared_mic_vref_pin = 0x18;
11617 	codec->power_save_node = 0;
11618 	spec->en_3kpull_low = true;
11619 
11620 	codec->patch_ops.suspend = alc269_suspend;
11621 	codec->patch_ops.resume = alc269_resume;
11622 	spec->shutup = alc_default_shutup;
11623 	spec->init_hook = alc_default_init;
11624 
11625 	switch (codec->core.vendor_id) {
11626 	case 0x10ec0269:
11627 		spec->codec_variant = ALC269_TYPE_ALC269VA;
11628 		switch (alc_get_coef0(codec) & 0x00f0) {
11629 		case 0x0010:
11630 			if (codec->bus->pci &&
11631 			    codec->bus->pci->subsystem_vendor == 0x1025 &&
11632 			    spec->cdefine.platform_type == 1)
11633 				err = alc_codec_rename(codec, "ALC271X");
11634 			spec->codec_variant = ALC269_TYPE_ALC269VB;
11635 			break;
11636 		case 0x0020:
11637 			if (codec->bus->pci &&
11638 			    codec->bus->pci->subsystem_vendor == 0x17aa &&
11639 			    codec->bus->pci->subsystem_device == 0x21f3)
11640 				err = alc_codec_rename(codec, "ALC3202");
11641 			spec->codec_variant = ALC269_TYPE_ALC269VC;
11642 			break;
11643 		case 0x0030:
11644 			spec->codec_variant = ALC269_TYPE_ALC269VD;
11645 			break;
11646 		default:
11647 			alc_fix_pll_init(codec, 0x20, 0x04, 15);
11648 		}
11649 		if (err < 0)
11650 			goto error;
11651 		spec->shutup = alc269_shutup;
11652 		spec->init_hook = alc269_fill_coef;
11653 		alc269_fill_coef(codec);
11654 		break;
11655 
11656 	case 0x10ec0280:
11657 	case 0x10ec0290:
11658 		spec->codec_variant = ALC269_TYPE_ALC280;
11659 		break;
11660 	case 0x10ec0282:
11661 		spec->codec_variant = ALC269_TYPE_ALC282;
11662 		spec->shutup = alc282_shutup;
11663 		spec->init_hook = alc282_init;
11664 		break;
11665 	case 0x10ec0233:
11666 	case 0x10ec0283:
11667 		spec->codec_variant = ALC269_TYPE_ALC283;
11668 		spec->shutup = alc283_shutup;
11669 		spec->init_hook = alc283_init;
11670 		break;
11671 	case 0x10ec0284:
11672 	case 0x10ec0292:
11673 		spec->codec_variant = ALC269_TYPE_ALC284;
11674 		break;
11675 	case 0x10ec0293:
11676 		spec->codec_variant = ALC269_TYPE_ALC293;
11677 		break;
11678 	case 0x10ec0286:
11679 	case 0x10ec0288:
11680 		spec->codec_variant = ALC269_TYPE_ALC286;
11681 		break;
11682 	case 0x10ec0298:
11683 		spec->codec_variant = ALC269_TYPE_ALC298;
11684 		break;
11685 	case 0x10ec0235:
11686 	case 0x10ec0255:
11687 		spec->codec_variant = ALC269_TYPE_ALC255;
11688 		spec->shutup = alc256_shutup;
11689 		spec->init_hook = alc256_init;
11690 		break;
11691 	case 0x10ec0230:
11692 	case 0x10ec0236:
11693 	case 0x10ec0256:
11694 	case 0x19e58326:
11695 		spec->codec_variant = ALC269_TYPE_ALC256;
11696 		spec->shutup = alc256_shutup;
11697 		spec->init_hook = alc256_init;
11698 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
11699 		if (codec->core.vendor_id == 0x10ec0236 &&
11700 		    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11701 			spec->en_3kpull_low = false;
11702 		break;
11703 	case 0x10ec0257:
11704 		spec->codec_variant = ALC269_TYPE_ALC257;
11705 		spec->shutup = alc256_shutup;
11706 		spec->init_hook = alc256_init;
11707 		spec->gen.mixer_nid = 0;
11708 		spec->en_3kpull_low = false;
11709 		break;
11710 	case 0x10ec0215:
11711 	case 0x10ec0245:
11712 	case 0x10ec0285:
11713 	case 0x10ec0289:
11714 		if (alc_get_coef0(codec) & 0x0010)
11715 			spec->codec_variant = ALC269_TYPE_ALC245;
11716 		else
11717 			spec->codec_variant = ALC269_TYPE_ALC215;
11718 		spec->shutup = alc225_shutup;
11719 		spec->init_hook = alc225_init;
11720 		spec->gen.mixer_nid = 0;
11721 		break;
11722 	case 0x10ec0225:
11723 	case 0x10ec0295:
11724 	case 0x10ec0299:
11725 		spec->codec_variant = ALC269_TYPE_ALC225;
11726 		spec->shutup = alc225_shutup;
11727 		spec->init_hook = alc225_init;
11728 		spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
11729 		break;
11730 	case 0x10ec0287:
11731 		spec->codec_variant = ALC269_TYPE_ALC287;
11732 		spec->shutup = alc225_shutup;
11733 		spec->init_hook = alc225_init;
11734 		spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11735 		break;
11736 	case 0x10ec0234:
11737 	case 0x10ec0274:
11738 	case 0x10ec0294:
11739 		spec->codec_variant = ALC269_TYPE_ALC294;
11740 		spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
11741 		alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
11742 		spec->init_hook = alc294_init;
11743 		break;
11744 	case 0x10ec0300:
11745 		spec->codec_variant = ALC269_TYPE_ALC300;
11746 		spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
11747 		break;
11748 	case 0x10ec0623:
11749 		spec->codec_variant = ALC269_TYPE_ALC623;
11750 		break;
11751 	case 0x10ec0700:
11752 	case 0x10ec0701:
11753 	case 0x10ec0703:
11754 	case 0x10ec0711:
11755 		spec->codec_variant = ALC269_TYPE_ALC700;
11756 		spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
11757 		alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
11758 		spec->init_hook = alc294_init;
11759 		break;
11760 
11761 	}
11762 
11763 	if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
11764 		spec->has_alc5505_dsp = 1;
11765 		spec->init_hook = alc5505_dsp_init;
11766 	}
11767 
11768 	alc_pre_init(codec);
11769 
11770 	snd_hda_pick_fixup(codec, alc269_fixup_models,
11771 		       alc269_fixup_tbl, alc269_fixups);
11772 	/* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11773 	 * the quirk breaks the latter (bko#214101).
11774 	 * Clear the wrong entry.
11775 	 */
11776 	if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11777 	    codec->core.vendor_id == 0x10ec0294) {
11778 		codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11779 		codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11780 	}
11781 
11782 	snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
11783 	snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
11784 	snd_hda_pick_fixup(codec, NULL,	alc269_fixup_vendor_tbl,
11785 			   alc269_fixups);
11786 
11787 	/*
11788 	 * Check whether ACPI describes companion amplifiers that require
11789 	 * component binding
11790 	 */
11791 	find_cirrus_companion_amps(codec);
11792 
11793 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11794 
11795 	alc_auto_parse_customize_define(codec);
11796 
11797 	if (has_cdefine_beep(codec))
11798 		spec->gen.beep_nid = 0x01;
11799 
11800 	/* automatic parse from the BIOS config */
11801 	err = alc269_parse_auto_config(codec);
11802 	if (err < 0)
11803 		goto error;
11804 
11805 	if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11806 		err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11807 		if (err < 0)
11808 			goto error;
11809 	}
11810 
11811 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11812 
11813 	return 0;
11814 
11815  error:
11816 	alc_free(codec);
11817 	return err;
11818 }
11819 
11820 /*
11821  * ALC861
11822  */
11823 
11824 static int alc861_parse_auto_config(struct hda_codec *codec)
11825 {
11826 	static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
11827 	static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11828 	return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
11829 }
11830 
11831 /* Pin config fixes */
11832 enum {
11833 	ALC861_FIXUP_FSC_AMILO_PI1505,
11834 	ALC861_FIXUP_AMP_VREF_0F,
11835 	ALC861_FIXUP_NO_JACK_DETECT,
11836 	ALC861_FIXUP_ASUS_A6RP,
11837 	ALC660_FIXUP_ASUS_W7J,
11838 };
11839 
11840 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11841 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
11842 			const struct hda_fixup *fix, int action)
11843 {
11844 	struct alc_spec *spec = codec->spec;
11845 	unsigned int val;
11846 
11847 	if (action != HDA_FIXUP_ACT_INIT)
11848 		return;
11849 	val = snd_hda_codec_get_pin_target(codec, 0x0f);
11850 	if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11851 		val |= AC_PINCTL_IN_EN;
11852 	val |= AC_PINCTL_VREF_50;
11853 	snd_hda_set_pin_ctl(codec, 0x0f, val);
11854 	spec->gen.keep_vref_in_automute = 1;
11855 }
11856 
11857 /* suppress the jack-detection */
11858 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
11859 				     const struct hda_fixup *fix, int action)
11860 {
11861 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11862 		codec->no_jack_detect = 1;
11863 }
11864 
11865 static const struct hda_fixup alc861_fixups[] = {
11866 	[ALC861_FIXUP_FSC_AMILO_PI1505] = {
11867 		.type = HDA_FIXUP_PINS,
11868 		.v.pins = (const struct hda_pintbl[]) {
11869 			{ 0x0b, 0x0221101f }, /* HP */
11870 			{ 0x0f, 0x90170310 }, /* speaker */
11871 			{ }
11872 		}
11873 	},
11874 	[ALC861_FIXUP_AMP_VREF_0F] = {
11875 		.type = HDA_FIXUP_FUNC,
11876 		.v.func = alc861_fixup_asus_amp_vref_0f,
11877 	},
11878 	[ALC861_FIXUP_NO_JACK_DETECT] = {
11879 		.type = HDA_FIXUP_FUNC,
11880 		.v.func = alc_fixup_no_jack_detect,
11881 	},
11882 	[ALC861_FIXUP_ASUS_A6RP] = {
11883 		.type = HDA_FIXUP_FUNC,
11884 		.v.func = alc861_fixup_asus_amp_vref_0f,
11885 		.chained = true,
11886 		.chain_id = ALC861_FIXUP_NO_JACK_DETECT,
11887 	},
11888 	[ALC660_FIXUP_ASUS_W7J] = {
11889 		.type = HDA_FIXUP_VERBS,
11890 		.v.verbs = (const struct hda_verb[]) {
11891 			/* ASUS W7J needs a magic pin setup on unused NID 0x10
11892 			 * for enabling outputs
11893 			 */
11894 			{0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11895 			{ }
11896 		},
11897 	}
11898 };
11899 
11900 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
11901 	SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
11902 	SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
11903 	SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11904 	SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11905 	SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
11906 	SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
11907 	SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
11908 	{}
11909 };
11910 
11911 /*
11912  */
11913 static int patch_alc861(struct hda_codec *codec)
11914 {
11915 	struct alc_spec *spec;
11916 	int err;
11917 
11918 	err = alc_alloc_spec(codec, 0x15);
11919 	if (err < 0)
11920 		return err;
11921 
11922 	spec = codec->spec;
11923 	if (has_cdefine_beep(codec))
11924 		spec->gen.beep_nid = 0x23;
11925 
11926 	spec->power_hook = alc_power_eapd;
11927 
11928 	alc_pre_init(codec);
11929 
11930 	snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11931 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11932 
11933 	/* automatic parse from the BIOS config */
11934 	err = alc861_parse_auto_config(codec);
11935 	if (err < 0)
11936 		goto error;
11937 
11938 	if (!spec->gen.no_analog) {
11939 		err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11940 		if (err < 0)
11941 			goto error;
11942 	}
11943 
11944 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11945 
11946 	return 0;
11947 
11948  error:
11949 	alc_free(codec);
11950 	return err;
11951 }
11952 
11953 /*
11954  * ALC861-VD support
11955  *
11956  * Based on ALC882
11957  *
11958  * In addition, an independent DAC
11959  */
11960 static int alc861vd_parse_auto_config(struct hda_codec *codec)
11961 {
11962 	static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
11963 	static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11964 	return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
11965 }
11966 
11967 enum {
11968 	ALC660VD_FIX_ASUS_GPIO1,
11969 	ALC861VD_FIX_DALLAS,
11970 };
11971 
11972 /* exclude VREF80 */
11973 static void alc861vd_fixup_dallas(struct hda_codec *codec,
11974 				  const struct hda_fixup *fix, int action)
11975 {
11976 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11977 		snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11978 		snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
11979 	}
11980 }
11981 
11982 /* reset GPIO1 */
11983 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11984 				      const struct hda_fixup *fix, int action)
11985 {
11986 	struct alc_spec *spec = codec->spec;
11987 
11988 	if (action == HDA_FIXUP_ACT_PRE_PROBE)
11989 		spec->gpio_mask |= 0x02;
11990 	alc_fixup_gpio(codec, action, 0x01);
11991 }
11992 
11993 static const struct hda_fixup alc861vd_fixups[] = {
11994 	[ALC660VD_FIX_ASUS_GPIO1] = {
11995 		.type = HDA_FIXUP_FUNC,
11996 		.v.func = alc660vd_fixup_asus_gpio1,
11997 	},
11998 	[ALC861VD_FIX_DALLAS] = {
11999 		.type = HDA_FIXUP_FUNC,
12000 		.v.func = alc861vd_fixup_dallas,
12001 	},
12002 };
12003 
12004 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
12005 	SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
12006 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
12007 	SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
12008 	{}
12009 };
12010 
12011 /*
12012  */
12013 static int patch_alc861vd(struct hda_codec *codec)
12014 {
12015 	struct alc_spec *spec;
12016 	int err;
12017 
12018 	err = alc_alloc_spec(codec, 0x0b);
12019 	if (err < 0)
12020 		return err;
12021 
12022 	spec = codec->spec;
12023 	if (has_cdefine_beep(codec))
12024 		spec->gen.beep_nid = 0x23;
12025 
12026 	spec->shutup = alc_eapd_shutup;
12027 
12028 	alc_pre_init(codec);
12029 
12030 	snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
12031 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12032 
12033 	/* automatic parse from the BIOS config */
12034 	err = alc861vd_parse_auto_config(codec);
12035 	if (err < 0)
12036 		goto error;
12037 
12038 	if (!spec->gen.no_analog) {
12039 		err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12040 		if (err < 0)
12041 			goto error;
12042 	}
12043 
12044 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
12045 
12046 	return 0;
12047 
12048  error:
12049 	alc_free(codec);
12050 	return err;
12051 }
12052 
12053 /*
12054  * ALC662 support
12055  *
12056  * ALC662 is almost identical with ALC880 but has cleaner and more flexible
12057  * configuration.  Each pin widget can choose any input DACs and a mixer.
12058  * Each ADC is connected from a mixer of all inputs.  This makes possible
12059  * 6-channel independent captures.
12060  *
12061  * In addition, an independent DAC for the multi-playback (not used in this
12062  * driver yet).
12063  */
12064 
12065 /*
12066  * BIOS auto configuration
12067  */
12068 
12069 static int alc662_parse_auto_config(struct hda_codec *codec)
12070 {
12071 	static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
12072 	static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
12073 	static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
12074 	const hda_nid_t *ssids;
12075 
12076 	if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
12077 	    codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
12078 	    codec->core.vendor_id == 0x10ec0671)
12079 		ssids = alc663_ssids;
12080 	else
12081 		ssids = alc662_ssids;
12082 	return alc_parse_auto_config(codec, alc662_ignore, ssids);
12083 }
12084 
12085 static void alc272_fixup_mario(struct hda_codec *codec,
12086 			       const struct hda_fixup *fix, int action)
12087 {
12088 	if (action != HDA_FIXUP_ACT_PRE_PROBE)
12089 		return;
12090 	if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
12091 				      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
12092 				      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
12093 				      (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
12094 				      (0 << AC_AMPCAP_MUTE_SHIFT)))
12095 		codec_warn(codec, "failed to override amp caps for NID 0x2\n");
12096 }
12097 
12098 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
12099 	{ .channels = 2,
12100 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
12101 	{ .channels = 4,
12102 	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
12103 		   SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
12104 	{ }
12105 };
12106 
12107 /* override the 2.1 chmap */
12108 static void alc_fixup_bass_chmap(struct hda_codec *codec,
12109 				    const struct hda_fixup *fix, int action)
12110 {
12111 	if (action == HDA_FIXUP_ACT_BUILD) {
12112 		struct alc_spec *spec = codec->spec;
12113 		spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
12114 	}
12115 }
12116 
12117 /* avoid D3 for keeping GPIO up */
12118 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
12119 					  hda_nid_t nid,
12120 					  unsigned int power_state)
12121 {
12122 	struct alc_spec *spec = codec->spec;
12123 	if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
12124 		return AC_PWRST_D0;
12125 	return power_state;
12126 }
12127 
12128 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
12129 				   const struct hda_fixup *fix, int action)
12130 {
12131 	struct alc_spec *spec = codec->spec;
12132 
12133 	alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
12134 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12135 		spec->mute_led_polarity = 1;
12136 		codec->power_filter = gpio_led_power_filter;
12137 	}
12138 }
12139 
12140 static void alc662_usi_automute_hook(struct hda_codec *codec,
12141 					 struct hda_jack_callback *jack)
12142 {
12143 	struct alc_spec *spec = codec->spec;
12144 	int vref;
12145 	msleep(200);
12146 	snd_hda_gen_hp_automute(codec, jack);
12147 
12148 	vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
12149 	msleep(100);
12150 	snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
12151 			    vref);
12152 }
12153 
12154 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
12155 				     const struct hda_fixup *fix, int action)
12156 {
12157 	struct alc_spec *spec = codec->spec;
12158 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12159 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12160 		spec->gen.hp_automute_hook = alc662_usi_automute_hook;
12161 	}
12162 }
12163 
12164 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
12165 					struct hda_jack_callback *cb)
12166 {
12167 	/* surround speakers at 0x1b already get muted automatically when
12168 	 * headphones are plugged in, but we have to mute/unmute the remaining
12169 	 * channels manually:
12170 	 * 0x15 - front left/front right
12171 	 * 0x18 - front center/ LFE
12172 	 */
12173 	if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
12174 		snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
12175 		snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
12176 	} else {
12177 		snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
12178 		snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
12179 	}
12180 }
12181 
12182 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
12183 					const struct hda_fixup *fix, int action)
12184 {
12185     /* Pin 0x1b: shared headphones jack and surround speakers */
12186 	if (!is_jack_detectable(codec, 0x1b))
12187 		return;
12188 
12189 	switch (action) {
12190 	case HDA_FIXUP_ACT_PRE_PROBE:
12191 		snd_hda_jack_detect_enable_callback(codec, 0x1b,
12192 				alc662_aspire_ethos_mute_speakers);
12193 		/* subwoofer needs an extra GPIO setting to become audible */
12194 		alc_setup_gpio(codec, 0x02);
12195 		break;
12196 	case HDA_FIXUP_ACT_INIT:
12197 		/* Make sure to start in a correct state, i.e. if
12198 		 * headphones have been plugged in before powering up the system
12199 		 */
12200 		alc662_aspire_ethos_mute_speakers(codec, NULL);
12201 		break;
12202 	}
12203 }
12204 
12205 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
12206 					     const struct hda_fixup *fix, int action)
12207 {
12208 	struct alc_spec *spec = codec->spec;
12209 
12210 	static const struct hda_pintbl pincfgs[] = {
12211 		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
12212 		{ 0x1b, 0x0181304f },
12213 		{ }
12214 	};
12215 
12216 	switch (action) {
12217 	case HDA_FIXUP_ACT_PRE_PROBE:
12218 		spec->gen.mixer_nid = 0;
12219 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12220 		snd_hda_apply_pincfgs(codec, pincfgs);
12221 		break;
12222 	case HDA_FIXUP_ACT_INIT:
12223 		alc_write_coef_idx(codec, 0x19, 0xa054);
12224 		break;
12225 	}
12226 }
12227 
12228 static void alc897_hp_automute_hook(struct hda_codec *codec,
12229 					 struct hda_jack_callback *jack)
12230 {
12231 	struct alc_spec *spec = codec->spec;
12232 	int vref;
12233 
12234 	snd_hda_gen_hp_automute(codec, jack);
12235 	vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
12236 	snd_hda_set_pin_ctl(codec, 0x1b, vref);
12237 }
12238 
12239 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
12240 				     const struct hda_fixup *fix, int action)
12241 {
12242 	struct alc_spec *spec = codec->spec;
12243 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12244 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12245 		spec->no_shutup_pins = 1;
12246 	}
12247 	if (action == HDA_FIXUP_ACT_PROBE) {
12248 		snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
12249 	}
12250 }
12251 
12252 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
12253 				     const struct hda_fixup *fix, int action)
12254 {
12255 	struct alc_spec *spec = codec->spec;
12256 
12257 	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12258 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12259 		spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12260 	}
12261 }
12262 
12263 static const struct coef_fw alc668_coefs[] = {
12264 	WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
12265 	WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06,    0x0), WRITE_COEF(0x07, 0x0f80),
12266 	WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b,    0x0),
12267 	WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
12268 	WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
12269 	WRITE_COEF(0x13,    0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
12270 	WRITE_COEF(0x19,    0x0), WRITE_COEF(0x1a,    0x0), WRITE_COEF(0x1b,    0x0),
12271 	WRITE_COEF(0x1c,    0x0), WRITE_COEF(0x1d,    0x0), WRITE_COEF(0x1e, 0x7418),
12272 	WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
12273 	WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
12274 	WRITE_COEF(0x27,    0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
12275 	WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
12276 	WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac,    0x0),
12277 	WRITE_COEF(0xad,    0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
12278 	WRITE_COEF(0xb0,    0x0), WRITE_COEF(0xb1,    0x0), WRITE_COEF(0xb2,    0x0),
12279 	WRITE_COEF(0xb3,    0x0), WRITE_COEF(0xb4,    0x0), WRITE_COEF(0xb5, 0x1040),
12280 	WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
12281 	WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
12282 	WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
12283 	WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
12284 	{}
12285 };
12286 
12287 static void alc668_restore_default_value(struct hda_codec *codec)
12288 {
12289 	alc_process_coef_fw(codec, alc668_coefs);
12290 }
12291 
12292 enum {
12293 	ALC662_FIXUP_ASPIRE,
12294 	ALC662_FIXUP_LED_GPIO1,
12295 	ALC662_FIXUP_IDEAPAD,
12296 	ALC272_FIXUP_MARIO,
12297 	ALC662_FIXUP_CZC_ET26,
12298 	ALC662_FIXUP_CZC_P10T,
12299 	ALC662_FIXUP_SKU_IGNORE,
12300 	ALC662_FIXUP_HP_RP5800,
12301 	ALC662_FIXUP_ASUS_MODE1,
12302 	ALC662_FIXUP_ASUS_MODE2,
12303 	ALC662_FIXUP_ASUS_MODE3,
12304 	ALC662_FIXUP_ASUS_MODE4,
12305 	ALC662_FIXUP_ASUS_MODE5,
12306 	ALC662_FIXUP_ASUS_MODE6,
12307 	ALC662_FIXUP_ASUS_MODE7,
12308 	ALC662_FIXUP_ASUS_MODE8,
12309 	ALC662_FIXUP_NO_JACK_DETECT,
12310 	ALC662_FIXUP_ZOTAC_Z68,
12311 	ALC662_FIXUP_INV_DMIC,
12312 	ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12313 	ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
12314 	ALC662_FIXUP_HEADSET_MODE,
12315 	ALC668_FIXUP_HEADSET_MODE,
12316 	ALC662_FIXUP_BASS_MODE4_CHMAP,
12317 	ALC662_FIXUP_BASS_16,
12318 	ALC662_FIXUP_BASS_1A,
12319 	ALC662_FIXUP_BASS_CHMAP,
12320 	ALC668_FIXUP_AUTO_MUTE,
12321 	ALC668_FIXUP_DELL_DISABLE_AAMIX,
12322 	ALC668_FIXUP_DELL_XPS13,
12323 	ALC662_FIXUP_ASUS_Nx50,
12324 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12325 	ALC668_FIXUP_ASUS_Nx51,
12326 	ALC668_FIXUP_MIC_COEF,
12327 	ALC668_FIXUP_ASUS_G751,
12328 	ALC891_FIXUP_HEADSET_MODE,
12329 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12330 	ALC662_FIXUP_ACER_VERITON,
12331 	ALC892_FIXUP_ASROCK_MOBO,
12332 	ALC662_FIXUP_USI_FUNC,
12333 	ALC662_FIXUP_USI_HEADSET_MODE,
12334 	ALC662_FIXUP_LENOVO_MULTI_CODECS,
12335 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
12336 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
12337 	ALC671_FIXUP_HP_HEADSET_MIC2,
12338 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
12339 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
12340 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12341 	ALC668_FIXUP_HEADSET_MIC,
12342 	ALC668_FIXUP_MIC_DET_COEF,
12343 	ALC897_FIXUP_LENOVO_HEADSET_MIC,
12344 	ALC897_FIXUP_HEADSET_MIC_PIN,
12345 	ALC897_FIXUP_HP_HSMIC_VERB,
12346 	ALC897_FIXUP_LENOVO_HEADSET_MODE,
12347 	ALC897_FIXUP_HEADSET_MIC_PIN2,
12348 	ALC897_FIXUP_UNIS_H3C_X500S,
12349 	ALC897_FIXUP_HEADSET_MIC_PIN3,
12350 };
12351 
12352 static const struct hda_fixup alc662_fixups[] = {
12353 	[ALC662_FIXUP_ASPIRE] = {
12354 		.type = HDA_FIXUP_PINS,
12355 		.v.pins = (const struct hda_pintbl[]) {
12356 			{ 0x15, 0x99130112 }, /* subwoofer */
12357 			{ }
12358 		}
12359 	},
12360 	[ALC662_FIXUP_LED_GPIO1] = {
12361 		.type = HDA_FIXUP_FUNC,
12362 		.v.func = alc662_fixup_led_gpio1,
12363 	},
12364 	[ALC662_FIXUP_IDEAPAD] = {
12365 		.type = HDA_FIXUP_PINS,
12366 		.v.pins = (const struct hda_pintbl[]) {
12367 			{ 0x17, 0x99130112 }, /* subwoofer */
12368 			{ }
12369 		},
12370 		.chained = true,
12371 		.chain_id = ALC662_FIXUP_LED_GPIO1,
12372 	},
12373 	[ALC272_FIXUP_MARIO] = {
12374 		.type = HDA_FIXUP_FUNC,
12375 		.v.func = alc272_fixup_mario,
12376 	},
12377 	[ALC662_FIXUP_CZC_ET26] = {
12378 		.type = HDA_FIXUP_PINS,
12379 		.v.pins = (const struct hda_pintbl[]) {
12380 			{0x12, 0x403cc000},
12381 			{0x14, 0x90170110}, /* speaker */
12382 			{0x15, 0x411111f0},
12383 			{0x16, 0x411111f0},
12384 			{0x18, 0x01a19030}, /* mic */
12385 			{0x19, 0x90a7013f}, /* int-mic */
12386 			{0x1a, 0x01014020},
12387 			{0x1b, 0x0121401f},
12388 			{0x1c, 0x411111f0},
12389 			{0x1d, 0x411111f0},
12390 			{0x1e, 0x40478e35},
12391 			{}
12392 		},
12393 		.chained = true,
12394 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12395 	},
12396 	[ALC662_FIXUP_CZC_P10T] = {
12397 		.type = HDA_FIXUP_VERBS,
12398 		.v.verbs = (const struct hda_verb[]) {
12399 			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12400 			{}
12401 		}
12402 	},
12403 	[ALC662_FIXUP_SKU_IGNORE] = {
12404 		.type = HDA_FIXUP_FUNC,
12405 		.v.func = alc_fixup_sku_ignore,
12406 	},
12407 	[ALC662_FIXUP_HP_RP5800] = {
12408 		.type = HDA_FIXUP_PINS,
12409 		.v.pins = (const struct hda_pintbl[]) {
12410 			{ 0x14, 0x0221201f }, /* HP out */
12411 			{ }
12412 		},
12413 		.chained = true,
12414 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12415 	},
12416 	[ALC662_FIXUP_ASUS_MODE1] = {
12417 		.type = HDA_FIXUP_PINS,
12418 		.v.pins = (const struct hda_pintbl[]) {
12419 			{ 0x14, 0x99130110 }, /* speaker */
12420 			{ 0x18, 0x01a19c20 }, /* mic */
12421 			{ 0x19, 0x99a3092f }, /* int-mic */
12422 			{ 0x21, 0x0121401f }, /* HP out */
12423 			{ }
12424 		},
12425 		.chained = true,
12426 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12427 	},
12428 	[ALC662_FIXUP_ASUS_MODE2] = {
12429 		.type = HDA_FIXUP_PINS,
12430 		.v.pins = (const struct hda_pintbl[]) {
12431 			{ 0x14, 0x99130110 }, /* speaker */
12432 			{ 0x18, 0x01a19820 }, /* mic */
12433 			{ 0x19, 0x99a3092f }, /* int-mic */
12434 			{ 0x1b, 0x0121401f }, /* HP out */
12435 			{ }
12436 		},
12437 		.chained = true,
12438 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12439 	},
12440 	[ALC662_FIXUP_ASUS_MODE3] = {
12441 		.type = HDA_FIXUP_PINS,
12442 		.v.pins = (const struct hda_pintbl[]) {
12443 			{ 0x14, 0x99130110 }, /* speaker */
12444 			{ 0x15, 0x0121441f }, /* HP */
12445 			{ 0x18, 0x01a19840 }, /* mic */
12446 			{ 0x19, 0x99a3094f }, /* int-mic */
12447 			{ 0x21, 0x01211420 }, /* HP2 */
12448 			{ }
12449 		},
12450 		.chained = true,
12451 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12452 	},
12453 	[ALC662_FIXUP_ASUS_MODE4] = {
12454 		.type = HDA_FIXUP_PINS,
12455 		.v.pins = (const struct hda_pintbl[]) {
12456 			{ 0x14, 0x99130110 }, /* speaker */
12457 			{ 0x16, 0x99130111 }, /* speaker */
12458 			{ 0x18, 0x01a19840 }, /* mic */
12459 			{ 0x19, 0x99a3094f }, /* int-mic */
12460 			{ 0x21, 0x0121441f }, /* HP */
12461 			{ }
12462 		},
12463 		.chained = true,
12464 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12465 	},
12466 	[ALC662_FIXUP_ASUS_MODE5] = {
12467 		.type = HDA_FIXUP_PINS,
12468 		.v.pins = (const struct hda_pintbl[]) {
12469 			{ 0x14, 0x99130110 }, /* speaker */
12470 			{ 0x15, 0x0121441f }, /* HP */
12471 			{ 0x16, 0x99130111 }, /* speaker */
12472 			{ 0x18, 0x01a19840 }, /* mic */
12473 			{ 0x19, 0x99a3094f }, /* int-mic */
12474 			{ }
12475 		},
12476 		.chained = true,
12477 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12478 	},
12479 	[ALC662_FIXUP_ASUS_MODE6] = {
12480 		.type = HDA_FIXUP_PINS,
12481 		.v.pins = (const struct hda_pintbl[]) {
12482 			{ 0x14, 0x99130110 }, /* speaker */
12483 			{ 0x15, 0x01211420 }, /* HP2 */
12484 			{ 0x18, 0x01a19840 }, /* mic */
12485 			{ 0x19, 0x99a3094f }, /* int-mic */
12486 			{ 0x1b, 0x0121441f }, /* HP */
12487 			{ }
12488 		},
12489 		.chained = true,
12490 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12491 	},
12492 	[ALC662_FIXUP_ASUS_MODE7] = {
12493 		.type = HDA_FIXUP_PINS,
12494 		.v.pins = (const struct hda_pintbl[]) {
12495 			{ 0x14, 0x99130110 }, /* speaker */
12496 			{ 0x17, 0x99130111 }, /* speaker */
12497 			{ 0x18, 0x01a19840 }, /* mic */
12498 			{ 0x19, 0x99a3094f }, /* int-mic */
12499 			{ 0x1b, 0x01214020 }, /* HP */
12500 			{ 0x21, 0x0121401f }, /* HP */
12501 			{ }
12502 		},
12503 		.chained = true,
12504 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12505 	},
12506 	[ALC662_FIXUP_ASUS_MODE8] = {
12507 		.type = HDA_FIXUP_PINS,
12508 		.v.pins = (const struct hda_pintbl[]) {
12509 			{ 0x14, 0x99130110 }, /* speaker */
12510 			{ 0x12, 0x99a30970 }, /* int-mic */
12511 			{ 0x15, 0x01214020 }, /* HP */
12512 			{ 0x17, 0x99130111 }, /* speaker */
12513 			{ 0x18, 0x01a19840 }, /* mic */
12514 			{ 0x21, 0x0121401f }, /* HP */
12515 			{ }
12516 		},
12517 		.chained = true,
12518 		.chain_id = ALC662_FIXUP_SKU_IGNORE
12519 	},
12520 	[ALC662_FIXUP_NO_JACK_DETECT] = {
12521 		.type = HDA_FIXUP_FUNC,
12522 		.v.func = alc_fixup_no_jack_detect,
12523 	},
12524 	[ALC662_FIXUP_ZOTAC_Z68] = {
12525 		.type = HDA_FIXUP_PINS,
12526 		.v.pins = (const struct hda_pintbl[]) {
12527 			{ 0x1b, 0x02214020 }, /* Front HP */
12528 			{ }
12529 		}
12530 	},
12531 	[ALC662_FIXUP_INV_DMIC] = {
12532 		.type = HDA_FIXUP_FUNC,
12533 		.v.func = alc_fixup_inv_dmic,
12534 	},
12535 	[ALC668_FIXUP_DELL_XPS13] = {
12536 		.type = HDA_FIXUP_FUNC,
12537 		.v.func = alc_fixup_dell_xps13,
12538 		.chained = true,
12539 		.chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
12540 	},
12541 	[ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
12542 		.type = HDA_FIXUP_FUNC,
12543 		.v.func = alc_fixup_disable_aamix,
12544 		.chained = true,
12545 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12546 	},
12547 	[ALC668_FIXUP_AUTO_MUTE] = {
12548 		.type = HDA_FIXUP_FUNC,
12549 		.v.func = alc_fixup_auto_mute_via_amp,
12550 		.chained = true,
12551 		.chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12552 	},
12553 	[ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12554 		.type = HDA_FIXUP_PINS,
12555 		.v.pins = (const struct hda_pintbl[]) {
12556 			{ 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12557 			/* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12558 			{ }
12559 		},
12560 		.chained = true,
12561 		.chain_id = ALC662_FIXUP_HEADSET_MODE
12562 	},
12563 	[ALC662_FIXUP_HEADSET_MODE] = {
12564 		.type = HDA_FIXUP_FUNC,
12565 		.v.func = alc_fixup_headset_mode_alc662,
12566 	},
12567 	[ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12568 		.type = HDA_FIXUP_PINS,
12569 		.v.pins = (const struct hda_pintbl[]) {
12570 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12571 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12572 			{ }
12573 		},
12574 		.chained = true,
12575 		.chain_id = ALC668_FIXUP_HEADSET_MODE
12576 	},
12577 	[ALC668_FIXUP_HEADSET_MODE] = {
12578 		.type = HDA_FIXUP_FUNC,
12579 		.v.func = alc_fixup_headset_mode_alc668,
12580 	},
12581 	[ALC662_FIXUP_BASS_MODE4_CHMAP] = {
12582 		.type = HDA_FIXUP_FUNC,
12583 		.v.func = alc_fixup_bass_chmap,
12584 		.chained = true,
12585 		.chain_id = ALC662_FIXUP_ASUS_MODE4
12586 	},
12587 	[ALC662_FIXUP_BASS_16] = {
12588 		.type = HDA_FIXUP_PINS,
12589 		.v.pins = (const struct hda_pintbl[]) {
12590 			{0x16, 0x80106111}, /* bass speaker */
12591 			{}
12592 		},
12593 		.chained = true,
12594 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12595 	},
12596 	[ALC662_FIXUP_BASS_1A] = {
12597 		.type = HDA_FIXUP_PINS,
12598 		.v.pins = (const struct hda_pintbl[]) {
12599 			{0x1a, 0x80106111}, /* bass speaker */
12600 			{}
12601 		},
12602 		.chained = true,
12603 		.chain_id = ALC662_FIXUP_BASS_CHMAP,
12604 	},
12605 	[ALC662_FIXUP_BASS_CHMAP] = {
12606 		.type = HDA_FIXUP_FUNC,
12607 		.v.func = alc_fixup_bass_chmap,
12608 	},
12609 	[ALC662_FIXUP_ASUS_Nx50] = {
12610 		.type = HDA_FIXUP_FUNC,
12611 		.v.func = alc_fixup_auto_mute_via_amp,
12612 		.chained = true,
12613 		.chain_id = ALC662_FIXUP_BASS_1A
12614 	},
12615 	[ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12616 		.type = HDA_FIXUP_FUNC,
12617 		.v.func = alc_fixup_headset_mode_alc668,
12618 		.chain_id = ALC662_FIXUP_BASS_CHMAP
12619 	},
12620 	[ALC668_FIXUP_ASUS_Nx51] = {
12621 		.type = HDA_FIXUP_PINS,
12622 		.v.pins = (const struct hda_pintbl[]) {
12623 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12624 			{ 0x1a, 0x90170151 }, /* bass speaker */
12625 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12626 			{}
12627 		},
12628 		.chained = true,
12629 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
12630 	},
12631 	[ALC668_FIXUP_MIC_COEF] = {
12632 		.type = HDA_FIXUP_VERBS,
12633 		.v.verbs = (const struct hda_verb[]) {
12634 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12635 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12636 			{}
12637 		},
12638 	},
12639 	[ALC668_FIXUP_ASUS_G751] = {
12640 		.type = HDA_FIXUP_PINS,
12641 		.v.pins = (const struct hda_pintbl[]) {
12642 			{ 0x16, 0x0421101f }, /* HP */
12643 			{}
12644 		},
12645 		.chained = true,
12646 		.chain_id = ALC668_FIXUP_MIC_COEF
12647 	},
12648 	[ALC891_FIXUP_HEADSET_MODE] = {
12649 		.type = HDA_FIXUP_FUNC,
12650 		.v.func = alc_fixup_headset_mode,
12651 	},
12652 	[ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12653 		.type = HDA_FIXUP_PINS,
12654 		.v.pins = (const struct hda_pintbl[]) {
12655 			{ 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12656 			{ 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12657 			{ }
12658 		},
12659 		.chained = true,
12660 		.chain_id = ALC891_FIXUP_HEADSET_MODE
12661 	},
12662 	[ALC662_FIXUP_ACER_VERITON] = {
12663 		.type = HDA_FIXUP_PINS,
12664 		.v.pins = (const struct hda_pintbl[]) {
12665 			{ 0x15, 0x50170120 }, /* no internal speaker */
12666 			{ }
12667 		}
12668 	},
12669 	[ALC892_FIXUP_ASROCK_MOBO] = {
12670 		.type = HDA_FIXUP_PINS,
12671 		.v.pins = (const struct hda_pintbl[]) {
12672 			{ 0x15, 0x40f000f0 }, /* disabled */
12673 			{ 0x16, 0x40f000f0 }, /* disabled */
12674 			{ }
12675 		}
12676 	},
12677 	[ALC662_FIXUP_USI_FUNC] = {
12678 		.type = HDA_FIXUP_FUNC,
12679 		.v.func = alc662_fixup_usi_headset_mic,
12680 	},
12681 	[ALC662_FIXUP_USI_HEADSET_MODE] = {
12682 		.type = HDA_FIXUP_PINS,
12683 		.v.pins = (const struct hda_pintbl[]) {
12684 			{ 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12685 			{ 0x18, 0x01a1903d },
12686 			{ }
12687 		},
12688 		.chained = true,
12689 		.chain_id = ALC662_FIXUP_USI_FUNC
12690 	},
12691 	[ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12692 		.type = HDA_FIXUP_FUNC,
12693 		.v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12694 	},
12695 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12696 		.type = HDA_FIXUP_FUNC,
12697 		.v.func = alc662_fixup_aspire_ethos_hp,
12698 	},
12699 	[ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12700 		.type = HDA_FIXUP_PINS,
12701 		.v.pins = (const struct hda_pintbl[]) {
12702 			{ 0x15, 0x92130110 }, /* front speakers */
12703 			{ 0x18, 0x99130111 }, /* center/subwoofer */
12704 			{ 0x1b, 0x11130012 }, /* surround plus jack for HP */
12705 			{ }
12706 		},
12707 		.chained = true,
12708 		.chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
12709 	},
12710 	[ALC671_FIXUP_HP_HEADSET_MIC2] = {
12711 		.type = HDA_FIXUP_FUNC,
12712 		.v.func = alc671_fixup_hp_headset_mic2,
12713 	},
12714 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12715 		.type = HDA_FIXUP_PINS,
12716 		.v.pins = (const struct hda_pintbl[]) {
12717 			{ 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12718 			{ }
12719 		},
12720 		.chained = true,
12721 		.chain_id = ALC662_FIXUP_USI_FUNC
12722 	},
12723 	[ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12724 		.type = HDA_FIXUP_PINS,
12725 		.v.pins = (const struct hda_pintbl[]) {
12726 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12727 			{ 0x1b, 0x0221144f },
12728 			{ }
12729 		},
12730 		.chained = true,
12731 		.chain_id = ALC662_FIXUP_USI_FUNC
12732 	},
12733 	[ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12734 		.type = HDA_FIXUP_PINS,
12735 		.v.pins = (const struct hda_pintbl[]) {
12736 			{ 0x1b, 0x04a1112c },
12737 			{ }
12738 		},
12739 		.chained = true,
12740 		.chain_id = ALC668_FIXUP_HEADSET_MIC
12741 	},
12742 	[ALC668_FIXUP_HEADSET_MIC] = {
12743 		.type = HDA_FIXUP_FUNC,
12744 		.v.func = alc269_fixup_headset_mic,
12745 		.chained = true,
12746 		.chain_id = ALC668_FIXUP_MIC_DET_COEF
12747 	},
12748 	[ALC668_FIXUP_MIC_DET_COEF] = {
12749 		.type = HDA_FIXUP_VERBS,
12750 		.v.verbs = (const struct hda_verb[]) {
12751 			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12752 			{ 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12753 			{}
12754 		},
12755 	},
12756 	[ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12757 		.type = HDA_FIXUP_FUNC,
12758 		.v.func = alc897_fixup_lenovo_headset_mic,
12759 	},
12760 	[ALC897_FIXUP_HEADSET_MIC_PIN] = {
12761 		.type = HDA_FIXUP_PINS,
12762 		.v.pins = (const struct hda_pintbl[]) {
12763 			{ 0x1a, 0x03a11050 },
12764 			{ }
12765 		},
12766 		.chained = true,
12767 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12768 	},
12769 	[ALC897_FIXUP_HP_HSMIC_VERB] = {
12770 		.type = HDA_FIXUP_PINS,
12771 		.v.pins = (const struct hda_pintbl[]) {
12772 			{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12773 			{ }
12774 		},
12775 	},
12776 	[ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12777 		.type = HDA_FIXUP_FUNC,
12778 		.v.func = alc897_fixup_lenovo_headset_mode,
12779 	},
12780 	[ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12781 		.type = HDA_FIXUP_PINS,
12782 		.v.pins = (const struct hda_pintbl[]) {
12783 			{ 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12784 			{ }
12785 		},
12786 		.chained = true,
12787 		.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12788 	},
12789 	[ALC897_FIXUP_UNIS_H3C_X500S] = {
12790 		.type = HDA_FIXUP_VERBS,
12791 		.v.verbs = (const struct hda_verb[]) {
12792 			{ 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12793 			{}
12794 		},
12795 	},
12796 	[ALC897_FIXUP_HEADSET_MIC_PIN3] = {
12797 		.type = HDA_FIXUP_PINS,
12798 		.v.pins = (const struct hda_pintbl[]) {
12799 			{ 0x19, 0x03a11050 }, /* use as headset mic */
12800 			{ }
12801 		},
12802 	},
12803 };
12804 
12805 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
12806 	SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
12807 	SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
12808 	SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
12809 	SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
12810 	SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
12811 	SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
12812 	SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
12813 	SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
12814 	SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
12815 	SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
12816 	SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
12817 	SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
12818 	SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12819 	SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12820 	SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
12821 	SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
12822 	SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
12823 	SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12824 	SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12825 	SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12826 	SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12827 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12828 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
12829 	SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12830 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12831 	SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
12832 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
12833 	SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
12834 	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
12835 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
12836 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
12837 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
12838 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
12839 	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
12840 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
12841 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12842 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
12843 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12844 	SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
12845 	SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
12846 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
12847 	SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
12848 	SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
12849 	SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
12850 	SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
12851 	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
12852 	SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
12853 	SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
12854 	SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
12855 	SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
12856 	SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12857 	SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12858 	SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12859 	SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
12860 	SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12861 	SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12862 	SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
12863 	SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
12864 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
12865 	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
12866 	SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
12867 	SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
12868 	SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
12869 	SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
12870 	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
12871 	SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
12872 
12873 #if 0
12874 	/* Below is a quirk table taken from the old code.
12875 	 * Basically the device should work as is without the fixup table.
12876 	 * If BIOS doesn't give a proper info, enable the corresponding
12877 	 * fixup entry.
12878 	 */
12879 	SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12880 	SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12881 	SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12882 	SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12883 	SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12884 	SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12885 	SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12886 	SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12887 	SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12888 	SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12889 	SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12890 	SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12891 	SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12892 	SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12893 	SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12894 	SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12895 	SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12896 	SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12897 	SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12898 	SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12899 	SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12900 	SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12901 	SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12902 	SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12903 	SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12904 	SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12905 	SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12906 	SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12907 	SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12908 	SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12909 	SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12910 	SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12911 	SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12912 	SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12913 	SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12914 	SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12915 	SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12916 	SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12917 	SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12918 	SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12919 	SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12920 	SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12921 	SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12922 	SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12923 	SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12924 	SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12925 	SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12926 	SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12927 	SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12928 	SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12929 #endif
12930 	{}
12931 };
12932 
12933 static const struct hda_model_fixup alc662_fixup_models[] = {
12934 	{.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12935 	{.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
12936 	{.id = ALC272_FIXUP_MARIO, .name = "mario"},
12937 	{.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
12938 	{.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12939 	{.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12940 	{.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12941 	{.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12942 	{.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12943 	{.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12944 	{.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12945 	{.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
12946 	{.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
12947 	{.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
12948 	{.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
12949 	{.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
12950 	{.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12951 	{.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12952 	{.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12953 	{.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12954 	{.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12955 	{.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12956 	{.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12957 	{.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
12958 	{.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
12959 	{.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12960 	{.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12961 	{.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12962 	{.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12963 	{.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
12964 	{.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
12965 	{.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
12966 	{.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
12967 	{}
12968 };
12969 
12970 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
12971 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12972 		{0x17, 0x02211010},
12973 		{0x18, 0x01a19030},
12974 		{0x1a, 0x01813040},
12975 		{0x21, 0x01014020}),
12976 	SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12977 		{0x16, 0x01813030},
12978 		{0x17, 0x02211010},
12979 		{0x18, 0x01a19040},
12980 		{0x21, 0x01014020}),
12981 	SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
12982 		{0x14, 0x01014010},
12983 		{0x18, 0x01a19020},
12984 		{0x1a, 0x0181302f},
12985 		{0x1b, 0x0221401f}),
12986 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12987 		{0x12, 0x99a30130},
12988 		{0x14, 0x90170110},
12989 		{0x15, 0x0321101f},
12990 		{0x16, 0x03011020}),
12991 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12992 		{0x12, 0x99a30140},
12993 		{0x14, 0x90170110},
12994 		{0x15, 0x0321101f},
12995 		{0x16, 0x03011020}),
12996 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12997 		{0x12, 0x99a30150},
12998 		{0x14, 0x90170110},
12999 		{0x15, 0x0321101f},
13000 		{0x16, 0x03011020}),
13001 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
13002 		{0x14, 0x90170110},
13003 		{0x15, 0x0321101f},
13004 		{0x16, 0x03011020}),
13005 	SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
13006 		{0x12, 0x90a60130},
13007 		{0x14, 0x90170110},
13008 		{0x15, 0x0321101f}),
13009 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13010 		{0x14, 0x01014010},
13011 		{0x17, 0x90170150},
13012 		{0x19, 0x02a11060},
13013 		{0x1b, 0x01813030},
13014 		{0x21, 0x02211020}),
13015 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13016 		{0x14, 0x01014010},
13017 		{0x18, 0x01a19040},
13018 		{0x1b, 0x01813030},
13019 		{0x21, 0x02211020}),
13020 	SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13021 		{0x14, 0x01014020},
13022 		{0x17, 0x90170110},
13023 		{0x18, 0x01a19050},
13024 		{0x1b, 0x01813040},
13025 		{0x21, 0x02211030}),
13026 	{}
13027 };
13028 
13029 /*
13030  */
13031 static int patch_alc662(struct hda_codec *codec)
13032 {
13033 	struct alc_spec *spec;
13034 	int err;
13035 
13036 	err = alc_alloc_spec(codec, 0x0b);
13037 	if (err < 0)
13038 		return err;
13039 
13040 	spec = codec->spec;
13041 
13042 	spec->shutup = alc_eapd_shutup;
13043 
13044 	/* handle multiple HPs as is */
13045 	spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
13046 
13047 	alc_fix_pll_init(codec, 0x20, 0x04, 15);
13048 
13049 	switch (codec->core.vendor_id) {
13050 	case 0x10ec0668:
13051 		spec->init_hook = alc668_restore_default_value;
13052 		break;
13053 	}
13054 
13055 	alc_pre_init(codec);
13056 
13057 	snd_hda_pick_fixup(codec, alc662_fixup_models,
13058 		       alc662_fixup_tbl, alc662_fixups);
13059 	snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
13060 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
13061 
13062 	alc_auto_parse_customize_define(codec);
13063 
13064 	if (has_cdefine_beep(codec))
13065 		spec->gen.beep_nid = 0x01;
13066 
13067 	if ((alc_get_coef0(codec) & (1 << 14)) &&
13068 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
13069 	    spec->cdefine.platform_type == 1) {
13070 		err = alc_codec_rename(codec, "ALC272X");
13071 		if (err < 0)
13072 			goto error;
13073 	}
13074 
13075 	/* automatic parse from the BIOS config */
13076 	err = alc662_parse_auto_config(codec);
13077 	if (err < 0)
13078 		goto error;
13079 
13080 	if (!spec->gen.no_analog && spec->gen.beep_nid) {
13081 		switch (codec->core.vendor_id) {
13082 		case 0x10ec0662:
13083 			err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
13084 			break;
13085 		case 0x10ec0272:
13086 		case 0x10ec0663:
13087 		case 0x10ec0665:
13088 		case 0x10ec0668:
13089 			err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
13090 			break;
13091 		case 0x10ec0273:
13092 			err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
13093 			break;
13094 		}
13095 		if (err < 0)
13096 			goto error;
13097 	}
13098 
13099 	snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
13100 
13101 	return 0;
13102 
13103  error:
13104 	alc_free(codec);
13105 	return err;
13106 }
13107 
13108 /*
13109  * ALC680 support
13110  */
13111 
13112 static int alc680_parse_auto_config(struct hda_codec *codec)
13113 {
13114 	return alc_parse_auto_config(codec, NULL, NULL);
13115 }
13116 
13117 /*
13118  */
13119 static int patch_alc680(struct hda_codec *codec)
13120 {
13121 	int err;
13122 
13123 	/* ALC680 has no aa-loopback mixer */
13124 	err = alc_alloc_spec(codec, 0);
13125 	if (err < 0)
13126 		return err;
13127 
13128 	/* automatic parse from the BIOS config */
13129 	err = alc680_parse_auto_config(codec);
13130 	if (err < 0) {
13131 		alc_free(codec);
13132 		return err;
13133 	}
13134 
13135 	return 0;
13136 }
13137 
13138 /*
13139  * patch entries
13140  */
13141 static const struct hda_device_id snd_hda_id_realtek[] = {
13142 	HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
13143 	HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
13144 	HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
13145 	HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
13146 	HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
13147 	HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
13148 	HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
13149 	HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
13150 	HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
13151 	HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
13152 	HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
13153 	HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
13154 	HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
13155 	HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
13156 	HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
13157 	HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
13158 	HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
13159 	HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
13160 	HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
13161 	HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
13162 	HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
13163 	HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
13164 	HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
13165 	HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
13166 	HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
13167 	HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
13168 	HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
13169 	HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
13170 	HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
13171 	HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
13172 	HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
13173 	HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
13174 	HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
13175 	HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
13176 	HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
13177 	HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
13178 	HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
13179 	HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
13180 	HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
13181 	HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
13182 	HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
13183 	HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
13184 	HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
13185 	HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
13186 	HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
13187 	HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
13188 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
13189 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
13190 	HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
13191 	HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
13192 	HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
13193 	HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
13194 	HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
13195 	HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
13196 	HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
13197 	HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
13198 	HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
13199 	HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
13200 	HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
13201 	HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
13202 	HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
13203 	HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
13204 	HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
13205 	HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
13206 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
13207 	HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
13208 	HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
13209 	HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
13210 	HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
13211 	HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
13212 	HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
13213 	HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
13214 	HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
13215 	HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
13216 	HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
13217 	HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
13218 	HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
13219 	HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
13220 	HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
13221 	{} /* terminator */
13222 };
13223 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
13224 
13225 MODULE_LICENSE("GPL");
13226 MODULE_DESCRIPTION("Realtek HD-audio codec");
13227 MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT);
13228 
13229 static struct hda_codec_driver realtek_driver = {
13230 	.id = snd_hda_id_realtek,
13231 };
13232 
13233 module_hda_codec_driver(realtek_driver);
13234