]> git.ipfire.org Git - thirdparty/linux.git/blame - sound/pci/hda/patch_realtek.c
Merge tag 'asoc-fix-v6.3-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git...
[thirdparty/linux.git] / sound / pci / hda / patch_realtek.c
CommitLineData
d0fa1179 1// SPDX-License-Identifier: GPL-2.0-or-later
1da177e4
LT
2/*
3 * Universal Interface for Intel High Definition Audio Codec
4 *
1d045db9 5 * HD audio interface patch for Realtek ALC codecs
1da177e4 6 *
df694daa
KY
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
1da177e4 9 * Takashi Iwai <tiwai@suse.de>
409a3e98 10 * Jonathan Woithe <jwoithe@just42.net>
1da177e4
LT
11 */
12
1da177e4
LT
13#include <linux/init.h>
14#include <linux/delay.h>
15#include <linux/slab.h>
16#include <linux/pci.h>
08fb0d0e 17#include <linux/dmi.h>
da155d5b 18#include <linux/module.h>
33f4acd3 19#include <linux/input.h>
87dc3648 20#include <linux/leds.h>
35a17444 21#include <linux/ctype.h>
1da177e4 22#include <sound/core.h>
9ad0e496 23#include <sound/jack.h>
be57bfff 24#include <sound/hda_codec.h>
1da177e4 25#include "hda_local.h"
23d30f28 26#include "hda_auto_parser.h"
1835a0f9 27#include "hda_jack.h"
08c189f2 28#include "hda_generic.h"
d3dca026 29#include "hda_component.h"
1da177e4 30
cd63a5ff
TI
31/* keep halting ALC5505 DSP, for power saving */
32#define HALT_REALTEK_ALC5505
33
4a79ba34
TI
34/* extra amp-initialization sequence types */
35enum {
1c76aa5f 36 ALC_INIT_UNDEFINED,
4a79ba34
TI
37 ALC_INIT_NONE,
38 ALC_INIT_DEFAULT,
4a79ba34
TI
39};
40
73bdd597
DH
41enum {
42 ALC_HEADSET_MODE_UNKNOWN,
43 ALC_HEADSET_MODE_UNPLUGGED,
44 ALC_HEADSET_MODE_HEADSET,
45 ALC_HEADSET_MODE_MIC,
46 ALC_HEADSET_MODE_HEADPHONE,
47};
48
49enum {
50 ALC_HEADSET_TYPE_UNKNOWN,
51 ALC_HEADSET_TYPE_CTIA,
52 ALC_HEADSET_TYPE_OMTP,
53};
54
c7b60a89
HW
55enum {
56 ALC_KEY_MICMUTE_INDEX,
57};
58
da00c244
KY
59struct alc_customize_define {
60 unsigned int sku_cfg;
61 unsigned char port_connectivity;
62 unsigned char check_sum;
63 unsigned char customization;
64 unsigned char external_amp;
65 unsigned int enable_pcbeep:1;
66 unsigned int platform_type:1;
67 unsigned int swap:1;
68 unsigned int override:1;
90622917 69 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
da00c244
KY
70};
71
766538ac
TI
72struct alc_coef_led {
73 unsigned int idx;
74 unsigned int mask;
75 unsigned int on;
76 unsigned int off;
77};
78
1da177e4 79struct alc_spec {
08c189f2 80 struct hda_gen_spec gen; /* must be at head */
23d30f28 81
1da177e4 82 /* codec parameterization */
da00c244 83 struct alc_customize_define cdefine;
08c189f2 84 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
834be88d 85
5579cd6f
TI
86 /* GPIO bits */
87 unsigned int gpio_mask;
88 unsigned int gpio_dir;
89 unsigned int gpio_data;
215c850c 90 bool gpio_write_delay; /* add a delay before writing gpio_data */
5579cd6f 91
8d3d1ece 92 /* mute LED for HP laptops, see vref_mute_led_set() */
08fb0d0e 93 int mute_led_polarity;
dbd13179 94 int micmute_led_polarity;
08fb0d0e 95 hda_nid_t mute_led_nid;
9c5dc3bf 96 hda_nid_t cap_mute_led_nid;
08fb0d0e 97
0f32fd19
TI
98 unsigned int gpio_mute_led_mask;
99 unsigned int gpio_mic_led_mask;
766538ac
TI
100 struct alc_coef_led mute_led_coef;
101 struct alc_coef_led mic_led_coef;
b837a9f5 102 struct mutex coef_mutex;
9f5c6faf 103
73bdd597
DH
104 hda_nid_t headset_mic_pin;
105 hda_nid_t headphone_mic_pin;
106 int current_headset_mode;
107 int current_headset_type;
108
ae6b813a
TI
109 /* hooks */
110 void (*init_hook)(struct hda_codec *codec);
83012a7c 111#ifdef CONFIG_PM
c97259df 112 void (*power_hook)(struct hda_codec *codec);
f5de24b0 113#endif
1c716153 114 void (*shutup)(struct hda_codec *codec);
d922b51d 115
4a79ba34 116 int init_amp;
d433a678 117 int codec_variant; /* flag for other variants */
97a26570
KY
118 unsigned int has_alc5505_dsp:1;
119 unsigned int no_depop_delay:1;
693abe11 120 unsigned int done_hp_init:1;
c0ca5ece 121 unsigned int no_shutup_pins:1;
d3ba58bb 122 unsigned int ultra_low_power:1;
476c02e0 123 unsigned int has_hs_key:1;
92666d45 124 unsigned int no_internal_mic_pin:1;
e64f14f4 125
2c3bf9ab
TI
126 /* for PLL fix */
127 hda_nid_t pll_nid;
128 unsigned int pll_coef_idx, pll_coef_bit;
1bb7e43e 129 unsigned int coef0;
33f4acd3 130 struct input_dev *kb_dev;
c7b60a89 131 u8 alc_mute_keycode_map[1];
d3dca026
LT
132
133 /* component binding */
134 struct component_match *match;
135 struct hda_component comps[HDA_MAX_COMPONENTS];
df694daa
KY
136};
137
f2a227cd
TI
138/*
139 * COEF access helper functions
140 */
141
2a845837
TI
142static void coef_mutex_lock(struct hda_codec *codec)
143{
144 struct alc_spec *spec = codec->spec;
145
146 snd_hda_power_up_pm(codec);
147 mutex_lock(&spec->coef_mutex);
148}
149
150static void coef_mutex_unlock(struct hda_codec *codec)
151{
152 struct alc_spec *spec = codec->spec;
153
154 mutex_unlock(&spec->coef_mutex);
155 snd_hda_power_down_pm(codec);
156}
157
b837a9f5
TI
158static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
159 unsigned int coef_idx)
f2a227cd
TI
160{
161 unsigned int val;
162
163 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
164 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
165 return val;
166}
167
b837a9f5
TI
168static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
169 unsigned int coef_idx)
170{
b837a9f5
TI
171 unsigned int val;
172
2a845837 173 coef_mutex_lock(codec);
b837a9f5 174 val = __alc_read_coefex_idx(codec, nid, coef_idx);
2a845837 175 coef_mutex_unlock(codec);
b837a9f5
TI
176 return val;
177}
178
f2a227cd
TI
179#define alc_read_coef_idx(codec, coef_idx) \
180 alc_read_coefex_idx(codec, 0x20, coef_idx)
181
b837a9f5
TI
182static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
183 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
184{
185 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
186 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
187}
188
b837a9f5
TI
189static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
190 unsigned int coef_idx, unsigned int coef_val)
191{
2a845837 192 coef_mutex_lock(codec);
b837a9f5 193 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
2a845837 194 coef_mutex_unlock(codec);
b837a9f5
TI
195}
196
f2a227cd
TI
197#define alc_write_coef_idx(codec, coef_idx, coef_val) \
198 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
199
b837a9f5
TI
200static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
201 unsigned int coef_idx, unsigned int mask,
202 unsigned int bits_set)
203{
204 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
205
206 if (val != -1)
207 __alc_write_coefex_idx(codec, nid, coef_idx,
208 (val & ~mask) | bits_set);
209}
210
98b24883
TI
211static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
212 unsigned int coef_idx, unsigned int mask,
213 unsigned int bits_set)
214{
2a845837 215 coef_mutex_lock(codec);
b837a9f5 216 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
2a845837 217 coef_mutex_unlock(codec);
98b24883
TI
218}
219
220#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
221 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
222
f2a227cd
TI
223/* a special bypass for COEF 0; read the cached value at the second time */
224static unsigned int alc_get_coef0(struct hda_codec *codec)
225{
226 struct alc_spec *spec = codec->spec;
227
228 if (!spec->coef0)
229 spec->coef0 = alc_read_coef_idx(codec, 0);
230 return spec->coef0;
231}
232
54db6c39
TI
233/* coef writes/updates batch */
234struct coef_fw {
235 unsigned char nid;
236 unsigned char idx;
237 unsigned short mask;
238 unsigned short val;
239};
240
241#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
242 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
243#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
244#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
245#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
246
247static void alc_process_coef_fw(struct hda_codec *codec,
248 const struct coef_fw *fw)
249{
2a845837 250 coef_mutex_lock(codec);
54db6c39
TI
251 for (; fw->nid; fw++) {
252 if (fw->mask == (unsigned short)-1)
b837a9f5 253 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 254 else
b837a9f5
TI
255 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
256 fw->mask, fw->val);
54db6c39 257 }
2a845837 258 coef_mutex_unlock(codec);
54db6c39
TI
259}
260
df694daa 261/*
1d045db9 262 * GPIO setup tables, used in initialization
df694daa 263 */
5579cd6f 264
bc9f98a9 265/* Enable GPIO mask and set output */
5579cd6f
TI
266static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
267{
268 struct alc_spec *spec = codec->spec;
bc9f98a9 269
5579cd6f
TI
270 spec->gpio_mask |= mask;
271 spec->gpio_dir |= mask;
272 spec->gpio_data |= mask;
273}
bc9f98a9 274
5579cd6f
TI
275static void alc_write_gpio_data(struct hda_codec *codec)
276{
277 struct alc_spec *spec = codec->spec;
278
279 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
280 spec->gpio_data);
281}
282
aaf312de
TI
283static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
284 bool on)
285{
286 struct alc_spec *spec = codec->spec;
287 unsigned int oldval = spec->gpio_data;
288
289 if (on)
290 spec->gpio_data |= mask;
291 else
292 spec->gpio_data &= ~mask;
293 if (oldval != spec->gpio_data)
294 alc_write_gpio_data(codec);
295}
296
5579cd6f
TI
297static void alc_write_gpio(struct hda_codec *codec)
298{
299 struct alc_spec *spec = codec->spec;
300
301 if (!spec->gpio_mask)
302 return;
303
304 snd_hda_codec_write(codec, codec->core.afg, 0,
305 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
306 snd_hda_codec_write(codec, codec->core.afg, 0,
307 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
308 if (spec->gpio_write_delay)
309 msleep(1);
5579cd6f
TI
310 alc_write_gpio_data(codec);
311}
312
313static void alc_fixup_gpio(struct hda_codec *codec, int action,
314 unsigned int mask)
315{
316 if (action == HDA_FIXUP_ACT_PRE_PROBE)
317 alc_setup_gpio(codec, mask);
318}
319
320static void alc_fixup_gpio1(struct hda_codec *codec,
321 const struct hda_fixup *fix, int action)
322{
323 alc_fixup_gpio(codec, action, 0x01);
324}
325
326static void alc_fixup_gpio2(struct hda_codec *codec,
327 const struct hda_fixup *fix, int action)
328{
329 alc_fixup_gpio(codec, action, 0x02);
330}
331
332static void alc_fixup_gpio3(struct hda_codec *codec,
333 const struct hda_fixup *fix, int action)
334{
335 alc_fixup_gpio(codec, action, 0x03);
336}
bdd148a3 337
ae065f1c
TI
338static void alc_fixup_gpio4(struct hda_codec *codec,
339 const struct hda_fixup *fix, int action)
340{
341 alc_fixup_gpio(codec, action, 0x04);
342}
343
8a503555
TI
344static void alc_fixup_micmute_led(struct hda_codec *codec,
345 const struct hda_fixup *fix, int action)
346{
e65bf997 347 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
348 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
349}
350
2c3bf9ab
TI
351/*
352 * Fix hardware PLL issue
353 * On some codecs, the analog PLL gating control must be off while
354 * the default value is 1.
355 */
356static void alc_fix_pll(struct hda_codec *codec)
357{
358 struct alc_spec *spec = codec->spec;
2c3bf9ab 359
98b24883
TI
360 if (spec->pll_nid)
361 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
362 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
363}
364
365static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
366 unsigned int coef_idx, unsigned int coef_bit)
367{
368 struct alc_spec *spec = codec->spec;
369 spec->pll_nid = nid;
370 spec->pll_coef_idx = coef_idx;
371 spec->pll_coef_bit = coef_bit;
372 alc_fix_pll(codec);
373}
374
cf5a2279 375/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
376static void alc_update_knob_master(struct hda_codec *codec,
377 struct hda_jack_callback *jack)
cf5a2279
TI
378{
379 unsigned int val;
380 struct snd_kcontrol *kctl;
381 struct snd_ctl_elem_value *uctl;
382
383 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
384 if (!kctl)
385 return;
386 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
387 if (!uctl)
388 return;
2ebab40e 389 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
390 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
391 val &= HDA_AMP_VOLMASK;
392 uctl->value.integer.value[0] = val;
393 uctl->value.integer.value[1] = val;
394 kctl->put(kctl, uctl);
395 kfree(uctl);
396}
397
29adc4b9 398static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 399{
29adc4b9
DH
400 /* For some reason, the res given from ALC880 is broken.
401 Here we adjust it properly. */
402 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
403}
404
394c97f8
KY
405/* Change EAPD to verb control */
406static void alc_fill_eapd_coef(struct hda_codec *codec)
407{
408 int coef;
409
410 coef = alc_get_coef0(codec);
411
7639a06c 412 switch (codec->core.vendor_id) {
394c97f8
KY
413 case 0x10ec0262:
414 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
415 break;
416 case 0x10ec0267:
417 case 0x10ec0268:
418 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
419 break;
420 case 0x10ec0269:
421 if ((coef & 0x00f0) == 0x0010)
422 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
423 if ((coef & 0x00f0) == 0x0020)
424 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
425 if ((coef & 0x00f0) == 0x0030)
426 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
427 break;
428 case 0x10ec0280:
429 case 0x10ec0284:
430 case 0x10ec0290:
431 case 0x10ec0292:
432 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
433 break;
4231430d 434 case 0x10ec0225:
44be77c5
TI
435 case 0x10ec0295:
436 case 0x10ec0299:
437 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 438 fallthrough;
44be77c5 439 case 0x10ec0215:
1948fc06 440 case 0x10ec0230:
394c97f8 441 case 0x10ec0233:
ea04a1db 442 case 0x10ec0235:
c4473744 443 case 0x10ec0236:
7fbdcd83 444 case 0x10ec0245:
394c97f8 445 case 0x10ec0255:
c4473744 446 case 0x10ec0256:
527f4643 447 case 0x19e58326:
f429e7e4 448 case 0x10ec0257:
394c97f8
KY
449 case 0x10ec0282:
450 case 0x10ec0283:
451 case 0x10ec0286:
452 case 0x10ec0288:
0a6f0600 453 case 0x10ec0285:
506b62c3 454 case 0x10ec0298:
0a6f0600 455 case 0x10ec0289:
1078bef0 456 case 0x10ec0300:
394c97f8
KY
457 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
458 break;
3aabf94c
KY
459 case 0x10ec0275:
460 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
461 break;
8822702f
HW
462 case 0x10ec0287:
463 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
464 alc_write_coef_idx(codec, 0x8, 0x4ab7);
465 break;
394c97f8
KY
466 case 0x10ec0293:
467 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
468 break;
dcd4f0db
KY
469 case 0x10ec0234:
470 case 0x10ec0274:
471 case 0x10ec0294:
6fbae35a
KY
472 case 0x10ec0700:
473 case 0x10ec0701:
474 case 0x10ec0703:
83629532 475 case 0x10ec0711:
dcd4f0db
KY
476 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
477 break;
394c97f8
KY
478 case 0x10ec0662:
479 if ((coef & 0x00f0) == 0x0030)
480 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
481 break;
482 case 0x10ec0272:
483 case 0x10ec0273:
484 case 0x10ec0663:
485 case 0x10ec0665:
486 case 0x10ec0670:
487 case 0x10ec0671:
488 case 0x10ec0672:
489 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
490 break;
9194a1eb 491 case 0x10ec0222:
f0778871
KY
492 case 0x10ec0623:
493 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
494 break;
394c97f8
KY
495 case 0x10ec0668:
496 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
497 break;
498 case 0x10ec0867:
499 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
500 break;
501 case 0x10ec0888:
502 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
503 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
504 break;
505 case 0x10ec0892:
e5782a5d 506 case 0x10ec0897:
394c97f8
KY
507 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
508 break;
509 case 0x10ec0899:
510 case 0x10ec0900:
6d9ffcff 511 case 0x10ec0b00:
65553b12 512 case 0x10ec1168:
a535ad57 513 case 0x10ec1220:
394c97f8
KY
514 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
515 break;
516 }
517}
518
f9423e7a
KY
519/* additional initialization for ALC888 variants */
520static void alc888_coef_init(struct hda_codec *codec)
521{
1df8874b
KY
522 switch (alc_get_coef0(codec) & 0x00f0) {
523 /* alc888-VA */
524 case 0x00:
525 /* alc888-VB */
526 case 0x10:
527 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
528 break;
529 }
87a8c370
JK
530}
531
3fb4a508
TI
532/* turn on/off EAPD control (only if available) */
533static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
534{
535 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
536 return;
537 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
538 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
539 on ? 2 : 0);
540}
541
691f1fcc
TI
542/* turn on/off EAPD controls of the codec */
543static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
544{
545 /* We currently only handle front, HP */
caf3c043 546 static const hda_nid_t pins[] = {
af95b414 547 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 548 };
caf3c043 549 const hda_nid_t *p;
39fa84e9
TI
550 for (p = pins; *p; p++)
551 set_eapd(codec, *p, on);
691f1fcc
TI
552}
553
dad3197d
KY
554static int find_ext_mic_pin(struct hda_codec *codec);
555
556static void alc_headset_mic_no_shutup(struct hda_codec *codec)
557{
558 const struct hda_pincfg *pin;
559 int mic_pin = find_ext_mic_pin(codec);
560 int i;
561
562 /* don't shut up pins when unloading the driver; otherwise it breaks
563 * the default pin setup at the next load of the driver
564 */
565 if (codec->bus->shutdown)
566 return;
567
568 snd_array_for_each(&codec->init_pins, i, pin) {
569 /* use read here for syncing after issuing each verb */
570 if (pin->nid != mic_pin)
571 snd_hda_codec_read(codec, pin->nid, 0,
572 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
573 }
574
575 codec->pins_shutup = 1;
576}
577
c0ca5ece
TI
578static void alc_shutup_pins(struct hda_codec *codec)
579{
580 struct alc_spec *spec = codec->spec;
581
dad3197d 582 switch (codec->core.vendor_id) {
5aec9891
KY
583 case 0x10ec0236:
584 case 0x10ec0256:
527f4643 585 case 0x19e58326:
66c5d718 586 case 0x10ec0283:
dad3197d
KY
587 case 0x10ec0286:
588 case 0x10ec0288:
589 case 0x10ec0298:
590 alc_headset_mic_no_shutup(codec);
591 break;
592 default:
593 if (!spec->no_shutup_pins)
594 snd_hda_shutup_pins(codec);
595 break;
596 }
c0ca5ece
TI
597}
598
1c716153 599/* generic shutup callback;
4ce8e6a5 600 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
601 */
602static void alc_eapd_shutup(struct hda_codec *codec)
603{
97a26570
KY
604 struct alc_spec *spec = codec->spec;
605
1c716153 606 alc_auto_setup_eapd(codec, false);
97a26570
KY
607 if (!spec->no_depop_delay)
608 msleep(200);
c0ca5ece 609 alc_shutup_pins(codec);
1c716153
TI
610}
611
1d045db9 612/* generic EAPD initialization */
4a79ba34 613static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 614{
39fa84e9 615 alc_auto_setup_eapd(codec, true);
5579cd6f 616 alc_write_gpio(codec);
4a79ba34 617 switch (type) {
4a79ba34 618 case ALC_INIT_DEFAULT:
7639a06c 619 switch (codec->core.vendor_id) {
c9b58006 620 case 0x10ec0260:
98b24883 621 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 622 break;
c9b58006
KY
623 case 0x10ec0880:
624 case 0x10ec0882:
625 case 0x10ec0883:
626 case 0x10ec0885:
1df8874b 627 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 628 break;
f9423e7a 629 case 0x10ec0888:
4a79ba34 630 alc888_coef_init(codec);
f9423e7a 631 break;
bc9f98a9 632 }
4a79ba34
TI
633 break;
634 }
635}
636
35a39f98
TI
637/* get a primary headphone pin if available */
638static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
639{
640 if (spec->gen.autocfg.hp_pins[0])
641 return spec->gen.autocfg.hp_pins[0];
642 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
643 return spec->gen.autocfg.line_out_pins[0];
644 return 0;
645}
08c189f2 646
1d045db9 647/*
08c189f2 648 * Realtek SSID verification
1d045db9 649 */
42cf0d01 650
08c189f2
TI
651/* Could be any non-zero and even value. When used as fixup, tells
652 * the driver to ignore any present sku defines.
653 */
654#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 655
08c189f2
TI
656static void alc_fixup_sku_ignore(struct hda_codec *codec,
657 const struct hda_fixup *fix, int action)
1a1455de 658{
1a1455de 659 struct alc_spec *spec = codec->spec;
08c189f2
TI
660 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
661 spec->cdefine.fixup = 1;
662 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 663 }
1a1455de
TI
664}
665
b5c6611f
ML
666static void alc_fixup_no_depop_delay(struct hda_codec *codec,
667 const struct hda_fixup *fix, int action)
668{
669 struct alc_spec *spec = codec->spec;
670
84d2dc3e 671 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 672 spec->no_depop_delay = 1;
84d2dc3e
ML
673 codec->depop_delay = 0;
674 }
b5c6611f
ML
675}
676
08c189f2 677static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 678{
08c189f2
TI
679 unsigned int ass, tmp, i;
680 unsigned nid = 0;
4a79ba34
TI
681 struct alc_spec *spec = codec->spec;
682
08c189f2 683 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 684
08c189f2
TI
685 if (spec->cdefine.fixup) {
686 ass = spec->cdefine.sku_cfg;
687 if (ass == ALC_FIXUP_SKU_IGNORE)
688 return -1;
689 goto do_sku;
bb35febd
TI
690 }
691
5100cd07
TI
692 if (!codec->bus->pci)
693 return -1;
7639a06c 694 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
695 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
696 goto do_sku;
4a79ba34 697
08c189f2 698 nid = 0x1d;
7639a06c 699 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
700 nid = 0x17;
701 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 702
08c189f2 703 if (!(ass & 1)) {
4e76a883 704 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 705 codec->core.chip_name, ass);
08c189f2 706 return -1;
42cf0d01
DH
707 }
708
08c189f2
TI
709 /* check sum */
710 tmp = 0;
711 for (i = 1; i < 16; i++) {
712 if ((ass >> i) & 1)
713 tmp++;
ae8a60a5 714 }
08c189f2
TI
715 if (((ass >> 16) & 0xf) != tmp)
716 return -1;
ae8a60a5 717
da00c244
KY
718 spec->cdefine.port_connectivity = ass >> 30;
719 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
720 spec->cdefine.check_sum = (ass >> 16) & 0xf;
721 spec->cdefine.customization = ass >> 8;
722do_sku:
723 spec->cdefine.sku_cfg = ass;
724 spec->cdefine.external_amp = (ass & 0x38) >> 3;
725 spec->cdefine.platform_type = (ass & 0x4) >> 2;
726 spec->cdefine.swap = (ass & 0x2) >> 1;
727 spec->cdefine.override = ass & 0x1;
728
4e76a883 729 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 730 nid, spec->cdefine.sku_cfg);
4e76a883 731 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 732 spec->cdefine.port_connectivity);
4e76a883
TI
733 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
734 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
735 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
736 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
737 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
738 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
739 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
740
741 return 0;
742}
743
08c189f2
TI
744/* return the position of NID in the list, or -1 if not found */
745static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
746{
747 int i;
748 for (i = 0; i < nums; i++)
749 if (list[i] == nid)
750 return i;
751 return -1;
752}
1d045db9 753/* return true if the given NID is found in the list */
3af9ee6b
TI
754static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
755{
21268961 756 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
757}
758
4a79ba34
TI
759/* check subsystem ID and set up device-specific initialization;
760 * return 1 if initialized, 0 if invalid SSID
761 */
762/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
763 * 31 ~ 16 : Manufacture ID
764 * 15 ~ 8 : SKU ID
765 * 7 ~ 0 : Assembly ID
766 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
767 */
58c57cfa 768static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
769{
770 unsigned int ass, tmp, i;
771 unsigned nid;
772 struct alc_spec *spec = codec->spec;
773
90622917
DH
774 if (spec->cdefine.fixup) {
775 ass = spec->cdefine.sku_cfg;
776 if (ass == ALC_FIXUP_SKU_IGNORE)
777 return 0;
778 goto do_sku;
779 }
780
7639a06c 781 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
782 if (codec->bus->pci &&
783 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
784 goto do_sku;
785
786 /* invalid SSID, check the special NID pin defcfg instead */
787 /*
def319f9 788 * 31~30 : port connectivity
4a79ba34
TI
789 * 29~21 : reserve
790 * 20 : PCBEEP input
791 * 19~16 : Check sum (15:1)
792 * 15~1 : Custom
793 * 0 : override
794 */
795 nid = 0x1d;
7639a06c 796 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
797 nid = 0x17;
798 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
799 codec_dbg(codec,
800 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 801 ass, nid);
6227cdce 802 if (!(ass & 1))
4a79ba34
TI
803 return 0;
804 if ((ass >> 30) != 1) /* no physical connection */
805 return 0;
806
807 /* check sum */
808 tmp = 0;
809 for (i = 1; i < 16; i++) {
810 if ((ass >> i) & 1)
811 tmp++;
812 }
813 if (((ass >> 16) & 0xf) != tmp)
814 return 0;
815do_sku:
4e76a883 816 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 817 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
818 /*
819 * 0 : override
820 * 1 : Swap Jack
821 * 2 : 0 --> Desktop, 1 --> Laptop
822 * 3~5 : External Amplifier control
823 * 7~6 : Reserved
824 */
825 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
826 if (spec->init_amp == ALC_INIT_UNDEFINED) {
827 switch (tmp) {
828 case 1:
5579cd6f 829 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
830 break;
831 case 3:
5579cd6f 832 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
833 break;
834 case 7:
2bdccfd2 835 alc_setup_gpio(codec, 0x04);
1c76aa5f
TI
836 break;
837 case 5:
838 default:
839 spec->init_amp = ALC_INIT_DEFAULT;
840 break;
841 }
bc9f98a9 842 }
ea1fb29a 843
8c427226 844 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
845 * when the external headphone out jack is plugged"
846 */
8c427226 847 if (!(ass & 0x8000))
4a79ba34 848 return 1;
c9b58006
KY
849 /*
850 * 10~8 : Jack location
851 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
852 * 14~13: Resvered
853 * 15 : 1 --> enable the function "Mute internal speaker
854 * when the external headphone out jack is plugged"
855 */
35a39f98 856 if (!alc_get_hp_pin(spec)) {
01d4825d 857 hda_nid_t nid;
c9b58006 858 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 859 nid = ports[tmp];
08c189f2
TI
860 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
861 spec->gen.autocfg.line_outs))
3af9ee6b 862 return 1;
08c189f2 863 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 864 }
4a79ba34
TI
865 return 1;
866}
ea1fb29a 867
3e6179b8
TI
868/* Check the validity of ALC subsystem-id
869 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
870static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 871{
58c57cfa 872 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 873 struct alc_spec *spec = codec->spec;
67791202
TI
874 if (spec->init_amp == ALC_INIT_UNDEFINED) {
875 codec_dbg(codec,
876 "realtek: Enable default setup for auto mode as fallback\n");
877 spec->init_amp = ALC_INIT_DEFAULT;
878 }
4a79ba34 879 }
21268961 880}
1a1455de 881
1d045db9 882/*
ef8ef5fb 883 */
f9e336f6 884
9d36a7dc
DH
885static void alc_fixup_inv_dmic(struct hda_codec *codec,
886 const struct hda_fixup *fix, int action)
125821ae
TI
887{
888 struct alc_spec *spec = codec->spec;
668d1e96 889
9d36a7dc 890 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
891}
892
e9edcee0 893
08c189f2 894static int alc_build_controls(struct hda_codec *codec)
1d045db9 895{
a5cb463a 896 int err;
e9427969 897
08c189f2
TI
898 err = snd_hda_gen_build_controls(codec);
899 if (err < 0)
900 return err;
1da177e4 901
1727a771 902 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 903 return 0;
a361d84b
KY
904}
905
a361d84b 906
df694daa 907/*
08c189f2 908 * Common callbacks
df694daa 909 */
a361d84b 910
c9af753f
TI
911static void alc_pre_init(struct hda_codec *codec)
912{
913 alc_fill_eapd_coef(codec);
914}
915
aeac1a0d
KY
916#define is_s3_resume(codec) \
917 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
918#define is_s4_resume(codec) \
919 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
920
08c189f2 921static int alc_init(struct hda_codec *codec)
1d045db9
TI
922{
923 struct alc_spec *spec = codec->spec;
a361d84b 924
c9af753f
TI
925 /* hibernation resume needs the full chip initialization */
926 if (is_s4_resume(codec))
927 alc_pre_init(codec);
928
08c189f2
TI
929 if (spec->init_hook)
930 spec->init_hook(codec);
a361d84b 931
89781d08 932 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 933 snd_hda_gen_init(codec);
08c189f2
TI
934 alc_fix_pll(codec);
935 alc_auto_init_amp(codec, spec->init_amp);
89781d08 936 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 937
1727a771 938 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 939
1d045db9
TI
940 return 0;
941}
a361d84b 942
c3d9ca93
RD
943#define alc_free snd_hda_gen_free
944
945#ifdef CONFIG_PM
08c189f2 946static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
947{
948 struct alc_spec *spec = codec->spec;
a361d84b 949
c7273bd6
TI
950 if (!snd_hda_get_bool_hint(codec, "shutup"))
951 return; /* disabled explicitly by hints */
952
08c189f2
TI
953 if (spec && spec->shutup)
954 spec->shutup(codec);
9bfb2844 955 else
c0ca5ece 956 alc_shutup_pins(codec);
1d045db9
TI
957}
958
08c189f2 959static void alc_power_eapd(struct hda_codec *codec)
1d045db9 960{
08c189f2 961 alc_auto_setup_eapd(codec, false);
1d045db9 962}
2134ea4f 963
08c189f2 964static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
965{
966 struct alc_spec *spec = codec->spec;
08c189f2
TI
967 alc_shutup(codec);
968 if (spec && spec->power_hook)
969 spec->power_hook(codec);
a361d84b
KY
970 return 0;
971}
972
08c189f2 973static int alc_resume(struct hda_codec *codec)
1d045db9 974{
97a26570
KY
975 struct alc_spec *spec = codec->spec;
976
977 if (!spec->no_depop_delay)
978 msleep(150); /* to avoid pop noise */
08c189f2 979 codec->patch_ops.init(codec);
1a462be5 980 snd_hda_regmap_sync(codec);
08c189f2
TI
981 hda_call_check_power_status(codec, 0x01);
982 return 0;
1d045db9 983}
08c189f2 984#endif
f6a92248 985
1d045db9 986/*
1d045db9 987 */
08c189f2
TI
988static const struct hda_codec_ops alc_patch_ops = {
989 .build_controls = alc_build_controls,
990 .build_pcms = snd_hda_gen_build_pcms,
991 .init = alc_init,
992 .free = alc_free,
993 .unsol_event = snd_hda_jack_unsol_event,
994#ifdef CONFIG_PM
995 .resume = alc_resume,
08c189f2 996 .suspend = alc_suspend,
fce52a3b 997 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 998#endif
08c189f2 999};
f6a92248 1000
f53281e6 1001
ded255be 1002#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 1003
e4770629 1004/*
4b016931 1005 * Rename codecs appropriately from COEF value or subvendor id
e4770629 1006 */
08c189f2
TI
1007struct alc_codec_rename_table {
1008 unsigned int vendor_id;
1009 unsigned short coef_mask;
1010 unsigned short coef_bits;
1011 const char *name;
1012};
84898e87 1013
4b016931
KY
1014struct alc_codec_rename_pci_table {
1015 unsigned int codec_vendor_id;
1016 unsigned short pci_subvendor;
1017 unsigned short pci_subdevice;
1018 const char *name;
1019};
1020
6b0f95c4 1021static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1022 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1023 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1024 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1025 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1026 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1027 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1028 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1029 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1030 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1031 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1032 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1033 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1034 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1035 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1036 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1037 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1038 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1039 { } /* terminator */
1040};
84898e87 1041
6b0f95c4 1042static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1043 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1044 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1045 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1046 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1047 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1048 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1049 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1050 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1051 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1052 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1053 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1054 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1055 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1056 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1057 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1058 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1059 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1060 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1061 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1062 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1063 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1064 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1065 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1066 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1067 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1068 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1069 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1070 { } /* terminator */
1071};
1072
08c189f2 1073static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1074{
08c189f2 1075 const struct alc_codec_rename_table *p;
4b016931 1076 const struct alc_codec_rename_pci_table *q;
60db6b53 1077
08c189f2 1078 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1079 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1080 continue;
1081 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1082 return alc_codec_rename(codec, p->name);
1d045db9 1083 }
4b016931 1084
5100cd07
TI
1085 if (!codec->bus->pci)
1086 return 0;
4b016931 1087 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1088 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1089 continue;
1090 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1091 continue;
1092 if (!q->pci_subdevice ||
1093 q->pci_subdevice == codec->bus->pci->subsystem_device)
1094 return alc_codec_rename(codec, q->name);
1095 }
1096
08c189f2 1097 return 0;
1d045db9 1098}
f53281e6 1099
e4770629 1100
1d045db9
TI
1101/*
1102 * Digital-beep handlers
1103 */
1104#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1105
1106/* additional beep mixers; private_value will be overwritten */
1107static const struct snd_kcontrol_new alc_beep_mixer[] = {
1108 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1109 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1110};
1111
1112/* set up and create beep controls */
1113static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1114 int idx, int dir)
1115{
1116 struct snd_kcontrol_new *knew;
1117 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1118 int i;
1119
1120 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1121 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1122 &alc_beep_mixer[i]);
1123 if (!knew)
1124 return -ENOMEM;
1125 knew->private_value = beep_amp;
1126 }
1127 return 0;
1128}
84898e87 1129
6317e5eb 1130static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1131 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1132 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1133 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1134 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1135 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1136 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1137 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1138 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1139 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1140 /* denylist -- no beep available */
051c78af
TI
1141 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1142 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1143 {}
fe3eb0a7
KY
1144};
1145
1d045db9
TI
1146static inline int has_cdefine_beep(struct hda_codec *codec)
1147{
1148 struct alc_spec *spec = codec->spec;
1149 const struct snd_pci_quirk *q;
6317e5eb 1150 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1151 if (q)
1152 return q->value;
1153 return spec->cdefine.enable_pcbeep;
1154}
1155#else
fea80fae 1156#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1157#define has_cdefine_beep(codec) 0
1158#endif
84898e87 1159
1d045db9
TI
1160/* parse the BIOS configuration and set up the alc_spec */
1161/* return 1 if successful, 0 if the proper config is not found,
1162 * or a negative error code
1163 */
3e6179b8
TI
1164static int alc_parse_auto_config(struct hda_codec *codec,
1165 const hda_nid_t *ignore_nids,
1166 const hda_nid_t *ssid_nids)
1d045db9
TI
1167{
1168 struct alc_spec *spec = codec->spec;
08c189f2 1169 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1170 int err;
26f5df26 1171
53c334ad
TI
1172 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1173 spec->parse_flags);
1d045db9
TI
1174 if (err < 0)
1175 return err;
3e6179b8
TI
1176
1177 if (ssid_nids)
1178 alc_ssid_check(codec, ssid_nids);
64154835 1179
08c189f2
TI
1180 err = snd_hda_gen_parse_auto_config(codec, cfg);
1181 if (err < 0)
1182 return err;
070cff4c 1183
1d045db9 1184 return 1;
60db6b53 1185}
f6a92248 1186
3de95173
TI
1187/* common preparation job for alc_spec */
1188static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1189{
1190 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1191 int err;
1192
1193 if (!spec)
1194 return -ENOMEM;
1195 codec->spec = spec;
08c189f2
TI
1196 snd_hda_gen_spec_init(&spec->gen);
1197 spec->gen.mixer_nid = mixer_nid;
1198 spec->gen.own_eapd_ctl = 1;
1098b7c2 1199 codec->single_adc_amp = 1;
08c189f2
TI
1200 /* FIXME: do we need this for all Realtek codec models? */
1201 codec->spdif_status_reset = 1;
a6e7d0a4 1202 codec->forced_resume = 1;
225068ab 1203 codec->patch_ops = alc_patch_ops;
b837a9f5 1204 mutex_init(&spec->coef_mutex);
3de95173
TI
1205
1206 err = alc_codec_rename_from_preset(codec);
1207 if (err < 0) {
1208 kfree(spec);
1209 return err;
1210 }
1211 return 0;
1212}
1213
3e6179b8
TI
1214static int alc880_parse_auto_config(struct hda_codec *codec)
1215{
1216 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1217 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1218 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1219}
1220
ee3b2969
TI
1221/*
1222 * ALC880 fix-ups
1223 */
1224enum {
411225a0 1225 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1226 ALC880_FIXUP_GPIO2,
1227 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1228 ALC880_FIXUP_LG,
db8a38e5 1229 ALC880_FIXUP_LG_LW25,
f02aab5d 1230 ALC880_FIXUP_W810,
27e917f8 1231 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1232 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1233 ALC880_FIXUP_VOL_KNOB,
1234 ALC880_FIXUP_FUJITSU,
ba533818 1235 ALC880_FIXUP_F1734,
817de92f 1236 ALC880_FIXUP_UNIWILL,
967b88c4 1237 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1238 ALC880_FIXUP_Z71V,
487a588d 1239 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1240 ALC880_FIXUP_3ST_BASE,
1241 ALC880_FIXUP_3ST,
1242 ALC880_FIXUP_3ST_DIG,
1243 ALC880_FIXUP_5ST_BASE,
1244 ALC880_FIXUP_5ST,
1245 ALC880_FIXUP_5ST_DIG,
1246 ALC880_FIXUP_6ST_BASE,
1247 ALC880_FIXUP_6ST,
1248 ALC880_FIXUP_6ST_DIG,
5397145f 1249 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1250};
1251
cf5a2279
TI
1252/* enable the volume-knob widget support on NID 0x21 */
1253static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1254 const struct hda_fixup *fix, int action)
cf5a2279 1255{
1727a771 1256 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1257 snd_hda_jack_detect_enable_callback(codec, 0x21,
1258 alc_update_knob_master);
cf5a2279
TI
1259}
1260
1727a771 1261static const struct hda_fixup alc880_fixups[] = {
411225a0 1262 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1263 .type = HDA_FIXUP_FUNC,
1264 .v.func = alc_fixup_gpio1,
411225a0 1265 },
ee3b2969 1266 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1267 .type = HDA_FIXUP_FUNC,
1268 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1269 },
1270 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1271 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1272 .v.verbs = (const struct hda_verb[]) {
1273 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1274 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1275 { }
1276 },
1277 .chained = true,
1278 .chain_id = ALC880_FIXUP_GPIO2,
1279 },
dc6af52d 1280 [ALC880_FIXUP_LG] = {
1727a771
TI
1281 .type = HDA_FIXUP_PINS,
1282 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1283 /* disable bogus unused pins */
1284 { 0x16, 0x411111f0 },
1285 { 0x18, 0x411111f0 },
1286 { 0x1a, 0x411111f0 },
1287 { }
1288 }
1289 },
db8a38e5
TI
1290 [ALC880_FIXUP_LG_LW25] = {
1291 .type = HDA_FIXUP_PINS,
1292 .v.pins = (const struct hda_pintbl[]) {
1293 { 0x1a, 0x0181344f }, /* line-in */
1294 { 0x1b, 0x0321403f }, /* headphone */
1295 { }
1296 }
1297 },
f02aab5d 1298 [ALC880_FIXUP_W810] = {
1727a771
TI
1299 .type = HDA_FIXUP_PINS,
1300 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1301 /* disable bogus unused pins */
1302 { 0x17, 0x411111f0 },
1303 { }
1304 },
1305 .chained = true,
1306 .chain_id = ALC880_FIXUP_GPIO2,
1307 },
27e917f8 1308 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1309 .type = HDA_FIXUP_VERBS,
27e917f8
TI
1310 .v.verbs = (const struct hda_verb[]) {
1311 /* change to EAPD mode */
1312 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1313 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1314 {}
1315 },
1316 },
b9368f5c 1317 [ALC880_FIXUP_TCL_S700] = {
1727a771 1318 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1319 .v.verbs = (const struct hda_verb[]) {
1320 /* change to EAPD mode */
1321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1322 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1323 {}
1324 },
1325 .chained = true,
1326 .chain_id = ALC880_FIXUP_GPIO2,
1327 },
cf5a2279 1328 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1329 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1330 .v.func = alc880_fixup_vol_knob,
1331 },
1332 [ALC880_FIXUP_FUJITSU] = {
1333 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1334 .type = HDA_FIXUP_PINS,
1335 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1336 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1337 { 0x15, 0x99030120 }, /* speaker */
1338 { 0x16, 0x99030130 }, /* bass speaker */
1339 { 0x17, 0x411111f0 }, /* N/A */
1340 { 0x18, 0x411111f0 }, /* N/A */
1341 { 0x19, 0x01a19950 }, /* mic-in */
1342 { 0x1a, 0x411111f0 }, /* N/A */
1343 { 0x1b, 0x411111f0 }, /* N/A */
1344 { 0x1c, 0x411111f0 }, /* N/A */
1345 { 0x1d, 0x411111f0 }, /* N/A */
1346 { 0x1e, 0x01454140 }, /* SPDIF out */
1347 { }
1348 },
1349 .chained = true,
1350 .chain_id = ALC880_FIXUP_VOL_KNOB,
1351 },
ba533818
TI
1352 [ALC880_FIXUP_F1734] = {
1353 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1354 .type = HDA_FIXUP_PINS,
1355 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1356 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1357 { 0x15, 0x99030120 }, /* speaker */
1358 { 0x16, 0x411111f0 }, /* N/A */
1359 { 0x17, 0x411111f0 }, /* N/A */
1360 { 0x18, 0x411111f0 }, /* N/A */
1361 { 0x19, 0x01a19950 }, /* mic-in */
1362 { 0x1a, 0x411111f0 }, /* N/A */
1363 { 0x1b, 0x411111f0 }, /* N/A */
1364 { 0x1c, 0x411111f0 }, /* N/A */
1365 { 0x1d, 0x411111f0 }, /* N/A */
1366 { 0x1e, 0x411111f0 }, /* N/A */
1367 { }
1368 },
1369 .chained = true,
1370 .chain_id = ALC880_FIXUP_VOL_KNOB,
1371 },
817de92f
TI
1372 [ALC880_FIXUP_UNIWILL] = {
1373 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1374 .type = HDA_FIXUP_PINS,
1375 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1376 { 0x14, 0x0121411f }, /* HP */
1377 { 0x15, 0x99030120 }, /* speaker */
1378 { 0x16, 0x99030130 }, /* bass speaker */
1379 { }
1380 },
1381 },
967b88c4 1382 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1383 .type = HDA_FIXUP_PINS,
1384 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1385 /* disable bogus unused pins */
1386 { 0x17, 0x411111f0 },
1387 { 0x19, 0x411111f0 },
1388 { 0x1b, 0x411111f0 },
1389 { 0x1f, 0x411111f0 },
1390 { }
1391 }
1392 },
96e225f6 1393 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1394 .type = HDA_FIXUP_PINS,
1395 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1396 /* set up the whole pins as BIOS is utterly broken */
1397 { 0x14, 0x99030120 }, /* speaker */
1398 { 0x15, 0x0121411f }, /* HP */
1399 { 0x16, 0x411111f0 }, /* N/A */
1400 { 0x17, 0x411111f0 }, /* N/A */
1401 { 0x18, 0x01a19950 }, /* mic-in */
1402 { 0x19, 0x411111f0 }, /* N/A */
1403 { 0x1a, 0x01813031 }, /* line-in */
1404 { 0x1b, 0x411111f0 }, /* N/A */
1405 { 0x1c, 0x411111f0 }, /* N/A */
1406 { 0x1d, 0x411111f0 }, /* N/A */
1407 { 0x1e, 0x0144111e }, /* SPDIF */
1408 { }
1409 }
1410 },
487a588d
TI
1411 [ALC880_FIXUP_ASUS_W5A] = {
1412 .type = HDA_FIXUP_PINS,
1413 .v.pins = (const struct hda_pintbl[]) {
1414 /* set up the whole pins as BIOS is utterly broken */
1415 { 0x14, 0x0121411f }, /* HP */
1416 { 0x15, 0x411111f0 }, /* N/A */
1417 { 0x16, 0x411111f0 }, /* N/A */
1418 { 0x17, 0x411111f0 }, /* N/A */
1419 { 0x18, 0x90a60160 }, /* mic */
1420 { 0x19, 0x411111f0 }, /* N/A */
1421 { 0x1a, 0x411111f0 }, /* N/A */
1422 { 0x1b, 0x411111f0 }, /* N/A */
1423 { 0x1c, 0x411111f0 }, /* N/A */
1424 { 0x1d, 0x411111f0 }, /* N/A */
1425 { 0x1e, 0xb743111e }, /* SPDIF out */
1426 { }
1427 },
1428 .chained = true,
1429 .chain_id = ALC880_FIXUP_GPIO1,
1430 },
67b6ec31 1431 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1432 .type = HDA_FIXUP_PINS,
1433 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1434 { 0x14, 0x01014010 }, /* line-out */
1435 { 0x15, 0x411111f0 }, /* N/A */
1436 { 0x16, 0x411111f0 }, /* N/A */
1437 { 0x17, 0x411111f0 }, /* N/A */
1438 { 0x18, 0x01a19c30 }, /* mic-in */
1439 { 0x19, 0x0121411f }, /* HP */
1440 { 0x1a, 0x01813031 }, /* line-in */
1441 { 0x1b, 0x02a19c40 }, /* front-mic */
1442 { 0x1c, 0x411111f0 }, /* N/A */
1443 { 0x1d, 0x411111f0 }, /* N/A */
1444 /* 0x1e is filled in below */
1445 { 0x1f, 0x411111f0 }, /* N/A */
1446 { }
1447 }
1448 },
1449 [ALC880_FIXUP_3ST] = {
1727a771
TI
1450 .type = HDA_FIXUP_PINS,
1451 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1452 { 0x1e, 0x411111f0 }, /* N/A */
1453 { }
1454 },
1455 .chained = true,
1456 .chain_id = ALC880_FIXUP_3ST_BASE,
1457 },
1458 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1459 .type = HDA_FIXUP_PINS,
1460 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1461 { 0x1e, 0x0144111e }, /* SPDIF */
1462 { }
1463 },
1464 .chained = true,
1465 .chain_id = ALC880_FIXUP_3ST_BASE,
1466 },
1467 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1468 .type = HDA_FIXUP_PINS,
1469 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1470 { 0x14, 0x01014010 }, /* front */
1471 { 0x15, 0x411111f0 }, /* N/A */
1472 { 0x16, 0x01011411 }, /* CLFE */
1473 { 0x17, 0x01016412 }, /* surr */
1474 { 0x18, 0x01a19c30 }, /* mic-in */
1475 { 0x19, 0x0121411f }, /* HP */
1476 { 0x1a, 0x01813031 }, /* line-in */
1477 { 0x1b, 0x02a19c40 }, /* front-mic */
1478 { 0x1c, 0x411111f0 }, /* N/A */
1479 { 0x1d, 0x411111f0 }, /* N/A */
1480 /* 0x1e is filled in below */
1481 { 0x1f, 0x411111f0 }, /* N/A */
1482 { }
1483 }
1484 },
1485 [ALC880_FIXUP_5ST] = {
1727a771
TI
1486 .type = HDA_FIXUP_PINS,
1487 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1488 { 0x1e, 0x411111f0 }, /* N/A */
1489 { }
1490 },
1491 .chained = true,
1492 .chain_id = ALC880_FIXUP_5ST_BASE,
1493 },
1494 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1495 .type = HDA_FIXUP_PINS,
1496 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1497 { 0x1e, 0x0144111e }, /* SPDIF */
1498 { }
1499 },
1500 .chained = true,
1501 .chain_id = ALC880_FIXUP_5ST_BASE,
1502 },
1503 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1504 .type = HDA_FIXUP_PINS,
1505 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1506 { 0x14, 0x01014010 }, /* front */
1507 { 0x15, 0x01016412 }, /* surr */
1508 { 0x16, 0x01011411 }, /* CLFE */
1509 { 0x17, 0x01012414 }, /* side */
1510 { 0x18, 0x01a19c30 }, /* mic-in */
1511 { 0x19, 0x02a19c40 }, /* front-mic */
1512 { 0x1a, 0x01813031 }, /* line-in */
1513 { 0x1b, 0x0121411f }, /* HP */
1514 { 0x1c, 0x411111f0 }, /* N/A */
1515 { 0x1d, 0x411111f0 }, /* N/A */
1516 /* 0x1e is filled in below */
1517 { 0x1f, 0x411111f0 }, /* N/A */
1518 { }
1519 }
1520 },
1521 [ALC880_FIXUP_6ST] = {
1727a771
TI
1522 .type = HDA_FIXUP_PINS,
1523 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1524 { 0x1e, 0x411111f0 }, /* N/A */
1525 { }
1526 },
1527 .chained = true,
1528 .chain_id = ALC880_FIXUP_6ST_BASE,
1529 },
1530 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1531 .type = HDA_FIXUP_PINS,
1532 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1533 { 0x1e, 0x0144111e }, /* SPDIF */
1534 { }
1535 },
1536 .chained = true,
1537 .chain_id = ALC880_FIXUP_6ST_BASE,
1538 },
5397145f
TI
1539 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1540 .type = HDA_FIXUP_PINS,
1541 .v.pins = (const struct hda_pintbl[]) {
1542 { 0x1b, 0x0121401f }, /* HP with jack detect */
1543 { }
1544 },
1545 .chained_before = true,
1546 .chain_id = ALC880_FIXUP_6ST_BASE,
1547 },
ee3b2969
TI
1548};
1549
1550static const struct snd_pci_quirk alc880_fixup_tbl[] = {
f02aab5d 1551 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1552 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1553 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1554 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1555 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1556 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1557 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1558 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1559 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1560 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1561 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1562 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1563 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1564 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1565 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1566 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1567 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1568 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1569 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1570 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1571 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1572 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1573 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1574
1575 /* Below is the copied entries from alc880_quirks.c.
1576 * It's not quite sure whether BIOS sets the correct pin-config table
1577 * on these machines, thus they are kept to be compatible with
1578 * the old static quirks. Once when it's confirmed to work without
1579 * these overrides, it'd be better to remove.
1580 */
1581 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1582 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1583 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1584 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1585 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1586 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1587 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1588 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1589 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1590 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1591 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1592 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1593 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1594 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1595 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1596 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1597 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1598 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1599 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1600 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1601 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1602 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1603 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1604 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1605 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1608 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1609 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1610 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1611 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1613 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 /* default Intel */
1615 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1616 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1617 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1618 {}
1619};
1620
1727a771 1621static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1622 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1623 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1624 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1625 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1626 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1627 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1628 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1629 {}
1630};
1631
1632
1d045db9
TI
1633/*
1634 * OK, here we have finally the patch for ALC880
1635 */
1d045db9 1636static int patch_alc880(struct hda_codec *codec)
60db6b53 1637{
1d045db9 1638 struct alc_spec *spec;
1d045db9 1639 int err;
f6a92248 1640
3de95173
TI
1641 err = alc_alloc_spec(codec, 0x0b);
1642 if (err < 0)
1643 return err;
64154835 1644
3de95173 1645 spec = codec->spec;
08c189f2 1646 spec->gen.need_dac_fix = 1;
7504b6cd 1647 spec->gen.beep_nid = 0x01;
f53281e6 1648
225068ab
TI
1649 codec->patch_ops.unsol_event = alc880_unsol_event;
1650
c9af753f
TI
1651 alc_pre_init(codec);
1652
1727a771 1653 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1654 alc880_fixups);
1727a771 1655 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1656
67b6ec31
TI
1657 /* automatic parse from the BIOS config */
1658 err = alc880_parse_auto_config(codec);
1659 if (err < 0)
1660 goto error;
fe3eb0a7 1661
fea80fae
TI
1662 if (!spec->gen.no_analog) {
1663 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1664 if (err < 0)
1665 goto error;
1666 }
f53281e6 1667
1727a771 1668 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1669
1d045db9 1670 return 0;
e16fb6d1
TI
1671
1672 error:
1673 alc_free(codec);
1674 return err;
226b1ec8
KY
1675}
1676
1d045db9 1677
60db6b53 1678/*
1d045db9 1679 * ALC260 support
60db6b53 1680 */
1d045db9 1681static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1682{
1d045db9 1683 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1684 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1685 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1686}
1687
1d045db9
TI
1688/*
1689 * Pin config fixes
1690 */
1691enum {
ca8f0424
TI
1692 ALC260_FIXUP_HP_DC5750,
1693 ALC260_FIXUP_HP_PIN_0F,
1694 ALC260_FIXUP_COEF,
15317ab2 1695 ALC260_FIXUP_GPIO1,
20f7d928
TI
1696 ALC260_FIXUP_GPIO1_TOGGLE,
1697 ALC260_FIXUP_REPLACER,
0a1c4fa2 1698 ALC260_FIXUP_HP_B1900,
118cb4a4 1699 ALC260_FIXUP_KN1,
39aedee7 1700 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1701 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1702 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1703};
1704
20f7d928
TI
1705static void alc260_gpio1_automute(struct hda_codec *codec)
1706{
1707 struct alc_spec *spec = codec->spec;
aaf312de
TI
1708
1709 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1710}
1711
1712static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1713 const struct hda_fixup *fix, int action)
20f7d928
TI
1714{
1715 struct alc_spec *spec = codec->spec;
1727a771 1716 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1717 /* although the machine has only one output pin, we need to
1718 * toggle GPIO1 according to the jack state
1719 */
08c189f2
TI
1720 spec->gen.automute_hook = alc260_gpio1_automute;
1721 spec->gen.detect_hp = 1;
1722 spec->gen.automute_speaker = 1;
1723 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1724 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1725 snd_hda_gen_hp_automute);
5579cd6f 1726 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1727 }
1728}
1729
118cb4a4 1730static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1731 const struct hda_fixup *fix, int action)
118cb4a4
TI
1732{
1733 struct alc_spec *spec = codec->spec;
1727a771 1734 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1735 { 0x0f, 0x02214000 }, /* HP/speaker */
1736 { 0x12, 0x90a60160 }, /* int mic */
1737 { 0x13, 0x02a19000 }, /* ext mic */
1738 { 0x18, 0x01446000 }, /* SPDIF out */
1739 /* disable bogus I/O pins */
1740 { 0x10, 0x411111f0 },
1741 { 0x11, 0x411111f0 },
1742 { 0x14, 0x411111f0 },
1743 { 0x15, 0x411111f0 },
1744 { 0x16, 0x411111f0 },
1745 { 0x17, 0x411111f0 },
1746 { 0x19, 0x411111f0 },
1747 { }
1748 };
1749
1750 switch (action) {
1727a771
TI
1751 case HDA_FIXUP_ACT_PRE_PROBE:
1752 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1753 spec->init_amp = ALC_INIT_NONE;
1754 break;
1755 }
1756}
1757
39aedee7
TI
1758static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1759 const struct hda_fixup *fix, int action)
1760{
1761 struct alc_spec *spec = codec->spec;
1c76aa5f 1762 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1763 spec->init_amp = ALC_INIT_NONE;
1764}
39aedee7 1765
5ebd3bbd
TI
1766static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1767 const struct hda_fixup *fix, int action)
1768{
1769 struct alc_spec *spec = codec->spec;
1770 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1771 spec->gen.add_jack_modes = 1;
5ebd3bbd 1772 spec->gen.hp_mic = 1;
e6e0ee50 1773 }
39aedee7
TI
1774}
1775
1727a771 1776static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1777 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1778 .type = HDA_FIXUP_PINS,
1779 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1780 { 0x11, 0x90130110 }, /* speaker */
1781 { }
1782 }
1783 },
ca8f0424 1784 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1785 .type = HDA_FIXUP_PINS,
1786 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1787 { 0x0f, 0x01214000 }, /* HP */
1788 { }
1789 }
1790 },
1791 [ALC260_FIXUP_COEF] = {
1727a771 1792 .type = HDA_FIXUP_VERBS,
ca8f0424 1793 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1794 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1795 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1796 { }
1797 },
ca8f0424 1798 },
15317ab2 1799 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1800 .type = HDA_FIXUP_FUNC,
1801 .v.func = alc_fixup_gpio1,
15317ab2 1802 },
20f7d928 1803 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1804 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1805 .v.func = alc260_fixup_gpio1_toggle,
1806 .chained = true,
1807 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1808 },
1809 [ALC260_FIXUP_REPLACER] = {
1727a771 1810 .type = HDA_FIXUP_VERBS,
20f7d928 1811 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1812 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1813 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1814 { }
1815 },
1816 .chained = true,
1817 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1818 },
0a1c4fa2 1819 [ALC260_FIXUP_HP_B1900] = {
1727a771 1820 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1821 .v.func = alc260_fixup_gpio1_toggle,
1822 .chained = true,
1823 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1824 },
1825 [ALC260_FIXUP_KN1] = {
1727a771 1826 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1827 .v.func = alc260_fixup_kn1,
1828 },
39aedee7
TI
1829 [ALC260_FIXUP_FSC_S7020] = {
1830 .type = HDA_FIXUP_FUNC,
1831 .v.func = alc260_fixup_fsc_s7020,
1832 },
5ebd3bbd
TI
1833 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1834 .type = HDA_FIXUP_FUNC,
1835 .v.func = alc260_fixup_fsc_s7020_jwse,
1836 .chained = true,
1837 .chain_id = ALC260_FIXUP_FSC_S7020,
1838 },
d08c5ef2
TI
1839 [ALC260_FIXUP_VAIO_PINS] = {
1840 .type = HDA_FIXUP_PINS,
1841 .v.pins = (const struct hda_pintbl[]) {
1842 /* Pin configs are missing completely on some VAIOs */
1843 { 0x0f, 0x01211020 },
1844 { 0x10, 0x0001003f },
1845 { 0x11, 0x411111f0 },
1846 { 0x12, 0x01a15930 },
1847 { 0x13, 0x411111f0 },
1848 { 0x14, 0x411111f0 },
1849 { 0x15, 0x411111f0 },
1850 { 0x16, 0x411111f0 },
1851 { 0x17, 0x411111f0 },
1852 { 0x18, 0x411111f0 },
1853 { 0x19, 0x411111f0 },
1854 { }
1855 }
1856 },
1d045db9
TI
1857};
1858
1859static const struct snd_pci_quirk alc260_fixup_tbl[] = {
15317ab2 1860 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1861 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1862 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1863 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1864 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1865 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1866 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1867 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1868 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1869 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1870 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1871 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1872 {}
1873};
1874
5ebd3bbd
TI
1875static const struct hda_model_fixup alc260_fixup_models[] = {
1876 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1877 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1878 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1879 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1880 {}
1881};
1882
1d045db9
TI
1883/*
1884 */
1d045db9 1885static int patch_alc260(struct hda_codec *codec)
977ddd6b 1886{
1d045db9 1887 struct alc_spec *spec;
c3c2c9e7 1888 int err;
1d045db9 1889
3de95173
TI
1890 err = alc_alloc_spec(codec, 0x07);
1891 if (err < 0)
1892 return err;
1d045db9 1893
3de95173 1894 spec = codec->spec;
ea46c3c8
TI
1895 /* as quite a few machines require HP amp for speaker outputs,
1896 * it's easier to enable it unconditionally; even if it's unneeded,
1897 * it's almost harmless.
1898 */
1899 spec->gen.prefer_hp_amp = 1;
7504b6cd 1900 spec->gen.beep_nid = 0x01;
1d045db9 1901
225068ab
TI
1902 spec->shutup = alc_eapd_shutup;
1903
c9af753f
TI
1904 alc_pre_init(codec);
1905
5ebd3bbd
TI
1906 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1907 alc260_fixups);
1727a771 1908 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1909
c3c2c9e7
TI
1910 /* automatic parse from the BIOS config */
1911 err = alc260_parse_auto_config(codec);
1912 if (err < 0)
1913 goto error;
977ddd6b 1914
fea80fae
TI
1915 if (!spec->gen.no_analog) {
1916 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1917 if (err < 0)
1918 goto error;
1919 }
977ddd6b 1920
1727a771 1921 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1922
1d045db9 1923 return 0;
e16fb6d1
TI
1924
1925 error:
1926 alc_free(codec);
1927 return err;
6981d184
TI
1928}
1929
1d045db9
TI
1930
1931/*
1932 * ALC882/883/885/888/889 support
1933 *
1934 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1935 * configuration. Each pin widget can choose any input DACs and a mixer.
1936 * Each ADC is connected from a mixer of all inputs. This makes possible
1937 * 6-channel independent captures.
1938 *
1939 * In addition, an independent DAC for the multi-playback (not used in this
1940 * driver yet).
1941 */
1d045db9
TI
1942
1943/*
1944 * Pin config fixes
1945 */
ff818c24 1946enum {
5c0ebfbe
TI
1947 ALC882_FIXUP_ABIT_AW9D_MAX,
1948 ALC882_FIXUP_LENOVO_Y530,
1949 ALC882_FIXUP_PB_M5210,
1950 ALC882_FIXUP_ACER_ASPIRE_7736,
1951 ALC882_FIXUP_ASUS_W90V,
8f239214 1952 ALC889_FIXUP_CD,
b2c53e20 1953 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1954 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1955 ALC888_FIXUP_EEE1601,
4841b8e6 1956 ALC886_FIXUP_EAPD,
177943a3 1957 ALC882_FIXUP_EAPD,
7a6069bf 1958 ALC883_FIXUP_EAPD,
8812c4f9 1959 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1960 ALC882_FIXUP_GPIO1,
1961 ALC882_FIXUP_GPIO2,
eb844d51 1962 ALC882_FIXUP_GPIO3,
68ef0561
TI
1963 ALC889_FIXUP_COEF,
1964 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1965 ALC882_FIXUP_ACER_ASPIRE_4930G,
1966 ALC882_FIXUP_ACER_ASPIRE_8930G,
1967 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1968 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1969 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1970 ALC889_FIXUP_MBP_VREF,
1971 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1972 ALC889_FIXUP_MBA11_VREF,
0756f09c 1973 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1974 ALC889_FIXUP_MP11_VREF,
9f660a1c 1975 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1976 ALC882_FIXUP_INV_DMIC,
e427c237 1977 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1978 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 1979 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 1980 ALC1220_FIXUP_GB_DUAL_CODECS,
c1933008 1981 ALC1220_FIXUP_GB_X570,
0202f5cd 1982 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
1983 ALC1220_FIXUP_CLEVO_PB51ED,
1984 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
1985 ALC887_FIXUP_ASUS_AUDIO,
1986 ALC887_FIXUP_ASUS_HMIC,
9bfa7b36 1987 ALCS1200A_FIXUP_MIC_VREF,
ff818c24
TI
1988};
1989
68ef0561 1990static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 1991 const struct hda_fixup *fix, int action)
68ef0561 1992{
1727a771 1993 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 1994 return;
1df8874b 1995 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
1996}
1997
5671087f
TI
1998/* set up GPIO at initialization */
1999static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 2000 const struct hda_fixup *fix, int action)
5671087f 2001{
215c850c
TI
2002 struct alc_spec *spec = codec->spec;
2003
2004 spec->gpio_write_delay = true;
2005 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
2006}
2007
02a237b2
TI
2008/* Fix the connection of some pins for ALC889:
2009 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2010 * work correctly (bko#42740)
2011 */
2012static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 2013 const struct hda_fixup *fix, int action)
02a237b2 2014{
1727a771 2015 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2016 /* fake the connections during parsing the tree */
caf3c043
MM
2017 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2018 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2019 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2020 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2021 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2022 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2023 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2024 /* restore the connections */
caf3c043
MM
2025 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2026 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2027 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2028 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2029 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2030 }
2031}
2032
1a97b7f2
TI
2033/* Set VREF on HP pin */
2034static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2035 const struct hda_fixup *fix, int action)
1a97b7f2 2036{
caf3c043 2037 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2038 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2039 int i;
2040
1727a771 2041 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2042 return;
2043 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2044 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2045 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2046 continue;
d3f02d60 2047 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2048 val |= AC_PINCTL_VREF_80;
cdd03ced 2049 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2050 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2051 break;
2052 }
2053}
2054
0756f09c
TI
2055static void alc889_fixup_mac_pins(struct hda_codec *codec,
2056 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2057{
2058 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2059 int i;
2060
0756f09c 2061 for (i = 0; i < num_nids; i++) {
1a97b7f2 2062 unsigned int val;
d3f02d60 2063 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2064 val |= AC_PINCTL_VREF_50;
cdd03ced 2065 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2066 }
08c189f2 2067 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2068}
2069
0756f09c
TI
2070/* Set VREF on speaker pins on imac91 */
2071static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2072 const struct hda_fixup *fix, int action)
2073{
caf3c043 2074 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2075
2076 if (action == HDA_FIXUP_ACT_INIT)
2077 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2078}
2079
e7729a41
AV
2080/* Set VREF on speaker pins on mba11 */
2081static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2082 const struct hda_fixup *fix, int action)
2083{
caf3c043 2084 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2085
2086 if (action == HDA_FIXUP_ACT_INIT)
2087 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2088}
2089
0756f09c
TI
2090/* Set VREF on speaker pins on mba21 */
2091static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2092 const struct hda_fixup *fix, int action)
2093{
caf3c043 2094 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2095
2096 if (action == HDA_FIXUP_ACT_INIT)
2097 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2098}
2099
e427c237 2100/* Don't take HP output as primary
d9111496
FLVC
2101 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2102 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2103 */
2104static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2105 const struct hda_fixup *fix, int action)
e427c237
TI
2106{
2107 struct alc_spec *spec = codec->spec;
da96fb5b 2108 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2109 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2110 spec->gen.no_multi_io = 1;
2111 }
e427c237
TI
2112}
2113
eb9ca3ab
TI
2114static void alc_fixup_bass_chmap(struct hda_codec *codec,
2115 const struct hda_fixup *fix, int action);
2116
7beb3a6e
TI
2117/* For dual-codec configuration, we need to disable some features to avoid
2118 * conflicts of kctls and PCM streams
2119 */
2120static void alc_fixup_dual_codecs(struct hda_codec *codec,
2121 const struct hda_fixup *fix, int action)
2122{
2123 struct alc_spec *spec = codec->spec;
2124
2125 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2126 return;
2127 /* disable vmaster */
2128 spec->gen.suppress_vmaster = 1;
2129 /* auto-mute and auto-mic switch don't work with multiple codecs */
2130 spec->gen.suppress_auto_mute = 1;
2131 spec->gen.suppress_auto_mic = 1;
2132 /* disable aamix as well */
2133 spec->gen.mixer_nid = 0;
2134 /* add location prefix to avoid conflicts */
2135 codec->force_pin_prefix = 1;
2136}
2137
2138static void rename_ctl(struct hda_codec *codec, const char *oldname,
2139 const char *newname)
2140{
2141 struct snd_kcontrol *kctl;
2142
2143 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2144 if (kctl)
b51c2253 2145 snd_ctl_rename(codec->card, kctl, newname);
7beb3a6e
TI
2146}
2147
2148static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2149 const struct hda_fixup *fix,
2150 int action)
2151{
2152 alc_fixup_dual_codecs(codec, fix, action);
2153 switch (action) {
2154 case HDA_FIXUP_ACT_PRE_PROBE:
2155 /* override card longname to provide a unique UCM profile */
2156 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2157 break;
2158 case HDA_FIXUP_ACT_BUILD:
2159 /* rename Capture controls depending on the codec */
2160 rename_ctl(codec, "Capture Volume",
2161 codec->addr == 0 ?
2162 "Rear-Panel Capture Volume" :
2163 "Front-Panel Capture Volume");
2164 rename_ctl(codec, "Capture Switch",
2165 codec->addr == 0 ?
2166 "Rear-Panel Capture Switch" :
2167 "Front-Panel Capture Switch");
2168 break;
2169 }
2170}
2171
c1933008
CL
2172static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2173 const struct hda_fixup *fix,
2174 int action)
2175{
2176 static const hda_nid_t conn1[] = { 0x0c };
2177 static const struct coef_fw gb_x570_coefs[] = {
41a86013 2178 WRITE_COEF(0x07, 0x03c0),
c1933008
CL
2179 WRITE_COEF(0x1a, 0x01c1),
2180 WRITE_COEF(0x1b, 0x0202),
2181 WRITE_COEF(0x43, 0x3005),
2182 {}
2183 };
2184
2185 switch (action) {
2186 case HDA_FIXUP_ACT_PRE_PROBE:
2187 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2188 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2189 break;
2190 case HDA_FIXUP_ACT_INIT:
2191 alc_process_coef_fw(codec, gb_x570_coefs);
2192 break;
2193 }
2194}
2195
0202f5cd
P
2196static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2197 const struct hda_fixup *fix,
2198 int action)
2199{
caf3c043 2200 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2201
2202 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2203 return;
2204
2205 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2206 /* We therefore want to make sure 0x14 (front headphone) and
2207 * 0x1b (speakers) use the stereo DAC 0x02
2208 */
caf3c043
MM
2209 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2210 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2211}
2212
7f665b1c
JS
2213static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2214 const struct hda_fixup *fix, int action);
2215
80690a27 2216static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2217 const struct hda_fixup *fix,
2218 int action)
2219{
2220 alc1220_fixup_clevo_p950(codec, fix, action);
2221 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2222}
2223
ca184355
JHP
2224static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2225 struct hda_jack_callback *jack)
2226{
2227 struct alc_spec *spec = codec->spec;
2228 unsigned int vref;
2229
2230 snd_hda_gen_hp_automute(codec, jack);
2231
2232 if (spec->gen.hp_jack_present)
2233 vref = AC_PINCTL_VREF_80;
2234 else
2235 vref = AC_PINCTL_VREF_HIZ;
2236 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2237}
2238
2239static void alc887_fixup_asus_jack(struct hda_codec *codec,
2240 const struct hda_fixup *fix, int action)
2241{
2242 struct alc_spec *spec = codec->spec;
2243 if (action != HDA_FIXUP_ACT_PROBE)
2244 return;
2245 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2246 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2247}
2248
1727a771 2249static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2250 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2251 .type = HDA_FIXUP_PINS,
2252 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2253 { 0x15, 0x01080104 }, /* side */
2254 { 0x16, 0x01011012 }, /* rear */
2255 { 0x17, 0x01016011 }, /* clfe */
2785591a 2256 { }
145a902b
DH
2257 }
2258 },
5c0ebfbe 2259 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2260 .type = HDA_FIXUP_PINS,
2261 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2262 { 0x15, 0x99130112 }, /* rear int speakers */
2263 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2264 { }
2265 }
2266 },
5c0ebfbe 2267 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2268 .type = HDA_FIXUP_PINCTLS,
2269 .v.pins = (const struct hda_pintbl[]) {
2270 { 0x19, PIN_VREF50 },
357f915e
KY
2271 {}
2272 }
2273 },
5c0ebfbe 2274 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2275 .type = HDA_FIXUP_FUNC,
23d30f28 2276 .v.func = alc_fixup_sku_ignore,
6981d184 2277 },
5c0ebfbe 2278 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2279 .type = HDA_FIXUP_PINS,
2280 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2281 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2282 { }
2283 }
2284 },
8f239214 2285 [ALC889_FIXUP_CD] = {
1727a771
TI
2286 .type = HDA_FIXUP_PINS,
2287 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2288 { 0x1c, 0x993301f0 }, /* CD */
2289 { }
2290 }
2291 },
b2c53e20
DH
2292 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2293 .type = HDA_FIXUP_PINS,
2294 .v.pins = (const struct hda_pintbl[]) {
2295 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2296 { }
2297 },
2298 .chained = true,
2299 .chain_id = ALC889_FIXUP_CD,
2300 },
5c0ebfbe 2301 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2302 .type = HDA_FIXUP_PINS,
2303 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2304 { 0x17, 0x90170111 }, /* hidden surround speaker */
2305 { }
2306 }
2307 },
0e7cc2e7 2308 [ALC888_FIXUP_EEE1601] = {
1727a771 2309 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2310 .v.verbs = (const struct hda_verb[]) {
2311 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2312 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2313 { }
2314 }
177943a3 2315 },
4841b8e6
PH
2316 [ALC886_FIXUP_EAPD] = {
2317 .type = HDA_FIXUP_VERBS,
2318 .v.verbs = (const struct hda_verb[]) {
2319 /* change to EAPD mode */
2320 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2321 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2322 { }
2323 }
2324 },
177943a3 2325 [ALC882_FIXUP_EAPD] = {
1727a771 2326 .type = HDA_FIXUP_VERBS,
177943a3
TI
2327 .v.verbs = (const struct hda_verb[]) {
2328 /* change to EAPD mode */
2329 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2330 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2331 { }
2332 }
2333 },
7a6069bf 2334 [ALC883_FIXUP_EAPD] = {
1727a771 2335 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2336 .v.verbs = (const struct hda_verb[]) {
2337 /* change to EAPD mode */
2338 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2339 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2340 { }
2341 }
2342 },
8812c4f9 2343 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2344 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2345 .v.verbs = (const struct hda_verb[]) {
2346 /* eanable EAPD on Acer laptops */
2347 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2348 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2349 { }
2350 }
2351 },
1a97b7f2 2352 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2353 .type = HDA_FIXUP_FUNC,
2354 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2355 },
2356 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2357 .type = HDA_FIXUP_FUNC,
2358 .v.func = alc_fixup_gpio2,
1a97b7f2 2359 },
eb844d51 2360 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2361 .type = HDA_FIXUP_FUNC,
2362 .v.func = alc_fixup_gpio3,
eb844d51 2363 },
68ef0561 2364 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2365 .type = HDA_FIXUP_FUNC,
2366 .v.func = alc_fixup_gpio1,
68ef0561
TI
2367 .chained = true,
2368 .chain_id = ALC882_FIXUP_EAPD,
2369 },
2370 [ALC889_FIXUP_COEF] = {
1727a771 2371 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2372 .v.func = alc889_fixup_coef,
2373 },
c3e837bb 2374 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2375 .type = HDA_FIXUP_PINS,
2376 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2377 { 0x16, 0x99130111 }, /* CLFE speaker */
2378 { 0x17, 0x99130112 }, /* surround speaker */
2379 { }
038d4fef
TI
2380 },
2381 .chained = true,
2382 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2383 },
2384 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2385 .type = HDA_FIXUP_PINS,
2386 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2387 { 0x16, 0x99130111 }, /* CLFE speaker */
2388 { 0x1b, 0x99130112 }, /* surround speaker */
2389 { }
2390 },
2391 .chained = true,
2392 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2393 },
2394 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2395 /* additional init verbs for Acer Aspire 8930G */
1727a771 2396 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2397 .v.verbs = (const struct hda_verb[]) {
2398 /* Enable all DACs */
2399 /* DAC DISABLE/MUTE 1? */
2400 /* setting bits 1-5 disables DAC nids 0x02-0x06
2401 * apparently. Init=0x38 */
2402 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2403 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2404 /* DAC DISABLE/MUTE 2? */
2405 /* some bit here disables the other DACs.
2406 * Init=0x4900 */
2407 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2408 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2409 /* DMIC fix
2410 * This laptop has a stereo digital microphone.
2411 * The mics are only 1cm apart which makes the stereo
2412 * useless. However, either the mic or the ALC889
2413 * makes the signal become a difference/sum signal
2414 * instead of standard stereo, which is annoying.
2415 * So instead we flip this bit which makes the
2416 * codec replicate the sum signal to both channels,
2417 * turning it into a normal mono mic.
2418 */
2419 /* DMIC_CONTROL? Init value = 0x0001 */
2420 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2421 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2422 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2423 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2424 { }
038d4fef
TI
2425 },
2426 .chained = true,
2427 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2428 },
5671087f 2429 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2430 .type = HDA_FIXUP_FUNC,
5671087f
TI
2431 .v.func = alc885_fixup_macpro_gpio,
2432 },
02a237b2 2433 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2434 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2435 .v.func = alc889_fixup_dac_route,
2436 },
1a97b7f2 2437 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2438 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2439 .v.func = alc889_fixup_mbp_vref,
2440 .chained = true,
2441 .chain_id = ALC882_FIXUP_GPIO1,
2442 },
2443 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2444 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2445 .v.func = alc889_fixup_imac91_vref,
2446 .chained = true,
2447 .chain_id = ALC882_FIXUP_GPIO1,
2448 },
e7729a41
AV
2449 [ALC889_FIXUP_MBA11_VREF] = {
2450 .type = HDA_FIXUP_FUNC,
2451 .v.func = alc889_fixup_mba11_vref,
2452 .chained = true,
2453 .chain_id = ALC889_FIXUP_MBP_VREF,
2454 },
0756f09c
TI
2455 [ALC889_FIXUP_MBA21_VREF] = {
2456 .type = HDA_FIXUP_FUNC,
2457 .v.func = alc889_fixup_mba21_vref,
2458 .chained = true,
2459 .chain_id = ALC889_FIXUP_MBP_VREF,
2460 },
c20f31ec
TI
2461 [ALC889_FIXUP_MP11_VREF] = {
2462 .type = HDA_FIXUP_FUNC,
2463 .v.func = alc889_fixup_mba11_vref,
2464 .chained = true,
2465 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2466 },
9f660a1c
MK
2467 [ALC889_FIXUP_MP41_VREF] = {
2468 .type = HDA_FIXUP_FUNC,
2469 .v.func = alc889_fixup_mbp_vref,
2470 .chained = true,
2471 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2472 },
6e72aa5f 2473 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2474 .type = HDA_FIXUP_FUNC,
9d36a7dc 2475 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2476 },
e427c237 2477 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2478 .type = HDA_FIXUP_FUNC,
e427c237
TI
2479 .v.func = alc882_fixup_no_primary_hp,
2480 },
1f0bbf03
TI
2481 [ALC887_FIXUP_ASUS_BASS] = {
2482 .type = HDA_FIXUP_PINS,
2483 .v.pins = (const struct hda_pintbl[]) {
2484 {0x16, 0x99130130}, /* bass speaker */
2485 {}
2486 },
eb9ca3ab
TI
2487 .chained = true,
2488 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2489 },
2490 [ALC887_FIXUP_BASS_CHMAP] = {
2491 .type = HDA_FIXUP_FUNC,
2492 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2493 },
7beb3a6e
TI
2494 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2495 .type = HDA_FIXUP_FUNC,
2496 .v.func = alc1220_fixup_gb_dual_codecs,
2497 },
c1933008
CL
2498 [ALC1220_FIXUP_GB_X570] = {
2499 .type = HDA_FIXUP_FUNC,
2500 .v.func = alc1220_fixup_gb_x570,
2501 },
0202f5cd
P
2502 [ALC1220_FIXUP_CLEVO_P950] = {
2503 .type = HDA_FIXUP_FUNC,
2504 .v.func = alc1220_fixup_clevo_p950,
2505 },
80690a27 2506 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2507 .type = HDA_FIXUP_FUNC,
80690a27 2508 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2509 },
80690a27 2510 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2511 .type = HDA_FIXUP_PINS,
2512 .v.pins = (const struct hda_pintbl[]) {
2513 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2514 {}
2515 },
2516 .chained = true,
80690a27 2517 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2518 },
ca184355
JHP
2519 [ALC887_FIXUP_ASUS_AUDIO] = {
2520 .type = HDA_FIXUP_PINS,
2521 .v.pins = (const struct hda_pintbl[]) {
2522 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2523 { 0x19, 0x22219420 },
2524 {}
2525 },
2526 },
2527 [ALC887_FIXUP_ASUS_HMIC] = {
2528 .type = HDA_FIXUP_FUNC,
2529 .v.func = alc887_fixup_asus_jack,
2530 .chained = true,
2531 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2532 },
9bfa7b36
ML
2533 [ALCS1200A_FIXUP_MIC_VREF] = {
2534 .type = HDA_FIXUP_PINCTLS,
2535 .v.pins = (const struct hda_pintbl[]) {
2536 { 0x18, PIN_VREF50 }, /* rear mic */
2537 { 0x19, PIN_VREF50 }, /* front mic */
2538 {}
2539 }
2540 },
ff818c24
TI
2541};
2542
1d045db9 2543static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2544 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2545 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2546 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2547 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2548 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2549 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2550 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2551 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2552 ALC882_FIXUP_ACER_ASPIRE_4930G),
2553 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2554 ALC882_FIXUP_ACER_ASPIRE_4930G),
2555 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2556 ALC882_FIXUP_ACER_ASPIRE_8930G),
2557 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2558 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2559 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2560 ALC882_FIXUP_ACER_ASPIRE_4930G),
2561 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2562 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2563 ALC882_FIXUP_ACER_ASPIRE_4930G),
2564 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2565 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2566 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2567 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2568 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2569 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2570 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2571 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2572 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2573 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2574 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2575 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2576 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2577 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
9bfa7b36 2578 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
b7529c18
TI
2579 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2580 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2581 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2582 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2583 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2584
2585 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2586 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2587 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2588 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2589 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2590 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2591 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2592 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2593 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2594 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2595 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2596 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2597 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2598 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2599 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2600 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2601 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2602 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2603 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2604 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2605 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2606 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2607 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2608
7a6069bf 2609 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
4841b8e6 2610 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2611 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2612 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
c1933008 2613 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
ea354196 2614 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
41a86013 2615 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
a0b03952 2616 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2617 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2618 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2619 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2620 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2621 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2622 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2623 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2624 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2625 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2626 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
36d4d213 2627 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2628 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2631 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2632 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2633 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
9eb6f5c3 2634 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
b7a58228 2635 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2636 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2637 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2638 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
dbfe8350 2639 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
d4995121 2640 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2641 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2642 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2643 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2644 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2645 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2646 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2647 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2648 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2649 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2650 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2651 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2652 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2653 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2654 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2655 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
b7a58228 2656 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
7a6069bf
TI
2657 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2658 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2659 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2660 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2661 {}
2662};
2663
1727a771 2664static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2665 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2666 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2667 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2668 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2669 {.id = ALC889_FIXUP_CD, .name = "cd"},
2670 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2671 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2672 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2673 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2674 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2675 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2676 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2677 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2678 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2679 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2680 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2681 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2682 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2683 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2684 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2685 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2686 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2687 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2688 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2689 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2690 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2691 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2692 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2693 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2694 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
63394a16 2695 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2696 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2697 {}
2698};
2699
119b75c1
HW
2700static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2701 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2702 {0x14, 0x01014010},
2703 {0x15, 0x01011012},
2704 {0x16, 0x01016011},
2705 {0x18, 0x01a19040},
2706 {0x19, 0x02a19050},
2707 {0x1a, 0x0181304f},
2708 {0x1b, 0x0221401f},
2709 {0x1e, 0x01456130}),
2710 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2711 {0x14, 0x01015010},
2712 {0x15, 0x01011012},
2713 {0x16, 0x01011011},
2714 {0x18, 0x01a11040},
2715 {0x19, 0x02a19050},
2716 {0x1a, 0x0181104f},
2717 {0x1b, 0x0221401f},
2718 {0x1e, 0x01451130}),
2719 {}
2720};
2721
f6a92248 2722/*
1d045db9 2723 * BIOS auto configuration
f6a92248 2724 */
1d045db9
TI
2725/* almost identical with ALC880 parser... */
2726static int alc882_parse_auto_config(struct hda_codec *codec)
2727{
1d045db9 2728 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2729 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2730 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2731}
b896b4eb 2732
1d045db9
TI
2733/*
2734 */
1d045db9 2735static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2736{
2737 struct alc_spec *spec;
1a97b7f2 2738 int err;
f6a92248 2739
3de95173
TI
2740 err = alc_alloc_spec(codec, 0x0b);
2741 if (err < 0)
2742 return err;
f6a92248 2743
3de95173 2744 spec = codec->spec;
1f0f4b80 2745
7639a06c 2746 switch (codec->core.vendor_id) {
1d045db9
TI
2747 case 0x10ec0882:
2748 case 0x10ec0885:
acf08081 2749 case 0x10ec0900:
6d9ffcff 2750 case 0x10ec0b00:
a535ad57 2751 case 0x10ec1220:
1d045db9
TI
2752 break;
2753 default:
2754 /* ALC883 and variants */
2755 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2756 break;
c793bec5 2757 }
977ddd6b 2758
c9af753f
TI
2759 alc_pre_init(codec);
2760
1727a771 2761 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2762 alc882_fixups);
119b75c1 2763 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2764 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2765
1d045db9
TI
2766 alc_auto_parse_customize_define(codec);
2767
7504b6cd
TI
2768 if (has_cdefine_beep(codec))
2769 spec->gen.beep_nid = 0x01;
2770
1a97b7f2
TI
2771 /* automatic parse from the BIOS config */
2772 err = alc882_parse_auto_config(codec);
2773 if (err < 0)
2774 goto error;
f6a92248 2775
fea80fae
TI
2776 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2777 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2778 if (err < 0)
2779 goto error;
2780 }
f6a92248 2781
1727a771 2782 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2783
f6a92248 2784 return 0;
e16fb6d1
TI
2785
2786 error:
2787 alc_free(codec);
2788 return err;
f6a92248
KY
2789}
2790
df694daa 2791
df694daa 2792/*
1d045db9 2793 * ALC262 support
df694daa 2794 */
1d045db9 2795static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2796{
1d045db9 2797 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2798 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2799 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2800}
2801
df694daa 2802/*
1d045db9 2803 * Pin config fixes
df694daa 2804 */
cfc9b06f 2805enum {
ea4e7af1 2806 ALC262_FIXUP_FSC_H270,
7513e6da 2807 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2808 ALC262_FIXUP_HP_Z200,
2809 ALC262_FIXUP_TYAN,
c470150c 2810 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2811 ALC262_FIXUP_BENQ,
2812 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2813 ALC262_FIXUP_INV_DMIC,
b5c6611f 2814 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2815};
2816
1727a771 2817static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2818 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2819 .type = HDA_FIXUP_PINS,
2820 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2821 { 0x14, 0x99130110 }, /* speaker */
2822 { 0x15, 0x0221142f }, /* front HP */
2823 { 0x1b, 0x0121141f }, /* rear HP */
2824 { }
2825 }
2826 },
7513e6da
TI
2827 [ALC262_FIXUP_FSC_S7110] = {
2828 .type = HDA_FIXUP_PINS,
2829 .v.pins = (const struct hda_pintbl[]) {
2830 { 0x15, 0x90170110 }, /* speaker */
2831 { }
2832 },
2833 .chained = true,
2834 .chain_id = ALC262_FIXUP_BENQ,
2835 },
ea4e7af1 2836 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2837 .type = HDA_FIXUP_PINS,
2838 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2839 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2840 { }
2841 }
cfc9b06f 2842 },
ea4e7af1 2843 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2844 .type = HDA_FIXUP_PINS,
2845 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2846 { 0x14, 0x1993e1f0 }, /* int AUX */
2847 { }
2848 }
2849 },
c470150c 2850 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2851 .type = HDA_FIXUP_PINCTLS,
2852 .v.pins = (const struct hda_pintbl[]) {
2853 { 0x19, PIN_VREF50 },
b42590b8
TI
2854 {}
2855 },
2856 .chained = true,
2857 .chain_id = ALC262_FIXUP_BENQ,
2858 },
2859 [ALC262_FIXUP_BENQ] = {
1727a771 2860 .type = HDA_FIXUP_VERBS,
b42590b8 2861 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2862 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2863 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2864 {}
2865 }
2866 },
b42590b8 2867 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2868 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2869 .v.verbs = (const struct hda_verb[]) {
2870 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2871 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2872 {}
2873 }
2874 },
6e72aa5f 2875 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2876 .type = HDA_FIXUP_FUNC,
9d36a7dc 2877 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2878 },
b5c6611f
ML
2879 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2880 .type = HDA_FIXUP_FUNC,
2881 .v.func = alc_fixup_no_depop_delay,
2882 },
cfc9b06f
TI
2883};
2884
1d045db9 2885static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2886 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2887 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2888 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2889 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2890 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2891 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2892 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2893 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2894 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2895 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2896 {}
2897};
df694daa 2898
1727a771 2899static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2900 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2901 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2902 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2903 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2904 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2905 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2906 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2907 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2908 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2909 {}
2910};
1d045db9 2911
1d045db9
TI
2912/*
2913 */
1d045db9 2914static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2915{
2916 struct alc_spec *spec;
df694daa
KY
2917 int err;
2918
3de95173
TI
2919 err = alc_alloc_spec(codec, 0x0b);
2920 if (err < 0)
2921 return err;
df694daa 2922
3de95173 2923 spec = codec->spec;
08c189f2 2924 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2925
225068ab
TI
2926 spec->shutup = alc_eapd_shutup;
2927
1d045db9
TI
2928#if 0
2929 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2930 * under-run
2931 */
98b24883 2932 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2933#endif
1d045db9
TI
2934 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2935
c9af753f
TI
2936 alc_pre_init(codec);
2937
1727a771 2938 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2939 alc262_fixups);
1727a771 2940 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2941
af741c15
TI
2942 alc_auto_parse_customize_define(codec);
2943
7504b6cd
TI
2944 if (has_cdefine_beep(codec))
2945 spec->gen.beep_nid = 0x01;
2946
42399f7a
TI
2947 /* automatic parse from the BIOS config */
2948 err = alc262_parse_auto_config(codec);
2949 if (err < 0)
2950 goto error;
df694daa 2951
fea80fae
TI
2952 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2953 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2954 if (err < 0)
2955 goto error;
2956 }
2134ea4f 2957
1727a771 2958 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2959
1da177e4 2960 return 0;
e16fb6d1
TI
2961
2962 error:
2963 alc_free(codec);
2964 return err;
1da177e4
LT
2965}
2966
f32610ed 2967/*
1d045db9 2968 * ALC268
f32610ed 2969 */
1d045db9 2970/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2971static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2972 struct snd_ctl_elem_value *ucontrol)
2973{
2974 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2975 unsigned long pval;
2976 int err;
2977
2978 mutex_lock(&codec->control_mutex);
2979 pval = kcontrol->private_value;
2980 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2981 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2982 if (err >= 0) {
2983 kcontrol->private_value = (pval & ~0xff) | 0x10;
2984 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2985 }
2986 kcontrol->private_value = pval;
2987 mutex_unlock(&codec->control_mutex);
2988 return err;
2989}
f32610ed 2990
1d045db9
TI
2991static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2992 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
2993 {
2994 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2995 .name = "Beep Playback Switch",
2996 .subdevice = HDA_SUBDEV_AMP_FLAG,
2997 .info = snd_hda_mixer_amp_switch_info,
2998 .get = snd_hda_mixer_amp_switch_get,
2999 .put = alc268_beep_switch_put,
3000 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3001 },
f32610ed
JS
3002};
3003
1d045db9
TI
3004/* set PCBEEP vol = 0, mute connections */
3005static const struct hda_verb alc268_beep_init_verbs[] = {
3006 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3007 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3008 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3009 { }
f32610ed
JS
3010};
3011
6e72aa5f
TI
3012enum {
3013 ALC268_FIXUP_INV_DMIC,
cb766404 3014 ALC268_FIXUP_HP_EAPD,
24eff328 3015 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
3016};
3017
1727a771 3018static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 3019 [ALC268_FIXUP_INV_DMIC] = {
1727a771 3020 .type = HDA_FIXUP_FUNC,
9d36a7dc 3021 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3022 },
cb766404 3023 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3024 .type = HDA_FIXUP_VERBS,
cb766404
TI
3025 .v.verbs = (const struct hda_verb[]) {
3026 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3027 {}
3028 }
3029 },
24eff328
TI
3030 [ALC268_FIXUP_SPDIF] = {
3031 .type = HDA_FIXUP_PINS,
3032 .v.pins = (const struct hda_pintbl[]) {
3033 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3034 {}
3035 }
3036 },
6e72aa5f
TI
3037};
3038
1727a771 3039static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3040 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3041 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3042 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3043 {}
3044};
3045
3046static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3047 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3048 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3049 /* below is codec SSID since multiple Toshiba laptops have the
3050 * same PCI SSID 1179:ff00
3051 */
3052 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3053 {}
3054};
3055
f32610ed
JS
3056/*
3057 * BIOS auto configuration
3058 */
1d045db9 3059static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3060{
3e6179b8 3061 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3062 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3063}
3064
1d045db9
TI
3065/*
3066 */
1d045db9 3067static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3068{
3069 struct alc_spec *spec;
a5cb463a 3070 int i, err;
f32610ed 3071
1d045db9 3072 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3073 err = alc_alloc_spec(codec, 0);
3074 if (err < 0)
3075 return err;
3076
3077 spec = codec->spec;
2722b535
TI
3078 if (has_cdefine_beep(codec))
3079 spec->gen.beep_nid = 0x01;
1f0f4b80 3080
225068ab
TI
3081 spec->shutup = alc_eapd_shutup;
3082
c9af753f
TI
3083 alc_pre_init(codec);
3084
1727a771
TI
3085 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3086 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3087
6ebb8053
TI
3088 /* automatic parse from the BIOS config */
3089 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3090 if (err < 0)
3091 goto error;
f32610ed 3092
7504b6cd
TI
3093 if (err > 0 && !spec->gen.no_analog &&
3094 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3095 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3096 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3097 &alc268_beep_mixer[i])) {
3098 err = -ENOMEM;
3099 goto error;
3100 }
3101 }
7504b6cd 3102 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3103 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3104 /* override the amp caps for beep generator */
3105 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3106 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3107 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3108 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3109 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3110 }
3111
1727a771 3112 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3113
f32610ed 3114 return 0;
e16fb6d1
TI
3115
3116 error:
3117 alc_free(codec);
3118 return err;
f32610ed
JS
3119}
3120
bc9f98a9 3121/*
1d045db9 3122 * ALC269
bc9f98a9 3123 */
08c189f2 3124
1d045db9 3125static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3126 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3127};
3128
1d045db9 3129static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3130 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3131};
291702f0 3132
1d045db9
TI
3133/* different alc269-variants */
3134enum {
3135 ALC269_TYPE_ALC269VA,
3136 ALC269_TYPE_ALC269VB,
3137 ALC269_TYPE_ALC269VC,
adcc70b2 3138 ALC269_TYPE_ALC269VD,
065380f0
KY
3139 ALC269_TYPE_ALC280,
3140 ALC269_TYPE_ALC282,
2af02be7 3141 ALC269_TYPE_ALC283,
065380f0 3142 ALC269_TYPE_ALC284,
4731d5de 3143 ALC269_TYPE_ALC293,
7fc7d047 3144 ALC269_TYPE_ALC286,
506b62c3 3145 ALC269_TYPE_ALC298,
1d04c9de 3146 ALC269_TYPE_ALC255,
4344aec8 3147 ALC269_TYPE_ALC256,
f429e7e4 3148 ALC269_TYPE_ALC257,
0a6f0600 3149 ALC269_TYPE_ALC215,
4231430d 3150 ALC269_TYPE_ALC225,
60571929 3151 ALC269_TYPE_ALC245,
99cee034 3152 ALC269_TYPE_ALC287,
dcd4f0db 3153 ALC269_TYPE_ALC294,
1078bef0 3154 ALC269_TYPE_ALC300,
f0778871 3155 ALC269_TYPE_ALC623,
6fbae35a 3156 ALC269_TYPE_ALC700,
bc9f98a9
KY
3157};
3158
3159/*
1d045db9 3160 * BIOS auto configuration
bc9f98a9 3161 */
1d045db9
TI
3162static int alc269_parse_auto_config(struct hda_codec *codec)
3163{
1d045db9 3164 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3165 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3166 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3167 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3168 const hda_nid_t *ssids;
3169
3170 switch (spec->codec_variant) {
3171 case ALC269_TYPE_ALC269VA:
3172 case ALC269_TYPE_ALC269VC:
065380f0
KY
3173 case ALC269_TYPE_ALC280:
3174 case ALC269_TYPE_ALC284:
4731d5de 3175 case ALC269_TYPE_ALC293:
adcc70b2
KY
3176 ssids = alc269va_ssids;
3177 break;
3178 case ALC269_TYPE_ALC269VB:
3179 case ALC269_TYPE_ALC269VD:
065380f0 3180 case ALC269_TYPE_ALC282:
2af02be7 3181 case ALC269_TYPE_ALC283:
7fc7d047 3182 case ALC269_TYPE_ALC286:
506b62c3 3183 case ALC269_TYPE_ALC298:
1d04c9de 3184 case ALC269_TYPE_ALC255:
4344aec8 3185 case ALC269_TYPE_ALC256:
f429e7e4 3186 case ALC269_TYPE_ALC257:
0a6f0600 3187 case ALC269_TYPE_ALC215:
4231430d 3188 case ALC269_TYPE_ALC225:
60571929 3189 case ALC269_TYPE_ALC245:
99cee034 3190 case ALC269_TYPE_ALC287:
dcd4f0db 3191 case ALC269_TYPE_ALC294:
1078bef0 3192 case ALC269_TYPE_ALC300:
f0778871 3193 case ALC269_TYPE_ALC623:
6fbae35a 3194 case ALC269_TYPE_ALC700:
adcc70b2
KY
3195 ssids = alc269_ssids;
3196 break;
3197 default:
3198 ssids = alc269_ssids;
3199 break;
3200 }
bc9f98a9 3201
3e6179b8 3202 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3203}
bc9f98a9 3204
476c02e0
HW
3205static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3206 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3207 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3208 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3209 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3210 {}
3211};
3212
3213static void alc_headset_btn_callback(struct hda_codec *codec,
3214 struct hda_jack_callback *jack)
3215{
3216 int report = 0;
3217
3218 if (jack->unsol_res & (7 << 13))
3219 report |= SND_JACK_BTN_0;
3220
3221 if (jack->unsol_res & (1 << 16 | 3 << 8))
3222 report |= SND_JACK_BTN_1;
3223
3224 /* Volume up key */
3225 if (jack->unsol_res & (7 << 23))
3226 report |= SND_JACK_BTN_2;
3227
3228 /* Volume down key */
3229 if (jack->unsol_res & (7 << 10))
3230 report |= SND_JACK_BTN_3;
3231
04f7791b 3232 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3233}
3234
3235static void alc_disable_headset_jack_key(struct hda_codec *codec)
3236{
3237 struct alc_spec *spec = codec->spec;
3238
3239 if (!spec->has_hs_key)
3240 return;
3241
3242 switch (codec->core.vendor_id) {
3243 case 0x10ec0215:
3244 case 0x10ec0225:
3245 case 0x10ec0285:
c72b9bfe 3246 case 0x10ec0287:
476c02e0
HW
3247 case 0x10ec0295:
3248 case 0x10ec0289:
3249 case 0x10ec0299:
3250 alc_write_coef_idx(codec, 0x48, 0x0);
3251 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3252 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3253 break;
1948fc06 3254 case 0x10ec0230:
476c02e0
HW
3255 case 0x10ec0236:
3256 case 0x10ec0256:
527f4643 3257 case 0x19e58326:
476c02e0
HW
3258 alc_write_coef_idx(codec, 0x48, 0x0);
3259 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3260 break;
3261 }
3262}
3263
3264static void alc_enable_headset_jack_key(struct hda_codec *codec)
3265{
3266 struct alc_spec *spec = codec->spec;
3267
3268 if (!spec->has_hs_key)
3269 return;
3270
3271 switch (codec->core.vendor_id) {
3272 case 0x10ec0215:
3273 case 0x10ec0225:
3274 case 0x10ec0285:
c72b9bfe 3275 case 0x10ec0287:
476c02e0
HW
3276 case 0x10ec0295:
3277 case 0x10ec0289:
3278 case 0x10ec0299:
3279 alc_write_coef_idx(codec, 0x48, 0xd011);
3280 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3281 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3282 break;
1948fc06 3283 case 0x10ec0230:
476c02e0
HW
3284 case 0x10ec0236:
3285 case 0x10ec0256:
527f4643 3286 case 0x19e58326:
476c02e0
HW
3287 alc_write_coef_idx(codec, 0x48, 0xd011);
3288 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3289 break;
3290 }
3291}
3292
3293static void alc_fixup_headset_jack(struct hda_codec *codec,
3294 const struct hda_fixup *fix, int action)
3295{
3296 struct alc_spec *spec = codec->spec;
04f7791b 3297 hda_nid_t hp_pin;
476c02e0
HW
3298
3299 switch (action) {
3300 case HDA_FIXUP_ACT_PRE_PROBE:
3301 spec->has_hs_key = 1;
3302 snd_hda_jack_detect_enable_callback(codec, 0x55,
3303 alc_headset_btn_callback);
476c02e0 3304 break;
04f7791b
HW
3305 case HDA_FIXUP_ACT_BUILD:
3306 hp_pin = alc_get_hp_pin(spec);
3307 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3308 alc_headset_btn_keymap,
3309 hp_pin))
3310 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3311 false, SND_JACK_HEADSET,
3312 alc_headset_btn_keymap);
3313
476c02e0
HW
3314 alc_enable_headset_jack_key(codec);
3315 break;
3316 }
3317}
3318
1387e2d1 3319static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3320{
98b24883 3321 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3322}
291702f0 3323
1d045db9
TI
3324static void alc269_shutup(struct hda_codec *codec)
3325{
adcc70b2
KY
3326 struct alc_spec *spec = codec->spec;
3327
1387e2d1
KY
3328 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3329 alc269vb_toggle_power_output(codec, 0);
3330 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3331 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3332 msleep(150);
3333 }
c0ca5ece 3334 alc_shutup_pins(codec);
1d045db9 3335}
291702f0 3336
6b0f95c4 3337static const struct coef_fw alc282_coefs[] = {
54db6c39 3338 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3339 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3340 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3341 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3342 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3343 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3344 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3345 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3346 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3347 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3348 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3349 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3350 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3351 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3352 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3353 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3354 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3355 WRITE_COEF(0x63, 0x2902), /* PLL */
3356 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3357 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3358 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3359 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3360 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3361 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3362 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3363 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3364 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3365 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3366 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3367 {}
3368};
3369
cb149cb3
KY
3370static void alc282_restore_default_value(struct hda_codec *codec)
3371{
54db6c39 3372 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3373}
3374
7b5c7a02
KY
3375static void alc282_init(struct hda_codec *codec)
3376{
3377 struct alc_spec *spec = codec->spec;
35a39f98 3378 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3379 bool hp_pin_sense;
3380 int coef78;
3381
cb149cb3
KY
3382 alc282_restore_default_value(codec);
3383
7b5c7a02
KY
3384 if (!hp_pin)
3385 return;
3386 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3387 coef78 = alc_read_coef_idx(codec, 0x78);
3388
3389 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3390 /* Headphone capless set to high power mode */
3391 alc_write_coef_idx(codec, 0x78, 0x9004);
3392
3393 if (hp_pin_sense)
3394 msleep(2);
3395
3396 snd_hda_codec_write(codec, hp_pin, 0,
3397 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3398
3399 if (hp_pin_sense)
3400 msleep(85);
3401
3402 snd_hda_codec_write(codec, hp_pin, 0,
3403 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3404
3405 if (hp_pin_sense)
3406 msleep(100);
3407
3408 /* Headphone capless set to normal mode */
3409 alc_write_coef_idx(codec, 0x78, coef78);
3410}
3411
3412static void alc282_shutup(struct hda_codec *codec)
3413{
3414 struct alc_spec *spec = codec->spec;
35a39f98 3415 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3416 bool hp_pin_sense;
3417 int coef78;
3418
3419 if (!hp_pin) {
3420 alc269_shutup(codec);
3421 return;
3422 }
3423
3424 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3425 coef78 = alc_read_coef_idx(codec, 0x78);
3426 alc_write_coef_idx(codec, 0x78, 0x9004);
3427
3428 if (hp_pin_sense)
3429 msleep(2);
3430
3431 snd_hda_codec_write(codec, hp_pin, 0,
3432 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3433
3434 if (hp_pin_sense)
3435 msleep(85);
3436
c0ca5ece
TI
3437 if (!spec->no_shutup_pins)
3438 snd_hda_codec_write(codec, hp_pin, 0,
3439 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3440
3441 if (hp_pin_sense)
3442 msleep(100);
3443
3444 alc_auto_setup_eapd(codec, false);
c0ca5ece 3445 alc_shutup_pins(codec);
7b5c7a02
KY
3446 alc_write_coef_idx(codec, 0x78, coef78);
3447}
3448
6b0f95c4 3449static const struct coef_fw alc283_coefs[] = {
54db6c39 3450 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3451 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3452 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3453 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3454 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3455 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3456 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3457 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3458 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3459 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3460 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3461 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3462 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3463 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3464 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3465 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3466 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3467 WRITE_COEF(0x2e, 0x2902), /* PLL */
3468 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3469 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3470 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3471 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3472 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3473 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3474 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3475 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3476 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3477 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3478 WRITE_COEF(0x49, 0x0), /* test mode */
3479 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3480 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3481 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3482 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3483 {}
3484};
3485
6bd55b04
KY
3486static void alc283_restore_default_value(struct hda_codec *codec)
3487{
54db6c39 3488 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3489}
3490
2af02be7
KY
3491static void alc283_init(struct hda_codec *codec)
3492{
3493 struct alc_spec *spec = codec->spec;
35a39f98 3494 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3495 bool hp_pin_sense;
2af02be7 3496
6bd55b04
KY
3497 alc283_restore_default_value(codec);
3498
2af02be7
KY
3499 if (!hp_pin)
3500 return;
a59d7199
KY
3501
3502 msleep(30);
2af02be7
KY
3503 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3504
3505 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3506 /* Headphone capless set to high power mode */
3507 alc_write_coef_idx(codec, 0x43, 0x9004);
3508
3509 snd_hda_codec_write(codec, hp_pin, 0,
3510 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3511
3512 if (hp_pin_sense)
3513 msleep(85);
3514
3515 snd_hda_codec_write(codec, hp_pin, 0,
3516 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3517
3518 if (hp_pin_sense)
3519 msleep(85);
3520 /* Index 0x46 Combo jack auto switch control 2 */
3521 /* 3k pull low control for Headset jack. */
98b24883 3522 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3523 /* Headphone capless set to normal mode */
3524 alc_write_coef_idx(codec, 0x43, 0x9614);
3525}
3526
3527static void alc283_shutup(struct hda_codec *codec)
3528{
3529 struct alc_spec *spec = codec->spec;
35a39f98 3530 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3531 bool hp_pin_sense;
2af02be7
KY
3532
3533 if (!hp_pin) {
3534 alc269_shutup(codec);
3535 return;
3536 }
3537
3538 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3539
3540 alc_write_coef_idx(codec, 0x43, 0x9004);
3541
b450b17c
HP
3542 /*depop hp during suspend*/
3543 alc_write_coef_idx(codec, 0x06, 0x2100);
3544
2af02be7
KY
3545 snd_hda_codec_write(codec, hp_pin, 0,
3546 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3547
3548 if (hp_pin_sense)
88011c09 3549 msleep(100);
2af02be7 3550
c0ca5ece
TI
3551 if (!spec->no_shutup_pins)
3552 snd_hda_codec_write(codec, hp_pin, 0,
3553 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3554
98b24883 3555 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3556
3557 if (hp_pin_sense)
88011c09 3558 msleep(100);
0435b3ff 3559 alc_auto_setup_eapd(codec, false);
c0ca5ece 3560 alc_shutup_pins(codec);
2af02be7
KY
3561 alc_write_coef_idx(codec, 0x43, 0x9614);
3562}
3563
4a219ef8
KY
3564static void alc256_init(struct hda_codec *codec)
3565{
3566 struct alc_spec *spec = codec->spec;
35a39f98 3567 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3568 bool hp_pin_sense;
3569
1f680609
YY
3570 if (spec->ultra_low_power) {
3571 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3572 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3573 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3574 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3575 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3576 msleep(30);
3577 }
3578
4a219ef8 3579 if (!hp_pin)
6447c962 3580 hp_pin = 0x21;
4a219ef8
KY
3581
3582 msleep(30);
3583
3584 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3585
3586 if (hp_pin_sense)
3587 msleep(2);
3588
3589 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3590
3591 snd_hda_codec_write(codec, hp_pin, 0,
3592 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3593
6447c962 3594 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3595 msleep(85);
3596
3597 snd_hda_codec_write(codec, hp_pin, 0,
3598 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3599
6447c962 3600 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3601 msleep(100);
3602
3603 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3604 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3605 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3606 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3607 /*
3608 * Expose headphone mic (or possibly Line In on some machines) instead
3609 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3610 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3611 * this register.
3612 */
3613 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3614}
3615
3616static void alc256_shutup(struct hda_codec *codec)
3617{
3618 struct alc_spec *spec = codec->spec;
35a39f98 3619 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3620 bool hp_pin_sense;
3621
6447c962
KY
3622 if (!hp_pin)
3623 hp_pin = 0x21;
4a219ef8
KY
3624
3625 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3626
3627 if (hp_pin_sense)
3628 msleep(2);
3629
3630 snd_hda_codec_write(codec, hp_pin, 0,
3631 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3632
6447c962 3633 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3634 msleep(85);
3635
1c9609e3
TI
3636 /* 3k pull low control for Headset jack. */
3637 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3638 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3639 * when booting with headset plugged. So skip setting it for the codec alc257
3640 */
f30741cd
KHF
3641 if (codec->core.vendor_id != 0x10ec0236 &&
3642 codec->core.vendor_id != 0x10ec0257)
3f742490 3643 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3644
c0ca5ece
TI
3645 if (!spec->no_shutup_pins)
3646 snd_hda_codec_write(codec, hp_pin, 0,
3647 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3648
6447c962 3649 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3650 msleep(100);
3651
3652 alc_auto_setup_eapd(codec, false);
c0ca5ece 3653 alc_shutup_pins(codec);
6447c962
KY
3654 if (spec->ultra_low_power) {
3655 msleep(50);
3656 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3657 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3658 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3659 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3660 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3661 msleep(30);
3662 }
4a219ef8
KY
3663}
3664
3c24e483
KY
3665static void alc285_hp_init(struct hda_codec *codec)
3666{
3667 struct alc_spec *spec = codec->spec;
3668 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3669 int i, val;
3670 int coef38, coef0d, coef36;
3671
3672 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3673 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3674 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3675 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3676 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3677 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3678
3679 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3680
3681 if (hp_pin)
3682 snd_hda_codec_write(codec, hp_pin, 0,
3683 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3684
3685 msleep(130);
3686 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3687 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3688
3689 if (hp_pin)
3690 snd_hda_codec_write(codec, hp_pin, 0,
3691 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3692 msleep(10);
3693 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3694 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3695 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3696 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3697
3698 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3699 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3700 for (i = 0; i < 20 && val & 0x8000; i++) {
3701 msleep(50);
3702 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3703 } /* Wait for depop procedure finish */
3704
3705 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3706 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3707 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3708 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3709
3710 msleep(50);
3711 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3712}
3713
da911b1f
KY
3714static void alc225_init(struct hda_codec *codec)
3715{
3716 struct alc_spec *spec = codec->spec;
35a39f98 3717 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3718 bool hp1_pin_sense, hp2_pin_sense;
3719
1f680609
YY
3720 if (spec->ultra_low_power) {
3721 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3722 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3723 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3724 msleep(30);
3725 }
3726
60571929
KY
3727 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3728 spec->codec_variant != ALC269_TYPE_ALC245)
3c24e483
KY
3729 /* required only at boot or S3 and S4 resume time */
3730 if (!spec->done_hp_init ||
3731 is_s3_resume(codec) ||
3732 is_s4_resume(codec)) {
3733 alc285_hp_init(codec);
3734 spec->done_hp_init = true;
3735 }
3736
da911b1f 3737 if (!hp_pin)
d3ba58bb 3738 hp_pin = 0x21;
da911b1f
KY
3739 msleep(30);
3740
3741 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3742 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3743
3744 if (hp1_pin_sense || hp2_pin_sense)
3745 msleep(2);
3746
3747 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3748
d3ba58bb 3749 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3750 snd_hda_codec_write(codec, hp_pin, 0,
3751 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3752 if (hp2_pin_sense)
3753 snd_hda_codec_write(codec, 0x16, 0,
3754 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3755
d3ba58bb 3756 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3757 msleep(85);
3758
d3ba58bb 3759 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3760 snd_hda_codec_write(codec, hp_pin, 0,
3761 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3762 if (hp2_pin_sense)
3763 snd_hda_codec_write(codec, 0x16, 0,
3764 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3765
d3ba58bb 3766 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3767 msleep(100);
3768
3769 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3770 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3771}
3772
3773static void alc225_shutup(struct hda_codec *codec)
3774{
3775 struct alc_spec *spec = codec->spec;
35a39f98 3776 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3777 bool hp1_pin_sense, hp2_pin_sense;
3778
d3ba58bb
KY
3779 if (!hp_pin)
3780 hp_pin = 0x21;
476c02e0
HW
3781
3782 alc_disable_headset_jack_key(codec);
da911b1f
KY
3783 /* 3k pull low control for Headset jack. */
3784 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3785
3786 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3787 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3788
3789 if (hp1_pin_sense || hp2_pin_sense)
3790 msleep(2);
3791
d3ba58bb 3792 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3793 snd_hda_codec_write(codec, hp_pin, 0,
3794 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3795 if (hp2_pin_sense)
3796 snd_hda_codec_write(codec, 0x16, 0,
3797 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3798
d3ba58bb 3799 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3800 msleep(85);
3801
d3ba58bb 3802 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3803 snd_hda_codec_write(codec, hp_pin, 0,
3804 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3805 if (hp2_pin_sense)
3806 snd_hda_codec_write(codec, 0x16, 0,
3807 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3808
d3ba58bb 3809 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3810 msleep(100);
3811
3812 alc_auto_setup_eapd(codec, false);
c0ca5ece 3813 alc_shutup_pins(codec);
d3ba58bb
KY
3814 if (spec->ultra_low_power) {
3815 msleep(50);
3816 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3817 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3818 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3819 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3820 msleep(30);
3821 }
476c02e0
HW
3822
3823 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3824 alc_enable_headset_jack_key(codec);
da911b1f
KY
3825}
3826
c2d6af53
KY
3827static void alc_default_init(struct hda_codec *codec)
3828{
3829 struct alc_spec *spec = codec->spec;
35a39f98 3830 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3831 bool hp_pin_sense;
3832
3833 if (!hp_pin)
3834 return;
3835
3836 msleep(30);
3837
3838 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3839
3840 if (hp_pin_sense)
3841 msleep(2);
3842
3843 snd_hda_codec_write(codec, hp_pin, 0,
3844 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3845
3846 if (hp_pin_sense)
3847 msleep(85);
3848
3849 snd_hda_codec_write(codec, hp_pin, 0,
3850 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3851
3852 if (hp_pin_sense)
3853 msleep(100);
3854}
3855
3856static void alc_default_shutup(struct hda_codec *codec)
3857{
3858 struct alc_spec *spec = codec->spec;
35a39f98 3859 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3860 bool hp_pin_sense;
3861
3862 if (!hp_pin) {
3863 alc269_shutup(codec);
3864 return;
3865 }
3866
3867 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3868
3869 if (hp_pin_sense)
3870 msleep(2);
3871
3872 snd_hda_codec_write(codec, hp_pin, 0,
3873 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3874
3875 if (hp_pin_sense)
3876 msleep(85);
3877
c0ca5ece
TI
3878 if (!spec->no_shutup_pins)
3879 snd_hda_codec_write(codec, hp_pin, 0,
3880 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3881
3882 if (hp_pin_sense)
3883 msleep(100);
3884
3885 alc_auto_setup_eapd(codec, false);
c0ca5ece 3886 alc_shutup_pins(codec);
c2d6af53
KY
3887}
3888
693abe11
KY
3889static void alc294_hp_init(struct hda_codec *codec)
3890{
3891 struct alc_spec *spec = codec->spec;
35a39f98 3892 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3893 int i, val;
3894
3895 if (!hp_pin)
3896 return;
3897
3898 snd_hda_codec_write(codec, hp_pin, 0,
3899 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3900
3901 msleep(100);
3902
c0ca5ece
TI
3903 if (!spec->no_shutup_pins)
3904 snd_hda_codec_write(codec, hp_pin, 0,
3905 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3906
3907 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3908 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3909
3910 /* Wait for depop procedure finish */
3911 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3912 for (i = 0; i < 20 && val & 0x0080; i++) {
3913 msleep(50);
3914 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3915 }
3916 /* Set HP depop to auto mode */
3917 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3918 msleep(50);
3919}
3920
3921static void alc294_init(struct hda_codec *codec)
3922{
3923 struct alc_spec *spec = codec->spec;
3924
f6ef4e0e
TI
3925 /* required only at boot or S4 resume time */
3926 if (!spec->done_hp_init ||
3927 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3928 alc294_hp_init(codec);
3929 spec->done_hp_init = true;
3930 }
3931 alc_default_init(codec);
3932}
3933
ad60d502
KY
3934static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3935 unsigned int val)
3936{
3937 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3938 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3939 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3940}
3941
3942static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3943{
3944 unsigned int val;
3945
3946 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3947 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3948 & 0xffff;
3949 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3950 << 16;
3951 return val;
3952}
3953
3954static void alc5505_dsp_halt(struct hda_codec *codec)
3955{
3956 unsigned int val;
3957
3958 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3959 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3960 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3961 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3962 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3963 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3964 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3965 val = alc5505_coef_get(codec, 0x6220);
3966 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3967}
3968
3969static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3970{
3971 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3972 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3973 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3974 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3975 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3976 alc5505_coef_set(codec, 0x880c, 0x00000004);
3977}
3978
3979static void alc5505_dsp_init(struct hda_codec *codec)
3980{
3981 unsigned int val;
3982
3983 alc5505_dsp_halt(codec);
3984 alc5505_dsp_back_from_halt(codec);
3985 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3986 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3987 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3988 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3989 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3990 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3991 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3992 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3993 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3994 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3995 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3996 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3997 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3998
3999 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4000 if (val <= 3)
4001 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4002 else
4003 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4004
4005 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4006 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4007 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4008 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4009 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4010 alc5505_coef_set(codec, 0x880c, 0x00000003);
4011 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
4012
4013#ifdef HALT_REALTEK_ALC5505
4014 alc5505_dsp_halt(codec);
4015#endif
ad60d502
KY
4016}
4017
cd63a5ff 4018#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
4019#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4020#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
4021#else
4022#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4023#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4024#endif
4025
2a43952a 4026#ifdef CONFIG_PM
ad60d502
KY
4027static int alc269_suspend(struct hda_codec *codec)
4028{
4029 struct alc_spec *spec = codec->spec;
4030
4031 if (spec->has_alc5505_dsp)
cd63a5ff 4032 alc5505_dsp_suspend(codec);
1873ebd3 4033
ad60d502
KY
4034 return alc_suspend(codec);
4035}
4036
1d045db9
TI
4037static int alc269_resume(struct hda_codec *codec)
4038{
adcc70b2
KY
4039 struct alc_spec *spec = codec->spec;
4040
1387e2d1
KY
4041 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4042 alc269vb_toggle_power_output(codec, 0);
4043 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4044 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4045 msleep(150);
4046 }
8c427226 4047
1d045db9 4048 codec->patch_ops.init(codec);
f1d4e28b 4049
1387e2d1
KY
4050 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4051 alc269vb_toggle_power_output(codec, 1);
4052 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4053 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4054 msleep(200);
4055 }
f1d4e28b 4056
1a462be5 4057 snd_hda_regmap_sync(codec);
1d045db9 4058 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4059
4060 /* on some machine, the BIOS will clear the codec gpio data when enter
4061 * suspend, and won't restore the data after resume, so we restore it
4062 * in the driver.
4063 */
d261eec8
TI
4064 if (spec->gpio_data)
4065 alc_write_gpio_data(codec);
f475371a 4066
ad60d502 4067 if (spec->has_alc5505_dsp)
cd63a5ff 4068 alc5505_dsp_resume(codec);
c5177c86 4069
1d045db9
TI
4070 return 0;
4071}
2a43952a 4072#endif /* CONFIG_PM */
f1d4e28b 4073
108cc108 4074static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4075 const struct hda_fixup *fix, int action)
108cc108
DH
4076{
4077 struct alc_spec *spec = codec->spec;
4078
1727a771 4079 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4080 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4081}
4082
fdcc968a
JMG
4083static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4084 const struct hda_fixup *fix,
4085 int action)
4086{
4087 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4088 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4089
4090 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4091 snd_hda_codec_set_pincfg(codec, 0x19,
4092 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4093 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4094}
4095
1d045db9 4096static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4097 const struct hda_fixup *fix, int action)
1d045db9 4098{
98b24883
TI
4099 if (action == HDA_FIXUP_ACT_INIT)
4100 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4101}
f1d4e28b 4102
7c478f03
DH
4103static void alc269_fixup_headset_mic(struct hda_codec *codec,
4104 const struct hda_fixup *fix, int action)
4105{
4106 struct alc_spec *spec = codec->spec;
4107
4108 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4109 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4110}
4111
1d045db9 4112static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4113 const struct hda_fixup *fix, int action)
1d045db9
TI
4114{
4115 static const struct hda_verb verbs[] = {
4116 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4117 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4118 {}
4119 };
4120 unsigned int cfg;
f1d4e28b 4121
7639a06c
TI
4122 if (strcmp(codec->core.chip_name, "ALC271X") &&
4123 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4124 return;
4125 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4126 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4127 snd_hda_sequence_write(codec, verbs);
4128}
f1d4e28b 4129
c8426b27
TI
4130/* Fix the speaker amp after resume, etc */
4131static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4132 const struct hda_fixup *fix,
4133 int action)
4134{
4135 if (action == HDA_FIXUP_ACT_INIT)
4136 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4137}
4138
017f2a10 4139static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4140 const struct hda_fixup *fix, int action)
017f2a10
TI
4141{
4142 struct alc_spec *spec = codec->spec;
4143
1727a771 4144 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4145 return;
4146
4147 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4148 * fix the sample rate of analog I/O to 44.1kHz
4149 */
08c189f2
TI
4150 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4151 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4152}
4153
adabb3ec 4154static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4155 const struct hda_fixup *fix, int action)
adabb3ec 4156{
adabb3ec
TI
4157 /* The digital-mic unit sends PDM (differential signal) instead of
4158 * the standard PCM, thus you can't record a valid mono stream as is.
4159 * Below is a workaround specific to ALC269 to control the dmic
4160 * signal source as mono.
4161 */
98b24883
TI
4162 if (action == HDA_FIXUP_ACT_INIT)
4163 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4164}
4165
24519911
TI
4166static void alc269_quanta_automute(struct hda_codec *codec)
4167{
08c189f2 4168 snd_hda_gen_update_outputs(codec);
24519911 4169
1687ccc8
TI
4170 alc_write_coef_idx(codec, 0x0c, 0x680);
4171 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4172}
4173
4174static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4175 const struct hda_fixup *fix, int action)
24519911
TI
4176{
4177 struct alc_spec *spec = codec->spec;
1727a771 4178 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4179 return;
08c189f2 4180 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4181}
4182
d240d1dc 4183static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4184 struct hda_jack_callback *jack)
d240d1dc
DH
4185{
4186 struct alc_spec *spec = codec->spec;
4187 int vref;
4188 msleep(200);
4189 snd_hda_gen_hp_automute(codec, jack);
4190
4191 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4192 msleep(100);
4193 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4194 vref);
4195 msleep(500);
4196 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4197 vref);
4198}
4199
a2ef03fe
TE
4200/*
4201 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4202 */
4203struct hda_alc298_mbxinit {
4204 unsigned char value_0x23;
4205 unsigned char value_0x25;
4206};
4207
4208static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4209 const struct hda_alc298_mbxinit *initval,
4210 bool first)
4211{
4212 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4213 alc_write_coef_idx(codec, 0x26, 0xb000);
4214
4215 if (first)
4216 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4217
4218 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4219 alc_write_coef_idx(codec, 0x26, 0xf000);
4220 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4221
4222 if (initval->value_0x23 != 0x1e)
4223 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4224
4225 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4226 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4227}
4228
4229static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4230 const struct hda_fixup *fix,
4231 int action)
4232{
4233 /* Initialization magic */
4234 static const struct hda_alc298_mbxinit dac_init[] = {
4235 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4236 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4237 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4238 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4239 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4240 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4241 {0x2f, 0x00},
4242 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4243 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4244 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4245 {}
4246 };
4247 const struct hda_alc298_mbxinit *seq;
4248
4249 if (action != HDA_FIXUP_ACT_INIT)
4250 return;
4251
4252 /* Start */
4253 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4254 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4255 alc_write_coef_idx(codec, 0x26, 0xf000);
4256 alc_write_coef_idx(codec, 0x22, 0x31);
4257 alc_write_coef_idx(codec, 0x23, 0x0b);
4258 alc_write_coef_idx(codec, 0x25, 0x00);
4259 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4260 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4261
4262 for (seq = dac_init; seq->value_0x23; seq++)
4263 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4264}
4265
d240d1dc
DH
4266static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4267 const struct hda_fixup *fix, int action)
4268{
4269 struct alc_spec *spec = codec->spec;
4270 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4271 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4272 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4273 }
4274}
4275
766538ac
TI
4276static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4277 bool polarity, bool on)
4278{
4279 unsigned int pinval;
4280
4281 if (!pin)
4282 return;
4283 if (polarity)
4284 on = !on;
4285 pinval = snd_hda_codec_get_pin_target(codec, pin);
4286 pinval &= ~AC_PINCTL_VREFEN;
4287 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4288 /* temporarily power up/down for setting VREF */
4289 snd_hda_power_up_pm(codec);
4290 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4291 snd_hda_power_down_pm(codec);
4292}
d240d1dc 4293
08fb0d0e 4294/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4295static int vref_mute_led_set(struct led_classdev *led_cdev,
4296 enum led_brightness brightness)
6d3cd5d4 4297{
8d3d1ece 4298 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4299 struct alc_spec *spec = codec->spec;
08fb0d0e 4300
766538ac
TI
4301 alc_update_vref_led(codec, spec->mute_led_nid,
4302 spec->mute_led_polarity, brightness);
8d3d1ece 4303 return 0;
6d3cd5d4
DH
4304}
4305
d5b6b65e
DH
4306/* Make sure the led works even in runtime suspend */
4307static unsigned int led_power_filter(struct hda_codec *codec,
4308 hda_nid_t nid,
4309 unsigned int power_state)
4310{
4311 struct alc_spec *spec = codec->spec;
4312
50dd9050
HW
4313 if (power_state != AC_PWRST_D3 || nid == 0 ||
4314 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4315 return power_state;
4316
4317 /* Set pin ctl again, it might have just been set to 0 */
4318 snd_hda_set_pin_ctl(codec, nid,
4319 snd_hda_codec_get_pin_target(codec, nid));
4320
cffd3966 4321 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4322}
4323
08fb0d0e
TI
4324static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4325 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4326{
4327 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4328 const struct dmi_device *dev = NULL;
4329
4330 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4331 return;
4332
4333 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4334 int pol, pin;
4335 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4336 continue;
4337 if (pin < 0x0a || pin >= 0x10)
4338 break;
4339 spec->mute_led_polarity = pol;
4340 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4341 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4342 codec->power_filter = led_power_filter;
4e76a883
TI
4343 codec_dbg(codec,
4344 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4345 spec->mute_led_polarity);
6d3cd5d4
DH
4346 break;
4347 }
4348}
4349
85c467dc
TI
4350static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4351 const struct hda_fixup *fix,
4352 int action, hda_nid_t pin)
d06ac143
DH
4353{
4354 struct alc_spec *spec = codec->spec;
85c467dc 4355
d06ac143
DH
4356 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4357 spec->mute_led_polarity = 0;
85c467dc 4358 spec->mute_led_nid = pin;
8d3d1ece 4359 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4360 codec->power_filter = led_power_filter;
d06ac143
DH
4361 }
4362}
4363
85c467dc
TI
4364static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4365 const struct hda_fixup *fix, int action)
4366{
4367 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4368}
4369
08fb0d0e
TI
4370static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4371 const struct hda_fixup *fix, int action)
420b0feb 4372{
85c467dc 4373 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4374}
4375
7f783bd5
TB
4376static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4377 const struct hda_fixup *fix, int action)
4378{
85c467dc 4379 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4380}
4381
0f32fd19
TI
4382/* update LED status via GPIO */
4383static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4384 int polarity, bool enabled)
9f5c6faf 4385{
dbd13179 4386 if (polarity)
0f32fd19 4387 enabled = !enabled;
d261eec8 4388 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4389}
4390
0f32fd19 4391/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4392static int gpio_mute_led_set(struct led_classdev *led_cdev,
4393 enum led_brightness brightness)
9f5c6faf 4394{
8d3d1ece 4395 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4396 struct alc_spec *spec = codec->spec;
9f5c6faf 4397
dbd13179 4398 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4399 spec->mute_led_polarity, !brightness);
4400 return 0;
0f32fd19 4401}
9f5c6faf 4402
0f32fd19 4403/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4404static int micmute_led_set(struct led_classdev *led_cdev,
4405 enum led_brightness brightness)
4406{
4407 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4408 struct alc_spec *spec = codec->spec;
4409
4410 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4411 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4412 return 0;
4413}
4414
01e4a275
TI
4415/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4416static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4417 int action,
4418 unsigned int mute_mask,
4419 unsigned int micmute_mask)
9f5c6faf
TI
4420{
4421 struct alc_spec *spec = codec->spec;
9f5c6faf 4422
01e4a275
TI
4423 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4424
4425 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4426 return;
4427 if (mute_mask) {
4428 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4429 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4430 }
4431 if (micmute_mask) {
4432 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4433 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4434 }
4435}
4436
e7d66cf7
JS
4437static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4438 const struct hda_fixup *fix, int action)
4439{
4440 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4441}
4442
01e4a275 4443static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4444 const struct hda_fixup *fix, int action)
4445{
01e4a275
TI
4446 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4447}
eaa8e5ef 4448
f5a88b0a
KHF
4449static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4450 const struct hda_fixup *fix, int action)
4451{
3e0650ab 4452 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4453}
4454
01e4a275
TI
4455static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4456 const struct hda_fixup *fix, int action)
4457{
4458 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4459}
4460
a0ccbc53
KY
4461static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4462 const struct hda_fixup *fix, int action)
4463{
4464 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4465}
4466
5fc462c3
JC
4467static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4468 const struct hda_fixup *fix, int action)
4469{
4470 struct alc_spec *spec = codec->spec;
4471
4472 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4473 spec->micmute_led_polarity = 1;
4474 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4475}
4476
8a503555
TI
4477/* turn on/off mic-mute LED per capture hook via VREF change */
4478static int vref_micmute_led_set(struct led_classdev *led_cdev,
4479 enum led_brightness brightness)
9c5dc3bf 4480{
8a503555 4481 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4482 struct alc_spec *spec = codec->spec;
9c5dc3bf 4483
766538ac
TI
4484 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4485 spec->micmute_led_polarity, brightness);
8a503555 4486 return 0;
9c5dc3bf
KY
4487}
4488
4489static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4490 const struct hda_fixup *fix, int action)
4491{
4492 struct alc_spec *spec = codec->spec;
9c5dc3bf 4493
01e4a275 4494 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4495 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4496 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4497 * enable headphone amp
4498 */
4499 spec->gpio_mask |= 0x10;
4500 spec->gpio_dir |= 0x10;
9c5dc3bf 4501 spec->cap_mute_led_nid = 0x18;
8a503555 4502 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4503 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4504 }
4505}
4506
7a5255f1
DH
4507static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4508 const struct hda_fixup *fix, int action)
4509{
7a5255f1 4510 struct alc_spec *spec = codec->spec;
7a5255f1 4511
01e4a275 4512 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4513 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4514 spec->cap_mute_led_nid = 0x18;
8a503555 4515 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4516 codec->power_filter = led_power_filter;
4517 }
4518}
4519
c3bb2b52
TI
4520/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4521 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4522 */
4523static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4524 const struct hda_fixup *fix, int action)
4525{
4526 struct alc_spec *spec = codec->spec;
4527
4528 switch (action) {
4529 case HDA_FIXUP_ACT_PRE_PROBE:
4530 spec->gpio_mask |= 0x01;
4531 spec->gpio_dir |= 0x01;
4532 break;
4533 case HDA_FIXUP_ACT_INIT:
4534 /* need to toggle GPIO to enable the amp */
4535 alc_update_gpio_data(codec, 0x01, true);
4536 msleep(100);
4537 alc_update_gpio_data(codec, 0x01, false);
4538 break;
4539 }
4540}
4541
622464c8
TI
4542/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4543static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4544 struct hda_codec *codec,
4545 struct snd_pcm_substream *substream,
4546 int action)
4547{
4548 switch (action) {
4549 case HDA_GEN_PCM_ACT_PREPARE:
4550 alc_update_gpio_data(codec, 0x04, true);
4551 break;
4552 case HDA_GEN_PCM_ACT_CLEANUP:
4553 alc_update_gpio_data(codec, 0x04, false);
4554 break;
4555 }
4556}
4557
4558static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4559 const struct hda_fixup *fix,
4560 int action)
4561{
4562 struct alc_spec *spec = codec->spec;
4563
4564 if (action == HDA_FIXUP_ACT_PROBE) {
4565 spec->gpio_mask |= 0x04;
4566 spec->gpio_dir |= 0x04;
4567 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4568 }
4569}
4570
766538ac
TI
4571static void alc_update_coef_led(struct hda_codec *codec,
4572 struct alc_coef_led *led,
4573 bool polarity, bool on)
4574{
4575 if (polarity)
4576 on = !on;
4577 /* temporarily power up/down for setting COEF bit */
4578 alc_update_coef_idx(codec, led->idx, led->mask,
4579 on ? led->on : led->off);
4580}
4581
431e76c3 4582/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4583static int coef_mute_led_set(struct led_classdev *led_cdev,
4584 enum led_brightness brightness)
431e76c3 4585{
8d3d1ece 4586 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4587 struct alc_spec *spec = codec->spec;
4588
766538ac
TI
4589 alc_update_coef_led(codec, &spec->mute_led_coef,
4590 spec->mute_led_polarity, brightness);
8d3d1ece 4591 return 0;
431e76c3
KY
4592}
4593
4594static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4595 const struct hda_fixup *fix,
4596 int action)
4597{
4598 struct alc_spec *spec = codec->spec;
4599
4600 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4601 spec->mute_led_polarity = 0;
766538ac
TI
4602 spec->mute_led_coef.idx = 0x0b;
4603 spec->mute_led_coef.mask = 1 << 3;
4604 spec->mute_led_coef.on = 1 << 3;
4605 spec->mute_led_coef.off = 0;
8d3d1ece 4606 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4607 }
4608}
4609
24164f43
KY
4610static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4611 const struct hda_fixup *fix,
4612 int action)
4613{
4614 struct alc_spec *spec = codec->spec;
4615
4616 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4617 spec->mute_led_polarity = 0;
766538ac
TI
4618 spec->mute_led_coef.idx = 0x34;
4619 spec->mute_led_coef.mask = 1 << 5;
4620 spec->mute_led_coef.on = 0;
4621 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4622 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4623 }
4624}
4625
431e76c3 4626/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4627static int coef_micmute_led_set(struct led_classdev *led_cdev,
4628 enum led_brightness brightness)
431e76c3 4629{
8a503555 4630 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4631 struct alc_spec *spec = codec->spec;
4632
766538ac
TI
4633 alc_update_coef_led(codec, &spec->mic_led_coef,
4634 spec->micmute_led_polarity, brightness);
8a503555 4635 return 0;
431e76c3
KY
4636}
4637
4638static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4639 const struct hda_fixup *fix, int action)
4640{
4641 struct alc_spec *spec = codec->spec;
4642
4643 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4644 spec->mic_led_coef.idx = 0x19;
4645 spec->mic_led_coef.mask = 1 << 13;
4646 spec->mic_led_coef.on = 1 << 13;
4647 spec->mic_led_coef.off = 0;
8a503555 4648 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4649 }
4650}
4651
ca88eeb3
LG
4652static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4653 const struct hda_fixup *fix, int action)
4654{
4655 struct alc_spec *spec = codec->spec;
4656
4657 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4658 spec->micmute_led_polarity = 1;
4659 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4660}
4661
24164f43
KY
4662static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4663 const struct hda_fixup *fix, int action)
4664{
4665 struct alc_spec *spec = codec->spec;
4666
4667 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4668 spec->mic_led_coef.idx = 0x35;
4669 spec->mic_led_coef.mask = 3 << 2;
4670 spec->mic_led_coef.on = 2 << 2;
4671 spec->mic_led_coef.off = 1 << 2;
8a503555 4672 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4673 }
4674}
4675
431e76c3
KY
4676static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4677 const struct hda_fixup *fix, int action)
4678{
4679 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4680 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4681}
4682
ca88eeb3
LG
4683static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4684 const struct hda_fixup *fix, int action)
4685{
4686 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4687 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4688}
4689
24164f43
KY
4690static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4691 const struct hda_fixup *fix, int action)
4692{
4693 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4694 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4695}
4696
75b62ab6
JW
4697static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4698 const struct hda_fixup *fix, int action)
4699{
4700 struct alc_spec *spec = codec->spec;
4701
4702 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4703 spec->cap_mute_led_nid = 0x1a;
4704 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4705 codec->power_filter = led_power_filter;
4706 }
4707}
4708
4709static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4710 const struct hda_fixup *fix, int action)
4711{
4712 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4713 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4714}
4715
a2d57ebe
KM
4716static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4717 const unsigned short coefs[2])
4718{
4719 alc_write_coef_idx(codec, 0x23, coefs[0]);
4720 alc_write_coef_idx(codec, 0x25, coefs[1]);
4721 alc_write_coef_idx(codec, 0x26, 0xb011);
4722}
4723
4724struct alc298_samsung_amp_desc {
4725 unsigned char nid;
4726 unsigned short init_seq[2][2];
4727};
4728
4729static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4730 const struct hda_fixup *fix, int action)
4731{
4732 int i, j;
4733 static const unsigned short init_seq[][2] = {
4734 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4735 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4736 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4737 { 0x41, 0x07 }, { 0x400, 0x1 }
4738 };
4739 static const struct alc298_samsung_amp_desc amps[] = {
4740 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4741 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4742 };
4743
4744 if (action != HDA_FIXUP_ACT_INIT)
4745 return;
4746
4747 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4748 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4749
4750 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4751 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4752
4753 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4754 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4755 }
4756}
4757
6a30abaa 4758#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4759static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4760 struct hda_jack_callback *event)
4761{
4762 struct alc_spec *spec = codec->spec;
4763
4764 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4765 send both key on and key off event for every interrupt. */
c7b60a89 4766 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4767 input_sync(spec->kb_dev);
c7b60a89 4768 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4769 input_sync(spec->kb_dev);
4770}
33f4acd3 4771
3694cb29
K
4772static int alc_register_micmute_input_device(struct hda_codec *codec)
4773{
4774 struct alc_spec *spec = codec->spec;
c7b60a89 4775 int i;
3694cb29
K
4776
4777 spec->kb_dev = input_allocate_device();
4778 if (!spec->kb_dev) {
4779 codec_err(codec, "Out of memory (input_allocate_device)\n");
4780 return -ENOMEM;
4781 }
c7b60a89
HW
4782
4783 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4784
3694cb29
K
4785 spec->kb_dev->name = "Microphone Mute Button";
4786 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4787 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4788 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4789 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4790 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4791 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4792
4793 if (input_register_device(spec->kb_dev)) {
4794 codec_err(codec, "input_register_device failed\n");
4795 input_free_device(spec->kb_dev);
4796 spec->kb_dev = NULL;
4797 return -ENOMEM;
4798 }
4799
4800 return 0;
4801}
4802
01e4a275
TI
4803/* GPIO1 = set according to SKU external amp
4804 * GPIO2 = mic mute hotkey
4805 * GPIO3 = mute LED
4806 * GPIO4 = mic mute LED
4807 */
33f4acd3
DH
4808static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4809 const struct hda_fixup *fix, int action)
4810{
33f4acd3
DH
4811 struct alc_spec *spec = codec->spec;
4812
01e4a275 4813 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4814 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4815 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4816 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4817 return;
33f4acd3 4818
01e4a275
TI
4819 spec->gpio_mask |= 0x06;
4820 spec->gpio_dir |= 0x02;
4821 spec->gpio_data |= 0x02;
7639a06c 4822 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4823 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4824 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4825 gpio2_mic_hotkey_event);
33f4acd3
DH
4826 return;
4827 }
4828
4829 if (!spec->kb_dev)
4830 return;
4831
4832 switch (action) {
33f4acd3
DH
4833 case HDA_FIXUP_ACT_FREE:
4834 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4835 spec->kb_dev = NULL;
4836 }
33f4acd3
DH
4837}
4838
01e4a275
TI
4839/* Line2 = mic mute hotkey
4840 * GPIO2 = mic mute LED
4841 */
3694cb29
K
4842static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4843 const struct hda_fixup *fix, int action)
4844{
3694cb29
K
4845 struct alc_spec *spec = codec->spec;
4846
01e4a275 4847 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4848 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4849 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4850 if (alc_register_micmute_input_device(codec) != 0)
4851 return;
4852
3694cb29
K
4853 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4854 gpio2_mic_hotkey_event);
3694cb29
K
4855 return;
4856 }
4857
4858 if (!spec->kb_dev)
4859 return;
4860
4861 switch (action) {
3694cb29
K
4862 case HDA_FIXUP_ACT_FREE:
4863 input_unregister_device(spec->kb_dev);
4864 spec->kb_dev = NULL;
4865 }
4866}
c469652b
TI
4867#else /* INPUT */
4868#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4869#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4870#endif /* INPUT */
3694cb29 4871
9c5dc3bf
KY
4872static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4873 const struct hda_fixup *fix, int action)
4874{
4875 struct alc_spec *spec = codec->spec;
4876
1bce62a6 4877 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4878 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4879 spec->cap_mute_led_nid = 0x18;
8a503555 4880 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4881 }
4882}
4883
6b0f95c4 4884static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4885 UPDATE_COEF(0x4a, 1<<8, 0),
4886 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4887 UPDATE_COEF(0x63, 3<<14, 3<<14),
4888 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4889 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4890 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4891 UPDATE_COEF(0x4a, 3<<10, 0),
4892 {}
4893};
4894
73bdd597
DH
4895static void alc_headset_mode_unplugged(struct hda_codec *codec)
4896{
92666d45 4897 struct alc_spec *spec = codec->spec;
6b0f95c4 4898 static const struct coef_fw coef0255[] = {
717f43d8 4899 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4900 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4901 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4902 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4903 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4904 {}
4905 };
6b0f95c4 4906 static const struct coef_fw coef0256[] = {
e69e7e03 4907 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4908 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4909 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4910 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4911 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4912 {}
4913 };
6b0f95c4 4914 static const struct coef_fw coef0233[] = {
54db6c39
TI
4915 WRITE_COEF(0x1b, 0x0c0b),
4916 WRITE_COEF(0x45, 0xc429),
4917 UPDATE_COEF(0x35, 0x4000, 0),
4918 WRITE_COEF(0x06, 0x2104),
4919 WRITE_COEF(0x1a, 0x0001),
4920 WRITE_COEF(0x26, 0x0004),
4921 WRITE_COEF(0x32, 0x42a3),
4922 {}
4923 };
6b0f95c4 4924 static const struct coef_fw coef0288[] = {
f3b70332
KY
4925 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4926 UPDATE_COEF(0x50, 0x2000, 0x2000),
4927 UPDATE_COEF(0x56, 0x0006, 0x0006),
4928 UPDATE_COEF(0x66, 0x0008, 0),
4929 UPDATE_COEF(0x67, 0x2000, 0),
4930 {}
4931 };
6b0f95c4 4932 static const struct coef_fw coef0298[] = {
89542936
KY
4933 UPDATE_COEF(0x19, 0x1300, 0x0300),
4934 {}
4935 };
6b0f95c4 4936 static const struct coef_fw coef0292[] = {
54db6c39
TI
4937 WRITE_COEF(0x76, 0x000e),
4938 WRITE_COEF(0x6c, 0x2400),
4939 WRITE_COEF(0x18, 0x7308),
4940 WRITE_COEF(0x6b, 0xc429),
4941 {}
4942 };
6b0f95c4 4943 static const struct coef_fw coef0293[] = {
54db6c39
TI
4944 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4945 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4946 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4947 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4948 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4949 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4950 {}
4951 };
6b0f95c4 4952 static const struct coef_fw coef0668[] = {
54db6c39
TI
4953 WRITE_COEF(0x15, 0x0d40),
4954 WRITE_COEF(0xb7, 0x802b),
4955 {}
4956 };
6b0f95c4 4957 static const struct coef_fw coef0225[] = {
5a36767a 4958 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
4959 {}
4960 };
6b0f95c4 4961 static const struct coef_fw coef0274[] = {
71683c32
KY
4962 UPDATE_COEF(0x4a, 0x0100, 0),
4963 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4964 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4965 UPDATE_COEF(0x4a, 0x0010, 0),
4966 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4967 WRITE_COEF(0x45, 0x5289),
4968 UPDATE_COEF(0x4a, 0x0c00, 0),
4969 {}
4970 };
54db6c39 4971
92666d45
KY
4972 if (spec->no_internal_mic_pin) {
4973 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4974 return;
4975 }
4976
7639a06c 4977 switch (codec->core.vendor_id) {
9a22a8f5 4978 case 0x10ec0255:
e69e7e03
KY
4979 alc_process_coef_fw(codec, coef0255);
4980 break;
1948fc06 4981 case 0x10ec0230:
736f20a7 4982 case 0x10ec0236:
7081adf3 4983 case 0x10ec0256:
527f4643 4984 case 0x19e58326:
e69e7e03 4985 alc_process_coef_fw(codec, coef0256);
9a22a8f5 4986 break;
71683c32
KY
4987 case 0x10ec0234:
4988 case 0x10ec0274:
4989 case 0x10ec0294:
4990 alc_process_coef_fw(codec, coef0274);
4991 break;
13fd08a3 4992 case 0x10ec0233:
73bdd597 4993 case 0x10ec0283:
54db6c39 4994 alc_process_coef_fw(codec, coef0233);
73bdd597 4995 break;
f3b70332
KY
4996 case 0x10ec0286:
4997 case 0x10ec0288:
89542936
KY
4998 alc_process_coef_fw(codec, coef0288);
4999 break;
1a5bc8d9 5000 case 0x10ec0298:
89542936 5001 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
5002 alc_process_coef_fw(codec, coef0288);
5003 break;
73bdd597 5004 case 0x10ec0292:
54db6c39 5005 alc_process_coef_fw(codec, coef0292);
73bdd597 5006 break;
a22aa26f 5007 case 0x10ec0293:
54db6c39 5008 alc_process_coef_fw(codec, coef0293);
a22aa26f 5009 break;
73bdd597 5010 case 0x10ec0668:
54db6c39 5011 alc_process_coef_fw(codec, coef0668);
73bdd597 5012 break;
c2b691ee 5013 case 0x10ec0215:
4cc9b9d6 5014 case 0x10ec0225:
c2b691ee 5015 case 0x10ec0285:
7d727869 5016 case 0x10ec0295:
c2b691ee 5017 case 0x10ec0289:
28f1f9b2 5018 case 0x10ec0299:
4d4b0c52 5019 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5020 alc_process_coef_fw(codec, coef0225);
5021 break;
78f4f7c2
KY
5022 case 0x10ec0867:
5023 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5024 break;
73bdd597 5025 }
4e76a883 5026 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
5027}
5028
5029
5030static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5031 hda_nid_t mic_pin)
5032{
6b0f95c4 5033 static const struct coef_fw coef0255[] = {
54db6c39
TI
5034 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5035 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5036 {}
5037 };
6b0f95c4 5038 static const struct coef_fw coef0256[] = {
717f43d8
KY
5039 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5040 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5041 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5042 {}
5043 };
6b0f95c4 5044 static const struct coef_fw coef0233[] = {
54db6c39
TI
5045 UPDATE_COEF(0x35, 0, 1<<14),
5046 WRITE_COEF(0x06, 0x2100),
5047 WRITE_COEF(0x1a, 0x0021),
5048 WRITE_COEF(0x26, 0x008c),
5049 {}
5050 };
6b0f95c4 5051 static const struct coef_fw coef0288[] = {
89542936 5052 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
5053 UPDATE_COEF(0x50, 0x2000, 0),
5054 UPDATE_COEF(0x56, 0x0006, 0),
5055 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5056 UPDATE_COEF(0x66, 0x0008, 0x0008),
5057 UPDATE_COEF(0x67, 0x2000, 0x2000),
5058 {}
5059 };
6b0f95c4 5060 static const struct coef_fw coef0292[] = {
54db6c39
TI
5061 WRITE_COEF(0x19, 0xa208),
5062 WRITE_COEF(0x2e, 0xacf0),
5063 {}
5064 };
6b0f95c4 5065 static const struct coef_fw coef0293[] = {
54db6c39
TI
5066 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5067 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5068 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5069 {}
5070 };
6b0f95c4 5071 static const struct coef_fw coef0688[] = {
54db6c39
TI
5072 WRITE_COEF(0xb7, 0x802b),
5073 WRITE_COEF(0xb5, 0x1040),
5074 UPDATE_COEF(0xc3, 0, 1<<12),
5075 {}
5076 };
6b0f95c4 5077 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
5078 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5079 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5080 UPDATE_COEF(0x63, 3<<14, 0),
5081 {}
5082 };
6b0f95c4 5083 static const struct coef_fw coef0274[] = {
71683c32
KY
5084 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5085 UPDATE_COEF(0x4a, 0x0010, 0),
5086 UPDATE_COEF(0x6b, 0xf000, 0),
5087 {}
5088 };
54db6c39 5089
7639a06c 5090 switch (codec->core.vendor_id) {
9a22a8f5
KY
5091 case 0x10ec0255:
5092 alc_write_coef_idx(codec, 0x45, 0xc489);
5093 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5094 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5095 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5096 break;
1948fc06 5097 case 0x10ec0230:
717f43d8
KY
5098 case 0x10ec0236:
5099 case 0x10ec0256:
527f4643 5100 case 0x19e58326:
717f43d8
KY
5101 alc_write_coef_idx(codec, 0x45, 0xc489);
5102 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5103 alc_process_coef_fw(codec, coef0256);
5104 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5105 break;
71683c32
KY
5106 case 0x10ec0234:
5107 case 0x10ec0274:
5108 case 0x10ec0294:
5109 alc_write_coef_idx(codec, 0x45, 0x4689);
5110 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5111 alc_process_coef_fw(codec, coef0274);
5112 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5113 break;
13fd08a3 5114 case 0x10ec0233:
73bdd597
DH
5115 case 0x10ec0283:
5116 alc_write_coef_idx(codec, 0x45, 0xc429);
5117 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5118 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5119 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5120 break;
f3b70332
KY
5121 case 0x10ec0286:
5122 case 0x10ec0288:
1a5bc8d9 5123 case 0x10ec0298:
f3b70332
KY
5124 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5125 alc_process_coef_fw(codec, coef0288);
5126 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5127 break;
73bdd597
DH
5128 case 0x10ec0292:
5129 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5130 alc_process_coef_fw(codec, coef0292);
73bdd597 5131 break;
a22aa26f
KY
5132 case 0x10ec0293:
5133 /* Set to TRS mode */
5134 alc_write_coef_idx(codec, 0x45, 0xc429);
5135 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5136 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5137 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5138 break;
78f4f7c2
KY
5139 case 0x10ec0867:
5140 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5141 fallthrough;
9eb5d0e6 5142 case 0x10ec0221:
1f8b46cd
DH
5143 case 0x10ec0662:
5144 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5145 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5146 break;
73bdd597
DH
5147 case 0x10ec0668:
5148 alc_write_coef_idx(codec, 0x11, 0x0001);
5149 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5150 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5151 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5152 break;
c2b691ee 5153 case 0x10ec0215:
4cc9b9d6 5154 case 0x10ec0225:
c2b691ee 5155 case 0x10ec0285:
7d727869 5156 case 0x10ec0295:
c2b691ee 5157 case 0x10ec0289:
28f1f9b2 5158 case 0x10ec0299:
5a36767a 5159 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5160 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5161 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5162 alc_process_coef_fw(codec, coef0225);
5163 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5164 break;
73bdd597 5165 }
4e76a883 5166 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5167}
5168
5169static void alc_headset_mode_default(struct hda_codec *codec)
5170{
6b0f95c4 5171 static const struct coef_fw coef0225[] = {
5a36767a
KY
5172 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5173 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5174 UPDATE_COEF(0x49, 3<<8, 0<<8),
5175 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5176 UPDATE_COEF(0x63, 3<<14, 0),
5177 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5178 {}
5179 };
6b0f95c4 5180 static const struct coef_fw coef0255[] = {
54db6c39
TI
5181 WRITE_COEF(0x45, 0xc089),
5182 WRITE_COEF(0x45, 0xc489),
5183 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5184 WRITE_COEF(0x49, 0x0049),
5185 {}
5186 };
6b0f95c4 5187 static const struct coef_fw coef0256[] = {
717f43d8
KY
5188 WRITE_COEF(0x45, 0xc489),
5189 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5190 WRITE_COEF(0x49, 0x0049),
5191 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5192 WRITE_COEF(0x06, 0x6100),
5193 {}
5194 };
6b0f95c4 5195 static const struct coef_fw coef0233[] = {
54db6c39
TI
5196 WRITE_COEF(0x06, 0x2100),
5197 WRITE_COEF(0x32, 0x4ea3),
5198 {}
5199 };
6b0f95c4 5200 static const struct coef_fw coef0288[] = {
f3b70332
KY
5201 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5202 UPDATE_COEF(0x50, 0x2000, 0x2000),
5203 UPDATE_COEF(0x56, 0x0006, 0x0006),
5204 UPDATE_COEF(0x66, 0x0008, 0),
5205 UPDATE_COEF(0x67, 0x2000, 0),
5206 {}
5207 };
6b0f95c4 5208 static const struct coef_fw coef0292[] = {
54db6c39
TI
5209 WRITE_COEF(0x76, 0x000e),
5210 WRITE_COEF(0x6c, 0x2400),
5211 WRITE_COEF(0x6b, 0xc429),
5212 WRITE_COEF(0x18, 0x7308),
5213 {}
5214 };
6b0f95c4 5215 static const struct coef_fw coef0293[] = {
54db6c39
TI
5216 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5217 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5218 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5219 {}
5220 };
6b0f95c4 5221 static const struct coef_fw coef0688[] = {
54db6c39
TI
5222 WRITE_COEF(0x11, 0x0041),
5223 WRITE_COEF(0x15, 0x0d40),
5224 WRITE_COEF(0xb7, 0x802b),
5225 {}
5226 };
6b0f95c4 5227 static const struct coef_fw coef0274[] = {
71683c32
KY
5228 WRITE_COEF(0x45, 0x4289),
5229 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5230 UPDATE_COEF(0x6b, 0x0f00, 0),
5231 UPDATE_COEF(0x49, 0x0300, 0x0300),
5232 {}
5233 };
54db6c39 5234
7639a06c 5235 switch (codec->core.vendor_id) {
c2b691ee 5236 case 0x10ec0215:
2ae95577 5237 case 0x10ec0225:
c2b691ee 5238 case 0x10ec0285:
7d727869 5239 case 0x10ec0295:
c2b691ee 5240 case 0x10ec0289:
28f1f9b2 5241 case 0x10ec0299:
5a36767a 5242 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5243 alc_process_coef_fw(codec, coef0225);
5244 break;
9a22a8f5 5245 case 0x10ec0255:
54db6c39 5246 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5247 break;
1948fc06 5248 case 0x10ec0230:
717f43d8
KY
5249 case 0x10ec0236:
5250 case 0x10ec0256:
527f4643 5251 case 0x19e58326:
717f43d8
KY
5252 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5253 alc_write_coef_idx(codec, 0x45, 0xc089);
5254 msleep(50);
5255 alc_process_coef_fw(codec, coef0256);
5256 break;
71683c32
KY
5257 case 0x10ec0234:
5258 case 0x10ec0274:
5259 case 0x10ec0294:
5260 alc_process_coef_fw(codec, coef0274);
5261 break;
13fd08a3 5262 case 0x10ec0233:
73bdd597 5263 case 0x10ec0283:
54db6c39 5264 alc_process_coef_fw(codec, coef0233);
73bdd597 5265 break;
f3b70332
KY
5266 case 0x10ec0286:
5267 case 0x10ec0288:
1a5bc8d9 5268 case 0x10ec0298:
f3b70332
KY
5269 alc_process_coef_fw(codec, coef0288);
5270 break;
73bdd597 5271 case 0x10ec0292:
54db6c39 5272 alc_process_coef_fw(codec, coef0292);
73bdd597 5273 break;
a22aa26f 5274 case 0x10ec0293:
54db6c39 5275 alc_process_coef_fw(codec, coef0293);
a22aa26f 5276 break;
73bdd597 5277 case 0x10ec0668:
54db6c39 5278 alc_process_coef_fw(codec, coef0688);
73bdd597 5279 break;
78f4f7c2
KY
5280 case 0x10ec0867:
5281 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5282 break;
73bdd597 5283 }
4e76a883 5284 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5285}
5286
5287/* Iphone type */
5288static void alc_headset_mode_ctia(struct hda_codec *codec)
5289{
89542936
KY
5290 int val;
5291
6b0f95c4 5292 static const struct coef_fw coef0255[] = {
54db6c39
TI
5293 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5294 WRITE_COEF(0x1b, 0x0c2b),
5295 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5296 {}
5297 };
6b0f95c4 5298 static const struct coef_fw coef0256[] = {
e69e7e03 5299 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5300 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5301 {}
5302 };
6b0f95c4 5303 static const struct coef_fw coef0233[] = {
54db6c39
TI
5304 WRITE_COEF(0x45, 0xd429),
5305 WRITE_COEF(0x1b, 0x0c2b),
5306 WRITE_COEF(0x32, 0x4ea3),
5307 {}
5308 };
6b0f95c4 5309 static const struct coef_fw coef0288[] = {
f3b70332
KY
5310 UPDATE_COEF(0x50, 0x2000, 0x2000),
5311 UPDATE_COEF(0x56, 0x0006, 0x0006),
5312 UPDATE_COEF(0x66, 0x0008, 0),
5313 UPDATE_COEF(0x67, 0x2000, 0),
5314 {}
5315 };
6b0f95c4 5316 static const struct coef_fw coef0292[] = {
54db6c39
TI
5317 WRITE_COEF(0x6b, 0xd429),
5318 WRITE_COEF(0x76, 0x0008),
5319 WRITE_COEF(0x18, 0x7388),
5320 {}
5321 };
6b0f95c4 5322 static const struct coef_fw coef0293[] = {
54db6c39
TI
5323 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5324 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5325 {}
5326 };
6b0f95c4 5327 static const struct coef_fw coef0688[] = {
54db6c39
TI
5328 WRITE_COEF(0x11, 0x0001),
5329 WRITE_COEF(0x15, 0x0d60),
5330 WRITE_COEF(0xc3, 0x0000),
5331 {}
5332 };
6b0f95c4 5333 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5334 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5335 UPDATE_COEF(0x63, 3<<14, 2<<14),
5336 {}
5337 };
6b0f95c4 5338 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5339 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5340 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5341 {}
5342 };
54db6c39 5343
7639a06c 5344 switch (codec->core.vendor_id) {
9a22a8f5 5345 case 0x10ec0255:
54db6c39 5346 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5347 break;
1948fc06 5348 case 0x10ec0230:
736f20a7 5349 case 0x10ec0236:
e69e7e03 5350 case 0x10ec0256:
527f4643 5351 case 0x19e58326:
e69e7e03
KY
5352 alc_process_coef_fw(codec, coef0256);
5353 break;
71683c32
KY
5354 case 0x10ec0234:
5355 case 0x10ec0274:
5356 case 0x10ec0294:
5357 alc_write_coef_idx(codec, 0x45, 0xd689);
5358 break;
13fd08a3 5359 case 0x10ec0233:
73bdd597 5360 case 0x10ec0283:
54db6c39 5361 alc_process_coef_fw(codec, coef0233);
73bdd597 5362 break;
1a5bc8d9 5363 case 0x10ec0298:
89542936
KY
5364 val = alc_read_coef_idx(codec, 0x50);
5365 if (val & (1 << 12)) {
5366 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5367 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5368 msleep(300);
5369 } else {
5370 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5371 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5372 msleep(300);
5373 }
5374 break;
f3b70332
KY
5375 case 0x10ec0286:
5376 case 0x10ec0288:
5377 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5378 msleep(300);
5379 alc_process_coef_fw(codec, coef0288);
5380 break;
73bdd597 5381 case 0x10ec0292:
54db6c39 5382 alc_process_coef_fw(codec, coef0292);
73bdd597 5383 break;
a22aa26f 5384 case 0x10ec0293:
54db6c39 5385 alc_process_coef_fw(codec, coef0293);
a22aa26f 5386 break;
73bdd597 5387 case 0x10ec0668:
54db6c39 5388 alc_process_coef_fw(codec, coef0688);
73bdd597 5389 break;
c2b691ee 5390 case 0x10ec0215:
4cc9b9d6 5391 case 0x10ec0225:
c2b691ee 5392 case 0x10ec0285:
7d727869 5393 case 0x10ec0295:
c2b691ee 5394 case 0x10ec0289:
28f1f9b2 5395 case 0x10ec0299:
5a36767a
KY
5396 val = alc_read_coef_idx(codec, 0x45);
5397 if (val & (1 << 9))
5398 alc_process_coef_fw(codec, coef0225_2);
5399 else
5400 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5401 break;
78f4f7c2
KY
5402 case 0x10ec0867:
5403 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5404 break;
73bdd597 5405 }
4e76a883 5406 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5407}
5408
5409/* Nokia type */
5410static void alc_headset_mode_omtp(struct hda_codec *codec)
5411{
6b0f95c4 5412 static const struct coef_fw coef0255[] = {
54db6c39
TI
5413 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5414 WRITE_COEF(0x1b, 0x0c2b),
5415 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5416 {}
5417 };
6b0f95c4 5418 static const struct coef_fw coef0256[] = {
e69e7e03 5419 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5420 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5421 {}
5422 };
6b0f95c4 5423 static const struct coef_fw coef0233[] = {
54db6c39
TI
5424 WRITE_COEF(0x45, 0xe429),
5425 WRITE_COEF(0x1b, 0x0c2b),
5426 WRITE_COEF(0x32, 0x4ea3),
5427 {}
5428 };
6b0f95c4 5429 static const struct coef_fw coef0288[] = {
f3b70332
KY
5430 UPDATE_COEF(0x50, 0x2000, 0x2000),
5431 UPDATE_COEF(0x56, 0x0006, 0x0006),
5432 UPDATE_COEF(0x66, 0x0008, 0),
5433 UPDATE_COEF(0x67, 0x2000, 0),
5434 {}
5435 };
6b0f95c4 5436 static const struct coef_fw coef0292[] = {
54db6c39
TI
5437 WRITE_COEF(0x6b, 0xe429),
5438 WRITE_COEF(0x76, 0x0008),
5439 WRITE_COEF(0x18, 0x7388),
5440 {}
5441 };
6b0f95c4 5442 static const struct coef_fw coef0293[] = {
54db6c39
TI
5443 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5444 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5445 {}
5446 };
6b0f95c4 5447 static const struct coef_fw coef0688[] = {
54db6c39
TI
5448 WRITE_COEF(0x11, 0x0001),
5449 WRITE_COEF(0x15, 0x0d50),
5450 WRITE_COEF(0xc3, 0x0000),
5451 {}
5452 };
6b0f95c4 5453 static const struct coef_fw coef0225[] = {
4cc9b9d6 5454 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5455 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5456 {}
5457 };
54db6c39 5458
7639a06c 5459 switch (codec->core.vendor_id) {
9a22a8f5 5460 case 0x10ec0255:
54db6c39 5461 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5462 break;
1948fc06 5463 case 0x10ec0230:
736f20a7 5464 case 0x10ec0236:
e69e7e03 5465 case 0x10ec0256:
527f4643 5466 case 0x19e58326:
e69e7e03
KY
5467 alc_process_coef_fw(codec, coef0256);
5468 break;
71683c32
KY
5469 case 0x10ec0234:
5470 case 0x10ec0274:
5471 case 0x10ec0294:
5472 alc_write_coef_idx(codec, 0x45, 0xe689);
5473 break;
13fd08a3 5474 case 0x10ec0233:
73bdd597 5475 case 0x10ec0283:
54db6c39 5476 alc_process_coef_fw(codec, coef0233);
73bdd597 5477 break;
1a5bc8d9
KY
5478 case 0x10ec0298:
5479 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5480 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5481 msleep(300);
5482 break;
f3b70332
KY
5483 case 0x10ec0286:
5484 case 0x10ec0288:
5485 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5486 msleep(300);
5487 alc_process_coef_fw(codec, coef0288);
5488 break;
73bdd597 5489 case 0x10ec0292:
54db6c39 5490 alc_process_coef_fw(codec, coef0292);
73bdd597 5491 break;
a22aa26f 5492 case 0x10ec0293:
54db6c39 5493 alc_process_coef_fw(codec, coef0293);
a22aa26f 5494 break;
73bdd597 5495 case 0x10ec0668:
54db6c39 5496 alc_process_coef_fw(codec, coef0688);
73bdd597 5497 break;
c2b691ee 5498 case 0x10ec0215:
4cc9b9d6 5499 case 0x10ec0225:
c2b691ee 5500 case 0x10ec0285:
7d727869 5501 case 0x10ec0295:
c2b691ee 5502 case 0x10ec0289:
28f1f9b2 5503 case 0x10ec0299:
4cc9b9d6
KY
5504 alc_process_coef_fw(codec, coef0225);
5505 break;
73bdd597 5506 }
4e76a883 5507 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5508}
5509
5510static void alc_determine_headset_type(struct hda_codec *codec)
5511{
5512 int val;
5513 bool is_ctia = false;
5514 struct alc_spec *spec = codec->spec;
6b0f95c4 5515 static const struct coef_fw coef0255[] = {
54db6c39
TI
5516 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5517 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5518 conteol) */
5519 {}
5520 };
6b0f95c4 5521 static const struct coef_fw coef0288[] = {
f3b70332
KY
5522 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5523 {}
5524 };
6b0f95c4 5525 static const struct coef_fw coef0298[] = {
89542936
KY
5526 UPDATE_COEF(0x50, 0x2000, 0x2000),
5527 UPDATE_COEF(0x56, 0x0006, 0x0006),
5528 UPDATE_COEF(0x66, 0x0008, 0),
5529 UPDATE_COEF(0x67, 0x2000, 0),
5530 UPDATE_COEF(0x19, 0x1300, 0x1300),
5531 {}
5532 };
6b0f95c4 5533 static const struct coef_fw coef0293[] = {
54db6c39
TI
5534 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5535 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5536 {}
5537 };
6b0f95c4 5538 static const struct coef_fw coef0688[] = {
54db6c39
TI
5539 WRITE_COEF(0x11, 0x0001),
5540 WRITE_COEF(0xb7, 0x802b),
5541 WRITE_COEF(0x15, 0x0d60),
5542 WRITE_COEF(0xc3, 0x0c00),
5543 {}
5544 };
6b0f95c4 5545 static const struct coef_fw coef0274[] = {
71683c32
KY
5546 UPDATE_COEF(0x4a, 0x0010, 0),
5547 UPDATE_COEF(0x4a, 0x8000, 0),
5548 WRITE_COEF(0x45, 0xd289),
5549 UPDATE_COEF(0x49, 0x0300, 0x0300),
5550 {}
5551 };
73bdd597 5552
92666d45
KY
5553 if (spec->no_internal_mic_pin) {
5554 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5555 return;
5556 }
5557
7639a06c 5558 switch (codec->core.vendor_id) {
9a22a8f5 5559 case 0x10ec0255:
717f43d8
KY
5560 alc_process_coef_fw(codec, coef0255);
5561 msleep(300);
5562 val = alc_read_coef_idx(codec, 0x46);
5563 is_ctia = (val & 0x0070) == 0x0070;
5564 break;
1948fc06 5565 case 0x10ec0230:
717f43d8 5566 case 0x10ec0236:
7081adf3 5567 case 0x10ec0256:
527f4643 5568 case 0x19e58326:
717f43d8
KY
5569 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5570 alc_write_coef_idx(codec, 0x06, 0x6104);
5571 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5572
5573 snd_hda_codec_write(codec, 0x21, 0,
5574 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5575 msleep(80);
5576 snd_hda_codec_write(codec, 0x21, 0,
5577 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5578
54db6c39 5579 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5580 msleep(300);
5581 val = alc_read_coef_idx(codec, 0x46);
5582 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5583
5584 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5585 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5586
5587 snd_hda_codec_write(codec, 0x21, 0,
5588 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5589 msleep(80);
5590 snd_hda_codec_write(codec, 0x21, 0,
5591 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5592 break;
71683c32
KY
5593 case 0x10ec0234:
5594 case 0x10ec0274:
5595 case 0x10ec0294:
5596 alc_process_coef_fw(codec, coef0274);
febf2256 5597 msleep(850);
71683c32
KY
5598 val = alc_read_coef_idx(codec, 0x46);
5599 is_ctia = (val & 0x00f0) == 0x00f0;
5600 break;
13fd08a3 5601 case 0x10ec0233:
73bdd597
DH
5602 case 0x10ec0283:
5603 alc_write_coef_idx(codec, 0x45, 0xd029);
5604 msleep(300);
5605 val = alc_read_coef_idx(codec, 0x46);
5606 is_ctia = (val & 0x0070) == 0x0070;
5607 break;
1a5bc8d9 5608 case 0x10ec0298:
89542936
KY
5609 snd_hda_codec_write(codec, 0x21, 0,
5610 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5611 msleep(100);
5612 snd_hda_codec_write(codec, 0x21, 0,
5613 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5614 msleep(200);
5615
5616 val = alc_read_coef_idx(codec, 0x50);
5617 if (val & (1 << 12)) {
5618 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5619 alc_process_coef_fw(codec, coef0288);
5620 msleep(350);
5621 val = alc_read_coef_idx(codec, 0x50);
5622 is_ctia = (val & 0x0070) == 0x0070;
5623 } else {
5624 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5625 alc_process_coef_fw(codec, coef0288);
5626 msleep(350);
5627 val = alc_read_coef_idx(codec, 0x50);
5628 is_ctia = (val & 0x0070) == 0x0070;
5629 }
5630 alc_process_coef_fw(codec, coef0298);
5631 snd_hda_codec_write(codec, 0x21, 0,
5632 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5633 msleep(75);
5634 snd_hda_codec_write(codec, 0x21, 0,
5635 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5636 break;
f3b70332
KY
5637 case 0x10ec0286:
5638 case 0x10ec0288:
5639 alc_process_coef_fw(codec, coef0288);
5640 msleep(350);
5641 val = alc_read_coef_idx(codec, 0x50);
5642 is_ctia = (val & 0x0070) == 0x0070;
5643 break;
73bdd597
DH
5644 case 0x10ec0292:
5645 alc_write_coef_idx(codec, 0x6b, 0xd429);
5646 msleep(300);
5647 val = alc_read_coef_idx(codec, 0x6c);
5648 is_ctia = (val & 0x001c) == 0x001c;
5649 break;
a22aa26f 5650 case 0x10ec0293:
54db6c39 5651 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5652 msleep(300);
5653 val = alc_read_coef_idx(codec, 0x46);
5654 is_ctia = (val & 0x0070) == 0x0070;
5655 break;
73bdd597 5656 case 0x10ec0668:
54db6c39 5657 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5658 msleep(300);
5659 val = alc_read_coef_idx(codec, 0xbe);
5660 is_ctia = (val & 0x1c02) == 0x1c02;
5661 break;
c2b691ee 5662 case 0x10ec0215:
4cc9b9d6 5663 case 0x10ec0225:
c2b691ee 5664 case 0x10ec0285:
7d727869 5665 case 0x10ec0295:
c2b691ee 5666 case 0x10ec0289:
28f1f9b2 5667 case 0x10ec0299:
da911b1f
KY
5668 snd_hda_codec_write(codec, 0x21, 0,
5669 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5670 msleep(80);
5671 snd_hda_codec_write(codec, 0x21, 0,
5672 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5673
5a36767a
KY
5674 alc_process_coef_fw(codec, alc225_pre_hsmode);
5675 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5676 val = alc_read_coef_idx(codec, 0x45);
5677 if (val & (1 << 9)) {
5678 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5679 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5680 msleep(800);
5681 val = alc_read_coef_idx(codec, 0x46);
5682 is_ctia = (val & 0x00f0) == 0x00f0;
5683 } else {
5684 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5685 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5686 msleep(800);
5687 val = alc_read_coef_idx(codec, 0x46);
5688 is_ctia = (val & 0x00f0) == 0x00f0;
5689 }
5690 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5691 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5692 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5693
5694 snd_hda_codec_write(codec, 0x21, 0,
5695 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5696 msleep(80);
5697 snd_hda_codec_write(codec, 0x21, 0,
5698 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5699 break;
78f4f7c2
KY
5700 case 0x10ec0867:
5701 is_ctia = true;
5702 break;
73bdd597
DH
5703 }
5704
4e76a883 5705 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5706 is_ctia ? "yes" : "no");
5707 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5708}
5709
5710static void alc_update_headset_mode(struct hda_codec *codec)
5711{
5712 struct alc_spec *spec = codec->spec;
5713
5714 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5715 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5716
5717 int new_headset_mode;
5718
5719 if (!snd_hda_jack_detect(codec, hp_pin))
5720 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5721 else if (mux_pin == spec->headset_mic_pin)
5722 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5723 else if (mux_pin == spec->headphone_mic_pin)
5724 new_headset_mode = ALC_HEADSET_MODE_MIC;
5725 else
5726 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5727
5959a6bc
DH
5728 if (new_headset_mode == spec->current_headset_mode) {
5729 snd_hda_gen_update_outputs(codec);
73bdd597 5730 return;
5959a6bc 5731 }
73bdd597
DH
5732
5733 switch (new_headset_mode) {
5734 case ALC_HEADSET_MODE_UNPLUGGED:
5735 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5736 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5737 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5738 spec->gen.hp_jack_present = false;
5739 break;
5740 case ALC_HEADSET_MODE_HEADSET:
5741 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5742 alc_determine_headset_type(codec);
5743 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5744 alc_headset_mode_ctia(codec);
5745 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5746 alc_headset_mode_omtp(codec);
5747 spec->gen.hp_jack_present = true;
5748 break;
5749 case ALC_HEADSET_MODE_MIC:
5750 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5751 spec->gen.hp_jack_present = false;
5752 break;
5753 case ALC_HEADSET_MODE_HEADPHONE:
5754 alc_headset_mode_default(codec);
5755 spec->gen.hp_jack_present = true;
5756 break;
5757 }
5758 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5759 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5760 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5761 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5762 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5763 PIN_VREFHIZ);
5764 }
5765 spec->current_headset_mode = new_headset_mode;
5766
5767 snd_hda_gen_update_outputs(codec);
5768}
5769
5770static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5771 struct snd_kcontrol *kcontrol,
5772 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5773{
5774 alc_update_headset_mode(codec);
5775}
5776
1a4f69d5
TI
5777static void alc_update_headset_jack_cb(struct hda_codec *codec,
5778 struct hda_jack_callback *jack)
73bdd597 5779{
73bdd597 5780 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5781 alc_update_headset_mode(codec);
73bdd597
DH
5782}
5783
5784static void alc_probe_headset_mode(struct hda_codec *codec)
5785{
5786 int i;
5787 struct alc_spec *spec = codec->spec;
5788 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5789
5790 /* Find mic pins */
5791 for (i = 0; i < cfg->num_inputs; i++) {
5792 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5793 spec->headset_mic_pin = cfg->inputs[i].pin;
5794 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5795 spec->headphone_mic_pin = cfg->inputs[i].pin;
5796 }
5797
0bed2aa3 5798 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5799 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5800 spec->gen.automute_hook = alc_update_headset_mode;
5801 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5802}
5803
5804static void alc_fixup_headset_mode(struct hda_codec *codec,
5805 const struct hda_fixup *fix, int action)
5806{
5807 struct alc_spec *spec = codec->spec;
5808
5809 switch (action) {
5810 case HDA_FIXUP_ACT_PRE_PROBE:
5811 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5812 break;
5813 case HDA_FIXUP_ACT_PROBE:
5814 alc_probe_headset_mode(codec);
5815 break;
5816 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5817 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5818 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5819 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5820 }
73bdd597
DH
5821 alc_update_headset_mode(codec);
5822 break;
5823 }
5824}
5825
5826static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5827 const struct hda_fixup *fix, int action)
5828{
5829 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5830 struct alc_spec *spec = codec->spec;
5831 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5832 }
5833 else
5834 alc_fixup_headset_mode(codec, fix, action);
5835}
5836
31278997
KY
5837static void alc255_set_default_jack_type(struct hda_codec *codec)
5838{
5839 /* Set to iphone type */
6b0f95c4 5840 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5841 WRITE_COEF(0x1b, 0x880b),
5842 WRITE_COEF(0x45, 0xd089),
5843 WRITE_COEF(0x1b, 0x080b),
5844 WRITE_COEF(0x46, 0x0004),
5845 WRITE_COEF(0x1b, 0x0c0b),
5846 {}
5847 };
6b0f95c4 5848 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5849 WRITE_COEF(0x1b, 0x884b),
5850 WRITE_COEF(0x45, 0xd089),
5851 WRITE_COEF(0x1b, 0x084b),
5852 WRITE_COEF(0x46, 0x0004),
5853 WRITE_COEF(0x1b, 0x0c4b),
5854 {}
5855 };
5856 switch (codec->core.vendor_id) {
5857 case 0x10ec0255:
5858 alc_process_coef_fw(codec, alc255fw);
5859 break;
1948fc06 5860 case 0x10ec0230:
736f20a7 5861 case 0x10ec0236:
e69e7e03 5862 case 0x10ec0256:
527f4643 5863 case 0x19e58326:
e69e7e03
KY
5864 alc_process_coef_fw(codec, alc256fw);
5865 break;
5866 }
31278997
KY
5867 msleep(30);
5868}
5869
9a22a8f5
KY
5870static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5871 const struct hda_fixup *fix, int action)
5872{
5873 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5874 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5875 }
5876 alc_fixup_headset_mode(codec, fix, action);
5877}
5878
31278997
KY
5879static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5880 const struct hda_fixup *fix, int action)
5881{
5882 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5883 struct alc_spec *spec = codec->spec;
5884 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5885 alc255_set_default_jack_type(codec);
5886 }
5887 else
5888 alc_fixup_headset_mode(codec, fix, action);
5889}
5890
e1e62b98
KY
5891static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5892 struct hda_jack_callback *jack)
5893{
5894 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5895
5896 alc_update_headset_jack_cb(codec, jack);
5897 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5898 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5899}
5900
5901static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5902 const struct hda_fixup *fix, int action)
5903{
5904 alc_fixup_headset_mode(codec, fix, action);
5905 if (action == HDA_FIXUP_ACT_PROBE) {
5906 struct alc_spec *spec = codec->spec;
d44a6864
TI
5907 /* toggled via hp_automute_hook */
5908 spec->gpio_mask |= 0x40;
5909 spec->gpio_dir |= 0x40;
e1e62b98
KY
5910 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5911 }
5912}
5913
493a52a9
HW
5914static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5915 const struct hda_fixup *fix, int action)
5916{
5917 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5918 struct alc_spec *spec = codec->spec;
5919 spec->gen.auto_mute_via_amp = 1;
5920 }
5921}
5922
9b745ab8
TI
5923static void alc_fixup_no_shutup(struct hda_codec *codec,
5924 const struct hda_fixup *fix, int action)
5925{
efe55732 5926 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5927 struct alc_spec *spec = codec->spec;
c0ca5ece 5928 spec->no_shutup_pins = 1;
9b745ab8
TI
5929 }
5930}
5931
5e6db669
GM
5932static void alc_fixup_disable_aamix(struct hda_codec *codec,
5933 const struct hda_fixup *fix, int action)
5934{
5935 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5936 struct alc_spec *spec = codec->spec;
5937 /* Disable AA-loopback as it causes white noise */
5938 spec->gen.mixer_nid = 0;
5939 }
5940}
5941
7f57d803
TI
5942/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5943static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5944 const struct hda_fixup *fix, int action)
5945{
5946 static const struct hda_pintbl pincfgs[] = {
5947 { 0x16, 0x21211010 }, /* dock headphone */
5948 { 0x19, 0x21a11010 }, /* dock mic */
5949 { }
5950 };
5951 struct alc_spec *spec = codec->spec;
5952
5953 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5954 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5955 codec->power_save_node = 0; /* avoid click noises */
5956 snd_hda_apply_pincfgs(codec, pincfgs);
5957 }
5958}
5959
61fcf8ec
KY
5960static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5961 const struct hda_fixup *fix, int action)
5962{
5963 static const struct hda_pintbl pincfgs[] = {
5964 { 0x17, 0x21211010 }, /* dock headphone */
5965 { 0x19, 0x21a11010 }, /* dock mic */
5966 { }
5967 };
5968 struct alc_spec *spec = codec->spec;
5969
5970 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5971 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
5972 snd_hda_apply_pincfgs(codec, pincfgs);
5973 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
5974 /* Enable DOCK device */
5975 snd_hda_codec_write(codec, 0x17, 0,
5976 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5977 /* Enable DOCK device */
5978 snd_hda_codec_write(codec, 0x19, 0,
5979 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
5980 }
5981}
5982
399c01aa
TI
5983static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5984 const struct hda_fixup *fix, int action)
5985{
5986 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5987 * the speaker output becomes too low by some reason on Thinkpads with
5988 * ALC298 codec
5989 */
5990 static const hda_nid_t preferred_pairs[] = {
5991 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5992 0
5993 };
5994 struct alc_spec *spec = codec->spec;
5995
5996 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5997 spec->gen.preferred_dacs = preferred_pairs;
5998}
5999
8eedd3a7
TI
6000static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6001 const struct hda_fixup *fix, int action)
6002{
6003 static const hda_nid_t preferred_pairs[] = {
6004 0x17, 0x02, 0x21, 0x03, 0
6005 };
6006 struct alc_spec *spec = codec->spec;
6007
6008 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6009 spec->gen.preferred_dacs = preferred_pairs;
6010}
6011
9476d369 6012static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
6013{
6014 struct alc_spec *spec = codec->spec;
35a39f98 6015 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 6016
9476d369
GM
6017 /* Prevent pop noises when headphones are plugged in */
6018 snd_hda_codec_write(codec, hp_pin, 0,
6019 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6020 msleep(20);
033b0a7c
GM
6021}
6022
6023static void alc_fixup_dell_xps13(struct hda_codec *codec,
6024 const struct hda_fixup *fix, int action)
6025{
3e1b0c4a
TI
6026 struct alc_spec *spec = codec->spec;
6027 struct hda_input_mux *imux = &spec->gen.input_mux;
6028 int i;
f38663ab 6029
3e1b0c4a
TI
6030 switch (action) {
6031 case HDA_FIXUP_ACT_PRE_PROBE:
6032 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6033 * it causes a click noise at start up
6034 */
6035 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 6036 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
6037 break;
6038 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
6039 /* Make the internal mic the default input source. */
6040 for (i = 0; i < imux->num_items; i++) {
6041 if (spec->gen.imux_pins[i] == 0x12) {
6042 spec->gen.cur_mux[0] = i;
6043 break;
6044 }
6045 }
3e1b0c4a 6046 break;
033b0a7c
GM
6047 }
6048}
6049
1f8b46cd
DH
6050static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6051 const struct hda_fixup *fix, int action)
6052{
6053 struct alc_spec *spec = codec->spec;
6054
6055 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6056 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6057 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
6058
6059 /* Disable boost for mic-in permanently. (This code is only called
6060 from quirks that guarantee that the headphone is at NID 0x1b.) */
6061 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6062 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
6063 } else
6064 alc_fixup_headset_mode(codec, fix, action);
6065}
6066
73bdd597
DH
6067static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6068 const struct hda_fixup *fix, int action)
6069{
6070 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 6071 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 6072 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
6073 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6074 }
6075 alc_fixup_headset_mode(codec, fix, action);
6076}
6077
bde7bc60
CCC
6078/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6079static int find_ext_mic_pin(struct hda_codec *codec)
6080{
6081 struct alc_spec *spec = codec->spec;
6082 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6083 hda_nid_t nid;
6084 unsigned int defcfg;
6085 int i;
6086
6087 for (i = 0; i < cfg->num_inputs; i++) {
6088 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6089 continue;
6090 nid = cfg->inputs[i].pin;
6091 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6092 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6093 continue;
6094 return nid;
6095 }
6096
6097 return 0;
6098}
6099
08a978db 6100static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6101 const struct hda_fixup *fix,
08a978db
DR
6102 int action)
6103{
6104 struct alc_spec *spec = codec->spec;
6105
0db75790 6106 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6107 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6108 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6109
6110 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6111 return;
bde7bc60 6112 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6113 }
08a978db 6114}
693b613d 6115
3e0d611b
DH
6116static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6117 const struct hda_fixup *fix,
6118 int action)
6119{
6120 struct alc_spec *spec = codec->spec;
6121 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6122 int i;
6123
6124 /* The mic boosts on level 2 and 3 are too noisy
6125 on the internal mic input.
6126 Therefore limit the boost to 0 or 1. */
6127
6128 if (action != HDA_FIXUP_ACT_PROBE)
6129 return;
6130
6131 for (i = 0; i < cfg->num_inputs; i++) {
6132 hda_nid_t nid = cfg->inputs[i].pin;
6133 unsigned int defcfg;
6134 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6135 continue;
6136 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6137 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6138 continue;
6139
6140 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6141 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6142 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6143 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6144 (0 << AC_AMPCAP_MUTE_SHIFT));
6145 }
6146}
6147
cd217a63 6148static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6149 struct hda_jack_callback *jack)
cd217a63
KY
6150{
6151 struct alc_spec *spec = codec->spec;
6152 int vref;
6153
6154 msleep(200);
6155 snd_hda_gen_hp_automute(codec, jack);
6156
6157 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6158
6159 msleep(600);
6160 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6161 vref);
6162}
6163
cd217a63
KY
6164static void alc283_fixup_chromebook(struct hda_codec *codec,
6165 const struct hda_fixup *fix, int action)
6166{
6167 struct alc_spec *spec = codec->spec;
cd217a63
KY
6168
6169 switch (action) {
6170 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6171 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6172 /* Disable AA-loopback as it causes white noise */
6173 spec->gen.mixer_nid = 0;
38070219 6174 break;
0202e99c 6175 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6176 /* MIC2-VREF control */
6177 /* Set to manual mode */
98b24883 6178 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6179 /* Enable Line1 input control by verb */
98b24883 6180 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6181 break;
6182 }
6183}
6184
6185static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6186 const struct hda_fixup *fix, int action)
6187{
6188 struct alc_spec *spec = codec->spec;
0202e99c
KY
6189
6190 switch (action) {
6191 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6192 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6193 break;
6194 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6195 /* MIC2-VREF control */
6196 /* Set to manual mode */
98b24883 6197 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6198 break;
6199 }
6200}
6201
7bba2157
TI
6202/* mute tablet speaker pin (0x14) via dock plugging in addition */
6203static void asus_tx300_automute(struct hda_codec *codec)
6204{
6205 struct alc_spec *spec = codec->spec;
6206 snd_hda_gen_update_outputs(codec);
6207 if (snd_hda_jack_detect(codec, 0x1b))
6208 spec->gen.mute_bits |= (1ULL << 0x14);
6209}
6210
6211static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6212 const struct hda_fixup *fix, int action)
6213{
6214 struct alc_spec *spec = codec->spec;
7bba2157
TI
6215 static const struct hda_pintbl dock_pins[] = {
6216 { 0x1b, 0x21114000 }, /* dock speaker pin */
6217 {}
6218 };
7bba2157
TI
6219
6220 switch (action) {
6221 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6222 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6223 /* TX300 needs to set up GPIO2 for the speaker amp */
6224 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6225 snd_hda_apply_pincfgs(codec, dock_pins);
6226 spec->gen.auto_mute_via_amp = 1;
6227 spec->gen.automute_hook = asus_tx300_automute;
6228 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6229 snd_hda_gen_hp_automute);
6230 break;
5579cd6f
TI
6231 case HDA_FIXUP_ACT_PROBE:
6232 spec->init_amp = ALC_INIT_DEFAULT;
6233 break;
7bba2157
TI
6234 case HDA_FIXUP_ACT_BUILD:
6235 /* this is a bit tricky; give more sane names for the main
6236 * (tablet) speaker and the dock speaker, respectively
6237 */
56798e6b
TI
6238 rename_ctl(codec, "Speaker Playback Switch",
6239 "Dock Speaker Playback Switch");
6240 rename_ctl(codec, "Bass Speaker Playback Switch",
6241 "Speaker Playback Switch");
7bba2157
TI
6242 break;
6243 }
6244}
6245
338cae56
DH
6246static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6247 const struct hda_fixup *fix, int action)
6248{
0f4881dc
DH
6249 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6250 /* DAC node 0x03 is giving mono output. We therefore want to
6251 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6252 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6253 static const hda_nid_t conn1[] = { 0x0c };
6254 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6255 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6256 }
338cae56
DH
6257}
6258
dd9aa335
HW
6259static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6260 const struct hda_fixup *fix, int action)
6261{
6262 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6263 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6264 we can't adjust the speaker's volume since this node does not has
6265 Amp-out capability. we change the speaker's route to:
6266 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6267 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6268 speaker's volume now. */
6269
caf3c043
MM
6270 static const hda_nid_t conn1[] = { 0x0c };
6271 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6272 }
6273}
6274
e312a869
TI
6275/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6276static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6277 const struct hda_fixup *fix, int action)
6278{
6279 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6280 static const hda_nid_t conn[] = { 0x02, 0x03 };
6281 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6282 }
6283}
6284
d2cd795c
JK
6285/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6286static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6287 const struct hda_fixup *fix, int action)
6288{
6289 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6290 static const hda_nid_t conn[] = { 0x02 };
6291 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6292 }
6293}
6294
98973f2f
KP
6295/* Hook to update amp GPIO4 for automute */
6296static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6297 struct hda_jack_callback *jack)
6298{
6299 struct alc_spec *spec = codec->spec;
6300
6301 snd_hda_gen_hp_automute(codec, jack);
6302 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6303 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6304 !spec->gen.hp_jack_present);
98973f2f
KP
6305}
6306
6307/* Manage GPIOs for HP EliteBook Folio 9480m.
6308 *
6309 * GPIO4 is the headphone amplifier power control
6310 * GPIO3 is the audio output mute indicator LED
6311 */
6312
6313static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6314 const struct hda_fixup *fix,
6315 int action)
6316{
6317 struct alc_spec *spec = codec->spec;
98973f2f 6318
01e4a275 6319 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6320 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6321 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6322 spec->gpio_mask |= 0x10;
6323 spec->gpio_dir |= 0x10;
98973f2f 6324 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6325 }
6326}
6327
ae065f1c
TI
6328static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6329 const struct hda_fixup *fix,
6330 int action)
6331{
6332 struct alc_spec *spec = codec->spec;
6333
6334 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6335 spec->gpio_mask |= 0x04;
6336 spec->gpio_dir |= 0x04;
6337 /* set data bit low */
6338 }
6339}
6340
6a6660d0
TI
6341/* Quirk for Thinkpad X1 7th and 8th Gen
6342 * The following fixed routing needed
6343 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6344 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6345 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6346 */
6347static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6348 const struct hda_fixup *fix, int action)
6349{
6350 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6351 static const hda_nid_t preferred_pairs[] = {
6352 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6353 };
6354 struct alc_spec *spec = codec->spec;
6355
6356 switch (action) {
6357 case HDA_FIXUP_ACT_PRE_PROBE:
6358 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6359 spec->gen.preferred_dacs = preferred_pairs;
6360 break;
6361 case HDA_FIXUP_ACT_BUILD:
6362 /* The generic parser creates somewhat unintuitive volume ctls
6363 * with the fixed routing above, and the shared DAC2 may be
6364 * confusing for PA.
6365 * Rename those to unique names so that PA doesn't touch them
6366 * and use only Master volume.
6367 */
6368 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6369 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6370 break;
6371 }
6372}
6373
ca169cc2
KY
6374static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6375 const struct hda_fixup *fix,
6376 int action)
6377{
6378 alc_fixup_dual_codecs(codec, fix, action);
6379 switch (action) {
6380 case HDA_FIXUP_ACT_PRE_PROBE:
6381 /* override card longname to provide a unique UCM profile */
6382 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6383 break;
6384 case HDA_FIXUP_ACT_BUILD:
6385 /* rename Capture controls depending on the codec */
6386 rename_ctl(codec, "Capture Volume",
6387 codec->addr == 0 ?
6388 "Rear-Panel Capture Volume" :
6389 "Front-Panel Capture Volume");
6390 rename_ctl(codec, "Capture Switch",
6391 codec->addr == 0 ?
6392 "Rear-Panel Capture Switch" :
6393 "Front-Panel Capture Switch");
6394 break;
6395 }
6396}
6397
52e4e368
KHF
6398static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6399 const struct hda_fixup *fix, int action)
6400{
6401 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6402 return;
6403
6404 codec->power_save_node = 1;
6405}
6406
92266651
KY
6407/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6408static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6409 const struct hda_fixup *fix, int action)
6410{
6411 struct alc_spec *spec = codec->spec;
caf3c043 6412 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6413 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6414 0
6415 };
6416
6417 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6418 return;
6419
6420 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6421 spec->gen.auto_mute_via_amp = 1;
6422 codec->power_save_node = 0;
92266651
KY
6423}
6424
c84bfedc
TI
6425/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6426static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6427 const struct hda_fixup *fix, int action)
6428{
6429 static const hda_nid_t preferred_pairs[] = {
6430 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6431 };
6432 struct alc_spec *spec = codec->spec;
6433
6434 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6435 spec->gen.preferred_dacs = preferred_pairs;
6436 spec->gen.obey_preferred_dacs = 1;
6437 }
6438}
6439
c4cfcf6f
HW
6440/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6441static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6442 const struct hda_fixup *fix, int action)
6443{
6444 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6445 return;
6446
6447 snd_hda_override_wcaps(codec, 0x03, 0);
6448}
6449
8a8de09c
KY
6450static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6451{
6452 switch (codec->core.vendor_id) {
6453 case 0x10ec0274:
6454 case 0x10ec0294:
6455 case 0x10ec0225:
6456 case 0x10ec0295:
6457 case 0x10ec0299:
6458 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6459 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6460 break;
1948fc06 6461 case 0x10ec0230:
8a8de09c
KY
6462 case 0x10ec0235:
6463 case 0x10ec0236:
6464 case 0x10ec0255:
6465 case 0x10ec0256:
527f4643 6466 case 0x19e58326:
8a8de09c
KY
6467 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6468 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6469 break;
6470 }
6471}
6472
8983eb60
KY
6473static void alc295_fixup_chromebook(struct hda_codec *codec,
6474 const struct hda_fixup *fix, int action)
6475{
d3ba58bb
KY
6476 struct alc_spec *spec = codec->spec;
6477
8983eb60 6478 switch (action) {
d3ba58bb
KY
6479 case HDA_FIXUP_ACT_PRE_PROBE:
6480 spec->ultra_low_power = true;
6481 break;
8983eb60 6482 case HDA_FIXUP_ACT_INIT:
8a8de09c 6483 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6484 break;
6485 }
6486}
6487
d1dd4211
KY
6488static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6489 const struct hda_fixup *fix, int action)
6490{
6491 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6492 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6493}
6494
c3cdf189
LJ
6495
6496static void alc294_gx502_toggle_output(struct hda_codec *codec,
6497 struct hda_jack_callback *cb)
6498{
6499 /* The Windows driver sets the codec up in a very different way where
6500 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6501 */
6502 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6503 alc_write_coef_idx(codec, 0x10, 0x8a20);
6504 else
6505 alc_write_coef_idx(codec, 0x10, 0x0a20);
6506}
6507
6508static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6509 const struct hda_fixup *fix, int action)
6510{
6511 /* Pin 0x21: headphones/headset mic */
6512 if (!is_jack_detectable(codec, 0x21))
6513 return;
6514
6515 switch (action) {
6516 case HDA_FIXUP_ACT_PRE_PROBE:
6517 snd_hda_jack_detect_enable_callback(codec, 0x21,
6518 alc294_gx502_toggle_output);
6519 break;
6520 case HDA_FIXUP_ACT_INIT:
6521 /* Make sure to start in a correct state, i.e. if
6522 * headphones have been plugged in before powering up the system
6523 */
6524 alc294_gx502_toggle_output(codec, NULL);
6525 break;
6526 }
6527}
6528
c1b55029
DC
6529static void alc294_gu502_toggle_output(struct hda_codec *codec,
6530 struct hda_jack_callback *cb)
6531{
6532 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6533 * responsible from changes between speakers and headphones
6534 */
6535 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6536 alc_write_coef_idx(codec, 0x10, 0x8420);
6537 else
6538 alc_write_coef_idx(codec, 0x10, 0x0a20);
6539}
6540
6541static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6542 const struct hda_fixup *fix, int action)
6543{
6544 if (!is_jack_detectable(codec, 0x21))
6545 return;
6546
6547 switch (action) {
6548 case HDA_FIXUP_ACT_PRE_PROBE:
6549 snd_hda_jack_detect_enable_callback(codec, 0x21,
6550 alc294_gu502_toggle_output);
6551 break;
6552 case HDA_FIXUP_ACT_INIT:
6553 alc294_gu502_toggle_output(codec, NULL);
6554 break;
6555 }
6556}
6557
56496253
KY
6558static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6559 const struct hda_fixup *fix, int action)
6560{
6561 if (action != HDA_FIXUP_ACT_INIT)
6562 return;
6563
6564 msleep(100);
6565 alc_write_coef_idx(codec, 0x65, 0x0);
6566}
6567
8a8de09c
KY
6568static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6569 const struct hda_fixup *fix, int action)
6570{
6571 switch (action) {
6572 case HDA_FIXUP_ACT_INIT:
6573 alc_combo_jack_hp_jd_restart(codec);
6574 break;
6575 }
6576}
6577
92666d45
KY
6578static void alc_fixup_no_int_mic(struct hda_codec *codec,
6579 const struct hda_fixup *fix, int action)
6580{
6581 struct alc_spec *spec = codec->spec;
6582
6583 switch (action) {
6584 case HDA_FIXUP_ACT_PRE_PROBE:
6585 /* Mic RING SLEEVE swap for combo jack */
6586 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6587 spec->no_internal_mic_pin = true;
6588 break;
6589 case HDA_FIXUP_ACT_INIT:
6590 alc_combo_jack_hp_jd_restart(codec);
6591 break;
6592 }
6593}
6594
d94befbb
DB
6595/* GPIO1 = amplifier on/off
6596 * GPIO3 = mic mute LED
6597 */
6598static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6599 const struct hda_fixup *fix, int action)
6600{
6601 static const hda_nid_t conn[] = { 0x02 };
6602
6603 struct alc_spec *spec = codec->spec;
6604 static const struct hda_pintbl pincfgs[] = {
6605 { 0x14, 0x90170110 }, /* front/high speakers */
6606 { 0x17, 0x90170130 }, /* back/bass speakers */
6607 { }
6608 };
6609
6610 //enable micmute led
6611 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6612
6613 switch (action) {
6614 case HDA_FIXUP_ACT_PRE_PROBE:
6615 spec->micmute_led_polarity = 1;
6616 /* needed for amp of back speakers */
6617 spec->gpio_mask |= 0x01;
6618 spec->gpio_dir |= 0x01;
6619 snd_hda_apply_pincfgs(codec, pincfgs);
6620 /* share DAC to have unified volume control */
6621 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6622 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6623 break;
6624 case HDA_FIXUP_ACT_INIT:
6625 /* need to toggle GPIO to enable the amp of back speakers */
6626 alc_update_gpio_data(codec, 0x01, true);
6627 msleep(100);
6628 alc_update_gpio_data(codec, 0x01, false);
6629 break;
6630 }
6631}
6632
434591b2
ED
6633static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6634 const struct hda_fixup *fix, int action)
6635{
6636 static const hda_nid_t conn[] = { 0x02 };
6637 static const struct hda_pintbl pincfgs[] = {
6638 { 0x14, 0x90170110 }, /* rear speaker */
6639 { }
6640 };
6641
6642 switch (action) {
6643 case HDA_FIXUP_ACT_PRE_PROBE:
6644 snd_hda_apply_pincfgs(codec, pincfgs);
6645 /* force front speaker to DAC1 */
6646 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6647 break;
6648 }
6649}
6650
b317b032
TI
6651/* for hda_fixup_thinkpad_acpi() */
6652#include "thinkpad_helper.c"
b67ae3f1 6653
d5a6cabf
TI
6654static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6655 const struct hda_fixup *fix, int action)
6656{
6657 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6658 hda_fixup_thinkpad_acpi(codec, fix, action);
6659}
6660
ad7cc2d4
CB
6661/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6662static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6663 const struct hda_fixup *fix,
6664 int action)
6665{
6666 struct alc_spec *spec = codec->spec;
6667
6668 switch (action) {
6669 case HDA_FIXUP_ACT_PRE_PROBE:
6670 spec->gen.suppress_auto_mute = 1;
6671 break;
6672 }
6673}
6674
d3dca026
LT
6675static int comp_bind(struct device *dev)
6676{
6677 struct hda_codec *cdc = dev_to_hda_codec(dev);
6678 struct alc_spec *spec = cdc->spec;
1873ebd3 6679
a8dfb850 6680 return component_bind_all(dev, spec->comps);
d3dca026
LT
6681}
6682
6683static void comp_unbind(struct device *dev)
6684{
6685 struct hda_codec *cdc = dev_to_hda_codec(dev);
6686 struct alc_spec *spec = cdc->spec;
6687
6688 component_unbind_all(dev, spec->comps);
6689}
6690
6691static const struct component_master_ops comp_master_ops = {
6692 .bind = comp_bind,
6693 .unbind = comp_unbind,
6694};
6695
6696static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6697 struct snd_pcm_substream *sub, int action)
6698{
6699 struct alc_spec *spec = cdc->spec;
6700 int i;
6701
6702 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6703 if (spec->comps[i].dev)
6704 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6705 }
6706}
6707
35a17444
TI
6708struct cs35l41_dev_name {
6709 const char *bus;
6710 const char *hid;
6711 int index;
6712};
6713
6714/* match the device name in a slightly relaxed manner */
6715static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6716{
6717 struct cs35l41_dev_name *p = data;
6718 const char *d = dev_name(dev);
6719 int n = strlen(p->bus);
6720 char tmp[32];
6721
6722 /* check the bus name */
6723 if (strncmp(d, p->bus, n))
6724 return 0;
6725 /* skip the bus number */
6726 if (isdigit(d[n]))
6727 n++;
6728 /* the rest must be exact matching */
6729 snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6730 return !strcmp(d + n, tmp);
6731}
6732
ae7abe36
SB
6733static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6734 const char *hid, int count)
6735{
6736 struct device *dev = hda_codec_dev(cdc);
6737 struct alc_spec *spec = cdc->spec;
35a17444 6738 struct cs35l41_dev_name *rec;
ae7abe36
SB
6739 int ret, i;
6740
6741 switch (action) {
6742 case HDA_FIXUP_ACT_PRE_PROBE:
6743 for (i = 0; i < count; i++) {
35a17444
TI
6744 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6745 if (!rec)
ae7abe36 6746 return;
35a17444
TI
6747 rec->bus = bus;
6748 rec->hid = hid;
6749 rec->index = i;
22d5cbd2 6750 spec->comps[i].codec = cdc;
35a17444
TI
6751 component_match_add(dev, &spec->match,
6752 comp_match_cs35l41_dev_name, rec);
ae7abe36
SB
6753 }
6754 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6755 if (ret)
6756 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6757 else
6758 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6759 break;
6760 }
6761}
6762
6763static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6764{
6765 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6766}
6767
07bcab93
LT
6768static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6769{
35a17444 6770 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
225f6e1b
TI
6771}
6772
07bcab93
LT
6773static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6774{
35a17444 6775 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
07bcab93
LT
6776}
6777
d3dca026
LT
6778static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6779 int action)
6780{
14e42cee 6781 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
d3dca026
LT
6782}
6783
1e24881d
LT
6784static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6785 int action)
6786{
6787 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6788}
6789
bbf8ff6b
TB
6790/* for alc295_fixup_hp_top_speakers */
6791#include "hp_x360_helper.c"
6792
26928ca1
TI
6793/* for alc285_fixup_ideapad_s740_coef() */
6794#include "ideapad_s740_helper.c"
6795
619764cc
WS
6796static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6797 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6798 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6799 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6800 {}
6801};
6802
6803static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6804 const struct hda_fixup *fix,
6805 int action)
dd6dd6e3
WS
6806{
6807 /*
619764cc
WS
6808 * A certain other OS sets these coeffs to different values. On at least
6809 * one TongFang barebone these settings might survive even a cold
6810 * reboot. So to restore a clean slate the values are explicitly reset
6811 * to default here. Without this, the external microphone is always in a
6812 * plugged-in state, while the internal microphone is always in an
6813 * unplugged state, breaking the ability to use the internal microphone.
6814 */
6815 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
6816}
6817
174a7fb3
WS
6818static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6819 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6820 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6821 WRITE_COEF(0x49, 0x0149),
6822 {}
6823};
6824
6825static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6826 const struct hda_fixup *fix,
6827 int action)
6828{
6829 /*
6830 * The audio jack input and output is not detected on the ASRock NUC Box
6831 * 1100 series when cold booting without this fix. Warm rebooting from a
6832 * certain other OS makes the audio functional, as COEF settings are
6833 * preserved in this case. This fix sets these altered COEF values as
6834 * the default.
6835 */
6836 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6837}
6838
edca7cc4
WS
6839static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6840 const struct hda_fixup *fix,
6841 int action)
6842{
6843 /*
6844 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6845 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6846 * needs an additional quirk for sound working after suspend and resume.
6847 */
6848 if (codec->core.vendor_id == 0x10ec0256) {
6849 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6850 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6851 } else {
6852 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6853 }
6854}
6855
1efcdd9c
GM
6856static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
6857 const struct hda_fixup *fix,
6858 int action)
6859{
6860 struct alc_spec *spec = codec->spec;
6861 struct hda_input_mux *imux = &spec->gen.input_mux;
6862 int i;
6863
6864 alc269_fixup_limit_int_mic_boost(codec, fix, action);
6865
6866 switch (action) {
6867 case HDA_FIXUP_ACT_PRE_PROBE:
6868 /**
6869 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
6870 * to Hi-Z to avoid pop noises at startup and when plugging and
6871 * unplugging headphones.
6872 */
6873 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6874 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
6875 break;
6876 case HDA_FIXUP_ACT_PROBE:
6877 /**
6878 * Make the internal mic (0x12) the default input source to
6879 * prevent pop noises on cold boot.
6880 */
6881 for (i = 0; i < imux->num_items; i++) {
6882 if (spec->gen.imux_pins[i] == 0x12) {
6883 spec->gen.cur_mux[0] = i;
6884 break;
6885 }
6886 }
6887 break;
6888 }
6889}
6890
3790a3d6
PJ
6891static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
6892 const struct hda_fixup *fix, int action)
6893{
6894 /*
6895 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
6896 * unconnected.
6897 */
6898 static const struct hda_pintbl pincfgs[] = {
6899 { 0x17, 0x90170121 },
6900 { }
6901 };
6902 /*
6903 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
6904 * DAC 0x02 and 0x03 would be fine.
6905 */
6906 static const hda_nid_t conn[] = { 0x02, 0x03 };
6907 /*
6908 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
6909 * Headphones (0x21) are connected to DAC 0x03.
6910 */
6911 static const hda_nid_t preferred_pairs[] = {
6912 0x14, 0x02,
6913 0x17, 0x02,
6914 0x21, 0x03,
6915 0
6916 };
6917 struct alc_spec *spec = codec->spec;
6918
6919 switch (action) {
6920 case HDA_FIXUP_ACT_PRE_PROBE:
6921 snd_hda_apply_pincfgs(codec, pincfgs);
6922 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6923 spec->gen.preferred_dacs = preferred_pairs;
6924 break;
6925 }
6926}
6927
2912cdda
PJ
6928static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
6929 const struct hda_fixup *fix, int action)
6930{
6931 static const struct hda_pintbl pincfgs[] = {
6932 { 0x14, 0x90170151 },
6933 { 0x17, 0x90170150 },
6934 { }
6935 };
6936 static const hda_nid_t conn[] = { 0x02, 0x03 };
6937 static const hda_nid_t preferred_pairs[] = {
6938 0x14, 0x02,
6939 0x17, 0x03,
6940 0x21, 0x02,
6941 0
6942 };
6943 struct alc_spec *spec = codec->spec;
6944
6945 alc_fixup_no_shutup(codec, fix, action);
6946
6947 switch (action) {
6948 case HDA_FIXUP_ACT_PRE_PROBE:
6949 snd_hda_apply_pincfgs(codec, pincfgs);
6950 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6951 spec->gen.preferred_dacs = preferred_pairs;
6952 break;
6953 }
6954}
6955
1d045db9 6956enum {
f73bbf63 6957 ALC269_FIXUP_GPIO2,
1d045db9
TI
6958 ALC269_FIXUP_SONY_VAIO,
6959 ALC275_FIXUP_SONY_VAIO_GPIO2,
6960 ALC269_FIXUP_DELL_M101Z,
6961 ALC269_FIXUP_SKU_IGNORE,
6962 ALC269_FIXUP_ASUS_G73JW,
e959f2be
PLB
6963 ALC269_FIXUP_ASUS_N7601ZM_PINS,
6964 ALC269_FIXUP_ASUS_N7601ZM,
1d045db9
TI
6965 ALC269_FIXUP_LENOVO_EAPD,
6966 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 6967 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 6968 ALC271_FIXUP_DMIC,
017f2a10 6969 ALC269_FIXUP_PCM_44K,
adabb3ec 6970 ALC269_FIXUP_STEREO_DMIC,
7c478f03 6971 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
6972 ALC269_FIXUP_QUANTA_MUTE,
6973 ALC269_FIXUP_LIFEBOOK,
2041d564 6974 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 6975 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 6976 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 6977 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
6978 ALC269_FIXUP_AMIC,
6979 ALC269_FIXUP_DMIC,
6980 ALC269VB_FIXUP_AMIC,
6981 ALC269VB_FIXUP_DMIC,
08fb0d0e 6982 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 6983 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 6984 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 6985 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 6986 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
6987 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6988 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 6989 ALC269_FIXUP_INV_DMIC,
108cc108 6990 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 6991 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 6992 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 6993 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 6994 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
6995 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6996 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 6997 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 6998 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
1efcdd9c 6999 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
73bdd597
DH
7000 ALC269_FIXUP_HEADSET_MODE,
7001 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 7002 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
7003 ALC269_FIXUP_ASUS_X101_FUNC,
7004 ALC269_FIXUP_ASUS_X101_VERB,
7005 ALC269_FIXUP_ASUS_X101,
08a978db
DR
7006 ALC271_FIXUP_AMIC_MIC2,
7007 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 7008 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 7009 ALC269_FIXUP_ACER_AC700,
3e0d611b 7010 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 7011 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 7012 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
f882c4be 7013 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
8e35cd4a 7014 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 7015 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 7016 ALC283_FIXUP_CHROME_BOOK,
0202e99c 7017 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 7018 ALC282_FIXUP_ASUS_TX300,
1bb3e062 7019 ALC283_FIXUP_INT_MIC,
338cae56 7020 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
7021 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7022 ALC290_FIXUP_SUBWOOFER,
7023 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 7024 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 7025 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5824ce8d 7026 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 7027 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 7028 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 7029 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 7030 ALC255_FIXUP_HEADSET_MODE,
31278997 7031 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 7032 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 7033 ALC292_FIXUP_TPT440_DOCK,
9a811230 7034 ALC292_FIXUP_TPT440,
abaa2274 7035 ALC283_FIXUP_HEADSET_MIC,
b3802783 7036 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 7037 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 7038 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 7039 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 7040 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 7041 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 7042 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 7043 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 7044 ALC280_FIXUP_HP_9480M,
c3bb2b52 7045 ALC245_FIXUP_HP_X360_AMP,
d94befbb 7046 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
e1e62b98
KY
7047 ALC288_FIXUP_DELL_HEADSET_MODE,
7048 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
7049 ALC288_FIXUP_DELL_XPS_13,
7050 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 7051 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
7052 ALC292_FIXUP_DELL_E7X,
7053 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 7054 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 7055 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 7056 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 7057 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 7058 ALC275_FIXUP_DELL_XPS,
23adc192 7059 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 7060 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 7061 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 7062 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 7063 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 7064 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 7065 ALC285_FIXUP_SPEAKER2_TO_DAC1,
f883982d 7066 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 7067 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 7068 ALC292_FIXUP_TPT460,
dd9aa335 7069 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 7070 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 7071 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 7072 ALC269_FIXUP_ATIV_BOOK_8,
4ba5c853 7073 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
9eb5d0e6 7074 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
7075 ALC256_FIXUP_ASUS_HEADSET_MODE,
7076 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 7077 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
7078 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7079 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 7080 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 7081 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 7082 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 7083 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 7084 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 7085 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
7086 ALC274_FIXUP_DELL_BIND_DACS,
7087 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 7088 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 7089 ALC298_FIXUP_TPT470_DOCK,
ae104a21 7090 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 7091 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 7092 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 7093 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 7094 ALC295_FIXUP_HP_X360,
8a328ac1 7095 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 7096 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 7097 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 7098 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 7099 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
7100 ALC294_FIXUP_ASUS_HEADSET_MIC,
7101 ALC294_FIXUP_ASUS_SPK,
89e3a568 7102 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 7103 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 7104 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 7105 ALC295_FIXUP_CHROME_BOOK,
8983eb60 7106 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
7107 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7108 ALC225_FIXUP_WYSE_AUTO_MUTE,
7109 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 7110 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 7111 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 7112 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 7113 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 7114 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
e79c2269
KY
7115 ALC289_FIXUP_DELL_SPK2,
7116 ALC289_FIXUP_DUAL_SPK,
48e01504
CC
7117 ALC294_FIXUP_SPK2_TO_DAC1,
7118 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 7119 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 7120 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8b33a134 7121 ALC294_FIXUP_ASUS_HPE,
1b94e59d 7122 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
7123 ALC294_FIXUP_ASUS_GX502_HP,
7124 ALC294_FIXUP_ASUS_GX502_PINS,
7125 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
7126 ALC294_FIXUP_ASUS_GU502_HP,
7127 ALC294_FIXUP_ASUS_GU502_PINS,
7128 ALC294_FIXUP_ASUS_GU502_VERBS,
c611e659 7129 ALC294_FIXUP_ASUS_G513_PINS,
bc2c2354 7130 ALC285_FIXUP_ASUS_G533Z_PINS,
f5a88b0a 7131 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 7132 ALC285_FIXUP_HP_MUTE_LED,
ca88eeb3 7133 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
e7d66cf7 7134 ALC236_FIXUP_HP_GPIO_LED,
24164f43 7135 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 7136 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
a2d57ebe 7137 ALC298_FIXUP_SAMSUNG_AMP,
14425f1f 7138 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ef248d9b 7139 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 7140 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 7141 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 7142 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 7143 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 7144 ALC289_FIXUP_ASUS_GA401,
4b43d05a 7145 ALC289_FIXUP_ASUS_GA502,
f50a121d 7146 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 7147 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
7148 ALC269_FIXUP_CZC_B20,
7149 ALC269_FIXUP_CZC_TMI,
7150 ALC269_FIXUP_CZC_L101,
7151 ALC269_FIXUP_LEMOTE_A1802,
7152 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 7153 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
7154 ALC233_FIXUP_INTEL_NUC8_DMIC,
7155 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 7156 ALC256_FIXUP_INTEL_NUC10,
fc19d559 7157 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 7158 ALC274_FIXUP_HP_MIC,
8a8de09c 7159 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 7160 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 7161 ALC256_FIXUP_ASUS_HPE,
446b8185 7162 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 7163 ALC287_FIXUP_HP_GPIO_LED,
9e885770 7164 ALC256_FIXUP_HP_HEADSET_MIC,
5fc462c3 7165 ALC245_FIXUP_HP_GPIO_LED,
92666d45 7166 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 7167 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 7168 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 7169 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 7170 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 7171 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 7172 ALC295_FIXUP_ASUS_DACS,
5d84b531 7173 ALC295_FIXUP_HP_OMEN,
f2be77fe 7174 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 7175 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 7176 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 7177 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 7178 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
7179 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7180 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7181 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
56ec3e75 7182 ALC298_FIXUP_LENOVO_C940_DUET7,
dd6dd6e3 7183 ALC287_FIXUP_13S_GEN2_SPEAKERS,
619764cc 7184 ALC256_FIXUP_SET_COEF_DEFAULTS,
1278cc5a 7185 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
174a7fb3 7186 ALC233_FIXUP_NO_AUDIO_JACK,
edca7cc4 7187 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
8f4c9042
BF
7188 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7189 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
d3dca026 7190 ALC287_FIXUP_LEGION_16ACHG6,
ae7abe36 7191 ALC287_FIXUP_CS35L41_I2C_2,
b3fbe536 7192 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
07bcab93 7193 ALC245_FIXUP_CS35L41_SPI_2,
ce18f905 7194 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
07bcab93
LT
7195 ALC245_FIXUP_CS35L41_SPI_4,
7196 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
91502a9a 7197 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
309d7363 7198 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
1e24881d 7199 ALC287_FIXUP_LEGION_16ITHG6,
3790a3d6
PJ
7200 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7201 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
2912cdda 7202 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
a4517c4f 7203 ALC236_FIXUP_DELL_DUAL_CODECS,
f1d4e28b
KY
7204};
7205
56ec3e75
TI
7206/* A special fixup for Lenovo C940 and Yoga Duet 7;
7207 * both have the very same PCI SSID, and we need to apply different fixups
7208 * depending on the codec ID
7209 */
7210static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7211 const struct hda_fixup *fix,
7212 int action)
7213{
7214 int id;
7215
7216 if (codec->core.vendor_id == 0x10ec0298)
7217 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7218 else
7219 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7220 __snd_hda_apply_fixup(codec, id, action, 0);
7221}
7222
1727a771 7223static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
7224 [ALC269_FIXUP_GPIO2] = {
7225 .type = HDA_FIXUP_FUNC,
7226 .v.func = alc_fixup_gpio2,
7227 },
1d045db9 7228 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
7229 .type = HDA_FIXUP_PINCTLS,
7230 .v.pins = (const struct hda_pintbl[]) {
7231 {0x19, PIN_VREFGRD},
1d045db9
TI
7232 {}
7233 }
f1d4e28b 7234 },
1d045db9 7235 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
7236 .type = HDA_FIXUP_FUNC,
7237 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
7238 .chained = true,
7239 .chain_id = ALC269_FIXUP_SONY_VAIO
7240 },
7241 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 7242 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7243 .v.verbs = (const struct hda_verb[]) {
7244 /* Enables internal speaker */
7245 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7246 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7247 {}
7248 }
7249 },
7250 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 7251 .type = HDA_FIXUP_FUNC,
23d30f28 7252 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
7253 },
7254 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
7255 .type = HDA_FIXUP_PINS,
7256 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
7257 { 0x17, 0x99130111 }, /* subwoofer */
7258 { }
7259 }
7260 },
e959f2be
PLB
7261 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7262 .type = HDA_FIXUP_PINS,
7263 .v.pins = (const struct hda_pintbl[]) {
7264 { 0x19, 0x03A11050 },
7265 { 0x1a, 0x03A11C30 },
7266 { 0x21, 0x03211420 },
7267 { }
7268 }
7269 },
7270 [ALC269_FIXUP_ASUS_N7601ZM] = {
7271 .type = HDA_FIXUP_VERBS,
7272 .v.verbs = (const struct hda_verb[]) {
7273 {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7274 {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7275 {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7276 {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7277 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7278 {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7279 { }
7280 },
7281 .chained = true,
7282 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7283 },
1d045db9 7284 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 7285 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7286 .v.verbs = (const struct hda_verb[]) {
7287 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7288 {}
7289 }
7290 },
7291 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 7292 .type = HDA_FIXUP_FUNC,
1d045db9
TI
7293 .v.func = alc269_fixup_hweq,
7294 .chained = true,
7295 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7296 },
e9bd7d5c
TI
7297 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7298 .type = HDA_FIXUP_FUNC,
7299 .v.func = alc_fixup_disable_aamix,
7300 .chained = true,
7301 .chain_id = ALC269_FIXUP_SONY_VAIO
7302 },
1d045db9 7303 [ALC271_FIXUP_DMIC] = {
1727a771 7304 .type = HDA_FIXUP_FUNC,
1d045db9 7305 .v.func = alc271_fixup_dmic,
f1d4e28b 7306 },
017f2a10 7307 [ALC269_FIXUP_PCM_44K] = {
1727a771 7308 .type = HDA_FIXUP_FUNC,
017f2a10 7309 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
7310 .chained = true,
7311 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 7312 },
adabb3ec 7313 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 7314 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
7315 .v.func = alc269_fixup_stereo_dmic,
7316 },
7c478f03
DH
7317 [ALC269_FIXUP_HEADSET_MIC] = {
7318 .type = HDA_FIXUP_FUNC,
7319 .v.func = alc269_fixup_headset_mic,
7320 },
24519911 7321 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 7322 .type = HDA_FIXUP_FUNC,
24519911
TI
7323 .v.func = alc269_fixup_quanta_mute,
7324 },
7325 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
7326 .type = HDA_FIXUP_PINS,
7327 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
7328 { 0x1a, 0x2101103f }, /* dock line-out */
7329 { 0x1b, 0x23a11040 }, /* dock mic-in */
7330 { }
7331 },
7332 .chained = true,
7333 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7334 },
2041d564
DH
7335 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7336 .type = HDA_FIXUP_PINS,
7337 .v.pins = (const struct hda_pintbl[]) {
7338 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7339 { }
7340 },
7341 },
cc7016ab
TI
7342 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7343 .type = HDA_FIXUP_PINS,
7344 .v.pins = (const struct hda_pintbl[]) {
7345 { 0x21, 0x0221102f }, /* HP out */
7346 { }
7347 },
7348 },
4df3fd17
TI
7349 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7350 .type = HDA_FIXUP_FUNC,
7351 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7352 },
fdcc968a
JMG
7353 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7354 .type = HDA_FIXUP_FUNC,
7355 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7356 },
a4297b5d 7357 [ALC269_FIXUP_AMIC] = {
1727a771
TI
7358 .type = HDA_FIXUP_PINS,
7359 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7360 { 0x14, 0x99130110 }, /* speaker */
7361 { 0x15, 0x0121401f }, /* HP out */
7362 { 0x18, 0x01a19c20 }, /* mic */
7363 { 0x19, 0x99a3092f }, /* int-mic */
7364 { }
7365 },
7366 },
7367 [ALC269_FIXUP_DMIC] = {
1727a771
TI
7368 .type = HDA_FIXUP_PINS,
7369 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7370 { 0x12, 0x99a3092f }, /* int-mic */
7371 { 0x14, 0x99130110 }, /* speaker */
7372 { 0x15, 0x0121401f }, /* HP out */
7373 { 0x18, 0x01a19c20 }, /* mic */
7374 { }
7375 },
7376 },
7377 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
7378 .type = HDA_FIXUP_PINS,
7379 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7380 { 0x14, 0x99130110 }, /* speaker */
7381 { 0x18, 0x01a19c20 }, /* mic */
7382 { 0x19, 0x99a3092f }, /* int-mic */
7383 { 0x21, 0x0121401f }, /* HP out */
7384 { }
7385 },
7386 },
2267ea97 7387 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7388 .type = HDA_FIXUP_PINS,
7389 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7390 { 0x12, 0x99a3092f }, /* int-mic */
7391 { 0x14, 0x99130110 }, /* speaker */
7392 { 0x18, 0x01a19c20 }, /* mic */
7393 { 0x21, 0x0121401f }, /* HP out */
7394 { }
7395 },
7396 },
08fb0d0e 7397 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7398 .type = HDA_FIXUP_FUNC,
08fb0d0e 7399 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7400 },
d06ac143
DH
7401 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7402 .type = HDA_FIXUP_FUNC,
7403 .v.func = alc269_fixup_hp_mute_led_mic1,
7404 },
08fb0d0e 7405 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7406 .type = HDA_FIXUP_FUNC,
08fb0d0e 7407 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7408 },
7f783bd5
TB
7409 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7410 .type = HDA_FIXUP_FUNC,
7411 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7412 .chained = true,
7413 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7414 },
9f5c6faf
TI
7415 [ALC269_FIXUP_HP_GPIO_LED] = {
7416 .type = HDA_FIXUP_FUNC,
7417 .v.func = alc269_fixup_hp_gpio_led,
7418 },
9c5dc3bf
KY
7419 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7420 .type = HDA_FIXUP_FUNC,
7421 .v.func = alc269_fixup_hp_gpio_mic1_led,
7422 },
7423 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc269_fixup_hp_line1_mic1_led,
7426 },
693b613d 7427 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7428 .type = HDA_FIXUP_FUNC,
9d36a7dc 7429 .v.func = alc_fixup_inv_dmic,
693b613d 7430 },
9b745ab8
TI
7431 [ALC269_FIXUP_NO_SHUTUP] = {
7432 .type = HDA_FIXUP_FUNC,
7433 .v.func = alc_fixup_no_shutup,
7434 },
108cc108 7435 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7436 .type = HDA_FIXUP_PINS,
7437 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7438 { 0x19, 0x23a11040 }, /* dock mic */
7439 { 0x1b, 0x2121103f }, /* dock headphone */
7440 { }
7441 },
7442 .chained = true,
7443 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7444 },
b590b38c
TI
7445 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7446 .type = HDA_FIXUP_FUNC,
7447 .v.func = alc269_fixup_limit_int_mic_boost,
7448 .chained = true,
7449 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7450 },
108cc108 7451 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7452 .type = HDA_FIXUP_FUNC,
108cc108 7453 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7454 .chained = true,
7455 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7456 },
73bdd597
DH
7457 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7458 .type = HDA_FIXUP_PINS,
7459 .v.pins = (const struct hda_pintbl[]) {
7460 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7461 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7462 { }
7463 },
7464 .chained = true,
7465 .chain_id = ALC269_FIXUP_HEADSET_MODE
7466 },
7467 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7468 .type = HDA_FIXUP_PINS,
7469 .v.pins = (const struct hda_pintbl[]) {
7470 { 0x16, 0x21014020 }, /* dock line out */
7471 { 0x19, 0x21a19030 }, /* dock mic */
7472 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7473 { }
7474 },
7475 .chained = true,
7476 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7477 },
338cae56
DH
7478 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7479 .type = HDA_FIXUP_PINS,
7480 .v.pins = (const struct hda_pintbl[]) {
7481 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7482 { }
7483 },
7484 .chained = true,
7485 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7486 },
fcc6c877
KY
7487 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7488 .type = HDA_FIXUP_PINS,
7489 .v.pins = (const struct hda_pintbl[]) {
7490 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7491 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7492 { }
7493 },
7494 .chained = true,
7495 .chain_id = ALC269_FIXUP_HEADSET_MODE
7496 },
73bdd597
DH
7497 [ALC269_FIXUP_HEADSET_MODE] = {
7498 .type = HDA_FIXUP_FUNC,
7499 .v.func = alc_fixup_headset_mode,
6676f308 7500 .chained = true,
b3802783 7501 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7502 },
7503 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7504 .type = HDA_FIXUP_FUNC,
7505 .v.func = alc_fixup_headset_mode_no_hp_mic,
7506 },
7819717b
TI
7507 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7508 .type = HDA_FIXUP_PINS,
7509 .v.pins = (const struct hda_pintbl[]) {
7510 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7511 { }
7512 },
7513 .chained = true,
7514 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7515 },
88cfcf86
DH
7516 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7517 .type = HDA_FIXUP_PINS,
7518 .v.pins = (const struct hda_pintbl[]) {
7519 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7520 { }
7521 },
fbc78ad6
DH
7522 .chained = true,
7523 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7524 },
0fbf21c3 7525 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7526 .type = HDA_FIXUP_PINS,
7527 .v.pins = (const struct hda_pintbl[]) {
7528 {0x12, 0x90a60130},
7529 {0x13, 0x40000000},
7530 {0x14, 0x90170110},
7531 {0x18, 0x411111f0},
7532 {0x19, 0x04a11040},
7533 {0x1a, 0x411111f0},
7534 {0x1b, 0x90170112},
7535 {0x1d, 0x40759a05},
7536 {0x1e, 0x411111f0},
7537 {0x21, 0x04211020},
7538 { }
7539 },
e2744fd7
AB
7540 .chained = true,
7541 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7542 },
a2ef03fe
TE
7543 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7544 .type = HDA_FIXUP_FUNC,
7545 .v.func = alc298_fixup_huawei_mbx_stereo,
7546 .chained = true,
7547 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7548 },
d240d1dc
DH
7549 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7550 .type = HDA_FIXUP_FUNC,
7551 .v.func = alc269_fixup_x101_headset_mic,
7552 },
7553 [ALC269_FIXUP_ASUS_X101_VERB] = {
7554 .type = HDA_FIXUP_VERBS,
7555 .v.verbs = (const struct hda_verb[]) {
7556 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7557 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7558 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7559 { }
7560 },
7561 .chained = true,
7562 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7563 },
7564 [ALC269_FIXUP_ASUS_X101] = {
7565 .type = HDA_FIXUP_PINS,
7566 .v.pins = (const struct hda_pintbl[]) {
7567 { 0x18, 0x04a1182c }, /* Headset mic */
7568 { }
7569 },
7570 .chained = true,
7571 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7572 },
08a978db 7573 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7574 .type = HDA_FIXUP_PINS,
7575 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7576 { 0x14, 0x99130110 }, /* speaker */
7577 { 0x19, 0x01a19c20 }, /* mic */
7578 { 0x1b, 0x99a7012f }, /* int-mic */
7579 { 0x21, 0x0121401f }, /* HP out */
7580 { }
7581 },
7582 },
7583 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7584 .type = HDA_FIXUP_FUNC,
08a978db
DR
7585 .v.func = alc271_hp_gate_mic_jack,
7586 .chained = true,
7587 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7588 },
b1e8972e
OR
7589 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7590 .type = HDA_FIXUP_FUNC,
7591 .v.func = alc269_fixup_limit_int_mic_boost,
7592 .chained = true,
7593 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7594 },
42397004
DR
7595 [ALC269_FIXUP_ACER_AC700] = {
7596 .type = HDA_FIXUP_PINS,
7597 .v.pins = (const struct hda_pintbl[]) {
7598 { 0x12, 0x99a3092f }, /* int-mic */
7599 { 0x14, 0x99130110 }, /* speaker */
7600 { 0x18, 0x03a11c20 }, /* mic */
7601 { 0x1e, 0x0346101e }, /* SPDIF1 */
7602 { 0x21, 0x0321101f }, /* HP out */
7603 { }
7604 },
7605 .chained = true,
7606 .chain_id = ALC271_FIXUP_DMIC,
7607 },
3e0d611b
DH
7608 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7609 .type = HDA_FIXUP_FUNC,
7610 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7611 .chained = true,
7612 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7613 },
2cede303
OR
7614 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7615 .type = HDA_FIXUP_FUNC,
7616 .v.func = alc269_fixup_limit_int_mic_boost,
7617 .chained = true,
7618 .chain_id = ALC269VB_FIXUP_DMIC,
7619 },
23870831
TI
7620 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7621 .type = HDA_FIXUP_VERBS,
7622 .v.verbs = (const struct hda_verb[]) {
7623 /* class-D output amp +5dB */
7624 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7625 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7626 {}
7627 },
7628 .chained = true,
7629 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7630 },
f882c4be
MT
7631 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7632 .type = HDA_FIXUP_PINS,
7633 .v.pins = (const struct hda_pintbl[]) {
7634 { 0x18, 0x01a110f0 }, /* use as headset mic */
7635 { }
7636 },
7637 .chained = true,
7638 .chain_id = ALC269_FIXUP_HEADSET_MIC
7639 },
8e35cd4a
DH
7640 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7641 .type = HDA_FIXUP_FUNC,
7642 .v.func = alc269_fixup_limit_int_mic_boost,
7643 .chained = true,
7644 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7645 },
02b504d9
AA
7646 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7647 .type = HDA_FIXUP_PINS,
7648 .v.pins = (const struct hda_pintbl[]) {
7649 { 0x12, 0x99a3092f }, /* int-mic */
7650 { 0x18, 0x03a11d20 }, /* mic */
7651 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7652 { }
7653 },
7654 },
cd217a63
KY
7655 [ALC283_FIXUP_CHROME_BOOK] = {
7656 .type = HDA_FIXUP_FUNC,
7657 .v.func = alc283_fixup_chromebook,
7658 },
0202e99c
KY
7659 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7660 .type = HDA_FIXUP_FUNC,
7661 .v.func = alc283_fixup_sense_combo_jack,
7662 .chained = true,
7663 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7664 },
7bba2157
TI
7665 [ALC282_FIXUP_ASUS_TX300] = {
7666 .type = HDA_FIXUP_FUNC,
7667 .v.func = alc282_fixup_asus_tx300,
7668 },
1bb3e062
KY
7669 [ALC283_FIXUP_INT_MIC] = {
7670 .type = HDA_FIXUP_VERBS,
7671 .v.verbs = (const struct hda_verb[]) {
7672 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7673 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7674 { }
7675 },
7676 .chained = true,
7677 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7678 },
0f4881dc
DH
7679 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7680 .type = HDA_FIXUP_PINS,
7681 .v.pins = (const struct hda_pintbl[]) {
7682 { 0x17, 0x90170112 }, /* subwoofer */
7683 { }
7684 },
7685 .chained = true,
7686 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7687 },
7688 [ALC290_FIXUP_SUBWOOFER] = {
7689 .type = HDA_FIXUP_PINS,
7690 .v.pins = (const struct hda_pintbl[]) {
7691 { 0x17, 0x90170112 }, /* subwoofer */
7692 { }
7693 },
7694 .chained = true,
7695 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7696 },
338cae56
DH
7697 [ALC290_FIXUP_MONO_SPEAKERS] = {
7698 .type = HDA_FIXUP_FUNC,
7699 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
7700 },
7701 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7702 .type = HDA_FIXUP_FUNC,
7703 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
7704 .chained = true,
7705 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7706 },
b67ae3f1
DH
7707 [ALC269_FIXUP_THINKPAD_ACPI] = {
7708 .type = HDA_FIXUP_FUNC,
d5a6cabf 7709 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
7710 .chained = true,
7711 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 7712 },
56f27013
DH
7713 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7714 .type = HDA_FIXUP_FUNC,
7715 .v.func = alc_fixup_inv_dmic,
7716 .chained = true,
7717 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7718 },
5824ce8d 7719 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
7720 .type = HDA_FIXUP_PINS,
7721 .v.pins = (const struct hda_pintbl[]) {
7722 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7723 { }
5824ce8d
CC
7724 },
7725 .chained = true,
17d30460 7726 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 7727 },
615966ad
CC
7728 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7729 .type = HDA_FIXUP_PINS,
7730 .v.pins = (const struct hda_pintbl[]) {
7731 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7732 { }
7733 },
7734 .chained = true,
7735 .chain_id = ALC255_FIXUP_HEADSET_MODE
7736 },
9a22a8f5
KY
7737 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7738 .type = HDA_FIXUP_PINS,
7739 .v.pins = (const struct hda_pintbl[]) {
7740 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7741 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7742 { }
7743 },
7744 .chained = true,
7745 .chain_id = ALC255_FIXUP_HEADSET_MODE
7746 },
31278997
KY
7747 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7748 .type = HDA_FIXUP_PINS,
7749 .v.pins = (const struct hda_pintbl[]) {
7750 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7751 { }
7752 },
7753 .chained = true,
7754 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7755 },
9a22a8f5
KY
7756 [ALC255_FIXUP_HEADSET_MODE] = {
7757 .type = HDA_FIXUP_FUNC,
7758 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 7759 .chained = true,
b3802783 7760 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 7761 },
31278997
KY
7762 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7763 .type = HDA_FIXUP_FUNC,
7764 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7765 },
a22aa26f
KY
7766 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7767 .type = HDA_FIXUP_PINS,
7768 .v.pins = (const struct hda_pintbl[]) {
7769 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7770 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7771 { }
7772 },
7773 .chained = true,
7774 .chain_id = ALC269_FIXUP_HEADSET_MODE
7775 },
1c37c223 7776 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 7777 .type = HDA_FIXUP_FUNC,
7f57d803 7778 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
7779 .chained = true,
7780 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7781 },
9a811230
TI
7782 [ALC292_FIXUP_TPT440] = {
7783 .type = HDA_FIXUP_FUNC,
157f0b7f 7784 .v.func = alc_fixup_disable_aamix,
9a811230
TI
7785 .chained = true,
7786 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7787 },
abaa2274 7788 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
7789 .type = HDA_FIXUP_PINS,
7790 .v.pins = (const struct hda_pintbl[]) {
7791 { 0x19, 0x04a110f0 },
7792 { },
7793 },
7794 },
b3802783 7795 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 7796 .type = HDA_FIXUP_FUNC,
8a503555 7797 .v.func = alc_fixup_micmute_led,
00ef9940 7798 },
1a22e775
TI
7799 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7800 .type = HDA_FIXUP_PINS,
7801 .v.pins = (const struct hda_pintbl[]) {
7802 { 0x12, 0x90a60130 },
7803 { 0x14, 0x90170110 },
7804 { 0x17, 0x40000008 },
7805 { 0x18, 0x411111f0 },
0420694d 7806 { 0x19, 0x01a1913c },
1a22e775
TI
7807 { 0x1a, 0x411111f0 },
7808 { 0x1b, 0x411111f0 },
7809 { 0x1d, 0x40f89b2d },
7810 { 0x1e, 0x411111f0 },
7811 { 0x21, 0x0321101f },
7812 { },
7813 },
7814 },
c8426b27
TI
7815 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7816 .type = HDA_FIXUP_FUNC,
7817 .v.func = alc269vb_fixup_aspire_e1_coef,
7818 },
7a5255f1
DH
7819 [ALC280_FIXUP_HP_GPIO4] = {
7820 .type = HDA_FIXUP_FUNC,
7821 .v.func = alc280_fixup_hp_gpio4,
7822 },
eaa8e5ef
KY
7823 [ALC286_FIXUP_HP_GPIO_LED] = {
7824 .type = HDA_FIXUP_FUNC,
7825 .v.func = alc286_fixup_hp_gpio_led,
7826 },
33f4acd3
DH
7827 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7828 .type = HDA_FIXUP_FUNC,
7829 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7830 },
b4b33f9d
TC
7831 [ALC280_FIXUP_HP_DOCK_PINS] = {
7832 .type = HDA_FIXUP_PINS,
7833 .v.pins = (const struct hda_pintbl[]) {
7834 { 0x1b, 0x21011020 }, /* line-out */
7835 { 0x1a, 0x01a1903c }, /* headset mic */
7836 { 0x18, 0x2181103f }, /* line-in */
7837 { },
7838 },
7839 .chained = true,
7840 .chain_id = ALC280_FIXUP_HP_GPIO4
7841 },
04d5466a
JK
7842 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7843 .type = HDA_FIXUP_PINS,
7844 .v.pins = (const struct hda_pintbl[]) {
7845 { 0x1b, 0x21011020 }, /* line-out */
7846 { 0x18, 0x2181103f }, /* line-in */
7847 { },
7848 },
7849 .chained = true,
7850 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7851 },
98973f2f
KP
7852 [ALC280_FIXUP_HP_9480M] = {
7853 .type = HDA_FIXUP_FUNC,
7854 .v.func = alc280_fixup_hp_9480m,
7855 },
c3bb2b52
TI
7856 [ALC245_FIXUP_HP_X360_AMP] = {
7857 .type = HDA_FIXUP_FUNC,
7858 .v.func = alc245_fixup_hp_x360_amp,
5fc462c3
JC
7859 .chained = true,
7860 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 7861 },
e1e62b98
KY
7862 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7863 .type = HDA_FIXUP_FUNC,
7864 .v.func = alc_fixup_headset_mode_dell_alc288,
7865 .chained = true,
b3802783 7866 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
7867 },
7868 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7869 .type = HDA_FIXUP_PINS,
7870 .v.pins = (const struct hda_pintbl[]) {
7871 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7872 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7873 { }
7874 },
7875 .chained = true,
7876 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7877 },
831bfdf9
HW
7878 [ALC288_FIXUP_DISABLE_AAMIX] = {
7879 .type = HDA_FIXUP_FUNC,
7880 .v.func = alc_fixup_disable_aamix,
7881 .chained = true,
d44a6864 7882 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
7883 },
7884 [ALC288_FIXUP_DELL_XPS_13] = {
7885 .type = HDA_FIXUP_FUNC,
7886 .v.func = alc_fixup_dell_xps13,
7887 .chained = true,
7888 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7889 },
8b99aba7
TI
7890 [ALC292_FIXUP_DISABLE_AAMIX] = {
7891 .type = HDA_FIXUP_FUNC,
7892 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
7893 .chained = true,
7894 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 7895 },
c04017ea
DH
7896 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7897 .type = HDA_FIXUP_FUNC,
7898 .v.func = alc_fixup_disable_aamix,
7899 .chained = true,
7900 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7901 },
5fab5829 7902 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
7903 .type = HDA_FIXUP_FUNC,
7904 .v.func = alc_fixup_dell_xps13,
7905 .chained = true,
7906 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7907 },
5fab5829
TI
7908 [ALC292_FIXUP_DELL_E7X] = {
7909 .type = HDA_FIXUP_FUNC,
8a503555 7910 .v.func = alc_fixup_micmute_led,
5fab5829
TI
7911 /* micmute fixup must be applied at last */
7912 .chained_before = true,
7913 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7914 },
54324221
JM
7915 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7916 .type = HDA_FIXUP_PINS,
7917 .v.pins = (const struct hda_pintbl[]) {
7918 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7919 { }
7920 },
7921 .chained_before = true,
7922 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7923 },
977e6276
KY
7924 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7925 .type = HDA_FIXUP_PINS,
7926 .v.pins = (const struct hda_pintbl[]) {
7927 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7928 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7929 { }
7930 },
7931 .chained = true,
7932 .chain_id = ALC269_FIXUP_HEADSET_MODE
7933 },
2f726aec
HW
7934 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7935 .type = HDA_FIXUP_PINS,
7936 .v.pins = (const struct hda_pintbl[]) {
7937 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7938 { }
7939 },
7940 .chained = true,
7941 .chain_id = ALC269_FIXUP_HEADSET_MODE
7942 },
6ed1131f
KY
7943 [ALC275_FIXUP_DELL_XPS] = {
7944 .type = HDA_FIXUP_VERBS,
7945 .v.verbs = (const struct hda_verb[]) {
7946 /* Enables internal speaker */
7947 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7948 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7949 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7950 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7951 {}
7952 }
7953 },
23adc192
HW
7954 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7955 .type = HDA_FIXUP_FUNC,
7956 .v.func = alc_fixup_disable_aamix,
7957 .chained = true,
7958 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7959 },
3694cb29
K
7960 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7961 .type = HDA_FIXUP_FUNC,
7962 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7963 },
d1ee66c5
PC
7964 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7965 .type = HDA_FIXUP_FUNC,
7966 .v.func = alc_fixup_inv_dmic,
7967 .chained = true,
7968 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7969 },
7970 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7971 .type = HDA_FIXUP_FUNC,
7972 .v.func = alc269_fixup_limit_int_mic_boost
7973 },
3b43b71f
KHF
7974 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7975 .type = HDA_FIXUP_FUNC,
7976 .v.func = alc_fixup_disable_aamix,
7977 .chained = true,
7978 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7979 },
d1dd4211
KY
7980 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7981 .type = HDA_FIXUP_FUNC,
7982 .v.func = alc_fixup_disable_mic_vref,
7983 .chained = true,
7984 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7985 },
2ae95577
DH
7986 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7987 .type = HDA_FIXUP_VERBS,
7988 .v.verbs = (const struct hda_verb[]) {
7989 /* Disable pass-through path for FRONT 14h */
7990 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7991 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7992 {}
7993 },
7994 .chained = true,
d1dd4211 7995 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 7996 },
f883982d
TI
7997 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7998 .type = HDA_FIXUP_FUNC,
7999 .v.func = alc_fixup_disable_aamix,
8000 .chained = true,
8001 .chain_id = ALC269_FIXUP_HEADSET_MIC,
8002 },
e549d190
HW
8003 [ALC221_FIXUP_HP_FRONT_MIC] = {
8004 .type = HDA_FIXUP_PINS,
8005 .v.pins = (const struct hda_pintbl[]) {
8006 { 0x19, 0x02a19020 }, /* Front Mic */
8007 { }
8008 },
8009 },
c636b95e
SE
8010 [ALC292_FIXUP_TPT460] = {
8011 .type = HDA_FIXUP_FUNC,
8012 .v.func = alc_fixup_tpt440_dock,
8013 .chained = true,
8014 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8015 },
dd9aa335
HW
8016 [ALC298_FIXUP_SPK_VOLUME] = {
8017 .type = HDA_FIXUP_FUNC,
8018 .v.func = alc298_fixup_speaker_volume,
59ec4b57 8019 .chained = true,
2f726aec 8020 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 8021 },
f86de9b1
KY
8022 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8023 .type = HDA_FIXUP_FUNC,
8024 .v.func = alc298_fixup_speaker_volume,
8025 },
e312a869
TI
8026 [ALC295_FIXUP_DISABLE_DAC3] = {
8027 .type = HDA_FIXUP_FUNC,
8028 .v.func = alc295_fixup_disable_dac3,
8029 },
d2cd795c
JK
8030 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8031 .type = HDA_FIXUP_FUNC,
8032 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
8033 .chained = true,
8034 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 8035 },
fd06c77e
KHF
8036 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8037 .type = HDA_FIXUP_PINS,
8038 .v.pins = (const struct hda_pintbl[]) {
8039 { 0x1b, 0x90170151 },
8040 { }
8041 },
8042 .chained = true,
8043 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8044 },
823ff161
GM
8045 [ALC269_FIXUP_ATIV_BOOK_8] = {
8046 .type = HDA_FIXUP_FUNC,
8047 .v.func = alc_fixup_auto_mute_via_amp,
8048 .chained = true,
8049 .chain_id = ALC269_FIXUP_NO_SHUTUP
8050 },
4ba5c853
MT
8051 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8052 .type = HDA_FIXUP_PINS,
8053 .v.pins = (const struct hda_pintbl[]) {
8054 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8055 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8056 { }
8057 },
8058 .chained = true,
8059 .chain_id = ALC269_FIXUP_HEADSET_MODE
8060 },
9eb5d0e6
KY
8061 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8062 .type = HDA_FIXUP_PINS,
8063 .v.pins = (const struct hda_pintbl[]) {
8064 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8065 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8066 { }
8067 },
8068 .chained = true,
8069 .chain_id = ALC269_FIXUP_HEADSET_MODE
8070 },
c1732ede
CC
8071 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8072 .type = HDA_FIXUP_FUNC,
8073 .v.func = alc_fixup_headset_mode,
8074 },
8075 [ALC256_FIXUP_ASUS_MIC] = {
8076 .type = HDA_FIXUP_PINS,
8077 .v.pins = (const struct hda_pintbl[]) {
8078 { 0x13, 0x90a60160 }, /* use as internal mic */
8079 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8080 { }
8081 },
8082 .chained = true,
8083 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8084 },
eeed4cd1 8085 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
8086 .type = HDA_FIXUP_FUNC,
8087 /* Set up GPIO2 for the speaker amp */
8088 .v.func = alc_fixup_gpio4,
eeed4cd1 8089 },
216d7aeb
CC
8090 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8091 .type = HDA_FIXUP_PINS,
8092 .v.pins = (const struct hda_pintbl[]) {
8093 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8094 { }
8095 },
8096 .chained = true,
8097 .chain_id = ALC269_FIXUP_HEADSET_MIC
8098 },
8099 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8100 .type = HDA_FIXUP_VERBS,
8101 .v.verbs = (const struct hda_verb[]) {
8102 /* Enables internal speaker */
8103 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8104 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8105 {}
8106 },
8107 .chained = true,
8108 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8109 },
ca169cc2
KY
8110 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8111 .type = HDA_FIXUP_FUNC,
8112 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
8113 .chained = true,
8114 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 8115 },
ea5c7eba
JHP
8116 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
8117 .type = HDA_FIXUP_VERBS,
8118 .v.verbs = (const struct hda_verb[]) {
8119 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8120 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8121 { }
8122 },
8123 .chained = true,
8124 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8125 },
f33f79f3
HW
8126 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8127 .type = HDA_FIXUP_PINS,
8128 .v.pins = (const struct hda_pintbl[]) {
8129 /* Change the mic location from front to right, otherwise there are
8130 two front mics with the same name, pulseaudio can't handle them.
8131 This is just a temporary workaround, after applying this fixup,
8132 there will be one "Front Mic" and one "Mic" in this machine.
8133 */
8134 { 0x1a, 0x04a19040 },
8135 { }
8136 },
8137 },
5f364135
KY
8138 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8139 .type = HDA_FIXUP_PINS,
8140 .v.pins = (const struct hda_pintbl[]) {
8141 { 0x16, 0x0101102f }, /* Rear Headset HP */
8142 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8143 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8144 { 0x1b, 0x02011020 },
8145 { }
8146 },
8147 .chained = true,
52e4e368
KHF
8148 .chain_id = ALC225_FIXUP_S3_POP_NOISE
8149 },
8150 [ALC225_FIXUP_S3_POP_NOISE] = {
8151 .type = HDA_FIXUP_FUNC,
8152 .v.func = alc225_fixup_s3_pop_noise,
8153 .chained = true,
5f364135
KY
8154 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8155 },
b84e8436
PH
8156 [ALC700_FIXUP_INTEL_REFERENCE] = {
8157 .type = HDA_FIXUP_VERBS,
8158 .v.verbs = (const struct hda_verb[]) {
8159 /* Enables internal speaker */
8160 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8161 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8162 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8163 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8164 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8165 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8166 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8167 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8168 {}
8169 }
8170 },
92266651
KY
8171 [ALC274_FIXUP_DELL_BIND_DACS] = {
8172 .type = HDA_FIXUP_FUNC,
8173 .v.func = alc274_fixup_bind_dacs,
8174 .chained = true,
8175 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8176 },
8177 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8178 .type = HDA_FIXUP_PINS,
8179 .v.pins = (const struct hda_pintbl[]) {
8180 { 0x1b, 0x0401102f },
8181 { }
8182 },
8183 .chained = true,
8184 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
8185 },
399c01aa 8186 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
8187 .type = HDA_FIXUP_FUNC,
8188 .v.func = alc_fixup_tpt470_dock,
8189 .chained = true,
8190 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8191 },
399c01aa
TI
8192 [ALC298_FIXUP_TPT470_DOCK] = {
8193 .type = HDA_FIXUP_FUNC,
8194 .v.func = alc_fixup_tpt470_dacs,
8195 .chained = true,
8196 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8197 },
ae104a21
KY
8198 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8199 .type = HDA_FIXUP_PINS,
8200 .v.pins = (const struct hda_pintbl[]) {
8201 { 0x14, 0x0201101f },
8202 { }
8203 },
8204 .chained = true,
8205 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8206 },
f0ba9d69
KY
8207 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
8208 .type = HDA_FIXUP_PINS,
8209 .v.pins = (const struct hda_pintbl[]) {
8210 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8211 { }
8212 },
3ce0d5aa
HW
8213 .chained = true,
8214 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 8215 },
bbf8ff6b
TB
8216 [ALC295_FIXUP_HP_X360] = {
8217 .type = HDA_FIXUP_FUNC,
8218 .v.func = alc295_fixup_hp_top_speakers,
8219 .chained = true,
8220 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
8221 },
8222 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8223 .type = HDA_FIXUP_PINS,
8224 .v.pins = (const struct hda_pintbl[]) {
8225 { 0x19, 0x0181313f},
8226 { }
8227 },
8228 .chained = true,
8229 .chain_id = ALC269_FIXUP_HEADSET_MIC
8230 },
c4cfcf6f
HW
8231 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8232 .type = HDA_FIXUP_FUNC,
8233 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
8234 .chained = true,
8235 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 8236 },
e8ed64b0
GKK
8237 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8238 .type = HDA_FIXUP_FUNC,
8239 .v.func = alc_fixup_auto_mute_via_amp,
8240 },
33aaebd4
CC
8241 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8242 .type = HDA_FIXUP_PINS,
8243 .v.pins = (const struct hda_pintbl[]) {
8244 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8245 { }
8246 },
8247 .chained = true,
8248 .chain_id = ALC269_FIXUP_HEADSET_MIC
8249 },
d8ae458e
CC
8250 [ALC294_FIXUP_ASUS_MIC] = {
8251 .type = HDA_FIXUP_PINS,
8252 .v.pins = (const struct hda_pintbl[]) {
8253 { 0x13, 0x90a60160 }, /* use as internal mic */
8254 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8255 { }
8256 },
8257 .chained = true,
ef9ddb9d 8258 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 8259 },
4e051106
JHP
8260 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8261 .type = HDA_FIXUP_PINS,
8262 .v.pins = (const struct hda_pintbl[]) {
82b01149 8263 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
8264 { }
8265 },
8266 .chained = true,
ef9ddb9d 8267 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
8268 },
8269 [ALC294_FIXUP_ASUS_SPK] = {
8270 .type = HDA_FIXUP_VERBS,
8271 .v.verbs = (const struct hda_verb[]) {
8272 /* Set EAPD high */
8273 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8274 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
8275 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8276 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
8277 { }
8278 },
8279 .chained = true,
8280 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8281 },
c8a9afa6 8282 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 8283 .type = HDA_FIXUP_FUNC,
c8a9afa6 8284 .v.func = alc295_fixup_chromebook,
8983eb60
KY
8285 .chained = true,
8286 .chain_id = ALC225_FIXUP_HEADSET_JACK
8287 },
8288 [ALC225_FIXUP_HEADSET_JACK] = {
8289 .type = HDA_FIXUP_FUNC,
8290 .v.func = alc_fixup_headset_jack,
e854747d 8291 },
89e3a568
JS
8292 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8293 .type = HDA_FIXUP_PINS,
8294 .v.pins = (const struct hda_pintbl[]) {
8295 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8296 { }
8297 },
8298 .chained = true,
8299 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8300 },
c8c6ee61
HW
8301 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8302 .type = HDA_FIXUP_VERBS,
8303 .v.verbs = (const struct hda_verb[]) {
8304 /* Disable PCBEEP-IN passthrough */
8305 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8306 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8307 { }
8308 },
8309 .chained = true,
8310 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8311 },
cbc05fd6
JHP
8312 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8313 .type = HDA_FIXUP_PINS,
8314 .v.pins = (const struct hda_pintbl[]) {
8315 { 0x19, 0x03a11130 },
8316 { 0x1a, 0x90a60140 }, /* use as internal mic */
8317 { }
8318 },
8319 .chained = true,
8320 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8321 },
136824ef
KY
8322 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8323 .type = HDA_FIXUP_PINS,
8324 .v.pins = (const struct hda_pintbl[]) {
8325 { 0x16, 0x01011020 }, /* Rear Line out */
8326 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8327 { }
8328 },
8329 .chained = true,
8330 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8331 },
8332 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8333 .type = HDA_FIXUP_FUNC,
8334 .v.func = alc_fixup_auto_mute_via_amp,
8335 .chained = true,
8336 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8337 },
8338 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8339 .type = HDA_FIXUP_FUNC,
8340 .v.func = alc_fixup_disable_mic_vref,
8341 .chained = true,
8342 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8343 },
667a8f73
JHP
8344 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8345 .type = HDA_FIXUP_VERBS,
8346 .v.verbs = (const struct hda_verb[]) {
8347 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8348 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8349 { }
8350 },
8351 .chained = true,
8352 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8353 },
8c8967a7
DD
8354 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8355 .type = HDA_FIXUP_PINS,
8356 .v.pins = (const struct hda_pintbl[]) {
8357 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8358 { }
8359 },
8360 .chained = true,
8361 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8362 },
e1037354
JHP
8363 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8364 .type = HDA_FIXUP_PINS,
8365 .v.pins = (const struct hda_pintbl[]) {
8366 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8367 { }
8368 },
8369 .chained = true,
8370 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8371 },
e2a829b3
BR
8372 [ALC299_FIXUP_PREDATOR_SPK] = {
8373 .type = HDA_FIXUP_PINS,
8374 .v.pins = (const struct hda_pintbl[]) {
8375 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8376 { }
8377 }
8378 },
bd9c10bc 8379 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
8380 .type = HDA_FIXUP_PINS,
8381 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
8382 { 0x19, 0x04a11040 },
8383 { 0x21, 0x04211020 },
60083f9e
JHP
8384 { }
8385 },
8386 .chained = true,
bd9c10bc 8387 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 8388 },
e79c2269 8389 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
8390 .type = HDA_FIXUP_PINS,
8391 .v.pins = (const struct hda_pintbl[]) {
e79c2269 8392 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
8393 { }
8394 },
8395 .chained = true,
e79c2269 8396 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 8397 },
e79c2269
KY
8398 [ALC289_FIXUP_DUAL_SPK] = {
8399 .type = HDA_FIXUP_FUNC,
8400 .v.func = alc285_fixup_speaker2_to_dac1,
8401 .chained = true,
8402 .chain_id = ALC289_FIXUP_DELL_SPK2
8403 },
48e01504
CC
8404 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8405 .type = HDA_FIXUP_FUNC,
8406 .v.func = alc285_fixup_speaker2_to_dac1,
8407 .chained = true,
8408 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8409 },
8410 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8411 .type = HDA_FIXUP_FUNC,
8412 /* The GPIO must be pulled to initialize the AMP */
8413 .v.func = alc_fixup_gpio4,
8414 .chained = true,
48e01504 8415 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8416 },
6a6660d0
TI
8417 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8418 .type = HDA_FIXUP_FUNC,
8419 .v.func = alc285_fixup_thinkpad_x1_gen7,
8420 .chained = true,
8421 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8422 },
76f7dec0
KY
8423 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8424 .type = HDA_FIXUP_FUNC,
8425 .v.func = alc_fixup_headset_jack,
8426 .chained = true,
6a6660d0 8427 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8428 },
8b33a134
JHP
8429 [ALC294_FIXUP_ASUS_HPE] = {
8430 .type = HDA_FIXUP_VERBS,
8431 .v.verbs = (const struct hda_verb[]) {
8432 /* Set EAPD high */
8433 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8434 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8435 { }
8436 },
8437 .chained = true,
8438 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8439 },
c3cdf189
LJ
8440 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8441 .type = HDA_FIXUP_PINS,
8442 .v.pins = (const struct hda_pintbl[]) {
8443 { 0x19, 0x03a11050 }, /* front HP mic */
8444 { 0x1a, 0x01a11830 }, /* rear external mic */
8445 { 0x21, 0x03211020 }, /* front HP out */
8446 { }
8447 },
8448 .chained = true,
8449 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8450 },
8451 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8452 .type = HDA_FIXUP_VERBS,
8453 .v.verbs = (const struct hda_verb[]) {
8454 /* set 0x15 to HP-OUT ctrl */
8455 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8456 /* unmute the 0x15 amp */
8457 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8458 { }
8459 },
8460 .chained = true,
8461 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8462 },
8463 [ALC294_FIXUP_ASUS_GX502_HP] = {
8464 .type = HDA_FIXUP_FUNC,
8465 .v.func = alc294_fixup_gx502_hp,
8466 },
c1b55029
DC
8467 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8468 .type = HDA_FIXUP_PINS,
8469 .v.pins = (const struct hda_pintbl[]) {
8470 { 0x19, 0x01a11050 }, /* rear HP mic */
8471 { 0x1a, 0x01a11830 }, /* rear external mic */
8472 { 0x21, 0x012110f0 }, /* rear HP out */
8473 { }
8474 },
8475 .chained = true,
8476 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8477 },
8478 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8479 .type = HDA_FIXUP_VERBS,
8480 .v.verbs = (const struct hda_verb[]) {
8481 /* set 0x15 to HP-OUT ctrl */
8482 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8483 /* unmute the 0x15 amp */
8484 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8485 /* set 0x1b to HP-OUT */
8486 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8487 { }
8488 },
8489 .chained = true,
8490 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8491 },
8492 [ALC294_FIXUP_ASUS_GU502_HP] = {
8493 .type = HDA_FIXUP_FUNC,
8494 .v.func = alc294_fixup_gu502_hp,
c611e659
LJ
8495 },
8496 [ALC294_FIXUP_ASUS_G513_PINS] = {
8497 .type = HDA_FIXUP_PINS,
8498 .v.pins = (const struct hda_pintbl[]) {
8499 { 0x19, 0x03a11050 }, /* front HP mic */
8500 { 0x1a, 0x03a11c30 }, /* rear external mic */
8501 { 0x21, 0x03211420 }, /* front HP out */
8502 { }
8503 },
c1b55029 8504 },
bc2c2354
LJ
8505 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8506 .type = HDA_FIXUP_PINS,
8507 .v.pins = (const struct hda_pintbl[]) {
66ba7c88
LJ
8508 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8509 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8510 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8511 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8512 { 0x21, 0x03211420 },
bc2c2354
LJ
8513 { }
8514 },
bc2c2354 8515 },
1b94e59d
TI
8516 [ALC294_FIXUP_ASUS_COEF_1B] = {
8517 .type = HDA_FIXUP_VERBS,
8518 .v.verbs = (const struct hda_verb[]) {
8519 /* Set bit 10 to correct noisy output after reboot from
8520 * Windows 10 (due to pop noise reduction?)
8521 */
8522 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8523 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8524 { }
8525 },
f8fbcdfb
TI
8526 .chained = true,
8527 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8528 },
f5a88b0a
KHF
8529 [ALC285_FIXUP_HP_GPIO_LED] = {
8530 .type = HDA_FIXUP_FUNC,
8531 .v.func = alc285_fixup_hp_gpio_led,
8532 },
431e76c3
KY
8533 [ALC285_FIXUP_HP_MUTE_LED] = {
8534 .type = HDA_FIXUP_FUNC,
8535 .v.func = alc285_fixup_hp_mute_led,
8536 },
ca88eeb3
LG
8537 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8538 .type = HDA_FIXUP_FUNC,
8539 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
8540 },
e7d66cf7
JS
8541 [ALC236_FIXUP_HP_GPIO_LED] = {
8542 .type = HDA_FIXUP_FUNC,
8543 .v.func = alc236_fixup_hp_gpio_led,
8544 },
24164f43
KY
8545 [ALC236_FIXUP_HP_MUTE_LED] = {
8546 .type = HDA_FIXUP_FUNC,
8547 .v.func = alc236_fixup_hp_mute_led,
8548 },
75b62ab6
JW
8549 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8550 .type = HDA_FIXUP_FUNC,
8551 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8552 },
a2d57ebe
KM
8553 [ALC298_FIXUP_SAMSUNG_AMP] = {
8554 .type = HDA_FIXUP_FUNC,
8555 .v.func = alc298_fixup_samsung_amp,
8556 .chained = true,
8557 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8558 },
14425f1f
MP
8559 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8560 .type = HDA_FIXUP_VERBS,
8561 .v.verbs = (const struct hda_verb[]) {
8562 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8563 { }
8564 },
8565 },
ef248d9b
MK
8566 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8567 .type = HDA_FIXUP_VERBS,
8568 .v.verbs = (const struct hda_verb[]) {
8569 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8570 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8571 { }
8572 },
8573 },
9e43342b
CC
8574 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8575 .type = HDA_FIXUP_PINS,
8576 .v.pins = (const struct hda_pintbl[]) {
8577 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8578 { }
8579 },
8580 .chained = true,
8581 .chain_id = ALC269_FIXUP_HEADSET_MODE
8582 },
8eae7e9b
JHP
8583 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8584 .type = HDA_FIXUP_PINS,
8585 .v.pins = (const struct hda_pintbl[]) {
8586 { 0x14, 0x90100120 }, /* use as internal speaker */
8587 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8588 { 0x1a, 0x01011020 }, /* use as line out */
8589 { },
8590 },
8591 .chained = true,
8592 .chain_id = ALC269_FIXUP_HEADSET_MIC
8593 },
6e15d126
JHP
8594 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8595 .type = HDA_FIXUP_PINS,
8596 .v.pins = (const struct hda_pintbl[]) {
8597 { 0x18, 0x02a11030 }, /* use as headset mic */
8598 { }
8599 },
8600 .chained = true,
8601 .chain_id = ALC269_FIXUP_HEADSET_MIC
8602 },
781c90c0
JHP
8603 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8604 .type = HDA_FIXUP_PINS,
8605 .v.pins = (const struct hda_pintbl[]) {
8606 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8607 { }
8608 },
8609 .chained = true,
8610 .chain_id = ALC269_FIXUP_HEADSET_MIC
8611 },
293a92c1 8612 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
8613 .type = HDA_FIXUP_FUNC,
8614 .v.func = alc289_fixup_asus_ga401,
8615 .chained = true,
8616 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 8617 },
4b43d05a
AS
8618 [ALC289_FIXUP_ASUS_GA502] = {
8619 .type = HDA_FIXUP_PINS,
8620 .v.pins = (const struct hda_pintbl[]) {
8621 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8622 { }
8623 },
8624 },
f50a121d
JHP
8625 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8626 .type = HDA_FIXUP_PINS,
8627 .v.pins = (const struct hda_pintbl[]) {
8628 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8629 { }
8630 },
8631 .chained = true,
8632 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8633 },
56496253
KY
8634 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8635 .type = HDA_FIXUP_FUNC,
8636 .v.func = alc285_fixup_hp_gpio_amp_init,
8637 .chained = true,
8638 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8639 },
f1ec5be1
HC
8640 [ALC269_FIXUP_CZC_B20] = {
8641 .type = HDA_FIXUP_PINS,
8642 .v.pins = (const struct hda_pintbl[]) {
8643 { 0x12, 0x411111f0 },
8644 { 0x14, 0x90170110 }, /* speaker */
8645 { 0x15, 0x032f1020 }, /* HP out */
8646 { 0x17, 0x411111f0 },
8647 { 0x18, 0x03ab1040 }, /* mic */
8648 { 0x19, 0xb7a7013f },
8649 { 0x1a, 0x0181305f },
8650 { 0x1b, 0x411111f0 },
8651 { 0x1d, 0x411111f0 },
8652 { 0x1e, 0x411111f0 },
8653 { }
8654 },
8655 .chain_id = ALC269_FIXUP_DMIC,
8656 },
8657 [ALC269_FIXUP_CZC_TMI] = {
8658 .type = HDA_FIXUP_PINS,
8659 .v.pins = (const struct hda_pintbl[]) {
8660 { 0x12, 0x4000c000 },
8661 { 0x14, 0x90170110 }, /* speaker */
8662 { 0x15, 0x0421401f }, /* HP out */
8663 { 0x17, 0x411111f0 },
8664 { 0x18, 0x04a19020 }, /* mic */
8665 { 0x19, 0x411111f0 },
8666 { 0x1a, 0x411111f0 },
8667 { 0x1b, 0x411111f0 },
8668 { 0x1d, 0x40448505 },
8669 { 0x1e, 0x411111f0 },
8670 { 0x20, 0x8000ffff },
8671 { }
8672 },
8673 .chain_id = ALC269_FIXUP_DMIC,
8674 },
8675 [ALC269_FIXUP_CZC_L101] = {
8676 .type = HDA_FIXUP_PINS,
8677 .v.pins = (const struct hda_pintbl[]) {
8678 { 0x12, 0x40000000 },
8679 { 0x14, 0x01014010 }, /* speaker */
8680 { 0x15, 0x411111f0 }, /* HP out */
8681 { 0x16, 0x411111f0 },
8682 { 0x18, 0x01a19020 }, /* mic */
8683 { 0x19, 0x02a19021 },
8684 { 0x1a, 0x0181302f },
8685 { 0x1b, 0x0221401f },
8686 { 0x1c, 0x411111f0 },
8687 { 0x1d, 0x4044c601 },
8688 { 0x1e, 0x411111f0 },
8689 { }
8690 },
8691 .chain_id = ALC269_FIXUP_DMIC,
8692 },
8693 [ALC269_FIXUP_LEMOTE_A1802] = {
8694 .type = HDA_FIXUP_PINS,
8695 .v.pins = (const struct hda_pintbl[]) {
8696 { 0x12, 0x40000000 },
8697 { 0x14, 0x90170110 }, /* speaker */
8698 { 0x17, 0x411111f0 },
8699 { 0x18, 0x03a19040 }, /* mic1 */
8700 { 0x19, 0x90a70130 }, /* mic2 */
8701 { 0x1a, 0x411111f0 },
8702 { 0x1b, 0x411111f0 },
8703 { 0x1d, 0x40489d2d },
8704 { 0x1e, 0x411111f0 },
8705 { 0x20, 0x0003ffff },
8706 { 0x21, 0x03214020 },
8707 { }
8708 },
8709 .chain_id = ALC269_FIXUP_DMIC,
8710 },
8711 [ALC269_FIXUP_LEMOTE_A190X] = {
8712 .type = HDA_FIXUP_PINS,
8713 .v.pins = (const struct hda_pintbl[]) {
8714 { 0x14, 0x99130110 }, /* speaker */
8715 { 0x15, 0x0121401f }, /* HP out */
8716 { 0x18, 0x01a19c20 }, /* rear mic */
8717 { 0x19, 0x99a3092f }, /* front mic */
8718 { 0x1b, 0x0201401f }, /* front lineout */
8719 { }
8720 },
8721 .chain_id = ALC269_FIXUP_DMIC,
8722 },
e2d2fded
KHF
8723 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8724 .type = HDA_FIXUP_PINS,
8725 .v.pins = (const struct hda_pintbl[]) {
8726 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8727 { }
8728 },
8729 .chained = true,
8730 .chain_id = ALC269_FIXUP_HEADSET_MODE
8731 },
73e7161e
WS
8732 [ALC256_FIXUP_INTEL_NUC10] = {
8733 .type = HDA_FIXUP_PINS,
8734 .v.pins = (const struct hda_pintbl[]) {
8735 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8736 { }
8737 },
8738 .chained = true,
8739 .chain_id = ALC269_FIXUP_HEADSET_MODE
8740 },
fc19d559
HW
8741 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8742 .type = HDA_FIXUP_VERBS,
8743 .v.verbs = (const struct hda_verb[]) {
8744 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8745 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8746 { }
8747 },
8748 .chained = true,
c84bfedc 8749 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 8750 },
13468bfa
HW
8751 [ALC274_FIXUP_HP_MIC] = {
8752 .type = HDA_FIXUP_VERBS,
8753 .v.verbs = (const struct hda_verb[]) {
8754 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8755 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8756 { }
8757 },
8758 },
8a8de09c
KY
8759 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8760 .type = HDA_FIXUP_FUNC,
8761 .v.func = alc274_fixup_hp_headset_mic,
8762 .chained = true,
8763 .chain_id = ALC274_FIXUP_HP_MIC
8764 },
622464c8
TI
8765 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8766 .type = HDA_FIXUP_FUNC,
8767 .v.func = alc274_fixup_hp_envy_gpio,
8768 },
ef9ce66f
KY
8769 [ALC256_FIXUP_ASUS_HPE] = {
8770 .type = HDA_FIXUP_VERBS,
8771 .v.verbs = (const struct hda_verb[]) {
8772 /* Set EAPD high */
8773 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8774 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8775 { }
8776 },
8777 .chained = true,
8778 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8779 },
446b8185
KY
8780 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8781 .type = HDA_FIXUP_FUNC,
8782 .v.func = alc_fixup_headset_jack,
8783 .chained = true,
8784 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8785 },
a0ccbc53
KY
8786 [ALC287_FIXUP_HP_GPIO_LED] = {
8787 .type = HDA_FIXUP_FUNC,
8788 .v.func = alc287_fixup_hp_gpio_led,
8789 },
9e885770
KY
8790 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8791 .type = HDA_FIXUP_FUNC,
8792 .v.func = alc274_fixup_hp_headset_mic,
8793 },
92666d45
KY
8794 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8795 .type = HDA_FIXUP_FUNC,
8796 .v.func = alc_fixup_no_int_mic,
8797 .chained = true,
8798 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8799 },
34cdf405
CC
8800 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8801 .type = HDA_FIXUP_PINS,
8802 .v.pins = (const struct hda_pintbl[]) {
8803 { 0x1b, 0x411111f0 },
8804 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8805 { },
8806 },
8807 .chained = true,
8808 .chain_id = ALC269_FIXUP_HEADSET_MODE
8809 },
495dc763
CC
8810 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8811 .type = HDA_FIXUP_FUNC,
8812 .v.func = alc269_fixup_limit_int_mic_boost,
8813 .chained = true,
8814 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8815 },
d0e18561
CC
8816 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8817 .type = HDA_FIXUP_PINS,
8818 .v.pins = (const struct hda_pintbl[]) {
8819 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8820 { 0x1a, 0x90a1092f }, /* use as internal mic */
8821 { }
8822 },
8823 .chained = true,
8824 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8825 },
26928ca1
TI
8826 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8827 .type = HDA_FIXUP_FUNC,
8828 .v.func = alc285_fixup_ideapad_s740_coef,
8829 .chained = true,
8830 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8831 },
bd15b155
KHF
8832 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8833 .type = HDA_FIXUP_FUNC,
8834 .v.func = alc269_fixup_limit_int_mic_boost,
8835 .chained = true,
8836 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8837 },
8eedd3a7
TI
8838 [ALC295_FIXUP_ASUS_DACS] = {
8839 .type = HDA_FIXUP_FUNC,
8840 .v.func = alc295_fixup_asus_dacs,
8841 },
5d84b531
TI
8842 [ALC295_FIXUP_HP_OMEN] = {
8843 .type = HDA_FIXUP_PINS,
8844 .v.pins = (const struct hda_pintbl[]) {
8845 { 0x12, 0xb7a60130 },
8846 { 0x13, 0x40000000 },
8847 { 0x14, 0x411111f0 },
8848 { 0x16, 0x411111f0 },
8849 { 0x17, 0x90170110 },
8850 { 0x18, 0x411111f0 },
8851 { 0x19, 0x02a11030 },
8852 { 0x1a, 0x411111f0 },
8853 { 0x1b, 0x04a19030 },
8854 { 0x1d, 0x40600001 },
8855 { 0x1e, 0x411111f0 },
8856 { 0x21, 0x03211020 },
8857 {}
8858 },
8859 .chained = true,
8860 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8861 },
f2be77fe 8862 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
8863 .type = HDA_FIXUP_FUNC,
8864 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 8865 },
d94befbb
DB
8866 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8867 .type = HDA_FIXUP_FUNC,
8868 .v.func = alc285_fixup_hp_spectre_x360_eb1
8869 },
9ebaef05
HW
8870 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8871 .type = HDA_FIXUP_FUNC,
8872 .v.func = alc285_fixup_ideapad_s740_coef,
8873 .chained = true,
8874 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8875 },
29c8f40b
PU
8876 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8877 .type = HDA_FIXUP_FUNC,
8878 .v.func = alc_fixup_no_shutup,
8879 .chained = true,
8880 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8881 },
57c9e21a
HW
8882 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8883 .type = HDA_FIXUP_PINS,
8884 .v.pins = (const struct hda_pintbl[]) {
8885 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8886 { }
8887 },
8888 .chained = true,
8889 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8890 },
8903376d
KHF
8891 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8892 .type = HDA_FIXUP_FUNC,
8893 .v.func = alc269_fixup_limit_int_mic_boost,
8894 .chained = true,
8895 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8896 },
8f4c9042
BF
8897 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8898 .type = HDA_FIXUP_FUNC,
8899 .v.func = alc285_fixup_ideapad_s740_coef,
8900 .chained = true,
8901 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8902 },
8903 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8904 .type = HDA_FIXUP_FUNC,
8905 .v.func = alc287_fixup_legion_15imhg05_speakers,
8906 .chained = true,
8907 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8908 },
ad7cc2d4
CB
8909 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8910 .type = HDA_FIXUP_VERBS,
8911 //.v.verbs = legion_15imhg05_coefs,
8912 .v.verbs = (const struct hda_verb[]) {
8913 // set left speaker Legion 7i.
8914 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8915 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8916
8917 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8918 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8919 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8920 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8921 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8922
8923 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8924 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8925 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8926 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8927 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8928
8929 // set right speaker Legion 7i.
8930 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8931 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8932
8933 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8934 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8935 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8936 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8937 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8938
8939 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8940 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8941 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8942 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8943 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8944 {}
8945 },
8946 .chained = true,
8947 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8948 },
8949 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8950 .type = HDA_FIXUP_FUNC,
8951 .v.func = alc287_fixup_legion_15imhg05_speakers,
8952 .chained = true,
8953 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8954 },
8955 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8956 .type = HDA_FIXUP_VERBS,
8957 .v.verbs = (const struct hda_verb[]) {
8958 // set left speaker Yoga 7i.
8959 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8960 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8961
8962 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8963 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8964 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8965 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8966 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8967
8968 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8969 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8970 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8971 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8972 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8973
8974 // set right speaker Yoga 7i.
8975 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8976 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8977
8978 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8979 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8980 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8981 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8982 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8983
8984 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8985 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8986 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8987 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8988 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8989 {}
8990 },
8991 .chained = true,
8992 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8993 },
56ec3e75
TI
8994 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
8995 .type = HDA_FIXUP_FUNC,
8996 .v.func = alc298_fixup_lenovo_c940_duet7,
8997 },
ad7cc2d4
CB
8998 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8999 .type = HDA_FIXUP_VERBS,
9000 .v.verbs = (const struct hda_verb[]) {
9001 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9002 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 9003 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
9004 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9005 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9006 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9007 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9008 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9009 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9010 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9011 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9012 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9013 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9014 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9015 {}
9016 },
9017 .chained = true,
9018 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9019 },
619764cc 9020 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 9021 .type = HDA_FIXUP_FUNC,
619764cc 9022 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 9023 },
5fc462c3
JC
9024 [ALC245_FIXUP_HP_GPIO_LED] = {
9025 .type = HDA_FIXUP_FUNC,
9026 .v.func = alc245_fixup_hp_gpio_led,
9027 },
1278cc5a
JS
9028 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9029 .type = HDA_FIXUP_PINS,
9030 .v.pins = (const struct hda_pintbl[]) {
9031 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9032 { }
9033 },
9034 .chained = true,
9035 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9036 },
174a7fb3
WS
9037 [ALC233_FIXUP_NO_AUDIO_JACK] = {
9038 .type = HDA_FIXUP_FUNC,
9039 .v.func = alc233_fixup_no_audio_jack,
9040 },
edca7cc4
WS
9041 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9042 .type = HDA_FIXUP_FUNC,
9043 .v.func = alc256_fixup_mic_no_presence_and_resume,
9044 .chained = true,
9045 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9046 },
d3dca026
LT
9047 [ALC287_FIXUP_LEGION_16ACHG6] = {
9048 .type = HDA_FIXUP_FUNC,
9049 .v.func = alc287_fixup_legion_16achg6_speakers,
9050 },
ae7abe36
SB
9051 [ALC287_FIXUP_CS35L41_I2C_2] = {
9052 .type = HDA_FIXUP_FUNC,
9053 .v.func = cs35l41_fixup_i2c_two,
a6ac60b3
HW
9054 .chained = true,
9055 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
ae7abe36 9056 },
b3fbe536
AC
9057 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9058 .type = HDA_FIXUP_FUNC,
9059 .v.func = cs35l41_fixup_i2c_two,
9060 .chained = true,
9061 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
ae7abe36 9062 },
07bcab93
LT
9063 [ALC245_FIXUP_CS35L41_SPI_2] = {
9064 .type = HDA_FIXUP_FUNC,
9065 .v.func = cs35l41_fixup_spi_two,
9066 },
ce18f905
KHF
9067 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9068 .type = HDA_FIXUP_FUNC,
9069 .v.func = cs35l41_fixup_spi_two,
9070 .chained = true,
9071 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9072 },
07bcab93
LT
9073 [ALC245_FIXUP_CS35L41_SPI_4] = {
9074 .type = HDA_FIXUP_FUNC,
9075 .v.func = cs35l41_fixup_spi_four,
9076 },
9077 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9078 .type = HDA_FIXUP_FUNC,
864cb14c 9079 .v.func = cs35l41_fixup_spi_four,
07bcab93 9080 .chained = true,
864cb14c 9081 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
07bcab93 9082 },
91502a9a
AS
9083 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9084 .type = HDA_FIXUP_VERBS,
9085 .v.verbs = (const struct hda_verb[]) {
9086 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9087 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9088 { }
9089 },
9090 .chained = true,
9091 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9092 },
1efcdd9c
GM
9093 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9094 .type = HDA_FIXUP_FUNC,
9095 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
9096 .chained = true,
9097 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9098 },
309d7363
DH
9099 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9100 .type = HDA_FIXUP_PINS,
9101 .v.pins = (const struct hda_pintbl[]) {
9102 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9103 { }
9104 },
9105 .chained = true,
9106 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9107 },
1e24881d
LT
9108 [ALC287_FIXUP_LEGION_16ITHG6] = {
9109 .type = HDA_FIXUP_FUNC,
9110 .v.func = alc287_fixup_legion_16ithg6_speakers,
9111 },
3790a3d6
PJ
9112 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9113 .type = HDA_FIXUP_VERBS,
9114 .v.verbs = (const struct hda_verb[]) {
9115 // enable left speaker
9116 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9117 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9118
9119 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9120 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9121 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9122 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9123 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9124
9125 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9126 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9127 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9128 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9129 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9130
9131 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9132 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9133 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9134 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9135 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9136
9137 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9138 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9139 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9140 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9141 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9142
9143 // enable right speaker
9144 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9145 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9146
9147 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9148 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9149 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9150 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9151 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9152
9153 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9154 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9155 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9156 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9157 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9158
9159 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9160 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9161 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9162 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9163 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9164
9165 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9166 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9167 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9168 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9169 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9170
9171 { },
9172 },
9173 },
9174 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9175 .type = HDA_FIXUP_FUNC,
9176 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9177 .chained = true,
9178 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9179 },
2912cdda
PJ
9180 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9181 .type = HDA_FIXUP_FUNC,
9182 .v.func = alc295_fixup_dell_inspiron_top_speakers,
9183 .chained = true,
9184 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9185 },
a4517c4f
CC
9186 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
9187 .type = HDA_FIXUP_PINS,
9188 .v.func = alc1220_fixup_gb_dual_codecs,
9189 .chained = true,
9190 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9191 },
f1d4e28b
KY
9192};
9193
1d045db9 9194static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 9195 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
9196 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9197 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 9198 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 9199 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
9200 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9201 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 9202 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 9203 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 9204 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 9205 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 9206 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 9207 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 9208 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 9209 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 9210 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 9211 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
9212 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9213 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
9214 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9215 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 9216 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 9217 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 9218 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 9219 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
667a8f73
JHP
9220 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9221 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9222 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 9223 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
5f3fe25e 9224 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
35171fbf 9225 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 9226 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 9227 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 9228 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
2a5bb694 9229 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 9230 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 9231 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 9232 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
6a28a25d 9233 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
aaedfb47 9234 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
841bdf85 9235 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
6ed1131f 9236 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 9237 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 9238 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
9239 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9240 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 9241 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
9242 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9243 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9244 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
9245 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9246 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 9247 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 9248 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 9249 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
9250 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9251 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 9252 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 9253 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 9254 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 9255 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
9256 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9257 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
9258 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9259 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9260 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9261 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9262 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 9263 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 9264 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 9265 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 9266 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 9267 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 9268 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 9269 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 9270 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
9271 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9272 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
9273 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9274 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 9275 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 9276 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 9277 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 9278 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 9279 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 9280 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
9281 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9282 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
9283 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9284 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
1efcdd9c 9285 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
c1e89523 9286 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 9287 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 9288 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
9289 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9290 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
15dad62f 9291 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
bdc9b739 9292 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
2912cdda
PJ
9293 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9294 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
a5751933 9295 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
a4517c4f
CC
9296 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9297 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9298 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9299 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9300 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9301 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
a22aa26f
KY
9302 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9303 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 9304 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 9305 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 9306 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 9307 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9308 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9309 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9310 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9311 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9312 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9313 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
9314 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9315 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9316 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9317 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 9318 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
9319 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9320 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9321 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9322 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9323 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 9324 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 9325 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 9326 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 9327 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9328 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9329 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9330 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9331 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9332 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9333 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9334 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9335 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 9336 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9337 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9338 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9339 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9340 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 9341 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9342 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9343 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9344 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9345 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9346 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9347 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9348 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9349 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9350 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9351 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9352 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9353 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9354 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9355 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9356 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
9357 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9358 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9359 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9360 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4ba5c853 9361 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
167897f4
JK
9362 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9363 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
9364 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9365 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
563785ed 9366 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
e549d190 9367 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 9368 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 9369 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
9370 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9371 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 9372 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 9373 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 9374 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
5d84b531 9375 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 9376 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 9377 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
d296a74b 9378 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 9379 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 9380 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
622464c8 9381 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
24df5428
IH
9382 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9383 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
ca88eeb3 9384 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
15d295b5 9385 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 9386 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 9387 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
c058493d 9388 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 9389 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 9390 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
05ec7161 9391 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 9392 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 9393 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
431e76c3 9394 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 9395 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
9396 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9397 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9398 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9399 ALC285_FIXUP_HP_GPIO_AMP_INIT),
30267718 9400 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
b2e6b3d9 9401 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
375f8426 9402 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
48422958 9403 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 9404 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 9405 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 9406 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 9407 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
9408 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9409 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 9410 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 9411 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
d07149ab 9412 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 9413 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
9414 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9415 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
53b861be 9416 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 9417 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 9418 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 9419 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
9420 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9421 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 9422 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 9423 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 9424 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
600dd2a7 9425 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
91502a9a 9426 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
0e68c4b1 9427 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 9428 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 9429 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
49632230 9430 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
f86bfeb6 9431 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
5f5d8890
AC
9432 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9433 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9434 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9435 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9436 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9437 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93
LT
9438 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9439 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9440 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9441 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9442 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9443 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9444 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
e6194c8d
AC
9445 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9446 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
024a7ad9 9447 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
e6194c8d
AC
9448 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9449 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
f86bfeb6 9450 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93 9451 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
ce18f905 9452 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
f7ac570d 9453 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9a6804aa 9454 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
5f3d696e 9455 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
61d30785
JS
9456 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9457 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9458 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9459 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
35a17444 9460 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
c578d5da
KHF
9461 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9462 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9251584a
AC
9463 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9464 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9465 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9466 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9467 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9468 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
1d8025ec
AC
9469 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9470 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9fdc1605 9471 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
6c4715aa
AC
9472 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9473 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
5007b848 9474 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
6c4715aa
AC
9475 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9476 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
9477 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
7bb62340 9478 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
858c5415 9479 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9c694fbf 9480 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
c1732ede 9481 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 9482 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 9483 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 9484 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 9485 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 9486 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3e0d611b 9487 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 9488 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 9489 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 9490 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
9491 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9492 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
e959f2be 9493 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
461122b9 9494 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
c1732ede 9495 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 9496 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
f882c4be 9497 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
c1732ede 9498 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 9499 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
23870831 9500 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
b16c8f22
TI
9501 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9502 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
3e0d611b 9503 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8eedd3a7 9504 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 9505 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
3cd0ed63 9506 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 9507 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
4963d66b 9508 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 9509 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
4fad4fb9 9510 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 9511 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 9512 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 9513 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 9514 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 9515 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
461122b9 9516 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1b94e59d 9517 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
693b613d 9518 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
615966ad 9519 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1 9520 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
bc2c2354 9521 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
c1732ede 9522 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
b16c8f22 9523 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ef9ce66f 9524 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
491a4ccd 9525 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),
4b43d05a 9526 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
7a17e842 9527 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
c1b55029 9528 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
c611e659 9529 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
76fae618 9530 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
ba1f8180 9531 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
293a92c1 9532 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8d06679b 9533 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
2ea8e129 9534 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 9535 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
adabb3ec
TI
9536 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9537 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9538 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9539 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 9540 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
9541 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9542 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9543 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 9544 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
9545 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9546 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 9547 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 9548 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 9549 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 9550 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 9551 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 9552 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 9553 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 9554 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 9555 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
4f2e56a5 9556 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
9557 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9558 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
0fca97a2 9559 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
a33cc48d 9560 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
a2d57ebe
KM
9561 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9562 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9563 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9564 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
b18a4563 9565 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
1abfd71e 9566 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
823ff161 9567 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
a2d57ebe
KM
9568 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9569 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
ef248d9b 9570 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
bd401fd7 9571 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
a86e79e3 9572 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
abaa2274
AA
9573 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9574 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 9575 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 9576 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
b5acfe15 9577 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 9578 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9579 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9580 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9581 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9582 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9583 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9584 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9585 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
be561ffa 9586 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9587 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9588 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9589 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
9590 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9591 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9592 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9593 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9594 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9595 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9596 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
9597 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9598 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9599 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 9600 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9601 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9602 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9603 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9604 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9605 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9606 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 9607 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9608 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9609 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9610 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9611 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9612 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9613 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
627ce0d6 9614 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
90d74fdb 9615 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11bea269 9616 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9617 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9618 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9619 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9620 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9621 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
9622 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9623 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9624 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9625 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9626 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 9627 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9cb72750 9628 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
86222af0 9629 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0c20fce1 9630 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9631 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
edca7cc4 9632 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
9633 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9634 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9635 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9636 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 9637 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9638 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9639 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
9640 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9641 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 9642 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9643 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9644 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9645 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9646 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9647 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9648 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 9649 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 9650 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
9651 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9652 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9653 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9654 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9655 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 9656 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 9657 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 9658 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 9659 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 9660 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 9661 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 9662 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 9663 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 9664 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 9665 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 9666 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 9667 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 9668 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 9669 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 9670 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 9671 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
9672 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9673 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 9674 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 9675 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9676 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9677 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9678 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 9679 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9680 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9681 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9682 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 9683 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 9684 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 9685 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
9686 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9687 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
ae7abe36
SB
9688 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9689 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9690 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
8eda19cd
SB
9691 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
9692 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
9693 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_CS35L41_I2C_2),
3694cb29 9694 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 9695 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 9696 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 9697 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 9698 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 9699 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 9700 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 9701 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
9702 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9703 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 9704 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
3790a3d6 9705 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
85743a84 9706 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
2aac550d 9707 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
56ec3e75 9708 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
2aac550d 9709 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
3b79954f 9710 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8f4c9042 9711 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
2aac550d 9712 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b81e9e5c 9713 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
c07f2c7b 9714 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 9715 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
d3dca026 9716 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
2aac550d 9717 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
9718 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9719 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1e24881d 9720 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
70cfdd03 9721 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
56f27013 9722 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 9723 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 9724 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 9725 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 9726 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 9727 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 9728 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 9729 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 9730 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 9731 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 9732 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 9733 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 9734 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 9735 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 9736 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 9737 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9738 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9739 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9740 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
264fb034 9741 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
cd5302c0 9742 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
9743 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9744 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 9745 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
52aad393 9746 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
174a7fb3 9747 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
79e28f2a 9748 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
0fbf21c3 9749 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
cbcdf8c4 9750 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
f1ec5be1
HC
9751 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9752 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9753 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 9754 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
9755 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9756 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
88d18b88 9757 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
619764cc 9758 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8b3b2392
WS
9759 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9760 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9761 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9762 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9763 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9764 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9765 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9766 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
fc19d559 9767 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 9768 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 9769 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9b043a8f 9770 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 9771 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
d1ee66c5 9772 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 9773 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 9774 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
309d7363 9775 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
a4297b5d 9776
a7f3eedc 9777#if 0
a4297b5d
TI
9778 /* Below is a quirk table taken from the old code.
9779 * Basically the device should work as is without the fixup table.
9780 * If BIOS doesn't give a proper info, enable the corresponding
9781 * fixup entry.
7d7eb9ea 9782 */
a4297b5d
TI
9783 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9784 ALC269_FIXUP_AMIC),
9785 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
9786 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9787 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9788 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9789 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9790 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9791 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9792 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9793 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9794 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9795 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9796 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9797 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9798 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9799 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9800 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9801 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9802 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9803 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9804 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9805 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9806 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9807 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9808 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9809 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9810 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9811 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9812 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9813 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9814 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9815 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9816 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9817 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9818 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9819 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9820 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9821 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9822 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9823 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9824#endif
9825 {}
9826};
9827
214eef76
DH
9828static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9829 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9830 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9831 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9832 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 9833 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
9834 {}
9835};
9836
1727a771 9837static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
9838 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9839 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
9840 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9841 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9842 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 9843 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
9844 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9845 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 9846 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 9847 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 9848 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 9849 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
9850 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9851 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
9852 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9853 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 9854 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 9855 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 9856 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 9857 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 9858 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 9859 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 9860 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 9861 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 9862 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
9863 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9864 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9865 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9866 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9867 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9868 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9869 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9870 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9871 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9872 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9873 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9874 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9875 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9876 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9877 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9878 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9879 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9880 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9881 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9882 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9883 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9884 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9885 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9886 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9887 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9888 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9889 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9890 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9891 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9892 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9893 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9894 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9895 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9896 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9897 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9898 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9899 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9900 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9901 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9902 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 9903 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 9904 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 9905 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
9906 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9907 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9908 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9909 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9910 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9911 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9912 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9913 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9914 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9915 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9916 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9917 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9918 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9919 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
9920 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9921 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9922 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 9923 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 9924 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 9925 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
9926 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9927 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9928 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9929 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9930 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9931 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9932 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9933 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9934 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9935 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9936 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9937 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9938 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9939 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9940 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9941 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9942 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
9943 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9944 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 9945 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 9946 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 9947 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
a2d57ebe 9948 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
ef248d9b 9949 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
fc19d559 9950 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 9951 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 9952 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 9953 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 9954 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 9955 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9ebaef05 9956 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
3790a3d6 9957 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
29c8f40b 9958 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 9959 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
aa723946 9960 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 9961 {}
6dda9f4a 9962};
cfc5a845 9963#define ALC225_STANDARD_PINS \
cfc5a845 9964 {0x21, 0x04211020}
6dda9f4a 9965
e8191a8e
HW
9966#define ALC256_STANDARD_PINS \
9967 {0x12, 0x90a60140}, \
9968 {0x14, 0x90170110}, \
e8191a8e
HW
9969 {0x21, 0x02211020}
9970
fea185e2 9971#define ALC282_STANDARD_PINS \
11580297 9972 {0x14, 0x90170110}
e1e62b98 9973
fea185e2 9974#define ALC290_STANDARD_PINS \
11580297 9975 {0x12, 0x99a30130}
fea185e2
DH
9976
9977#define ALC292_STANDARD_PINS \
9978 {0x14, 0x90170110}, \
11580297 9979 {0x15, 0x0221401f}
977e6276 9980
3f640970
HW
9981#define ALC295_STANDARD_PINS \
9982 {0x12, 0xb7a60130}, \
9983 {0x14, 0x90170110}, \
3f640970
HW
9984 {0x21, 0x04211020}
9985
703867e2
WS
9986#define ALC298_STANDARD_PINS \
9987 {0x12, 0x90a60130}, \
9988 {0x21, 0x03211020}
9989
e1918938 9990static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
9991 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9992 {0x14, 0x01014020},
9993 {0x17, 0x90170110},
9994 {0x18, 0x02a11030},
9995 {0x19, 0x0181303F},
9996 {0x21, 0x0221102f}),
5824ce8d
CC
9997 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9998 {0x12, 0x90a601c0},
9999 {0x14, 0x90171120},
10000 {0x21, 0x02211030}),
615966ad
CC
10001 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10002 {0x14, 0x90170110},
10003 {0x1b, 0x90a70130},
10004 {0x21, 0x03211020}),
10005 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10006 {0x1a, 0x90a70130},
10007 {0x1b, 0x90170110},
10008 {0x21, 0x03211020}),
2ae95577 10009 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10010 ALC225_STANDARD_PINS,
8a132099 10011 {0x12, 0xb7a60130},
cfc5a845 10012 {0x14, 0x901701a0}),
2ae95577 10013 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10014 ALC225_STANDARD_PINS,
8a132099 10015 {0x12, 0xb7a60130},
cfc5a845 10016 {0x14, 0x901701b0}),
8a132099
HW
10017 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10018 ALC225_STANDARD_PINS,
10019 {0x12, 0xb7a60150},
10020 {0x14, 0x901701a0}),
10021 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10022 ALC225_STANDARD_PINS,
10023 {0x12, 0xb7a60150},
10024 {0x14, 0x901701b0}),
10025 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10026 ALC225_STANDARD_PINS,
10027 {0x12, 0xb7a60130},
10028 {0x1b, 0x90170110}),
0ce48e17
KHF
10029 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10030 {0x1b, 0x01111010},
10031 {0x1e, 0x01451130},
10032 {0x21, 0x02211020}),
986376b6
HW
10033 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10034 {0x12, 0x90a60140},
10035 {0x14, 0x90170110},
10036 {0x19, 0x02a11030},
10037 {0x21, 0x02211020}),
e41fc8c5
HW
10038 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10039 {0x14, 0x90170110},
10040 {0x19, 0x02a11030},
10041 {0x1a, 0x02a11040},
10042 {0x1b, 0x01014020},
10043 {0x21, 0x0221101f}),
d06fb562
HW
10044 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10045 {0x14, 0x90170110},
10046 {0x19, 0x02a11030},
10047 {0x1a, 0x02a11040},
10048 {0x1b, 0x01011020},
10049 {0x21, 0x0221101f}),
c6b17f10
HW
10050 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10051 {0x14, 0x90170110},
10052 {0x19, 0x02a11020},
10053 {0x1a, 0x02a11030},
10054 {0x21, 0x0221101f}),
92666d45
KY
10055 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10056 {0x21, 0x02211010}),
9e885770
KY
10057 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10058 {0x14, 0x90170110},
10059 {0x19, 0x02a11020},
10060 {0x21, 0x02211030}),
c77900e6 10061 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 10062 {0x14, 0x90170110},
c77900e6 10063 {0x21, 0x02211020}),
86c72d1c
HW
10064 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10065 {0x14, 0x90170130},
10066 {0x21, 0x02211040}),
76c2132e
DH
10067 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10068 {0x12, 0x90a60140},
10069 {0x14, 0x90170110},
76c2132e
DH
10070 {0x21, 0x02211020}),
10071 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10072 {0x12, 0x90a60160},
10073 {0x14, 0x90170120},
76c2132e 10074 {0x21, 0x02211030}),
392c9da2
HW
10075 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10076 {0x14, 0x90170110},
10077 {0x1b, 0x02011020},
10078 {0x21, 0x0221101f}),
6aecd871
HW
10079 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10080 {0x14, 0x90170110},
10081 {0x1b, 0x01011020},
10082 {0x21, 0x0221101f}),
cba59972 10083 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 10084 {0x14, 0x90170130},
cba59972 10085 {0x1b, 0x01014020},
cba59972 10086 {0x21, 0x0221103f}),
6aecd871
HW
10087 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10088 {0x14, 0x90170130},
10089 {0x1b, 0x01011020},
10090 {0x21, 0x0221103f}),
59ec4b57
HW
10091 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10092 {0x14, 0x90170130},
10093 {0x1b, 0x02011020},
10094 {0x21, 0x0221103f}),
e9c28e16 10095 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10096 {0x14, 0x90170150},
e9c28e16 10097 {0x1b, 0x02011020},
e9c28e16
WS
10098 {0x21, 0x0221105f}),
10099 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10100 {0x14, 0x90170110},
e9c28e16 10101 {0x1b, 0x01014020},
e9c28e16 10102 {0x21, 0x0221101f}),
76c2132e
DH
10103 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10104 {0x12, 0x90a60160},
10105 {0x14, 0x90170120},
10106 {0x17, 0x90170140},
76c2132e
DH
10107 {0x21, 0x0321102f}),
10108 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10109 {0x12, 0x90a60160},
10110 {0x14, 0x90170130},
76c2132e
DH
10111 {0x21, 0x02211040}),
10112 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10113 {0x12, 0x90a60160},
10114 {0x14, 0x90170140},
76c2132e
DH
10115 {0x21, 0x02211050}),
10116 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10117 {0x12, 0x90a60170},
10118 {0x14, 0x90170120},
76c2132e
DH
10119 {0x21, 0x02211030}),
10120 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10121 {0x12, 0x90a60170},
10122 {0x14, 0x90170130},
76c2132e 10123 {0x21, 0x02211040}),
0a1f90a9
HW
10124 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10125 {0x12, 0x90a60170},
10126 {0x14, 0x90171130},
10127 {0x21, 0x02211040}),
70658b99 10128 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
10129 {0x12, 0x90a60170},
10130 {0x14, 0x90170140},
70658b99 10131 {0x21, 0x02211050}),
9b5a4e39 10132 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
10133 {0x12, 0x90a60180},
10134 {0x14, 0x90170130},
9b5a4e39 10135 {0x21, 0x02211040}),
f90d83b3
AK
10136 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10137 {0x12, 0x90a60180},
10138 {0x14, 0x90170120},
10139 {0x21, 0x02211030}),
989dbe4a
HW
10140 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10141 {0x1b, 0x01011020},
10142 {0x21, 0x02211010}),
c1732ede
CC
10143 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10144 {0x14, 0x90170110},
10145 {0x1b, 0x90a70130},
10146 {0x21, 0x04211020}),
10147 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10148 {0x14, 0x90170110},
10149 {0x1b, 0x90a70130},
10150 {0x21, 0x03211020}),
a806ef1c
CC
10151 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10152 {0x12, 0x90a60130},
10153 {0x14, 0x90170110},
10154 {0x21, 0x03211020}),
6ac371aa
JHP
10155 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10156 {0x12, 0x90a60130},
10157 {0x14, 0x90170110},
10158 {0x21, 0x04211020}),
e1037354
JHP
10159 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10160 {0x1a, 0x90a70130},
10161 {0x1b, 0x90170110},
10162 {0x21, 0x03211020}),
9e885770
KY
10163 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10164 {0x14, 0x90170110},
10165 {0x19, 0x02a11020},
10166 {0x21, 0x0221101f}),
8a8de09c
KY
10167 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10168 {0x17, 0x90170110},
10169 {0x19, 0x03a11030},
10170 {0x21, 0x03211020}),
cf51eb9d
DH
10171 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10172 {0x12, 0x90a60130},
cf51eb9d
DH
10173 {0x14, 0x90170110},
10174 {0x15, 0x0421101f},
11580297 10175 {0x1a, 0x04a11020}),
0279661b
HW
10176 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10177 {0x12, 0x90a60140},
0279661b
HW
10178 {0x14, 0x90170110},
10179 {0x15, 0x0421101f},
0279661b 10180 {0x18, 0x02811030},
0279661b 10181 {0x1a, 0x04a1103f},
11580297 10182 {0x1b, 0x02011020}),
42304474 10183 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10184 ALC282_STANDARD_PINS,
42304474 10185 {0x12, 0x99a30130},
42304474 10186 {0x19, 0x03a11020},
42304474 10187 {0x21, 0x0321101f}),
2c609999 10188 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10189 ALC282_STANDARD_PINS,
2c609999 10190 {0x12, 0x99a30130},
2c609999 10191 {0x19, 0x03a11020},
2c609999
HW
10192 {0x21, 0x03211040}),
10193 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10194 ALC282_STANDARD_PINS,
2c609999 10195 {0x12, 0x99a30130},
2c609999 10196 {0x19, 0x03a11030},
2c609999
HW
10197 {0x21, 0x03211020}),
10198 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10199 ALC282_STANDARD_PINS,
2c609999 10200 {0x12, 0x99a30130},
2c609999 10201 {0x19, 0x04a11020},
2c609999 10202 {0x21, 0x0421101f}),
200afc09 10203 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 10204 ALC282_STANDARD_PINS,
200afc09 10205 {0x12, 0x90a60140},
200afc09 10206 {0x19, 0x04a11030},
200afc09 10207 {0x21, 0x04211020}),
34cdf405
CC
10208 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10209 ALC282_STANDARD_PINS,
10210 {0x12, 0x90a609c0},
10211 {0x18, 0x03a11830},
10212 {0x19, 0x04a19831},
10213 {0x1a, 0x0481303f},
10214 {0x1b, 0x04211020},
10215 {0x21, 0x0321101f}),
10216 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10217 ALC282_STANDARD_PINS,
10218 {0x12, 0x90a60940},
10219 {0x18, 0x03a11830},
10220 {0x19, 0x04a19831},
10221 {0x1a, 0x0481303f},
10222 {0x1b, 0x04211020},
10223 {0x21, 0x0321101f}),
76c2132e 10224 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10225 ALC282_STANDARD_PINS,
76c2132e 10226 {0x12, 0x90a60130},
76c2132e
DH
10227 {0x21, 0x0321101f}),
10228 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10229 {0x12, 0x90a60160},
10230 {0x14, 0x90170120},
76c2132e 10231 {0x21, 0x02211030}),
bc262179 10232 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10233 ALC282_STANDARD_PINS,
bc262179 10234 {0x12, 0x90a60130},
bc262179 10235 {0x19, 0x03a11020},
bc262179 10236 {0x21, 0x0321101f}),
c8c6ee61 10237 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
10238 {0x12, 0x90a60130},
10239 {0x14, 0x90170110},
10240 {0x19, 0x04a11040},
10241 {0x21, 0x04211020}),
10242 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10243 {0x14, 0x90170110},
10244 {0x19, 0x04a11040},
10245 {0x1d, 0x40600001},
10246 {0x21, 0x04211020}),
10247 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
10248 {0x14, 0x90170110},
10249 {0x19, 0x04a11040},
10250 {0x21, 0x04211020}),
c72b9bfe
HW
10251 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10252 {0x14, 0x90170110},
10253 {0x17, 0x90170111},
10254 {0x19, 0x03a11030},
10255 {0x21, 0x03211020}),
33aaebd4
CC
10256 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10257 {0x12, 0x90a60130},
10258 {0x17, 0x90170110},
10259 {0x21, 0x02211020}),
d44a6864 10260 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 10261 {0x12, 0x90a60120},
e1e62b98 10262 {0x14, 0x90170110},
e1e62b98 10263 {0x21, 0x0321101f}),
e4442bcf 10264 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10265 ALC290_STANDARD_PINS,
e4442bcf 10266 {0x15, 0x04211040},
e4442bcf 10267 {0x18, 0x90170112},
11580297 10268 {0x1a, 0x04a11020}),
e4442bcf 10269 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10270 ALC290_STANDARD_PINS,
e4442bcf 10271 {0x15, 0x04211040},
e4442bcf 10272 {0x18, 0x90170110},
11580297 10273 {0x1a, 0x04a11020}),
e4442bcf 10274 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10275 ALC290_STANDARD_PINS,
e4442bcf 10276 {0x15, 0x0421101f},
11580297 10277 {0x1a, 0x04a11020}),
e4442bcf 10278 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10279 ALC290_STANDARD_PINS,
e4442bcf 10280 {0x15, 0x04211020},
11580297 10281 {0x1a, 0x04a11040}),
e4442bcf 10282 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10283 ALC290_STANDARD_PINS,
e4442bcf
HW
10284 {0x14, 0x90170110},
10285 {0x15, 0x04211020},
11580297 10286 {0x1a, 0x04a11040}),
e4442bcf 10287 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10288 ALC290_STANDARD_PINS,
e4442bcf
HW
10289 {0x14, 0x90170110},
10290 {0x15, 0x04211020},
11580297 10291 {0x1a, 0x04a11020}),
e4442bcf 10292 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10293 ALC290_STANDARD_PINS,
e4442bcf
HW
10294 {0x14, 0x90170110},
10295 {0x15, 0x0421101f},
11580297 10296 {0x1a, 0x04a11020}),
e8818fa8 10297 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10298 ALC292_STANDARD_PINS,
e8818fa8 10299 {0x12, 0x90a60140},
e8818fa8 10300 {0x16, 0x01014020},
11580297 10301 {0x19, 0x01a19030}),
e8818fa8 10302 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10303 ALC292_STANDARD_PINS,
e8818fa8 10304 {0x12, 0x90a60140},
e8818fa8
HW
10305 {0x16, 0x01014020},
10306 {0x18, 0x02a19031},
11580297 10307 {0x19, 0x01a1903e}),
76c2132e 10308 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 10309 ALC292_STANDARD_PINS,
11580297 10310 {0x12, 0x90a60140}),
76c2132e 10311 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10312 ALC292_STANDARD_PINS,
76c2132e 10313 {0x13, 0x90a60140},
76c2132e 10314 {0x16, 0x21014020},
11580297 10315 {0x19, 0x21a19030}),
e03fdbde 10316 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10317 ALC292_STANDARD_PINS,
11580297 10318 {0x13, 0x90a60140}),
eeacd80f
JHP
10319 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10320 {0x17, 0x90170110},
10321 {0x21, 0x04211020}),
d8ae458e
CC
10322 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10323 {0x14, 0x90170110},
10324 {0x1b, 0x90a70130},
10325 {0x21, 0x04211020}),
8bb37a2a
JHP
10326 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10327 {0x12, 0x90a60130},
10328 {0x17, 0x90170110},
10329 {0x21, 0x03211020}),
0bea4cc8
JHP
10330 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10331 {0x12, 0x90a60130},
10332 {0x17, 0x90170110},
10333 {0x21, 0x04211020}),
3887c26c
TI
10334 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10335 {0x12, 0x90a60130},
10336 {0x17, 0x90170110},
10337 {0x21, 0x03211020}),
9e43342b 10338 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
10339 {0x12, 0x90a60120},
10340 {0x17, 0x90170110},
10341 {0x21, 0x04211030}),
10342 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
10343 {0x12, 0x90a60130},
10344 {0x17, 0x90170110},
10345 {0x21, 0x03211020}),
10346 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10347 {0x12, 0x90a60130},
10348 {0x17, 0x90170110},
10349 {0x21, 0x03211020}),
fbc57129 10350 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
0a29c57b
KY
10351 {0x14, 0x90170110},
10352 {0x21, 0x04211020}),
fbc57129
KY
10353 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10354 {0x14, 0x90170110},
10355 {0x21, 0x04211030}),
3f640970 10356 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
f771d5bb
HW
10357 ALC295_STANDARD_PINS,
10358 {0x17, 0x21014020},
10359 {0x18, 0x21a19030}),
10360 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10361 ALC295_STANDARD_PINS,
10362 {0x17, 0x21014040},
10363 {0x18, 0x21a19050}),
3f307834
HW
10364 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10365 ALC295_STANDARD_PINS),
9f502ff5
TI
10366 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10367 ALC298_STANDARD_PINS,
10368 {0x17, 0x90170110}),
977e6276 10369 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
10370 ALC298_STANDARD_PINS,
10371 {0x17, 0x90170140}),
10372 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10373 ALC298_STANDARD_PINS,
9f502ff5 10374 {0x17, 0x90170150}),
9f1bc2c4
KHF
10375 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10376 {0x12, 0xb7a60140},
10377 {0x13, 0xb7a60150},
10378 {0x17, 0x90170110},
10379 {0x1a, 0x03011020},
10380 {0x21, 0x03211030}),
54324221
JM
10381 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10382 {0x12, 0xb7a60140},
10383 {0x17, 0x90170110},
10384 {0x1a, 0x03a11030},
10385 {0x21, 0x03211020}),
fcc6c877
KY
10386 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10387 ALC225_STANDARD_PINS,
10388 {0x12, 0xb7a60130},
fcc6c877 10389 {0x17, 0x90170110}),
573fcbfd
HW
10390 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10391 {0x14, 0x01014010},
10392 {0x17, 0x90170120},
10393 {0x18, 0x02a11030},
10394 {0x19, 0x02a1103f},
10395 {0x21, 0x0221101f}),
e1918938
HW
10396 {}
10397};
6dda9f4a 10398
7c0a6939
HW
10399/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10400 * more machines, don't need to match all valid pins, just need to match
10401 * all the pins defined in the tbl. Just because of this reason, it is possible
10402 * that a single machine matches multiple tbls, so there is one limitation:
10403 * at most one tbl is allowed to define for the same vendor and same codec
10404 */
10405static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10406 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10407 {0x19, 0x40000000},
10408 {0x1b, 0x40000000}),
aed8c7f4
HW
10409 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10410 {0x19, 0x40000000},
10411 {0x1a, 0x40000000}),
d64ebdbf
HW
10412 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10413 {0x19, 0x40000000},
10414 {0x1a, 0x40000000}),
5815bdfd
HW
10415 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
10416 {0x19, 0x40000000},
10417 {0x1a, 0x40000000}),
7c0a6939
HW
10418 {}
10419};
10420
546bb678 10421static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 10422{
526af6eb 10423 struct alc_spec *spec = codec->spec;
1d045db9 10424 int val;
ebb83eeb 10425
526af6eb 10426 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 10427 return;
526af6eb 10428
1bb7e43e 10429 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
10430 alc_write_coef_idx(codec, 0xf, 0x960b);
10431 alc_write_coef_idx(codec, 0xe, 0x8817);
10432 }
ebb83eeb 10433
1bb7e43e 10434 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
10435 alc_write_coef_idx(codec, 0xf, 0x960b);
10436 alc_write_coef_idx(codec, 0xe, 0x8814);
10437 }
ebb83eeb 10438
1bb7e43e 10439 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 10440 /* Power up output pin */
98b24883 10441 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 10442 }
ebb83eeb 10443
1bb7e43e 10444 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 10445 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 10446 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
10447 /* Capless ramp up clock control */
10448 alc_write_coef_idx(codec, 0xd, val | (1<<10));
10449 }
10450 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 10451 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
10452 /* Class D power on reset */
10453 alc_write_coef_idx(codec, 0x17, val | (1<<7));
10454 }
10455 }
ebb83eeb 10456
98b24883
TI
10457 /* HP */
10458 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 10459}
a7f2371f 10460
1d045db9
TI
10461/*
10462 */
1d045db9
TI
10463static int patch_alc269(struct hda_codec *codec)
10464{
10465 struct alc_spec *spec;
3de95173 10466 int err;
f1d4e28b 10467
3de95173 10468 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 10469 if (err < 0)
3de95173
TI
10470 return err;
10471
10472 spec = codec->spec;
08c189f2 10473 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 10474 codec->power_save_node = 0;
e16fb6d1 10475
225068ab
TI
10476#ifdef CONFIG_PM
10477 codec->patch_ops.suspend = alc269_suspend;
10478 codec->patch_ops.resume = alc269_resume;
10479#endif
c2d6af53
KY
10480 spec->shutup = alc_default_shutup;
10481 spec->init_hook = alc_default_init;
225068ab 10482
7639a06c 10483 switch (codec->core.vendor_id) {
065380f0 10484 case 0x10ec0269:
1d045db9 10485 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
10486 switch (alc_get_coef0(codec) & 0x00f0) {
10487 case 0x0010:
5100cd07
TI
10488 if (codec->bus->pci &&
10489 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 10490 spec->cdefine.platform_type == 1)
20ca0c35 10491 err = alc_codec_rename(codec, "ALC271X");
1d045db9 10492 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
10493 break;
10494 case 0x0020:
5100cd07
TI
10495 if (codec->bus->pci &&
10496 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 10497 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 10498 err = alc_codec_rename(codec, "ALC3202");
1d045db9 10499 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 10500 break;
adcc70b2
KY
10501 case 0x0030:
10502 spec->codec_variant = ALC269_TYPE_ALC269VD;
10503 break;
1bb7e43e 10504 default:
1d045db9 10505 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 10506 }
e16fb6d1
TI
10507 if (err < 0)
10508 goto error;
c2d6af53 10509 spec->shutup = alc269_shutup;
546bb678 10510 spec->init_hook = alc269_fill_coef;
1d045db9 10511 alc269_fill_coef(codec);
065380f0
KY
10512 break;
10513
10514 case 0x10ec0280:
10515 case 0x10ec0290:
10516 spec->codec_variant = ALC269_TYPE_ALC280;
10517 break;
10518 case 0x10ec0282:
065380f0 10519 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
10520 spec->shutup = alc282_shutup;
10521 spec->init_hook = alc282_init;
065380f0 10522 break;
2af02be7
KY
10523 case 0x10ec0233:
10524 case 0x10ec0283:
10525 spec->codec_variant = ALC269_TYPE_ALC283;
10526 spec->shutup = alc283_shutup;
10527 spec->init_hook = alc283_init;
10528 break;
065380f0
KY
10529 case 0x10ec0284:
10530 case 0x10ec0292:
10531 spec->codec_variant = ALC269_TYPE_ALC284;
10532 break;
161ebf29 10533 case 0x10ec0293:
4731d5de 10534 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 10535 break;
7fc7d047 10536 case 0x10ec0286:
7c665932 10537 case 0x10ec0288:
7fc7d047
KY
10538 spec->codec_variant = ALC269_TYPE_ALC286;
10539 break;
506b62c3
KY
10540 case 0x10ec0298:
10541 spec->codec_variant = ALC269_TYPE_ALC298;
10542 break;
ea04a1db 10543 case 0x10ec0235:
1d04c9de
KY
10544 case 0x10ec0255:
10545 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
10546 spec->shutup = alc256_shutup;
10547 spec->init_hook = alc256_init;
1d04c9de 10548 break;
1948fc06 10549 case 0x10ec0230:
736f20a7 10550 case 0x10ec0236:
4344aec8 10551 case 0x10ec0256:
527f4643 10552 case 0x19e58326:
4344aec8 10553 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
10554 spec->shutup = alc256_shutup;
10555 spec->init_hook = alc256_init;
7d1b6e29 10556 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
4344aec8 10557 break;
f429e7e4
KY
10558 case 0x10ec0257:
10559 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
10560 spec->shutup = alc256_shutup;
10561 spec->init_hook = alc256_init;
f429e7e4
KY
10562 spec->gen.mixer_nid = 0;
10563 break;
0a6f0600 10564 case 0x10ec0215:
7fbdcd83 10565 case 0x10ec0245:
0a6f0600
KY
10566 case 0x10ec0285:
10567 case 0x10ec0289:
60571929
KY
10568 if (alc_get_coef0(codec) & 0x0010)
10569 spec->codec_variant = ALC269_TYPE_ALC245;
10570 else
10571 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
10572 spec->shutup = alc225_shutup;
10573 spec->init_hook = alc225_init;
0a6f0600
KY
10574 spec->gen.mixer_nid = 0;
10575 break;
4231430d 10576 case 0x10ec0225:
7d727869 10577 case 0x10ec0295:
28f1f9b2 10578 case 0x10ec0299:
4231430d 10579 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
10580 spec->shutup = alc225_shutup;
10581 spec->init_hook = alc225_init;
c1350bff 10582 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 10583 break;
99cee034
KY
10584 case 0x10ec0287:
10585 spec->codec_variant = ALC269_TYPE_ALC287;
10586 spec->shutup = alc225_shutup;
10587 spec->init_hook = alc225_init;
10588 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10589 break;
dcd4f0db
KY
10590 case 0x10ec0234:
10591 case 0x10ec0274:
10592 case 0x10ec0294:
10593 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 10594 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 10595 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 10596 spec->init_hook = alc294_init;
dcd4f0db 10597 break;
1078bef0
KY
10598 case 0x10ec0300:
10599 spec->codec_variant = ALC269_TYPE_ALC300;
10600 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 10601 break;
f0778871
KY
10602 case 0x10ec0623:
10603 spec->codec_variant = ALC269_TYPE_ALC623;
10604 break;
6fbae35a
KY
10605 case 0x10ec0700:
10606 case 0x10ec0701:
10607 case 0x10ec0703:
83629532 10608 case 0x10ec0711:
6fbae35a
KY
10609 spec->codec_variant = ALC269_TYPE_ALC700;
10610 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 10611 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 10612 spec->init_hook = alc294_init;
6fbae35a
KY
10613 break;
10614
1d045db9 10615 }
6dda9f4a 10616
ad60d502 10617 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 10618 spec->has_alc5505_dsp = 1;
ad60d502
KY
10619 spec->init_hook = alc5505_dsp_init;
10620 }
10621
c9af753f
TI
10622 alc_pre_init(codec);
10623
efe55732
TI
10624 snd_hda_pick_fixup(codec, alc269_fixup_models,
10625 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
10626 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10627 * the quirk breaks the latter (bko#214101).
10628 * Clear the wrong entry.
10629 */
10630 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10631 codec->core.vendor_id == 0x10ec0294) {
10632 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10633 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10634 }
10635
0fc1e447 10636 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 10637 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
10638 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10639 alc269_fixups);
10640 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10641
10642 alc_auto_parse_customize_define(codec);
10643
10644 if (has_cdefine_beep(codec))
10645 spec->gen.beep_nid = 0x01;
10646
a4297b5d
TI
10647 /* automatic parse from the BIOS config */
10648 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
10649 if (err < 0)
10650 goto error;
6dda9f4a 10651
fea80fae
TI
10652 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10653 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10654 if (err < 0)
10655 goto error;
10656 }
f1d4e28b 10657
1727a771 10658 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10659
1d045db9 10660 return 0;
e16fb6d1
TI
10661
10662 error:
10663 alc_free(codec);
10664 return err;
1d045db9 10665}
f1d4e28b 10666
1d045db9
TI
10667/*
10668 * ALC861
10669 */
622e84cd 10670
1d045db9 10671static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 10672{
1d045db9 10673 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10674 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10675 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
10676}
10677
1d045db9
TI
10678/* Pin config fixes */
10679enum {
e652f4c8
TI
10680 ALC861_FIXUP_FSC_AMILO_PI1505,
10681 ALC861_FIXUP_AMP_VREF_0F,
10682 ALC861_FIXUP_NO_JACK_DETECT,
10683 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 10684 ALC660_FIXUP_ASUS_W7J,
1d045db9 10685};
7085ec12 10686
31150f23
TI
10687/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10688static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 10689 const struct hda_fixup *fix, int action)
31150f23
TI
10690{
10691 struct alc_spec *spec = codec->spec;
10692 unsigned int val;
10693
1727a771 10694 if (action != HDA_FIXUP_ACT_INIT)
31150f23 10695 return;
d3f02d60 10696 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
10697 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10698 val |= AC_PINCTL_IN_EN;
10699 val |= AC_PINCTL_VREF_50;
cdd03ced 10700 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 10701 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
10702}
10703
e652f4c8
TI
10704/* suppress the jack-detection */
10705static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 10706 const struct hda_fixup *fix, int action)
e652f4c8 10707{
1727a771 10708 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 10709 codec->no_jack_detect = 1;
7d7eb9ea 10710}
e652f4c8 10711
1727a771 10712static const struct hda_fixup alc861_fixups[] = {
e652f4c8 10713 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
10714 .type = HDA_FIXUP_PINS,
10715 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
10716 { 0x0b, 0x0221101f }, /* HP */
10717 { 0x0f, 0x90170310 }, /* speaker */
10718 { }
10719 }
10720 },
e652f4c8 10721 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 10722 .type = HDA_FIXUP_FUNC,
31150f23 10723 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 10724 },
e652f4c8 10725 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 10726 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10727 .v.func = alc_fixup_no_jack_detect,
10728 },
10729 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 10730 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10731 .v.func = alc861_fixup_asus_amp_vref_0f,
10732 .chained = true,
10733 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
10734 },
10735 [ALC660_FIXUP_ASUS_W7J] = {
10736 .type = HDA_FIXUP_VERBS,
10737 .v.verbs = (const struct hda_verb[]) {
10738 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10739 * for enabling outputs
10740 */
10741 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10742 { }
10743 },
e652f4c8 10744 }
1d045db9 10745};
7085ec12 10746
1d045db9 10747static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 10748 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 10749 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
10750 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10751 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10752 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 10753 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 10754 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
10755 {}
10756};
3af9ee6b 10757
1d045db9
TI
10758/*
10759 */
1d045db9 10760static int patch_alc861(struct hda_codec *codec)
7085ec12 10761{
1d045db9 10762 struct alc_spec *spec;
1d045db9 10763 int err;
7085ec12 10764
3de95173
TI
10765 err = alc_alloc_spec(codec, 0x15);
10766 if (err < 0)
10767 return err;
1d045db9 10768
3de95173 10769 spec = codec->spec;
2722b535
TI
10770 if (has_cdefine_beep(codec))
10771 spec->gen.beep_nid = 0x23;
1d045db9 10772
225068ab
TI
10773#ifdef CONFIG_PM
10774 spec->power_hook = alc_power_eapd;
10775#endif
10776
c9af753f
TI
10777 alc_pre_init(codec);
10778
1727a771
TI
10779 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10780 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 10781
cb4e4824
TI
10782 /* automatic parse from the BIOS config */
10783 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
10784 if (err < 0)
10785 goto error;
3af9ee6b 10786
fea80fae
TI
10787 if (!spec->gen.no_analog) {
10788 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10789 if (err < 0)
10790 goto error;
10791 }
7085ec12 10792
1727a771 10793 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10794
1d045db9 10795 return 0;
e16fb6d1
TI
10796
10797 error:
10798 alc_free(codec);
10799 return err;
7085ec12
TI
10800}
10801
1d045db9
TI
10802/*
10803 * ALC861-VD support
10804 *
10805 * Based on ALC882
10806 *
10807 * In addition, an independent DAC
10808 */
1d045db9 10809static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 10810{
1d045db9 10811 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10812 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10813 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
10814}
10815
1d045db9 10816enum {
8fdcb6fe
TI
10817 ALC660VD_FIX_ASUS_GPIO1,
10818 ALC861VD_FIX_DALLAS,
1d045db9 10819};
ce764ab2 10820
8fdcb6fe
TI
10821/* exclude VREF80 */
10822static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 10823 const struct hda_fixup *fix, int action)
8fdcb6fe 10824{
1727a771 10825 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
10826 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10827 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
10828 }
10829}
10830
df73d83f
TI
10831/* reset GPIO1 */
10832static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10833 const struct hda_fixup *fix, int action)
10834{
10835 struct alc_spec *spec = codec->spec;
10836
10837 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10838 spec->gpio_mask |= 0x02;
10839 alc_fixup_gpio(codec, action, 0x01);
10840}
10841
1727a771 10842static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 10843 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
10844 .type = HDA_FIXUP_FUNC,
10845 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 10846 },
8fdcb6fe 10847 [ALC861VD_FIX_DALLAS] = {
1727a771 10848 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
10849 .v.func = alc861vd_fixup_dallas,
10850 },
1d045db9 10851};
ce764ab2 10852
1d045db9 10853static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 10854 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 10855 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 10856 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
10857 {}
10858};
ce764ab2 10859
1d045db9
TI
10860/*
10861 */
1d045db9 10862static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 10863{
1d045db9 10864 struct alc_spec *spec;
cb4e4824 10865 int err;
ce764ab2 10866
3de95173
TI
10867 err = alc_alloc_spec(codec, 0x0b);
10868 if (err < 0)
10869 return err;
1d045db9 10870
3de95173 10871 spec = codec->spec;
2722b535
TI
10872 if (has_cdefine_beep(codec))
10873 spec->gen.beep_nid = 0x23;
1d045db9 10874
225068ab
TI
10875 spec->shutup = alc_eapd_shutup;
10876
c9af753f
TI
10877 alc_pre_init(codec);
10878
1727a771
TI
10879 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10880 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 10881
cb4e4824
TI
10882 /* automatic parse from the BIOS config */
10883 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
10884 if (err < 0)
10885 goto error;
ce764ab2 10886
fea80fae
TI
10887 if (!spec->gen.no_analog) {
10888 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10889 if (err < 0)
10890 goto error;
10891 }
1d045db9 10892
1727a771 10893 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10894
ce764ab2 10895 return 0;
e16fb6d1
TI
10896
10897 error:
10898 alc_free(codec);
10899 return err;
ce764ab2
TI
10900}
10901
1d045db9
TI
10902/*
10903 * ALC662 support
10904 *
10905 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10906 * configuration. Each pin widget can choose any input DACs and a mixer.
10907 * Each ADC is connected from a mixer of all inputs. This makes possible
10908 * 6-channel independent captures.
10909 *
10910 * In addition, an independent DAC for the multi-playback (not used in this
10911 * driver yet).
10912 */
1d045db9
TI
10913
10914/*
10915 * BIOS auto configuration
10916 */
10917
bc9f98a9
KY
10918static int alc662_parse_auto_config(struct hda_codec *codec)
10919{
4c6d72d1 10920 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10921 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10922 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10923 const hda_nid_t *ssids;
ee979a14 10924
7639a06c
TI
10925 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10926 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10927 codec->core.vendor_id == 0x10ec0671)
3e6179b8 10928 ssids = alc663_ssids;
6227cdce 10929 else
3e6179b8
TI
10930 ssids = alc662_ssids;
10931 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
10932}
10933
6be7948f 10934static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 10935 const struct hda_fixup *fix, int action)
6fc398cb 10936{
9bb1f06f 10937 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 10938 return;
6be7948f
TB
10939 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10940 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10941 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10942 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10943 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 10944 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
10945}
10946
8e383953
TI
10947static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10948 { .channels = 2,
10949 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10950 { .channels = 4,
10951 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10952 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10953 { }
10954};
10955
10956/* override the 2.1 chmap */
eb9ca3ab 10957static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
10958 const struct hda_fixup *fix, int action)
10959{
10960 if (action == HDA_FIXUP_ACT_BUILD) {
10961 struct alc_spec *spec = codec->spec;
bbbc7e85 10962 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
10963 }
10964}
10965
bf68665d
TI
10966/* avoid D3 for keeping GPIO up */
10967static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10968 hda_nid_t nid,
10969 unsigned int power_state)
10970{
10971 struct alc_spec *spec = codec->spec;
d261eec8 10972 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
10973 return AC_PWRST_D0;
10974 return power_state;
10975}
10976
3e887f37
TI
10977static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10978 const struct hda_fixup *fix, int action)
10979{
10980 struct alc_spec *spec = codec->spec;
3e887f37 10981
01e4a275 10982 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 10983 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 10984 spec->mute_led_polarity = 1;
bf68665d 10985 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
10986 }
10987}
10988
c6790c8e
KY
10989static void alc662_usi_automute_hook(struct hda_codec *codec,
10990 struct hda_jack_callback *jack)
10991{
10992 struct alc_spec *spec = codec->spec;
10993 int vref;
10994 msleep(200);
10995 snd_hda_gen_hp_automute(codec, jack);
10996
10997 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10998 msleep(100);
10999 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11000 vref);
11001}
11002
11003static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11004 const struct hda_fixup *fix, int action)
11005{
11006 struct alc_spec *spec = codec->spec;
11007 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11008 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11009 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11010 }
11011}
11012
00066e97
SB
11013static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11014 struct hda_jack_callback *cb)
11015{
11016 /* surround speakers at 0x1b already get muted automatically when
11017 * headphones are plugged in, but we have to mute/unmute the remaining
11018 * channels manually:
11019 * 0x15 - front left/front right
11020 * 0x18 - front center/ LFE
11021 */
11022 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11023 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11024 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11025 } else {
11026 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11027 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11028 }
11029}
11030
11031static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11032 const struct hda_fixup *fix, int action)
11033{
11034 /* Pin 0x1b: shared headphones jack and surround speakers */
11035 if (!is_jack_detectable(codec, 0x1b))
11036 return;
11037
11038 switch (action) {
11039 case HDA_FIXUP_ACT_PRE_PROBE:
11040 snd_hda_jack_detect_enable_callback(codec, 0x1b,
11041 alc662_aspire_ethos_mute_speakers);
336820c4
TI
11042 /* subwoofer needs an extra GPIO setting to become audible */
11043 alc_setup_gpio(codec, 0x02);
00066e97
SB
11044 break;
11045 case HDA_FIXUP_ACT_INIT:
11046 /* Make sure to start in a correct state, i.e. if
11047 * headphones have been plugged in before powering up the system
11048 */
11049 alc662_aspire_ethos_mute_speakers(codec, NULL);
11050 break;
11051 }
11052}
11053
5af29028
KY
11054static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11055 const struct hda_fixup *fix, int action)
11056{
11057 struct alc_spec *spec = codec->spec;
11058
11059 static const struct hda_pintbl pincfgs[] = {
11060 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11061 { 0x1b, 0x0181304f },
11062 { }
11063 };
11064
11065 switch (action) {
11066 case HDA_FIXUP_ACT_PRE_PROBE:
11067 spec->gen.mixer_nid = 0;
11068 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11069 snd_hda_apply_pincfgs(codec, pincfgs);
11070 break;
11071 case HDA_FIXUP_ACT_INIT:
11072 alc_write_coef_idx(codec, 0x19, 0xa054);
11073 break;
11074 }
11075}
11076
d7f32791
KY
11077static void alc897_hp_automute_hook(struct hda_codec *codec,
11078 struct hda_jack_callback *jack)
11079{
11080 struct alc_spec *spec = codec->spec;
11081 int vref;
11082
11083 snd_hda_gen_hp_automute(codec, jack);
11084 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11085 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11086 vref);
11087}
11088
11089static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11090 const struct hda_fixup *fix, int action)
11091{
11092 struct alc_spec *spec = codec->spec;
11093 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11094 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11095 }
11096}
11097
4bf5bf54
EP
11098static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11099 const struct hda_fixup *fix, int action)
11100{
11101 struct alc_spec *spec = codec->spec;
11102
11103 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11104 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11105 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11106 }
11107}
11108
6b0f95c4 11109static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
11110 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
11111 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
11112 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
11113 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11114 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11115 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11116 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
11117 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
11118 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11119 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11120 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11121 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11122 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
11123 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11124 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
11125 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
11126 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11127 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11128 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11129 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11130 {}
11131};
11132
11133static void alc668_restore_default_value(struct hda_codec *codec)
11134{
11135 alc_process_coef_fw(codec, alc668_coefs);
11136}
11137
6cb3b707 11138enum {
2df03514 11139 ALC662_FIXUP_ASPIRE,
3e887f37 11140 ALC662_FIXUP_LED_GPIO1,
6cb3b707 11141 ALC662_FIXUP_IDEAPAD,
6be7948f 11142 ALC272_FIXUP_MARIO,
f1ec5be1 11143 ALC662_FIXUP_CZC_ET26,
d2ebd479 11144 ALC662_FIXUP_CZC_P10T,
94024cd1 11145 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 11146 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
11147 ALC662_FIXUP_ASUS_MODE1,
11148 ALC662_FIXUP_ASUS_MODE2,
11149 ALC662_FIXUP_ASUS_MODE3,
11150 ALC662_FIXUP_ASUS_MODE4,
11151 ALC662_FIXUP_ASUS_MODE5,
11152 ALC662_FIXUP_ASUS_MODE6,
11153 ALC662_FIXUP_ASUS_MODE7,
11154 ALC662_FIXUP_ASUS_MODE8,
1565cc35 11155 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 11156 ALC662_FIXUP_ZOTAC_Z68,
125821ae 11157 ALC662_FIXUP_INV_DMIC,
1f8b46cd 11158 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 11159 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11160 ALC662_FIXUP_HEADSET_MODE,
73bdd597 11161 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 11162 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 11163 ALC662_FIXUP_BASS_16,
a30c9aaa 11164 ALC662_FIXUP_BASS_1A,
8e54b4ac 11165 ALC662_FIXUP_BASS_CHMAP,
493a52a9 11166 ALC668_FIXUP_AUTO_MUTE,
5e6db669 11167 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 11168 ALC668_FIXUP_DELL_XPS13,
9d4dc584 11169 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 11170 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11171 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 11172 ALC668_FIXUP_MIC_COEF,
11ba6111 11173 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
11174 ALC891_FIXUP_HEADSET_MODE,
11175 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 11176 ALC662_FIXUP_ACER_VERITON,
1a3f0991 11177 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
11178 ALC662_FIXUP_USI_FUNC,
11179 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 11180 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 11181 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 11182 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 11183 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 11184 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 11185 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
11186 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11187 ALC668_FIXUP_HEADSET_MIC,
11188 ALC668_FIXUP_MIC_DET_COEF,
d7f32791
KY
11189 ALC897_FIXUP_LENOVO_HEADSET_MIC,
11190 ALC897_FIXUP_HEADSET_MIC_PIN,
fe6900bd 11191 ALC897_FIXUP_HP_HSMIC_VERB,
4bf5bf54
EP
11192 ALC897_FIXUP_LENOVO_HEADSET_MODE,
11193 ALC897_FIXUP_HEADSET_MIC_PIN2,
6cb3b707
DH
11194};
11195
1727a771 11196static const struct hda_fixup alc662_fixups[] = {
2df03514 11197 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
11198 .type = HDA_FIXUP_PINS,
11199 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
11200 { 0x15, 0x99130112 }, /* subwoofer */
11201 { }
11202 }
11203 },
3e887f37
TI
11204 [ALC662_FIXUP_LED_GPIO1] = {
11205 .type = HDA_FIXUP_FUNC,
11206 .v.func = alc662_fixup_led_gpio1,
11207 },
6cb3b707 11208 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
11209 .type = HDA_FIXUP_PINS,
11210 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
11211 { 0x17, 0x99130112 }, /* subwoofer */
11212 { }
3e887f37
TI
11213 },
11214 .chained = true,
11215 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 11216 },
6be7948f 11217 [ALC272_FIXUP_MARIO] = {
1727a771 11218 .type = HDA_FIXUP_FUNC,
b5bfbc67 11219 .v.func = alc272_fixup_mario,
d2ebd479 11220 },
f1ec5be1
HC
11221 [ALC662_FIXUP_CZC_ET26] = {
11222 .type = HDA_FIXUP_PINS,
11223 .v.pins = (const struct hda_pintbl[]) {
11224 {0x12, 0x403cc000},
11225 {0x14, 0x90170110}, /* speaker */
11226 {0x15, 0x411111f0},
11227 {0x16, 0x411111f0},
11228 {0x18, 0x01a19030}, /* mic */
11229 {0x19, 0x90a7013f}, /* int-mic */
11230 {0x1a, 0x01014020},
11231 {0x1b, 0x0121401f},
11232 {0x1c, 0x411111f0},
11233 {0x1d, 0x411111f0},
11234 {0x1e, 0x40478e35},
11235 {}
11236 },
11237 .chained = true,
11238 .chain_id = ALC662_FIXUP_SKU_IGNORE
11239 },
d2ebd479 11240 [ALC662_FIXUP_CZC_P10T] = {
1727a771 11241 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
11242 .v.verbs = (const struct hda_verb[]) {
11243 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11244 {}
11245 }
11246 },
94024cd1 11247 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 11248 .type = HDA_FIXUP_FUNC,
23d30f28 11249 .v.func = alc_fixup_sku_ignore,
c6b35874 11250 },
e59ea3ed 11251 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
11252 .type = HDA_FIXUP_PINS,
11253 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
11254 { 0x14, 0x0221201f }, /* HP out */
11255 { }
11256 },
11257 .chained = true,
11258 .chain_id = ALC662_FIXUP_SKU_IGNORE
11259 },
53c334ad 11260 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
11261 .type = HDA_FIXUP_PINS,
11262 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11263 { 0x14, 0x99130110 }, /* speaker */
11264 { 0x18, 0x01a19c20 }, /* mic */
11265 { 0x19, 0x99a3092f }, /* int-mic */
11266 { 0x21, 0x0121401f }, /* HP out */
11267 { }
11268 },
11269 .chained = true,
11270 .chain_id = ALC662_FIXUP_SKU_IGNORE
11271 },
11272 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
11273 .type = HDA_FIXUP_PINS,
11274 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
11275 { 0x14, 0x99130110 }, /* speaker */
11276 { 0x18, 0x01a19820 }, /* mic */
11277 { 0x19, 0x99a3092f }, /* int-mic */
11278 { 0x1b, 0x0121401f }, /* HP out */
11279 { }
11280 },
53c334ad
TI
11281 .chained = true,
11282 .chain_id = ALC662_FIXUP_SKU_IGNORE
11283 },
11284 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
11285 .type = HDA_FIXUP_PINS,
11286 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11287 { 0x14, 0x99130110 }, /* speaker */
11288 { 0x15, 0x0121441f }, /* HP */
11289 { 0x18, 0x01a19840 }, /* mic */
11290 { 0x19, 0x99a3094f }, /* int-mic */
11291 { 0x21, 0x01211420 }, /* HP2 */
11292 { }
11293 },
11294 .chained = true,
11295 .chain_id = ALC662_FIXUP_SKU_IGNORE
11296 },
11297 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
11298 .type = HDA_FIXUP_PINS,
11299 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11300 { 0x14, 0x99130110 }, /* speaker */
11301 { 0x16, 0x99130111 }, /* speaker */
11302 { 0x18, 0x01a19840 }, /* mic */
11303 { 0x19, 0x99a3094f }, /* int-mic */
11304 { 0x21, 0x0121441f }, /* HP */
11305 { }
11306 },
11307 .chained = true,
11308 .chain_id = ALC662_FIXUP_SKU_IGNORE
11309 },
11310 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
11311 .type = HDA_FIXUP_PINS,
11312 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11313 { 0x14, 0x99130110 }, /* speaker */
11314 { 0x15, 0x0121441f }, /* HP */
11315 { 0x16, 0x99130111 }, /* speaker */
11316 { 0x18, 0x01a19840 }, /* mic */
11317 { 0x19, 0x99a3094f }, /* int-mic */
11318 { }
11319 },
11320 .chained = true,
11321 .chain_id = ALC662_FIXUP_SKU_IGNORE
11322 },
11323 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
11324 .type = HDA_FIXUP_PINS,
11325 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11326 { 0x14, 0x99130110 }, /* speaker */
11327 { 0x15, 0x01211420 }, /* HP2 */
11328 { 0x18, 0x01a19840 }, /* mic */
11329 { 0x19, 0x99a3094f }, /* int-mic */
11330 { 0x1b, 0x0121441f }, /* HP */
11331 { }
11332 },
11333 .chained = true,
11334 .chain_id = ALC662_FIXUP_SKU_IGNORE
11335 },
11336 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
11337 .type = HDA_FIXUP_PINS,
11338 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11339 { 0x14, 0x99130110 }, /* speaker */
11340 { 0x17, 0x99130111 }, /* speaker */
11341 { 0x18, 0x01a19840 }, /* mic */
11342 { 0x19, 0x99a3094f }, /* int-mic */
11343 { 0x1b, 0x01214020 }, /* HP */
11344 { 0x21, 0x0121401f }, /* HP */
11345 { }
11346 },
11347 .chained = true,
11348 .chain_id = ALC662_FIXUP_SKU_IGNORE
11349 },
11350 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
11351 .type = HDA_FIXUP_PINS,
11352 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11353 { 0x14, 0x99130110 }, /* speaker */
11354 { 0x12, 0x99a30970 }, /* int-mic */
11355 { 0x15, 0x01214020 }, /* HP */
11356 { 0x17, 0x99130111 }, /* speaker */
11357 { 0x18, 0x01a19840 }, /* mic */
11358 { 0x21, 0x0121401f }, /* HP */
11359 { }
11360 },
11361 .chained = true,
11362 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 11363 },
1565cc35 11364 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 11365 .type = HDA_FIXUP_FUNC,
1565cc35
TI
11366 .v.func = alc_fixup_no_jack_detect,
11367 },
edfe3bfc 11368 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
11369 .type = HDA_FIXUP_PINS,
11370 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
11371 { 0x1b, 0x02214020 }, /* Front HP */
11372 { }
11373 }
11374 },
125821ae 11375 [ALC662_FIXUP_INV_DMIC] = {
1727a771 11376 .type = HDA_FIXUP_FUNC,
9d36a7dc 11377 .v.func = alc_fixup_inv_dmic,
125821ae 11378 },
033b0a7c
GM
11379 [ALC668_FIXUP_DELL_XPS13] = {
11380 .type = HDA_FIXUP_FUNC,
11381 .v.func = alc_fixup_dell_xps13,
11382 .chained = true,
11383 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11384 },
5e6db669
GM
11385 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11386 .type = HDA_FIXUP_FUNC,
11387 .v.func = alc_fixup_disable_aamix,
11388 .chained = true,
11389 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11390 },
493a52a9
HW
11391 [ALC668_FIXUP_AUTO_MUTE] = {
11392 .type = HDA_FIXUP_FUNC,
11393 .v.func = alc_fixup_auto_mute_via_amp,
11394 .chained = true,
11395 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11396 },
1f8b46cd
DH
11397 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11398 .type = HDA_FIXUP_PINS,
11399 .v.pins = (const struct hda_pintbl[]) {
11400 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11401 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
11402 { }
11403 },
11404 .chained = true,
11405 .chain_id = ALC662_FIXUP_HEADSET_MODE
11406 },
11407 [ALC662_FIXUP_HEADSET_MODE] = {
11408 .type = HDA_FIXUP_FUNC,
11409 .v.func = alc_fixup_headset_mode_alc662,
11410 },
73bdd597
DH
11411 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
11412 .type = HDA_FIXUP_PINS,
11413 .v.pins = (const struct hda_pintbl[]) {
11414 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11415 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11416 { }
11417 },
11418 .chained = true,
11419 .chain_id = ALC668_FIXUP_HEADSET_MODE
11420 },
11421 [ALC668_FIXUP_HEADSET_MODE] = {
11422 .type = HDA_FIXUP_FUNC,
11423 .v.func = alc_fixup_headset_mode_alc668,
11424 },
8e54b4ac 11425 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 11426 .type = HDA_FIXUP_FUNC,
eb9ca3ab 11427 .v.func = alc_fixup_bass_chmap,
8e383953
TI
11428 .chained = true,
11429 .chain_id = ALC662_FIXUP_ASUS_MODE4
11430 },
61a75f13
DH
11431 [ALC662_FIXUP_BASS_16] = {
11432 .type = HDA_FIXUP_PINS,
11433 .v.pins = (const struct hda_pintbl[]) {
11434 {0x16, 0x80106111}, /* bass speaker */
11435 {}
11436 },
11437 .chained = true,
11438 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11439 },
a30c9aaa
TI
11440 [ALC662_FIXUP_BASS_1A] = {
11441 .type = HDA_FIXUP_PINS,
11442 .v.pins = (const struct hda_pintbl[]) {
11443 {0x1a, 0x80106111}, /* bass speaker */
11444 {}
11445 },
8e54b4ac
DH
11446 .chained = true,
11447 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 11448 },
8e54b4ac 11449 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 11450 .type = HDA_FIXUP_FUNC,
eb9ca3ab 11451 .v.func = alc_fixup_bass_chmap,
a30c9aaa 11452 },
9d4dc584
BM
11453 [ALC662_FIXUP_ASUS_Nx50] = {
11454 .type = HDA_FIXUP_FUNC,
11455 .v.func = alc_fixup_auto_mute_via_amp,
11456 .chained = true,
11457 .chain_id = ALC662_FIXUP_BASS_1A
11458 },
fc7438b1
MP
11459 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
11460 .type = HDA_FIXUP_FUNC,
11461 .v.func = alc_fixup_headset_mode_alc668,
11462 .chain_id = ALC662_FIXUP_BASS_CHMAP
11463 },
3231e205
YP
11464 [ALC668_FIXUP_ASUS_Nx51] = {
11465 .type = HDA_FIXUP_PINS,
11466 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
11467 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11468 { 0x1a, 0x90170151 }, /* bass speaker */
11469 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
11470 {}
11471 },
11472 .chained = true,
fc7438b1 11473 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11474 },
5b7c5e1f 11475 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
11476 .type = HDA_FIXUP_VERBS,
11477 .v.verbs = (const struct hda_verb[]) {
11478 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11479 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11480 {}
11481 },
11482 },
5b7c5e1f
TI
11483 [ALC668_FIXUP_ASUS_G751] = {
11484 .type = HDA_FIXUP_PINS,
11485 .v.pins = (const struct hda_pintbl[]) {
11486 { 0x16, 0x0421101f }, /* HP */
11487 {}
11488 },
11489 .chained = true,
11490 .chain_id = ALC668_FIXUP_MIC_COEF
11491 },
78f4f7c2
KY
11492 [ALC891_FIXUP_HEADSET_MODE] = {
11493 .type = HDA_FIXUP_FUNC,
11494 .v.func = alc_fixup_headset_mode,
11495 },
11496 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11497 .type = HDA_FIXUP_PINS,
11498 .v.pins = (const struct hda_pintbl[]) {
11499 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11500 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11501 { }
11502 },
11503 .chained = true,
11504 .chain_id = ALC891_FIXUP_HEADSET_MODE
11505 },
9b51fe3e
SB
11506 [ALC662_FIXUP_ACER_VERITON] = {
11507 .type = HDA_FIXUP_PINS,
11508 .v.pins = (const struct hda_pintbl[]) {
11509 { 0x15, 0x50170120 }, /* no internal speaker */
11510 { }
11511 }
11512 },
1a3f0991
TI
11513 [ALC892_FIXUP_ASROCK_MOBO] = {
11514 .type = HDA_FIXUP_PINS,
11515 .v.pins = (const struct hda_pintbl[]) {
11516 { 0x15, 0x40f000f0 }, /* disabled */
11517 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
11518 { }
11519 }
11520 },
c6790c8e
KY
11521 [ALC662_FIXUP_USI_FUNC] = {
11522 .type = HDA_FIXUP_FUNC,
11523 .v.func = alc662_fixup_usi_headset_mic,
11524 },
11525 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11526 .type = HDA_FIXUP_PINS,
11527 .v.pins = (const struct hda_pintbl[]) {
11528 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11529 { 0x18, 0x01a1903d },
11530 { }
11531 },
11532 .chained = true,
11533 .chain_id = ALC662_FIXUP_USI_FUNC
11534 },
ca169cc2
KY
11535 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11536 .type = HDA_FIXUP_FUNC,
11537 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11538 },
00066e97
SB
11539 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11540 .type = HDA_FIXUP_FUNC,
11541 .v.func = alc662_fixup_aspire_ethos_hp,
11542 },
00066e97
SB
11543 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11544 .type = HDA_FIXUP_PINS,
11545 .v.pins = (const struct hda_pintbl[]) {
11546 { 0x15, 0x92130110 }, /* front speakers */
11547 { 0x18, 0x99130111 }, /* center/subwoofer */
11548 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11549 { }
11550 },
11551 .chained = true,
336820c4 11552 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 11553 },
5af29028
KY
11554 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11555 .type = HDA_FIXUP_FUNC,
11556 .v.func = alc671_fixup_hp_headset_mic2,
11557 },
d858c706
JHP
11558 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11559 .type = HDA_FIXUP_PINS,
11560 .v.pins = (const struct hda_pintbl[]) {
11561 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11562 { }
11563 },
11564 .chained = true,
11565 .chain_id = ALC662_FIXUP_USI_FUNC
11566 },
a124458a
JHP
11567 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11568 .type = HDA_FIXUP_PINS,
11569 .v.pins = (const struct hda_pintbl[]) {
11570 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11571 { 0x1b, 0x0221144f },
11572 { }
11573 },
11574 .chained = true,
11575 .chain_id = ALC662_FIXUP_USI_FUNC
11576 },
a3fd1a98
HW
11577 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11578 .type = HDA_FIXUP_PINS,
11579 .v.pins = (const struct hda_pintbl[]) {
11580 { 0x1b, 0x04a1112c },
11581 { }
11582 },
11583 .chained = true,
11584 .chain_id = ALC668_FIXUP_HEADSET_MIC
11585 },
11586 [ALC668_FIXUP_HEADSET_MIC] = {
11587 .type = HDA_FIXUP_FUNC,
11588 .v.func = alc269_fixup_headset_mic,
11589 .chained = true,
11590 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11591 },
11592 [ALC668_FIXUP_MIC_DET_COEF] = {
11593 .type = HDA_FIXUP_VERBS,
11594 .v.verbs = (const struct hda_verb[]) {
11595 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11596 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11597 {}
11598 },
11599 },
d7f32791
KY
11600 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11601 .type = HDA_FIXUP_FUNC,
11602 .v.func = alc897_fixup_lenovo_headset_mic,
11603 },
11604 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11605 .type = HDA_FIXUP_PINS,
11606 .v.pins = (const struct hda_pintbl[]) {
11607 { 0x1a, 0x03a11050 },
11608 { }
11609 },
11610 .chained = true,
11611 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11612 },
fe6900bd
KY
11613 [ALC897_FIXUP_HP_HSMIC_VERB] = {
11614 .type = HDA_FIXUP_PINS,
11615 .v.pins = (const struct hda_pintbl[]) {
11616 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11617 { }
11618 },
11619 },
4bf5bf54
EP
11620 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
11621 .type = HDA_FIXUP_FUNC,
11622 .v.func = alc897_fixup_lenovo_headset_mode,
11623 },
11624 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
11625 .type = HDA_FIXUP_PINS,
11626 .v.pins = (const struct hda_pintbl[]) {
11627 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11628 { }
11629 },
11630 .chained = true,
11631 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
11632 },
6cb3b707
DH
11633};
11634
a9111321 11635static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 11636 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 11637 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 11638 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 11639 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 11640 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 11641 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 11642 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 11643 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 11644 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 11645 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 11646 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
11647 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11648 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 11649 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 11650 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 11651 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 11652 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 11653 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
11654 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11655 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 11656 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 11657 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
ea24b995 11658 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
fe6900bd 11659 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
148ebf54 11660 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
dbe75d31 11661 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
882bd07f 11662 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 11663 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 11664 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 11665 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 11666 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 11667 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 11668 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 11669 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
11670 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11671 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 11672 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 11673 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 11674 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 11675 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 11676 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 11677 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 11678 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 11679 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 11680 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
5a873857 11681 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
d7f32791
KY
11682 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11683 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11684 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11685 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
4bf5bf54 11686 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
d4118588 11687 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 11688 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 11689 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 11690 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 11691 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 11692 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 11693 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
53c334ad
TI
11694
11695#if 0
11696 /* Below is a quirk table taken from the old code.
11697 * Basically the device should work as is without the fixup table.
11698 * If BIOS doesn't give a proper info, enable the corresponding
11699 * fixup entry.
7d7eb9ea 11700 */
53c334ad
TI
11701 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11702 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11703 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11704 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11705 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11706 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11707 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11708 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11709 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11710 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11711 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11712 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11713 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11714 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11715 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11716 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11717 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11718 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11719 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11720 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11721 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11722 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11723 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11724 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11725 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11726 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11727 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11728 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11729 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11730 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11731 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11732 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11733 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11734 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11735 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11736 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11737 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11738 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11739 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11740 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11741 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11742 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11743 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11744 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11745 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11746 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11747 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11748 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11749 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11750 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11751#endif
6cb3b707
DH
11752 {}
11753};
11754
1727a771 11755static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
11756 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11757 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 11758 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 11759 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
11760 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11761 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11762 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11763 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11764 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11765 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11766 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11767 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 11768 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 11769 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 11770 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 11771 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
11772 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11773 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11774 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11775 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11776 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11777 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11778 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11779 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 11780 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
11781 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11782 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11783 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11784 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11785 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 11786 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 11787 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
6be7948f
TB
11788 {}
11789};
6cb3b707 11790
532895c5 11791static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
11792 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11793 {0x17, 0x02211010},
11794 {0x18, 0x01a19030},
11795 {0x1a, 0x01813040},
11796 {0x21, 0x01014020}),
4b4e0e32
HW
11797 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11798 {0x16, 0x01813030},
11799 {0x17, 0x02211010},
11800 {0x18, 0x01a19040},
11801 {0x21, 0x01014020}),
1f8b46cd 11802 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11803 {0x14, 0x01014010},
1f8b46cd 11804 {0x18, 0x01a19020},
1f8b46cd 11805 {0x1a, 0x0181302f},
11580297 11806 {0x1b, 0x0221401f}),
76c2132e
DH
11807 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11808 {0x12, 0x99a30130},
11809 {0x14, 0x90170110},
11810 {0x15, 0x0321101f},
11580297 11811 {0x16, 0x03011020}),
76c2132e
DH
11812 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11813 {0x12, 0x99a30140},
11814 {0x14, 0x90170110},
11815 {0x15, 0x0321101f},
11580297 11816 {0x16, 0x03011020}),
76c2132e
DH
11817 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11818 {0x12, 0x99a30150},
11819 {0x14, 0x90170110},
11820 {0x15, 0x0321101f},
11580297 11821 {0x16, 0x03011020}),
76c2132e 11822 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
11823 {0x14, 0x90170110},
11824 {0x15, 0x0321101f},
11580297 11825 {0x16, 0x03011020}),
76c2132e
DH
11826 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11827 {0x12, 0x90a60130},
11828 {0x14, 0x90170110},
11580297 11829 {0x15, 0x0321101f}),
5af29028
KY
11830 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11831 {0x14, 0x01014010},
11832 {0x17, 0x90170150},
f2adbae0 11833 {0x19, 0x02a11060},
5af29028
KY
11834 {0x1b, 0x01813030},
11835 {0x21, 0x02211020}),
11836 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11837 {0x14, 0x01014010},
11838 {0x18, 0x01a19040},
11839 {0x1b, 0x01813030},
11840 {0x21, 0x02211020}),
11841 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11842 {0x14, 0x01014020},
11843 {0x17, 0x90170110},
11844 {0x18, 0x01a19050},
11845 {0x1b, 0x01813040},
11846 {0x21, 0x02211030}),
532895c5
HW
11847 {}
11848};
11849
1d045db9
TI
11850/*
11851 */
bc9f98a9
KY
11852static int patch_alc662(struct hda_codec *codec)
11853{
11854 struct alc_spec *spec;
3de95173 11855 int err;
bc9f98a9 11856
3de95173
TI
11857 err = alc_alloc_spec(codec, 0x0b);
11858 if (err < 0)
11859 return err;
bc9f98a9 11860
3de95173 11861 spec = codec->spec;
1f0f4b80 11862
225068ab
TI
11863 spec->shutup = alc_eapd_shutup;
11864
53c334ad
TI
11865 /* handle multiple HPs as is */
11866 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11867
2c3bf9ab
TI
11868 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11869
7639a06c 11870 switch (codec->core.vendor_id) {
f3f9185f
KY
11871 case 0x10ec0668:
11872 spec->init_hook = alc668_restore_default_value;
11873 break;
f3f9185f 11874 }
8663ff75 11875
c9af753f
TI
11876 alc_pre_init(codec);
11877
1727a771 11878 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 11879 alc662_fixup_tbl, alc662_fixups);
0fc1e447 11880 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 11881 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
11882
11883 alc_auto_parse_customize_define(codec);
11884
7504b6cd
TI
11885 if (has_cdefine_beep(codec))
11886 spec->gen.beep_nid = 0x01;
11887
1bb7e43e 11888 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 11889 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11890 spec->cdefine.platform_type == 1) {
6134b1a2
WY
11891 err = alc_codec_rename(codec, "ALC272X");
11892 if (err < 0)
e16fb6d1 11893 goto error;
20ca0c35 11894 }
274693f3 11895
b9c5106c
TI
11896 /* automatic parse from the BIOS config */
11897 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
11898 if (err < 0)
11899 goto error;
bc9f98a9 11900
7504b6cd 11901 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 11902 switch (codec->core.vendor_id) {
da00c244 11903 case 0x10ec0662:
fea80fae 11904 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
11905 break;
11906 case 0x10ec0272:
11907 case 0x10ec0663:
11908 case 0x10ec0665:
9ad54547 11909 case 0x10ec0668:
fea80fae 11910 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
11911 break;
11912 case 0x10ec0273:
fea80fae 11913 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
11914 break;
11915 }
fea80fae
TI
11916 if (err < 0)
11917 goto error;
cec27c89 11918 }
2134ea4f 11919
1727a771 11920 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11921
bc9f98a9 11922 return 0;
801f49d3 11923
e16fb6d1
TI
11924 error:
11925 alc_free(codec);
11926 return err;
b478b998
KY
11927}
11928
d1eb57f4
KY
11929/*
11930 * ALC680 support
11931 */
d1eb57f4 11932
d1eb57f4
KY
11933static int alc680_parse_auto_config(struct hda_codec *codec)
11934{
3e6179b8 11935 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
11936}
11937
d1eb57f4 11938/*
d1eb57f4 11939 */
d1eb57f4
KY
11940static int patch_alc680(struct hda_codec *codec)
11941{
d1eb57f4
KY
11942 int err;
11943
1f0f4b80 11944 /* ALC680 has no aa-loopback mixer */
3de95173
TI
11945 err = alc_alloc_spec(codec, 0);
11946 if (err < 0)
11947 return err;
1f0f4b80 11948
1ebec5f2
TI
11949 /* automatic parse from the BIOS config */
11950 err = alc680_parse_auto_config(codec);
11951 if (err < 0) {
11952 alc_free(codec);
11953 return err;
d1eb57f4
KY
11954 }
11955
d1eb57f4
KY
11956 return 0;
11957}
11958
1da177e4
LT
11959/*
11960 * patch entries
11961 */
b9a94a9c 11962static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 11963 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 11964 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 11965 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 11966 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 11967 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
11968 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11969 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 11970 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 11971 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 11972 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 11973 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
11974 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11975 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 11976 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
11977 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11978 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11979 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11980 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11981 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11982 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11983 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 11984 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
11985 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11986 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11987 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11988 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11989 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11990 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 11991 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 11992 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 11993 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 11994 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 11995 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
11996 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11997 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11998 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 11999 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 12000 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 12001 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 12002 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 12003 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 12004 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
12005 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12006 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12007 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12008 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12009 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12010 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12011 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12012 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12013 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12014 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12015 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12016 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12017 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12018 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
12019 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12020 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12021 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 12022 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 12023 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
12024 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12025 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12026 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12027 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12028 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12029 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12030 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12031 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12032 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12033 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12034 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 12035 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
12036 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12037 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 12038 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 12039 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 12040 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
527f4643 12041 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
1da177e4
LT
12042 {} /* terminator */
12043};
b9a94a9c 12044MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
12045
12046MODULE_LICENSE("GPL");
12047MODULE_DESCRIPTION("Realtek HD-audio codec");
12048
d8a766a1 12049static struct hda_codec_driver realtek_driver = {
b9a94a9c 12050 .id = snd_hda_id_realtek,
1289e9e8
TI
12051};
12052
d8a766a1 12053module_hda_codec_driver(realtek_driver);