]> git.ipfire.org Git - thirdparty/linux.git/blame - sound/pci/hda/patch_realtek.c
ALSA: usb-audio: add the quirk for KT0206 device
[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:
5579cd6f 835 alc_setup_gpio(codec, 0x03);
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),
13e1a4cd
TI
2627 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2628 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2631 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2632 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
9eb6f5c3 2633 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2634 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2635 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2636 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
dbfe8350 2637 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
d4995121 2638 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2639 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2640 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2641 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2642 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2643 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2644 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2645 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2646 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2647 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2648 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2649 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2650 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2651 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2652 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2653 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
7a6069bf
TI
2654 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2655 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2656 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2657 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2658 {}
2659};
2660
1727a771 2661static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2662 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2663 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2664 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2665 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2666 {.id = ALC889_FIXUP_CD, .name = "cd"},
2667 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2668 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2669 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2670 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2671 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2672 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2673 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2674 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2675 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2676 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2677 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2678 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2679 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2680 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2681 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2682 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2683 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2684 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2685 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2686 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2687 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2688 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2689 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2690 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2691 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
63394a16 2692 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2693 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2694 {}
2695};
2696
119b75c1
HW
2697static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2698 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2699 {0x14, 0x01014010},
2700 {0x15, 0x01011012},
2701 {0x16, 0x01016011},
2702 {0x18, 0x01a19040},
2703 {0x19, 0x02a19050},
2704 {0x1a, 0x0181304f},
2705 {0x1b, 0x0221401f},
2706 {0x1e, 0x01456130}),
2707 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2708 {0x14, 0x01015010},
2709 {0x15, 0x01011012},
2710 {0x16, 0x01011011},
2711 {0x18, 0x01a11040},
2712 {0x19, 0x02a19050},
2713 {0x1a, 0x0181104f},
2714 {0x1b, 0x0221401f},
2715 {0x1e, 0x01451130}),
2716 {}
2717};
2718
f6a92248 2719/*
1d045db9 2720 * BIOS auto configuration
f6a92248 2721 */
1d045db9
TI
2722/* almost identical with ALC880 parser... */
2723static int alc882_parse_auto_config(struct hda_codec *codec)
2724{
1d045db9 2725 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2726 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2727 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2728}
b896b4eb 2729
1d045db9
TI
2730/*
2731 */
1d045db9 2732static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2733{
2734 struct alc_spec *spec;
1a97b7f2 2735 int err;
f6a92248 2736
3de95173
TI
2737 err = alc_alloc_spec(codec, 0x0b);
2738 if (err < 0)
2739 return err;
f6a92248 2740
3de95173 2741 spec = codec->spec;
1f0f4b80 2742
7639a06c 2743 switch (codec->core.vendor_id) {
1d045db9
TI
2744 case 0x10ec0882:
2745 case 0x10ec0885:
acf08081 2746 case 0x10ec0900:
6d9ffcff 2747 case 0x10ec0b00:
a535ad57 2748 case 0x10ec1220:
1d045db9
TI
2749 break;
2750 default:
2751 /* ALC883 and variants */
2752 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2753 break;
c793bec5 2754 }
977ddd6b 2755
c9af753f
TI
2756 alc_pre_init(codec);
2757
1727a771 2758 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2759 alc882_fixups);
119b75c1 2760 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2761 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2762
1d045db9
TI
2763 alc_auto_parse_customize_define(codec);
2764
7504b6cd
TI
2765 if (has_cdefine_beep(codec))
2766 spec->gen.beep_nid = 0x01;
2767
1a97b7f2
TI
2768 /* automatic parse from the BIOS config */
2769 err = alc882_parse_auto_config(codec);
2770 if (err < 0)
2771 goto error;
f6a92248 2772
fea80fae
TI
2773 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2774 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2775 if (err < 0)
2776 goto error;
2777 }
f6a92248 2778
1727a771 2779 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2780
f6a92248 2781 return 0;
e16fb6d1
TI
2782
2783 error:
2784 alc_free(codec);
2785 return err;
f6a92248
KY
2786}
2787
df694daa 2788
df694daa 2789/*
1d045db9 2790 * ALC262 support
df694daa 2791 */
1d045db9 2792static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2793{
1d045db9 2794 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2795 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2796 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2797}
2798
df694daa 2799/*
1d045db9 2800 * Pin config fixes
df694daa 2801 */
cfc9b06f 2802enum {
ea4e7af1 2803 ALC262_FIXUP_FSC_H270,
7513e6da 2804 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2805 ALC262_FIXUP_HP_Z200,
2806 ALC262_FIXUP_TYAN,
c470150c 2807 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2808 ALC262_FIXUP_BENQ,
2809 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2810 ALC262_FIXUP_INV_DMIC,
b5c6611f 2811 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2812};
2813
1727a771 2814static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2815 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2816 .type = HDA_FIXUP_PINS,
2817 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2818 { 0x14, 0x99130110 }, /* speaker */
2819 { 0x15, 0x0221142f }, /* front HP */
2820 { 0x1b, 0x0121141f }, /* rear HP */
2821 { }
2822 }
2823 },
7513e6da
TI
2824 [ALC262_FIXUP_FSC_S7110] = {
2825 .type = HDA_FIXUP_PINS,
2826 .v.pins = (const struct hda_pintbl[]) {
2827 { 0x15, 0x90170110 }, /* speaker */
2828 { }
2829 },
2830 .chained = true,
2831 .chain_id = ALC262_FIXUP_BENQ,
2832 },
ea4e7af1 2833 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2834 .type = HDA_FIXUP_PINS,
2835 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2836 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2837 { }
2838 }
cfc9b06f 2839 },
ea4e7af1 2840 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2841 .type = HDA_FIXUP_PINS,
2842 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2843 { 0x14, 0x1993e1f0 }, /* int AUX */
2844 { }
2845 }
2846 },
c470150c 2847 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2848 .type = HDA_FIXUP_PINCTLS,
2849 .v.pins = (const struct hda_pintbl[]) {
2850 { 0x19, PIN_VREF50 },
b42590b8
TI
2851 {}
2852 },
2853 .chained = true,
2854 .chain_id = ALC262_FIXUP_BENQ,
2855 },
2856 [ALC262_FIXUP_BENQ] = {
1727a771 2857 .type = HDA_FIXUP_VERBS,
b42590b8 2858 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2859 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2860 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2861 {}
2862 }
2863 },
b42590b8 2864 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2865 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2866 .v.verbs = (const struct hda_verb[]) {
2867 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2868 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2869 {}
2870 }
2871 },
6e72aa5f 2872 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2873 .type = HDA_FIXUP_FUNC,
9d36a7dc 2874 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2875 },
b5c6611f
ML
2876 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2877 .type = HDA_FIXUP_FUNC,
2878 .v.func = alc_fixup_no_depop_delay,
2879 },
cfc9b06f
TI
2880};
2881
1d045db9 2882static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2883 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2884 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2885 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2886 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2887 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2888 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2889 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2890 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2891 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2892 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2893 {}
2894};
df694daa 2895
1727a771 2896static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2897 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2898 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2899 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2900 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2901 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2902 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2903 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2904 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2905 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2906 {}
2907};
1d045db9 2908
1d045db9
TI
2909/*
2910 */
1d045db9 2911static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2912{
2913 struct alc_spec *spec;
df694daa
KY
2914 int err;
2915
3de95173
TI
2916 err = alc_alloc_spec(codec, 0x0b);
2917 if (err < 0)
2918 return err;
df694daa 2919
3de95173 2920 spec = codec->spec;
08c189f2 2921 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2922
225068ab
TI
2923 spec->shutup = alc_eapd_shutup;
2924
1d045db9
TI
2925#if 0
2926 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2927 * under-run
2928 */
98b24883 2929 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2930#endif
1d045db9
TI
2931 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2932
c9af753f
TI
2933 alc_pre_init(codec);
2934
1727a771 2935 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2936 alc262_fixups);
1727a771 2937 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2938
af741c15
TI
2939 alc_auto_parse_customize_define(codec);
2940
7504b6cd
TI
2941 if (has_cdefine_beep(codec))
2942 spec->gen.beep_nid = 0x01;
2943
42399f7a
TI
2944 /* automatic parse from the BIOS config */
2945 err = alc262_parse_auto_config(codec);
2946 if (err < 0)
2947 goto error;
df694daa 2948
fea80fae
TI
2949 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2950 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2951 if (err < 0)
2952 goto error;
2953 }
2134ea4f 2954
1727a771 2955 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2956
1da177e4 2957 return 0;
e16fb6d1
TI
2958
2959 error:
2960 alc_free(codec);
2961 return err;
1da177e4
LT
2962}
2963
f32610ed 2964/*
1d045db9 2965 * ALC268
f32610ed 2966 */
1d045db9 2967/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2968static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2969 struct snd_ctl_elem_value *ucontrol)
2970{
2971 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2972 unsigned long pval;
2973 int err;
2974
2975 mutex_lock(&codec->control_mutex);
2976 pval = kcontrol->private_value;
2977 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2978 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2979 if (err >= 0) {
2980 kcontrol->private_value = (pval & ~0xff) | 0x10;
2981 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2982 }
2983 kcontrol->private_value = pval;
2984 mutex_unlock(&codec->control_mutex);
2985 return err;
2986}
f32610ed 2987
1d045db9
TI
2988static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2989 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
2990 {
2991 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2992 .name = "Beep Playback Switch",
2993 .subdevice = HDA_SUBDEV_AMP_FLAG,
2994 .info = snd_hda_mixer_amp_switch_info,
2995 .get = snd_hda_mixer_amp_switch_get,
2996 .put = alc268_beep_switch_put,
2997 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2998 },
f32610ed
JS
2999};
3000
1d045db9
TI
3001/* set PCBEEP vol = 0, mute connections */
3002static const struct hda_verb alc268_beep_init_verbs[] = {
3003 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3004 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3005 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3006 { }
f32610ed
JS
3007};
3008
6e72aa5f
TI
3009enum {
3010 ALC268_FIXUP_INV_DMIC,
cb766404 3011 ALC268_FIXUP_HP_EAPD,
24eff328 3012 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
3013};
3014
1727a771 3015static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 3016 [ALC268_FIXUP_INV_DMIC] = {
1727a771 3017 .type = HDA_FIXUP_FUNC,
9d36a7dc 3018 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3019 },
cb766404 3020 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3021 .type = HDA_FIXUP_VERBS,
cb766404
TI
3022 .v.verbs = (const struct hda_verb[]) {
3023 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3024 {}
3025 }
3026 },
24eff328
TI
3027 [ALC268_FIXUP_SPDIF] = {
3028 .type = HDA_FIXUP_PINS,
3029 .v.pins = (const struct hda_pintbl[]) {
3030 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3031 {}
3032 }
3033 },
6e72aa5f
TI
3034};
3035
1727a771 3036static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3037 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3038 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3039 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3040 {}
3041};
3042
3043static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3044 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3045 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3046 /* below is codec SSID since multiple Toshiba laptops have the
3047 * same PCI SSID 1179:ff00
3048 */
3049 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3050 {}
3051};
3052
f32610ed
JS
3053/*
3054 * BIOS auto configuration
3055 */
1d045db9 3056static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3057{
3e6179b8 3058 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3059 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3060}
3061
1d045db9
TI
3062/*
3063 */
1d045db9 3064static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3065{
3066 struct alc_spec *spec;
a5cb463a 3067 int i, err;
f32610ed 3068
1d045db9 3069 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3070 err = alc_alloc_spec(codec, 0);
3071 if (err < 0)
3072 return err;
3073
3074 spec = codec->spec;
2722b535
TI
3075 if (has_cdefine_beep(codec))
3076 spec->gen.beep_nid = 0x01;
1f0f4b80 3077
225068ab
TI
3078 spec->shutup = alc_eapd_shutup;
3079
c9af753f
TI
3080 alc_pre_init(codec);
3081
1727a771
TI
3082 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3083 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3084
6ebb8053
TI
3085 /* automatic parse from the BIOS config */
3086 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3087 if (err < 0)
3088 goto error;
f32610ed 3089
7504b6cd
TI
3090 if (err > 0 && !spec->gen.no_analog &&
3091 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3092 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3093 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3094 &alc268_beep_mixer[i])) {
3095 err = -ENOMEM;
3096 goto error;
3097 }
3098 }
7504b6cd 3099 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3100 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3101 /* override the amp caps for beep generator */
3102 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3103 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3104 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3105 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3106 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3107 }
3108
1727a771 3109 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3110
f32610ed 3111 return 0;
e16fb6d1
TI
3112
3113 error:
3114 alc_free(codec);
3115 return err;
f32610ed
JS
3116}
3117
bc9f98a9 3118/*
1d045db9 3119 * ALC269
bc9f98a9 3120 */
08c189f2 3121
1d045db9 3122static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3123 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3124};
3125
1d045db9 3126static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3127 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3128};
291702f0 3129
1d045db9
TI
3130/* different alc269-variants */
3131enum {
3132 ALC269_TYPE_ALC269VA,
3133 ALC269_TYPE_ALC269VB,
3134 ALC269_TYPE_ALC269VC,
adcc70b2 3135 ALC269_TYPE_ALC269VD,
065380f0
KY
3136 ALC269_TYPE_ALC280,
3137 ALC269_TYPE_ALC282,
2af02be7 3138 ALC269_TYPE_ALC283,
065380f0 3139 ALC269_TYPE_ALC284,
4731d5de 3140 ALC269_TYPE_ALC293,
7fc7d047 3141 ALC269_TYPE_ALC286,
506b62c3 3142 ALC269_TYPE_ALC298,
1d04c9de 3143 ALC269_TYPE_ALC255,
4344aec8 3144 ALC269_TYPE_ALC256,
f429e7e4 3145 ALC269_TYPE_ALC257,
0a6f0600 3146 ALC269_TYPE_ALC215,
4231430d 3147 ALC269_TYPE_ALC225,
60571929 3148 ALC269_TYPE_ALC245,
99cee034 3149 ALC269_TYPE_ALC287,
dcd4f0db 3150 ALC269_TYPE_ALC294,
1078bef0 3151 ALC269_TYPE_ALC300,
f0778871 3152 ALC269_TYPE_ALC623,
6fbae35a 3153 ALC269_TYPE_ALC700,
bc9f98a9
KY
3154};
3155
3156/*
1d045db9 3157 * BIOS auto configuration
bc9f98a9 3158 */
1d045db9
TI
3159static int alc269_parse_auto_config(struct hda_codec *codec)
3160{
1d045db9 3161 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3162 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3163 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3164 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3165 const hda_nid_t *ssids;
3166
3167 switch (spec->codec_variant) {
3168 case ALC269_TYPE_ALC269VA:
3169 case ALC269_TYPE_ALC269VC:
065380f0
KY
3170 case ALC269_TYPE_ALC280:
3171 case ALC269_TYPE_ALC284:
4731d5de 3172 case ALC269_TYPE_ALC293:
adcc70b2
KY
3173 ssids = alc269va_ssids;
3174 break;
3175 case ALC269_TYPE_ALC269VB:
3176 case ALC269_TYPE_ALC269VD:
065380f0 3177 case ALC269_TYPE_ALC282:
2af02be7 3178 case ALC269_TYPE_ALC283:
7fc7d047 3179 case ALC269_TYPE_ALC286:
506b62c3 3180 case ALC269_TYPE_ALC298:
1d04c9de 3181 case ALC269_TYPE_ALC255:
4344aec8 3182 case ALC269_TYPE_ALC256:
f429e7e4 3183 case ALC269_TYPE_ALC257:
0a6f0600 3184 case ALC269_TYPE_ALC215:
4231430d 3185 case ALC269_TYPE_ALC225:
60571929 3186 case ALC269_TYPE_ALC245:
99cee034 3187 case ALC269_TYPE_ALC287:
dcd4f0db 3188 case ALC269_TYPE_ALC294:
1078bef0 3189 case ALC269_TYPE_ALC300:
f0778871 3190 case ALC269_TYPE_ALC623:
6fbae35a 3191 case ALC269_TYPE_ALC700:
adcc70b2
KY
3192 ssids = alc269_ssids;
3193 break;
3194 default:
3195 ssids = alc269_ssids;
3196 break;
3197 }
bc9f98a9 3198
3e6179b8 3199 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3200}
bc9f98a9 3201
476c02e0
HW
3202static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3203 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3204 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3205 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3206 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3207 {}
3208};
3209
3210static void alc_headset_btn_callback(struct hda_codec *codec,
3211 struct hda_jack_callback *jack)
3212{
3213 int report = 0;
3214
3215 if (jack->unsol_res & (7 << 13))
3216 report |= SND_JACK_BTN_0;
3217
3218 if (jack->unsol_res & (1 << 16 | 3 << 8))
3219 report |= SND_JACK_BTN_1;
3220
3221 /* Volume up key */
3222 if (jack->unsol_res & (7 << 23))
3223 report |= SND_JACK_BTN_2;
3224
3225 /* Volume down key */
3226 if (jack->unsol_res & (7 << 10))
3227 report |= SND_JACK_BTN_3;
3228
04f7791b 3229 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3230}
3231
3232static void alc_disable_headset_jack_key(struct hda_codec *codec)
3233{
3234 struct alc_spec *spec = codec->spec;
3235
3236 if (!spec->has_hs_key)
3237 return;
3238
3239 switch (codec->core.vendor_id) {
3240 case 0x10ec0215:
3241 case 0x10ec0225:
3242 case 0x10ec0285:
c72b9bfe 3243 case 0x10ec0287:
476c02e0
HW
3244 case 0x10ec0295:
3245 case 0x10ec0289:
3246 case 0x10ec0299:
3247 alc_write_coef_idx(codec, 0x48, 0x0);
3248 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3249 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3250 break;
1948fc06 3251 case 0x10ec0230:
476c02e0
HW
3252 case 0x10ec0236:
3253 case 0x10ec0256:
527f4643 3254 case 0x19e58326:
476c02e0
HW
3255 alc_write_coef_idx(codec, 0x48, 0x0);
3256 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3257 break;
3258 }
3259}
3260
3261static void alc_enable_headset_jack_key(struct hda_codec *codec)
3262{
3263 struct alc_spec *spec = codec->spec;
3264
3265 if (!spec->has_hs_key)
3266 return;
3267
3268 switch (codec->core.vendor_id) {
3269 case 0x10ec0215:
3270 case 0x10ec0225:
3271 case 0x10ec0285:
c72b9bfe 3272 case 0x10ec0287:
476c02e0
HW
3273 case 0x10ec0295:
3274 case 0x10ec0289:
3275 case 0x10ec0299:
3276 alc_write_coef_idx(codec, 0x48, 0xd011);
3277 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3278 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3279 break;
1948fc06 3280 case 0x10ec0230:
476c02e0
HW
3281 case 0x10ec0236:
3282 case 0x10ec0256:
527f4643 3283 case 0x19e58326:
476c02e0
HW
3284 alc_write_coef_idx(codec, 0x48, 0xd011);
3285 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3286 break;
3287 }
3288}
3289
3290static void alc_fixup_headset_jack(struct hda_codec *codec,
3291 const struct hda_fixup *fix, int action)
3292{
3293 struct alc_spec *spec = codec->spec;
04f7791b 3294 hda_nid_t hp_pin;
476c02e0
HW
3295
3296 switch (action) {
3297 case HDA_FIXUP_ACT_PRE_PROBE:
3298 spec->has_hs_key = 1;
3299 snd_hda_jack_detect_enable_callback(codec, 0x55,
3300 alc_headset_btn_callback);
476c02e0 3301 break;
04f7791b
HW
3302 case HDA_FIXUP_ACT_BUILD:
3303 hp_pin = alc_get_hp_pin(spec);
3304 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3305 alc_headset_btn_keymap,
3306 hp_pin))
3307 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3308 false, SND_JACK_HEADSET,
3309 alc_headset_btn_keymap);
3310
476c02e0
HW
3311 alc_enable_headset_jack_key(codec);
3312 break;
3313 }
3314}
3315
1387e2d1 3316static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3317{
98b24883 3318 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3319}
291702f0 3320
1d045db9
TI
3321static void alc269_shutup(struct hda_codec *codec)
3322{
adcc70b2
KY
3323 struct alc_spec *spec = codec->spec;
3324
1387e2d1
KY
3325 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3326 alc269vb_toggle_power_output(codec, 0);
3327 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3328 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3329 msleep(150);
3330 }
c0ca5ece 3331 alc_shutup_pins(codec);
1d045db9 3332}
291702f0 3333
6b0f95c4 3334static const struct coef_fw alc282_coefs[] = {
54db6c39 3335 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3336 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3337 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3338 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3339 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3340 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3341 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3342 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3343 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3344 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3345 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3346 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3347 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3348 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3349 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3350 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3351 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3352 WRITE_COEF(0x63, 0x2902), /* PLL */
3353 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3354 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3355 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3356 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3357 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3358 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3359 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3360 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3361 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3362 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3363 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3364 {}
3365};
3366
cb149cb3
KY
3367static void alc282_restore_default_value(struct hda_codec *codec)
3368{
54db6c39 3369 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3370}
3371
7b5c7a02
KY
3372static void alc282_init(struct hda_codec *codec)
3373{
3374 struct alc_spec *spec = codec->spec;
35a39f98 3375 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3376 bool hp_pin_sense;
3377 int coef78;
3378
cb149cb3
KY
3379 alc282_restore_default_value(codec);
3380
7b5c7a02
KY
3381 if (!hp_pin)
3382 return;
3383 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3384 coef78 = alc_read_coef_idx(codec, 0x78);
3385
3386 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3387 /* Headphone capless set to high power mode */
3388 alc_write_coef_idx(codec, 0x78, 0x9004);
3389
3390 if (hp_pin_sense)
3391 msleep(2);
3392
3393 snd_hda_codec_write(codec, hp_pin, 0,
3394 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3395
3396 if (hp_pin_sense)
3397 msleep(85);
3398
3399 snd_hda_codec_write(codec, hp_pin, 0,
3400 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3401
3402 if (hp_pin_sense)
3403 msleep(100);
3404
3405 /* Headphone capless set to normal mode */
3406 alc_write_coef_idx(codec, 0x78, coef78);
3407}
3408
3409static void alc282_shutup(struct hda_codec *codec)
3410{
3411 struct alc_spec *spec = codec->spec;
35a39f98 3412 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3413 bool hp_pin_sense;
3414 int coef78;
3415
3416 if (!hp_pin) {
3417 alc269_shutup(codec);
3418 return;
3419 }
3420
3421 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3422 coef78 = alc_read_coef_idx(codec, 0x78);
3423 alc_write_coef_idx(codec, 0x78, 0x9004);
3424
3425 if (hp_pin_sense)
3426 msleep(2);
3427
3428 snd_hda_codec_write(codec, hp_pin, 0,
3429 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3430
3431 if (hp_pin_sense)
3432 msleep(85);
3433
c0ca5ece
TI
3434 if (!spec->no_shutup_pins)
3435 snd_hda_codec_write(codec, hp_pin, 0,
3436 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3437
3438 if (hp_pin_sense)
3439 msleep(100);
3440
3441 alc_auto_setup_eapd(codec, false);
c0ca5ece 3442 alc_shutup_pins(codec);
7b5c7a02
KY
3443 alc_write_coef_idx(codec, 0x78, coef78);
3444}
3445
6b0f95c4 3446static const struct coef_fw alc283_coefs[] = {
54db6c39 3447 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3448 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3449 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3450 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3451 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3452 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3453 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3454 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3455 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3456 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3457 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3458 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3459 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3460 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3461 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3462 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3463 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3464 WRITE_COEF(0x2e, 0x2902), /* PLL */
3465 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3466 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3467 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3468 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3469 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3470 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3471 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3472 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3473 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3474 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3475 WRITE_COEF(0x49, 0x0), /* test mode */
3476 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3477 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3478 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3479 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3480 {}
3481};
3482
6bd55b04
KY
3483static void alc283_restore_default_value(struct hda_codec *codec)
3484{
54db6c39 3485 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3486}
3487
2af02be7
KY
3488static void alc283_init(struct hda_codec *codec)
3489{
3490 struct alc_spec *spec = codec->spec;
35a39f98 3491 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3492 bool hp_pin_sense;
2af02be7 3493
6bd55b04
KY
3494 alc283_restore_default_value(codec);
3495
2af02be7
KY
3496 if (!hp_pin)
3497 return;
a59d7199
KY
3498
3499 msleep(30);
2af02be7
KY
3500 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3501
3502 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3503 /* Headphone capless set to high power mode */
3504 alc_write_coef_idx(codec, 0x43, 0x9004);
3505
3506 snd_hda_codec_write(codec, hp_pin, 0,
3507 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3508
3509 if (hp_pin_sense)
3510 msleep(85);
3511
3512 snd_hda_codec_write(codec, hp_pin, 0,
3513 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3514
3515 if (hp_pin_sense)
3516 msleep(85);
3517 /* Index 0x46 Combo jack auto switch control 2 */
3518 /* 3k pull low control for Headset jack. */
98b24883 3519 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3520 /* Headphone capless set to normal mode */
3521 alc_write_coef_idx(codec, 0x43, 0x9614);
3522}
3523
3524static void alc283_shutup(struct hda_codec *codec)
3525{
3526 struct alc_spec *spec = codec->spec;
35a39f98 3527 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3528 bool hp_pin_sense;
2af02be7
KY
3529
3530 if (!hp_pin) {
3531 alc269_shutup(codec);
3532 return;
3533 }
3534
3535 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3536
3537 alc_write_coef_idx(codec, 0x43, 0x9004);
3538
b450b17c
HP
3539 /*depop hp during suspend*/
3540 alc_write_coef_idx(codec, 0x06, 0x2100);
3541
2af02be7
KY
3542 snd_hda_codec_write(codec, hp_pin, 0,
3543 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3544
3545 if (hp_pin_sense)
88011c09 3546 msleep(100);
2af02be7 3547
c0ca5ece
TI
3548 if (!spec->no_shutup_pins)
3549 snd_hda_codec_write(codec, hp_pin, 0,
3550 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3551
98b24883 3552 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3553
3554 if (hp_pin_sense)
88011c09 3555 msleep(100);
0435b3ff 3556 alc_auto_setup_eapd(codec, false);
c0ca5ece 3557 alc_shutup_pins(codec);
2af02be7
KY
3558 alc_write_coef_idx(codec, 0x43, 0x9614);
3559}
3560
4a219ef8
KY
3561static void alc256_init(struct hda_codec *codec)
3562{
3563 struct alc_spec *spec = codec->spec;
35a39f98 3564 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3565 bool hp_pin_sense;
3566
3567 if (!hp_pin)
6447c962 3568 hp_pin = 0x21;
4a219ef8
KY
3569
3570 msleep(30);
3571
3572 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3573
3574 if (hp_pin_sense)
3575 msleep(2);
3576
3577 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
6447c962
KY
3578 if (spec->ultra_low_power) {
3579 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3580 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3581 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3582 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3583 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3584 msleep(30);
3585 }
4a219ef8
KY
3586
3587 snd_hda_codec_write(codec, hp_pin, 0,
3588 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3589
6447c962 3590 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3591 msleep(85);
3592
3593 snd_hda_codec_write(codec, hp_pin, 0,
3594 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3595
6447c962 3596 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3597 msleep(100);
3598
3599 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3600 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3601 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3602 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3603 /*
3604 * Expose headphone mic (or possibly Line In on some machines) instead
3605 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3606 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3607 * this register.
3608 */
3609 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3610}
3611
3612static void alc256_shutup(struct hda_codec *codec)
3613{
3614 struct alc_spec *spec = codec->spec;
35a39f98 3615 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3616 bool hp_pin_sense;
3617
6447c962
KY
3618 if (!hp_pin)
3619 hp_pin = 0x21;
4a219ef8
KY
3620
3621 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3622
3623 if (hp_pin_sense)
3624 msleep(2);
3625
3626 snd_hda_codec_write(codec, hp_pin, 0,
3627 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3628
6447c962 3629 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3630 msleep(85);
3631
1c9609e3
TI
3632 /* 3k pull low control for Headset jack. */
3633 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3634 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3635 * when booting with headset plugged. So skip setting it for the codec alc257
3636 */
f30741cd
KHF
3637 if (codec->core.vendor_id != 0x10ec0236 &&
3638 codec->core.vendor_id != 0x10ec0257)
3f742490 3639 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3640
c0ca5ece
TI
3641 if (!spec->no_shutup_pins)
3642 snd_hda_codec_write(codec, hp_pin, 0,
3643 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3644
6447c962 3645 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3646 msleep(100);
3647
3648 alc_auto_setup_eapd(codec, false);
c0ca5ece 3649 alc_shutup_pins(codec);
6447c962
KY
3650 if (spec->ultra_low_power) {
3651 msleep(50);
3652 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3653 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3654 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3655 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3656 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3657 msleep(30);
3658 }
4a219ef8
KY
3659}
3660
3c24e483
KY
3661static void alc285_hp_init(struct hda_codec *codec)
3662{
3663 struct alc_spec *spec = codec->spec;
3664 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3665 int i, val;
3666 int coef38, coef0d, coef36;
3667
3668 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3669 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3670 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3671 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3672 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3673 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3674
3675 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3676
3677 if (hp_pin)
3678 snd_hda_codec_write(codec, hp_pin, 0,
3679 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3680
3681 msleep(130);
3682 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3683 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3684
3685 if (hp_pin)
3686 snd_hda_codec_write(codec, hp_pin, 0,
3687 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3688 msleep(10);
3689 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3690 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3691 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3692 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3693
3694 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3695 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3696 for (i = 0; i < 20 && val & 0x8000; i++) {
3697 msleep(50);
3698 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3699 } /* Wait for depop procedure finish */
3700
3701 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3702 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3703 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3704 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3705
3706 msleep(50);
3707 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3708}
3709
da911b1f
KY
3710static void alc225_init(struct hda_codec *codec)
3711{
3712 struct alc_spec *spec = codec->spec;
35a39f98 3713 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3714 bool hp1_pin_sense, hp2_pin_sense;
3715
60571929
KY
3716 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3717 spec->codec_variant != ALC269_TYPE_ALC245)
3c24e483
KY
3718 /* required only at boot or S3 and S4 resume time */
3719 if (!spec->done_hp_init ||
3720 is_s3_resume(codec) ||
3721 is_s4_resume(codec)) {
3722 alc285_hp_init(codec);
3723 spec->done_hp_init = true;
3724 }
3725
da911b1f 3726 if (!hp_pin)
d3ba58bb 3727 hp_pin = 0x21;
da911b1f
KY
3728 msleep(30);
3729
3730 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3731 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3732
3733 if (hp1_pin_sense || hp2_pin_sense)
3734 msleep(2);
3735
3736 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
d3ba58bb
KY
3737 if (spec->ultra_low_power) {
3738 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3739 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3740 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3741 msleep(30);
3742 }
da911b1f 3743
d3ba58bb 3744 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3745 snd_hda_codec_write(codec, hp_pin, 0,
3746 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3747 if (hp2_pin_sense)
3748 snd_hda_codec_write(codec, 0x16, 0,
3749 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3750
d3ba58bb 3751 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3752 msleep(85);
3753
d3ba58bb 3754 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3755 snd_hda_codec_write(codec, hp_pin, 0,
3756 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3757 if (hp2_pin_sense)
3758 snd_hda_codec_write(codec, 0x16, 0,
3759 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3760
d3ba58bb 3761 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3762 msleep(100);
3763
3764 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3765 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3766}
3767
3768static void alc225_shutup(struct hda_codec *codec)
3769{
3770 struct alc_spec *spec = codec->spec;
35a39f98 3771 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3772 bool hp1_pin_sense, hp2_pin_sense;
3773
d3ba58bb
KY
3774 if (!hp_pin)
3775 hp_pin = 0x21;
476c02e0
HW
3776
3777 alc_disable_headset_jack_key(codec);
da911b1f
KY
3778 /* 3k pull low control for Headset jack. */
3779 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3780
3781 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3782 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3783
3784 if (hp1_pin_sense || hp2_pin_sense)
3785 msleep(2);
3786
d3ba58bb 3787 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3788 snd_hda_codec_write(codec, hp_pin, 0,
3789 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3790 if (hp2_pin_sense)
3791 snd_hda_codec_write(codec, 0x16, 0,
3792 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3793
d3ba58bb 3794 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3795 msleep(85);
3796
d3ba58bb 3797 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3798 snd_hda_codec_write(codec, hp_pin, 0,
3799 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3800 if (hp2_pin_sense)
3801 snd_hda_codec_write(codec, 0x16, 0,
3802 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3803
d3ba58bb 3804 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3805 msleep(100);
3806
3807 alc_auto_setup_eapd(codec, false);
c0ca5ece 3808 alc_shutup_pins(codec);
d3ba58bb
KY
3809 if (spec->ultra_low_power) {
3810 msleep(50);
3811 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3812 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3813 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3814 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3815 msleep(30);
3816 }
476c02e0
HW
3817
3818 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3819 alc_enable_headset_jack_key(codec);
da911b1f
KY
3820}
3821
c2d6af53
KY
3822static void alc_default_init(struct hda_codec *codec)
3823{
3824 struct alc_spec *spec = codec->spec;
35a39f98 3825 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3826 bool hp_pin_sense;
3827
3828 if (!hp_pin)
3829 return;
3830
3831 msleep(30);
3832
3833 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3834
3835 if (hp_pin_sense)
3836 msleep(2);
3837
3838 snd_hda_codec_write(codec, hp_pin, 0,
3839 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3840
3841 if (hp_pin_sense)
3842 msleep(85);
3843
3844 snd_hda_codec_write(codec, hp_pin, 0,
3845 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3846
3847 if (hp_pin_sense)
3848 msleep(100);
3849}
3850
3851static void alc_default_shutup(struct hda_codec *codec)
3852{
3853 struct alc_spec *spec = codec->spec;
35a39f98 3854 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3855 bool hp_pin_sense;
3856
3857 if (!hp_pin) {
3858 alc269_shutup(codec);
3859 return;
3860 }
3861
3862 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3863
3864 if (hp_pin_sense)
3865 msleep(2);
3866
3867 snd_hda_codec_write(codec, hp_pin, 0,
3868 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3869
3870 if (hp_pin_sense)
3871 msleep(85);
3872
c0ca5ece
TI
3873 if (!spec->no_shutup_pins)
3874 snd_hda_codec_write(codec, hp_pin, 0,
3875 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3876
3877 if (hp_pin_sense)
3878 msleep(100);
3879
3880 alc_auto_setup_eapd(codec, false);
c0ca5ece 3881 alc_shutup_pins(codec);
c2d6af53
KY
3882}
3883
693abe11
KY
3884static void alc294_hp_init(struct hda_codec *codec)
3885{
3886 struct alc_spec *spec = codec->spec;
35a39f98 3887 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3888 int i, val;
3889
3890 if (!hp_pin)
3891 return;
3892
3893 snd_hda_codec_write(codec, hp_pin, 0,
3894 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3895
3896 msleep(100);
3897
c0ca5ece
TI
3898 if (!spec->no_shutup_pins)
3899 snd_hda_codec_write(codec, hp_pin, 0,
3900 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3901
3902 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3903 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3904
3905 /* Wait for depop procedure finish */
3906 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3907 for (i = 0; i < 20 && val & 0x0080; i++) {
3908 msleep(50);
3909 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3910 }
3911 /* Set HP depop to auto mode */
3912 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3913 msleep(50);
3914}
3915
3916static void alc294_init(struct hda_codec *codec)
3917{
3918 struct alc_spec *spec = codec->spec;
3919
f6ef4e0e
TI
3920 /* required only at boot or S4 resume time */
3921 if (!spec->done_hp_init ||
3922 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3923 alc294_hp_init(codec);
3924 spec->done_hp_init = true;
3925 }
3926 alc_default_init(codec);
3927}
3928
ad60d502
KY
3929static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3930 unsigned int val)
3931{
3932 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3933 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3934 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3935}
3936
3937static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3938{
3939 unsigned int val;
3940
3941 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3942 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3943 & 0xffff;
3944 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3945 << 16;
3946 return val;
3947}
3948
3949static void alc5505_dsp_halt(struct hda_codec *codec)
3950{
3951 unsigned int val;
3952
3953 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3954 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3955 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3956 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3957 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3958 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3959 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3960 val = alc5505_coef_get(codec, 0x6220);
3961 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3962}
3963
3964static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3965{
3966 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3967 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3968 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3969 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3970 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3971 alc5505_coef_set(codec, 0x880c, 0x00000004);
3972}
3973
3974static void alc5505_dsp_init(struct hda_codec *codec)
3975{
3976 unsigned int val;
3977
3978 alc5505_dsp_halt(codec);
3979 alc5505_dsp_back_from_halt(codec);
3980 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3981 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3982 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3983 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3984 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3985 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3986 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3987 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3988 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3989 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3990 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3991 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3992 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3993
3994 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3995 if (val <= 3)
3996 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3997 else
3998 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3999
4000 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4001 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4002 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4003 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4004 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4005 alc5505_coef_set(codec, 0x880c, 0x00000003);
4006 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
4007
4008#ifdef HALT_REALTEK_ALC5505
4009 alc5505_dsp_halt(codec);
4010#endif
ad60d502
KY
4011}
4012
cd63a5ff 4013#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
4014#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4015#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
4016#else
4017#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4018#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4019#endif
4020
2a43952a 4021#ifdef CONFIG_PM
ad60d502
KY
4022static int alc269_suspend(struct hda_codec *codec)
4023{
4024 struct alc_spec *spec = codec->spec;
4025
4026 if (spec->has_alc5505_dsp)
cd63a5ff 4027 alc5505_dsp_suspend(codec);
1873ebd3 4028
ad60d502
KY
4029 return alc_suspend(codec);
4030}
4031
1d045db9
TI
4032static int alc269_resume(struct hda_codec *codec)
4033{
adcc70b2
KY
4034 struct alc_spec *spec = codec->spec;
4035
1387e2d1
KY
4036 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4037 alc269vb_toggle_power_output(codec, 0);
4038 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4039 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4040 msleep(150);
4041 }
8c427226 4042
1d045db9 4043 codec->patch_ops.init(codec);
f1d4e28b 4044
1387e2d1
KY
4045 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4046 alc269vb_toggle_power_output(codec, 1);
4047 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4048 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4049 msleep(200);
4050 }
f1d4e28b 4051
1a462be5 4052 snd_hda_regmap_sync(codec);
1d045db9 4053 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4054
4055 /* on some machine, the BIOS will clear the codec gpio data when enter
4056 * suspend, and won't restore the data after resume, so we restore it
4057 * in the driver.
4058 */
d261eec8
TI
4059 if (spec->gpio_data)
4060 alc_write_gpio_data(codec);
f475371a 4061
ad60d502 4062 if (spec->has_alc5505_dsp)
cd63a5ff 4063 alc5505_dsp_resume(codec);
c5177c86 4064
1d045db9
TI
4065 return 0;
4066}
2a43952a 4067#endif /* CONFIG_PM */
f1d4e28b 4068
108cc108 4069static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4070 const struct hda_fixup *fix, int action)
108cc108
DH
4071{
4072 struct alc_spec *spec = codec->spec;
4073
1727a771 4074 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4075 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4076}
4077
fdcc968a
JMG
4078static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4079 const struct hda_fixup *fix,
4080 int action)
4081{
4082 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4083 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4084
4085 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4086 snd_hda_codec_set_pincfg(codec, 0x19,
4087 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4088 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4089}
4090
1d045db9 4091static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4092 const struct hda_fixup *fix, int action)
1d045db9 4093{
98b24883
TI
4094 if (action == HDA_FIXUP_ACT_INIT)
4095 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4096}
f1d4e28b 4097
7c478f03
DH
4098static void alc269_fixup_headset_mic(struct hda_codec *codec,
4099 const struct hda_fixup *fix, int action)
4100{
4101 struct alc_spec *spec = codec->spec;
4102
4103 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4104 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4105}
4106
1d045db9 4107static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4108 const struct hda_fixup *fix, int action)
1d045db9
TI
4109{
4110 static const struct hda_verb verbs[] = {
4111 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4112 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4113 {}
4114 };
4115 unsigned int cfg;
f1d4e28b 4116
7639a06c
TI
4117 if (strcmp(codec->core.chip_name, "ALC271X") &&
4118 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4119 return;
4120 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4121 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4122 snd_hda_sequence_write(codec, verbs);
4123}
f1d4e28b 4124
c8426b27
TI
4125/* Fix the speaker amp after resume, etc */
4126static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4127 const struct hda_fixup *fix,
4128 int action)
4129{
4130 if (action == HDA_FIXUP_ACT_INIT)
4131 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4132}
4133
017f2a10 4134static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4135 const struct hda_fixup *fix, int action)
017f2a10
TI
4136{
4137 struct alc_spec *spec = codec->spec;
4138
1727a771 4139 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4140 return;
4141
4142 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4143 * fix the sample rate of analog I/O to 44.1kHz
4144 */
08c189f2
TI
4145 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4146 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4147}
4148
adabb3ec 4149static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4150 const struct hda_fixup *fix, int action)
adabb3ec 4151{
adabb3ec
TI
4152 /* The digital-mic unit sends PDM (differential signal) instead of
4153 * the standard PCM, thus you can't record a valid mono stream as is.
4154 * Below is a workaround specific to ALC269 to control the dmic
4155 * signal source as mono.
4156 */
98b24883
TI
4157 if (action == HDA_FIXUP_ACT_INIT)
4158 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4159}
4160
24519911
TI
4161static void alc269_quanta_automute(struct hda_codec *codec)
4162{
08c189f2 4163 snd_hda_gen_update_outputs(codec);
24519911 4164
1687ccc8
TI
4165 alc_write_coef_idx(codec, 0x0c, 0x680);
4166 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4167}
4168
4169static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4170 const struct hda_fixup *fix, int action)
24519911
TI
4171{
4172 struct alc_spec *spec = codec->spec;
1727a771 4173 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4174 return;
08c189f2 4175 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4176}
4177
d240d1dc 4178static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4179 struct hda_jack_callback *jack)
d240d1dc
DH
4180{
4181 struct alc_spec *spec = codec->spec;
4182 int vref;
4183 msleep(200);
4184 snd_hda_gen_hp_automute(codec, jack);
4185
4186 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4187 msleep(100);
4188 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4189 vref);
4190 msleep(500);
4191 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4192 vref);
4193}
4194
a2ef03fe
TE
4195/*
4196 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4197 */
4198struct hda_alc298_mbxinit {
4199 unsigned char value_0x23;
4200 unsigned char value_0x25;
4201};
4202
4203static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4204 const struct hda_alc298_mbxinit *initval,
4205 bool first)
4206{
4207 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4208 alc_write_coef_idx(codec, 0x26, 0xb000);
4209
4210 if (first)
4211 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4212
4213 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4214 alc_write_coef_idx(codec, 0x26, 0xf000);
4215 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4216
4217 if (initval->value_0x23 != 0x1e)
4218 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4219
4220 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4221 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4222}
4223
4224static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4225 const struct hda_fixup *fix,
4226 int action)
4227{
4228 /* Initialization magic */
4229 static const struct hda_alc298_mbxinit dac_init[] = {
4230 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4231 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4232 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4233 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4234 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4235 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4236 {0x2f, 0x00},
4237 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4238 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4239 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4240 {}
4241 };
4242 const struct hda_alc298_mbxinit *seq;
4243
4244 if (action != HDA_FIXUP_ACT_INIT)
4245 return;
4246
4247 /* Start */
4248 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4249 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4250 alc_write_coef_idx(codec, 0x26, 0xf000);
4251 alc_write_coef_idx(codec, 0x22, 0x31);
4252 alc_write_coef_idx(codec, 0x23, 0x0b);
4253 alc_write_coef_idx(codec, 0x25, 0x00);
4254 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4255 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4256
4257 for (seq = dac_init; seq->value_0x23; seq++)
4258 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4259}
4260
d240d1dc
DH
4261static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4262 const struct hda_fixup *fix, int action)
4263{
4264 struct alc_spec *spec = codec->spec;
4265 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4266 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4267 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4268 }
4269}
4270
766538ac
TI
4271static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4272 bool polarity, bool on)
4273{
4274 unsigned int pinval;
4275
4276 if (!pin)
4277 return;
4278 if (polarity)
4279 on = !on;
4280 pinval = snd_hda_codec_get_pin_target(codec, pin);
4281 pinval &= ~AC_PINCTL_VREFEN;
4282 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4283 /* temporarily power up/down for setting VREF */
4284 snd_hda_power_up_pm(codec);
4285 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4286 snd_hda_power_down_pm(codec);
4287}
d240d1dc 4288
08fb0d0e 4289/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4290static int vref_mute_led_set(struct led_classdev *led_cdev,
4291 enum led_brightness brightness)
6d3cd5d4 4292{
8d3d1ece 4293 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4294 struct alc_spec *spec = codec->spec;
08fb0d0e 4295
766538ac
TI
4296 alc_update_vref_led(codec, spec->mute_led_nid,
4297 spec->mute_led_polarity, brightness);
8d3d1ece 4298 return 0;
6d3cd5d4
DH
4299}
4300
d5b6b65e
DH
4301/* Make sure the led works even in runtime suspend */
4302static unsigned int led_power_filter(struct hda_codec *codec,
4303 hda_nid_t nid,
4304 unsigned int power_state)
4305{
4306 struct alc_spec *spec = codec->spec;
4307
50dd9050
HW
4308 if (power_state != AC_PWRST_D3 || nid == 0 ||
4309 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4310 return power_state;
4311
4312 /* Set pin ctl again, it might have just been set to 0 */
4313 snd_hda_set_pin_ctl(codec, nid,
4314 snd_hda_codec_get_pin_target(codec, nid));
4315
cffd3966 4316 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4317}
4318
08fb0d0e
TI
4319static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4320 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4321{
4322 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4323 const struct dmi_device *dev = NULL;
4324
4325 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4326 return;
4327
4328 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4329 int pol, pin;
4330 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4331 continue;
4332 if (pin < 0x0a || pin >= 0x10)
4333 break;
4334 spec->mute_led_polarity = pol;
4335 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4336 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4337 codec->power_filter = led_power_filter;
4e76a883
TI
4338 codec_dbg(codec,
4339 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4340 spec->mute_led_polarity);
6d3cd5d4
DH
4341 break;
4342 }
4343}
4344
85c467dc
TI
4345static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4346 const struct hda_fixup *fix,
4347 int action, hda_nid_t pin)
d06ac143
DH
4348{
4349 struct alc_spec *spec = codec->spec;
85c467dc 4350
d06ac143
DH
4351 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4352 spec->mute_led_polarity = 0;
85c467dc 4353 spec->mute_led_nid = pin;
8d3d1ece 4354 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4355 codec->power_filter = led_power_filter;
d06ac143
DH
4356 }
4357}
4358
85c467dc
TI
4359static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4360 const struct hda_fixup *fix, int action)
4361{
4362 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4363}
4364
08fb0d0e
TI
4365static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4366 const struct hda_fixup *fix, int action)
420b0feb 4367{
85c467dc 4368 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4369}
4370
7f783bd5
TB
4371static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4372 const struct hda_fixup *fix, int action)
4373{
85c467dc 4374 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4375}
4376
0f32fd19
TI
4377/* update LED status via GPIO */
4378static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4379 int polarity, bool enabled)
9f5c6faf 4380{
dbd13179 4381 if (polarity)
0f32fd19 4382 enabled = !enabled;
d261eec8 4383 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4384}
4385
0f32fd19 4386/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4387static int gpio_mute_led_set(struct led_classdev *led_cdev,
4388 enum led_brightness brightness)
9f5c6faf 4389{
8d3d1ece 4390 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4391 struct alc_spec *spec = codec->spec;
9f5c6faf 4392
dbd13179 4393 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4394 spec->mute_led_polarity, !brightness);
4395 return 0;
0f32fd19 4396}
9f5c6faf 4397
0f32fd19 4398/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4399static int micmute_led_set(struct led_classdev *led_cdev,
4400 enum led_brightness brightness)
4401{
4402 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4403 struct alc_spec *spec = codec->spec;
4404
4405 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4406 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4407 return 0;
4408}
4409
01e4a275
TI
4410/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4411static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4412 int action,
4413 unsigned int mute_mask,
4414 unsigned int micmute_mask)
9f5c6faf
TI
4415{
4416 struct alc_spec *spec = codec->spec;
9f5c6faf 4417
01e4a275
TI
4418 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4419
4420 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4421 return;
4422 if (mute_mask) {
4423 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4424 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4425 }
4426 if (micmute_mask) {
4427 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4428 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4429 }
4430}
4431
e7d66cf7
JS
4432static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4433 const struct hda_fixup *fix, int action)
4434{
4435 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4436}
4437
01e4a275 4438static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4439 const struct hda_fixup *fix, int action)
4440{
01e4a275
TI
4441 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4442}
eaa8e5ef 4443
f5a88b0a
KHF
4444static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4445 const struct hda_fixup *fix, int action)
4446{
3e0650ab 4447 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4448}
4449
01e4a275
TI
4450static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4451 const struct hda_fixup *fix, int action)
4452{
4453 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4454}
4455
a0ccbc53
KY
4456static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4457 const struct hda_fixup *fix, int action)
4458{
4459 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4460}
4461
5fc462c3
JC
4462static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4463 const struct hda_fixup *fix, int action)
4464{
4465 struct alc_spec *spec = codec->spec;
4466
4467 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4468 spec->micmute_led_polarity = 1;
4469 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4470}
4471
8a503555
TI
4472/* turn on/off mic-mute LED per capture hook via VREF change */
4473static int vref_micmute_led_set(struct led_classdev *led_cdev,
4474 enum led_brightness brightness)
9c5dc3bf 4475{
8a503555 4476 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4477 struct alc_spec *spec = codec->spec;
9c5dc3bf 4478
766538ac
TI
4479 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4480 spec->micmute_led_polarity, brightness);
8a503555 4481 return 0;
9c5dc3bf
KY
4482}
4483
4484static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4485 const struct hda_fixup *fix, int action)
4486{
4487 struct alc_spec *spec = codec->spec;
9c5dc3bf 4488
01e4a275 4489 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4490 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4491 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4492 * enable headphone amp
4493 */
4494 spec->gpio_mask |= 0x10;
4495 spec->gpio_dir |= 0x10;
9c5dc3bf 4496 spec->cap_mute_led_nid = 0x18;
8a503555 4497 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4498 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4499 }
4500}
4501
7a5255f1
DH
4502static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4503 const struct hda_fixup *fix, int action)
4504{
7a5255f1 4505 struct alc_spec *spec = codec->spec;
7a5255f1 4506
01e4a275 4507 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4508 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4509 spec->cap_mute_led_nid = 0x18;
8a503555 4510 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4511 codec->power_filter = led_power_filter;
4512 }
4513}
4514
c3bb2b52
TI
4515/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4516 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4517 */
4518static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4519 const struct hda_fixup *fix, int action)
4520{
4521 struct alc_spec *spec = codec->spec;
4522
4523 switch (action) {
4524 case HDA_FIXUP_ACT_PRE_PROBE:
4525 spec->gpio_mask |= 0x01;
4526 spec->gpio_dir |= 0x01;
4527 break;
4528 case HDA_FIXUP_ACT_INIT:
4529 /* need to toggle GPIO to enable the amp */
4530 alc_update_gpio_data(codec, 0x01, true);
4531 msleep(100);
4532 alc_update_gpio_data(codec, 0x01, false);
4533 break;
4534 }
4535}
4536
622464c8
TI
4537/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4538static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4539 struct hda_codec *codec,
4540 struct snd_pcm_substream *substream,
4541 int action)
4542{
4543 switch (action) {
4544 case HDA_GEN_PCM_ACT_PREPARE:
4545 alc_update_gpio_data(codec, 0x04, true);
4546 break;
4547 case HDA_GEN_PCM_ACT_CLEANUP:
4548 alc_update_gpio_data(codec, 0x04, false);
4549 break;
4550 }
4551}
4552
4553static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4554 const struct hda_fixup *fix,
4555 int action)
4556{
4557 struct alc_spec *spec = codec->spec;
4558
4559 if (action == HDA_FIXUP_ACT_PROBE) {
4560 spec->gpio_mask |= 0x04;
4561 spec->gpio_dir |= 0x04;
4562 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4563 }
4564}
4565
766538ac
TI
4566static void alc_update_coef_led(struct hda_codec *codec,
4567 struct alc_coef_led *led,
4568 bool polarity, bool on)
4569{
4570 if (polarity)
4571 on = !on;
4572 /* temporarily power up/down for setting COEF bit */
4573 alc_update_coef_idx(codec, led->idx, led->mask,
4574 on ? led->on : led->off);
4575}
4576
431e76c3 4577/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4578static int coef_mute_led_set(struct led_classdev *led_cdev,
4579 enum led_brightness brightness)
431e76c3 4580{
8d3d1ece 4581 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4582 struct alc_spec *spec = codec->spec;
4583
766538ac
TI
4584 alc_update_coef_led(codec, &spec->mute_led_coef,
4585 spec->mute_led_polarity, brightness);
8d3d1ece 4586 return 0;
431e76c3
KY
4587}
4588
4589static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4590 const struct hda_fixup *fix,
4591 int action)
4592{
4593 struct alc_spec *spec = codec->spec;
4594
4595 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4596 spec->mute_led_polarity = 0;
766538ac
TI
4597 spec->mute_led_coef.idx = 0x0b;
4598 spec->mute_led_coef.mask = 1 << 3;
4599 spec->mute_led_coef.on = 1 << 3;
4600 spec->mute_led_coef.off = 0;
8d3d1ece 4601 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4602 }
4603}
4604
24164f43
KY
4605static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4606 const struct hda_fixup *fix,
4607 int action)
4608{
4609 struct alc_spec *spec = codec->spec;
4610
4611 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4612 spec->mute_led_polarity = 0;
766538ac
TI
4613 spec->mute_led_coef.idx = 0x34;
4614 spec->mute_led_coef.mask = 1 << 5;
4615 spec->mute_led_coef.on = 0;
4616 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4617 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4618 }
4619}
4620
431e76c3 4621/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4622static int coef_micmute_led_set(struct led_classdev *led_cdev,
4623 enum led_brightness brightness)
431e76c3 4624{
8a503555 4625 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4626 struct alc_spec *spec = codec->spec;
4627
766538ac
TI
4628 alc_update_coef_led(codec, &spec->mic_led_coef,
4629 spec->micmute_led_polarity, brightness);
8a503555 4630 return 0;
431e76c3
KY
4631}
4632
4633static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4634 const struct hda_fixup *fix, int action)
4635{
4636 struct alc_spec *spec = codec->spec;
4637
4638 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4639 spec->mic_led_coef.idx = 0x19;
4640 spec->mic_led_coef.mask = 1 << 13;
4641 spec->mic_led_coef.on = 1 << 13;
4642 spec->mic_led_coef.off = 0;
8a503555 4643 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4644 }
4645}
4646
24164f43
KY
4647static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4648 const struct hda_fixup *fix, int action)
4649{
4650 struct alc_spec *spec = codec->spec;
4651
4652 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4653 spec->mic_led_coef.idx = 0x35;
4654 spec->mic_led_coef.mask = 3 << 2;
4655 spec->mic_led_coef.on = 2 << 2;
4656 spec->mic_led_coef.off = 1 << 2;
8a503555 4657 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4658 }
4659}
4660
431e76c3
KY
4661static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4662 const struct hda_fixup *fix, int action)
4663{
4664 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4665 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4666}
4667
24164f43
KY
4668static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4669 const struct hda_fixup *fix, int action)
4670{
4671 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4672 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4673}
4674
75b62ab6
JW
4675static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4676 const struct hda_fixup *fix, int action)
4677{
4678 struct alc_spec *spec = codec->spec;
4679
4680 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4681 spec->cap_mute_led_nid = 0x1a;
4682 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4683 codec->power_filter = led_power_filter;
4684 }
4685}
4686
4687static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4688 const struct hda_fixup *fix, int action)
4689{
4690 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4691 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4692}
4693
a2d57ebe
KM
4694static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4695 const unsigned short coefs[2])
4696{
4697 alc_write_coef_idx(codec, 0x23, coefs[0]);
4698 alc_write_coef_idx(codec, 0x25, coefs[1]);
4699 alc_write_coef_idx(codec, 0x26, 0xb011);
4700}
4701
4702struct alc298_samsung_amp_desc {
4703 unsigned char nid;
4704 unsigned short init_seq[2][2];
4705};
4706
4707static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4708 const struct hda_fixup *fix, int action)
4709{
4710 int i, j;
4711 static const unsigned short init_seq[][2] = {
4712 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4713 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4714 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4715 { 0x41, 0x07 }, { 0x400, 0x1 }
4716 };
4717 static const struct alc298_samsung_amp_desc amps[] = {
4718 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4719 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4720 };
4721
4722 if (action != HDA_FIXUP_ACT_INIT)
4723 return;
4724
4725 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4726 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4727
4728 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4729 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4730
4731 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4732 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4733 }
4734}
4735
6a30abaa 4736#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4737static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4738 struct hda_jack_callback *event)
4739{
4740 struct alc_spec *spec = codec->spec;
4741
4742 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4743 send both key on and key off event for every interrupt. */
c7b60a89 4744 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4745 input_sync(spec->kb_dev);
c7b60a89 4746 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4747 input_sync(spec->kb_dev);
4748}
33f4acd3 4749
3694cb29
K
4750static int alc_register_micmute_input_device(struct hda_codec *codec)
4751{
4752 struct alc_spec *spec = codec->spec;
c7b60a89 4753 int i;
3694cb29
K
4754
4755 spec->kb_dev = input_allocate_device();
4756 if (!spec->kb_dev) {
4757 codec_err(codec, "Out of memory (input_allocate_device)\n");
4758 return -ENOMEM;
4759 }
c7b60a89
HW
4760
4761 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4762
3694cb29
K
4763 spec->kb_dev->name = "Microphone Mute Button";
4764 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4765 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4766 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4767 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4768 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4769 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4770
4771 if (input_register_device(spec->kb_dev)) {
4772 codec_err(codec, "input_register_device failed\n");
4773 input_free_device(spec->kb_dev);
4774 spec->kb_dev = NULL;
4775 return -ENOMEM;
4776 }
4777
4778 return 0;
4779}
4780
01e4a275
TI
4781/* GPIO1 = set according to SKU external amp
4782 * GPIO2 = mic mute hotkey
4783 * GPIO3 = mute LED
4784 * GPIO4 = mic mute LED
4785 */
33f4acd3
DH
4786static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4787 const struct hda_fixup *fix, int action)
4788{
33f4acd3
DH
4789 struct alc_spec *spec = codec->spec;
4790
01e4a275 4791 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4792 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4793 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4794 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4795 return;
33f4acd3 4796
01e4a275
TI
4797 spec->gpio_mask |= 0x06;
4798 spec->gpio_dir |= 0x02;
4799 spec->gpio_data |= 0x02;
7639a06c 4800 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4801 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4802 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4803 gpio2_mic_hotkey_event);
33f4acd3
DH
4804 return;
4805 }
4806
4807 if (!spec->kb_dev)
4808 return;
4809
4810 switch (action) {
33f4acd3
DH
4811 case HDA_FIXUP_ACT_FREE:
4812 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4813 spec->kb_dev = NULL;
4814 }
33f4acd3
DH
4815}
4816
01e4a275
TI
4817/* Line2 = mic mute hotkey
4818 * GPIO2 = mic mute LED
4819 */
3694cb29
K
4820static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4821 const struct hda_fixup *fix, int action)
4822{
3694cb29
K
4823 struct alc_spec *spec = codec->spec;
4824
01e4a275 4825 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4826 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4827 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4828 if (alc_register_micmute_input_device(codec) != 0)
4829 return;
4830
3694cb29
K
4831 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4832 gpio2_mic_hotkey_event);
3694cb29
K
4833 return;
4834 }
4835
4836 if (!spec->kb_dev)
4837 return;
4838
4839 switch (action) {
3694cb29
K
4840 case HDA_FIXUP_ACT_FREE:
4841 input_unregister_device(spec->kb_dev);
4842 spec->kb_dev = NULL;
4843 }
4844}
c469652b
TI
4845#else /* INPUT */
4846#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4847#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4848#endif /* INPUT */
3694cb29 4849
9c5dc3bf
KY
4850static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4851 const struct hda_fixup *fix, int action)
4852{
4853 struct alc_spec *spec = codec->spec;
4854
1bce62a6 4855 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4856 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4857 spec->cap_mute_led_nid = 0x18;
8a503555 4858 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4859 }
4860}
4861
6b0f95c4 4862static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4863 UPDATE_COEF(0x4a, 1<<8, 0),
4864 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4865 UPDATE_COEF(0x63, 3<<14, 3<<14),
4866 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4867 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4868 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4869 UPDATE_COEF(0x4a, 3<<10, 0),
4870 {}
4871};
4872
73bdd597
DH
4873static void alc_headset_mode_unplugged(struct hda_codec *codec)
4874{
92666d45 4875 struct alc_spec *spec = codec->spec;
6b0f95c4 4876 static const struct coef_fw coef0255[] = {
717f43d8 4877 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4878 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4879 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4880 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4881 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4882 {}
4883 };
6b0f95c4 4884 static const struct coef_fw coef0256[] = {
e69e7e03 4885 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4886 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4887 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4888 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4889 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4890 {}
4891 };
6b0f95c4 4892 static const struct coef_fw coef0233[] = {
54db6c39
TI
4893 WRITE_COEF(0x1b, 0x0c0b),
4894 WRITE_COEF(0x45, 0xc429),
4895 UPDATE_COEF(0x35, 0x4000, 0),
4896 WRITE_COEF(0x06, 0x2104),
4897 WRITE_COEF(0x1a, 0x0001),
4898 WRITE_COEF(0x26, 0x0004),
4899 WRITE_COEF(0x32, 0x42a3),
4900 {}
4901 };
6b0f95c4 4902 static const struct coef_fw coef0288[] = {
f3b70332
KY
4903 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4904 UPDATE_COEF(0x50, 0x2000, 0x2000),
4905 UPDATE_COEF(0x56, 0x0006, 0x0006),
4906 UPDATE_COEF(0x66, 0x0008, 0),
4907 UPDATE_COEF(0x67, 0x2000, 0),
4908 {}
4909 };
6b0f95c4 4910 static const struct coef_fw coef0298[] = {
89542936
KY
4911 UPDATE_COEF(0x19, 0x1300, 0x0300),
4912 {}
4913 };
6b0f95c4 4914 static const struct coef_fw coef0292[] = {
54db6c39
TI
4915 WRITE_COEF(0x76, 0x000e),
4916 WRITE_COEF(0x6c, 0x2400),
4917 WRITE_COEF(0x18, 0x7308),
4918 WRITE_COEF(0x6b, 0xc429),
4919 {}
4920 };
6b0f95c4 4921 static const struct coef_fw coef0293[] = {
54db6c39
TI
4922 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4923 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4924 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4925 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4926 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4927 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4928 {}
4929 };
6b0f95c4 4930 static const struct coef_fw coef0668[] = {
54db6c39
TI
4931 WRITE_COEF(0x15, 0x0d40),
4932 WRITE_COEF(0xb7, 0x802b),
4933 {}
4934 };
6b0f95c4 4935 static const struct coef_fw coef0225[] = {
5a36767a 4936 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
4937 {}
4938 };
6b0f95c4 4939 static const struct coef_fw coef0274[] = {
71683c32
KY
4940 UPDATE_COEF(0x4a, 0x0100, 0),
4941 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4942 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4943 UPDATE_COEF(0x4a, 0x0010, 0),
4944 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4945 WRITE_COEF(0x45, 0x5289),
4946 UPDATE_COEF(0x4a, 0x0c00, 0),
4947 {}
4948 };
54db6c39 4949
92666d45
KY
4950 if (spec->no_internal_mic_pin) {
4951 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4952 return;
4953 }
4954
7639a06c 4955 switch (codec->core.vendor_id) {
9a22a8f5 4956 case 0x10ec0255:
e69e7e03
KY
4957 alc_process_coef_fw(codec, coef0255);
4958 break;
1948fc06 4959 case 0x10ec0230:
736f20a7 4960 case 0x10ec0236:
7081adf3 4961 case 0x10ec0256:
527f4643 4962 case 0x19e58326:
e69e7e03 4963 alc_process_coef_fw(codec, coef0256);
9a22a8f5 4964 break;
71683c32
KY
4965 case 0x10ec0234:
4966 case 0x10ec0274:
4967 case 0x10ec0294:
4968 alc_process_coef_fw(codec, coef0274);
4969 break;
13fd08a3 4970 case 0x10ec0233:
73bdd597 4971 case 0x10ec0283:
54db6c39 4972 alc_process_coef_fw(codec, coef0233);
73bdd597 4973 break;
f3b70332
KY
4974 case 0x10ec0286:
4975 case 0x10ec0288:
89542936
KY
4976 alc_process_coef_fw(codec, coef0288);
4977 break;
1a5bc8d9 4978 case 0x10ec0298:
89542936 4979 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
4980 alc_process_coef_fw(codec, coef0288);
4981 break;
73bdd597 4982 case 0x10ec0292:
54db6c39 4983 alc_process_coef_fw(codec, coef0292);
73bdd597 4984 break;
a22aa26f 4985 case 0x10ec0293:
54db6c39 4986 alc_process_coef_fw(codec, coef0293);
a22aa26f 4987 break;
73bdd597 4988 case 0x10ec0668:
54db6c39 4989 alc_process_coef_fw(codec, coef0668);
73bdd597 4990 break;
c2b691ee 4991 case 0x10ec0215:
4cc9b9d6 4992 case 0x10ec0225:
c2b691ee 4993 case 0x10ec0285:
7d727869 4994 case 0x10ec0295:
c2b691ee 4995 case 0x10ec0289:
28f1f9b2 4996 case 0x10ec0299:
4d4b0c52 4997 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
4998 alc_process_coef_fw(codec, coef0225);
4999 break;
78f4f7c2
KY
5000 case 0x10ec0867:
5001 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5002 break;
73bdd597 5003 }
4e76a883 5004 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
5005}
5006
5007
5008static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5009 hda_nid_t mic_pin)
5010{
6b0f95c4 5011 static const struct coef_fw coef0255[] = {
54db6c39
TI
5012 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5013 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5014 {}
5015 };
6b0f95c4 5016 static const struct coef_fw coef0256[] = {
717f43d8
KY
5017 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5018 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5019 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5020 {}
5021 };
6b0f95c4 5022 static const struct coef_fw coef0233[] = {
54db6c39
TI
5023 UPDATE_COEF(0x35, 0, 1<<14),
5024 WRITE_COEF(0x06, 0x2100),
5025 WRITE_COEF(0x1a, 0x0021),
5026 WRITE_COEF(0x26, 0x008c),
5027 {}
5028 };
6b0f95c4 5029 static const struct coef_fw coef0288[] = {
89542936 5030 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
5031 UPDATE_COEF(0x50, 0x2000, 0),
5032 UPDATE_COEF(0x56, 0x0006, 0),
5033 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5034 UPDATE_COEF(0x66, 0x0008, 0x0008),
5035 UPDATE_COEF(0x67, 0x2000, 0x2000),
5036 {}
5037 };
6b0f95c4 5038 static const struct coef_fw coef0292[] = {
54db6c39
TI
5039 WRITE_COEF(0x19, 0xa208),
5040 WRITE_COEF(0x2e, 0xacf0),
5041 {}
5042 };
6b0f95c4 5043 static const struct coef_fw coef0293[] = {
54db6c39
TI
5044 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5045 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5046 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5047 {}
5048 };
6b0f95c4 5049 static const struct coef_fw coef0688[] = {
54db6c39
TI
5050 WRITE_COEF(0xb7, 0x802b),
5051 WRITE_COEF(0xb5, 0x1040),
5052 UPDATE_COEF(0xc3, 0, 1<<12),
5053 {}
5054 };
6b0f95c4 5055 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
5056 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5057 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5058 UPDATE_COEF(0x63, 3<<14, 0),
5059 {}
5060 };
6b0f95c4 5061 static const struct coef_fw coef0274[] = {
71683c32
KY
5062 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5063 UPDATE_COEF(0x4a, 0x0010, 0),
5064 UPDATE_COEF(0x6b, 0xf000, 0),
5065 {}
5066 };
54db6c39 5067
7639a06c 5068 switch (codec->core.vendor_id) {
9a22a8f5
KY
5069 case 0x10ec0255:
5070 alc_write_coef_idx(codec, 0x45, 0xc489);
5071 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5072 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5073 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5074 break;
1948fc06 5075 case 0x10ec0230:
717f43d8
KY
5076 case 0x10ec0236:
5077 case 0x10ec0256:
527f4643 5078 case 0x19e58326:
717f43d8
KY
5079 alc_write_coef_idx(codec, 0x45, 0xc489);
5080 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5081 alc_process_coef_fw(codec, coef0256);
5082 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5083 break;
71683c32
KY
5084 case 0x10ec0234:
5085 case 0x10ec0274:
5086 case 0x10ec0294:
5087 alc_write_coef_idx(codec, 0x45, 0x4689);
5088 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5089 alc_process_coef_fw(codec, coef0274);
5090 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5091 break;
13fd08a3 5092 case 0x10ec0233:
73bdd597
DH
5093 case 0x10ec0283:
5094 alc_write_coef_idx(codec, 0x45, 0xc429);
5095 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5096 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5097 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5098 break;
f3b70332
KY
5099 case 0x10ec0286:
5100 case 0x10ec0288:
1a5bc8d9 5101 case 0x10ec0298:
f3b70332
KY
5102 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5103 alc_process_coef_fw(codec, coef0288);
5104 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5105 break;
73bdd597
DH
5106 case 0x10ec0292:
5107 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5108 alc_process_coef_fw(codec, coef0292);
73bdd597 5109 break;
a22aa26f
KY
5110 case 0x10ec0293:
5111 /* Set to TRS mode */
5112 alc_write_coef_idx(codec, 0x45, 0xc429);
5113 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5114 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5115 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5116 break;
78f4f7c2
KY
5117 case 0x10ec0867:
5118 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5119 fallthrough;
9eb5d0e6 5120 case 0x10ec0221:
1f8b46cd
DH
5121 case 0x10ec0662:
5122 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5123 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5124 break;
73bdd597
DH
5125 case 0x10ec0668:
5126 alc_write_coef_idx(codec, 0x11, 0x0001);
5127 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5128 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5129 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5130 break;
c2b691ee 5131 case 0x10ec0215:
4cc9b9d6 5132 case 0x10ec0225:
c2b691ee 5133 case 0x10ec0285:
7d727869 5134 case 0x10ec0295:
c2b691ee 5135 case 0x10ec0289:
28f1f9b2 5136 case 0x10ec0299:
5a36767a 5137 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5138 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5139 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5140 alc_process_coef_fw(codec, coef0225);
5141 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5142 break;
73bdd597 5143 }
4e76a883 5144 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5145}
5146
5147static void alc_headset_mode_default(struct hda_codec *codec)
5148{
6b0f95c4 5149 static const struct coef_fw coef0225[] = {
5a36767a
KY
5150 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5151 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5152 UPDATE_COEF(0x49, 3<<8, 0<<8),
5153 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5154 UPDATE_COEF(0x63, 3<<14, 0),
5155 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5156 {}
5157 };
6b0f95c4 5158 static const struct coef_fw coef0255[] = {
54db6c39
TI
5159 WRITE_COEF(0x45, 0xc089),
5160 WRITE_COEF(0x45, 0xc489),
5161 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5162 WRITE_COEF(0x49, 0x0049),
5163 {}
5164 };
6b0f95c4 5165 static const struct coef_fw coef0256[] = {
717f43d8
KY
5166 WRITE_COEF(0x45, 0xc489),
5167 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5168 WRITE_COEF(0x49, 0x0049),
5169 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5170 WRITE_COEF(0x06, 0x6100),
5171 {}
5172 };
6b0f95c4 5173 static const struct coef_fw coef0233[] = {
54db6c39
TI
5174 WRITE_COEF(0x06, 0x2100),
5175 WRITE_COEF(0x32, 0x4ea3),
5176 {}
5177 };
6b0f95c4 5178 static const struct coef_fw coef0288[] = {
f3b70332
KY
5179 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5180 UPDATE_COEF(0x50, 0x2000, 0x2000),
5181 UPDATE_COEF(0x56, 0x0006, 0x0006),
5182 UPDATE_COEF(0x66, 0x0008, 0),
5183 UPDATE_COEF(0x67, 0x2000, 0),
5184 {}
5185 };
6b0f95c4 5186 static const struct coef_fw coef0292[] = {
54db6c39
TI
5187 WRITE_COEF(0x76, 0x000e),
5188 WRITE_COEF(0x6c, 0x2400),
5189 WRITE_COEF(0x6b, 0xc429),
5190 WRITE_COEF(0x18, 0x7308),
5191 {}
5192 };
6b0f95c4 5193 static const struct coef_fw coef0293[] = {
54db6c39
TI
5194 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5195 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5196 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5197 {}
5198 };
6b0f95c4 5199 static const struct coef_fw coef0688[] = {
54db6c39
TI
5200 WRITE_COEF(0x11, 0x0041),
5201 WRITE_COEF(0x15, 0x0d40),
5202 WRITE_COEF(0xb7, 0x802b),
5203 {}
5204 };
6b0f95c4 5205 static const struct coef_fw coef0274[] = {
71683c32
KY
5206 WRITE_COEF(0x45, 0x4289),
5207 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5208 UPDATE_COEF(0x6b, 0x0f00, 0),
5209 UPDATE_COEF(0x49, 0x0300, 0x0300),
5210 {}
5211 };
54db6c39 5212
7639a06c 5213 switch (codec->core.vendor_id) {
c2b691ee 5214 case 0x10ec0215:
2ae95577 5215 case 0x10ec0225:
c2b691ee 5216 case 0x10ec0285:
7d727869 5217 case 0x10ec0295:
c2b691ee 5218 case 0x10ec0289:
28f1f9b2 5219 case 0x10ec0299:
5a36767a 5220 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5221 alc_process_coef_fw(codec, coef0225);
5222 break;
9a22a8f5 5223 case 0x10ec0255:
54db6c39 5224 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5225 break;
1948fc06 5226 case 0x10ec0230:
717f43d8
KY
5227 case 0x10ec0236:
5228 case 0x10ec0256:
527f4643 5229 case 0x19e58326:
717f43d8
KY
5230 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5231 alc_write_coef_idx(codec, 0x45, 0xc089);
5232 msleep(50);
5233 alc_process_coef_fw(codec, coef0256);
5234 break;
71683c32
KY
5235 case 0x10ec0234:
5236 case 0x10ec0274:
5237 case 0x10ec0294:
5238 alc_process_coef_fw(codec, coef0274);
5239 break;
13fd08a3 5240 case 0x10ec0233:
73bdd597 5241 case 0x10ec0283:
54db6c39 5242 alc_process_coef_fw(codec, coef0233);
73bdd597 5243 break;
f3b70332
KY
5244 case 0x10ec0286:
5245 case 0x10ec0288:
1a5bc8d9 5246 case 0x10ec0298:
f3b70332
KY
5247 alc_process_coef_fw(codec, coef0288);
5248 break;
73bdd597 5249 case 0x10ec0292:
54db6c39 5250 alc_process_coef_fw(codec, coef0292);
73bdd597 5251 break;
a22aa26f 5252 case 0x10ec0293:
54db6c39 5253 alc_process_coef_fw(codec, coef0293);
a22aa26f 5254 break;
73bdd597 5255 case 0x10ec0668:
54db6c39 5256 alc_process_coef_fw(codec, coef0688);
73bdd597 5257 break;
78f4f7c2
KY
5258 case 0x10ec0867:
5259 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5260 break;
73bdd597 5261 }
4e76a883 5262 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5263}
5264
5265/* Iphone type */
5266static void alc_headset_mode_ctia(struct hda_codec *codec)
5267{
89542936
KY
5268 int val;
5269
6b0f95c4 5270 static const struct coef_fw coef0255[] = {
54db6c39
TI
5271 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5272 WRITE_COEF(0x1b, 0x0c2b),
5273 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5274 {}
5275 };
6b0f95c4 5276 static const struct coef_fw coef0256[] = {
e69e7e03 5277 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5278 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5279 {}
5280 };
6b0f95c4 5281 static const struct coef_fw coef0233[] = {
54db6c39
TI
5282 WRITE_COEF(0x45, 0xd429),
5283 WRITE_COEF(0x1b, 0x0c2b),
5284 WRITE_COEF(0x32, 0x4ea3),
5285 {}
5286 };
6b0f95c4 5287 static const struct coef_fw coef0288[] = {
f3b70332
KY
5288 UPDATE_COEF(0x50, 0x2000, 0x2000),
5289 UPDATE_COEF(0x56, 0x0006, 0x0006),
5290 UPDATE_COEF(0x66, 0x0008, 0),
5291 UPDATE_COEF(0x67, 0x2000, 0),
5292 {}
5293 };
6b0f95c4 5294 static const struct coef_fw coef0292[] = {
54db6c39
TI
5295 WRITE_COEF(0x6b, 0xd429),
5296 WRITE_COEF(0x76, 0x0008),
5297 WRITE_COEF(0x18, 0x7388),
5298 {}
5299 };
6b0f95c4 5300 static const struct coef_fw coef0293[] = {
54db6c39
TI
5301 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5302 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5303 {}
5304 };
6b0f95c4 5305 static const struct coef_fw coef0688[] = {
54db6c39
TI
5306 WRITE_COEF(0x11, 0x0001),
5307 WRITE_COEF(0x15, 0x0d60),
5308 WRITE_COEF(0xc3, 0x0000),
5309 {}
5310 };
6b0f95c4 5311 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5312 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5313 UPDATE_COEF(0x63, 3<<14, 2<<14),
5314 {}
5315 };
6b0f95c4 5316 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5317 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5318 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5319 {}
5320 };
54db6c39 5321
7639a06c 5322 switch (codec->core.vendor_id) {
9a22a8f5 5323 case 0x10ec0255:
54db6c39 5324 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5325 break;
1948fc06 5326 case 0x10ec0230:
736f20a7 5327 case 0x10ec0236:
e69e7e03 5328 case 0x10ec0256:
527f4643 5329 case 0x19e58326:
e69e7e03
KY
5330 alc_process_coef_fw(codec, coef0256);
5331 break;
71683c32
KY
5332 case 0x10ec0234:
5333 case 0x10ec0274:
5334 case 0x10ec0294:
5335 alc_write_coef_idx(codec, 0x45, 0xd689);
5336 break;
13fd08a3 5337 case 0x10ec0233:
73bdd597 5338 case 0x10ec0283:
54db6c39 5339 alc_process_coef_fw(codec, coef0233);
73bdd597 5340 break;
1a5bc8d9 5341 case 0x10ec0298:
89542936
KY
5342 val = alc_read_coef_idx(codec, 0x50);
5343 if (val & (1 << 12)) {
5344 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5345 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5346 msleep(300);
5347 } else {
5348 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5349 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5350 msleep(300);
5351 }
5352 break;
f3b70332
KY
5353 case 0x10ec0286:
5354 case 0x10ec0288:
5355 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5356 msleep(300);
5357 alc_process_coef_fw(codec, coef0288);
5358 break;
73bdd597 5359 case 0x10ec0292:
54db6c39 5360 alc_process_coef_fw(codec, coef0292);
73bdd597 5361 break;
a22aa26f 5362 case 0x10ec0293:
54db6c39 5363 alc_process_coef_fw(codec, coef0293);
a22aa26f 5364 break;
73bdd597 5365 case 0x10ec0668:
54db6c39 5366 alc_process_coef_fw(codec, coef0688);
73bdd597 5367 break;
c2b691ee 5368 case 0x10ec0215:
4cc9b9d6 5369 case 0x10ec0225:
c2b691ee 5370 case 0x10ec0285:
7d727869 5371 case 0x10ec0295:
c2b691ee 5372 case 0x10ec0289:
28f1f9b2 5373 case 0x10ec0299:
5a36767a
KY
5374 val = alc_read_coef_idx(codec, 0x45);
5375 if (val & (1 << 9))
5376 alc_process_coef_fw(codec, coef0225_2);
5377 else
5378 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5379 break;
78f4f7c2
KY
5380 case 0x10ec0867:
5381 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5382 break;
73bdd597 5383 }
4e76a883 5384 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5385}
5386
5387/* Nokia type */
5388static void alc_headset_mode_omtp(struct hda_codec *codec)
5389{
6b0f95c4 5390 static const struct coef_fw coef0255[] = {
54db6c39
TI
5391 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5392 WRITE_COEF(0x1b, 0x0c2b),
5393 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5394 {}
5395 };
6b0f95c4 5396 static const struct coef_fw coef0256[] = {
e69e7e03 5397 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5398 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5399 {}
5400 };
6b0f95c4 5401 static const struct coef_fw coef0233[] = {
54db6c39
TI
5402 WRITE_COEF(0x45, 0xe429),
5403 WRITE_COEF(0x1b, 0x0c2b),
5404 WRITE_COEF(0x32, 0x4ea3),
5405 {}
5406 };
6b0f95c4 5407 static const struct coef_fw coef0288[] = {
f3b70332
KY
5408 UPDATE_COEF(0x50, 0x2000, 0x2000),
5409 UPDATE_COEF(0x56, 0x0006, 0x0006),
5410 UPDATE_COEF(0x66, 0x0008, 0),
5411 UPDATE_COEF(0x67, 0x2000, 0),
5412 {}
5413 };
6b0f95c4 5414 static const struct coef_fw coef0292[] = {
54db6c39
TI
5415 WRITE_COEF(0x6b, 0xe429),
5416 WRITE_COEF(0x76, 0x0008),
5417 WRITE_COEF(0x18, 0x7388),
5418 {}
5419 };
6b0f95c4 5420 static const struct coef_fw coef0293[] = {
54db6c39
TI
5421 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5422 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5423 {}
5424 };
6b0f95c4 5425 static const struct coef_fw coef0688[] = {
54db6c39
TI
5426 WRITE_COEF(0x11, 0x0001),
5427 WRITE_COEF(0x15, 0x0d50),
5428 WRITE_COEF(0xc3, 0x0000),
5429 {}
5430 };
6b0f95c4 5431 static const struct coef_fw coef0225[] = {
4cc9b9d6 5432 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5433 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5434 {}
5435 };
54db6c39 5436
7639a06c 5437 switch (codec->core.vendor_id) {
9a22a8f5 5438 case 0x10ec0255:
54db6c39 5439 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5440 break;
1948fc06 5441 case 0x10ec0230:
736f20a7 5442 case 0x10ec0236:
e69e7e03 5443 case 0x10ec0256:
527f4643 5444 case 0x19e58326:
e69e7e03
KY
5445 alc_process_coef_fw(codec, coef0256);
5446 break;
71683c32
KY
5447 case 0x10ec0234:
5448 case 0x10ec0274:
5449 case 0x10ec0294:
5450 alc_write_coef_idx(codec, 0x45, 0xe689);
5451 break;
13fd08a3 5452 case 0x10ec0233:
73bdd597 5453 case 0x10ec0283:
54db6c39 5454 alc_process_coef_fw(codec, coef0233);
73bdd597 5455 break;
1a5bc8d9
KY
5456 case 0x10ec0298:
5457 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5458 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5459 msleep(300);
5460 break;
f3b70332
KY
5461 case 0x10ec0286:
5462 case 0x10ec0288:
5463 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5464 msleep(300);
5465 alc_process_coef_fw(codec, coef0288);
5466 break;
73bdd597 5467 case 0x10ec0292:
54db6c39 5468 alc_process_coef_fw(codec, coef0292);
73bdd597 5469 break;
a22aa26f 5470 case 0x10ec0293:
54db6c39 5471 alc_process_coef_fw(codec, coef0293);
a22aa26f 5472 break;
73bdd597 5473 case 0x10ec0668:
54db6c39 5474 alc_process_coef_fw(codec, coef0688);
73bdd597 5475 break;
c2b691ee 5476 case 0x10ec0215:
4cc9b9d6 5477 case 0x10ec0225:
c2b691ee 5478 case 0x10ec0285:
7d727869 5479 case 0x10ec0295:
c2b691ee 5480 case 0x10ec0289:
28f1f9b2 5481 case 0x10ec0299:
4cc9b9d6
KY
5482 alc_process_coef_fw(codec, coef0225);
5483 break;
73bdd597 5484 }
4e76a883 5485 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5486}
5487
5488static void alc_determine_headset_type(struct hda_codec *codec)
5489{
5490 int val;
5491 bool is_ctia = false;
5492 struct alc_spec *spec = codec->spec;
6b0f95c4 5493 static const struct coef_fw coef0255[] = {
54db6c39
TI
5494 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5495 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5496 conteol) */
5497 {}
5498 };
6b0f95c4 5499 static const struct coef_fw coef0288[] = {
f3b70332
KY
5500 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5501 {}
5502 };
6b0f95c4 5503 static const struct coef_fw coef0298[] = {
89542936
KY
5504 UPDATE_COEF(0x50, 0x2000, 0x2000),
5505 UPDATE_COEF(0x56, 0x0006, 0x0006),
5506 UPDATE_COEF(0x66, 0x0008, 0),
5507 UPDATE_COEF(0x67, 0x2000, 0),
5508 UPDATE_COEF(0x19, 0x1300, 0x1300),
5509 {}
5510 };
6b0f95c4 5511 static const struct coef_fw coef0293[] = {
54db6c39
TI
5512 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5513 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5514 {}
5515 };
6b0f95c4 5516 static const struct coef_fw coef0688[] = {
54db6c39
TI
5517 WRITE_COEF(0x11, 0x0001),
5518 WRITE_COEF(0xb7, 0x802b),
5519 WRITE_COEF(0x15, 0x0d60),
5520 WRITE_COEF(0xc3, 0x0c00),
5521 {}
5522 };
6b0f95c4 5523 static const struct coef_fw coef0274[] = {
71683c32
KY
5524 UPDATE_COEF(0x4a, 0x0010, 0),
5525 UPDATE_COEF(0x4a, 0x8000, 0),
5526 WRITE_COEF(0x45, 0xd289),
5527 UPDATE_COEF(0x49, 0x0300, 0x0300),
5528 {}
5529 };
73bdd597 5530
92666d45
KY
5531 if (spec->no_internal_mic_pin) {
5532 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5533 return;
5534 }
5535
7639a06c 5536 switch (codec->core.vendor_id) {
9a22a8f5 5537 case 0x10ec0255:
717f43d8
KY
5538 alc_process_coef_fw(codec, coef0255);
5539 msleep(300);
5540 val = alc_read_coef_idx(codec, 0x46);
5541 is_ctia = (val & 0x0070) == 0x0070;
5542 break;
1948fc06 5543 case 0x10ec0230:
717f43d8 5544 case 0x10ec0236:
7081adf3 5545 case 0x10ec0256:
527f4643 5546 case 0x19e58326:
717f43d8
KY
5547 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5548 alc_write_coef_idx(codec, 0x06, 0x6104);
5549 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5550
5551 snd_hda_codec_write(codec, 0x21, 0,
5552 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5553 msleep(80);
5554 snd_hda_codec_write(codec, 0x21, 0,
5555 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5556
54db6c39 5557 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5558 msleep(300);
5559 val = alc_read_coef_idx(codec, 0x46);
5560 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5561
5562 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5563 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5564
5565 snd_hda_codec_write(codec, 0x21, 0,
5566 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5567 msleep(80);
5568 snd_hda_codec_write(codec, 0x21, 0,
5569 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5570 break;
71683c32
KY
5571 case 0x10ec0234:
5572 case 0x10ec0274:
5573 case 0x10ec0294:
5574 alc_process_coef_fw(codec, coef0274);
febf2256 5575 msleep(850);
71683c32
KY
5576 val = alc_read_coef_idx(codec, 0x46);
5577 is_ctia = (val & 0x00f0) == 0x00f0;
5578 break;
13fd08a3 5579 case 0x10ec0233:
73bdd597
DH
5580 case 0x10ec0283:
5581 alc_write_coef_idx(codec, 0x45, 0xd029);
5582 msleep(300);
5583 val = alc_read_coef_idx(codec, 0x46);
5584 is_ctia = (val & 0x0070) == 0x0070;
5585 break;
1a5bc8d9 5586 case 0x10ec0298:
89542936
KY
5587 snd_hda_codec_write(codec, 0x21, 0,
5588 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5589 msleep(100);
5590 snd_hda_codec_write(codec, 0x21, 0,
5591 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5592 msleep(200);
5593
5594 val = alc_read_coef_idx(codec, 0x50);
5595 if (val & (1 << 12)) {
5596 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5597 alc_process_coef_fw(codec, coef0288);
5598 msleep(350);
5599 val = alc_read_coef_idx(codec, 0x50);
5600 is_ctia = (val & 0x0070) == 0x0070;
5601 } else {
5602 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5603 alc_process_coef_fw(codec, coef0288);
5604 msleep(350);
5605 val = alc_read_coef_idx(codec, 0x50);
5606 is_ctia = (val & 0x0070) == 0x0070;
5607 }
5608 alc_process_coef_fw(codec, coef0298);
5609 snd_hda_codec_write(codec, 0x21, 0,
5610 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5611 msleep(75);
5612 snd_hda_codec_write(codec, 0x21, 0,
5613 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5614 break;
f3b70332
KY
5615 case 0x10ec0286:
5616 case 0x10ec0288:
5617 alc_process_coef_fw(codec, coef0288);
5618 msleep(350);
5619 val = alc_read_coef_idx(codec, 0x50);
5620 is_ctia = (val & 0x0070) == 0x0070;
5621 break;
73bdd597
DH
5622 case 0x10ec0292:
5623 alc_write_coef_idx(codec, 0x6b, 0xd429);
5624 msleep(300);
5625 val = alc_read_coef_idx(codec, 0x6c);
5626 is_ctia = (val & 0x001c) == 0x001c;
5627 break;
a22aa26f 5628 case 0x10ec0293:
54db6c39 5629 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5630 msleep(300);
5631 val = alc_read_coef_idx(codec, 0x46);
5632 is_ctia = (val & 0x0070) == 0x0070;
5633 break;
73bdd597 5634 case 0x10ec0668:
54db6c39 5635 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5636 msleep(300);
5637 val = alc_read_coef_idx(codec, 0xbe);
5638 is_ctia = (val & 0x1c02) == 0x1c02;
5639 break;
c2b691ee 5640 case 0x10ec0215:
4cc9b9d6 5641 case 0x10ec0225:
c2b691ee 5642 case 0x10ec0285:
7d727869 5643 case 0x10ec0295:
c2b691ee 5644 case 0x10ec0289:
28f1f9b2 5645 case 0x10ec0299:
da911b1f
KY
5646 snd_hda_codec_write(codec, 0x21, 0,
5647 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5648 msleep(80);
5649 snd_hda_codec_write(codec, 0x21, 0,
5650 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5651
5a36767a
KY
5652 alc_process_coef_fw(codec, alc225_pre_hsmode);
5653 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5654 val = alc_read_coef_idx(codec, 0x45);
5655 if (val & (1 << 9)) {
5656 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5657 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5658 msleep(800);
5659 val = alc_read_coef_idx(codec, 0x46);
5660 is_ctia = (val & 0x00f0) == 0x00f0;
5661 } else {
5662 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5663 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5664 msleep(800);
5665 val = alc_read_coef_idx(codec, 0x46);
5666 is_ctia = (val & 0x00f0) == 0x00f0;
5667 }
5668 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5669 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5670 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5671
5672 snd_hda_codec_write(codec, 0x21, 0,
5673 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5674 msleep(80);
5675 snd_hda_codec_write(codec, 0x21, 0,
5676 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5677 break;
78f4f7c2
KY
5678 case 0x10ec0867:
5679 is_ctia = true;
5680 break;
73bdd597
DH
5681 }
5682
4e76a883 5683 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5684 is_ctia ? "yes" : "no");
5685 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5686}
5687
5688static void alc_update_headset_mode(struct hda_codec *codec)
5689{
5690 struct alc_spec *spec = codec->spec;
5691
5692 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5693 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5694
5695 int new_headset_mode;
5696
5697 if (!snd_hda_jack_detect(codec, hp_pin))
5698 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5699 else if (mux_pin == spec->headset_mic_pin)
5700 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5701 else if (mux_pin == spec->headphone_mic_pin)
5702 new_headset_mode = ALC_HEADSET_MODE_MIC;
5703 else
5704 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5705
5959a6bc
DH
5706 if (new_headset_mode == spec->current_headset_mode) {
5707 snd_hda_gen_update_outputs(codec);
73bdd597 5708 return;
5959a6bc 5709 }
73bdd597
DH
5710
5711 switch (new_headset_mode) {
5712 case ALC_HEADSET_MODE_UNPLUGGED:
5713 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5714 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5715 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5716 spec->gen.hp_jack_present = false;
5717 break;
5718 case ALC_HEADSET_MODE_HEADSET:
5719 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5720 alc_determine_headset_type(codec);
5721 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5722 alc_headset_mode_ctia(codec);
5723 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5724 alc_headset_mode_omtp(codec);
5725 spec->gen.hp_jack_present = true;
5726 break;
5727 case ALC_HEADSET_MODE_MIC:
5728 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5729 spec->gen.hp_jack_present = false;
5730 break;
5731 case ALC_HEADSET_MODE_HEADPHONE:
5732 alc_headset_mode_default(codec);
5733 spec->gen.hp_jack_present = true;
5734 break;
5735 }
5736 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5737 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5738 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5739 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5740 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5741 PIN_VREFHIZ);
5742 }
5743 spec->current_headset_mode = new_headset_mode;
5744
5745 snd_hda_gen_update_outputs(codec);
5746}
5747
5748static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5749 struct snd_kcontrol *kcontrol,
5750 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5751{
5752 alc_update_headset_mode(codec);
5753}
5754
1a4f69d5
TI
5755static void alc_update_headset_jack_cb(struct hda_codec *codec,
5756 struct hda_jack_callback *jack)
73bdd597 5757{
73bdd597 5758 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5759 alc_update_headset_mode(codec);
73bdd597
DH
5760}
5761
5762static void alc_probe_headset_mode(struct hda_codec *codec)
5763{
5764 int i;
5765 struct alc_spec *spec = codec->spec;
5766 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5767
5768 /* Find mic pins */
5769 for (i = 0; i < cfg->num_inputs; i++) {
5770 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5771 spec->headset_mic_pin = cfg->inputs[i].pin;
5772 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5773 spec->headphone_mic_pin = cfg->inputs[i].pin;
5774 }
5775
0bed2aa3 5776 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5777 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5778 spec->gen.automute_hook = alc_update_headset_mode;
5779 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5780}
5781
5782static void alc_fixup_headset_mode(struct hda_codec *codec,
5783 const struct hda_fixup *fix, int action)
5784{
5785 struct alc_spec *spec = codec->spec;
5786
5787 switch (action) {
5788 case HDA_FIXUP_ACT_PRE_PROBE:
5789 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5790 break;
5791 case HDA_FIXUP_ACT_PROBE:
5792 alc_probe_headset_mode(codec);
5793 break;
5794 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5795 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5796 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5797 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5798 }
73bdd597
DH
5799 alc_update_headset_mode(codec);
5800 break;
5801 }
5802}
5803
5804static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5805 const struct hda_fixup *fix, int action)
5806{
5807 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5808 struct alc_spec *spec = codec->spec;
5809 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5810 }
5811 else
5812 alc_fixup_headset_mode(codec, fix, action);
5813}
5814
31278997
KY
5815static void alc255_set_default_jack_type(struct hda_codec *codec)
5816{
5817 /* Set to iphone type */
6b0f95c4 5818 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5819 WRITE_COEF(0x1b, 0x880b),
5820 WRITE_COEF(0x45, 0xd089),
5821 WRITE_COEF(0x1b, 0x080b),
5822 WRITE_COEF(0x46, 0x0004),
5823 WRITE_COEF(0x1b, 0x0c0b),
5824 {}
5825 };
6b0f95c4 5826 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5827 WRITE_COEF(0x1b, 0x884b),
5828 WRITE_COEF(0x45, 0xd089),
5829 WRITE_COEF(0x1b, 0x084b),
5830 WRITE_COEF(0x46, 0x0004),
5831 WRITE_COEF(0x1b, 0x0c4b),
5832 {}
5833 };
5834 switch (codec->core.vendor_id) {
5835 case 0x10ec0255:
5836 alc_process_coef_fw(codec, alc255fw);
5837 break;
1948fc06 5838 case 0x10ec0230:
736f20a7 5839 case 0x10ec0236:
e69e7e03 5840 case 0x10ec0256:
527f4643 5841 case 0x19e58326:
e69e7e03
KY
5842 alc_process_coef_fw(codec, alc256fw);
5843 break;
5844 }
31278997
KY
5845 msleep(30);
5846}
5847
9a22a8f5
KY
5848static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5849 const struct hda_fixup *fix, int action)
5850{
5851 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5852 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5853 }
5854 alc_fixup_headset_mode(codec, fix, action);
5855}
5856
31278997
KY
5857static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5858 const struct hda_fixup *fix, int action)
5859{
5860 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5861 struct alc_spec *spec = codec->spec;
5862 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5863 alc255_set_default_jack_type(codec);
5864 }
5865 else
5866 alc_fixup_headset_mode(codec, fix, action);
5867}
5868
e1e62b98
KY
5869static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5870 struct hda_jack_callback *jack)
5871{
5872 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5873
5874 alc_update_headset_jack_cb(codec, jack);
5875 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5876 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5877}
5878
5879static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5880 const struct hda_fixup *fix, int action)
5881{
5882 alc_fixup_headset_mode(codec, fix, action);
5883 if (action == HDA_FIXUP_ACT_PROBE) {
5884 struct alc_spec *spec = codec->spec;
d44a6864
TI
5885 /* toggled via hp_automute_hook */
5886 spec->gpio_mask |= 0x40;
5887 spec->gpio_dir |= 0x40;
e1e62b98
KY
5888 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5889 }
5890}
5891
493a52a9
HW
5892static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5893 const struct hda_fixup *fix, int action)
5894{
5895 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5896 struct alc_spec *spec = codec->spec;
5897 spec->gen.auto_mute_via_amp = 1;
5898 }
5899}
5900
9b745ab8
TI
5901static void alc_fixup_no_shutup(struct hda_codec *codec,
5902 const struct hda_fixup *fix, int action)
5903{
efe55732 5904 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5905 struct alc_spec *spec = codec->spec;
c0ca5ece 5906 spec->no_shutup_pins = 1;
9b745ab8
TI
5907 }
5908}
5909
5e6db669
GM
5910static void alc_fixup_disable_aamix(struct hda_codec *codec,
5911 const struct hda_fixup *fix, int action)
5912{
5913 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5914 struct alc_spec *spec = codec->spec;
5915 /* Disable AA-loopback as it causes white noise */
5916 spec->gen.mixer_nid = 0;
5917 }
5918}
5919
7f57d803
TI
5920/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5921static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5922 const struct hda_fixup *fix, int action)
5923{
5924 static const struct hda_pintbl pincfgs[] = {
5925 { 0x16, 0x21211010 }, /* dock headphone */
5926 { 0x19, 0x21a11010 }, /* dock mic */
5927 { }
5928 };
5929 struct alc_spec *spec = codec->spec;
5930
5931 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5932 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5933 codec->power_save_node = 0; /* avoid click noises */
5934 snd_hda_apply_pincfgs(codec, pincfgs);
5935 }
5936}
5937
61fcf8ec
KY
5938static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5939 const struct hda_fixup *fix, int action)
5940{
5941 static const struct hda_pintbl pincfgs[] = {
5942 { 0x17, 0x21211010 }, /* dock headphone */
5943 { 0x19, 0x21a11010 }, /* dock mic */
5944 { }
5945 };
5946 struct alc_spec *spec = codec->spec;
5947
5948 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5949 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
5950 snd_hda_apply_pincfgs(codec, pincfgs);
5951 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
5952 /* Enable DOCK device */
5953 snd_hda_codec_write(codec, 0x17, 0,
5954 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5955 /* Enable DOCK device */
5956 snd_hda_codec_write(codec, 0x19, 0,
5957 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
5958 }
5959}
5960
399c01aa
TI
5961static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5962 const struct hda_fixup *fix, int action)
5963{
5964 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5965 * the speaker output becomes too low by some reason on Thinkpads with
5966 * ALC298 codec
5967 */
5968 static const hda_nid_t preferred_pairs[] = {
5969 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5970 0
5971 };
5972 struct alc_spec *spec = codec->spec;
5973
5974 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5975 spec->gen.preferred_dacs = preferred_pairs;
5976}
5977
8eedd3a7
TI
5978static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5979 const struct hda_fixup *fix, int action)
5980{
5981 static const hda_nid_t preferred_pairs[] = {
5982 0x17, 0x02, 0x21, 0x03, 0
5983 };
5984 struct alc_spec *spec = codec->spec;
5985
5986 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5987 spec->gen.preferred_dacs = preferred_pairs;
5988}
5989
9476d369 5990static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
5991{
5992 struct alc_spec *spec = codec->spec;
35a39f98 5993 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 5994
9476d369
GM
5995 /* Prevent pop noises when headphones are plugged in */
5996 snd_hda_codec_write(codec, hp_pin, 0,
5997 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5998 msleep(20);
033b0a7c
GM
5999}
6000
6001static void alc_fixup_dell_xps13(struct hda_codec *codec,
6002 const struct hda_fixup *fix, int action)
6003{
3e1b0c4a
TI
6004 struct alc_spec *spec = codec->spec;
6005 struct hda_input_mux *imux = &spec->gen.input_mux;
6006 int i;
f38663ab 6007
3e1b0c4a
TI
6008 switch (action) {
6009 case HDA_FIXUP_ACT_PRE_PROBE:
6010 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6011 * it causes a click noise at start up
6012 */
6013 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 6014 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
6015 break;
6016 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
6017 /* Make the internal mic the default input source. */
6018 for (i = 0; i < imux->num_items; i++) {
6019 if (spec->gen.imux_pins[i] == 0x12) {
6020 spec->gen.cur_mux[0] = i;
6021 break;
6022 }
6023 }
3e1b0c4a 6024 break;
033b0a7c
GM
6025 }
6026}
6027
1f8b46cd
DH
6028static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6029 const struct hda_fixup *fix, int action)
6030{
6031 struct alc_spec *spec = codec->spec;
6032
6033 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6034 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6035 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
6036
6037 /* Disable boost for mic-in permanently. (This code is only called
6038 from quirks that guarantee that the headphone is at NID 0x1b.) */
6039 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6040 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
6041 } else
6042 alc_fixup_headset_mode(codec, fix, action);
6043}
6044
73bdd597
DH
6045static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6046 const struct hda_fixup *fix, int action)
6047{
6048 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 6049 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 6050 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
6051 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6052 }
6053 alc_fixup_headset_mode(codec, fix, action);
6054}
6055
bde7bc60
CCC
6056/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6057static int find_ext_mic_pin(struct hda_codec *codec)
6058{
6059 struct alc_spec *spec = codec->spec;
6060 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6061 hda_nid_t nid;
6062 unsigned int defcfg;
6063 int i;
6064
6065 for (i = 0; i < cfg->num_inputs; i++) {
6066 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6067 continue;
6068 nid = cfg->inputs[i].pin;
6069 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6070 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6071 continue;
6072 return nid;
6073 }
6074
6075 return 0;
6076}
6077
08a978db 6078static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6079 const struct hda_fixup *fix,
08a978db
DR
6080 int action)
6081{
6082 struct alc_spec *spec = codec->spec;
6083
0db75790 6084 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6085 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6086 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6087
6088 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6089 return;
bde7bc60 6090 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6091 }
08a978db 6092}
693b613d 6093
3e0d611b
DH
6094static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6095 const struct hda_fixup *fix,
6096 int action)
6097{
6098 struct alc_spec *spec = codec->spec;
6099 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6100 int i;
6101
6102 /* The mic boosts on level 2 and 3 are too noisy
6103 on the internal mic input.
6104 Therefore limit the boost to 0 or 1. */
6105
6106 if (action != HDA_FIXUP_ACT_PROBE)
6107 return;
6108
6109 for (i = 0; i < cfg->num_inputs; i++) {
6110 hda_nid_t nid = cfg->inputs[i].pin;
6111 unsigned int defcfg;
6112 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6113 continue;
6114 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6115 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6116 continue;
6117
6118 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6119 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6120 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6121 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6122 (0 << AC_AMPCAP_MUTE_SHIFT));
6123 }
6124}
6125
cd217a63 6126static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6127 struct hda_jack_callback *jack)
cd217a63
KY
6128{
6129 struct alc_spec *spec = codec->spec;
6130 int vref;
6131
6132 msleep(200);
6133 snd_hda_gen_hp_automute(codec, jack);
6134
6135 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6136
6137 msleep(600);
6138 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6139 vref);
6140}
6141
cd217a63
KY
6142static void alc283_fixup_chromebook(struct hda_codec *codec,
6143 const struct hda_fixup *fix, int action)
6144{
6145 struct alc_spec *spec = codec->spec;
cd217a63
KY
6146
6147 switch (action) {
6148 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6149 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6150 /* Disable AA-loopback as it causes white noise */
6151 spec->gen.mixer_nid = 0;
38070219 6152 break;
0202e99c 6153 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6154 /* MIC2-VREF control */
6155 /* Set to manual mode */
98b24883 6156 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6157 /* Enable Line1 input control by verb */
98b24883 6158 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6159 break;
6160 }
6161}
6162
6163static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6164 const struct hda_fixup *fix, int action)
6165{
6166 struct alc_spec *spec = codec->spec;
0202e99c
KY
6167
6168 switch (action) {
6169 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6170 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6171 break;
6172 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6173 /* MIC2-VREF control */
6174 /* Set to manual mode */
98b24883 6175 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6176 break;
6177 }
6178}
6179
7bba2157
TI
6180/* mute tablet speaker pin (0x14) via dock plugging in addition */
6181static void asus_tx300_automute(struct hda_codec *codec)
6182{
6183 struct alc_spec *spec = codec->spec;
6184 snd_hda_gen_update_outputs(codec);
6185 if (snd_hda_jack_detect(codec, 0x1b))
6186 spec->gen.mute_bits |= (1ULL << 0x14);
6187}
6188
6189static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6190 const struct hda_fixup *fix, int action)
6191{
6192 struct alc_spec *spec = codec->spec;
7bba2157
TI
6193 static const struct hda_pintbl dock_pins[] = {
6194 { 0x1b, 0x21114000 }, /* dock speaker pin */
6195 {}
6196 };
7bba2157
TI
6197
6198 switch (action) {
6199 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6200 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6201 /* TX300 needs to set up GPIO2 for the speaker amp */
6202 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6203 snd_hda_apply_pincfgs(codec, dock_pins);
6204 spec->gen.auto_mute_via_amp = 1;
6205 spec->gen.automute_hook = asus_tx300_automute;
6206 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6207 snd_hda_gen_hp_automute);
6208 break;
5579cd6f
TI
6209 case HDA_FIXUP_ACT_PROBE:
6210 spec->init_amp = ALC_INIT_DEFAULT;
6211 break;
7bba2157
TI
6212 case HDA_FIXUP_ACT_BUILD:
6213 /* this is a bit tricky; give more sane names for the main
6214 * (tablet) speaker and the dock speaker, respectively
6215 */
56798e6b
TI
6216 rename_ctl(codec, "Speaker Playback Switch",
6217 "Dock Speaker Playback Switch");
6218 rename_ctl(codec, "Bass Speaker Playback Switch",
6219 "Speaker Playback Switch");
7bba2157
TI
6220 break;
6221 }
6222}
6223
338cae56
DH
6224static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6225 const struct hda_fixup *fix, int action)
6226{
0f4881dc
DH
6227 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6228 /* DAC node 0x03 is giving mono output. We therefore want to
6229 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6230 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6231 static const hda_nid_t conn1[] = { 0x0c };
6232 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6233 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6234 }
338cae56
DH
6235}
6236
dd9aa335
HW
6237static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6238 const struct hda_fixup *fix, int action)
6239{
6240 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6241 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6242 we can't adjust the speaker's volume since this node does not has
6243 Amp-out capability. we change the speaker's route to:
6244 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6245 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6246 speaker's volume now. */
6247
caf3c043
MM
6248 static const hda_nid_t conn1[] = { 0x0c };
6249 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6250 }
6251}
6252
e312a869
TI
6253/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6254static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6255 const struct hda_fixup *fix, int action)
6256{
6257 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6258 static const hda_nid_t conn[] = { 0x02, 0x03 };
6259 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6260 }
6261}
6262
d2cd795c
JK
6263/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6264static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6265 const struct hda_fixup *fix, int action)
6266{
6267 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6268 static const hda_nid_t conn[] = { 0x02 };
6269 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6270 }
6271}
6272
98973f2f
KP
6273/* Hook to update amp GPIO4 for automute */
6274static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6275 struct hda_jack_callback *jack)
6276{
6277 struct alc_spec *spec = codec->spec;
6278
6279 snd_hda_gen_hp_automute(codec, jack);
6280 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6281 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6282 !spec->gen.hp_jack_present);
98973f2f
KP
6283}
6284
6285/* Manage GPIOs for HP EliteBook Folio 9480m.
6286 *
6287 * GPIO4 is the headphone amplifier power control
6288 * GPIO3 is the audio output mute indicator LED
6289 */
6290
6291static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6292 const struct hda_fixup *fix,
6293 int action)
6294{
6295 struct alc_spec *spec = codec->spec;
98973f2f 6296
01e4a275 6297 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6298 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6299 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6300 spec->gpio_mask |= 0x10;
6301 spec->gpio_dir |= 0x10;
98973f2f 6302 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6303 }
6304}
6305
ae065f1c
TI
6306static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6307 const struct hda_fixup *fix,
6308 int action)
6309{
6310 struct alc_spec *spec = codec->spec;
6311
6312 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6313 spec->gpio_mask |= 0x04;
6314 spec->gpio_dir |= 0x04;
6315 /* set data bit low */
6316 }
6317}
6318
6a6660d0
TI
6319/* Quirk for Thinkpad X1 7th and 8th Gen
6320 * The following fixed routing needed
6321 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6322 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6323 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6324 */
6325static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6326 const struct hda_fixup *fix, int action)
6327{
6328 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6329 static const hda_nid_t preferred_pairs[] = {
6330 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6331 };
6332 struct alc_spec *spec = codec->spec;
6333
6334 switch (action) {
6335 case HDA_FIXUP_ACT_PRE_PROBE:
6336 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6337 spec->gen.preferred_dacs = preferred_pairs;
6338 break;
6339 case HDA_FIXUP_ACT_BUILD:
6340 /* The generic parser creates somewhat unintuitive volume ctls
6341 * with the fixed routing above, and the shared DAC2 may be
6342 * confusing for PA.
6343 * Rename those to unique names so that PA doesn't touch them
6344 * and use only Master volume.
6345 */
6346 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6347 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6348 break;
6349 }
6350}
6351
ca169cc2
KY
6352static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6353 const struct hda_fixup *fix,
6354 int action)
6355{
6356 alc_fixup_dual_codecs(codec, fix, action);
6357 switch (action) {
6358 case HDA_FIXUP_ACT_PRE_PROBE:
6359 /* override card longname to provide a unique UCM profile */
6360 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6361 break;
6362 case HDA_FIXUP_ACT_BUILD:
6363 /* rename Capture controls depending on the codec */
6364 rename_ctl(codec, "Capture Volume",
6365 codec->addr == 0 ?
6366 "Rear-Panel Capture Volume" :
6367 "Front-Panel Capture Volume");
6368 rename_ctl(codec, "Capture Switch",
6369 codec->addr == 0 ?
6370 "Rear-Panel Capture Switch" :
6371 "Front-Panel Capture Switch");
6372 break;
6373 }
6374}
6375
52e4e368
KHF
6376static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6377 const struct hda_fixup *fix, int action)
6378{
6379 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6380 return;
6381
6382 codec->power_save_node = 1;
6383}
6384
92266651
KY
6385/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6386static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6387 const struct hda_fixup *fix, int action)
6388{
6389 struct alc_spec *spec = codec->spec;
caf3c043 6390 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6391 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6392 0
6393 };
6394
6395 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6396 return;
6397
6398 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6399 spec->gen.auto_mute_via_amp = 1;
6400 codec->power_save_node = 0;
92266651
KY
6401}
6402
c84bfedc
TI
6403/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6404static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6405 const struct hda_fixup *fix, int action)
6406{
6407 static const hda_nid_t preferred_pairs[] = {
6408 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6409 };
6410 struct alc_spec *spec = codec->spec;
6411
6412 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6413 spec->gen.preferred_dacs = preferred_pairs;
6414 spec->gen.obey_preferred_dacs = 1;
6415 }
6416}
6417
c4cfcf6f
HW
6418/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6419static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6420 const struct hda_fixup *fix, int action)
6421{
6422 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6423 return;
6424
6425 snd_hda_override_wcaps(codec, 0x03, 0);
6426}
6427
8a8de09c
KY
6428static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6429{
6430 switch (codec->core.vendor_id) {
6431 case 0x10ec0274:
6432 case 0x10ec0294:
6433 case 0x10ec0225:
6434 case 0x10ec0295:
6435 case 0x10ec0299:
6436 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6437 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6438 break;
1948fc06 6439 case 0x10ec0230:
8a8de09c
KY
6440 case 0x10ec0235:
6441 case 0x10ec0236:
6442 case 0x10ec0255:
6443 case 0x10ec0256:
527f4643 6444 case 0x19e58326:
8a8de09c
KY
6445 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6446 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6447 break;
6448 }
6449}
6450
8983eb60
KY
6451static void alc295_fixup_chromebook(struct hda_codec *codec,
6452 const struct hda_fixup *fix, int action)
6453{
d3ba58bb
KY
6454 struct alc_spec *spec = codec->spec;
6455
8983eb60 6456 switch (action) {
d3ba58bb
KY
6457 case HDA_FIXUP_ACT_PRE_PROBE:
6458 spec->ultra_low_power = true;
6459 break;
8983eb60 6460 case HDA_FIXUP_ACT_INIT:
8a8de09c 6461 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6462 break;
6463 }
6464}
6465
d1dd4211
KY
6466static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6467 const struct hda_fixup *fix, int action)
6468{
6469 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6470 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6471}
6472
c3cdf189
LJ
6473
6474static void alc294_gx502_toggle_output(struct hda_codec *codec,
6475 struct hda_jack_callback *cb)
6476{
6477 /* The Windows driver sets the codec up in a very different way where
6478 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6479 */
6480 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6481 alc_write_coef_idx(codec, 0x10, 0x8a20);
6482 else
6483 alc_write_coef_idx(codec, 0x10, 0x0a20);
6484}
6485
6486static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6487 const struct hda_fixup *fix, int action)
6488{
6489 /* Pin 0x21: headphones/headset mic */
6490 if (!is_jack_detectable(codec, 0x21))
6491 return;
6492
6493 switch (action) {
6494 case HDA_FIXUP_ACT_PRE_PROBE:
6495 snd_hda_jack_detect_enable_callback(codec, 0x21,
6496 alc294_gx502_toggle_output);
6497 break;
6498 case HDA_FIXUP_ACT_INIT:
6499 /* Make sure to start in a correct state, i.e. if
6500 * headphones have been plugged in before powering up the system
6501 */
6502 alc294_gx502_toggle_output(codec, NULL);
6503 break;
6504 }
6505}
6506
c1b55029
DC
6507static void alc294_gu502_toggle_output(struct hda_codec *codec,
6508 struct hda_jack_callback *cb)
6509{
6510 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6511 * responsible from changes between speakers and headphones
6512 */
6513 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6514 alc_write_coef_idx(codec, 0x10, 0x8420);
6515 else
6516 alc_write_coef_idx(codec, 0x10, 0x0a20);
6517}
6518
6519static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6520 const struct hda_fixup *fix, int action)
6521{
6522 if (!is_jack_detectable(codec, 0x21))
6523 return;
6524
6525 switch (action) {
6526 case HDA_FIXUP_ACT_PRE_PROBE:
6527 snd_hda_jack_detect_enable_callback(codec, 0x21,
6528 alc294_gu502_toggle_output);
6529 break;
6530 case HDA_FIXUP_ACT_INIT:
6531 alc294_gu502_toggle_output(codec, NULL);
6532 break;
6533 }
6534}
6535
56496253
KY
6536static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6537 const struct hda_fixup *fix, int action)
6538{
6539 if (action != HDA_FIXUP_ACT_INIT)
6540 return;
6541
6542 msleep(100);
6543 alc_write_coef_idx(codec, 0x65, 0x0);
6544}
6545
8a8de09c
KY
6546static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6547 const struct hda_fixup *fix, int action)
6548{
6549 switch (action) {
6550 case HDA_FIXUP_ACT_INIT:
6551 alc_combo_jack_hp_jd_restart(codec);
6552 break;
6553 }
6554}
6555
92666d45
KY
6556static void alc_fixup_no_int_mic(struct hda_codec *codec,
6557 const struct hda_fixup *fix, int action)
6558{
6559 struct alc_spec *spec = codec->spec;
6560
6561 switch (action) {
6562 case HDA_FIXUP_ACT_PRE_PROBE:
6563 /* Mic RING SLEEVE swap for combo jack */
6564 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6565 spec->no_internal_mic_pin = true;
6566 break;
6567 case HDA_FIXUP_ACT_INIT:
6568 alc_combo_jack_hp_jd_restart(codec);
6569 break;
6570 }
6571}
6572
d94befbb
DB
6573/* GPIO1 = amplifier on/off
6574 * GPIO3 = mic mute LED
6575 */
6576static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6577 const struct hda_fixup *fix, int action)
6578{
6579 static const hda_nid_t conn[] = { 0x02 };
6580
6581 struct alc_spec *spec = codec->spec;
6582 static const struct hda_pintbl pincfgs[] = {
6583 { 0x14, 0x90170110 }, /* front/high speakers */
6584 { 0x17, 0x90170130 }, /* back/bass speakers */
6585 { }
6586 };
6587
6588 //enable micmute led
6589 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6590
6591 switch (action) {
6592 case HDA_FIXUP_ACT_PRE_PROBE:
6593 spec->micmute_led_polarity = 1;
6594 /* needed for amp of back speakers */
6595 spec->gpio_mask |= 0x01;
6596 spec->gpio_dir |= 0x01;
6597 snd_hda_apply_pincfgs(codec, pincfgs);
6598 /* share DAC to have unified volume control */
6599 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6600 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6601 break;
6602 case HDA_FIXUP_ACT_INIT:
6603 /* need to toggle GPIO to enable the amp of back speakers */
6604 alc_update_gpio_data(codec, 0x01, true);
6605 msleep(100);
6606 alc_update_gpio_data(codec, 0x01, false);
6607 break;
6608 }
6609}
6610
434591b2
ED
6611static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6612 const struct hda_fixup *fix, int action)
6613{
6614 static const hda_nid_t conn[] = { 0x02 };
6615 static const struct hda_pintbl pincfgs[] = {
6616 { 0x14, 0x90170110 }, /* rear speaker */
6617 { }
6618 };
6619
6620 switch (action) {
6621 case HDA_FIXUP_ACT_PRE_PROBE:
6622 snd_hda_apply_pincfgs(codec, pincfgs);
6623 /* force front speaker to DAC1 */
6624 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6625 break;
6626 }
6627}
6628
b317b032
TI
6629/* for hda_fixup_thinkpad_acpi() */
6630#include "thinkpad_helper.c"
b67ae3f1 6631
d5a6cabf
TI
6632static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6633 const struct hda_fixup *fix, int action)
6634{
6635 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6636 hda_fixup_thinkpad_acpi(codec, fix, action);
6637}
6638
ad7cc2d4
CB
6639/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6640static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6641 const struct hda_fixup *fix,
6642 int action)
6643{
6644 struct alc_spec *spec = codec->spec;
6645
6646 switch (action) {
6647 case HDA_FIXUP_ACT_PRE_PROBE:
6648 spec->gen.suppress_auto_mute = 1;
6649 break;
6650 }
6651}
6652
d3dca026
LT
6653static int comp_bind(struct device *dev)
6654{
6655 struct hda_codec *cdc = dev_to_hda_codec(dev);
6656 struct alc_spec *spec = cdc->spec;
1873ebd3 6657
a8dfb850 6658 return component_bind_all(dev, spec->comps);
d3dca026
LT
6659}
6660
6661static void comp_unbind(struct device *dev)
6662{
6663 struct hda_codec *cdc = dev_to_hda_codec(dev);
6664 struct alc_spec *spec = cdc->spec;
6665
6666 component_unbind_all(dev, spec->comps);
6667}
6668
6669static const struct component_master_ops comp_master_ops = {
6670 .bind = comp_bind,
6671 .unbind = comp_unbind,
6672};
6673
6674static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6675 struct snd_pcm_substream *sub, int action)
6676{
6677 struct alc_spec *spec = cdc->spec;
6678 int i;
6679
6680 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6681 if (spec->comps[i].dev)
6682 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6683 }
6684}
6685
35a17444
TI
6686struct cs35l41_dev_name {
6687 const char *bus;
6688 const char *hid;
6689 int index;
6690};
6691
6692/* match the device name in a slightly relaxed manner */
6693static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6694{
6695 struct cs35l41_dev_name *p = data;
6696 const char *d = dev_name(dev);
6697 int n = strlen(p->bus);
6698 char tmp[32];
6699
6700 /* check the bus name */
6701 if (strncmp(d, p->bus, n))
6702 return 0;
6703 /* skip the bus number */
6704 if (isdigit(d[n]))
6705 n++;
6706 /* the rest must be exact matching */
6707 snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6708 return !strcmp(d + n, tmp);
6709}
6710
ae7abe36
SB
6711static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6712 const char *hid, int count)
6713{
6714 struct device *dev = hda_codec_dev(cdc);
6715 struct alc_spec *spec = cdc->spec;
35a17444 6716 struct cs35l41_dev_name *rec;
ae7abe36
SB
6717 int ret, i;
6718
6719 switch (action) {
6720 case HDA_FIXUP_ACT_PRE_PROBE:
6721 for (i = 0; i < count; i++) {
35a17444
TI
6722 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6723 if (!rec)
ae7abe36 6724 return;
35a17444
TI
6725 rec->bus = bus;
6726 rec->hid = hid;
6727 rec->index = i;
22d5cbd2 6728 spec->comps[i].codec = cdc;
35a17444
TI
6729 component_match_add(dev, &spec->match,
6730 comp_match_cs35l41_dev_name, rec);
ae7abe36
SB
6731 }
6732 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6733 if (ret)
6734 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6735 else
6736 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6737 break;
6738 }
6739}
6740
6741static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6742{
6743 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6744}
6745
07bcab93
LT
6746static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6747{
35a17444 6748 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
225f6e1b
TI
6749}
6750
07bcab93
LT
6751static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6752{
35a17444 6753 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
07bcab93
LT
6754}
6755
d3dca026
LT
6756static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6757 int action)
6758{
14e42cee 6759 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
d3dca026
LT
6760}
6761
1e24881d
LT
6762static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6763 int action)
6764{
6765 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6766}
6767
bbf8ff6b
TB
6768/* for alc295_fixup_hp_top_speakers */
6769#include "hp_x360_helper.c"
6770
26928ca1
TI
6771/* for alc285_fixup_ideapad_s740_coef() */
6772#include "ideapad_s740_helper.c"
6773
619764cc
WS
6774static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6775 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6776 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6777 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6778 {}
6779};
6780
6781static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6782 const struct hda_fixup *fix,
6783 int action)
dd6dd6e3
WS
6784{
6785 /*
619764cc
WS
6786 * A certain other OS sets these coeffs to different values. On at least
6787 * one TongFang barebone these settings might survive even a cold
6788 * reboot. So to restore a clean slate the values are explicitly reset
6789 * to default here. Without this, the external microphone is always in a
6790 * plugged-in state, while the internal microphone is always in an
6791 * unplugged state, breaking the ability to use the internal microphone.
6792 */
6793 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
6794}
6795
174a7fb3
WS
6796static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6797 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6798 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6799 WRITE_COEF(0x49, 0x0149),
6800 {}
6801};
6802
6803static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6804 const struct hda_fixup *fix,
6805 int action)
6806{
6807 /*
6808 * The audio jack input and output is not detected on the ASRock NUC Box
6809 * 1100 series when cold booting without this fix. Warm rebooting from a
6810 * certain other OS makes the audio functional, as COEF settings are
6811 * preserved in this case. This fix sets these altered COEF values as
6812 * the default.
6813 */
6814 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6815}
6816
edca7cc4
WS
6817static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6818 const struct hda_fixup *fix,
6819 int action)
6820{
6821 /*
6822 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6823 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6824 * needs an additional quirk for sound working after suspend and resume.
6825 */
6826 if (codec->core.vendor_id == 0x10ec0256) {
6827 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6828 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6829 } else {
6830 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6831 }
6832}
6833
1efcdd9c
GM
6834static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
6835 const struct hda_fixup *fix,
6836 int action)
6837{
6838 struct alc_spec *spec = codec->spec;
6839 struct hda_input_mux *imux = &spec->gen.input_mux;
6840 int i;
6841
6842 alc269_fixup_limit_int_mic_boost(codec, fix, action);
6843
6844 switch (action) {
6845 case HDA_FIXUP_ACT_PRE_PROBE:
6846 /**
6847 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
6848 * to Hi-Z to avoid pop noises at startup and when plugging and
6849 * unplugging headphones.
6850 */
6851 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6852 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
6853 break;
6854 case HDA_FIXUP_ACT_PROBE:
6855 /**
6856 * Make the internal mic (0x12) the default input source to
6857 * prevent pop noises on cold boot.
6858 */
6859 for (i = 0; i < imux->num_items; i++) {
6860 if (spec->gen.imux_pins[i] == 0x12) {
6861 spec->gen.cur_mux[0] = i;
6862 break;
6863 }
6864 }
6865 break;
6866 }
6867}
6868
3790a3d6
PJ
6869static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
6870 const struct hda_fixup *fix, int action)
6871{
6872 /*
6873 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
6874 * unconnected.
6875 */
6876 static const struct hda_pintbl pincfgs[] = {
6877 { 0x17, 0x90170121 },
6878 { }
6879 };
6880 /*
6881 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
6882 * DAC 0x02 and 0x03 would be fine.
6883 */
6884 static const hda_nid_t conn[] = { 0x02, 0x03 };
6885 /*
6886 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
6887 * Headphones (0x21) are connected to DAC 0x03.
6888 */
6889 static const hda_nid_t preferred_pairs[] = {
6890 0x14, 0x02,
6891 0x17, 0x02,
6892 0x21, 0x03,
6893 0
6894 };
6895 struct alc_spec *spec = codec->spec;
6896
6897 switch (action) {
6898 case HDA_FIXUP_ACT_PRE_PROBE:
6899 snd_hda_apply_pincfgs(codec, pincfgs);
6900 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6901 spec->gen.preferred_dacs = preferred_pairs;
6902 break;
6903 }
6904}
6905
2912cdda
PJ
6906static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
6907 const struct hda_fixup *fix, int action)
6908{
6909 static const struct hda_pintbl pincfgs[] = {
6910 { 0x14, 0x90170151 },
6911 { 0x17, 0x90170150 },
6912 { }
6913 };
6914 static const hda_nid_t conn[] = { 0x02, 0x03 };
6915 static const hda_nid_t preferred_pairs[] = {
6916 0x14, 0x02,
6917 0x17, 0x03,
6918 0x21, 0x02,
6919 0
6920 };
6921 struct alc_spec *spec = codec->spec;
6922
6923 alc_fixup_no_shutup(codec, fix, action);
6924
6925 switch (action) {
6926 case HDA_FIXUP_ACT_PRE_PROBE:
6927 snd_hda_apply_pincfgs(codec, pincfgs);
6928 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6929 spec->gen.preferred_dacs = preferred_pairs;
6930 break;
6931 }
6932}
6933
1d045db9 6934enum {
f73bbf63 6935 ALC269_FIXUP_GPIO2,
1d045db9
TI
6936 ALC269_FIXUP_SONY_VAIO,
6937 ALC275_FIXUP_SONY_VAIO_GPIO2,
6938 ALC269_FIXUP_DELL_M101Z,
6939 ALC269_FIXUP_SKU_IGNORE,
6940 ALC269_FIXUP_ASUS_G73JW,
6941 ALC269_FIXUP_LENOVO_EAPD,
6942 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 6943 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 6944 ALC271_FIXUP_DMIC,
017f2a10 6945 ALC269_FIXUP_PCM_44K,
adabb3ec 6946 ALC269_FIXUP_STEREO_DMIC,
7c478f03 6947 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
6948 ALC269_FIXUP_QUANTA_MUTE,
6949 ALC269_FIXUP_LIFEBOOK,
2041d564 6950 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 6951 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 6952 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 6953 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
6954 ALC269_FIXUP_AMIC,
6955 ALC269_FIXUP_DMIC,
6956 ALC269VB_FIXUP_AMIC,
6957 ALC269VB_FIXUP_DMIC,
08fb0d0e 6958 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 6959 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 6960 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 6961 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 6962 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
6963 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6964 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 6965 ALC269_FIXUP_INV_DMIC,
108cc108 6966 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 6967 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 6968 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 6969 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 6970 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
6971 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6972 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 6973 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 6974 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
1efcdd9c 6975 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
73bdd597
DH
6976 ALC269_FIXUP_HEADSET_MODE,
6977 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 6978 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
6979 ALC269_FIXUP_ASUS_X101_FUNC,
6980 ALC269_FIXUP_ASUS_X101_VERB,
6981 ALC269_FIXUP_ASUS_X101,
08a978db
DR
6982 ALC271_FIXUP_AMIC_MIC2,
6983 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 6984 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 6985 ALC269_FIXUP_ACER_AC700,
3e0d611b 6986 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 6987 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 6988 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
f882c4be 6989 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
8e35cd4a 6990 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 6991 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 6992 ALC283_FIXUP_CHROME_BOOK,
0202e99c 6993 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 6994 ALC282_FIXUP_ASUS_TX300,
1bb3e062 6995 ALC283_FIXUP_INT_MIC,
338cae56 6996 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
6997 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6998 ALC290_FIXUP_SUBWOOFER,
6999 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 7000 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 7001 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5824ce8d 7002 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 7003 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 7004 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 7005 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 7006 ALC255_FIXUP_HEADSET_MODE,
31278997 7007 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 7008 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 7009 ALC292_FIXUP_TPT440_DOCK,
9a811230 7010 ALC292_FIXUP_TPT440,
abaa2274 7011 ALC283_FIXUP_HEADSET_MIC,
b3802783 7012 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 7013 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 7014 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 7015 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 7016 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 7017 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 7018 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 7019 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 7020 ALC280_FIXUP_HP_9480M,
c3bb2b52 7021 ALC245_FIXUP_HP_X360_AMP,
d94befbb 7022 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
e1e62b98
KY
7023 ALC288_FIXUP_DELL_HEADSET_MODE,
7024 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
7025 ALC288_FIXUP_DELL_XPS_13,
7026 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 7027 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
7028 ALC292_FIXUP_DELL_E7X,
7029 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 7030 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 7031 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 7032 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 7033 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 7034 ALC275_FIXUP_DELL_XPS,
23adc192 7035 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 7036 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 7037 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 7038 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 7039 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 7040 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 7041 ALC285_FIXUP_SPEAKER2_TO_DAC1,
f883982d 7042 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 7043 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 7044 ALC292_FIXUP_TPT460,
dd9aa335 7045 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 7046 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 7047 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 7048 ALC269_FIXUP_ATIV_BOOK_8,
4ba5c853 7049 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
9eb5d0e6 7050 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
7051 ALC256_FIXUP_ASUS_HEADSET_MODE,
7052 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 7053 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
7054 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7055 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 7056 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 7057 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 7058 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 7059 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 7060 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 7061 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
7062 ALC274_FIXUP_DELL_BIND_DACS,
7063 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 7064 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 7065 ALC298_FIXUP_TPT470_DOCK,
ae104a21 7066 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 7067 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 7068 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 7069 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 7070 ALC295_FIXUP_HP_X360,
8a328ac1 7071 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 7072 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 7073 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 7074 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 7075 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
7076 ALC294_FIXUP_ASUS_HEADSET_MIC,
7077 ALC294_FIXUP_ASUS_SPK,
89e3a568 7078 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 7079 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 7080 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 7081 ALC295_FIXUP_CHROME_BOOK,
8983eb60 7082 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
7083 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7084 ALC225_FIXUP_WYSE_AUTO_MUTE,
7085 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 7086 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 7087 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 7088 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 7089 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 7090 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
e79c2269
KY
7091 ALC289_FIXUP_DELL_SPK2,
7092 ALC289_FIXUP_DUAL_SPK,
48e01504
CC
7093 ALC294_FIXUP_SPK2_TO_DAC1,
7094 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 7095 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 7096 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8b33a134 7097 ALC294_FIXUP_ASUS_HPE,
1b94e59d 7098 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
7099 ALC294_FIXUP_ASUS_GX502_HP,
7100 ALC294_FIXUP_ASUS_GX502_PINS,
7101 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
7102 ALC294_FIXUP_ASUS_GU502_HP,
7103 ALC294_FIXUP_ASUS_GU502_PINS,
7104 ALC294_FIXUP_ASUS_GU502_VERBS,
c611e659 7105 ALC294_FIXUP_ASUS_G513_PINS,
bc2c2354 7106 ALC285_FIXUP_ASUS_G533Z_PINS,
f5a88b0a 7107 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 7108 ALC285_FIXUP_HP_MUTE_LED,
e7d66cf7 7109 ALC236_FIXUP_HP_GPIO_LED,
24164f43 7110 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 7111 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
a2d57ebe 7112 ALC298_FIXUP_SAMSUNG_AMP,
14425f1f 7113 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ef248d9b 7114 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 7115 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 7116 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 7117 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 7118 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 7119 ALC289_FIXUP_ASUS_GA401,
4b43d05a 7120 ALC289_FIXUP_ASUS_GA502,
f50a121d 7121 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 7122 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
7123 ALC269_FIXUP_CZC_B20,
7124 ALC269_FIXUP_CZC_TMI,
7125 ALC269_FIXUP_CZC_L101,
7126 ALC269_FIXUP_LEMOTE_A1802,
7127 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 7128 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
7129 ALC233_FIXUP_INTEL_NUC8_DMIC,
7130 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 7131 ALC256_FIXUP_INTEL_NUC10,
fc19d559 7132 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 7133 ALC274_FIXUP_HP_MIC,
8a8de09c 7134 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 7135 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 7136 ALC256_FIXUP_ASUS_HPE,
446b8185 7137 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 7138 ALC287_FIXUP_HP_GPIO_LED,
9e885770 7139 ALC256_FIXUP_HP_HEADSET_MIC,
5fc462c3 7140 ALC245_FIXUP_HP_GPIO_LED,
92666d45 7141 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 7142 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 7143 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 7144 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 7145 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 7146 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 7147 ALC295_FIXUP_ASUS_DACS,
5d84b531 7148 ALC295_FIXUP_HP_OMEN,
f2be77fe 7149 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 7150 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 7151 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 7152 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 7153 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
7154 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7155 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7156 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
56ec3e75 7157 ALC298_FIXUP_LENOVO_C940_DUET7,
dd6dd6e3 7158 ALC287_FIXUP_13S_GEN2_SPEAKERS,
619764cc 7159 ALC256_FIXUP_SET_COEF_DEFAULTS,
1278cc5a 7160 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
174a7fb3 7161 ALC233_FIXUP_NO_AUDIO_JACK,
edca7cc4 7162 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
8f4c9042
BF
7163 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7164 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
d3dca026 7165 ALC287_FIXUP_LEGION_16ACHG6,
ae7abe36 7166 ALC287_FIXUP_CS35L41_I2C_2,
b3fbe536 7167 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
07bcab93 7168 ALC245_FIXUP_CS35L41_SPI_2,
ce18f905 7169 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
07bcab93
LT
7170 ALC245_FIXUP_CS35L41_SPI_4,
7171 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
91502a9a 7172 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
309d7363 7173 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
1e24881d 7174 ALC287_FIXUP_LEGION_16ITHG6,
3790a3d6
PJ
7175 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7176 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
2912cdda 7177 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
f1d4e28b
KY
7178};
7179
56ec3e75
TI
7180/* A special fixup for Lenovo C940 and Yoga Duet 7;
7181 * both have the very same PCI SSID, and we need to apply different fixups
7182 * depending on the codec ID
7183 */
7184static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7185 const struct hda_fixup *fix,
7186 int action)
7187{
7188 int id;
7189
7190 if (codec->core.vendor_id == 0x10ec0298)
7191 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7192 else
7193 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7194 __snd_hda_apply_fixup(codec, id, action, 0);
7195}
7196
1727a771 7197static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
7198 [ALC269_FIXUP_GPIO2] = {
7199 .type = HDA_FIXUP_FUNC,
7200 .v.func = alc_fixup_gpio2,
7201 },
1d045db9 7202 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
7203 .type = HDA_FIXUP_PINCTLS,
7204 .v.pins = (const struct hda_pintbl[]) {
7205 {0x19, PIN_VREFGRD},
1d045db9
TI
7206 {}
7207 }
f1d4e28b 7208 },
1d045db9 7209 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
7210 .type = HDA_FIXUP_FUNC,
7211 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
7212 .chained = true,
7213 .chain_id = ALC269_FIXUP_SONY_VAIO
7214 },
7215 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 7216 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7217 .v.verbs = (const struct hda_verb[]) {
7218 /* Enables internal speaker */
7219 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7220 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7221 {}
7222 }
7223 },
7224 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 7225 .type = HDA_FIXUP_FUNC,
23d30f28 7226 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
7227 },
7228 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
7229 .type = HDA_FIXUP_PINS,
7230 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
7231 { 0x17, 0x99130111 }, /* subwoofer */
7232 { }
7233 }
7234 },
7235 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 7236 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7237 .v.verbs = (const struct hda_verb[]) {
7238 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7239 {}
7240 }
7241 },
7242 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 7243 .type = HDA_FIXUP_FUNC,
1d045db9
TI
7244 .v.func = alc269_fixup_hweq,
7245 .chained = true,
7246 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7247 },
e9bd7d5c
TI
7248 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7249 .type = HDA_FIXUP_FUNC,
7250 .v.func = alc_fixup_disable_aamix,
7251 .chained = true,
7252 .chain_id = ALC269_FIXUP_SONY_VAIO
7253 },
1d045db9 7254 [ALC271_FIXUP_DMIC] = {
1727a771 7255 .type = HDA_FIXUP_FUNC,
1d045db9 7256 .v.func = alc271_fixup_dmic,
f1d4e28b 7257 },
017f2a10 7258 [ALC269_FIXUP_PCM_44K] = {
1727a771 7259 .type = HDA_FIXUP_FUNC,
017f2a10 7260 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
7261 .chained = true,
7262 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 7263 },
adabb3ec 7264 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 7265 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
7266 .v.func = alc269_fixup_stereo_dmic,
7267 },
7c478f03
DH
7268 [ALC269_FIXUP_HEADSET_MIC] = {
7269 .type = HDA_FIXUP_FUNC,
7270 .v.func = alc269_fixup_headset_mic,
7271 },
24519911 7272 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 7273 .type = HDA_FIXUP_FUNC,
24519911
TI
7274 .v.func = alc269_fixup_quanta_mute,
7275 },
7276 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
7277 .type = HDA_FIXUP_PINS,
7278 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
7279 { 0x1a, 0x2101103f }, /* dock line-out */
7280 { 0x1b, 0x23a11040 }, /* dock mic-in */
7281 { }
7282 },
7283 .chained = true,
7284 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7285 },
2041d564
DH
7286 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7287 .type = HDA_FIXUP_PINS,
7288 .v.pins = (const struct hda_pintbl[]) {
7289 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7290 { }
7291 },
7292 },
cc7016ab
TI
7293 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7294 .type = HDA_FIXUP_PINS,
7295 .v.pins = (const struct hda_pintbl[]) {
7296 { 0x21, 0x0221102f }, /* HP out */
7297 { }
7298 },
7299 },
4df3fd17
TI
7300 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7301 .type = HDA_FIXUP_FUNC,
7302 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7303 },
fdcc968a
JMG
7304 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7305 .type = HDA_FIXUP_FUNC,
7306 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7307 },
a4297b5d 7308 [ALC269_FIXUP_AMIC] = {
1727a771
TI
7309 .type = HDA_FIXUP_PINS,
7310 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7311 { 0x14, 0x99130110 }, /* speaker */
7312 { 0x15, 0x0121401f }, /* HP out */
7313 { 0x18, 0x01a19c20 }, /* mic */
7314 { 0x19, 0x99a3092f }, /* int-mic */
7315 { }
7316 },
7317 },
7318 [ALC269_FIXUP_DMIC] = {
1727a771
TI
7319 .type = HDA_FIXUP_PINS,
7320 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7321 { 0x12, 0x99a3092f }, /* int-mic */
7322 { 0x14, 0x99130110 }, /* speaker */
7323 { 0x15, 0x0121401f }, /* HP out */
7324 { 0x18, 0x01a19c20 }, /* mic */
7325 { }
7326 },
7327 },
7328 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
7329 .type = HDA_FIXUP_PINS,
7330 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7331 { 0x14, 0x99130110 }, /* speaker */
7332 { 0x18, 0x01a19c20 }, /* mic */
7333 { 0x19, 0x99a3092f }, /* int-mic */
7334 { 0x21, 0x0121401f }, /* HP out */
7335 { }
7336 },
7337 },
2267ea97 7338 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7339 .type = HDA_FIXUP_PINS,
7340 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7341 { 0x12, 0x99a3092f }, /* int-mic */
7342 { 0x14, 0x99130110 }, /* speaker */
7343 { 0x18, 0x01a19c20 }, /* mic */
7344 { 0x21, 0x0121401f }, /* HP out */
7345 { }
7346 },
7347 },
08fb0d0e 7348 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7349 .type = HDA_FIXUP_FUNC,
08fb0d0e 7350 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7351 },
d06ac143
DH
7352 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7353 .type = HDA_FIXUP_FUNC,
7354 .v.func = alc269_fixup_hp_mute_led_mic1,
7355 },
08fb0d0e 7356 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7357 .type = HDA_FIXUP_FUNC,
08fb0d0e 7358 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7359 },
7f783bd5
TB
7360 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7361 .type = HDA_FIXUP_FUNC,
7362 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7363 .chained = true,
7364 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7365 },
9f5c6faf
TI
7366 [ALC269_FIXUP_HP_GPIO_LED] = {
7367 .type = HDA_FIXUP_FUNC,
7368 .v.func = alc269_fixup_hp_gpio_led,
7369 },
9c5dc3bf
KY
7370 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7371 .type = HDA_FIXUP_FUNC,
7372 .v.func = alc269_fixup_hp_gpio_mic1_led,
7373 },
7374 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7375 .type = HDA_FIXUP_FUNC,
7376 .v.func = alc269_fixup_hp_line1_mic1_led,
7377 },
693b613d 7378 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7379 .type = HDA_FIXUP_FUNC,
9d36a7dc 7380 .v.func = alc_fixup_inv_dmic,
693b613d 7381 },
9b745ab8
TI
7382 [ALC269_FIXUP_NO_SHUTUP] = {
7383 .type = HDA_FIXUP_FUNC,
7384 .v.func = alc_fixup_no_shutup,
7385 },
108cc108 7386 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7387 .type = HDA_FIXUP_PINS,
7388 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7389 { 0x19, 0x23a11040 }, /* dock mic */
7390 { 0x1b, 0x2121103f }, /* dock headphone */
7391 { }
7392 },
7393 .chained = true,
7394 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7395 },
b590b38c
TI
7396 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7397 .type = HDA_FIXUP_FUNC,
7398 .v.func = alc269_fixup_limit_int_mic_boost,
7399 .chained = true,
7400 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7401 },
108cc108 7402 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7403 .type = HDA_FIXUP_FUNC,
108cc108 7404 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7405 .chained = true,
7406 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7407 },
73bdd597
DH
7408 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7409 .type = HDA_FIXUP_PINS,
7410 .v.pins = (const struct hda_pintbl[]) {
7411 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7412 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7413 { }
7414 },
7415 .chained = true,
7416 .chain_id = ALC269_FIXUP_HEADSET_MODE
7417 },
7418 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7419 .type = HDA_FIXUP_PINS,
7420 .v.pins = (const struct hda_pintbl[]) {
7421 { 0x16, 0x21014020 }, /* dock line out */
7422 { 0x19, 0x21a19030 }, /* dock mic */
7423 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7424 { }
7425 },
7426 .chained = true,
7427 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7428 },
338cae56
DH
7429 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7430 .type = HDA_FIXUP_PINS,
7431 .v.pins = (const struct hda_pintbl[]) {
7432 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7433 { }
7434 },
7435 .chained = true,
7436 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7437 },
fcc6c877
KY
7438 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7439 .type = HDA_FIXUP_PINS,
7440 .v.pins = (const struct hda_pintbl[]) {
7441 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7442 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7443 { }
7444 },
7445 .chained = true,
7446 .chain_id = ALC269_FIXUP_HEADSET_MODE
7447 },
73bdd597
DH
7448 [ALC269_FIXUP_HEADSET_MODE] = {
7449 .type = HDA_FIXUP_FUNC,
7450 .v.func = alc_fixup_headset_mode,
6676f308 7451 .chained = true,
b3802783 7452 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7453 },
7454 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7455 .type = HDA_FIXUP_FUNC,
7456 .v.func = alc_fixup_headset_mode_no_hp_mic,
7457 },
7819717b
TI
7458 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7459 .type = HDA_FIXUP_PINS,
7460 .v.pins = (const struct hda_pintbl[]) {
7461 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7462 { }
7463 },
7464 .chained = true,
7465 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7466 },
88cfcf86
DH
7467 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7468 .type = HDA_FIXUP_PINS,
7469 .v.pins = (const struct hda_pintbl[]) {
7470 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7471 { }
7472 },
fbc78ad6
DH
7473 .chained = true,
7474 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7475 },
0fbf21c3 7476 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7477 .type = HDA_FIXUP_PINS,
7478 .v.pins = (const struct hda_pintbl[]) {
7479 {0x12, 0x90a60130},
7480 {0x13, 0x40000000},
7481 {0x14, 0x90170110},
7482 {0x18, 0x411111f0},
7483 {0x19, 0x04a11040},
7484 {0x1a, 0x411111f0},
7485 {0x1b, 0x90170112},
7486 {0x1d, 0x40759a05},
7487 {0x1e, 0x411111f0},
7488 {0x21, 0x04211020},
7489 { }
7490 },
e2744fd7
AB
7491 .chained = true,
7492 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7493 },
a2ef03fe
TE
7494 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7495 .type = HDA_FIXUP_FUNC,
7496 .v.func = alc298_fixup_huawei_mbx_stereo,
7497 .chained = true,
7498 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7499 },
d240d1dc
DH
7500 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7501 .type = HDA_FIXUP_FUNC,
7502 .v.func = alc269_fixup_x101_headset_mic,
7503 },
7504 [ALC269_FIXUP_ASUS_X101_VERB] = {
7505 .type = HDA_FIXUP_VERBS,
7506 .v.verbs = (const struct hda_verb[]) {
7507 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7508 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7509 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7510 { }
7511 },
7512 .chained = true,
7513 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7514 },
7515 [ALC269_FIXUP_ASUS_X101] = {
7516 .type = HDA_FIXUP_PINS,
7517 .v.pins = (const struct hda_pintbl[]) {
7518 { 0x18, 0x04a1182c }, /* Headset mic */
7519 { }
7520 },
7521 .chained = true,
7522 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7523 },
08a978db 7524 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7525 .type = HDA_FIXUP_PINS,
7526 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7527 { 0x14, 0x99130110 }, /* speaker */
7528 { 0x19, 0x01a19c20 }, /* mic */
7529 { 0x1b, 0x99a7012f }, /* int-mic */
7530 { 0x21, 0x0121401f }, /* HP out */
7531 { }
7532 },
7533 },
7534 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7535 .type = HDA_FIXUP_FUNC,
08a978db
DR
7536 .v.func = alc271_hp_gate_mic_jack,
7537 .chained = true,
7538 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7539 },
b1e8972e
OR
7540 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7541 .type = HDA_FIXUP_FUNC,
7542 .v.func = alc269_fixup_limit_int_mic_boost,
7543 .chained = true,
7544 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7545 },
42397004
DR
7546 [ALC269_FIXUP_ACER_AC700] = {
7547 .type = HDA_FIXUP_PINS,
7548 .v.pins = (const struct hda_pintbl[]) {
7549 { 0x12, 0x99a3092f }, /* int-mic */
7550 { 0x14, 0x99130110 }, /* speaker */
7551 { 0x18, 0x03a11c20 }, /* mic */
7552 { 0x1e, 0x0346101e }, /* SPDIF1 */
7553 { 0x21, 0x0321101f }, /* HP out */
7554 { }
7555 },
7556 .chained = true,
7557 .chain_id = ALC271_FIXUP_DMIC,
7558 },
3e0d611b
DH
7559 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7560 .type = HDA_FIXUP_FUNC,
7561 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7562 .chained = true,
7563 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7564 },
2cede303
OR
7565 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7566 .type = HDA_FIXUP_FUNC,
7567 .v.func = alc269_fixup_limit_int_mic_boost,
7568 .chained = true,
7569 .chain_id = ALC269VB_FIXUP_DMIC,
7570 },
23870831
TI
7571 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7572 .type = HDA_FIXUP_VERBS,
7573 .v.verbs = (const struct hda_verb[]) {
7574 /* class-D output amp +5dB */
7575 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7576 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7577 {}
7578 },
7579 .chained = true,
7580 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7581 },
f882c4be
MT
7582 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7583 .type = HDA_FIXUP_PINS,
7584 .v.pins = (const struct hda_pintbl[]) {
7585 { 0x18, 0x01a110f0 }, /* use as headset mic */
7586 { }
7587 },
7588 .chained = true,
7589 .chain_id = ALC269_FIXUP_HEADSET_MIC
7590 },
8e35cd4a
DH
7591 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7592 .type = HDA_FIXUP_FUNC,
7593 .v.func = alc269_fixup_limit_int_mic_boost,
7594 .chained = true,
7595 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7596 },
02b504d9
AA
7597 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7598 .type = HDA_FIXUP_PINS,
7599 .v.pins = (const struct hda_pintbl[]) {
7600 { 0x12, 0x99a3092f }, /* int-mic */
7601 { 0x18, 0x03a11d20 }, /* mic */
7602 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7603 { }
7604 },
7605 },
cd217a63
KY
7606 [ALC283_FIXUP_CHROME_BOOK] = {
7607 .type = HDA_FIXUP_FUNC,
7608 .v.func = alc283_fixup_chromebook,
7609 },
0202e99c
KY
7610 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7611 .type = HDA_FIXUP_FUNC,
7612 .v.func = alc283_fixup_sense_combo_jack,
7613 .chained = true,
7614 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7615 },
7bba2157
TI
7616 [ALC282_FIXUP_ASUS_TX300] = {
7617 .type = HDA_FIXUP_FUNC,
7618 .v.func = alc282_fixup_asus_tx300,
7619 },
1bb3e062
KY
7620 [ALC283_FIXUP_INT_MIC] = {
7621 .type = HDA_FIXUP_VERBS,
7622 .v.verbs = (const struct hda_verb[]) {
7623 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7624 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7625 { }
7626 },
7627 .chained = true,
7628 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7629 },
0f4881dc
DH
7630 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7631 .type = HDA_FIXUP_PINS,
7632 .v.pins = (const struct hda_pintbl[]) {
7633 { 0x17, 0x90170112 }, /* subwoofer */
7634 { }
7635 },
7636 .chained = true,
7637 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7638 },
7639 [ALC290_FIXUP_SUBWOOFER] = {
7640 .type = HDA_FIXUP_PINS,
7641 .v.pins = (const struct hda_pintbl[]) {
7642 { 0x17, 0x90170112 }, /* subwoofer */
7643 { }
7644 },
7645 .chained = true,
7646 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7647 },
338cae56
DH
7648 [ALC290_FIXUP_MONO_SPEAKERS] = {
7649 .type = HDA_FIXUP_FUNC,
7650 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
7651 },
7652 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7653 .type = HDA_FIXUP_FUNC,
7654 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
7655 .chained = true,
7656 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7657 },
b67ae3f1
DH
7658 [ALC269_FIXUP_THINKPAD_ACPI] = {
7659 .type = HDA_FIXUP_FUNC,
d5a6cabf 7660 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
7661 .chained = true,
7662 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 7663 },
56f27013
DH
7664 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7665 .type = HDA_FIXUP_FUNC,
7666 .v.func = alc_fixup_inv_dmic,
7667 .chained = true,
7668 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7669 },
5824ce8d 7670 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
7671 .type = HDA_FIXUP_PINS,
7672 .v.pins = (const struct hda_pintbl[]) {
7673 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7674 { }
5824ce8d
CC
7675 },
7676 .chained = true,
17d30460 7677 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 7678 },
615966ad
CC
7679 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7680 .type = HDA_FIXUP_PINS,
7681 .v.pins = (const struct hda_pintbl[]) {
7682 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7683 { }
7684 },
7685 .chained = true,
7686 .chain_id = ALC255_FIXUP_HEADSET_MODE
7687 },
9a22a8f5
KY
7688 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7689 .type = HDA_FIXUP_PINS,
7690 .v.pins = (const struct hda_pintbl[]) {
7691 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7692 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7693 { }
7694 },
7695 .chained = true,
7696 .chain_id = ALC255_FIXUP_HEADSET_MODE
7697 },
31278997
KY
7698 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7699 .type = HDA_FIXUP_PINS,
7700 .v.pins = (const struct hda_pintbl[]) {
7701 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7702 { }
7703 },
7704 .chained = true,
7705 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7706 },
9a22a8f5
KY
7707 [ALC255_FIXUP_HEADSET_MODE] = {
7708 .type = HDA_FIXUP_FUNC,
7709 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 7710 .chained = true,
b3802783 7711 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 7712 },
31278997
KY
7713 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7714 .type = HDA_FIXUP_FUNC,
7715 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7716 },
a22aa26f
KY
7717 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7718 .type = HDA_FIXUP_PINS,
7719 .v.pins = (const struct hda_pintbl[]) {
7720 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7721 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7722 { }
7723 },
7724 .chained = true,
7725 .chain_id = ALC269_FIXUP_HEADSET_MODE
7726 },
1c37c223 7727 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 7728 .type = HDA_FIXUP_FUNC,
7f57d803 7729 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
7730 .chained = true,
7731 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7732 },
9a811230
TI
7733 [ALC292_FIXUP_TPT440] = {
7734 .type = HDA_FIXUP_FUNC,
157f0b7f 7735 .v.func = alc_fixup_disable_aamix,
9a811230
TI
7736 .chained = true,
7737 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7738 },
abaa2274 7739 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
7740 .type = HDA_FIXUP_PINS,
7741 .v.pins = (const struct hda_pintbl[]) {
7742 { 0x19, 0x04a110f0 },
7743 { },
7744 },
7745 },
b3802783 7746 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 7747 .type = HDA_FIXUP_FUNC,
8a503555 7748 .v.func = alc_fixup_micmute_led,
00ef9940 7749 },
1a22e775
TI
7750 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7751 .type = HDA_FIXUP_PINS,
7752 .v.pins = (const struct hda_pintbl[]) {
7753 { 0x12, 0x90a60130 },
7754 { 0x14, 0x90170110 },
7755 { 0x17, 0x40000008 },
7756 { 0x18, 0x411111f0 },
0420694d 7757 { 0x19, 0x01a1913c },
1a22e775
TI
7758 { 0x1a, 0x411111f0 },
7759 { 0x1b, 0x411111f0 },
7760 { 0x1d, 0x40f89b2d },
7761 { 0x1e, 0x411111f0 },
7762 { 0x21, 0x0321101f },
7763 { },
7764 },
7765 },
c8426b27
TI
7766 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7767 .type = HDA_FIXUP_FUNC,
7768 .v.func = alc269vb_fixup_aspire_e1_coef,
7769 },
7a5255f1
DH
7770 [ALC280_FIXUP_HP_GPIO4] = {
7771 .type = HDA_FIXUP_FUNC,
7772 .v.func = alc280_fixup_hp_gpio4,
7773 },
eaa8e5ef
KY
7774 [ALC286_FIXUP_HP_GPIO_LED] = {
7775 .type = HDA_FIXUP_FUNC,
7776 .v.func = alc286_fixup_hp_gpio_led,
7777 },
33f4acd3
DH
7778 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7779 .type = HDA_FIXUP_FUNC,
7780 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7781 },
b4b33f9d
TC
7782 [ALC280_FIXUP_HP_DOCK_PINS] = {
7783 .type = HDA_FIXUP_PINS,
7784 .v.pins = (const struct hda_pintbl[]) {
7785 { 0x1b, 0x21011020 }, /* line-out */
7786 { 0x1a, 0x01a1903c }, /* headset mic */
7787 { 0x18, 0x2181103f }, /* line-in */
7788 { },
7789 },
7790 .chained = true,
7791 .chain_id = ALC280_FIXUP_HP_GPIO4
7792 },
04d5466a
JK
7793 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7794 .type = HDA_FIXUP_PINS,
7795 .v.pins = (const struct hda_pintbl[]) {
7796 { 0x1b, 0x21011020 }, /* line-out */
7797 { 0x18, 0x2181103f }, /* line-in */
7798 { },
7799 },
7800 .chained = true,
7801 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7802 },
98973f2f
KP
7803 [ALC280_FIXUP_HP_9480M] = {
7804 .type = HDA_FIXUP_FUNC,
7805 .v.func = alc280_fixup_hp_9480m,
7806 },
c3bb2b52
TI
7807 [ALC245_FIXUP_HP_X360_AMP] = {
7808 .type = HDA_FIXUP_FUNC,
7809 .v.func = alc245_fixup_hp_x360_amp,
5fc462c3
JC
7810 .chained = true,
7811 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 7812 },
e1e62b98
KY
7813 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7814 .type = HDA_FIXUP_FUNC,
7815 .v.func = alc_fixup_headset_mode_dell_alc288,
7816 .chained = true,
b3802783 7817 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
7818 },
7819 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7820 .type = HDA_FIXUP_PINS,
7821 .v.pins = (const struct hda_pintbl[]) {
7822 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7823 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7824 { }
7825 },
7826 .chained = true,
7827 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7828 },
831bfdf9
HW
7829 [ALC288_FIXUP_DISABLE_AAMIX] = {
7830 .type = HDA_FIXUP_FUNC,
7831 .v.func = alc_fixup_disable_aamix,
7832 .chained = true,
d44a6864 7833 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
7834 },
7835 [ALC288_FIXUP_DELL_XPS_13] = {
7836 .type = HDA_FIXUP_FUNC,
7837 .v.func = alc_fixup_dell_xps13,
7838 .chained = true,
7839 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7840 },
8b99aba7
TI
7841 [ALC292_FIXUP_DISABLE_AAMIX] = {
7842 .type = HDA_FIXUP_FUNC,
7843 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
7844 .chained = true,
7845 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 7846 },
c04017ea
DH
7847 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7848 .type = HDA_FIXUP_FUNC,
7849 .v.func = alc_fixup_disable_aamix,
7850 .chained = true,
7851 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7852 },
5fab5829 7853 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
7854 .type = HDA_FIXUP_FUNC,
7855 .v.func = alc_fixup_dell_xps13,
7856 .chained = true,
7857 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7858 },
5fab5829
TI
7859 [ALC292_FIXUP_DELL_E7X] = {
7860 .type = HDA_FIXUP_FUNC,
8a503555 7861 .v.func = alc_fixup_micmute_led,
5fab5829
TI
7862 /* micmute fixup must be applied at last */
7863 .chained_before = true,
7864 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7865 },
54324221
JM
7866 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7867 .type = HDA_FIXUP_PINS,
7868 .v.pins = (const struct hda_pintbl[]) {
7869 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7870 { }
7871 },
7872 .chained_before = true,
7873 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7874 },
977e6276
KY
7875 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7876 .type = HDA_FIXUP_PINS,
7877 .v.pins = (const struct hda_pintbl[]) {
7878 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7879 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7880 { }
7881 },
7882 .chained = true,
7883 .chain_id = ALC269_FIXUP_HEADSET_MODE
7884 },
2f726aec
HW
7885 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7886 .type = HDA_FIXUP_PINS,
7887 .v.pins = (const struct hda_pintbl[]) {
7888 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7889 { }
7890 },
7891 .chained = true,
7892 .chain_id = ALC269_FIXUP_HEADSET_MODE
7893 },
6ed1131f
KY
7894 [ALC275_FIXUP_DELL_XPS] = {
7895 .type = HDA_FIXUP_VERBS,
7896 .v.verbs = (const struct hda_verb[]) {
7897 /* Enables internal speaker */
7898 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7899 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7900 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7901 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7902 {}
7903 }
7904 },
23adc192
HW
7905 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7906 .type = HDA_FIXUP_FUNC,
7907 .v.func = alc_fixup_disable_aamix,
7908 .chained = true,
7909 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7910 },
3694cb29
K
7911 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7912 .type = HDA_FIXUP_FUNC,
7913 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7914 },
d1ee66c5
PC
7915 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7916 .type = HDA_FIXUP_FUNC,
7917 .v.func = alc_fixup_inv_dmic,
7918 .chained = true,
7919 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7920 },
7921 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7922 .type = HDA_FIXUP_FUNC,
7923 .v.func = alc269_fixup_limit_int_mic_boost
7924 },
3b43b71f
KHF
7925 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7926 .type = HDA_FIXUP_FUNC,
7927 .v.func = alc_fixup_disable_aamix,
7928 .chained = true,
7929 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7930 },
d1dd4211
KY
7931 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7932 .type = HDA_FIXUP_FUNC,
7933 .v.func = alc_fixup_disable_mic_vref,
7934 .chained = true,
7935 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7936 },
2ae95577
DH
7937 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7938 .type = HDA_FIXUP_VERBS,
7939 .v.verbs = (const struct hda_verb[]) {
7940 /* Disable pass-through path for FRONT 14h */
7941 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7942 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7943 {}
7944 },
7945 .chained = true,
d1dd4211 7946 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 7947 },
f883982d
TI
7948 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7949 .type = HDA_FIXUP_FUNC,
7950 .v.func = alc_fixup_disable_aamix,
7951 .chained = true,
7952 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7953 },
e549d190
HW
7954 [ALC221_FIXUP_HP_FRONT_MIC] = {
7955 .type = HDA_FIXUP_PINS,
7956 .v.pins = (const struct hda_pintbl[]) {
7957 { 0x19, 0x02a19020 }, /* Front Mic */
7958 { }
7959 },
7960 },
c636b95e
SE
7961 [ALC292_FIXUP_TPT460] = {
7962 .type = HDA_FIXUP_FUNC,
7963 .v.func = alc_fixup_tpt440_dock,
7964 .chained = true,
7965 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7966 },
dd9aa335
HW
7967 [ALC298_FIXUP_SPK_VOLUME] = {
7968 .type = HDA_FIXUP_FUNC,
7969 .v.func = alc298_fixup_speaker_volume,
59ec4b57 7970 .chained = true,
2f726aec 7971 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 7972 },
f86de9b1
KY
7973 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7974 .type = HDA_FIXUP_FUNC,
7975 .v.func = alc298_fixup_speaker_volume,
7976 },
e312a869
TI
7977 [ALC295_FIXUP_DISABLE_DAC3] = {
7978 .type = HDA_FIXUP_FUNC,
7979 .v.func = alc295_fixup_disable_dac3,
7980 },
d2cd795c
JK
7981 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7982 .type = HDA_FIXUP_FUNC,
7983 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
7984 .chained = true,
7985 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 7986 },
fd06c77e
KHF
7987 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7988 .type = HDA_FIXUP_PINS,
7989 .v.pins = (const struct hda_pintbl[]) {
7990 { 0x1b, 0x90170151 },
7991 { }
7992 },
7993 .chained = true,
7994 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7995 },
823ff161
GM
7996 [ALC269_FIXUP_ATIV_BOOK_8] = {
7997 .type = HDA_FIXUP_FUNC,
7998 .v.func = alc_fixup_auto_mute_via_amp,
7999 .chained = true,
8000 .chain_id = ALC269_FIXUP_NO_SHUTUP
8001 },
4ba5c853
MT
8002 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8003 .type = HDA_FIXUP_PINS,
8004 .v.pins = (const struct hda_pintbl[]) {
8005 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8006 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8007 { }
8008 },
8009 .chained = true,
8010 .chain_id = ALC269_FIXUP_HEADSET_MODE
8011 },
9eb5d0e6
KY
8012 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8013 .type = HDA_FIXUP_PINS,
8014 .v.pins = (const struct hda_pintbl[]) {
8015 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8016 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8017 { }
8018 },
8019 .chained = true,
8020 .chain_id = ALC269_FIXUP_HEADSET_MODE
8021 },
c1732ede
CC
8022 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8023 .type = HDA_FIXUP_FUNC,
8024 .v.func = alc_fixup_headset_mode,
8025 },
8026 [ALC256_FIXUP_ASUS_MIC] = {
8027 .type = HDA_FIXUP_PINS,
8028 .v.pins = (const struct hda_pintbl[]) {
8029 { 0x13, 0x90a60160 }, /* use as internal mic */
8030 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8031 { }
8032 },
8033 .chained = true,
8034 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8035 },
eeed4cd1 8036 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
8037 .type = HDA_FIXUP_FUNC,
8038 /* Set up GPIO2 for the speaker amp */
8039 .v.func = alc_fixup_gpio4,
eeed4cd1 8040 },
216d7aeb
CC
8041 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8042 .type = HDA_FIXUP_PINS,
8043 .v.pins = (const struct hda_pintbl[]) {
8044 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8045 { }
8046 },
8047 .chained = true,
8048 .chain_id = ALC269_FIXUP_HEADSET_MIC
8049 },
8050 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8051 .type = HDA_FIXUP_VERBS,
8052 .v.verbs = (const struct hda_verb[]) {
8053 /* Enables internal speaker */
8054 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8055 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8056 {}
8057 },
8058 .chained = true,
8059 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8060 },
ca169cc2
KY
8061 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8062 .type = HDA_FIXUP_FUNC,
8063 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
8064 .chained = true,
8065 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 8066 },
ea5c7eba
JHP
8067 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
8068 .type = HDA_FIXUP_VERBS,
8069 .v.verbs = (const struct hda_verb[]) {
8070 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8071 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8072 { }
8073 },
8074 .chained = true,
8075 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8076 },
f33f79f3
HW
8077 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8078 .type = HDA_FIXUP_PINS,
8079 .v.pins = (const struct hda_pintbl[]) {
8080 /* Change the mic location from front to right, otherwise there are
8081 two front mics with the same name, pulseaudio can't handle them.
8082 This is just a temporary workaround, after applying this fixup,
8083 there will be one "Front Mic" and one "Mic" in this machine.
8084 */
8085 { 0x1a, 0x04a19040 },
8086 { }
8087 },
8088 },
5f364135
KY
8089 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8090 .type = HDA_FIXUP_PINS,
8091 .v.pins = (const struct hda_pintbl[]) {
8092 { 0x16, 0x0101102f }, /* Rear Headset HP */
8093 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8094 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8095 { 0x1b, 0x02011020 },
8096 { }
8097 },
8098 .chained = true,
52e4e368
KHF
8099 .chain_id = ALC225_FIXUP_S3_POP_NOISE
8100 },
8101 [ALC225_FIXUP_S3_POP_NOISE] = {
8102 .type = HDA_FIXUP_FUNC,
8103 .v.func = alc225_fixup_s3_pop_noise,
8104 .chained = true,
5f364135
KY
8105 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8106 },
b84e8436
PH
8107 [ALC700_FIXUP_INTEL_REFERENCE] = {
8108 .type = HDA_FIXUP_VERBS,
8109 .v.verbs = (const struct hda_verb[]) {
8110 /* Enables internal speaker */
8111 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8112 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8113 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8114 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8115 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8116 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8117 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8118 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8119 {}
8120 }
8121 },
92266651
KY
8122 [ALC274_FIXUP_DELL_BIND_DACS] = {
8123 .type = HDA_FIXUP_FUNC,
8124 .v.func = alc274_fixup_bind_dacs,
8125 .chained = true,
8126 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8127 },
8128 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8129 .type = HDA_FIXUP_PINS,
8130 .v.pins = (const struct hda_pintbl[]) {
8131 { 0x1b, 0x0401102f },
8132 { }
8133 },
8134 .chained = true,
8135 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
8136 },
399c01aa 8137 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
8138 .type = HDA_FIXUP_FUNC,
8139 .v.func = alc_fixup_tpt470_dock,
8140 .chained = true,
8141 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8142 },
399c01aa
TI
8143 [ALC298_FIXUP_TPT470_DOCK] = {
8144 .type = HDA_FIXUP_FUNC,
8145 .v.func = alc_fixup_tpt470_dacs,
8146 .chained = true,
8147 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8148 },
ae104a21
KY
8149 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8150 .type = HDA_FIXUP_PINS,
8151 .v.pins = (const struct hda_pintbl[]) {
8152 { 0x14, 0x0201101f },
8153 { }
8154 },
8155 .chained = true,
8156 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8157 },
f0ba9d69
KY
8158 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
8159 .type = HDA_FIXUP_PINS,
8160 .v.pins = (const struct hda_pintbl[]) {
8161 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8162 { }
8163 },
3ce0d5aa
HW
8164 .chained = true,
8165 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 8166 },
bbf8ff6b
TB
8167 [ALC295_FIXUP_HP_X360] = {
8168 .type = HDA_FIXUP_FUNC,
8169 .v.func = alc295_fixup_hp_top_speakers,
8170 .chained = true,
8171 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
8172 },
8173 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8174 .type = HDA_FIXUP_PINS,
8175 .v.pins = (const struct hda_pintbl[]) {
8176 { 0x19, 0x0181313f},
8177 { }
8178 },
8179 .chained = true,
8180 .chain_id = ALC269_FIXUP_HEADSET_MIC
8181 },
c4cfcf6f
HW
8182 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8183 .type = HDA_FIXUP_FUNC,
8184 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
8185 .chained = true,
8186 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 8187 },
e8ed64b0
GKK
8188 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8189 .type = HDA_FIXUP_FUNC,
8190 .v.func = alc_fixup_auto_mute_via_amp,
8191 },
33aaebd4
CC
8192 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8193 .type = HDA_FIXUP_PINS,
8194 .v.pins = (const struct hda_pintbl[]) {
8195 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8196 { }
8197 },
8198 .chained = true,
8199 .chain_id = ALC269_FIXUP_HEADSET_MIC
8200 },
d8ae458e
CC
8201 [ALC294_FIXUP_ASUS_MIC] = {
8202 .type = HDA_FIXUP_PINS,
8203 .v.pins = (const struct hda_pintbl[]) {
8204 { 0x13, 0x90a60160 }, /* use as internal mic */
8205 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8206 { }
8207 },
8208 .chained = true,
ef9ddb9d 8209 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 8210 },
4e051106
JHP
8211 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8212 .type = HDA_FIXUP_PINS,
8213 .v.pins = (const struct hda_pintbl[]) {
82b01149 8214 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
8215 { }
8216 },
8217 .chained = true,
ef9ddb9d 8218 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
8219 },
8220 [ALC294_FIXUP_ASUS_SPK] = {
8221 .type = HDA_FIXUP_VERBS,
8222 .v.verbs = (const struct hda_verb[]) {
8223 /* Set EAPD high */
8224 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8225 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
8226 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8227 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
8228 { }
8229 },
8230 .chained = true,
8231 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8232 },
c8a9afa6 8233 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 8234 .type = HDA_FIXUP_FUNC,
c8a9afa6 8235 .v.func = alc295_fixup_chromebook,
8983eb60
KY
8236 .chained = true,
8237 .chain_id = ALC225_FIXUP_HEADSET_JACK
8238 },
8239 [ALC225_FIXUP_HEADSET_JACK] = {
8240 .type = HDA_FIXUP_FUNC,
8241 .v.func = alc_fixup_headset_jack,
e854747d 8242 },
89e3a568
JS
8243 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8244 .type = HDA_FIXUP_PINS,
8245 .v.pins = (const struct hda_pintbl[]) {
8246 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8247 { }
8248 },
8249 .chained = true,
8250 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8251 },
c8c6ee61
HW
8252 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8253 .type = HDA_FIXUP_VERBS,
8254 .v.verbs = (const struct hda_verb[]) {
8255 /* Disable PCBEEP-IN passthrough */
8256 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8257 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8258 { }
8259 },
8260 .chained = true,
8261 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8262 },
cbc05fd6
JHP
8263 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8264 .type = HDA_FIXUP_PINS,
8265 .v.pins = (const struct hda_pintbl[]) {
8266 { 0x19, 0x03a11130 },
8267 { 0x1a, 0x90a60140 }, /* use as internal mic */
8268 { }
8269 },
8270 .chained = true,
8271 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8272 },
136824ef
KY
8273 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8274 .type = HDA_FIXUP_PINS,
8275 .v.pins = (const struct hda_pintbl[]) {
8276 { 0x16, 0x01011020 }, /* Rear Line out */
8277 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8278 { }
8279 },
8280 .chained = true,
8281 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8282 },
8283 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8284 .type = HDA_FIXUP_FUNC,
8285 .v.func = alc_fixup_auto_mute_via_amp,
8286 .chained = true,
8287 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8288 },
8289 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8290 .type = HDA_FIXUP_FUNC,
8291 .v.func = alc_fixup_disable_mic_vref,
8292 .chained = true,
8293 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8294 },
667a8f73
JHP
8295 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8296 .type = HDA_FIXUP_VERBS,
8297 .v.verbs = (const struct hda_verb[]) {
8298 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8299 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8300 { }
8301 },
8302 .chained = true,
8303 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8304 },
8c8967a7
DD
8305 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8306 .type = HDA_FIXUP_PINS,
8307 .v.pins = (const struct hda_pintbl[]) {
8308 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8309 { }
8310 },
8311 .chained = true,
8312 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8313 },
e1037354
JHP
8314 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8315 .type = HDA_FIXUP_PINS,
8316 .v.pins = (const struct hda_pintbl[]) {
8317 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8318 { }
8319 },
8320 .chained = true,
8321 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8322 },
e2a829b3
BR
8323 [ALC299_FIXUP_PREDATOR_SPK] = {
8324 .type = HDA_FIXUP_PINS,
8325 .v.pins = (const struct hda_pintbl[]) {
8326 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8327 { }
8328 }
8329 },
bd9c10bc 8330 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
8331 .type = HDA_FIXUP_PINS,
8332 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
8333 { 0x19, 0x04a11040 },
8334 { 0x21, 0x04211020 },
60083f9e
JHP
8335 { }
8336 },
8337 .chained = true,
bd9c10bc 8338 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 8339 },
e79c2269 8340 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
8341 .type = HDA_FIXUP_PINS,
8342 .v.pins = (const struct hda_pintbl[]) {
e79c2269 8343 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
8344 { }
8345 },
8346 .chained = true,
e79c2269 8347 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 8348 },
e79c2269
KY
8349 [ALC289_FIXUP_DUAL_SPK] = {
8350 .type = HDA_FIXUP_FUNC,
8351 .v.func = alc285_fixup_speaker2_to_dac1,
8352 .chained = true,
8353 .chain_id = ALC289_FIXUP_DELL_SPK2
8354 },
48e01504
CC
8355 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8356 .type = HDA_FIXUP_FUNC,
8357 .v.func = alc285_fixup_speaker2_to_dac1,
8358 .chained = true,
8359 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8360 },
8361 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8362 .type = HDA_FIXUP_FUNC,
8363 /* The GPIO must be pulled to initialize the AMP */
8364 .v.func = alc_fixup_gpio4,
8365 .chained = true,
48e01504 8366 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8367 },
6a6660d0
TI
8368 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8369 .type = HDA_FIXUP_FUNC,
8370 .v.func = alc285_fixup_thinkpad_x1_gen7,
8371 .chained = true,
8372 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8373 },
76f7dec0
KY
8374 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8375 .type = HDA_FIXUP_FUNC,
8376 .v.func = alc_fixup_headset_jack,
8377 .chained = true,
6a6660d0 8378 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8379 },
8b33a134
JHP
8380 [ALC294_FIXUP_ASUS_HPE] = {
8381 .type = HDA_FIXUP_VERBS,
8382 .v.verbs = (const struct hda_verb[]) {
8383 /* Set EAPD high */
8384 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8385 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8386 { }
8387 },
8388 .chained = true,
8389 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8390 },
c3cdf189
LJ
8391 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8392 .type = HDA_FIXUP_PINS,
8393 .v.pins = (const struct hda_pintbl[]) {
8394 { 0x19, 0x03a11050 }, /* front HP mic */
8395 { 0x1a, 0x01a11830 }, /* rear external mic */
8396 { 0x21, 0x03211020 }, /* front HP out */
8397 { }
8398 },
8399 .chained = true,
8400 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8401 },
8402 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8403 .type = HDA_FIXUP_VERBS,
8404 .v.verbs = (const struct hda_verb[]) {
8405 /* set 0x15 to HP-OUT ctrl */
8406 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8407 /* unmute the 0x15 amp */
8408 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8409 { }
8410 },
8411 .chained = true,
8412 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8413 },
8414 [ALC294_FIXUP_ASUS_GX502_HP] = {
8415 .type = HDA_FIXUP_FUNC,
8416 .v.func = alc294_fixup_gx502_hp,
8417 },
c1b55029
DC
8418 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8419 .type = HDA_FIXUP_PINS,
8420 .v.pins = (const struct hda_pintbl[]) {
8421 { 0x19, 0x01a11050 }, /* rear HP mic */
8422 { 0x1a, 0x01a11830 }, /* rear external mic */
8423 { 0x21, 0x012110f0 }, /* rear HP out */
8424 { }
8425 },
8426 .chained = true,
8427 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8428 },
8429 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8430 .type = HDA_FIXUP_VERBS,
8431 .v.verbs = (const struct hda_verb[]) {
8432 /* set 0x15 to HP-OUT ctrl */
8433 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8434 /* unmute the 0x15 amp */
8435 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8436 /* set 0x1b to HP-OUT */
8437 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8438 { }
8439 },
8440 .chained = true,
8441 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8442 },
8443 [ALC294_FIXUP_ASUS_GU502_HP] = {
8444 .type = HDA_FIXUP_FUNC,
8445 .v.func = alc294_fixup_gu502_hp,
c611e659
LJ
8446 },
8447 [ALC294_FIXUP_ASUS_G513_PINS] = {
8448 .type = HDA_FIXUP_PINS,
8449 .v.pins = (const struct hda_pintbl[]) {
8450 { 0x19, 0x03a11050 }, /* front HP mic */
8451 { 0x1a, 0x03a11c30 }, /* rear external mic */
8452 { 0x21, 0x03211420 }, /* front HP out */
8453 { }
8454 },
c1b55029 8455 },
bc2c2354
LJ
8456 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8457 .type = HDA_FIXUP_PINS,
8458 .v.pins = (const struct hda_pintbl[]) {
66ba7c88
LJ
8459 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8460 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8461 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8462 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8463 { 0x21, 0x03211420 },
bc2c2354
LJ
8464 { }
8465 },
bc2c2354 8466 },
1b94e59d
TI
8467 [ALC294_FIXUP_ASUS_COEF_1B] = {
8468 .type = HDA_FIXUP_VERBS,
8469 .v.verbs = (const struct hda_verb[]) {
8470 /* Set bit 10 to correct noisy output after reboot from
8471 * Windows 10 (due to pop noise reduction?)
8472 */
8473 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8474 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8475 { }
8476 },
f8fbcdfb
TI
8477 .chained = true,
8478 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8479 },
f5a88b0a
KHF
8480 [ALC285_FIXUP_HP_GPIO_LED] = {
8481 .type = HDA_FIXUP_FUNC,
8482 .v.func = alc285_fixup_hp_gpio_led,
8483 },
431e76c3
KY
8484 [ALC285_FIXUP_HP_MUTE_LED] = {
8485 .type = HDA_FIXUP_FUNC,
8486 .v.func = alc285_fixup_hp_mute_led,
8487 },
e7d66cf7
JS
8488 [ALC236_FIXUP_HP_GPIO_LED] = {
8489 .type = HDA_FIXUP_FUNC,
8490 .v.func = alc236_fixup_hp_gpio_led,
8491 },
24164f43
KY
8492 [ALC236_FIXUP_HP_MUTE_LED] = {
8493 .type = HDA_FIXUP_FUNC,
8494 .v.func = alc236_fixup_hp_mute_led,
8495 },
75b62ab6
JW
8496 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8497 .type = HDA_FIXUP_FUNC,
8498 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8499 },
a2d57ebe
KM
8500 [ALC298_FIXUP_SAMSUNG_AMP] = {
8501 .type = HDA_FIXUP_FUNC,
8502 .v.func = alc298_fixup_samsung_amp,
8503 .chained = true,
8504 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8505 },
14425f1f
MP
8506 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8507 .type = HDA_FIXUP_VERBS,
8508 .v.verbs = (const struct hda_verb[]) {
8509 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8510 { }
8511 },
8512 },
ef248d9b
MK
8513 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8514 .type = HDA_FIXUP_VERBS,
8515 .v.verbs = (const struct hda_verb[]) {
8516 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8517 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8518 { }
8519 },
8520 },
9e43342b
CC
8521 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8522 .type = HDA_FIXUP_PINS,
8523 .v.pins = (const struct hda_pintbl[]) {
8524 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8525 { }
8526 },
8527 .chained = true,
8528 .chain_id = ALC269_FIXUP_HEADSET_MODE
8529 },
8eae7e9b
JHP
8530 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8531 .type = HDA_FIXUP_PINS,
8532 .v.pins = (const struct hda_pintbl[]) {
8533 { 0x14, 0x90100120 }, /* use as internal speaker */
8534 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8535 { 0x1a, 0x01011020 }, /* use as line out */
8536 { },
8537 },
8538 .chained = true,
8539 .chain_id = ALC269_FIXUP_HEADSET_MIC
8540 },
6e15d126
JHP
8541 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8542 .type = HDA_FIXUP_PINS,
8543 .v.pins = (const struct hda_pintbl[]) {
8544 { 0x18, 0x02a11030 }, /* use as headset mic */
8545 { }
8546 },
8547 .chained = true,
8548 .chain_id = ALC269_FIXUP_HEADSET_MIC
8549 },
781c90c0
JHP
8550 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8551 .type = HDA_FIXUP_PINS,
8552 .v.pins = (const struct hda_pintbl[]) {
8553 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8554 { }
8555 },
8556 .chained = true,
8557 .chain_id = ALC269_FIXUP_HEADSET_MIC
8558 },
293a92c1 8559 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
8560 .type = HDA_FIXUP_FUNC,
8561 .v.func = alc289_fixup_asus_ga401,
8562 .chained = true,
8563 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 8564 },
4b43d05a
AS
8565 [ALC289_FIXUP_ASUS_GA502] = {
8566 .type = HDA_FIXUP_PINS,
8567 .v.pins = (const struct hda_pintbl[]) {
8568 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8569 { }
8570 },
8571 },
f50a121d
JHP
8572 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8573 .type = HDA_FIXUP_PINS,
8574 .v.pins = (const struct hda_pintbl[]) {
8575 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8576 { }
8577 },
8578 .chained = true,
8579 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8580 },
56496253
KY
8581 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8582 .type = HDA_FIXUP_FUNC,
8583 .v.func = alc285_fixup_hp_gpio_amp_init,
8584 .chained = true,
8585 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8586 },
f1ec5be1
HC
8587 [ALC269_FIXUP_CZC_B20] = {
8588 .type = HDA_FIXUP_PINS,
8589 .v.pins = (const struct hda_pintbl[]) {
8590 { 0x12, 0x411111f0 },
8591 { 0x14, 0x90170110 }, /* speaker */
8592 { 0x15, 0x032f1020 }, /* HP out */
8593 { 0x17, 0x411111f0 },
8594 { 0x18, 0x03ab1040 }, /* mic */
8595 { 0x19, 0xb7a7013f },
8596 { 0x1a, 0x0181305f },
8597 { 0x1b, 0x411111f0 },
8598 { 0x1d, 0x411111f0 },
8599 { 0x1e, 0x411111f0 },
8600 { }
8601 },
8602 .chain_id = ALC269_FIXUP_DMIC,
8603 },
8604 [ALC269_FIXUP_CZC_TMI] = {
8605 .type = HDA_FIXUP_PINS,
8606 .v.pins = (const struct hda_pintbl[]) {
8607 { 0x12, 0x4000c000 },
8608 { 0x14, 0x90170110 }, /* speaker */
8609 { 0x15, 0x0421401f }, /* HP out */
8610 { 0x17, 0x411111f0 },
8611 { 0x18, 0x04a19020 }, /* mic */
8612 { 0x19, 0x411111f0 },
8613 { 0x1a, 0x411111f0 },
8614 { 0x1b, 0x411111f0 },
8615 { 0x1d, 0x40448505 },
8616 { 0x1e, 0x411111f0 },
8617 { 0x20, 0x8000ffff },
8618 { }
8619 },
8620 .chain_id = ALC269_FIXUP_DMIC,
8621 },
8622 [ALC269_FIXUP_CZC_L101] = {
8623 .type = HDA_FIXUP_PINS,
8624 .v.pins = (const struct hda_pintbl[]) {
8625 { 0x12, 0x40000000 },
8626 { 0x14, 0x01014010 }, /* speaker */
8627 { 0x15, 0x411111f0 }, /* HP out */
8628 { 0x16, 0x411111f0 },
8629 { 0x18, 0x01a19020 }, /* mic */
8630 { 0x19, 0x02a19021 },
8631 { 0x1a, 0x0181302f },
8632 { 0x1b, 0x0221401f },
8633 { 0x1c, 0x411111f0 },
8634 { 0x1d, 0x4044c601 },
8635 { 0x1e, 0x411111f0 },
8636 { }
8637 },
8638 .chain_id = ALC269_FIXUP_DMIC,
8639 },
8640 [ALC269_FIXUP_LEMOTE_A1802] = {
8641 .type = HDA_FIXUP_PINS,
8642 .v.pins = (const struct hda_pintbl[]) {
8643 { 0x12, 0x40000000 },
8644 { 0x14, 0x90170110 }, /* speaker */
8645 { 0x17, 0x411111f0 },
8646 { 0x18, 0x03a19040 }, /* mic1 */
8647 { 0x19, 0x90a70130 }, /* mic2 */
8648 { 0x1a, 0x411111f0 },
8649 { 0x1b, 0x411111f0 },
8650 { 0x1d, 0x40489d2d },
8651 { 0x1e, 0x411111f0 },
8652 { 0x20, 0x0003ffff },
8653 { 0x21, 0x03214020 },
8654 { }
8655 },
8656 .chain_id = ALC269_FIXUP_DMIC,
8657 },
8658 [ALC269_FIXUP_LEMOTE_A190X] = {
8659 .type = HDA_FIXUP_PINS,
8660 .v.pins = (const struct hda_pintbl[]) {
8661 { 0x14, 0x99130110 }, /* speaker */
8662 { 0x15, 0x0121401f }, /* HP out */
8663 { 0x18, 0x01a19c20 }, /* rear mic */
8664 { 0x19, 0x99a3092f }, /* front mic */
8665 { 0x1b, 0x0201401f }, /* front lineout */
8666 { }
8667 },
8668 .chain_id = ALC269_FIXUP_DMIC,
8669 },
e2d2fded
KHF
8670 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8671 .type = HDA_FIXUP_PINS,
8672 .v.pins = (const struct hda_pintbl[]) {
8673 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8674 { }
8675 },
8676 .chained = true,
8677 .chain_id = ALC269_FIXUP_HEADSET_MODE
8678 },
73e7161e
WS
8679 [ALC256_FIXUP_INTEL_NUC10] = {
8680 .type = HDA_FIXUP_PINS,
8681 .v.pins = (const struct hda_pintbl[]) {
8682 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8683 { }
8684 },
8685 .chained = true,
8686 .chain_id = ALC269_FIXUP_HEADSET_MODE
8687 },
fc19d559
HW
8688 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8689 .type = HDA_FIXUP_VERBS,
8690 .v.verbs = (const struct hda_verb[]) {
8691 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8692 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8693 { }
8694 },
8695 .chained = true,
c84bfedc 8696 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 8697 },
13468bfa
HW
8698 [ALC274_FIXUP_HP_MIC] = {
8699 .type = HDA_FIXUP_VERBS,
8700 .v.verbs = (const struct hda_verb[]) {
8701 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8702 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8703 { }
8704 },
8705 },
8a8de09c
KY
8706 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8707 .type = HDA_FIXUP_FUNC,
8708 .v.func = alc274_fixup_hp_headset_mic,
8709 .chained = true,
8710 .chain_id = ALC274_FIXUP_HP_MIC
8711 },
622464c8
TI
8712 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8713 .type = HDA_FIXUP_FUNC,
8714 .v.func = alc274_fixup_hp_envy_gpio,
8715 },
ef9ce66f
KY
8716 [ALC256_FIXUP_ASUS_HPE] = {
8717 .type = HDA_FIXUP_VERBS,
8718 .v.verbs = (const struct hda_verb[]) {
8719 /* Set EAPD high */
8720 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8721 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8722 { }
8723 },
8724 .chained = true,
8725 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8726 },
446b8185
KY
8727 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8728 .type = HDA_FIXUP_FUNC,
8729 .v.func = alc_fixup_headset_jack,
8730 .chained = true,
8731 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8732 },
a0ccbc53
KY
8733 [ALC287_FIXUP_HP_GPIO_LED] = {
8734 .type = HDA_FIXUP_FUNC,
8735 .v.func = alc287_fixup_hp_gpio_led,
8736 },
9e885770
KY
8737 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8738 .type = HDA_FIXUP_FUNC,
8739 .v.func = alc274_fixup_hp_headset_mic,
8740 },
92666d45
KY
8741 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8742 .type = HDA_FIXUP_FUNC,
8743 .v.func = alc_fixup_no_int_mic,
8744 .chained = true,
8745 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8746 },
34cdf405
CC
8747 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8748 .type = HDA_FIXUP_PINS,
8749 .v.pins = (const struct hda_pintbl[]) {
8750 { 0x1b, 0x411111f0 },
8751 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8752 { },
8753 },
8754 .chained = true,
8755 .chain_id = ALC269_FIXUP_HEADSET_MODE
8756 },
495dc763
CC
8757 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8758 .type = HDA_FIXUP_FUNC,
8759 .v.func = alc269_fixup_limit_int_mic_boost,
8760 .chained = true,
8761 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8762 },
d0e18561
CC
8763 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8764 .type = HDA_FIXUP_PINS,
8765 .v.pins = (const struct hda_pintbl[]) {
8766 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8767 { 0x1a, 0x90a1092f }, /* use as internal mic */
8768 { }
8769 },
8770 .chained = true,
8771 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8772 },
26928ca1
TI
8773 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8774 .type = HDA_FIXUP_FUNC,
8775 .v.func = alc285_fixup_ideapad_s740_coef,
8776 .chained = true,
8777 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8778 },
bd15b155
KHF
8779 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8780 .type = HDA_FIXUP_FUNC,
8781 .v.func = alc269_fixup_limit_int_mic_boost,
8782 .chained = true,
8783 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8784 },
8eedd3a7
TI
8785 [ALC295_FIXUP_ASUS_DACS] = {
8786 .type = HDA_FIXUP_FUNC,
8787 .v.func = alc295_fixup_asus_dacs,
8788 },
5d84b531
TI
8789 [ALC295_FIXUP_HP_OMEN] = {
8790 .type = HDA_FIXUP_PINS,
8791 .v.pins = (const struct hda_pintbl[]) {
8792 { 0x12, 0xb7a60130 },
8793 { 0x13, 0x40000000 },
8794 { 0x14, 0x411111f0 },
8795 { 0x16, 0x411111f0 },
8796 { 0x17, 0x90170110 },
8797 { 0x18, 0x411111f0 },
8798 { 0x19, 0x02a11030 },
8799 { 0x1a, 0x411111f0 },
8800 { 0x1b, 0x04a19030 },
8801 { 0x1d, 0x40600001 },
8802 { 0x1e, 0x411111f0 },
8803 { 0x21, 0x03211020 },
8804 {}
8805 },
8806 .chained = true,
8807 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8808 },
f2be77fe 8809 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
8810 .type = HDA_FIXUP_FUNC,
8811 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 8812 },
d94befbb
DB
8813 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8814 .type = HDA_FIXUP_FUNC,
8815 .v.func = alc285_fixup_hp_spectre_x360_eb1
8816 },
9ebaef05
HW
8817 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8818 .type = HDA_FIXUP_FUNC,
8819 .v.func = alc285_fixup_ideapad_s740_coef,
8820 .chained = true,
8821 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8822 },
29c8f40b
PU
8823 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8824 .type = HDA_FIXUP_FUNC,
8825 .v.func = alc_fixup_no_shutup,
8826 .chained = true,
8827 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8828 },
57c9e21a
HW
8829 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8830 .type = HDA_FIXUP_PINS,
8831 .v.pins = (const struct hda_pintbl[]) {
8832 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8833 { }
8834 },
8835 .chained = true,
8836 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8837 },
8903376d
KHF
8838 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8839 .type = HDA_FIXUP_FUNC,
8840 .v.func = alc269_fixup_limit_int_mic_boost,
8841 .chained = true,
8842 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8843 },
8f4c9042
BF
8844 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8845 .type = HDA_FIXUP_FUNC,
8846 .v.func = alc285_fixup_ideapad_s740_coef,
8847 .chained = true,
8848 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8849 },
8850 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8851 .type = HDA_FIXUP_FUNC,
8852 .v.func = alc287_fixup_legion_15imhg05_speakers,
8853 .chained = true,
8854 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8855 },
ad7cc2d4
CB
8856 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8857 .type = HDA_FIXUP_VERBS,
8858 //.v.verbs = legion_15imhg05_coefs,
8859 .v.verbs = (const struct hda_verb[]) {
8860 // set left speaker Legion 7i.
8861 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8862 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8863
8864 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8865 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8866 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8867 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8868 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8869
8870 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8871 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8872 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8873 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8874 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8875
8876 // set right speaker Legion 7i.
8877 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8878 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8879
8880 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8881 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8882 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8883 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8884 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8885
8886 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8887 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8888 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8889 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8890 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8891 {}
8892 },
8893 .chained = true,
8894 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8895 },
8896 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8897 .type = HDA_FIXUP_FUNC,
8898 .v.func = alc287_fixup_legion_15imhg05_speakers,
8899 .chained = true,
8900 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8901 },
8902 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8903 .type = HDA_FIXUP_VERBS,
8904 .v.verbs = (const struct hda_verb[]) {
8905 // set left speaker Yoga 7i.
8906 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8907 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8908
8909 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8910 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8911 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8912 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8913 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8914
8915 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8916 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8917 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8918 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8919 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8920
8921 // set right speaker Yoga 7i.
8922 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8923 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8924
8925 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8926 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8927 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8928 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8929 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8930
8931 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8932 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8933 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8934 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8935 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8936 {}
8937 },
8938 .chained = true,
8939 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8940 },
56ec3e75
TI
8941 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
8942 .type = HDA_FIXUP_FUNC,
8943 .v.func = alc298_fixup_lenovo_c940_duet7,
8944 },
ad7cc2d4
CB
8945 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8946 .type = HDA_FIXUP_VERBS,
8947 .v.verbs = (const struct hda_verb[]) {
8948 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8949 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 8950 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
8951 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8952 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8953 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8954 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8955 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8956 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8957 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8958 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8959 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8960 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8961 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8962 {}
8963 },
8964 .chained = true,
8965 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8966 },
619764cc 8967 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 8968 .type = HDA_FIXUP_FUNC,
619764cc 8969 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 8970 },
5fc462c3
JC
8971 [ALC245_FIXUP_HP_GPIO_LED] = {
8972 .type = HDA_FIXUP_FUNC,
8973 .v.func = alc245_fixup_hp_gpio_led,
8974 },
1278cc5a
JS
8975 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8976 .type = HDA_FIXUP_PINS,
8977 .v.pins = (const struct hda_pintbl[]) {
8978 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8979 { }
8980 },
8981 .chained = true,
8982 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8983 },
174a7fb3
WS
8984 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8985 .type = HDA_FIXUP_FUNC,
8986 .v.func = alc233_fixup_no_audio_jack,
8987 },
edca7cc4
WS
8988 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8989 .type = HDA_FIXUP_FUNC,
8990 .v.func = alc256_fixup_mic_no_presence_and_resume,
8991 .chained = true,
8992 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8993 },
d3dca026
LT
8994 [ALC287_FIXUP_LEGION_16ACHG6] = {
8995 .type = HDA_FIXUP_FUNC,
8996 .v.func = alc287_fixup_legion_16achg6_speakers,
8997 },
ae7abe36
SB
8998 [ALC287_FIXUP_CS35L41_I2C_2] = {
8999 .type = HDA_FIXUP_FUNC,
9000 .v.func = cs35l41_fixup_i2c_two,
a6ac60b3
HW
9001 .chained = true,
9002 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
ae7abe36 9003 },
b3fbe536
AC
9004 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9005 .type = HDA_FIXUP_FUNC,
9006 .v.func = cs35l41_fixup_i2c_two,
9007 .chained = true,
9008 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
ae7abe36 9009 },
07bcab93
LT
9010 [ALC245_FIXUP_CS35L41_SPI_2] = {
9011 .type = HDA_FIXUP_FUNC,
9012 .v.func = cs35l41_fixup_spi_two,
9013 },
ce18f905
KHF
9014 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9015 .type = HDA_FIXUP_FUNC,
9016 .v.func = cs35l41_fixup_spi_two,
9017 .chained = true,
9018 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9019 },
07bcab93
LT
9020 [ALC245_FIXUP_CS35L41_SPI_4] = {
9021 .type = HDA_FIXUP_FUNC,
9022 .v.func = cs35l41_fixup_spi_four,
9023 },
9024 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9025 .type = HDA_FIXUP_FUNC,
864cb14c 9026 .v.func = cs35l41_fixup_spi_four,
07bcab93 9027 .chained = true,
864cb14c 9028 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
07bcab93 9029 },
91502a9a
AS
9030 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9031 .type = HDA_FIXUP_VERBS,
9032 .v.verbs = (const struct hda_verb[]) {
9033 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9034 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9035 { }
9036 },
9037 .chained = true,
9038 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9039 },
1efcdd9c
GM
9040 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9041 .type = HDA_FIXUP_FUNC,
9042 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
9043 .chained = true,
9044 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9045 },
309d7363
DH
9046 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9047 .type = HDA_FIXUP_PINS,
9048 .v.pins = (const struct hda_pintbl[]) {
9049 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9050 { }
9051 },
9052 .chained = true,
9053 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9054 },
1e24881d
LT
9055 [ALC287_FIXUP_LEGION_16ITHG6] = {
9056 .type = HDA_FIXUP_FUNC,
9057 .v.func = alc287_fixup_legion_16ithg6_speakers,
9058 },
3790a3d6
PJ
9059 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9060 .type = HDA_FIXUP_VERBS,
9061 .v.verbs = (const struct hda_verb[]) {
9062 // enable left speaker
9063 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9064 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9065
9066 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9067 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9068 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9069 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9070 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9071
9072 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9073 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9074 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9075 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9076 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9077
9078 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9079 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9080 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9081 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9082 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9083
9084 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9085 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9086 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9087 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9088 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9089
9090 // enable right speaker
9091 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9092 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9093
9094 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9095 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9096 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9097 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9098 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9099
9100 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9101 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9102 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9103 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9104 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9105
9106 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9107 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9108 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9109 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9110 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9111
9112 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9113 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9114 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9115 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9116 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9117
9118 { },
9119 },
9120 },
9121 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9122 .type = HDA_FIXUP_FUNC,
9123 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9124 .chained = true,
9125 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9126 },
2912cdda
PJ
9127 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9128 .type = HDA_FIXUP_FUNC,
9129 .v.func = alc295_fixup_dell_inspiron_top_speakers,
9130 .chained = true,
9131 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9132 },
f1d4e28b
KY
9133};
9134
1d045db9 9135static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 9136 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
9137 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9138 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 9139 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 9140 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
9141 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9142 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 9143 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 9144 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 9145 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 9146 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 9147 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 9148 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 9149 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 9150 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 9151 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 9152 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
9153 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9154 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
9155 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9156 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 9157 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 9158 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 9159 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 9160 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
667a8f73
JHP
9161 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9162 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9163 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 9164 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
5f3fe25e 9165 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
35171fbf 9166 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 9167 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 9168 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 9169 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
2a5bb694 9170 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 9171 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 9172 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 9173 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
aaedfb47 9174 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
841bdf85 9175 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
6ed1131f 9176 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 9177 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 9178 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
9179 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9180 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 9181 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
9182 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9183 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9184 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
9185 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9186 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 9187 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 9188 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 9189 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
9190 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9191 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 9192 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 9193 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 9194 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 9195 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
9196 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9197 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
9198 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9199 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9200 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9201 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9202 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 9203 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 9204 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 9205 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 9206 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 9207 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 9208 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 9209 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 9210 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
9211 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9212 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
9213 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9214 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 9215 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 9216 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 9217 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 9218 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 9219 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 9220 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
9221 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9222 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
9223 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9224 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
1efcdd9c 9225 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
c1e89523 9226 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 9227 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 9228 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
9229 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9230 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
15dad62f 9231 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
bdc9b739 9232 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
2912cdda
PJ
9233 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9234 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
a22aa26f
KY
9235 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9236 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 9237 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 9238 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 9239 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 9240 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9241 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9242 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9243 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9244 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9245 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9246 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
9247 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9248 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9249 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9250 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 9251 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
9252 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9253 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9254 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9255 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9256 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 9257 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 9258 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 9259 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 9260 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9261 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9262 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9263 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9264 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9265 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9266 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9267 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9268 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 9269 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9270 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9271 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9272 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9273 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 9274 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9275 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9276 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9277 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9278 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9279 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9280 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9281 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9282 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9283 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9284 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9285 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9286 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9287 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9288 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9289 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
9290 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9291 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9292 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9293 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4ba5c853 9294 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
167897f4
JK
9295 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9296 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
9297 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9298 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
563785ed 9299 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
e549d190 9300 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 9301 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 9302 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
9303 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9304 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 9305 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 9306 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 9307 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
5d84b531 9308 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 9309 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 9310 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
d296a74b 9311 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 9312 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 9313 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
622464c8 9314 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
24df5428
IH
9315 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9316 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
15d295b5 9317 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 9318 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 9319 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
c058493d 9320 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 9321 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 9322 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
05ec7161 9323 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 9324 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 9325 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
431e76c3 9326 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 9327 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
9328 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9329 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9330 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9331 ALC285_FIXUP_HP_GPIO_AMP_INIT),
30267718 9332 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
b2e6b3d9 9333 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
375f8426 9334 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
48422958 9335 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 9336 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 9337 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 9338 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 9339 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
9340 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9341 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 9342 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 9343 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
d07149ab 9344 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 9345 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
9346 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9347 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
53b861be 9348 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 9349 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 9350 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 9351 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
9352 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9353 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 9354 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 9355 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 9356 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
600dd2a7 9357 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
91502a9a 9358 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
0e68c4b1 9359 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 9360 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 9361 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
49632230 9362 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
f86bfeb6 9363 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
5f5d8890
AC
9364 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9365 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9366 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9367 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9368 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9369 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93
LT
9370 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9371 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9372 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9373 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9374 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9375 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9376 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
e6194c8d
AC
9377 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9378 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
024a7ad9 9379 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
e6194c8d
AC
9380 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9381 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
f86bfeb6 9382 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93 9383 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
ce18f905 9384 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
f7ac570d 9385 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
5f3d696e 9386 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
61d30785
JS
9387 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9388 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9389 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9390 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
35a17444 9391 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
c578d5da
KHF
9392 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9393 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
1d8025ec
AC
9394 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9395 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
c1732ede 9396 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 9397 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 9398 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 9399 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 9400 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 9401 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3e0d611b 9402 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 9403 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 9404 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 9405 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
9406 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9407 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
461122b9 9408 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
c1732ede 9409 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 9410 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
f882c4be 9411 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
c1732ede 9412 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 9413 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
23870831 9414 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
b16c8f22
TI
9415 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9416 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
3e0d611b 9417 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8eedd3a7 9418 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 9419 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
3cd0ed63 9420 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 9421 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
4963d66b 9422 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 9423 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
4fad4fb9 9424 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 9425 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 9426 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 9427 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 9428 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 9429 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
461122b9 9430 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1b94e59d 9431 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
693b613d 9432 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
615966ad 9433 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1 9434 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
bc2c2354 9435 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
c1732ede 9436 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
b16c8f22 9437 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ef9ce66f 9438 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
491a4ccd 9439 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),
4b43d05a 9440 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
c1b55029 9441 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
c611e659 9442 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
76fae618 9443 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
ba1f8180 9444 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
293a92c1 9445 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8d06679b 9446 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
2ea8e129 9447 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 9448 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
adabb3ec
TI
9449 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9450 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9451 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9452 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 9453 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
9454 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9455 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9456 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 9457 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
9458 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9459 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 9460 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 9461 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 9462 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 9463 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 9464 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 9465 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 9466 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 9467 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 9468 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
4f2e56a5 9469 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
9470 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9471 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
0fca97a2 9472 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
a33cc48d 9473 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
a2d57ebe
KM
9474 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9475 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9476 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9477 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
b18a4563 9478 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
1abfd71e 9479 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
823ff161 9480 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
a2d57ebe
KM
9481 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9482 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
ef248d9b 9483 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
abaa2274
AA
9484 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9485 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 9486 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 9487 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
b5acfe15 9488 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 9489 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9490 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9491 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9492 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9493 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9494 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9495 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9496 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
be561ffa 9497 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9498 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9499 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9500 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
9501 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9502 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9503 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9504 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9505 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9506 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9507 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
9508 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9509 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9510 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 9511 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9512 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9513 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9514 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9515 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9516 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9517 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9518 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9519 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9520 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9521 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9522 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9523 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
627ce0d6 9524 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
90d74fdb 9525 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11bea269 9526 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9527 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9528 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9529 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9530 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9531 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
9532 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9533 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9534 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9535 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9536 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 9537 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9cb72750 9538 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
86222af0 9539 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0c20fce1 9540 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 9541 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
edca7cc4 9542 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
9543 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9544 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9545 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9546 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 9547 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
9548 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9549 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
9550 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9551 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
9552 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9553 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9554 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9555 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9556 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9557 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 9558 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 9559 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
9560 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9561 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9562 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9563 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9564 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 9565 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 9566 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 9567 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 9568 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 9569 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 9570 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 9571 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 9572 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 9573 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 9574 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 9575 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 9576 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 9577 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 9578 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 9579 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 9580 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
9581 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9582 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 9583 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 9584 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9585 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9586 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9587 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 9588 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9589 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9590 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9591 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 9592 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 9593 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 9594 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
9595 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9596 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
ae7abe36
SB
9597 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9598 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9599 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
3694cb29 9600 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 9601 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 9602 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 9603 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 9604 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 9605 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 9606 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 9607 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
9608 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9609 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 9610 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
3790a3d6 9611 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
85743a84 9612 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
2aac550d 9613 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
56ec3e75 9614 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
2aac550d 9615 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
3b79954f 9616 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8f4c9042 9617 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
2aac550d 9618 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b81e9e5c 9619 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
c07f2c7b 9620 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 9621 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
d3dca026 9622 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
2aac550d 9623 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
9624 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9625 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1e24881d 9626 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
70cfdd03 9627 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
56f27013 9628 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 9629 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 9630 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 9631 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 9632 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 9633 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 9634 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 9635 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 9636 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 9637 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 9638 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 9639 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 9640 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 9641 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 9642 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 9643 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9644 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9645 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9646 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
264fb034 9647 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
cd5302c0 9648 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
9649 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9650 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 9651 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
174a7fb3 9652 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
79e28f2a 9653 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
0fbf21c3 9654 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
cbcdf8c4 9655 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
f1ec5be1
HC
9656 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9657 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9658 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 9659 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
9660 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9661 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
619764cc 9662 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8b3b2392
WS
9663 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9664 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9665 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9666 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9667 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9668 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9669 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9670 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
fc19d559 9671 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 9672 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 9673 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9b043a8f 9674 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 9675 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
d1ee66c5 9676 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 9677 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 9678 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
309d7363 9679 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
a4297b5d 9680
a7f3eedc 9681#if 0
a4297b5d
TI
9682 /* Below is a quirk table taken from the old code.
9683 * Basically the device should work as is without the fixup table.
9684 * If BIOS doesn't give a proper info, enable the corresponding
9685 * fixup entry.
7d7eb9ea 9686 */
a4297b5d
TI
9687 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9688 ALC269_FIXUP_AMIC),
9689 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
9690 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9691 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9692 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9693 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9694 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9695 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9696 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9697 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9698 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9699 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9700 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9701 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9702 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9703 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9704 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9705 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9706 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9707 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9708 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9709 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9710 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9711 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9712 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9713 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9714 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9715 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9716 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9717 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9718 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9719 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9720 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9721 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9722 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9723 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9724 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9725 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9726 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9727 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9728#endif
9729 {}
9730};
9731
214eef76
DH
9732static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9733 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9734 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9735 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9736 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 9737 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
9738 {}
9739};
9740
1727a771 9741static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
9742 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9743 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
9744 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9745 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9746 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 9747 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
9748 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9749 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 9750 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 9751 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 9752 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 9753 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
9754 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9755 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
9756 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9757 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 9758 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 9759 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 9760 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 9761 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 9762 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 9763 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 9764 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 9765 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 9766 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
9767 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9768 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9769 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9770 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9771 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9772 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9773 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9774 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9775 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9776 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9777 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9778 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9779 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9780 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9781 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9782 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9783 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9784 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9785 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9786 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9787 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9788 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9789 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9790 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9791 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9792 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9793 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9794 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9795 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9796 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9797 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9798 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9799 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9800 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9801 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9802 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9803 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9804 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9805 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9806 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 9807 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 9808 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 9809 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
9810 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9811 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9812 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9813 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9814 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9815 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9816 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9817 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9818 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9819 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9820 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9821 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9822 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9823 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
9824 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9825 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9826 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 9827 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 9828 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 9829 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
9830 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9831 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9832 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9833 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9834 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9835 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9836 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9837 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9838 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9839 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9840 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9841 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9842 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9843 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9844 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9845 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9846 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
9847 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9848 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 9849 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 9850 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 9851 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
a2d57ebe 9852 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
ef248d9b 9853 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
fc19d559 9854 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 9855 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 9856 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 9857 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 9858 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 9859 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9ebaef05 9860 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
3790a3d6 9861 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
29c8f40b 9862 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 9863 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
aa723946 9864 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 9865 {}
6dda9f4a 9866};
cfc5a845 9867#define ALC225_STANDARD_PINS \
cfc5a845 9868 {0x21, 0x04211020}
6dda9f4a 9869
e8191a8e
HW
9870#define ALC256_STANDARD_PINS \
9871 {0x12, 0x90a60140}, \
9872 {0x14, 0x90170110}, \
e8191a8e
HW
9873 {0x21, 0x02211020}
9874
fea185e2 9875#define ALC282_STANDARD_PINS \
11580297 9876 {0x14, 0x90170110}
e1e62b98 9877
fea185e2 9878#define ALC290_STANDARD_PINS \
11580297 9879 {0x12, 0x99a30130}
fea185e2
DH
9880
9881#define ALC292_STANDARD_PINS \
9882 {0x14, 0x90170110}, \
11580297 9883 {0x15, 0x0221401f}
977e6276 9884
3f640970
HW
9885#define ALC295_STANDARD_PINS \
9886 {0x12, 0xb7a60130}, \
9887 {0x14, 0x90170110}, \
3f640970
HW
9888 {0x21, 0x04211020}
9889
703867e2
WS
9890#define ALC298_STANDARD_PINS \
9891 {0x12, 0x90a60130}, \
9892 {0x21, 0x03211020}
9893
e1918938 9894static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
9895 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9896 {0x14, 0x01014020},
9897 {0x17, 0x90170110},
9898 {0x18, 0x02a11030},
9899 {0x19, 0x0181303F},
9900 {0x21, 0x0221102f}),
5824ce8d
CC
9901 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9902 {0x12, 0x90a601c0},
9903 {0x14, 0x90171120},
9904 {0x21, 0x02211030}),
615966ad
CC
9905 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9906 {0x14, 0x90170110},
9907 {0x1b, 0x90a70130},
9908 {0x21, 0x03211020}),
9909 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9910 {0x1a, 0x90a70130},
9911 {0x1b, 0x90170110},
9912 {0x21, 0x03211020}),
2ae95577 9913 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9914 ALC225_STANDARD_PINS,
8a132099 9915 {0x12, 0xb7a60130},
cfc5a845 9916 {0x14, 0x901701a0}),
2ae95577 9917 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9918 ALC225_STANDARD_PINS,
8a132099 9919 {0x12, 0xb7a60130},
cfc5a845 9920 {0x14, 0x901701b0}),
8a132099
HW
9921 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9922 ALC225_STANDARD_PINS,
9923 {0x12, 0xb7a60150},
9924 {0x14, 0x901701a0}),
9925 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9926 ALC225_STANDARD_PINS,
9927 {0x12, 0xb7a60150},
9928 {0x14, 0x901701b0}),
9929 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9930 ALC225_STANDARD_PINS,
9931 {0x12, 0xb7a60130},
9932 {0x1b, 0x90170110}),
0ce48e17
KHF
9933 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9934 {0x1b, 0x01111010},
9935 {0x1e, 0x01451130},
9936 {0x21, 0x02211020}),
986376b6
HW
9937 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9938 {0x12, 0x90a60140},
9939 {0x14, 0x90170110},
9940 {0x19, 0x02a11030},
9941 {0x21, 0x02211020}),
e41fc8c5
HW
9942 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9943 {0x14, 0x90170110},
9944 {0x19, 0x02a11030},
9945 {0x1a, 0x02a11040},
9946 {0x1b, 0x01014020},
9947 {0x21, 0x0221101f}),
d06fb562
HW
9948 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9949 {0x14, 0x90170110},
9950 {0x19, 0x02a11030},
9951 {0x1a, 0x02a11040},
9952 {0x1b, 0x01011020},
9953 {0x21, 0x0221101f}),
c6b17f10
HW
9954 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9955 {0x14, 0x90170110},
9956 {0x19, 0x02a11020},
9957 {0x1a, 0x02a11030},
9958 {0x21, 0x0221101f}),
92666d45
KY
9959 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9960 {0x21, 0x02211010}),
9e885770
KY
9961 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9962 {0x14, 0x90170110},
9963 {0x19, 0x02a11020},
9964 {0x21, 0x02211030}),
c77900e6 9965 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 9966 {0x14, 0x90170110},
c77900e6 9967 {0x21, 0x02211020}),
86c72d1c
HW
9968 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9969 {0x14, 0x90170130},
9970 {0x21, 0x02211040}),
76c2132e
DH
9971 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9972 {0x12, 0x90a60140},
9973 {0x14, 0x90170110},
76c2132e
DH
9974 {0x21, 0x02211020}),
9975 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9976 {0x12, 0x90a60160},
9977 {0x14, 0x90170120},
76c2132e 9978 {0x21, 0x02211030}),
392c9da2
HW
9979 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9980 {0x14, 0x90170110},
9981 {0x1b, 0x02011020},
9982 {0x21, 0x0221101f}),
6aecd871
HW
9983 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9984 {0x14, 0x90170110},
9985 {0x1b, 0x01011020},
9986 {0x21, 0x0221101f}),
cba59972 9987 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 9988 {0x14, 0x90170130},
cba59972 9989 {0x1b, 0x01014020},
cba59972 9990 {0x21, 0x0221103f}),
6aecd871
HW
9991 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9992 {0x14, 0x90170130},
9993 {0x1b, 0x01011020},
9994 {0x21, 0x0221103f}),
59ec4b57
HW
9995 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9996 {0x14, 0x90170130},
9997 {0x1b, 0x02011020},
9998 {0x21, 0x0221103f}),
e9c28e16 9999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10000 {0x14, 0x90170150},
e9c28e16 10001 {0x1b, 0x02011020},
e9c28e16
WS
10002 {0x21, 0x0221105f}),
10003 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10004 {0x14, 0x90170110},
e9c28e16 10005 {0x1b, 0x01014020},
e9c28e16 10006 {0x21, 0x0221101f}),
76c2132e
DH
10007 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10008 {0x12, 0x90a60160},
10009 {0x14, 0x90170120},
10010 {0x17, 0x90170140},
76c2132e
DH
10011 {0x21, 0x0321102f}),
10012 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10013 {0x12, 0x90a60160},
10014 {0x14, 0x90170130},
76c2132e
DH
10015 {0x21, 0x02211040}),
10016 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10017 {0x12, 0x90a60160},
10018 {0x14, 0x90170140},
76c2132e
DH
10019 {0x21, 0x02211050}),
10020 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10021 {0x12, 0x90a60170},
10022 {0x14, 0x90170120},
76c2132e
DH
10023 {0x21, 0x02211030}),
10024 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10025 {0x12, 0x90a60170},
10026 {0x14, 0x90170130},
76c2132e 10027 {0x21, 0x02211040}),
0a1f90a9
HW
10028 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10029 {0x12, 0x90a60170},
10030 {0x14, 0x90171130},
10031 {0x21, 0x02211040}),
70658b99 10032 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
10033 {0x12, 0x90a60170},
10034 {0x14, 0x90170140},
70658b99 10035 {0x21, 0x02211050}),
9b5a4e39 10036 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
10037 {0x12, 0x90a60180},
10038 {0x14, 0x90170130},
9b5a4e39 10039 {0x21, 0x02211040}),
f90d83b3
AK
10040 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10041 {0x12, 0x90a60180},
10042 {0x14, 0x90170120},
10043 {0x21, 0x02211030}),
989dbe4a
HW
10044 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10045 {0x1b, 0x01011020},
10046 {0x21, 0x02211010}),
c1732ede
CC
10047 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10048 {0x14, 0x90170110},
10049 {0x1b, 0x90a70130},
10050 {0x21, 0x04211020}),
10051 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10052 {0x14, 0x90170110},
10053 {0x1b, 0x90a70130},
10054 {0x21, 0x03211020}),
a806ef1c
CC
10055 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10056 {0x12, 0x90a60130},
10057 {0x14, 0x90170110},
10058 {0x21, 0x03211020}),
6ac371aa
JHP
10059 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10060 {0x12, 0x90a60130},
10061 {0x14, 0x90170110},
10062 {0x21, 0x04211020}),
e1037354
JHP
10063 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10064 {0x1a, 0x90a70130},
10065 {0x1b, 0x90170110},
10066 {0x21, 0x03211020}),
9e885770
KY
10067 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10068 {0x14, 0x90170110},
10069 {0x19, 0x02a11020},
10070 {0x21, 0x0221101f}),
8a8de09c
KY
10071 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10072 {0x17, 0x90170110},
10073 {0x19, 0x03a11030},
10074 {0x21, 0x03211020}),
cf51eb9d
DH
10075 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10076 {0x12, 0x90a60130},
cf51eb9d
DH
10077 {0x14, 0x90170110},
10078 {0x15, 0x0421101f},
11580297 10079 {0x1a, 0x04a11020}),
0279661b
HW
10080 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10081 {0x12, 0x90a60140},
0279661b
HW
10082 {0x14, 0x90170110},
10083 {0x15, 0x0421101f},
0279661b 10084 {0x18, 0x02811030},
0279661b 10085 {0x1a, 0x04a1103f},
11580297 10086 {0x1b, 0x02011020}),
42304474 10087 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10088 ALC282_STANDARD_PINS,
42304474 10089 {0x12, 0x99a30130},
42304474 10090 {0x19, 0x03a11020},
42304474 10091 {0x21, 0x0321101f}),
2c609999 10092 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10093 ALC282_STANDARD_PINS,
2c609999 10094 {0x12, 0x99a30130},
2c609999 10095 {0x19, 0x03a11020},
2c609999
HW
10096 {0x21, 0x03211040}),
10097 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10098 ALC282_STANDARD_PINS,
2c609999 10099 {0x12, 0x99a30130},
2c609999 10100 {0x19, 0x03a11030},
2c609999
HW
10101 {0x21, 0x03211020}),
10102 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10103 ALC282_STANDARD_PINS,
2c609999 10104 {0x12, 0x99a30130},
2c609999 10105 {0x19, 0x04a11020},
2c609999 10106 {0x21, 0x0421101f}),
200afc09 10107 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 10108 ALC282_STANDARD_PINS,
200afc09 10109 {0x12, 0x90a60140},
200afc09 10110 {0x19, 0x04a11030},
200afc09 10111 {0x21, 0x04211020}),
34cdf405
CC
10112 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10113 ALC282_STANDARD_PINS,
10114 {0x12, 0x90a609c0},
10115 {0x18, 0x03a11830},
10116 {0x19, 0x04a19831},
10117 {0x1a, 0x0481303f},
10118 {0x1b, 0x04211020},
10119 {0x21, 0x0321101f}),
10120 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10121 ALC282_STANDARD_PINS,
10122 {0x12, 0x90a60940},
10123 {0x18, 0x03a11830},
10124 {0x19, 0x04a19831},
10125 {0x1a, 0x0481303f},
10126 {0x1b, 0x04211020},
10127 {0x21, 0x0321101f}),
76c2132e 10128 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10129 ALC282_STANDARD_PINS,
76c2132e 10130 {0x12, 0x90a60130},
76c2132e
DH
10131 {0x21, 0x0321101f}),
10132 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10133 {0x12, 0x90a60160},
10134 {0x14, 0x90170120},
76c2132e 10135 {0x21, 0x02211030}),
bc262179 10136 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10137 ALC282_STANDARD_PINS,
bc262179 10138 {0x12, 0x90a60130},
bc262179 10139 {0x19, 0x03a11020},
bc262179 10140 {0x21, 0x0321101f}),
c8c6ee61 10141 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
10142 {0x12, 0x90a60130},
10143 {0x14, 0x90170110},
10144 {0x19, 0x04a11040},
10145 {0x21, 0x04211020}),
10146 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10147 {0x14, 0x90170110},
10148 {0x19, 0x04a11040},
10149 {0x1d, 0x40600001},
10150 {0x21, 0x04211020}),
10151 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
10152 {0x14, 0x90170110},
10153 {0x19, 0x04a11040},
10154 {0x21, 0x04211020}),
c72b9bfe
HW
10155 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10156 {0x14, 0x90170110},
10157 {0x17, 0x90170111},
10158 {0x19, 0x03a11030},
10159 {0x21, 0x03211020}),
33aaebd4
CC
10160 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10161 {0x12, 0x90a60130},
10162 {0x17, 0x90170110},
10163 {0x21, 0x02211020}),
d44a6864 10164 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 10165 {0x12, 0x90a60120},
e1e62b98 10166 {0x14, 0x90170110},
e1e62b98 10167 {0x21, 0x0321101f}),
e4442bcf 10168 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10169 ALC290_STANDARD_PINS,
e4442bcf 10170 {0x15, 0x04211040},
e4442bcf 10171 {0x18, 0x90170112},
11580297 10172 {0x1a, 0x04a11020}),
e4442bcf 10173 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10174 ALC290_STANDARD_PINS,
e4442bcf 10175 {0x15, 0x04211040},
e4442bcf 10176 {0x18, 0x90170110},
11580297 10177 {0x1a, 0x04a11020}),
e4442bcf 10178 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10179 ALC290_STANDARD_PINS,
e4442bcf 10180 {0x15, 0x0421101f},
11580297 10181 {0x1a, 0x04a11020}),
e4442bcf 10182 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10183 ALC290_STANDARD_PINS,
e4442bcf 10184 {0x15, 0x04211020},
11580297 10185 {0x1a, 0x04a11040}),
e4442bcf 10186 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10187 ALC290_STANDARD_PINS,
e4442bcf
HW
10188 {0x14, 0x90170110},
10189 {0x15, 0x04211020},
11580297 10190 {0x1a, 0x04a11040}),
e4442bcf 10191 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10192 ALC290_STANDARD_PINS,
e4442bcf
HW
10193 {0x14, 0x90170110},
10194 {0x15, 0x04211020},
11580297 10195 {0x1a, 0x04a11020}),
e4442bcf 10196 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10197 ALC290_STANDARD_PINS,
e4442bcf
HW
10198 {0x14, 0x90170110},
10199 {0x15, 0x0421101f},
11580297 10200 {0x1a, 0x04a11020}),
e8818fa8 10201 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10202 ALC292_STANDARD_PINS,
e8818fa8 10203 {0x12, 0x90a60140},
e8818fa8 10204 {0x16, 0x01014020},
11580297 10205 {0x19, 0x01a19030}),
e8818fa8 10206 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10207 ALC292_STANDARD_PINS,
e8818fa8 10208 {0x12, 0x90a60140},
e8818fa8
HW
10209 {0x16, 0x01014020},
10210 {0x18, 0x02a19031},
11580297 10211 {0x19, 0x01a1903e}),
76c2132e 10212 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 10213 ALC292_STANDARD_PINS,
11580297 10214 {0x12, 0x90a60140}),
76c2132e 10215 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10216 ALC292_STANDARD_PINS,
76c2132e 10217 {0x13, 0x90a60140},
76c2132e 10218 {0x16, 0x21014020},
11580297 10219 {0x19, 0x21a19030}),
e03fdbde 10220 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10221 ALC292_STANDARD_PINS,
11580297 10222 {0x13, 0x90a60140}),
eeacd80f
JHP
10223 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10224 {0x17, 0x90170110},
10225 {0x21, 0x04211020}),
d8ae458e
CC
10226 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10227 {0x14, 0x90170110},
10228 {0x1b, 0x90a70130},
10229 {0x21, 0x04211020}),
8bb37a2a
JHP
10230 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10231 {0x12, 0x90a60130},
10232 {0x17, 0x90170110},
10233 {0x21, 0x03211020}),
0bea4cc8
JHP
10234 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10235 {0x12, 0x90a60130},
10236 {0x17, 0x90170110},
10237 {0x21, 0x04211020}),
3887c26c
TI
10238 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10239 {0x12, 0x90a60130},
10240 {0x17, 0x90170110},
10241 {0x21, 0x03211020}),
9e43342b 10242 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
10243 {0x12, 0x90a60120},
10244 {0x17, 0x90170110},
10245 {0x21, 0x04211030}),
10246 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
10247 {0x12, 0x90a60130},
10248 {0x17, 0x90170110},
10249 {0x21, 0x03211020}),
10250 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10251 {0x12, 0x90a60130},
10252 {0x17, 0x90170110},
10253 {0x21, 0x03211020}),
fbc57129 10254 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
0a29c57b
KY
10255 {0x14, 0x90170110},
10256 {0x21, 0x04211020}),
fbc57129
KY
10257 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10258 {0x14, 0x90170110},
10259 {0x21, 0x04211030}),
3f640970 10260 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
f771d5bb
HW
10261 ALC295_STANDARD_PINS,
10262 {0x17, 0x21014020},
10263 {0x18, 0x21a19030}),
10264 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10265 ALC295_STANDARD_PINS,
10266 {0x17, 0x21014040},
10267 {0x18, 0x21a19050}),
3f307834
HW
10268 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10269 ALC295_STANDARD_PINS),
9f502ff5
TI
10270 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10271 ALC298_STANDARD_PINS,
10272 {0x17, 0x90170110}),
977e6276 10273 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
10274 ALC298_STANDARD_PINS,
10275 {0x17, 0x90170140}),
10276 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10277 ALC298_STANDARD_PINS,
9f502ff5 10278 {0x17, 0x90170150}),
9f1bc2c4
KHF
10279 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10280 {0x12, 0xb7a60140},
10281 {0x13, 0xb7a60150},
10282 {0x17, 0x90170110},
10283 {0x1a, 0x03011020},
10284 {0x21, 0x03211030}),
54324221
JM
10285 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10286 {0x12, 0xb7a60140},
10287 {0x17, 0x90170110},
10288 {0x1a, 0x03a11030},
10289 {0x21, 0x03211020}),
fcc6c877
KY
10290 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10291 ALC225_STANDARD_PINS,
10292 {0x12, 0xb7a60130},
fcc6c877 10293 {0x17, 0x90170110}),
573fcbfd
HW
10294 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10295 {0x14, 0x01014010},
10296 {0x17, 0x90170120},
10297 {0x18, 0x02a11030},
10298 {0x19, 0x02a1103f},
10299 {0x21, 0x0221101f}),
e1918938
HW
10300 {}
10301};
6dda9f4a 10302
7c0a6939
HW
10303/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10304 * more machines, don't need to match all valid pins, just need to match
10305 * all the pins defined in the tbl. Just because of this reason, it is possible
10306 * that a single machine matches multiple tbls, so there is one limitation:
10307 * at most one tbl is allowed to define for the same vendor and same codec
10308 */
10309static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10310 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10311 {0x19, 0x40000000},
10312 {0x1b, 0x40000000}),
aed8c7f4
HW
10313 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10314 {0x19, 0x40000000},
10315 {0x1a, 0x40000000}),
d64ebdbf
HW
10316 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10317 {0x19, 0x40000000},
10318 {0x1a, 0x40000000}),
5815bdfd
HW
10319 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
10320 {0x19, 0x40000000},
10321 {0x1a, 0x40000000}),
7c0a6939
HW
10322 {}
10323};
10324
546bb678 10325static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 10326{
526af6eb 10327 struct alc_spec *spec = codec->spec;
1d045db9 10328 int val;
ebb83eeb 10329
526af6eb 10330 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 10331 return;
526af6eb 10332
1bb7e43e 10333 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
10334 alc_write_coef_idx(codec, 0xf, 0x960b);
10335 alc_write_coef_idx(codec, 0xe, 0x8817);
10336 }
ebb83eeb 10337
1bb7e43e 10338 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
10339 alc_write_coef_idx(codec, 0xf, 0x960b);
10340 alc_write_coef_idx(codec, 0xe, 0x8814);
10341 }
ebb83eeb 10342
1bb7e43e 10343 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 10344 /* Power up output pin */
98b24883 10345 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 10346 }
ebb83eeb 10347
1bb7e43e 10348 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 10349 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 10350 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
10351 /* Capless ramp up clock control */
10352 alc_write_coef_idx(codec, 0xd, val | (1<<10));
10353 }
10354 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 10355 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
10356 /* Class D power on reset */
10357 alc_write_coef_idx(codec, 0x17, val | (1<<7));
10358 }
10359 }
ebb83eeb 10360
98b24883
TI
10361 /* HP */
10362 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 10363}
a7f2371f 10364
1d045db9
TI
10365/*
10366 */
1d045db9
TI
10367static int patch_alc269(struct hda_codec *codec)
10368{
10369 struct alc_spec *spec;
3de95173 10370 int err;
f1d4e28b 10371
3de95173 10372 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 10373 if (err < 0)
3de95173
TI
10374 return err;
10375
10376 spec = codec->spec;
08c189f2 10377 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 10378 codec->power_save_node = 0;
e16fb6d1 10379
225068ab
TI
10380#ifdef CONFIG_PM
10381 codec->patch_ops.suspend = alc269_suspend;
10382 codec->patch_ops.resume = alc269_resume;
10383#endif
c2d6af53
KY
10384 spec->shutup = alc_default_shutup;
10385 spec->init_hook = alc_default_init;
225068ab 10386
7639a06c 10387 switch (codec->core.vendor_id) {
065380f0 10388 case 0x10ec0269:
1d045db9 10389 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
10390 switch (alc_get_coef0(codec) & 0x00f0) {
10391 case 0x0010:
5100cd07
TI
10392 if (codec->bus->pci &&
10393 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 10394 spec->cdefine.platform_type == 1)
20ca0c35 10395 err = alc_codec_rename(codec, "ALC271X");
1d045db9 10396 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
10397 break;
10398 case 0x0020:
5100cd07
TI
10399 if (codec->bus->pci &&
10400 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 10401 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 10402 err = alc_codec_rename(codec, "ALC3202");
1d045db9 10403 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 10404 break;
adcc70b2
KY
10405 case 0x0030:
10406 spec->codec_variant = ALC269_TYPE_ALC269VD;
10407 break;
1bb7e43e 10408 default:
1d045db9 10409 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 10410 }
e16fb6d1
TI
10411 if (err < 0)
10412 goto error;
c2d6af53 10413 spec->shutup = alc269_shutup;
546bb678 10414 spec->init_hook = alc269_fill_coef;
1d045db9 10415 alc269_fill_coef(codec);
065380f0
KY
10416 break;
10417
10418 case 0x10ec0280:
10419 case 0x10ec0290:
10420 spec->codec_variant = ALC269_TYPE_ALC280;
10421 break;
10422 case 0x10ec0282:
065380f0 10423 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
10424 spec->shutup = alc282_shutup;
10425 spec->init_hook = alc282_init;
065380f0 10426 break;
2af02be7
KY
10427 case 0x10ec0233:
10428 case 0x10ec0283:
10429 spec->codec_variant = ALC269_TYPE_ALC283;
10430 spec->shutup = alc283_shutup;
10431 spec->init_hook = alc283_init;
10432 break;
065380f0
KY
10433 case 0x10ec0284:
10434 case 0x10ec0292:
10435 spec->codec_variant = ALC269_TYPE_ALC284;
10436 break;
161ebf29 10437 case 0x10ec0293:
4731d5de 10438 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 10439 break;
7fc7d047 10440 case 0x10ec0286:
7c665932 10441 case 0x10ec0288:
7fc7d047
KY
10442 spec->codec_variant = ALC269_TYPE_ALC286;
10443 break;
506b62c3
KY
10444 case 0x10ec0298:
10445 spec->codec_variant = ALC269_TYPE_ALC298;
10446 break;
ea04a1db 10447 case 0x10ec0235:
1d04c9de
KY
10448 case 0x10ec0255:
10449 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
10450 spec->shutup = alc256_shutup;
10451 spec->init_hook = alc256_init;
1d04c9de 10452 break;
1948fc06 10453 case 0x10ec0230:
736f20a7 10454 case 0x10ec0236:
4344aec8 10455 case 0x10ec0256:
527f4643 10456 case 0x19e58326:
4344aec8 10457 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
10458 spec->shutup = alc256_shutup;
10459 spec->init_hook = alc256_init;
7d1b6e29 10460 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
4344aec8 10461 break;
f429e7e4
KY
10462 case 0x10ec0257:
10463 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
10464 spec->shutup = alc256_shutup;
10465 spec->init_hook = alc256_init;
f429e7e4
KY
10466 spec->gen.mixer_nid = 0;
10467 break;
0a6f0600 10468 case 0x10ec0215:
7fbdcd83 10469 case 0x10ec0245:
0a6f0600
KY
10470 case 0x10ec0285:
10471 case 0x10ec0289:
60571929
KY
10472 if (alc_get_coef0(codec) & 0x0010)
10473 spec->codec_variant = ALC269_TYPE_ALC245;
10474 else
10475 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
10476 spec->shutup = alc225_shutup;
10477 spec->init_hook = alc225_init;
0a6f0600
KY
10478 spec->gen.mixer_nid = 0;
10479 break;
4231430d 10480 case 0x10ec0225:
7d727869 10481 case 0x10ec0295:
28f1f9b2 10482 case 0x10ec0299:
4231430d 10483 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
10484 spec->shutup = alc225_shutup;
10485 spec->init_hook = alc225_init;
c1350bff 10486 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 10487 break;
99cee034
KY
10488 case 0x10ec0287:
10489 spec->codec_variant = ALC269_TYPE_ALC287;
10490 spec->shutup = alc225_shutup;
10491 spec->init_hook = alc225_init;
10492 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10493 break;
dcd4f0db
KY
10494 case 0x10ec0234:
10495 case 0x10ec0274:
10496 case 0x10ec0294:
10497 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 10498 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 10499 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 10500 spec->init_hook = alc294_init;
dcd4f0db 10501 break;
1078bef0
KY
10502 case 0x10ec0300:
10503 spec->codec_variant = ALC269_TYPE_ALC300;
10504 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 10505 break;
f0778871
KY
10506 case 0x10ec0623:
10507 spec->codec_variant = ALC269_TYPE_ALC623;
10508 break;
6fbae35a
KY
10509 case 0x10ec0700:
10510 case 0x10ec0701:
10511 case 0x10ec0703:
83629532 10512 case 0x10ec0711:
6fbae35a
KY
10513 spec->codec_variant = ALC269_TYPE_ALC700;
10514 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 10515 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 10516 spec->init_hook = alc294_init;
6fbae35a
KY
10517 break;
10518
1d045db9 10519 }
6dda9f4a 10520
ad60d502 10521 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 10522 spec->has_alc5505_dsp = 1;
ad60d502
KY
10523 spec->init_hook = alc5505_dsp_init;
10524 }
10525
c9af753f
TI
10526 alc_pre_init(codec);
10527
efe55732
TI
10528 snd_hda_pick_fixup(codec, alc269_fixup_models,
10529 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
10530 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10531 * the quirk breaks the latter (bko#214101).
10532 * Clear the wrong entry.
10533 */
10534 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10535 codec->core.vendor_id == 0x10ec0294) {
10536 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10537 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10538 }
10539
0fc1e447 10540 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 10541 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
10542 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10543 alc269_fixups);
10544 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10545
10546 alc_auto_parse_customize_define(codec);
10547
10548 if (has_cdefine_beep(codec))
10549 spec->gen.beep_nid = 0x01;
10550
a4297b5d
TI
10551 /* automatic parse from the BIOS config */
10552 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
10553 if (err < 0)
10554 goto error;
6dda9f4a 10555
fea80fae
TI
10556 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10557 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10558 if (err < 0)
10559 goto error;
10560 }
f1d4e28b 10561
1727a771 10562 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10563
1d045db9 10564 return 0;
e16fb6d1
TI
10565
10566 error:
10567 alc_free(codec);
10568 return err;
1d045db9 10569}
f1d4e28b 10570
1d045db9
TI
10571/*
10572 * ALC861
10573 */
622e84cd 10574
1d045db9 10575static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 10576{
1d045db9 10577 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10578 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10579 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
10580}
10581
1d045db9
TI
10582/* Pin config fixes */
10583enum {
e652f4c8
TI
10584 ALC861_FIXUP_FSC_AMILO_PI1505,
10585 ALC861_FIXUP_AMP_VREF_0F,
10586 ALC861_FIXUP_NO_JACK_DETECT,
10587 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 10588 ALC660_FIXUP_ASUS_W7J,
1d045db9 10589};
7085ec12 10590
31150f23
TI
10591/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10592static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 10593 const struct hda_fixup *fix, int action)
31150f23
TI
10594{
10595 struct alc_spec *spec = codec->spec;
10596 unsigned int val;
10597
1727a771 10598 if (action != HDA_FIXUP_ACT_INIT)
31150f23 10599 return;
d3f02d60 10600 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
10601 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10602 val |= AC_PINCTL_IN_EN;
10603 val |= AC_PINCTL_VREF_50;
cdd03ced 10604 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 10605 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
10606}
10607
e652f4c8
TI
10608/* suppress the jack-detection */
10609static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 10610 const struct hda_fixup *fix, int action)
e652f4c8 10611{
1727a771 10612 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 10613 codec->no_jack_detect = 1;
7d7eb9ea 10614}
e652f4c8 10615
1727a771 10616static const struct hda_fixup alc861_fixups[] = {
e652f4c8 10617 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
10618 .type = HDA_FIXUP_PINS,
10619 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
10620 { 0x0b, 0x0221101f }, /* HP */
10621 { 0x0f, 0x90170310 }, /* speaker */
10622 { }
10623 }
10624 },
e652f4c8 10625 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 10626 .type = HDA_FIXUP_FUNC,
31150f23 10627 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 10628 },
e652f4c8 10629 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 10630 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10631 .v.func = alc_fixup_no_jack_detect,
10632 },
10633 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 10634 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10635 .v.func = alc861_fixup_asus_amp_vref_0f,
10636 .chained = true,
10637 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
10638 },
10639 [ALC660_FIXUP_ASUS_W7J] = {
10640 .type = HDA_FIXUP_VERBS,
10641 .v.verbs = (const struct hda_verb[]) {
10642 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10643 * for enabling outputs
10644 */
10645 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10646 { }
10647 },
e652f4c8 10648 }
1d045db9 10649};
7085ec12 10650
1d045db9 10651static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 10652 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 10653 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
10654 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10655 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10656 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 10657 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 10658 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
10659 {}
10660};
3af9ee6b 10661
1d045db9
TI
10662/*
10663 */
1d045db9 10664static int patch_alc861(struct hda_codec *codec)
7085ec12 10665{
1d045db9 10666 struct alc_spec *spec;
1d045db9 10667 int err;
7085ec12 10668
3de95173
TI
10669 err = alc_alloc_spec(codec, 0x15);
10670 if (err < 0)
10671 return err;
1d045db9 10672
3de95173 10673 spec = codec->spec;
2722b535
TI
10674 if (has_cdefine_beep(codec))
10675 spec->gen.beep_nid = 0x23;
1d045db9 10676
225068ab
TI
10677#ifdef CONFIG_PM
10678 spec->power_hook = alc_power_eapd;
10679#endif
10680
c9af753f
TI
10681 alc_pre_init(codec);
10682
1727a771
TI
10683 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10684 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 10685
cb4e4824
TI
10686 /* automatic parse from the BIOS config */
10687 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
10688 if (err < 0)
10689 goto error;
3af9ee6b 10690
fea80fae
TI
10691 if (!spec->gen.no_analog) {
10692 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10693 if (err < 0)
10694 goto error;
10695 }
7085ec12 10696
1727a771 10697 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10698
1d045db9 10699 return 0;
e16fb6d1
TI
10700
10701 error:
10702 alc_free(codec);
10703 return err;
7085ec12
TI
10704}
10705
1d045db9
TI
10706/*
10707 * ALC861-VD support
10708 *
10709 * Based on ALC882
10710 *
10711 * In addition, an independent DAC
10712 */
1d045db9 10713static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 10714{
1d045db9 10715 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10716 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10717 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
10718}
10719
1d045db9 10720enum {
8fdcb6fe
TI
10721 ALC660VD_FIX_ASUS_GPIO1,
10722 ALC861VD_FIX_DALLAS,
1d045db9 10723};
ce764ab2 10724
8fdcb6fe
TI
10725/* exclude VREF80 */
10726static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 10727 const struct hda_fixup *fix, int action)
8fdcb6fe 10728{
1727a771 10729 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
10730 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10731 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
10732 }
10733}
10734
df73d83f
TI
10735/* reset GPIO1 */
10736static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10737 const struct hda_fixup *fix, int action)
10738{
10739 struct alc_spec *spec = codec->spec;
10740
10741 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10742 spec->gpio_mask |= 0x02;
10743 alc_fixup_gpio(codec, action, 0x01);
10744}
10745
1727a771 10746static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 10747 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
10748 .type = HDA_FIXUP_FUNC,
10749 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 10750 },
8fdcb6fe 10751 [ALC861VD_FIX_DALLAS] = {
1727a771 10752 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
10753 .v.func = alc861vd_fixup_dallas,
10754 },
1d045db9 10755};
ce764ab2 10756
1d045db9 10757static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 10758 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 10759 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 10760 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
10761 {}
10762};
ce764ab2 10763
1d045db9
TI
10764/*
10765 */
1d045db9 10766static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 10767{
1d045db9 10768 struct alc_spec *spec;
cb4e4824 10769 int err;
ce764ab2 10770
3de95173
TI
10771 err = alc_alloc_spec(codec, 0x0b);
10772 if (err < 0)
10773 return err;
1d045db9 10774
3de95173 10775 spec = codec->spec;
2722b535
TI
10776 if (has_cdefine_beep(codec))
10777 spec->gen.beep_nid = 0x23;
1d045db9 10778
225068ab
TI
10779 spec->shutup = alc_eapd_shutup;
10780
c9af753f
TI
10781 alc_pre_init(codec);
10782
1727a771
TI
10783 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10784 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 10785
cb4e4824
TI
10786 /* automatic parse from the BIOS config */
10787 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
10788 if (err < 0)
10789 goto error;
ce764ab2 10790
fea80fae
TI
10791 if (!spec->gen.no_analog) {
10792 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10793 if (err < 0)
10794 goto error;
10795 }
1d045db9 10796
1727a771 10797 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10798
ce764ab2 10799 return 0;
e16fb6d1
TI
10800
10801 error:
10802 alc_free(codec);
10803 return err;
ce764ab2
TI
10804}
10805
1d045db9
TI
10806/*
10807 * ALC662 support
10808 *
10809 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10810 * configuration. Each pin widget can choose any input DACs and a mixer.
10811 * Each ADC is connected from a mixer of all inputs. This makes possible
10812 * 6-channel independent captures.
10813 *
10814 * In addition, an independent DAC for the multi-playback (not used in this
10815 * driver yet).
10816 */
1d045db9
TI
10817
10818/*
10819 * BIOS auto configuration
10820 */
10821
bc9f98a9
KY
10822static int alc662_parse_auto_config(struct hda_codec *codec)
10823{
4c6d72d1 10824 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10825 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10826 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10827 const hda_nid_t *ssids;
ee979a14 10828
7639a06c
TI
10829 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10830 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10831 codec->core.vendor_id == 0x10ec0671)
3e6179b8 10832 ssids = alc663_ssids;
6227cdce 10833 else
3e6179b8
TI
10834 ssids = alc662_ssids;
10835 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
10836}
10837
6be7948f 10838static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 10839 const struct hda_fixup *fix, int action)
6fc398cb 10840{
9bb1f06f 10841 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 10842 return;
6be7948f
TB
10843 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10844 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10845 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10846 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10847 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 10848 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
10849}
10850
8e383953
TI
10851static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10852 { .channels = 2,
10853 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10854 { .channels = 4,
10855 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10856 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10857 { }
10858};
10859
10860/* override the 2.1 chmap */
eb9ca3ab 10861static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
10862 const struct hda_fixup *fix, int action)
10863{
10864 if (action == HDA_FIXUP_ACT_BUILD) {
10865 struct alc_spec *spec = codec->spec;
bbbc7e85 10866 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
10867 }
10868}
10869
bf68665d
TI
10870/* avoid D3 for keeping GPIO up */
10871static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10872 hda_nid_t nid,
10873 unsigned int power_state)
10874{
10875 struct alc_spec *spec = codec->spec;
d261eec8 10876 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
10877 return AC_PWRST_D0;
10878 return power_state;
10879}
10880
3e887f37
TI
10881static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10882 const struct hda_fixup *fix, int action)
10883{
10884 struct alc_spec *spec = codec->spec;
3e887f37 10885
01e4a275 10886 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 10887 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 10888 spec->mute_led_polarity = 1;
bf68665d 10889 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
10890 }
10891}
10892
c6790c8e
KY
10893static void alc662_usi_automute_hook(struct hda_codec *codec,
10894 struct hda_jack_callback *jack)
10895{
10896 struct alc_spec *spec = codec->spec;
10897 int vref;
10898 msleep(200);
10899 snd_hda_gen_hp_automute(codec, jack);
10900
10901 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10902 msleep(100);
10903 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10904 vref);
10905}
10906
10907static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10908 const struct hda_fixup *fix, int action)
10909{
10910 struct alc_spec *spec = codec->spec;
10911 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10912 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10913 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10914 }
10915}
10916
00066e97
SB
10917static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10918 struct hda_jack_callback *cb)
10919{
10920 /* surround speakers at 0x1b already get muted automatically when
10921 * headphones are plugged in, but we have to mute/unmute the remaining
10922 * channels manually:
10923 * 0x15 - front left/front right
10924 * 0x18 - front center/ LFE
10925 */
10926 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10927 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10928 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10929 } else {
10930 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10931 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10932 }
10933}
10934
10935static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10936 const struct hda_fixup *fix, int action)
10937{
10938 /* Pin 0x1b: shared headphones jack and surround speakers */
10939 if (!is_jack_detectable(codec, 0x1b))
10940 return;
10941
10942 switch (action) {
10943 case HDA_FIXUP_ACT_PRE_PROBE:
10944 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10945 alc662_aspire_ethos_mute_speakers);
336820c4
TI
10946 /* subwoofer needs an extra GPIO setting to become audible */
10947 alc_setup_gpio(codec, 0x02);
00066e97
SB
10948 break;
10949 case HDA_FIXUP_ACT_INIT:
10950 /* Make sure to start in a correct state, i.e. if
10951 * headphones have been plugged in before powering up the system
10952 */
10953 alc662_aspire_ethos_mute_speakers(codec, NULL);
10954 break;
10955 }
10956}
10957
5af29028
KY
10958static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10959 const struct hda_fixup *fix, int action)
10960{
10961 struct alc_spec *spec = codec->spec;
10962
10963 static const struct hda_pintbl pincfgs[] = {
10964 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10965 { 0x1b, 0x0181304f },
10966 { }
10967 };
10968
10969 switch (action) {
10970 case HDA_FIXUP_ACT_PRE_PROBE:
10971 spec->gen.mixer_nid = 0;
10972 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10973 snd_hda_apply_pincfgs(codec, pincfgs);
10974 break;
10975 case HDA_FIXUP_ACT_INIT:
10976 alc_write_coef_idx(codec, 0x19, 0xa054);
10977 break;
10978 }
10979}
10980
d7f32791
KY
10981static void alc897_hp_automute_hook(struct hda_codec *codec,
10982 struct hda_jack_callback *jack)
10983{
10984 struct alc_spec *spec = codec->spec;
10985 int vref;
10986
10987 snd_hda_gen_hp_automute(codec, jack);
10988 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10989 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10990 vref);
10991}
10992
10993static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10994 const struct hda_fixup *fix, int action)
10995{
10996 struct alc_spec *spec = codec->spec;
10997 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10998 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10999 }
11000}
11001
6b0f95c4 11002static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
11003 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
11004 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
11005 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
11006 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11007 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11008 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11009 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
11010 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
11011 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11012 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11013 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11014 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11015 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
11016 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11017 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
11018 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
11019 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11020 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11021 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11022 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11023 {}
11024};
11025
11026static void alc668_restore_default_value(struct hda_codec *codec)
11027{
11028 alc_process_coef_fw(codec, alc668_coefs);
11029}
11030
6cb3b707 11031enum {
2df03514 11032 ALC662_FIXUP_ASPIRE,
3e887f37 11033 ALC662_FIXUP_LED_GPIO1,
6cb3b707 11034 ALC662_FIXUP_IDEAPAD,
6be7948f 11035 ALC272_FIXUP_MARIO,
f1ec5be1 11036 ALC662_FIXUP_CZC_ET26,
d2ebd479 11037 ALC662_FIXUP_CZC_P10T,
94024cd1 11038 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 11039 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
11040 ALC662_FIXUP_ASUS_MODE1,
11041 ALC662_FIXUP_ASUS_MODE2,
11042 ALC662_FIXUP_ASUS_MODE3,
11043 ALC662_FIXUP_ASUS_MODE4,
11044 ALC662_FIXUP_ASUS_MODE5,
11045 ALC662_FIXUP_ASUS_MODE6,
11046 ALC662_FIXUP_ASUS_MODE7,
11047 ALC662_FIXUP_ASUS_MODE8,
1565cc35 11048 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 11049 ALC662_FIXUP_ZOTAC_Z68,
125821ae 11050 ALC662_FIXUP_INV_DMIC,
1f8b46cd 11051 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 11052 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11053 ALC662_FIXUP_HEADSET_MODE,
73bdd597 11054 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 11055 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 11056 ALC662_FIXUP_BASS_16,
a30c9aaa 11057 ALC662_FIXUP_BASS_1A,
8e54b4ac 11058 ALC662_FIXUP_BASS_CHMAP,
493a52a9 11059 ALC668_FIXUP_AUTO_MUTE,
5e6db669 11060 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 11061 ALC668_FIXUP_DELL_XPS13,
9d4dc584 11062 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 11063 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11064 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 11065 ALC668_FIXUP_MIC_COEF,
11ba6111 11066 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
11067 ALC891_FIXUP_HEADSET_MODE,
11068 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 11069 ALC662_FIXUP_ACER_VERITON,
1a3f0991 11070 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
11071 ALC662_FIXUP_USI_FUNC,
11072 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 11073 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 11074 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 11075 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 11076 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 11077 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 11078 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
11079 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11080 ALC668_FIXUP_HEADSET_MIC,
11081 ALC668_FIXUP_MIC_DET_COEF,
d7f32791
KY
11082 ALC897_FIXUP_LENOVO_HEADSET_MIC,
11083 ALC897_FIXUP_HEADSET_MIC_PIN,
fe6900bd 11084 ALC897_FIXUP_HP_HSMIC_VERB,
6cb3b707
DH
11085};
11086
1727a771 11087static const struct hda_fixup alc662_fixups[] = {
2df03514 11088 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
11089 .type = HDA_FIXUP_PINS,
11090 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
11091 { 0x15, 0x99130112 }, /* subwoofer */
11092 { }
11093 }
11094 },
3e887f37
TI
11095 [ALC662_FIXUP_LED_GPIO1] = {
11096 .type = HDA_FIXUP_FUNC,
11097 .v.func = alc662_fixup_led_gpio1,
11098 },
6cb3b707 11099 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
11100 .type = HDA_FIXUP_PINS,
11101 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
11102 { 0x17, 0x99130112 }, /* subwoofer */
11103 { }
3e887f37
TI
11104 },
11105 .chained = true,
11106 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 11107 },
6be7948f 11108 [ALC272_FIXUP_MARIO] = {
1727a771 11109 .type = HDA_FIXUP_FUNC,
b5bfbc67 11110 .v.func = alc272_fixup_mario,
d2ebd479 11111 },
f1ec5be1
HC
11112 [ALC662_FIXUP_CZC_ET26] = {
11113 .type = HDA_FIXUP_PINS,
11114 .v.pins = (const struct hda_pintbl[]) {
11115 {0x12, 0x403cc000},
11116 {0x14, 0x90170110}, /* speaker */
11117 {0x15, 0x411111f0},
11118 {0x16, 0x411111f0},
11119 {0x18, 0x01a19030}, /* mic */
11120 {0x19, 0x90a7013f}, /* int-mic */
11121 {0x1a, 0x01014020},
11122 {0x1b, 0x0121401f},
11123 {0x1c, 0x411111f0},
11124 {0x1d, 0x411111f0},
11125 {0x1e, 0x40478e35},
11126 {}
11127 },
11128 .chained = true,
11129 .chain_id = ALC662_FIXUP_SKU_IGNORE
11130 },
d2ebd479 11131 [ALC662_FIXUP_CZC_P10T] = {
1727a771 11132 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
11133 .v.verbs = (const struct hda_verb[]) {
11134 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11135 {}
11136 }
11137 },
94024cd1 11138 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 11139 .type = HDA_FIXUP_FUNC,
23d30f28 11140 .v.func = alc_fixup_sku_ignore,
c6b35874 11141 },
e59ea3ed 11142 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
11143 .type = HDA_FIXUP_PINS,
11144 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
11145 { 0x14, 0x0221201f }, /* HP out */
11146 { }
11147 },
11148 .chained = true,
11149 .chain_id = ALC662_FIXUP_SKU_IGNORE
11150 },
53c334ad 11151 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
11152 .type = HDA_FIXUP_PINS,
11153 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11154 { 0x14, 0x99130110 }, /* speaker */
11155 { 0x18, 0x01a19c20 }, /* mic */
11156 { 0x19, 0x99a3092f }, /* int-mic */
11157 { 0x21, 0x0121401f }, /* HP out */
11158 { }
11159 },
11160 .chained = true,
11161 .chain_id = ALC662_FIXUP_SKU_IGNORE
11162 },
11163 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
11164 .type = HDA_FIXUP_PINS,
11165 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
11166 { 0x14, 0x99130110 }, /* speaker */
11167 { 0x18, 0x01a19820 }, /* mic */
11168 { 0x19, 0x99a3092f }, /* int-mic */
11169 { 0x1b, 0x0121401f }, /* HP out */
11170 { }
11171 },
53c334ad
TI
11172 .chained = true,
11173 .chain_id = ALC662_FIXUP_SKU_IGNORE
11174 },
11175 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
11176 .type = HDA_FIXUP_PINS,
11177 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11178 { 0x14, 0x99130110 }, /* speaker */
11179 { 0x15, 0x0121441f }, /* HP */
11180 { 0x18, 0x01a19840 }, /* mic */
11181 { 0x19, 0x99a3094f }, /* int-mic */
11182 { 0x21, 0x01211420 }, /* HP2 */
11183 { }
11184 },
11185 .chained = true,
11186 .chain_id = ALC662_FIXUP_SKU_IGNORE
11187 },
11188 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
11189 .type = HDA_FIXUP_PINS,
11190 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11191 { 0x14, 0x99130110 }, /* speaker */
11192 { 0x16, 0x99130111 }, /* speaker */
11193 { 0x18, 0x01a19840 }, /* mic */
11194 { 0x19, 0x99a3094f }, /* int-mic */
11195 { 0x21, 0x0121441f }, /* HP */
11196 { }
11197 },
11198 .chained = true,
11199 .chain_id = ALC662_FIXUP_SKU_IGNORE
11200 },
11201 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
11202 .type = HDA_FIXUP_PINS,
11203 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11204 { 0x14, 0x99130110 }, /* speaker */
11205 { 0x15, 0x0121441f }, /* HP */
11206 { 0x16, 0x99130111 }, /* speaker */
11207 { 0x18, 0x01a19840 }, /* mic */
11208 { 0x19, 0x99a3094f }, /* int-mic */
11209 { }
11210 },
11211 .chained = true,
11212 .chain_id = ALC662_FIXUP_SKU_IGNORE
11213 },
11214 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
11215 .type = HDA_FIXUP_PINS,
11216 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11217 { 0x14, 0x99130110 }, /* speaker */
11218 { 0x15, 0x01211420 }, /* HP2 */
11219 { 0x18, 0x01a19840 }, /* mic */
11220 { 0x19, 0x99a3094f }, /* int-mic */
11221 { 0x1b, 0x0121441f }, /* HP */
11222 { }
11223 },
11224 .chained = true,
11225 .chain_id = ALC662_FIXUP_SKU_IGNORE
11226 },
11227 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
11228 .type = HDA_FIXUP_PINS,
11229 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11230 { 0x14, 0x99130110 }, /* speaker */
11231 { 0x17, 0x99130111 }, /* speaker */
11232 { 0x18, 0x01a19840 }, /* mic */
11233 { 0x19, 0x99a3094f }, /* int-mic */
11234 { 0x1b, 0x01214020 }, /* HP */
11235 { 0x21, 0x0121401f }, /* HP */
11236 { }
11237 },
11238 .chained = true,
11239 .chain_id = ALC662_FIXUP_SKU_IGNORE
11240 },
11241 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
11242 .type = HDA_FIXUP_PINS,
11243 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11244 { 0x14, 0x99130110 }, /* speaker */
11245 { 0x12, 0x99a30970 }, /* int-mic */
11246 { 0x15, 0x01214020 }, /* HP */
11247 { 0x17, 0x99130111 }, /* speaker */
11248 { 0x18, 0x01a19840 }, /* mic */
11249 { 0x21, 0x0121401f }, /* HP */
11250 { }
11251 },
11252 .chained = true,
11253 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 11254 },
1565cc35 11255 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 11256 .type = HDA_FIXUP_FUNC,
1565cc35
TI
11257 .v.func = alc_fixup_no_jack_detect,
11258 },
edfe3bfc 11259 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
11260 .type = HDA_FIXUP_PINS,
11261 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
11262 { 0x1b, 0x02214020 }, /* Front HP */
11263 { }
11264 }
11265 },
125821ae 11266 [ALC662_FIXUP_INV_DMIC] = {
1727a771 11267 .type = HDA_FIXUP_FUNC,
9d36a7dc 11268 .v.func = alc_fixup_inv_dmic,
125821ae 11269 },
033b0a7c
GM
11270 [ALC668_FIXUP_DELL_XPS13] = {
11271 .type = HDA_FIXUP_FUNC,
11272 .v.func = alc_fixup_dell_xps13,
11273 .chained = true,
11274 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11275 },
5e6db669
GM
11276 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11277 .type = HDA_FIXUP_FUNC,
11278 .v.func = alc_fixup_disable_aamix,
11279 .chained = true,
11280 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11281 },
493a52a9
HW
11282 [ALC668_FIXUP_AUTO_MUTE] = {
11283 .type = HDA_FIXUP_FUNC,
11284 .v.func = alc_fixup_auto_mute_via_amp,
11285 .chained = true,
11286 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11287 },
1f8b46cd
DH
11288 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11289 .type = HDA_FIXUP_PINS,
11290 .v.pins = (const struct hda_pintbl[]) {
11291 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11292 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
11293 { }
11294 },
11295 .chained = true,
11296 .chain_id = ALC662_FIXUP_HEADSET_MODE
11297 },
11298 [ALC662_FIXUP_HEADSET_MODE] = {
11299 .type = HDA_FIXUP_FUNC,
11300 .v.func = alc_fixup_headset_mode_alc662,
11301 },
73bdd597
DH
11302 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
11303 .type = HDA_FIXUP_PINS,
11304 .v.pins = (const struct hda_pintbl[]) {
11305 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11306 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11307 { }
11308 },
11309 .chained = true,
11310 .chain_id = ALC668_FIXUP_HEADSET_MODE
11311 },
11312 [ALC668_FIXUP_HEADSET_MODE] = {
11313 .type = HDA_FIXUP_FUNC,
11314 .v.func = alc_fixup_headset_mode_alc668,
11315 },
8e54b4ac 11316 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 11317 .type = HDA_FIXUP_FUNC,
eb9ca3ab 11318 .v.func = alc_fixup_bass_chmap,
8e383953
TI
11319 .chained = true,
11320 .chain_id = ALC662_FIXUP_ASUS_MODE4
11321 },
61a75f13
DH
11322 [ALC662_FIXUP_BASS_16] = {
11323 .type = HDA_FIXUP_PINS,
11324 .v.pins = (const struct hda_pintbl[]) {
11325 {0x16, 0x80106111}, /* bass speaker */
11326 {}
11327 },
11328 .chained = true,
11329 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11330 },
a30c9aaa
TI
11331 [ALC662_FIXUP_BASS_1A] = {
11332 .type = HDA_FIXUP_PINS,
11333 .v.pins = (const struct hda_pintbl[]) {
11334 {0x1a, 0x80106111}, /* bass speaker */
11335 {}
11336 },
8e54b4ac
DH
11337 .chained = true,
11338 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 11339 },
8e54b4ac 11340 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 11341 .type = HDA_FIXUP_FUNC,
eb9ca3ab 11342 .v.func = alc_fixup_bass_chmap,
a30c9aaa 11343 },
9d4dc584
BM
11344 [ALC662_FIXUP_ASUS_Nx50] = {
11345 .type = HDA_FIXUP_FUNC,
11346 .v.func = alc_fixup_auto_mute_via_amp,
11347 .chained = true,
11348 .chain_id = ALC662_FIXUP_BASS_1A
11349 },
fc7438b1
MP
11350 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
11351 .type = HDA_FIXUP_FUNC,
11352 .v.func = alc_fixup_headset_mode_alc668,
11353 .chain_id = ALC662_FIXUP_BASS_CHMAP
11354 },
3231e205
YP
11355 [ALC668_FIXUP_ASUS_Nx51] = {
11356 .type = HDA_FIXUP_PINS,
11357 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
11358 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11359 { 0x1a, 0x90170151 }, /* bass speaker */
11360 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
11361 {}
11362 },
11363 .chained = true,
fc7438b1 11364 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11365 },
5b7c5e1f 11366 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
11367 .type = HDA_FIXUP_VERBS,
11368 .v.verbs = (const struct hda_verb[]) {
11369 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11370 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11371 {}
11372 },
11373 },
5b7c5e1f
TI
11374 [ALC668_FIXUP_ASUS_G751] = {
11375 .type = HDA_FIXUP_PINS,
11376 .v.pins = (const struct hda_pintbl[]) {
11377 { 0x16, 0x0421101f }, /* HP */
11378 {}
11379 },
11380 .chained = true,
11381 .chain_id = ALC668_FIXUP_MIC_COEF
11382 },
78f4f7c2
KY
11383 [ALC891_FIXUP_HEADSET_MODE] = {
11384 .type = HDA_FIXUP_FUNC,
11385 .v.func = alc_fixup_headset_mode,
11386 },
11387 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11388 .type = HDA_FIXUP_PINS,
11389 .v.pins = (const struct hda_pintbl[]) {
11390 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11391 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11392 { }
11393 },
11394 .chained = true,
11395 .chain_id = ALC891_FIXUP_HEADSET_MODE
11396 },
9b51fe3e
SB
11397 [ALC662_FIXUP_ACER_VERITON] = {
11398 .type = HDA_FIXUP_PINS,
11399 .v.pins = (const struct hda_pintbl[]) {
11400 { 0x15, 0x50170120 }, /* no internal speaker */
11401 { }
11402 }
11403 },
1a3f0991
TI
11404 [ALC892_FIXUP_ASROCK_MOBO] = {
11405 .type = HDA_FIXUP_PINS,
11406 .v.pins = (const struct hda_pintbl[]) {
11407 { 0x15, 0x40f000f0 }, /* disabled */
11408 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
11409 { }
11410 }
11411 },
c6790c8e
KY
11412 [ALC662_FIXUP_USI_FUNC] = {
11413 .type = HDA_FIXUP_FUNC,
11414 .v.func = alc662_fixup_usi_headset_mic,
11415 },
11416 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11417 .type = HDA_FIXUP_PINS,
11418 .v.pins = (const struct hda_pintbl[]) {
11419 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11420 { 0x18, 0x01a1903d },
11421 { }
11422 },
11423 .chained = true,
11424 .chain_id = ALC662_FIXUP_USI_FUNC
11425 },
ca169cc2
KY
11426 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11427 .type = HDA_FIXUP_FUNC,
11428 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11429 },
00066e97
SB
11430 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11431 .type = HDA_FIXUP_FUNC,
11432 .v.func = alc662_fixup_aspire_ethos_hp,
11433 },
00066e97
SB
11434 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11435 .type = HDA_FIXUP_PINS,
11436 .v.pins = (const struct hda_pintbl[]) {
11437 { 0x15, 0x92130110 }, /* front speakers */
11438 { 0x18, 0x99130111 }, /* center/subwoofer */
11439 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11440 { }
11441 },
11442 .chained = true,
336820c4 11443 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 11444 },
5af29028
KY
11445 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11446 .type = HDA_FIXUP_FUNC,
11447 .v.func = alc671_fixup_hp_headset_mic2,
11448 },
d858c706
JHP
11449 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11450 .type = HDA_FIXUP_PINS,
11451 .v.pins = (const struct hda_pintbl[]) {
11452 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11453 { }
11454 },
11455 .chained = true,
11456 .chain_id = ALC662_FIXUP_USI_FUNC
11457 },
a124458a
JHP
11458 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11459 .type = HDA_FIXUP_PINS,
11460 .v.pins = (const struct hda_pintbl[]) {
11461 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11462 { 0x1b, 0x0221144f },
11463 { }
11464 },
11465 .chained = true,
11466 .chain_id = ALC662_FIXUP_USI_FUNC
11467 },
a3fd1a98
HW
11468 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11469 .type = HDA_FIXUP_PINS,
11470 .v.pins = (const struct hda_pintbl[]) {
11471 { 0x1b, 0x04a1112c },
11472 { }
11473 },
11474 .chained = true,
11475 .chain_id = ALC668_FIXUP_HEADSET_MIC
11476 },
11477 [ALC668_FIXUP_HEADSET_MIC] = {
11478 .type = HDA_FIXUP_FUNC,
11479 .v.func = alc269_fixup_headset_mic,
11480 .chained = true,
11481 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11482 },
11483 [ALC668_FIXUP_MIC_DET_COEF] = {
11484 .type = HDA_FIXUP_VERBS,
11485 .v.verbs = (const struct hda_verb[]) {
11486 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11487 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11488 {}
11489 },
11490 },
d7f32791
KY
11491 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11492 .type = HDA_FIXUP_FUNC,
11493 .v.func = alc897_fixup_lenovo_headset_mic,
11494 },
11495 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11496 .type = HDA_FIXUP_PINS,
11497 .v.pins = (const struct hda_pintbl[]) {
11498 { 0x1a, 0x03a11050 },
11499 { }
11500 },
11501 .chained = true,
11502 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11503 },
fe6900bd
KY
11504 [ALC897_FIXUP_HP_HSMIC_VERB] = {
11505 .type = HDA_FIXUP_PINS,
11506 .v.pins = (const struct hda_pintbl[]) {
11507 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11508 { }
11509 },
11510 },
6cb3b707
DH
11511};
11512
a9111321 11513static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 11514 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 11515 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 11516 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 11517 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 11518 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 11519 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 11520 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 11521 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 11522 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 11523 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 11524 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
11525 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11526 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 11527 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 11528 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 11529 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 11530 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 11531 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
11532 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11533 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 11534 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 11535 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
fe6900bd 11536 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
148ebf54 11537 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
dbe75d31 11538 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
882bd07f 11539 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 11540 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 11541 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 11542 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 11543 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 11544 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 11545 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 11546 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
11547 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11548 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 11549 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 11550 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 11551 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 11552 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 11553 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 11554 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 11555 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 11556 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 11557 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
5a873857 11558 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
d7f32791
KY
11559 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11560 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11561 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11562 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
d4118588 11563 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 11564 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 11565 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 11566 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 11567 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 11568 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 11569 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
53c334ad
TI
11570
11571#if 0
11572 /* Below is a quirk table taken from the old code.
11573 * Basically the device should work as is without the fixup table.
11574 * If BIOS doesn't give a proper info, enable the corresponding
11575 * fixup entry.
7d7eb9ea 11576 */
53c334ad
TI
11577 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11578 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11579 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11580 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11581 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11582 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11583 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11584 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11585 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11586 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11587 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11588 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11589 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11590 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11591 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11592 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11593 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11594 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11595 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11596 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11597 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11598 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11599 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11600 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11601 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11602 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11603 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11604 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11605 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11606 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11607 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11608 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11609 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11610 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11611 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11612 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11613 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11614 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11615 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11616 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11617 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11618 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11619 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11620 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11621 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11622 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11623 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11624 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11625 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11626 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11627#endif
6cb3b707
DH
11628 {}
11629};
11630
1727a771 11631static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
11632 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11633 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 11634 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 11635 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
11636 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11637 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11638 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11639 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11640 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11641 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11642 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11643 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 11644 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 11645 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 11646 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 11647 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
11648 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11649 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11650 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11651 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11652 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11653 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11654 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11655 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 11656 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
11657 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11658 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11659 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11660 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11661 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 11662 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 11663 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
6be7948f
TB
11664 {}
11665};
6cb3b707 11666
532895c5 11667static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
11668 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11669 {0x17, 0x02211010},
11670 {0x18, 0x01a19030},
11671 {0x1a, 0x01813040},
11672 {0x21, 0x01014020}),
4b4e0e32
HW
11673 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11674 {0x16, 0x01813030},
11675 {0x17, 0x02211010},
11676 {0x18, 0x01a19040},
11677 {0x21, 0x01014020}),
1f8b46cd 11678 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11679 {0x14, 0x01014010},
1f8b46cd 11680 {0x18, 0x01a19020},
1f8b46cd 11681 {0x1a, 0x0181302f},
11580297 11682 {0x1b, 0x0221401f}),
76c2132e
DH
11683 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11684 {0x12, 0x99a30130},
11685 {0x14, 0x90170110},
11686 {0x15, 0x0321101f},
11580297 11687 {0x16, 0x03011020}),
76c2132e
DH
11688 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11689 {0x12, 0x99a30140},
11690 {0x14, 0x90170110},
11691 {0x15, 0x0321101f},
11580297 11692 {0x16, 0x03011020}),
76c2132e
DH
11693 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11694 {0x12, 0x99a30150},
11695 {0x14, 0x90170110},
11696 {0x15, 0x0321101f},
11580297 11697 {0x16, 0x03011020}),
76c2132e 11698 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
11699 {0x14, 0x90170110},
11700 {0x15, 0x0321101f},
11580297 11701 {0x16, 0x03011020}),
76c2132e
DH
11702 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11703 {0x12, 0x90a60130},
11704 {0x14, 0x90170110},
11580297 11705 {0x15, 0x0321101f}),
5af29028
KY
11706 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11707 {0x14, 0x01014010},
11708 {0x17, 0x90170150},
f2adbae0 11709 {0x19, 0x02a11060},
5af29028
KY
11710 {0x1b, 0x01813030},
11711 {0x21, 0x02211020}),
11712 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11713 {0x14, 0x01014010},
11714 {0x18, 0x01a19040},
11715 {0x1b, 0x01813030},
11716 {0x21, 0x02211020}),
11717 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11718 {0x14, 0x01014020},
11719 {0x17, 0x90170110},
11720 {0x18, 0x01a19050},
11721 {0x1b, 0x01813040},
11722 {0x21, 0x02211030}),
532895c5
HW
11723 {}
11724};
11725
1d045db9
TI
11726/*
11727 */
bc9f98a9
KY
11728static int patch_alc662(struct hda_codec *codec)
11729{
11730 struct alc_spec *spec;
3de95173 11731 int err;
bc9f98a9 11732
3de95173
TI
11733 err = alc_alloc_spec(codec, 0x0b);
11734 if (err < 0)
11735 return err;
bc9f98a9 11736
3de95173 11737 spec = codec->spec;
1f0f4b80 11738
225068ab
TI
11739 spec->shutup = alc_eapd_shutup;
11740
53c334ad
TI
11741 /* handle multiple HPs as is */
11742 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11743
2c3bf9ab
TI
11744 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11745
7639a06c 11746 switch (codec->core.vendor_id) {
f3f9185f
KY
11747 case 0x10ec0668:
11748 spec->init_hook = alc668_restore_default_value;
11749 break;
f3f9185f 11750 }
8663ff75 11751
c9af753f
TI
11752 alc_pre_init(codec);
11753
1727a771 11754 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 11755 alc662_fixup_tbl, alc662_fixups);
0fc1e447 11756 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 11757 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
11758
11759 alc_auto_parse_customize_define(codec);
11760
7504b6cd
TI
11761 if (has_cdefine_beep(codec))
11762 spec->gen.beep_nid = 0x01;
11763
1bb7e43e 11764 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 11765 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11766 spec->cdefine.platform_type == 1) {
6134b1a2
WY
11767 err = alc_codec_rename(codec, "ALC272X");
11768 if (err < 0)
e16fb6d1 11769 goto error;
20ca0c35 11770 }
274693f3 11771
b9c5106c
TI
11772 /* automatic parse from the BIOS config */
11773 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
11774 if (err < 0)
11775 goto error;
bc9f98a9 11776
7504b6cd 11777 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 11778 switch (codec->core.vendor_id) {
da00c244 11779 case 0x10ec0662:
fea80fae 11780 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
11781 break;
11782 case 0x10ec0272:
11783 case 0x10ec0663:
11784 case 0x10ec0665:
9ad54547 11785 case 0x10ec0668:
fea80fae 11786 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
11787 break;
11788 case 0x10ec0273:
fea80fae 11789 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
11790 break;
11791 }
fea80fae
TI
11792 if (err < 0)
11793 goto error;
cec27c89 11794 }
2134ea4f 11795
1727a771 11796 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11797
bc9f98a9 11798 return 0;
801f49d3 11799
e16fb6d1
TI
11800 error:
11801 alc_free(codec);
11802 return err;
b478b998
KY
11803}
11804
d1eb57f4
KY
11805/*
11806 * ALC680 support
11807 */
d1eb57f4 11808
d1eb57f4
KY
11809static int alc680_parse_auto_config(struct hda_codec *codec)
11810{
3e6179b8 11811 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
11812}
11813
d1eb57f4 11814/*
d1eb57f4 11815 */
d1eb57f4
KY
11816static int patch_alc680(struct hda_codec *codec)
11817{
d1eb57f4
KY
11818 int err;
11819
1f0f4b80 11820 /* ALC680 has no aa-loopback mixer */
3de95173
TI
11821 err = alc_alloc_spec(codec, 0);
11822 if (err < 0)
11823 return err;
1f0f4b80 11824
1ebec5f2
TI
11825 /* automatic parse from the BIOS config */
11826 err = alc680_parse_auto_config(codec);
11827 if (err < 0) {
11828 alc_free(codec);
11829 return err;
d1eb57f4
KY
11830 }
11831
d1eb57f4
KY
11832 return 0;
11833}
11834
1da177e4
LT
11835/*
11836 * patch entries
11837 */
b9a94a9c 11838static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 11839 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 11840 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 11841 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 11842 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 11843 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
11844 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11845 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 11846 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 11847 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 11848 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 11849 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
11850 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11851 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 11852 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
11853 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11854 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11855 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11856 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11857 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11858 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11859 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 11860 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
11861 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11862 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11863 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11864 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11865 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11866 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 11867 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 11868 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 11869 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 11870 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 11871 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
11872 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11873 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11874 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 11875 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 11876 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 11877 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 11878 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 11879 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 11880 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
11881 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11882 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11883 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11884 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11885 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11886 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11887 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11888 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11889 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11890 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11891 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11892 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11893 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11894 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
11895 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11896 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11897 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 11898 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 11899 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
11900 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11901 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11902 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11903 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11904 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11905 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11906 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11907 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11908 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11909 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11910 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 11911 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
11912 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11913 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 11914 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 11915 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 11916 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
527f4643 11917 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
1da177e4
LT
11918 {} /* terminator */
11919};
b9a94a9c 11920MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
11921
11922MODULE_LICENSE("GPL");
11923MODULE_DESCRIPTION("Realtek HD-audio codec");
11924
d8a766a1 11925static struct hda_codec_driver realtek_driver = {
b9a94a9c 11926 .id = snd_hda_id_realtek,
1289e9e8
TI
11927};
11928
d8a766a1 11929module_hda_codec_driver(realtek_driver);