]> git.ipfire.org Git - thirdparty/linux.git/blame - sound/pci/hda/patch_realtek.c
Linux 6.8-rc1
[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
7ce66933 13#include <linux/acpi.h>
1da177e4
LT
14#include <linux/init.h>
15#include <linux/delay.h>
16#include <linux/slab.h>
17#include <linux/pci.h>
08fb0d0e 18#include <linux/dmi.h>
da155d5b 19#include <linux/module.h>
33f4acd3 20#include <linux/input.h>
87dc3648 21#include <linux/leds.h>
35a17444 22#include <linux/ctype.h>
1da177e4 23#include <sound/core.h>
9ad0e496 24#include <sound/jack.h>
be57bfff 25#include <sound/hda_codec.h>
1da177e4 26#include "hda_local.h"
23d30f28 27#include "hda_auto_parser.h"
1835a0f9 28#include "hda_jack.h"
08c189f2 29#include "hda_generic.h"
d3dca026 30#include "hda_component.h"
1da177e4 31
cd63a5ff
TI
32/* keep halting ALC5505 DSP, for power saving */
33#define HALT_REALTEK_ALC5505
34
4a79ba34
TI
35/* extra amp-initialization sequence types */
36enum {
1c76aa5f 37 ALC_INIT_UNDEFINED,
4a79ba34
TI
38 ALC_INIT_NONE,
39 ALC_INIT_DEFAULT,
4a79ba34
TI
40};
41
73bdd597
DH
42enum {
43 ALC_HEADSET_MODE_UNKNOWN,
44 ALC_HEADSET_MODE_UNPLUGGED,
45 ALC_HEADSET_MODE_HEADSET,
46 ALC_HEADSET_MODE_MIC,
47 ALC_HEADSET_MODE_HEADPHONE,
48};
49
50enum {
51 ALC_HEADSET_TYPE_UNKNOWN,
52 ALC_HEADSET_TYPE_CTIA,
53 ALC_HEADSET_TYPE_OMTP,
54};
55
c7b60a89
HW
56enum {
57 ALC_KEY_MICMUTE_INDEX,
58};
59
da00c244
KY
60struct alc_customize_define {
61 unsigned int sku_cfg;
62 unsigned char port_connectivity;
63 unsigned char check_sum;
64 unsigned char customization;
65 unsigned char external_amp;
66 unsigned int enable_pcbeep:1;
67 unsigned int platform_type:1;
68 unsigned int swap:1;
69 unsigned int override:1;
90622917 70 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
da00c244
KY
71};
72
766538ac
TI
73struct alc_coef_led {
74 unsigned int idx;
75 unsigned int mask;
76 unsigned int on;
77 unsigned int off;
78};
79
1da177e4 80struct alc_spec {
08c189f2 81 struct hda_gen_spec gen; /* must be at head */
23d30f28 82
1da177e4 83 /* codec parameterization */
da00c244 84 struct alc_customize_define cdefine;
08c189f2 85 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
834be88d 86
5579cd6f
TI
87 /* GPIO bits */
88 unsigned int gpio_mask;
89 unsigned int gpio_dir;
90 unsigned int gpio_data;
215c850c 91 bool gpio_write_delay; /* add a delay before writing gpio_data */
5579cd6f 92
8d3d1ece 93 /* mute LED for HP laptops, see vref_mute_led_set() */
08fb0d0e 94 int mute_led_polarity;
dbd13179 95 int micmute_led_polarity;
08fb0d0e 96 hda_nid_t mute_led_nid;
9c5dc3bf 97 hda_nid_t cap_mute_led_nid;
08fb0d0e 98
0f32fd19
TI
99 unsigned int gpio_mute_led_mask;
100 unsigned int gpio_mic_led_mask;
766538ac
TI
101 struct alc_coef_led mute_led_coef;
102 struct alc_coef_led mic_led_coef;
b837a9f5 103 struct mutex coef_mutex;
9f5c6faf 104
73bdd597
DH
105 hda_nid_t headset_mic_pin;
106 hda_nid_t headphone_mic_pin;
107 int current_headset_mode;
108 int current_headset_type;
109
ae6b813a
TI
110 /* hooks */
111 void (*init_hook)(struct hda_codec *codec);
83012a7c 112#ifdef CONFIG_PM
c97259df 113 void (*power_hook)(struct hda_codec *codec);
f5de24b0 114#endif
1c716153 115 void (*shutup)(struct hda_codec *codec);
d922b51d 116
4a79ba34 117 int init_amp;
d433a678 118 int codec_variant; /* flag for other variants */
97a26570
KY
119 unsigned int has_alc5505_dsp:1;
120 unsigned int no_depop_delay:1;
693abe11 121 unsigned int done_hp_init:1;
c0ca5ece 122 unsigned int no_shutup_pins:1;
d3ba58bb 123 unsigned int ultra_low_power:1;
476c02e0 124 unsigned int has_hs_key:1;
92666d45 125 unsigned int no_internal_mic_pin:1;
69ea4c9d 126 unsigned int en_3kpull_low:1;
e64f14f4 127
2c3bf9ab
TI
128 /* for PLL fix */
129 hda_nid_t pll_nid;
130 unsigned int pll_coef_idx, pll_coef_bit;
1bb7e43e 131 unsigned int coef0;
33f4acd3 132 struct input_dev *kb_dev;
c7b60a89 133 u8 alc_mute_keycode_map[1];
d3dca026
LT
134
135 /* component binding */
136 struct component_match *match;
137 struct hda_component comps[HDA_MAX_COMPONENTS];
df694daa
KY
138};
139
f2a227cd
TI
140/*
141 * COEF access helper functions
142 */
143
2a845837
TI
144static void coef_mutex_lock(struct hda_codec *codec)
145{
146 struct alc_spec *spec = codec->spec;
147
148 snd_hda_power_up_pm(codec);
149 mutex_lock(&spec->coef_mutex);
150}
151
152static void coef_mutex_unlock(struct hda_codec *codec)
153{
154 struct alc_spec *spec = codec->spec;
155
156 mutex_unlock(&spec->coef_mutex);
157 snd_hda_power_down_pm(codec);
158}
159
b837a9f5
TI
160static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
161 unsigned int coef_idx)
f2a227cd
TI
162{
163 unsigned int val;
164
165 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
166 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
167 return val;
168}
169
b837a9f5
TI
170static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
171 unsigned int coef_idx)
172{
b837a9f5
TI
173 unsigned int val;
174
2a845837 175 coef_mutex_lock(codec);
b837a9f5 176 val = __alc_read_coefex_idx(codec, nid, coef_idx);
2a845837 177 coef_mutex_unlock(codec);
b837a9f5
TI
178 return val;
179}
180
f2a227cd
TI
181#define alc_read_coef_idx(codec, coef_idx) \
182 alc_read_coefex_idx(codec, 0x20, coef_idx)
183
b837a9f5
TI
184static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
185 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
186{
187 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
188 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
189}
190
b837a9f5
TI
191static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
192 unsigned int coef_idx, unsigned int coef_val)
193{
2a845837 194 coef_mutex_lock(codec);
b837a9f5 195 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
2a845837 196 coef_mutex_unlock(codec);
b837a9f5
TI
197}
198
f2a227cd
TI
199#define alc_write_coef_idx(codec, coef_idx, coef_val) \
200 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
201
b837a9f5
TI
202static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
203 unsigned int coef_idx, unsigned int mask,
204 unsigned int bits_set)
205{
206 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
207
208 if (val != -1)
209 __alc_write_coefex_idx(codec, nid, coef_idx,
210 (val & ~mask) | bits_set);
211}
212
98b24883
TI
213static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
214 unsigned int coef_idx, unsigned int mask,
215 unsigned int bits_set)
216{
2a845837 217 coef_mutex_lock(codec);
b837a9f5 218 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
2a845837 219 coef_mutex_unlock(codec);
98b24883
TI
220}
221
222#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
223 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
224
f2a227cd
TI
225/* a special bypass for COEF 0; read the cached value at the second time */
226static unsigned int alc_get_coef0(struct hda_codec *codec)
227{
228 struct alc_spec *spec = codec->spec;
229
230 if (!spec->coef0)
231 spec->coef0 = alc_read_coef_idx(codec, 0);
232 return spec->coef0;
233}
234
54db6c39
TI
235/* coef writes/updates batch */
236struct coef_fw {
237 unsigned char nid;
238 unsigned char idx;
239 unsigned short mask;
240 unsigned short val;
241};
242
243#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
244 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
245#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
246#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
247#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
248
249static void alc_process_coef_fw(struct hda_codec *codec,
250 const struct coef_fw *fw)
251{
2a845837 252 coef_mutex_lock(codec);
54db6c39
TI
253 for (; fw->nid; fw++) {
254 if (fw->mask == (unsigned short)-1)
b837a9f5 255 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 256 else
b837a9f5
TI
257 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
258 fw->mask, fw->val);
54db6c39 259 }
2a845837 260 coef_mutex_unlock(codec);
54db6c39
TI
261}
262
df694daa 263/*
1d045db9 264 * GPIO setup tables, used in initialization
df694daa 265 */
5579cd6f 266
bc9f98a9 267/* Enable GPIO mask and set output */
5579cd6f
TI
268static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
269{
270 struct alc_spec *spec = codec->spec;
bc9f98a9 271
5579cd6f
TI
272 spec->gpio_mask |= mask;
273 spec->gpio_dir |= mask;
274 spec->gpio_data |= mask;
275}
bc9f98a9 276
5579cd6f
TI
277static void alc_write_gpio_data(struct hda_codec *codec)
278{
279 struct alc_spec *spec = codec->spec;
280
281 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
282 spec->gpio_data);
283}
284
aaf312de
TI
285static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
286 bool on)
287{
288 struct alc_spec *spec = codec->spec;
289 unsigned int oldval = spec->gpio_data;
290
291 if (on)
292 spec->gpio_data |= mask;
293 else
294 spec->gpio_data &= ~mask;
295 if (oldval != spec->gpio_data)
296 alc_write_gpio_data(codec);
297}
298
5579cd6f
TI
299static void alc_write_gpio(struct hda_codec *codec)
300{
301 struct alc_spec *spec = codec->spec;
302
303 if (!spec->gpio_mask)
304 return;
305
306 snd_hda_codec_write(codec, codec->core.afg, 0,
307 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
308 snd_hda_codec_write(codec, codec->core.afg, 0,
309 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
310 if (spec->gpio_write_delay)
311 msleep(1);
5579cd6f
TI
312 alc_write_gpio_data(codec);
313}
314
315static void alc_fixup_gpio(struct hda_codec *codec, int action,
316 unsigned int mask)
317{
318 if (action == HDA_FIXUP_ACT_PRE_PROBE)
319 alc_setup_gpio(codec, mask);
320}
321
322static void alc_fixup_gpio1(struct hda_codec *codec,
323 const struct hda_fixup *fix, int action)
324{
325 alc_fixup_gpio(codec, action, 0x01);
326}
327
328static void alc_fixup_gpio2(struct hda_codec *codec,
329 const struct hda_fixup *fix, int action)
330{
331 alc_fixup_gpio(codec, action, 0x02);
332}
333
334static void alc_fixup_gpio3(struct hda_codec *codec,
335 const struct hda_fixup *fix, int action)
336{
337 alc_fixup_gpio(codec, action, 0x03);
338}
bdd148a3 339
ae065f1c
TI
340static void alc_fixup_gpio4(struct hda_codec *codec,
341 const struct hda_fixup *fix, int action)
342{
343 alc_fixup_gpio(codec, action, 0x04);
344}
345
8a503555
TI
346static void alc_fixup_micmute_led(struct hda_codec *codec,
347 const struct hda_fixup *fix, int action)
348{
e65bf997 349 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
350 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
351}
352
2c3bf9ab
TI
353/*
354 * Fix hardware PLL issue
355 * On some codecs, the analog PLL gating control must be off while
356 * the default value is 1.
357 */
358static void alc_fix_pll(struct hda_codec *codec)
359{
360 struct alc_spec *spec = codec->spec;
2c3bf9ab 361
98b24883
TI
362 if (spec->pll_nid)
363 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
364 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
365}
366
367static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
368 unsigned int coef_idx, unsigned int coef_bit)
369{
370 struct alc_spec *spec = codec->spec;
371 spec->pll_nid = nid;
372 spec->pll_coef_idx = coef_idx;
373 spec->pll_coef_bit = coef_bit;
374 alc_fix_pll(codec);
375}
376
cf5a2279 377/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
378static void alc_update_knob_master(struct hda_codec *codec,
379 struct hda_jack_callback *jack)
cf5a2279
TI
380{
381 unsigned int val;
382 struct snd_kcontrol *kctl;
383 struct snd_ctl_elem_value *uctl;
384
385 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
386 if (!kctl)
387 return;
388 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
389 if (!uctl)
390 return;
2ebab40e 391 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
392 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
393 val &= HDA_AMP_VOLMASK;
394 uctl->value.integer.value[0] = val;
395 uctl->value.integer.value[1] = val;
396 kctl->put(kctl, uctl);
397 kfree(uctl);
398}
399
29adc4b9 400static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 401{
29adc4b9
DH
402 /* For some reason, the res given from ALC880 is broken.
403 Here we adjust it properly. */
404 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
405}
406
394c97f8
KY
407/* Change EAPD to verb control */
408static void alc_fill_eapd_coef(struct hda_codec *codec)
409{
410 int coef;
411
412 coef = alc_get_coef0(codec);
413
7639a06c 414 switch (codec->core.vendor_id) {
394c97f8
KY
415 case 0x10ec0262:
416 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
417 break;
418 case 0x10ec0267:
419 case 0x10ec0268:
420 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
421 break;
422 case 0x10ec0269:
423 if ((coef & 0x00f0) == 0x0010)
424 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
425 if ((coef & 0x00f0) == 0x0020)
426 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
427 if ((coef & 0x00f0) == 0x0030)
428 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
429 break;
430 case 0x10ec0280:
431 case 0x10ec0284:
432 case 0x10ec0290:
433 case 0x10ec0292:
434 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
435 break;
4231430d 436 case 0x10ec0225:
44be77c5
TI
437 case 0x10ec0295:
438 case 0x10ec0299:
439 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 440 fallthrough;
44be77c5 441 case 0x10ec0215:
1948fc06 442 case 0x10ec0230:
394c97f8 443 case 0x10ec0233:
ea04a1db 444 case 0x10ec0235:
c4473744 445 case 0x10ec0236:
7fbdcd83 446 case 0x10ec0245:
394c97f8 447 case 0x10ec0255:
c4473744 448 case 0x10ec0256:
527f4643 449 case 0x19e58326:
f429e7e4 450 case 0x10ec0257:
394c97f8
KY
451 case 0x10ec0282:
452 case 0x10ec0283:
453 case 0x10ec0286:
454 case 0x10ec0288:
0a6f0600 455 case 0x10ec0285:
506b62c3 456 case 0x10ec0298:
0a6f0600 457 case 0x10ec0289:
1078bef0 458 case 0x10ec0300:
394c97f8
KY
459 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
460 break;
3aabf94c
KY
461 case 0x10ec0275:
462 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
463 break;
8822702f
HW
464 case 0x10ec0287:
465 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
466 alc_write_coef_idx(codec, 0x8, 0x4ab7);
467 break;
394c97f8
KY
468 case 0x10ec0293:
469 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
470 break;
dcd4f0db
KY
471 case 0x10ec0234:
472 case 0x10ec0274:
473 case 0x10ec0294:
6fbae35a
KY
474 case 0x10ec0700:
475 case 0x10ec0701:
476 case 0x10ec0703:
83629532 477 case 0x10ec0711:
dcd4f0db
KY
478 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
479 break;
394c97f8
KY
480 case 0x10ec0662:
481 if ((coef & 0x00f0) == 0x0030)
482 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
483 break;
484 case 0x10ec0272:
485 case 0x10ec0273:
486 case 0x10ec0663:
487 case 0x10ec0665:
488 case 0x10ec0670:
489 case 0x10ec0671:
490 case 0x10ec0672:
491 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
492 break;
9194a1eb 493 case 0x10ec0222:
f0778871
KY
494 case 0x10ec0623:
495 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
496 break;
394c97f8
KY
497 case 0x10ec0668:
498 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
499 break;
500 case 0x10ec0867:
501 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
502 break;
503 case 0x10ec0888:
504 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
505 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
506 break;
507 case 0x10ec0892:
e5782a5d 508 case 0x10ec0897:
394c97f8
KY
509 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
510 break;
511 case 0x10ec0899:
512 case 0x10ec0900:
6d9ffcff 513 case 0x10ec0b00:
65553b12 514 case 0x10ec1168:
a535ad57 515 case 0x10ec1220:
394c97f8
KY
516 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
517 break;
518 }
519}
520
f9423e7a
KY
521/* additional initialization for ALC888 variants */
522static void alc888_coef_init(struct hda_codec *codec)
523{
1df8874b
KY
524 switch (alc_get_coef0(codec) & 0x00f0) {
525 /* alc888-VA */
526 case 0x00:
527 /* alc888-VB */
528 case 0x10:
529 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
530 break;
531 }
87a8c370
JK
532}
533
3fb4a508
TI
534/* turn on/off EAPD control (only if available) */
535static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
536{
537 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
538 return;
539 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
540 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
541 on ? 2 : 0);
542}
543
691f1fcc
TI
544/* turn on/off EAPD controls of the codec */
545static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
546{
547 /* We currently only handle front, HP */
caf3c043 548 static const hda_nid_t pins[] = {
af95b414 549 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 550 };
caf3c043 551 const hda_nid_t *p;
39fa84e9
TI
552 for (p = pins; *p; p++)
553 set_eapd(codec, *p, on);
691f1fcc
TI
554}
555
dad3197d
KY
556static int find_ext_mic_pin(struct hda_codec *codec);
557
558static void alc_headset_mic_no_shutup(struct hda_codec *codec)
559{
560 const struct hda_pincfg *pin;
561 int mic_pin = find_ext_mic_pin(codec);
562 int i;
563
564 /* don't shut up pins when unloading the driver; otherwise it breaks
565 * the default pin setup at the next load of the driver
566 */
567 if (codec->bus->shutdown)
568 return;
569
570 snd_array_for_each(&codec->init_pins, i, pin) {
571 /* use read here for syncing after issuing each verb */
572 if (pin->nid != mic_pin)
573 snd_hda_codec_read(codec, pin->nid, 0,
574 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
575 }
576
577 codec->pins_shutup = 1;
578}
579
c0ca5ece
TI
580static void alc_shutup_pins(struct hda_codec *codec)
581{
582 struct alc_spec *spec = codec->spec;
583
dad3197d 584 switch (codec->core.vendor_id) {
5aec9891
KY
585 case 0x10ec0236:
586 case 0x10ec0256:
527f4643 587 case 0x19e58326:
66c5d718 588 case 0x10ec0283:
dad3197d
KY
589 case 0x10ec0286:
590 case 0x10ec0288:
591 case 0x10ec0298:
592 alc_headset_mic_no_shutup(codec);
593 break;
594 default:
595 if (!spec->no_shutup_pins)
596 snd_hda_shutup_pins(codec);
597 break;
598 }
c0ca5ece
TI
599}
600
1c716153 601/* generic shutup callback;
4ce8e6a5 602 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
603 */
604static void alc_eapd_shutup(struct hda_codec *codec)
605{
97a26570
KY
606 struct alc_spec *spec = codec->spec;
607
1c716153 608 alc_auto_setup_eapd(codec, false);
97a26570
KY
609 if (!spec->no_depop_delay)
610 msleep(200);
c0ca5ece 611 alc_shutup_pins(codec);
1c716153
TI
612}
613
1d045db9 614/* generic EAPD initialization */
4a79ba34 615static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 616{
39fa84e9 617 alc_auto_setup_eapd(codec, true);
5579cd6f 618 alc_write_gpio(codec);
4a79ba34 619 switch (type) {
4a79ba34 620 case ALC_INIT_DEFAULT:
7639a06c 621 switch (codec->core.vendor_id) {
c9b58006 622 case 0x10ec0260:
98b24883 623 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 624 break;
c9b58006
KY
625 case 0x10ec0880:
626 case 0x10ec0882:
627 case 0x10ec0883:
628 case 0x10ec0885:
1df8874b 629 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 630 break;
f9423e7a 631 case 0x10ec0888:
4a79ba34 632 alc888_coef_init(codec);
f9423e7a 633 break;
bc9f98a9 634 }
4a79ba34
TI
635 break;
636 }
637}
638
35a39f98
TI
639/* get a primary headphone pin if available */
640static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
641{
642 if (spec->gen.autocfg.hp_pins[0])
643 return spec->gen.autocfg.hp_pins[0];
644 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
645 return spec->gen.autocfg.line_out_pins[0];
646 return 0;
647}
08c189f2 648
1d045db9 649/*
08c189f2 650 * Realtek SSID verification
1d045db9 651 */
42cf0d01 652
08c189f2
TI
653/* Could be any non-zero and even value. When used as fixup, tells
654 * the driver to ignore any present sku defines.
655 */
656#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 657
08c189f2
TI
658static void alc_fixup_sku_ignore(struct hda_codec *codec,
659 const struct hda_fixup *fix, int action)
1a1455de 660{
1a1455de 661 struct alc_spec *spec = codec->spec;
08c189f2
TI
662 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
663 spec->cdefine.fixup = 1;
664 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 665 }
1a1455de
TI
666}
667
b5c6611f
ML
668static void alc_fixup_no_depop_delay(struct hda_codec *codec,
669 const struct hda_fixup *fix, int action)
670{
671 struct alc_spec *spec = codec->spec;
672
84d2dc3e 673 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 674 spec->no_depop_delay = 1;
84d2dc3e
ML
675 codec->depop_delay = 0;
676 }
b5c6611f
ML
677}
678
08c189f2 679static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 680{
08c189f2
TI
681 unsigned int ass, tmp, i;
682 unsigned nid = 0;
4a79ba34
TI
683 struct alc_spec *spec = codec->spec;
684
08c189f2 685 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 686
08c189f2
TI
687 if (spec->cdefine.fixup) {
688 ass = spec->cdefine.sku_cfg;
689 if (ass == ALC_FIXUP_SKU_IGNORE)
690 return -1;
691 goto do_sku;
bb35febd
TI
692 }
693
5100cd07
TI
694 if (!codec->bus->pci)
695 return -1;
7639a06c 696 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
697 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
698 goto do_sku;
4a79ba34 699
08c189f2 700 nid = 0x1d;
7639a06c 701 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
702 nid = 0x17;
703 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 704
08c189f2 705 if (!(ass & 1)) {
4e76a883 706 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 707 codec->core.chip_name, ass);
08c189f2 708 return -1;
42cf0d01
DH
709 }
710
08c189f2
TI
711 /* check sum */
712 tmp = 0;
713 for (i = 1; i < 16; i++) {
714 if ((ass >> i) & 1)
715 tmp++;
ae8a60a5 716 }
08c189f2
TI
717 if (((ass >> 16) & 0xf) != tmp)
718 return -1;
ae8a60a5 719
da00c244
KY
720 spec->cdefine.port_connectivity = ass >> 30;
721 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
722 spec->cdefine.check_sum = (ass >> 16) & 0xf;
723 spec->cdefine.customization = ass >> 8;
724do_sku:
725 spec->cdefine.sku_cfg = ass;
726 spec->cdefine.external_amp = (ass & 0x38) >> 3;
727 spec->cdefine.platform_type = (ass & 0x4) >> 2;
728 spec->cdefine.swap = (ass & 0x2) >> 1;
729 spec->cdefine.override = ass & 0x1;
730
4e76a883 731 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 732 nid, spec->cdefine.sku_cfg);
4e76a883 733 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 734 spec->cdefine.port_connectivity);
4e76a883
TI
735 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
736 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
737 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
738 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
739 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
740 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
741 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
742
743 return 0;
744}
745
08c189f2
TI
746/* return the position of NID in the list, or -1 if not found */
747static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
748{
749 int i;
750 for (i = 0; i < nums; i++)
751 if (list[i] == nid)
752 return i;
753 return -1;
754}
1d045db9 755/* return true if the given NID is found in the list */
3af9ee6b
TI
756static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
757{
21268961 758 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
759}
760
4a79ba34
TI
761/* check subsystem ID and set up device-specific initialization;
762 * return 1 if initialized, 0 if invalid SSID
763 */
764/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
765 * 31 ~ 16 : Manufacture ID
766 * 15 ~ 8 : SKU ID
767 * 7 ~ 0 : Assembly ID
768 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
769 */
58c57cfa 770static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
771{
772 unsigned int ass, tmp, i;
773 unsigned nid;
774 struct alc_spec *spec = codec->spec;
775
90622917
DH
776 if (spec->cdefine.fixup) {
777 ass = spec->cdefine.sku_cfg;
778 if (ass == ALC_FIXUP_SKU_IGNORE)
779 return 0;
780 goto do_sku;
781 }
782
7639a06c 783 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
784 if (codec->bus->pci &&
785 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
786 goto do_sku;
787
788 /* invalid SSID, check the special NID pin defcfg instead */
789 /*
def319f9 790 * 31~30 : port connectivity
4a79ba34
TI
791 * 29~21 : reserve
792 * 20 : PCBEEP input
793 * 19~16 : Check sum (15:1)
794 * 15~1 : Custom
795 * 0 : override
796 */
797 nid = 0x1d;
7639a06c 798 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
799 nid = 0x17;
800 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
801 codec_dbg(codec,
802 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 803 ass, nid);
6227cdce 804 if (!(ass & 1))
4a79ba34
TI
805 return 0;
806 if ((ass >> 30) != 1) /* no physical connection */
807 return 0;
808
809 /* check sum */
810 tmp = 0;
811 for (i = 1; i < 16; i++) {
812 if ((ass >> i) & 1)
813 tmp++;
814 }
815 if (((ass >> 16) & 0xf) != tmp)
816 return 0;
817do_sku:
4e76a883 818 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 819 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
820 /*
821 * 0 : override
822 * 1 : Swap Jack
823 * 2 : 0 --> Desktop, 1 --> Laptop
824 * 3~5 : External Amplifier control
825 * 7~6 : Reserved
826 */
827 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
828 if (spec->init_amp == ALC_INIT_UNDEFINED) {
829 switch (tmp) {
830 case 1:
5579cd6f 831 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
832 break;
833 case 3:
5579cd6f 834 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
835 break;
836 case 7:
2bdccfd2 837 alc_setup_gpio(codec, 0x04);
1c76aa5f
TI
838 break;
839 case 5:
840 default:
841 spec->init_amp = ALC_INIT_DEFAULT;
842 break;
843 }
bc9f98a9 844 }
ea1fb29a 845
8c427226 846 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
847 * when the external headphone out jack is plugged"
848 */
8c427226 849 if (!(ass & 0x8000))
4a79ba34 850 return 1;
c9b58006
KY
851 /*
852 * 10~8 : Jack location
853 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
854 * 14~13: Resvered
855 * 15 : 1 --> enable the function "Mute internal speaker
856 * when the external headphone out jack is plugged"
857 */
35a39f98 858 if (!alc_get_hp_pin(spec)) {
01d4825d 859 hda_nid_t nid;
c9b58006 860 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 861 nid = ports[tmp];
08c189f2
TI
862 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
863 spec->gen.autocfg.line_outs))
3af9ee6b 864 return 1;
08c189f2 865 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 866 }
4a79ba34
TI
867 return 1;
868}
ea1fb29a 869
3e6179b8
TI
870/* Check the validity of ALC subsystem-id
871 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
872static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 873{
58c57cfa 874 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 875 struct alc_spec *spec = codec->spec;
67791202
TI
876 if (spec->init_amp == ALC_INIT_UNDEFINED) {
877 codec_dbg(codec,
878 "realtek: Enable default setup for auto mode as fallback\n");
879 spec->init_amp = ALC_INIT_DEFAULT;
880 }
4a79ba34 881 }
21268961 882}
1a1455de 883
1d045db9 884/*
ef8ef5fb 885 */
f9e336f6 886
9d36a7dc
DH
887static void alc_fixup_inv_dmic(struct hda_codec *codec,
888 const struct hda_fixup *fix, int action)
125821ae
TI
889{
890 struct alc_spec *spec = codec->spec;
668d1e96 891
9d36a7dc 892 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
893}
894
e9edcee0 895
08c189f2 896static int alc_build_controls(struct hda_codec *codec)
1d045db9 897{
a5cb463a 898 int err;
e9427969 899
08c189f2
TI
900 err = snd_hda_gen_build_controls(codec);
901 if (err < 0)
902 return err;
1da177e4 903
1727a771 904 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 905 return 0;
a361d84b
KY
906}
907
a361d84b 908
df694daa 909/*
08c189f2 910 * Common callbacks
df694daa 911 */
a361d84b 912
c9af753f
TI
913static void alc_pre_init(struct hda_codec *codec)
914{
915 alc_fill_eapd_coef(codec);
916}
917
aeac1a0d
KY
918#define is_s3_resume(codec) \
919 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
920#define is_s4_resume(codec) \
921 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
922
08c189f2 923static int alc_init(struct hda_codec *codec)
1d045db9
TI
924{
925 struct alc_spec *spec = codec->spec;
a361d84b 926
c9af753f
TI
927 /* hibernation resume needs the full chip initialization */
928 if (is_s4_resume(codec))
929 alc_pre_init(codec);
930
08c189f2
TI
931 if (spec->init_hook)
932 spec->init_hook(codec);
a361d84b 933
89781d08 934 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 935 snd_hda_gen_init(codec);
08c189f2
TI
936 alc_fix_pll(codec);
937 alc_auto_init_amp(codec, spec->init_amp);
89781d08 938 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 939
1727a771 940 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 941
1d045db9
TI
942 return 0;
943}
a361d84b 944
c3d9ca93
RD
945#define alc_free snd_hda_gen_free
946
947#ifdef CONFIG_PM
08c189f2 948static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
949{
950 struct alc_spec *spec = codec->spec;
a361d84b 951
c7273bd6
TI
952 if (!snd_hda_get_bool_hint(codec, "shutup"))
953 return; /* disabled explicitly by hints */
954
08c189f2
TI
955 if (spec && spec->shutup)
956 spec->shutup(codec);
9bfb2844 957 else
c0ca5ece 958 alc_shutup_pins(codec);
1d045db9
TI
959}
960
08c189f2 961static void alc_power_eapd(struct hda_codec *codec)
1d045db9 962{
08c189f2 963 alc_auto_setup_eapd(codec, false);
1d045db9 964}
2134ea4f 965
08c189f2 966static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
967{
968 struct alc_spec *spec = codec->spec;
08c189f2
TI
969 alc_shutup(codec);
970 if (spec && spec->power_hook)
971 spec->power_hook(codec);
a361d84b
KY
972 return 0;
973}
974
08c189f2 975static int alc_resume(struct hda_codec *codec)
1d045db9 976{
97a26570
KY
977 struct alc_spec *spec = codec->spec;
978
979 if (!spec->no_depop_delay)
980 msleep(150); /* to avoid pop noise */
08c189f2 981 codec->patch_ops.init(codec);
1a462be5 982 snd_hda_regmap_sync(codec);
08c189f2
TI
983 hda_call_check_power_status(codec, 0x01);
984 return 0;
1d045db9 985}
08c189f2 986#endif
f6a92248 987
1d045db9 988/*
1d045db9 989 */
08c189f2
TI
990static const struct hda_codec_ops alc_patch_ops = {
991 .build_controls = alc_build_controls,
992 .build_pcms = snd_hda_gen_build_pcms,
993 .init = alc_init,
994 .free = alc_free,
995 .unsol_event = snd_hda_jack_unsol_event,
996#ifdef CONFIG_PM
997 .resume = alc_resume,
08c189f2 998 .suspend = alc_suspend,
fce52a3b 999 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 1000#endif
08c189f2 1001};
f6a92248 1002
f53281e6 1003
ded255be 1004#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 1005
e4770629 1006/*
4b016931 1007 * Rename codecs appropriately from COEF value or subvendor id
e4770629 1008 */
08c189f2
TI
1009struct alc_codec_rename_table {
1010 unsigned int vendor_id;
1011 unsigned short coef_mask;
1012 unsigned short coef_bits;
1013 const char *name;
1014};
84898e87 1015
4b016931
KY
1016struct alc_codec_rename_pci_table {
1017 unsigned int codec_vendor_id;
1018 unsigned short pci_subvendor;
1019 unsigned short pci_subdevice;
1020 const char *name;
1021};
1022
6b0f95c4 1023static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1024 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1025 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1026 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1027 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1028 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1029 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1030 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1031 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1032 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1033 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1034 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1035 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1036 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1037 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1038 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1039 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1040 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1041 { } /* terminator */
1042};
84898e87 1043
6b0f95c4 1044static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1045 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1046 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1047 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1048 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1049 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1050 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1051 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1052 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1053 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1054 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1055 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1056 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1057 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1058 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1059 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1060 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1061 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1062 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1063 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1064 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1065 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1066 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1067 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1068 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1069 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1070 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1071 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1072 { } /* terminator */
1073};
1074
08c189f2 1075static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1076{
08c189f2 1077 const struct alc_codec_rename_table *p;
4b016931 1078 const struct alc_codec_rename_pci_table *q;
60db6b53 1079
08c189f2 1080 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1081 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1082 continue;
1083 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1084 return alc_codec_rename(codec, p->name);
1d045db9 1085 }
4b016931 1086
5100cd07
TI
1087 if (!codec->bus->pci)
1088 return 0;
4b016931 1089 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1090 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1091 continue;
1092 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1093 continue;
1094 if (!q->pci_subdevice ||
1095 q->pci_subdevice == codec->bus->pci->subsystem_device)
1096 return alc_codec_rename(codec, q->name);
1097 }
1098
08c189f2 1099 return 0;
1d045db9 1100}
f53281e6 1101
e4770629 1102
1d045db9
TI
1103/*
1104 * Digital-beep handlers
1105 */
1106#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1107
1108/* additional beep mixers; private_value will be overwritten */
1109static const struct snd_kcontrol_new alc_beep_mixer[] = {
1110 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1111 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1112};
1113
1114/* set up and create beep controls */
1115static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1116 int idx, int dir)
1117{
1118 struct snd_kcontrol_new *knew;
1119 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1120 int i;
1121
1122 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1123 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1124 &alc_beep_mixer[i]);
1125 if (!knew)
1126 return -ENOMEM;
1127 knew->private_value = beep_amp;
1128 }
1129 return 0;
1130}
84898e87 1131
6317e5eb 1132static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1133 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1134 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1135 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1136 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1137 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1138 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1139 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1140 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1141 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1142 /* denylist -- no beep available */
051c78af
TI
1143 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1144 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1145 {}
fe3eb0a7
KY
1146};
1147
1d045db9
TI
1148static inline int has_cdefine_beep(struct hda_codec *codec)
1149{
1150 struct alc_spec *spec = codec->spec;
1151 const struct snd_pci_quirk *q;
6317e5eb 1152 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1153 if (q)
1154 return q->value;
1155 return spec->cdefine.enable_pcbeep;
1156}
1157#else
fea80fae 1158#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1159#define has_cdefine_beep(codec) 0
1160#endif
84898e87 1161
1d045db9
TI
1162/* parse the BIOS configuration and set up the alc_spec */
1163/* return 1 if successful, 0 if the proper config is not found,
1164 * or a negative error code
1165 */
3e6179b8
TI
1166static int alc_parse_auto_config(struct hda_codec *codec,
1167 const hda_nid_t *ignore_nids,
1168 const hda_nid_t *ssid_nids)
1d045db9
TI
1169{
1170 struct alc_spec *spec = codec->spec;
08c189f2 1171 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1172 int err;
26f5df26 1173
53c334ad
TI
1174 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1175 spec->parse_flags);
1d045db9
TI
1176 if (err < 0)
1177 return err;
3e6179b8
TI
1178
1179 if (ssid_nids)
1180 alc_ssid_check(codec, ssid_nids);
64154835 1181
08c189f2
TI
1182 err = snd_hda_gen_parse_auto_config(codec, cfg);
1183 if (err < 0)
1184 return err;
070cff4c 1185
1d045db9 1186 return 1;
60db6b53 1187}
f6a92248 1188
3de95173
TI
1189/* common preparation job for alc_spec */
1190static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1191{
1192 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1193 int err;
1194
1195 if (!spec)
1196 return -ENOMEM;
1197 codec->spec = spec;
08c189f2
TI
1198 snd_hda_gen_spec_init(&spec->gen);
1199 spec->gen.mixer_nid = mixer_nid;
1200 spec->gen.own_eapd_ctl = 1;
1098b7c2 1201 codec->single_adc_amp = 1;
08c189f2
TI
1202 /* FIXME: do we need this for all Realtek codec models? */
1203 codec->spdif_status_reset = 1;
a6e7d0a4 1204 codec->forced_resume = 1;
225068ab 1205 codec->patch_ops = alc_patch_ops;
b837a9f5 1206 mutex_init(&spec->coef_mutex);
3de95173
TI
1207
1208 err = alc_codec_rename_from_preset(codec);
1209 if (err < 0) {
1210 kfree(spec);
1211 return err;
1212 }
1213 return 0;
1214}
1215
3e6179b8
TI
1216static int alc880_parse_auto_config(struct hda_codec *codec)
1217{
1218 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1219 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1220 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1221}
1222
ee3b2969
TI
1223/*
1224 * ALC880 fix-ups
1225 */
1226enum {
411225a0 1227 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1228 ALC880_FIXUP_GPIO2,
1229 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1230 ALC880_FIXUP_LG,
db8a38e5 1231 ALC880_FIXUP_LG_LW25,
f02aab5d 1232 ALC880_FIXUP_W810,
27e917f8 1233 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1234 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1235 ALC880_FIXUP_VOL_KNOB,
1236 ALC880_FIXUP_FUJITSU,
ba533818 1237 ALC880_FIXUP_F1734,
817de92f 1238 ALC880_FIXUP_UNIWILL,
967b88c4 1239 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1240 ALC880_FIXUP_Z71V,
487a588d 1241 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1242 ALC880_FIXUP_3ST_BASE,
1243 ALC880_FIXUP_3ST,
1244 ALC880_FIXUP_3ST_DIG,
1245 ALC880_FIXUP_5ST_BASE,
1246 ALC880_FIXUP_5ST,
1247 ALC880_FIXUP_5ST_DIG,
1248 ALC880_FIXUP_6ST_BASE,
1249 ALC880_FIXUP_6ST,
1250 ALC880_FIXUP_6ST_DIG,
5397145f 1251 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1252};
1253
cf5a2279
TI
1254/* enable the volume-knob widget support on NID 0x21 */
1255static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1256 const struct hda_fixup *fix, int action)
cf5a2279 1257{
1727a771 1258 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1259 snd_hda_jack_detect_enable_callback(codec, 0x21,
1260 alc_update_knob_master);
cf5a2279
TI
1261}
1262
1727a771 1263static const struct hda_fixup alc880_fixups[] = {
411225a0 1264 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1265 .type = HDA_FIXUP_FUNC,
1266 .v.func = alc_fixup_gpio1,
411225a0 1267 },
ee3b2969 1268 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1269 .type = HDA_FIXUP_FUNC,
1270 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1271 },
1272 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1273 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1274 .v.verbs = (const struct hda_verb[]) {
1275 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1276 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1277 { }
1278 },
1279 .chained = true,
1280 .chain_id = ALC880_FIXUP_GPIO2,
1281 },
dc6af52d 1282 [ALC880_FIXUP_LG] = {
1727a771
TI
1283 .type = HDA_FIXUP_PINS,
1284 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1285 /* disable bogus unused pins */
1286 { 0x16, 0x411111f0 },
1287 { 0x18, 0x411111f0 },
1288 { 0x1a, 0x411111f0 },
1289 { }
1290 }
1291 },
db8a38e5
TI
1292 [ALC880_FIXUP_LG_LW25] = {
1293 .type = HDA_FIXUP_PINS,
1294 .v.pins = (const struct hda_pintbl[]) {
1295 { 0x1a, 0x0181344f }, /* line-in */
1296 { 0x1b, 0x0321403f }, /* headphone */
1297 { }
1298 }
1299 },
f02aab5d 1300 [ALC880_FIXUP_W810] = {
1727a771
TI
1301 .type = HDA_FIXUP_PINS,
1302 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1303 /* disable bogus unused pins */
1304 { 0x17, 0x411111f0 },
1305 { }
1306 },
1307 .chained = true,
1308 .chain_id = ALC880_FIXUP_GPIO2,
1309 },
27e917f8 1310 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1311 .type = HDA_FIXUP_VERBS,
27e917f8
TI
1312 .v.verbs = (const struct hda_verb[]) {
1313 /* change to EAPD mode */
1314 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1315 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1316 {}
1317 },
1318 },
b9368f5c 1319 [ALC880_FIXUP_TCL_S700] = {
1727a771 1320 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1321 .v.verbs = (const struct hda_verb[]) {
1322 /* change to EAPD mode */
1323 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1324 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1325 {}
1326 },
1327 .chained = true,
1328 .chain_id = ALC880_FIXUP_GPIO2,
1329 },
cf5a2279 1330 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1331 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1332 .v.func = alc880_fixup_vol_knob,
1333 },
1334 [ALC880_FIXUP_FUJITSU] = {
1335 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1336 .type = HDA_FIXUP_PINS,
1337 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1338 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1339 { 0x15, 0x99030120 }, /* speaker */
1340 { 0x16, 0x99030130 }, /* bass speaker */
1341 { 0x17, 0x411111f0 }, /* N/A */
1342 { 0x18, 0x411111f0 }, /* N/A */
1343 { 0x19, 0x01a19950 }, /* mic-in */
1344 { 0x1a, 0x411111f0 }, /* N/A */
1345 { 0x1b, 0x411111f0 }, /* N/A */
1346 { 0x1c, 0x411111f0 }, /* N/A */
1347 { 0x1d, 0x411111f0 }, /* N/A */
1348 { 0x1e, 0x01454140 }, /* SPDIF out */
1349 { }
1350 },
1351 .chained = true,
1352 .chain_id = ALC880_FIXUP_VOL_KNOB,
1353 },
ba533818
TI
1354 [ALC880_FIXUP_F1734] = {
1355 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1356 .type = HDA_FIXUP_PINS,
1357 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1358 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1359 { 0x15, 0x99030120 }, /* speaker */
1360 { 0x16, 0x411111f0 }, /* N/A */
1361 { 0x17, 0x411111f0 }, /* N/A */
1362 { 0x18, 0x411111f0 }, /* N/A */
1363 { 0x19, 0x01a19950 }, /* mic-in */
1364 { 0x1a, 0x411111f0 }, /* N/A */
1365 { 0x1b, 0x411111f0 }, /* N/A */
1366 { 0x1c, 0x411111f0 }, /* N/A */
1367 { 0x1d, 0x411111f0 }, /* N/A */
1368 { 0x1e, 0x411111f0 }, /* N/A */
1369 { }
1370 },
1371 .chained = true,
1372 .chain_id = ALC880_FIXUP_VOL_KNOB,
1373 },
817de92f
TI
1374 [ALC880_FIXUP_UNIWILL] = {
1375 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1376 .type = HDA_FIXUP_PINS,
1377 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1378 { 0x14, 0x0121411f }, /* HP */
1379 { 0x15, 0x99030120 }, /* speaker */
1380 { 0x16, 0x99030130 }, /* bass speaker */
1381 { }
1382 },
1383 },
967b88c4 1384 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1385 .type = HDA_FIXUP_PINS,
1386 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1387 /* disable bogus unused pins */
1388 { 0x17, 0x411111f0 },
1389 { 0x19, 0x411111f0 },
1390 { 0x1b, 0x411111f0 },
1391 { 0x1f, 0x411111f0 },
1392 { }
1393 }
1394 },
96e225f6 1395 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1396 .type = HDA_FIXUP_PINS,
1397 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1398 /* set up the whole pins as BIOS is utterly broken */
1399 { 0x14, 0x99030120 }, /* speaker */
1400 { 0x15, 0x0121411f }, /* HP */
1401 { 0x16, 0x411111f0 }, /* N/A */
1402 { 0x17, 0x411111f0 }, /* N/A */
1403 { 0x18, 0x01a19950 }, /* mic-in */
1404 { 0x19, 0x411111f0 }, /* N/A */
1405 { 0x1a, 0x01813031 }, /* line-in */
1406 { 0x1b, 0x411111f0 }, /* N/A */
1407 { 0x1c, 0x411111f0 }, /* N/A */
1408 { 0x1d, 0x411111f0 }, /* N/A */
1409 { 0x1e, 0x0144111e }, /* SPDIF */
1410 { }
1411 }
1412 },
487a588d
TI
1413 [ALC880_FIXUP_ASUS_W5A] = {
1414 .type = HDA_FIXUP_PINS,
1415 .v.pins = (const struct hda_pintbl[]) {
1416 /* set up the whole pins as BIOS is utterly broken */
1417 { 0x14, 0x0121411f }, /* HP */
1418 { 0x15, 0x411111f0 }, /* N/A */
1419 { 0x16, 0x411111f0 }, /* N/A */
1420 { 0x17, 0x411111f0 }, /* N/A */
1421 { 0x18, 0x90a60160 }, /* mic */
1422 { 0x19, 0x411111f0 }, /* N/A */
1423 { 0x1a, 0x411111f0 }, /* N/A */
1424 { 0x1b, 0x411111f0 }, /* N/A */
1425 { 0x1c, 0x411111f0 }, /* N/A */
1426 { 0x1d, 0x411111f0 }, /* N/A */
1427 { 0x1e, 0xb743111e }, /* SPDIF out */
1428 { }
1429 },
1430 .chained = true,
1431 .chain_id = ALC880_FIXUP_GPIO1,
1432 },
67b6ec31 1433 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1434 .type = HDA_FIXUP_PINS,
1435 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1436 { 0x14, 0x01014010 }, /* line-out */
1437 { 0x15, 0x411111f0 }, /* N/A */
1438 { 0x16, 0x411111f0 }, /* N/A */
1439 { 0x17, 0x411111f0 }, /* N/A */
1440 { 0x18, 0x01a19c30 }, /* mic-in */
1441 { 0x19, 0x0121411f }, /* HP */
1442 { 0x1a, 0x01813031 }, /* line-in */
1443 { 0x1b, 0x02a19c40 }, /* front-mic */
1444 { 0x1c, 0x411111f0 }, /* N/A */
1445 { 0x1d, 0x411111f0 }, /* N/A */
1446 /* 0x1e is filled in below */
1447 { 0x1f, 0x411111f0 }, /* N/A */
1448 { }
1449 }
1450 },
1451 [ALC880_FIXUP_3ST] = {
1727a771
TI
1452 .type = HDA_FIXUP_PINS,
1453 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1454 { 0x1e, 0x411111f0 }, /* N/A */
1455 { }
1456 },
1457 .chained = true,
1458 .chain_id = ALC880_FIXUP_3ST_BASE,
1459 },
1460 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1461 .type = HDA_FIXUP_PINS,
1462 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1463 { 0x1e, 0x0144111e }, /* SPDIF */
1464 { }
1465 },
1466 .chained = true,
1467 .chain_id = ALC880_FIXUP_3ST_BASE,
1468 },
1469 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1470 .type = HDA_FIXUP_PINS,
1471 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1472 { 0x14, 0x01014010 }, /* front */
1473 { 0x15, 0x411111f0 }, /* N/A */
1474 { 0x16, 0x01011411 }, /* CLFE */
1475 { 0x17, 0x01016412 }, /* surr */
1476 { 0x18, 0x01a19c30 }, /* mic-in */
1477 { 0x19, 0x0121411f }, /* HP */
1478 { 0x1a, 0x01813031 }, /* line-in */
1479 { 0x1b, 0x02a19c40 }, /* front-mic */
1480 { 0x1c, 0x411111f0 }, /* N/A */
1481 { 0x1d, 0x411111f0 }, /* N/A */
1482 /* 0x1e is filled in below */
1483 { 0x1f, 0x411111f0 }, /* N/A */
1484 { }
1485 }
1486 },
1487 [ALC880_FIXUP_5ST] = {
1727a771
TI
1488 .type = HDA_FIXUP_PINS,
1489 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1490 { 0x1e, 0x411111f0 }, /* N/A */
1491 { }
1492 },
1493 .chained = true,
1494 .chain_id = ALC880_FIXUP_5ST_BASE,
1495 },
1496 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1497 .type = HDA_FIXUP_PINS,
1498 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1499 { 0x1e, 0x0144111e }, /* SPDIF */
1500 { }
1501 },
1502 .chained = true,
1503 .chain_id = ALC880_FIXUP_5ST_BASE,
1504 },
1505 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1506 .type = HDA_FIXUP_PINS,
1507 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1508 { 0x14, 0x01014010 }, /* front */
1509 { 0x15, 0x01016412 }, /* surr */
1510 { 0x16, 0x01011411 }, /* CLFE */
1511 { 0x17, 0x01012414 }, /* side */
1512 { 0x18, 0x01a19c30 }, /* mic-in */
1513 { 0x19, 0x02a19c40 }, /* front-mic */
1514 { 0x1a, 0x01813031 }, /* line-in */
1515 { 0x1b, 0x0121411f }, /* HP */
1516 { 0x1c, 0x411111f0 }, /* N/A */
1517 { 0x1d, 0x411111f0 }, /* N/A */
1518 /* 0x1e is filled in below */
1519 { 0x1f, 0x411111f0 }, /* N/A */
1520 { }
1521 }
1522 },
1523 [ALC880_FIXUP_6ST] = {
1727a771
TI
1524 .type = HDA_FIXUP_PINS,
1525 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1526 { 0x1e, 0x411111f0 }, /* N/A */
1527 { }
1528 },
1529 .chained = true,
1530 .chain_id = ALC880_FIXUP_6ST_BASE,
1531 },
1532 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1533 .type = HDA_FIXUP_PINS,
1534 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1535 { 0x1e, 0x0144111e }, /* SPDIF */
1536 { }
1537 },
1538 .chained = true,
1539 .chain_id = ALC880_FIXUP_6ST_BASE,
1540 },
5397145f
TI
1541 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1542 .type = HDA_FIXUP_PINS,
1543 .v.pins = (const struct hda_pintbl[]) {
1544 { 0x1b, 0x0121401f }, /* HP with jack detect */
1545 { }
1546 },
1547 .chained_before = true,
1548 .chain_id = ALC880_FIXUP_6ST_BASE,
1549 },
ee3b2969
TI
1550};
1551
1552static const struct snd_pci_quirk alc880_fixup_tbl[] = {
f02aab5d 1553 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1554 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1555 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1556 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1557 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1558 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1559 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1560 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1561 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1562 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1563 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1564 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1565 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1566 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1567 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1568 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1569 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1570 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1571 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1572 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1573 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1574 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1575 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1576
1577 /* Below is the copied entries from alc880_quirks.c.
1578 * It's not quite sure whether BIOS sets the correct pin-config table
1579 * on these machines, thus they are kept to be compatible with
1580 * the old static quirks. Once when it's confirmed to work without
1581 * these overrides, it'd be better to remove.
1582 */
1583 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1584 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1585 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1586 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1587 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1588 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1589 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1590 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1591 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1592 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1593 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1594 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1595 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1596 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1597 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1598 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1599 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1600 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1601 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1602 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1603 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1604 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1605 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1608 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1609 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1610 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1611 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1612 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1613 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1615 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1616 /* default Intel */
1617 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1618 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1619 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1620 {}
1621};
1622
1727a771 1623static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1624 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1625 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1626 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1627 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1628 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1629 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1630 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1631 {}
1632};
1633
1634
1d045db9
TI
1635/*
1636 * OK, here we have finally the patch for ALC880
1637 */
1d045db9 1638static int patch_alc880(struct hda_codec *codec)
60db6b53 1639{
1d045db9 1640 struct alc_spec *spec;
1d045db9 1641 int err;
f6a92248 1642
3de95173
TI
1643 err = alc_alloc_spec(codec, 0x0b);
1644 if (err < 0)
1645 return err;
64154835 1646
3de95173 1647 spec = codec->spec;
08c189f2 1648 spec->gen.need_dac_fix = 1;
7504b6cd 1649 spec->gen.beep_nid = 0x01;
f53281e6 1650
225068ab
TI
1651 codec->patch_ops.unsol_event = alc880_unsol_event;
1652
c9af753f
TI
1653 alc_pre_init(codec);
1654
1727a771 1655 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1656 alc880_fixups);
1727a771 1657 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1658
67b6ec31
TI
1659 /* automatic parse from the BIOS config */
1660 err = alc880_parse_auto_config(codec);
1661 if (err < 0)
1662 goto error;
fe3eb0a7 1663
fea80fae
TI
1664 if (!spec->gen.no_analog) {
1665 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1666 if (err < 0)
1667 goto error;
1668 }
f53281e6 1669
1727a771 1670 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1671
1d045db9 1672 return 0;
e16fb6d1
TI
1673
1674 error:
1675 alc_free(codec);
1676 return err;
226b1ec8
KY
1677}
1678
1d045db9 1679
60db6b53 1680/*
1d045db9 1681 * ALC260 support
60db6b53 1682 */
1d045db9 1683static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1684{
1d045db9 1685 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1686 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1687 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1688}
1689
1d045db9
TI
1690/*
1691 * Pin config fixes
1692 */
1693enum {
ca8f0424
TI
1694 ALC260_FIXUP_HP_DC5750,
1695 ALC260_FIXUP_HP_PIN_0F,
1696 ALC260_FIXUP_COEF,
15317ab2 1697 ALC260_FIXUP_GPIO1,
20f7d928
TI
1698 ALC260_FIXUP_GPIO1_TOGGLE,
1699 ALC260_FIXUP_REPLACER,
0a1c4fa2 1700 ALC260_FIXUP_HP_B1900,
118cb4a4 1701 ALC260_FIXUP_KN1,
39aedee7 1702 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1703 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1704 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1705};
1706
20f7d928
TI
1707static void alc260_gpio1_automute(struct hda_codec *codec)
1708{
1709 struct alc_spec *spec = codec->spec;
aaf312de
TI
1710
1711 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1712}
1713
1714static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1715 const struct hda_fixup *fix, int action)
20f7d928
TI
1716{
1717 struct alc_spec *spec = codec->spec;
1727a771 1718 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1719 /* although the machine has only one output pin, we need to
1720 * toggle GPIO1 according to the jack state
1721 */
08c189f2
TI
1722 spec->gen.automute_hook = alc260_gpio1_automute;
1723 spec->gen.detect_hp = 1;
1724 spec->gen.automute_speaker = 1;
1725 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1726 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1727 snd_hda_gen_hp_automute);
5579cd6f 1728 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1729 }
1730}
1731
118cb4a4 1732static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1733 const struct hda_fixup *fix, int action)
118cb4a4
TI
1734{
1735 struct alc_spec *spec = codec->spec;
1727a771 1736 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1737 { 0x0f, 0x02214000 }, /* HP/speaker */
1738 { 0x12, 0x90a60160 }, /* int mic */
1739 { 0x13, 0x02a19000 }, /* ext mic */
1740 { 0x18, 0x01446000 }, /* SPDIF out */
1741 /* disable bogus I/O pins */
1742 { 0x10, 0x411111f0 },
1743 { 0x11, 0x411111f0 },
1744 { 0x14, 0x411111f0 },
1745 { 0x15, 0x411111f0 },
1746 { 0x16, 0x411111f0 },
1747 { 0x17, 0x411111f0 },
1748 { 0x19, 0x411111f0 },
1749 { }
1750 };
1751
1752 switch (action) {
1727a771
TI
1753 case HDA_FIXUP_ACT_PRE_PROBE:
1754 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1755 spec->init_amp = ALC_INIT_NONE;
1756 break;
1757 }
1758}
1759
39aedee7
TI
1760static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1761 const struct hda_fixup *fix, int action)
1762{
1763 struct alc_spec *spec = codec->spec;
1c76aa5f 1764 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1765 spec->init_amp = ALC_INIT_NONE;
1766}
39aedee7 1767
5ebd3bbd
TI
1768static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1769 const struct hda_fixup *fix, int action)
1770{
1771 struct alc_spec *spec = codec->spec;
1772 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1773 spec->gen.add_jack_modes = 1;
5ebd3bbd 1774 spec->gen.hp_mic = 1;
e6e0ee50 1775 }
39aedee7
TI
1776}
1777
1727a771 1778static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1779 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1780 .type = HDA_FIXUP_PINS,
1781 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1782 { 0x11, 0x90130110 }, /* speaker */
1783 { }
1784 }
1785 },
ca8f0424 1786 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1787 .type = HDA_FIXUP_PINS,
1788 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1789 { 0x0f, 0x01214000 }, /* HP */
1790 { }
1791 }
1792 },
1793 [ALC260_FIXUP_COEF] = {
1727a771 1794 .type = HDA_FIXUP_VERBS,
ca8f0424 1795 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1796 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1797 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1798 { }
1799 },
ca8f0424 1800 },
15317ab2 1801 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1802 .type = HDA_FIXUP_FUNC,
1803 .v.func = alc_fixup_gpio1,
15317ab2 1804 },
20f7d928 1805 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1806 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1807 .v.func = alc260_fixup_gpio1_toggle,
1808 .chained = true,
1809 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1810 },
1811 [ALC260_FIXUP_REPLACER] = {
1727a771 1812 .type = HDA_FIXUP_VERBS,
20f7d928 1813 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1814 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1815 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1816 { }
1817 },
1818 .chained = true,
1819 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1820 },
0a1c4fa2 1821 [ALC260_FIXUP_HP_B1900] = {
1727a771 1822 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1823 .v.func = alc260_fixup_gpio1_toggle,
1824 .chained = true,
1825 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1826 },
1827 [ALC260_FIXUP_KN1] = {
1727a771 1828 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1829 .v.func = alc260_fixup_kn1,
1830 },
39aedee7
TI
1831 [ALC260_FIXUP_FSC_S7020] = {
1832 .type = HDA_FIXUP_FUNC,
1833 .v.func = alc260_fixup_fsc_s7020,
1834 },
5ebd3bbd
TI
1835 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1836 .type = HDA_FIXUP_FUNC,
1837 .v.func = alc260_fixup_fsc_s7020_jwse,
1838 .chained = true,
1839 .chain_id = ALC260_FIXUP_FSC_S7020,
1840 },
d08c5ef2
TI
1841 [ALC260_FIXUP_VAIO_PINS] = {
1842 .type = HDA_FIXUP_PINS,
1843 .v.pins = (const struct hda_pintbl[]) {
1844 /* Pin configs are missing completely on some VAIOs */
1845 { 0x0f, 0x01211020 },
1846 { 0x10, 0x0001003f },
1847 { 0x11, 0x411111f0 },
1848 { 0x12, 0x01a15930 },
1849 { 0x13, 0x411111f0 },
1850 { 0x14, 0x411111f0 },
1851 { 0x15, 0x411111f0 },
1852 { 0x16, 0x411111f0 },
1853 { 0x17, 0x411111f0 },
1854 { 0x18, 0x411111f0 },
1855 { 0x19, 0x411111f0 },
1856 { }
1857 }
1858 },
1d045db9
TI
1859};
1860
1861static const struct snd_pci_quirk alc260_fixup_tbl[] = {
15317ab2 1862 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1863 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1864 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1865 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1866 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1867 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1868 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1869 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1870 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1871 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1872 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1873 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1874 {}
1875};
1876
5ebd3bbd
TI
1877static const struct hda_model_fixup alc260_fixup_models[] = {
1878 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1879 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1880 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1881 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1882 {}
1883};
1884
1d045db9
TI
1885/*
1886 */
1d045db9 1887static int patch_alc260(struct hda_codec *codec)
977ddd6b 1888{
1d045db9 1889 struct alc_spec *spec;
c3c2c9e7 1890 int err;
1d045db9 1891
3de95173
TI
1892 err = alc_alloc_spec(codec, 0x07);
1893 if (err < 0)
1894 return err;
1d045db9 1895
3de95173 1896 spec = codec->spec;
ea46c3c8
TI
1897 /* as quite a few machines require HP amp for speaker outputs,
1898 * it's easier to enable it unconditionally; even if it's unneeded,
1899 * it's almost harmless.
1900 */
1901 spec->gen.prefer_hp_amp = 1;
7504b6cd 1902 spec->gen.beep_nid = 0x01;
1d045db9 1903
225068ab
TI
1904 spec->shutup = alc_eapd_shutup;
1905
c9af753f
TI
1906 alc_pre_init(codec);
1907
5ebd3bbd
TI
1908 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1909 alc260_fixups);
1727a771 1910 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1911
c3c2c9e7
TI
1912 /* automatic parse from the BIOS config */
1913 err = alc260_parse_auto_config(codec);
1914 if (err < 0)
1915 goto error;
977ddd6b 1916
fea80fae
TI
1917 if (!spec->gen.no_analog) {
1918 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1919 if (err < 0)
1920 goto error;
1921 }
977ddd6b 1922
1727a771 1923 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1924
1d045db9 1925 return 0;
e16fb6d1
TI
1926
1927 error:
1928 alc_free(codec);
1929 return err;
6981d184
TI
1930}
1931
1d045db9
TI
1932
1933/*
1934 * ALC882/883/885/888/889 support
1935 *
1936 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1937 * configuration. Each pin widget can choose any input DACs and a mixer.
1938 * Each ADC is connected from a mixer of all inputs. This makes possible
1939 * 6-channel independent captures.
1940 *
1941 * In addition, an independent DAC for the multi-playback (not used in this
1942 * driver yet).
1943 */
1d045db9
TI
1944
1945/*
1946 * Pin config fixes
1947 */
ff818c24 1948enum {
5c0ebfbe
TI
1949 ALC882_FIXUP_ABIT_AW9D_MAX,
1950 ALC882_FIXUP_LENOVO_Y530,
1951 ALC882_FIXUP_PB_M5210,
1952 ALC882_FIXUP_ACER_ASPIRE_7736,
1953 ALC882_FIXUP_ASUS_W90V,
8f239214 1954 ALC889_FIXUP_CD,
b2c53e20 1955 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1956 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1957 ALC888_FIXUP_EEE1601,
4841b8e6 1958 ALC886_FIXUP_EAPD,
177943a3 1959 ALC882_FIXUP_EAPD,
7a6069bf 1960 ALC883_FIXUP_EAPD,
8812c4f9 1961 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1962 ALC882_FIXUP_GPIO1,
1963 ALC882_FIXUP_GPIO2,
eb844d51 1964 ALC882_FIXUP_GPIO3,
68ef0561
TI
1965 ALC889_FIXUP_COEF,
1966 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1967 ALC882_FIXUP_ACER_ASPIRE_4930G,
1968 ALC882_FIXUP_ACER_ASPIRE_8930G,
1969 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1970 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1971 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1972 ALC889_FIXUP_MBP_VREF,
1973 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1974 ALC889_FIXUP_MBA11_VREF,
0756f09c 1975 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1976 ALC889_FIXUP_MP11_VREF,
9f660a1c 1977 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1978 ALC882_FIXUP_INV_DMIC,
e427c237 1979 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1980 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 1981 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 1982 ALC1220_FIXUP_GB_DUAL_CODECS,
c1933008 1983 ALC1220_FIXUP_GB_X570,
0202f5cd 1984 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
1985 ALC1220_FIXUP_CLEVO_PB51ED,
1986 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
1987 ALC887_FIXUP_ASUS_AUDIO,
1988 ALC887_FIXUP_ASUS_HMIC,
9bfa7b36 1989 ALCS1200A_FIXUP_MIC_VREF,
baaacbff 1990 ALC888VD_FIXUP_MIC_100VREF,
ff818c24
TI
1991};
1992
68ef0561 1993static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 1994 const struct hda_fixup *fix, int action)
68ef0561 1995{
1727a771 1996 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 1997 return;
1df8874b 1998 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
1999}
2000
5671087f
TI
2001/* set up GPIO at initialization */
2002static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 2003 const struct hda_fixup *fix, int action)
5671087f 2004{
215c850c
TI
2005 struct alc_spec *spec = codec->spec;
2006
2007 spec->gpio_write_delay = true;
2008 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
2009}
2010
02a237b2
TI
2011/* Fix the connection of some pins for ALC889:
2012 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2013 * work correctly (bko#42740)
2014 */
2015static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 2016 const struct hda_fixup *fix, int action)
02a237b2 2017{
1727a771 2018 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2019 /* fake the connections during parsing the tree */
caf3c043
MM
2020 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2021 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2022 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2023 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2024 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2025 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2026 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2027 /* restore the connections */
caf3c043
MM
2028 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2029 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2030 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2031 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2032 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2033 }
2034}
2035
1a97b7f2
TI
2036/* Set VREF on HP pin */
2037static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2038 const struct hda_fixup *fix, int action)
1a97b7f2 2039{
caf3c043 2040 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2041 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2042 int i;
2043
1727a771 2044 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2045 return;
2046 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2047 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2048 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2049 continue;
d3f02d60 2050 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2051 val |= AC_PINCTL_VREF_80;
cdd03ced 2052 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2053 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2054 break;
2055 }
2056}
2057
0756f09c
TI
2058static void alc889_fixup_mac_pins(struct hda_codec *codec,
2059 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2060{
2061 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2062 int i;
2063
0756f09c 2064 for (i = 0; i < num_nids; i++) {
1a97b7f2 2065 unsigned int val;
d3f02d60 2066 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2067 val |= AC_PINCTL_VREF_50;
cdd03ced 2068 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2069 }
08c189f2 2070 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2071}
2072
0756f09c
TI
2073/* Set VREF on speaker pins on imac91 */
2074static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2075 const struct hda_fixup *fix, int action)
2076{
caf3c043 2077 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2078
2079 if (action == HDA_FIXUP_ACT_INIT)
2080 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2081}
2082
e7729a41
AV
2083/* Set VREF on speaker pins on mba11 */
2084static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2085 const struct hda_fixup *fix, int action)
2086{
caf3c043 2087 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2088
2089 if (action == HDA_FIXUP_ACT_INIT)
2090 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2091}
2092
0756f09c
TI
2093/* Set VREF on speaker pins on mba21 */
2094static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2095 const struct hda_fixup *fix, int action)
2096{
caf3c043 2097 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2098
2099 if (action == HDA_FIXUP_ACT_INIT)
2100 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2101}
2102
e427c237 2103/* Don't take HP output as primary
d9111496
FLVC
2104 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2105 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2106 */
2107static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2108 const struct hda_fixup *fix, int action)
e427c237
TI
2109{
2110 struct alc_spec *spec = codec->spec;
da96fb5b 2111 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2112 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2113 spec->gen.no_multi_io = 1;
2114 }
e427c237
TI
2115}
2116
eb9ca3ab
TI
2117static void alc_fixup_bass_chmap(struct hda_codec *codec,
2118 const struct hda_fixup *fix, int action);
2119
7beb3a6e
TI
2120/* For dual-codec configuration, we need to disable some features to avoid
2121 * conflicts of kctls and PCM streams
2122 */
2123static void alc_fixup_dual_codecs(struct hda_codec *codec,
2124 const struct hda_fixup *fix, int action)
2125{
2126 struct alc_spec *spec = codec->spec;
2127
2128 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2129 return;
2130 /* disable vmaster */
2131 spec->gen.suppress_vmaster = 1;
2132 /* auto-mute and auto-mic switch don't work with multiple codecs */
2133 spec->gen.suppress_auto_mute = 1;
2134 spec->gen.suppress_auto_mic = 1;
2135 /* disable aamix as well */
2136 spec->gen.mixer_nid = 0;
2137 /* add location prefix to avoid conflicts */
2138 codec->force_pin_prefix = 1;
2139}
2140
2141static void rename_ctl(struct hda_codec *codec, const char *oldname,
2142 const char *newname)
2143{
2144 struct snd_kcontrol *kctl;
2145
2146 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2147 if (kctl)
b51c2253 2148 snd_ctl_rename(codec->card, kctl, newname);
7beb3a6e
TI
2149}
2150
2151static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2152 const struct hda_fixup *fix,
2153 int action)
2154{
2155 alc_fixup_dual_codecs(codec, fix, action);
2156 switch (action) {
2157 case HDA_FIXUP_ACT_PRE_PROBE:
2158 /* override card longname to provide a unique UCM profile */
2159 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2160 break;
2161 case HDA_FIXUP_ACT_BUILD:
2162 /* rename Capture controls depending on the codec */
2163 rename_ctl(codec, "Capture Volume",
2164 codec->addr == 0 ?
2165 "Rear-Panel Capture Volume" :
2166 "Front-Panel Capture Volume");
2167 rename_ctl(codec, "Capture Switch",
2168 codec->addr == 0 ?
2169 "Rear-Panel Capture Switch" :
2170 "Front-Panel Capture Switch");
2171 break;
2172 }
2173}
2174
c1933008
CL
2175static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2176 const struct hda_fixup *fix,
2177 int action)
2178{
2179 static const hda_nid_t conn1[] = { 0x0c };
2180 static const struct coef_fw gb_x570_coefs[] = {
41a86013 2181 WRITE_COEF(0x07, 0x03c0),
c1933008
CL
2182 WRITE_COEF(0x1a, 0x01c1),
2183 WRITE_COEF(0x1b, 0x0202),
2184 WRITE_COEF(0x43, 0x3005),
2185 {}
2186 };
2187
2188 switch (action) {
2189 case HDA_FIXUP_ACT_PRE_PROBE:
2190 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2191 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2192 break;
2193 case HDA_FIXUP_ACT_INIT:
2194 alc_process_coef_fw(codec, gb_x570_coefs);
2195 break;
2196 }
2197}
2198
0202f5cd
P
2199static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2200 const struct hda_fixup *fix,
2201 int action)
2202{
caf3c043 2203 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2204
2205 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2206 return;
2207
2208 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2209 /* We therefore want to make sure 0x14 (front headphone) and
2210 * 0x1b (speakers) use the stereo DAC 0x02
2211 */
caf3c043
MM
2212 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2213 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2214}
2215
7f665b1c
JS
2216static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2217 const struct hda_fixup *fix, int action);
2218
80690a27 2219static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2220 const struct hda_fixup *fix,
2221 int action)
2222{
2223 alc1220_fixup_clevo_p950(codec, fix, action);
2224 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2225}
2226
ca184355
JHP
2227static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2228 struct hda_jack_callback *jack)
2229{
2230 struct alc_spec *spec = codec->spec;
2231 unsigned int vref;
2232
2233 snd_hda_gen_hp_automute(codec, jack);
2234
2235 if (spec->gen.hp_jack_present)
2236 vref = AC_PINCTL_VREF_80;
2237 else
2238 vref = AC_PINCTL_VREF_HIZ;
2239 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2240}
2241
2242static void alc887_fixup_asus_jack(struct hda_codec *codec,
2243 const struct hda_fixup *fix, int action)
2244{
2245 struct alc_spec *spec = codec->spec;
2246 if (action != HDA_FIXUP_ACT_PROBE)
2247 return;
2248 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2249 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2250}
2251
1727a771 2252static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2253 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2254 .type = HDA_FIXUP_PINS,
2255 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2256 { 0x15, 0x01080104 }, /* side */
2257 { 0x16, 0x01011012 }, /* rear */
2258 { 0x17, 0x01016011 }, /* clfe */
2785591a 2259 { }
145a902b
DH
2260 }
2261 },
5c0ebfbe 2262 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2263 .type = HDA_FIXUP_PINS,
2264 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2265 { 0x15, 0x99130112 }, /* rear int speakers */
2266 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2267 { }
2268 }
2269 },
5c0ebfbe 2270 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2271 .type = HDA_FIXUP_PINCTLS,
2272 .v.pins = (const struct hda_pintbl[]) {
2273 { 0x19, PIN_VREF50 },
357f915e
KY
2274 {}
2275 }
2276 },
5c0ebfbe 2277 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2278 .type = HDA_FIXUP_FUNC,
23d30f28 2279 .v.func = alc_fixup_sku_ignore,
6981d184 2280 },
5c0ebfbe 2281 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2282 .type = HDA_FIXUP_PINS,
2283 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2284 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2285 { }
2286 }
2287 },
8f239214 2288 [ALC889_FIXUP_CD] = {
1727a771
TI
2289 .type = HDA_FIXUP_PINS,
2290 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2291 { 0x1c, 0x993301f0 }, /* CD */
2292 { }
2293 }
2294 },
b2c53e20
DH
2295 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2296 .type = HDA_FIXUP_PINS,
2297 .v.pins = (const struct hda_pintbl[]) {
2298 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2299 { }
2300 },
2301 .chained = true,
2302 .chain_id = ALC889_FIXUP_CD,
2303 },
5c0ebfbe 2304 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2305 .type = HDA_FIXUP_PINS,
2306 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2307 { 0x17, 0x90170111 }, /* hidden surround speaker */
2308 { }
2309 }
2310 },
0e7cc2e7 2311 [ALC888_FIXUP_EEE1601] = {
1727a771 2312 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2313 .v.verbs = (const struct hda_verb[]) {
2314 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2315 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2316 { }
2317 }
177943a3 2318 },
4841b8e6
PH
2319 [ALC886_FIXUP_EAPD] = {
2320 .type = HDA_FIXUP_VERBS,
2321 .v.verbs = (const struct hda_verb[]) {
2322 /* change to EAPD mode */
2323 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2324 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2325 { }
2326 }
2327 },
177943a3 2328 [ALC882_FIXUP_EAPD] = {
1727a771 2329 .type = HDA_FIXUP_VERBS,
177943a3
TI
2330 .v.verbs = (const struct hda_verb[]) {
2331 /* change to EAPD mode */
2332 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2333 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2334 { }
2335 }
2336 },
7a6069bf 2337 [ALC883_FIXUP_EAPD] = {
1727a771 2338 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2339 .v.verbs = (const struct hda_verb[]) {
2340 /* change to EAPD mode */
2341 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2342 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2343 { }
2344 }
2345 },
8812c4f9 2346 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2347 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2348 .v.verbs = (const struct hda_verb[]) {
2349 /* eanable EAPD on Acer laptops */
2350 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2351 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2352 { }
2353 }
2354 },
1a97b7f2 2355 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2356 .type = HDA_FIXUP_FUNC,
2357 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2358 },
2359 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2360 .type = HDA_FIXUP_FUNC,
2361 .v.func = alc_fixup_gpio2,
1a97b7f2 2362 },
eb844d51 2363 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2364 .type = HDA_FIXUP_FUNC,
2365 .v.func = alc_fixup_gpio3,
eb844d51 2366 },
68ef0561 2367 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2368 .type = HDA_FIXUP_FUNC,
2369 .v.func = alc_fixup_gpio1,
68ef0561
TI
2370 .chained = true,
2371 .chain_id = ALC882_FIXUP_EAPD,
2372 },
2373 [ALC889_FIXUP_COEF] = {
1727a771 2374 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2375 .v.func = alc889_fixup_coef,
2376 },
c3e837bb 2377 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2378 .type = HDA_FIXUP_PINS,
2379 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2380 { 0x16, 0x99130111 }, /* CLFE speaker */
2381 { 0x17, 0x99130112 }, /* surround speaker */
2382 { }
038d4fef
TI
2383 },
2384 .chained = true,
2385 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2386 },
2387 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2388 .type = HDA_FIXUP_PINS,
2389 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2390 { 0x16, 0x99130111 }, /* CLFE speaker */
2391 { 0x1b, 0x99130112 }, /* surround speaker */
2392 { }
2393 },
2394 .chained = true,
2395 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2396 },
2397 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2398 /* additional init verbs for Acer Aspire 8930G */
1727a771 2399 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2400 .v.verbs = (const struct hda_verb[]) {
2401 /* Enable all DACs */
2402 /* DAC DISABLE/MUTE 1? */
2403 /* setting bits 1-5 disables DAC nids 0x02-0x06
2404 * apparently. Init=0x38 */
2405 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2406 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2407 /* DAC DISABLE/MUTE 2? */
2408 /* some bit here disables the other DACs.
2409 * Init=0x4900 */
2410 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2411 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2412 /* DMIC fix
2413 * This laptop has a stereo digital microphone.
2414 * The mics are only 1cm apart which makes the stereo
2415 * useless. However, either the mic or the ALC889
2416 * makes the signal become a difference/sum signal
2417 * instead of standard stereo, which is annoying.
2418 * So instead we flip this bit which makes the
2419 * codec replicate the sum signal to both channels,
2420 * turning it into a normal mono mic.
2421 */
2422 /* DMIC_CONTROL? Init value = 0x0001 */
2423 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2424 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2425 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2426 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2427 { }
038d4fef
TI
2428 },
2429 .chained = true,
2430 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2431 },
5671087f 2432 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2433 .type = HDA_FIXUP_FUNC,
5671087f
TI
2434 .v.func = alc885_fixup_macpro_gpio,
2435 },
02a237b2 2436 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2437 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2438 .v.func = alc889_fixup_dac_route,
2439 },
1a97b7f2 2440 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2441 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2442 .v.func = alc889_fixup_mbp_vref,
2443 .chained = true,
2444 .chain_id = ALC882_FIXUP_GPIO1,
2445 },
2446 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2447 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2448 .v.func = alc889_fixup_imac91_vref,
2449 .chained = true,
2450 .chain_id = ALC882_FIXUP_GPIO1,
2451 },
e7729a41
AV
2452 [ALC889_FIXUP_MBA11_VREF] = {
2453 .type = HDA_FIXUP_FUNC,
2454 .v.func = alc889_fixup_mba11_vref,
2455 .chained = true,
2456 .chain_id = ALC889_FIXUP_MBP_VREF,
2457 },
0756f09c
TI
2458 [ALC889_FIXUP_MBA21_VREF] = {
2459 .type = HDA_FIXUP_FUNC,
2460 .v.func = alc889_fixup_mba21_vref,
2461 .chained = true,
2462 .chain_id = ALC889_FIXUP_MBP_VREF,
2463 },
c20f31ec
TI
2464 [ALC889_FIXUP_MP11_VREF] = {
2465 .type = HDA_FIXUP_FUNC,
2466 .v.func = alc889_fixup_mba11_vref,
2467 .chained = true,
2468 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2469 },
9f660a1c
MK
2470 [ALC889_FIXUP_MP41_VREF] = {
2471 .type = HDA_FIXUP_FUNC,
2472 .v.func = alc889_fixup_mbp_vref,
2473 .chained = true,
2474 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2475 },
6e72aa5f 2476 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2477 .type = HDA_FIXUP_FUNC,
9d36a7dc 2478 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2479 },
e427c237 2480 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2481 .type = HDA_FIXUP_FUNC,
e427c237
TI
2482 .v.func = alc882_fixup_no_primary_hp,
2483 },
1f0bbf03
TI
2484 [ALC887_FIXUP_ASUS_BASS] = {
2485 .type = HDA_FIXUP_PINS,
2486 .v.pins = (const struct hda_pintbl[]) {
2487 {0x16, 0x99130130}, /* bass speaker */
2488 {}
2489 },
eb9ca3ab
TI
2490 .chained = true,
2491 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2492 },
2493 [ALC887_FIXUP_BASS_CHMAP] = {
2494 .type = HDA_FIXUP_FUNC,
2495 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2496 },
7beb3a6e
TI
2497 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2498 .type = HDA_FIXUP_FUNC,
2499 .v.func = alc1220_fixup_gb_dual_codecs,
2500 },
c1933008
CL
2501 [ALC1220_FIXUP_GB_X570] = {
2502 .type = HDA_FIXUP_FUNC,
2503 .v.func = alc1220_fixup_gb_x570,
2504 },
0202f5cd
P
2505 [ALC1220_FIXUP_CLEVO_P950] = {
2506 .type = HDA_FIXUP_FUNC,
2507 .v.func = alc1220_fixup_clevo_p950,
2508 },
80690a27 2509 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2510 .type = HDA_FIXUP_FUNC,
80690a27 2511 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2512 },
80690a27 2513 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2514 .type = HDA_FIXUP_PINS,
2515 .v.pins = (const struct hda_pintbl[]) {
2516 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2517 {}
2518 },
2519 .chained = true,
80690a27 2520 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2521 },
ca184355
JHP
2522 [ALC887_FIXUP_ASUS_AUDIO] = {
2523 .type = HDA_FIXUP_PINS,
2524 .v.pins = (const struct hda_pintbl[]) {
2525 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2526 { 0x19, 0x22219420 },
2527 {}
2528 },
2529 },
2530 [ALC887_FIXUP_ASUS_HMIC] = {
2531 .type = HDA_FIXUP_FUNC,
2532 .v.func = alc887_fixup_asus_jack,
2533 .chained = true,
2534 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2535 },
9bfa7b36
ML
2536 [ALCS1200A_FIXUP_MIC_VREF] = {
2537 .type = HDA_FIXUP_PINCTLS,
2538 .v.pins = (const struct hda_pintbl[]) {
2539 { 0x18, PIN_VREF50 }, /* rear mic */
2540 { 0x19, PIN_VREF50 }, /* front mic */
2541 {}
2542 }
2543 },
baaacbff
KY
2544 [ALC888VD_FIXUP_MIC_100VREF] = {
2545 .type = HDA_FIXUP_PINCTLS,
2546 .v.pins = (const struct hda_pintbl[]) {
2547 { 0x18, PIN_VREF100 }, /* headset mic */
2548 {}
2549 }
2550 },
ff818c24
TI
2551};
2552
1d045db9 2553static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2554 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2555 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2556 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2557 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2558 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2559 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2560 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2561 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2562 ALC882_FIXUP_ACER_ASPIRE_4930G),
2563 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2564 ALC882_FIXUP_ACER_ASPIRE_4930G),
2565 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2566 ALC882_FIXUP_ACER_ASPIRE_8930G),
2567 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2568 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2569 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2570 ALC882_FIXUP_ACER_ASPIRE_4930G),
2571 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2572 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2573 ALC882_FIXUP_ACER_ASPIRE_4930G),
2574 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2575 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2576 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2577 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2578 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2579 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2580 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2581 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2582 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2583 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2584 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2585 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2586 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2587 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
9bfa7b36 2588 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
b7529c18
TI
2589 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2590 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2591 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2592 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2593 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2594
2595 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2596 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2597 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2598 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2599 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2600 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2601 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2602 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2603 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2604 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2605 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2606 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2607 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2608 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2609 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2610 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2611 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2612 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2613 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2614 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2615 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2616 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2617 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2618
7a6069bf 2619 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
baaacbff 2620 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
4841b8e6 2621 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2622 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2623 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
c1933008 2624 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
ea354196 2625 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
41a86013 2626 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
a0b03952 2627 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2628 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2629 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2630 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2631 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2632 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2633 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2634 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2635 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2636 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2637 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
36d4d213 2638 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2639 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2640 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2641 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2642 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2643 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2644 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
9eb6f5c3 2645 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
b7a58228 2646 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2647 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2648 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2649 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
dbfe8350 2650 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
d4995121 2651 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2652 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2653 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2654 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2655 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2656 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2657 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2658 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2659 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2660 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2661 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2662 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2663 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2664 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2665 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2666 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
b7a58228 2667 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
7a6069bf
TI
2668 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2669 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2670 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2671 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2672 {}
2673};
2674
1727a771 2675static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2676 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2677 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2678 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2679 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2680 {.id = ALC889_FIXUP_CD, .name = "cd"},
2681 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2682 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2683 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2684 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2685 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2686 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2687 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2688 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2689 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2690 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2691 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2692 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2693 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2694 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2695 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2696 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2697 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2698 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2699 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2700 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2701 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2702 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2703 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2704 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2705 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
63394a16 2706 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2707 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2708 {}
2709};
2710
119b75c1
HW
2711static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2712 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2713 {0x14, 0x01014010},
2714 {0x15, 0x01011012},
2715 {0x16, 0x01016011},
2716 {0x18, 0x01a19040},
2717 {0x19, 0x02a19050},
2718 {0x1a, 0x0181304f},
2719 {0x1b, 0x0221401f},
2720 {0x1e, 0x01456130}),
2721 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2722 {0x14, 0x01015010},
2723 {0x15, 0x01011012},
2724 {0x16, 0x01011011},
2725 {0x18, 0x01a11040},
2726 {0x19, 0x02a19050},
2727 {0x1a, 0x0181104f},
2728 {0x1b, 0x0221401f},
2729 {0x1e, 0x01451130}),
2730 {}
2731};
2732
f6a92248 2733/*
1d045db9 2734 * BIOS auto configuration
f6a92248 2735 */
1d045db9
TI
2736/* almost identical with ALC880 parser... */
2737static int alc882_parse_auto_config(struct hda_codec *codec)
2738{
1d045db9 2739 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2740 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2741 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2742}
b896b4eb 2743
1d045db9
TI
2744/*
2745 */
1d045db9 2746static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2747{
2748 struct alc_spec *spec;
1a97b7f2 2749 int err;
f6a92248 2750
3de95173
TI
2751 err = alc_alloc_spec(codec, 0x0b);
2752 if (err < 0)
2753 return err;
f6a92248 2754
3de95173 2755 spec = codec->spec;
1f0f4b80 2756
7639a06c 2757 switch (codec->core.vendor_id) {
1d045db9
TI
2758 case 0x10ec0882:
2759 case 0x10ec0885:
acf08081 2760 case 0x10ec0900:
6d9ffcff 2761 case 0x10ec0b00:
a535ad57 2762 case 0x10ec1220:
1d045db9
TI
2763 break;
2764 default:
2765 /* ALC883 and variants */
2766 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2767 break;
c793bec5 2768 }
977ddd6b 2769
c9af753f
TI
2770 alc_pre_init(codec);
2771
1727a771 2772 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2773 alc882_fixups);
119b75c1 2774 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2775 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2776
1d045db9
TI
2777 alc_auto_parse_customize_define(codec);
2778
7504b6cd
TI
2779 if (has_cdefine_beep(codec))
2780 spec->gen.beep_nid = 0x01;
2781
1a97b7f2
TI
2782 /* automatic parse from the BIOS config */
2783 err = alc882_parse_auto_config(codec);
2784 if (err < 0)
2785 goto error;
f6a92248 2786
fea80fae
TI
2787 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2788 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2789 if (err < 0)
2790 goto error;
2791 }
f6a92248 2792
1727a771 2793 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2794
f6a92248 2795 return 0;
e16fb6d1
TI
2796
2797 error:
2798 alc_free(codec);
2799 return err;
f6a92248
KY
2800}
2801
df694daa 2802
df694daa 2803/*
1d045db9 2804 * ALC262 support
df694daa 2805 */
1d045db9 2806static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2807{
1d045db9 2808 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2809 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2810 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2811}
2812
df694daa 2813/*
1d045db9 2814 * Pin config fixes
df694daa 2815 */
cfc9b06f 2816enum {
ea4e7af1 2817 ALC262_FIXUP_FSC_H270,
7513e6da 2818 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2819 ALC262_FIXUP_HP_Z200,
2820 ALC262_FIXUP_TYAN,
c470150c 2821 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2822 ALC262_FIXUP_BENQ,
2823 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2824 ALC262_FIXUP_INV_DMIC,
b5c6611f 2825 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2826};
2827
1727a771 2828static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2829 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2830 .type = HDA_FIXUP_PINS,
2831 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2832 { 0x14, 0x99130110 }, /* speaker */
2833 { 0x15, 0x0221142f }, /* front HP */
2834 { 0x1b, 0x0121141f }, /* rear HP */
2835 { }
2836 }
2837 },
7513e6da
TI
2838 [ALC262_FIXUP_FSC_S7110] = {
2839 .type = HDA_FIXUP_PINS,
2840 .v.pins = (const struct hda_pintbl[]) {
2841 { 0x15, 0x90170110 }, /* speaker */
2842 { }
2843 },
2844 .chained = true,
2845 .chain_id = ALC262_FIXUP_BENQ,
2846 },
ea4e7af1 2847 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2848 .type = HDA_FIXUP_PINS,
2849 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2850 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2851 { }
2852 }
cfc9b06f 2853 },
ea4e7af1 2854 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2855 .type = HDA_FIXUP_PINS,
2856 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2857 { 0x14, 0x1993e1f0 }, /* int AUX */
2858 { }
2859 }
2860 },
c470150c 2861 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2862 .type = HDA_FIXUP_PINCTLS,
2863 .v.pins = (const struct hda_pintbl[]) {
2864 { 0x19, PIN_VREF50 },
b42590b8
TI
2865 {}
2866 },
2867 .chained = true,
2868 .chain_id = ALC262_FIXUP_BENQ,
2869 },
2870 [ALC262_FIXUP_BENQ] = {
1727a771 2871 .type = HDA_FIXUP_VERBS,
b42590b8 2872 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2873 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2874 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2875 {}
2876 }
2877 },
b42590b8 2878 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2879 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2880 .v.verbs = (const struct hda_verb[]) {
2881 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2882 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2883 {}
2884 }
2885 },
6e72aa5f 2886 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2887 .type = HDA_FIXUP_FUNC,
9d36a7dc 2888 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2889 },
b5c6611f
ML
2890 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2891 .type = HDA_FIXUP_FUNC,
2892 .v.func = alc_fixup_no_depop_delay,
2893 },
cfc9b06f
TI
2894};
2895
1d045db9 2896static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2897 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2898 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2899 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2900 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2901 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2902 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2903 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2904 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2905 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2906 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2907 {}
2908};
df694daa 2909
1727a771 2910static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2911 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2912 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2913 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2914 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2915 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2916 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2917 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2918 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2919 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2920 {}
2921};
1d045db9 2922
1d045db9
TI
2923/*
2924 */
1d045db9 2925static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2926{
2927 struct alc_spec *spec;
df694daa
KY
2928 int err;
2929
3de95173
TI
2930 err = alc_alloc_spec(codec, 0x0b);
2931 if (err < 0)
2932 return err;
df694daa 2933
3de95173 2934 spec = codec->spec;
08c189f2 2935 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2936
225068ab
TI
2937 spec->shutup = alc_eapd_shutup;
2938
1d045db9
TI
2939#if 0
2940 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2941 * under-run
2942 */
98b24883 2943 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2944#endif
1d045db9
TI
2945 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2946
c9af753f
TI
2947 alc_pre_init(codec);
2948
1727a771 2949 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2950 alc262_fixups);
1727a771 2951 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2952
af741c15
TI
2953 alc_auto_parse_customize_define(codec);
2954
7504b6cd
TI
2955 if (has_cdefine_beep(codec))
2956 spec->gen.beep_nid = 0x01;
2957
42399f7a
TI
2958 /* automatic parse from the BIOS config */
2959 err = alc262_parse_auto_config(codec);
2960 if (err < 0)
2961 goto error;
df694daa 2962
fea80fae
TI
2963 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2964 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2965 if (err < 0)
2966 goto error;
2967 }
2134ea4f 2968
1727a771 2969 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2970
1da177e4 2971 return 0;
e16fb6d1
TI
2972
2973 error:
2974 alc_free(codec);
2975 return err;
1da177e4
LT
2976}
2977
f32610ed 2978/*
1d045db9 2979 * ALC268
f32610ed 2980 */
1d045db9 2981/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2982static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2983 struct snd_ctl_elem_value *ucontrol)
2984{
2985 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2986 unsigned long pval;
2987 int err;
2988
2989 mutex_lock(&codec->control_mutex);
2990 pval = kcontrol->private_value;
2991 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2992 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2993 if (err >= 0) {
2994 kcontrol->private_value = (pval & ~0xff) | 0x10;
2995 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2996 }
2997 kcontrol->private_value = pval;
2998 mutex_unlock(&codec->control_mutex);
2999 return err;
3000}
f32610ed 3001
1d045db9
TI
3002static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3003 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
3004 {
3005 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3006 .name = "Beep Playback Switch",
3007 .subdevice = HDA_SUBDEV_AMP_FLAG,
3008 .info = snd_hda_mixer_amp_switch_info,
3009 .get = snd_hda_mixer_amp_switch_get,
3010 .put = alc268_beep_switch_put,
3011 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3012 },
f32610ed
JS
3013};
3014
1d045db9
TI
3015/* set PCBEEP vol = 0, mute connections */
3016static const struct hda_verb alc268_beep_init_verbs[] = {
3017 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3018 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3019 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3020 { }
f32610ed
JS
3021};
3022
6e72aa5f
TI
3023enum {
3024 ALC268_FIXUP_INV_DMIC,
cb766404 3025 ALC268_FIXUP_HP_EAPD,
24eff328 3026 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
3027};
3028
1727a771 3029static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 3030 [ALC268_FIXUP_INV_DMIC] = {
1727a771 3031 .type = HDA_FIXUP_FUNC,
9d36a7dc 3032 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3033 },
cb766404 3034 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3035 .type = HDA_FIXUP_VERBS,
cb766404
TI
3036 .v.verbs = (const struct hda_verb[]) {
3037 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3038 {}
3039 }
3040 },
24eff328
TI
3041 [ALC268_FIXUP_SPDIF] = {
3042 .type = HDA_FIXUP_PINS,
3043 .v.pins = (const struct hda_pintbl[]) {
3044 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3045 {}
3046 }
3047 },
6e72aa5f
TI
3048};
3049
1727a771 3050static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3051 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3052 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3053 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3054 {}
3055};
3056
3057static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3058 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3059 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3060 /* below is codec SSID since multiple Toshiba laptops have the
3061 * same PCI SSID 1179:ff00
3062 */
3063 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3064 {}
3065};
3066
f32610ed
JS
3067/*
3068 * BIOS auto configuration
3069 */
1d045db9 3070static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3071{
3e6179b8 3072 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3073 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3074}
3075
1d045db9
TI
3076/*
3077 */
1d045db9 3078static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3079{
3080 struct alc_spec *spec;
a5cb463a 3081 int i, err;
f32610ed 3082
1d045db9 3083 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3084 err = alc_alloc_spec(codec, 0);
3085 if (err < 0)
3086 return err;
3087
3088 spec = codec->spec;
2722b535
TI
3089 if (has_cdefine_beep(codec))
3090 spec->gen.beep_nid = 0x01;
1f0f4b80 3091
225068ab
TI
3092 spec->shutup = alc_eapd_shutup;
3093
c9af753f
TI
3094 alc_pre_init(codec);
3095
1727a771
TI
3096 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3097 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3098
6ebb8053
TI
3099 /* automatic parse from the BIOS config */
3100 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3101 if (err < 0)
3102 goto error;
f32610ed 3103
7504b6cd
TI
3104 if (err > 0 && !spec->gen.no_analog &&
3105 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3106 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3107 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3108 &alc268_beep_mixer[i])) {
3109 err = -ENOMEM;
3110 goto error;
3111 }
3112 }
7504b6cd 3113 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3114 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3115 /* override the amp caps for beep generator */
3116 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3117 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3118 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3119 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3120 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3121 }
3122
1727a771 3123 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3124
f32610ed 3125 return 0;
e16fb6d1
TI
3126
3127 error:
3128 alc_free(codec);
3129 return err;
f32610ed
JS
3130}
3131
bc9f98a9 3132/*
1d045db9 3133 * ALC269
bc9f98a9 3134 */
08c189f2 3135
1d045db9 3136static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3137 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3138};
3139
1d045db9 3140static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3141 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3142};
291702f0 3143
1d045db9
TI
3144/* different alc269-variants */
3145enum {
3146 ALC269_TYPE_ALC269VA,
3147 ALC269_TYPE_ALC269VB,
3148 ALC269_TYPE_ALC269VC,
adcc70b2 3149 ALC269_TYPE_ALC269VD,
065380f0
KY
3150 ALC269_TYPE_ALC280,
3151 ALC269_TYPE_ALC282,
2af02be7 3152 ALC269_TYPE_ALC283,
065380f0 3153 ALC269_TYPE_ALC284,
4731d5de 3154 ALC269_TYPE_ALC293,
7fc7d047 3155 ALC269_TYPE_ALC286,
506b62c3 3156 ALC269_TYPE_ALC298,
1d04c9de 3157 ALC269_TYPE_ALC255,
4344aec8 3158 ALC269_TYPE_ALC256,
f429e7e4 3159 ALC269_TYPE_ALC257,
0a6f0600 3160 ALC269_TYPE_ALC215,
4231430d 3161 ALC269_TYPE_ALC225,
60571929 3162 ALC269_TYPE_ALC245,
99cee034 3163 ALC269_TYPE_ALC287,
dcd4f0db 3164 ALC269_TYPE_ALC294,
1078bef0 3165 ALC269_TYPE_ALC300,
f0778871 3166 ALC269_TYPE_ALC623,
6fbae35a 3167 ALC269_TYPE_ALC700,
bc9f98a9
KY
3168};
3169
3170/*
1d045db9 3171 * BIOS auto configuration
bc9f98a9 3172 */
1d045db9
TI
3173static int alc269_parse_auto_config(struct hda_codec *codec)
3174{
1d045db9 3175 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3176 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3177 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3178 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3179 const hda_nid_t *ssids;
3180
3181 switch (spec->codec_variant) {
3182 case ALC269_TYPE_ALC269VA:
3183 case ALC269_TYPE_ALC269VC:
065380f0
KY
3184 case ALC269_TYPE_ALC280:
3185 case ALC269_TYPE_ALC284:
4731d5de 3186 case ALC269_TYPE_ALC293:
adcc70b2
KY
3187 ssids = alc269va_ssids;
3188 break;
3189 case ALC269_TYPE_ALC269VB:
3190 case ALC269_TYPE_ALC269VD:
065380f0 3191 case ALC269_TYPE_ALC282:
2af02be7 3192 case ALC269_TYPE_ALC283:
7fc7d047 3193 case ALC269_TYPE_ALC286:
506b62c3 3194 case ALC269_TYPE_ALC298:
1d04c9de 3195 case ALC269_TYPE_ALC255:
4344aec8 3196 case ALC269_TYPE_ALC256:
f429e7e4 3197 case ALC269_TYPE_ALC257:
0a6f0600 3198 case ALC269_TYPE_ALC215:
4231430d 3199 case ALC269_TYPE_ALC225:
60571929 3200 case ALC269_TYPE_ALC245:
99cee034 3201 case ALC269_TYPE_ALC287:
dcd4f0db 3202 case ALC269_TYPE_ALC294:
1078bef0 3203 case ALC269_TYPE_ALC300:
f0778871 3204 case ALC269_TYPE_ALC623:
6fbae35a 3205 case ALC269_TYPE_ALC700:
adcc70b2
KY
3206 ssids = alc269_ssids;
3207 break;
3208 default:
3209 ssids = alc269_ssids;
3210 break;
3211 }
bc9f98a9 3212
3e6179b8 3213 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3214}
bc9f98a9 3215
476c02e0
HW
3216static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3217 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3218 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3219 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3220 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3221 {}
3222};
3223
3224static void alc_headset_btn_callback(struct hda_codec *codec,
3225 struct hda_jack_callback *jack)
3226{
3227 int report = 0;
3228
3229 if (jack->unsol_res & (7 << 13))
3230 report |= SND_JACK_BTN_0;
3231
3232 if (jack->unsol_res & (1 << 16 | 3 << 8))
3233 report |= SND_JACK_BTN_1;
3234
3235 /* Volume up key */
3236 if (jack->unsol_res & (7 << 23))
3237 report |= SND_JACK_BTN_2;
3238
3239 /* Volume down key */
3240 if (jack->unsol_res & (7 << 10))
3241 report |= SND_JACK_BTN_3;
3242
04f7791b 3243 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3244}
3245
3246static void alc_disable_headset_jack_key(struct hda_codec *codec)
3247{
3248 struct alc_spec *spec = codec->spec;
3249
3250 if (!spec->has_hs_key)
3251 return;
3252
3253 switch (codec->core.vendor_id) {
3254 case 0x10ec0215:
3255 case 0x10ec0225:
3256 case 0x10ec0285:
c72b9bfe 3257 case 0x10ec0287:
476c02e0
HW
3258 case 0x10ec0295:
3259 case 0x10ec0289:
3260 case 0x10ec0299:
3261 alc_write_coef_idx(codec, 0x48, 0x0);
3262 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3263 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3264 break;
1948fc06 3265 case 0x10ec0230:
476c02e0
HW
3266 case 0x10ec0236:
3267 case 0x10ec0256:
cae2bdb5 3268 case 0x10ec0257:
527f4643 3269 case 0x19e58326:
476c02e0
HW
3270 alc_write_coef_idx(codec, 0x48, 0x0);
3271 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3272 break;
3273 }
3274}
3275
3276static void alc_enable_headset_jack_key(struct hda_codec *codec)
3277{
3278 struct alc_spec *spec = codec->spec;
3279
3280 if (!spec->has_hs_key)
3281 return;
3282
3283 switch (codec->core.vendor_id) {
3284 case 0x10ec0215:
3285 case 0x10ec0225:
3286 case 0x10ec0285:
c72b9bfe 3287 case 0x10ec0287:
476c02e0
HW
3288 case 0x10ec0295:
3289 case 0x10ec0289:
3290 case 0x10ec0299:
3291 alc_write_coef_idx(codec, 0x48, 0xd011);
3292 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3293 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3294 break;
1948fc06 3295 case 0x10ec0230:
476c02e0
HW
3296 case 0x10ec0236:
3297 case 0x10ec0256:
cae2bdb5 3298 case 0x10ec0257:
527f4643 3299 case 0x19e58326:
476c02e0
HW
3300 alc_write_coef_idx(codec, 0x48, 0xd011);
3301 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3302 break;
3303 }
3304}
3305
3306static void alc_fixup_headset_jack(struct hda_codec *codec,
3307 const struct hda_fixup *fix, int action)
3308{
3309 struct alc_spec *spec = codec->spec;
04f7791b 3310 hda_nid_t hp_pin;
476c02e0
HW
3311
3312 switch (action) {
3313 case HDA_FIXUP_ACT_PRE_PROBE:
3314 spec->has_hs_key = 1;
3315 snd_hda_jack_detect_enable_callback(codec, 0x55,
3316 alc_headset_btn_callback);
476c02e0 3317 break;
04f7791b
HW
3318 case HDA_FIXUP_ACT_BUILD:
3319 hp_pin = alc_get_hp_pin(spec);
3320 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3321 alc_headset_btn_keymap,
3322 hp_pin))
3323 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3324 false, SND_JACK_HEADSET,
3325 alc_headset_btn_keymap);
3326
476c02e0
HW
3327 alc_enable_headset_jack_key(codec);
3328 break;
3329 }
3330}
3331
1387e2d1 3332static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3333{
98b24883 3334 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3335}
291702f0 3336
1d045db9
TI
3337static void alc269_shutup(struct hda_codec *codec)
3338{
adcc70b2
KY
3339 struct alc_spec *spec = codec->spec;
3340
1387e2d1
KY
3341 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3342 alc269vb_toggle_power_output(codec, 0);
3343 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3344 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3345 msleep(150);
3346 }
c0ca5ece 3347 alc_shutup_pins(codec);
1d045db9 3348}
291702f0 3349
6b0f95c4 3350static const struct coef_fw alc282_coefs[] = {
54db6c39 3351 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3352 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3353 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3354 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3355 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3356 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3357 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3358 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3359 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3360 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3361 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3362 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3363 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3364 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3365 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3366 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3367 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3368 WRITE_COEF(0x63, 0x2902), /* PLL */
3369 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3370 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3371 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3372 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3373 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3374 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3375 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3376 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3377 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3378 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3379 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3380 {}
3381};
3382
cb149cb3
KY
3383static void alc282_restore_default_value(struct hda_codec *codec)
3384{
54db6c39 3385 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3386}
3387
7b5c7a02
KY
3388static void alc282_init(struct hda_codec *codec)
3389{
3390 struct alc_spec *spec = codec->spec;
35a39f98 3391 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3392 bool hp_pin_sense;
3393 int coef78;
3394
cb149cb3
KY
3395 alc282_restore_default_value(codec);
3396
7b5c7a02
KY
3397 if (!hp_pin)
3398 return;
3399 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3400 coef78 = alc_read_coef_idx(codec, 0x78);
3401
3402 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3403 /* Headphone capless set to high power mode */
3404 alc_write_coef_idx(codec, 0x78, 0x9004);
3405
3406 if (hp_pin_sense)
3407 msleep(2);
3408
3409 snd_hda_codec_write(codec, hp_pin, 0,
3410 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3411
3412 if (hp_pin_sense)
3413 msleep(85);
3414
3415 snd_hda_codec_write(codec, hp_pin, 0,
3416 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3417
3418 if (hp_pin_sense)
3419 msleep(100);
3420
3421 /* Headphone capless set to normal mode */
3422 alc_write_coef_idx(codec, 0x78, coef78);
3423}
3424
3425static void alc282_shutup(struct hda_codec *codec)
3426{
3427 struct alc_spec *spec = codec->spec;
35a39f98 3428 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3429 bool hp_pin_sense;
3430 int coef78;
3431
3432 if (!hp_pin) {
3433 alc269_shutup(codec);
3434 return;
3435 }
3436
3437 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3438 coef78 = alc_read_coef_idx(codec, 0x78);
3439 alc_write_coef_idx(codec, 0x78, 0x9004);
3440
3441 if (hp_pin_sense)
3442 msleep(2);
3443
3444 snd_hda_codec_write(codec, hp_pin, 0,
3445 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3446
3447 if (hp_pin_sense)
3448 msleep(85);
3449
c0ca5ece
TI
3450 if (!spec->no_shutup_pins)
3451 snd_hda_codec_write(codec, hp_pin, 0,
3452 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3453
3454 if (hp_pin_sense)
3455 msleep(100);
3456
3457 alc_auto_setup_eapd(codec, false);
c0ca5ece 3458 alc_shutup_pins(codec);
7b5c7a02
KY
3459 alc_write_coef_idx(codec, 0x78, coef78);
3460}
3461
6b0f95c4 3462static const struct coef_fw alc283_coefs[] = {
54db6c39 3463 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3464 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3465 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3466 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3467 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3468 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3469 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3470 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3471 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3472 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3473 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3474 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3475 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3476 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3477 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3478 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3479 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3480 WRITE_COEF(0x2e, 0x2902), /* PLL */
3481 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3482 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3483 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3484 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3485 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3486 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3487 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3488 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3489 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3490 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3491 WRITE_COEF(0x49, 0x0), /* test mode */
3492 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3493 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3494 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3495 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3496 {}
3497};
3498
6bd55b04
KY
3499static void alc283_restore_default_value(struct hda_codec *codec)
3500{
54db6c39 3501 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3502}
3503
2af02be7
KY
3504static void alc283_init(struct hda_codec *codec)
3505{
3506 struct alc_spec *spec = codec->spec;
35a39f98 3507 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3508 bool hp_pin_sense;
2af02be7 3509
6bd55b04
KY
3510 alc283_restore_default_value(codec);
3511
2af02be7
KY
3512 if (!hp_pin)
3513 return;
a59d7199
KY
3514
3515 msleep(30);
2af02be7
KY
3516 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3517
3518 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3519 /* Headphone capless set to high power mode */
3520 alc_write_coef_idx(codec, 0x43, 0x9004);
3521
3522 snd_hda_codec_write(codec, hp_pin, 0,
3523 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3524
3525 if (hp_pin_sense)
3526 msleep(85);
3527
3528 snd_hda_codec_write(codec, hp_pin, 0,
3529 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3530
3531 if (hp_pin_sense)
3532 msleep(85);
3533 /* Index 0x46 Combo jack auto switch control 2 */
3534 /* 3k pull low control for Headset jack. */
98b24883 3535 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3536 /* Headphone capless set to normal mode */
3537 alc_write_coef_idx(codec, 0x43, 0x9614);
3538}
3539
3540static void alc283_shutup(struct hda_codec *codec)
3541{
3542 struct alc_spec *spec = codec->spec;
35a39f98 3543 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3544 bool hp_pin_sense;
2af02be7
KY
3545
3546 if (!hp_pin) {
3547 alc269_shutup(codec);
3548 return;
3549 }
3550
3551 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3552
3553 alc_write_coef_idx(codec, 0x43, 0x9004);
3554
b450b17c
HP
3555 /*depop hp during suspend*/
3556 alc_write_coef_idx(codec, 0x06, 0x2100);
3557
2af02be7
KY
3558 snd_hda_codec_write(codec, hp_pin, 0,
3559 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3560
3561 if (hp_pin_sense)
88011c09 3562 msleep(100);
2af02be7 3563
c0ca5ece
TI
3564 if (!spec->no_shutup_pins)
3565 snd_hda_codec_write(codec, hp_pin, 0,
3566 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3567
98b24883 3568 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3569
3570 if (hp_pin_sense)
88011c09 3571 msleep(100);
0435b3ff 3572 alc_auto_setup_eapd(codec, false);
c0ca5ece 3573 alc_shutup_pins(codec);
2af02be7
KY
3574 alc_write_coef_idx(codec, 0x43, 0x9614);
3575}
3576
4a219ef8
KY
3577static void alc256_init(struct hda_codec *codec)
3578{
3579 struct alc_spec *spec = codec->spec;
35a39f98 3580 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3581 bool hp_pin_sense;
3582
1f680609
YY
3583 if (spec->ultra_low_power) {
3584 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3585 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3586 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3587 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3588 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3589 msleep(30);
3590 }
3591
4a219ef8 3592 if (!hp_pin)
6447c962 3593 hp_pin = 0x21;
4a219ef8
KY
3594
3595 msleep(30);
3596
3597 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3598
3599 if (hp_pin_sense)
3600 msleep(2);
3601
3602 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3603
3604 snd_hda_codec_write(codec, hp_pin, 0,
3605 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3606
6447c962 3607 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3608 msleep(85);
3609
3610 snd_hda_codec_write(codec, hp_pin, 0,
3611 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3612
6447c962 3613 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3614 msleep(100);
3615
3616 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3617 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3618 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3619 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3620 /*
3621 * Expose headphone mic (or possibly Line In on some machines) instead
3622 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3623 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3624 * this register.
3625 */
3626 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3627}
3628
3629static void alc256_shutup(struct hda_codec *codec)
3630{
3631 struct alc_spec *spec = codec->spec;
35a39f98 3632 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3633 bool hp_pin_sense;
3634
6447c962
KY
3635 if (!hp_pin)
3636 hp_pin = 0x21;
4a219ef8 3637
69ea4c9d 3638 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
4a219ef8
KY
3639 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3640
3641 if (hp_pin_sense)
3642 msleep(2);
3643
3644 snd_hda_codec_write(codec, hp_pin, 0,
3645 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3646
6447c962 3647 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3648 msleep(85);
3649
1c9609e3
TI
3650 /* 3k pull low control for Headset jack. */
3651 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3652 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3653 * when booting with headset plugged. So skip setting it for the codec alc257
3654 */
69ea4c9d 3655 if (spec->en_3kpull_low)
3f742490 3656 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3657
c0ca5ece
TI
3658 if (!spec->no_shutup_pins)
3659 snd_hda_codec_write(codec, hp_pin, 0,
3660 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3661
6447c962 3662 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3663 msleep(100);
3664
3665 alc_auto_setup_eapd(codec, false);
c0ca5ece 3666 alc_shutup_pins(codec);
6447c962
KY
3667 if (spec->ultra_low_power) {
3668 msleep(50);
3669 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3670 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3671 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3672 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3673 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3674 msleep(30);
3675 }
4a219ef8
KY
3676}
3677
3c24e483
KY
3678static void alc285_hp_init(struct hda_codec *codec)
3679{
3680 struct alc_spec *spec = codec->spec;
3681 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3682 int i, val;
3683 int coef38, coef0d, coef36;
3684
3685 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3686 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3687 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3688 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3689 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3690 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3691
3692 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3693
3694 if (hp_pin)
3695 snd_hda_codec_write(codec, hp_pin, 0,
3696 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3697
3698 msleep(130);
3699 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3700 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3701
3702 if (hp_pin)
3703 snd_hda_codec_write(codec, hp_pin, 0,
3704 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3705 msleep(10);
3706 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3707 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3708 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3709 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3710
3711 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3712 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3713 for (i = 0; i < 20 && val & 0x8000; i++) {
3714 msleep(50);
3715 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3716 } /* Wait for depop procedure finish */
3717
3718 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3719 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3720 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3721 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3722
3723 msleep(50);
3724 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3725}
3726
da911b1f
KY
3727static void alc225_init(struct hda_codec *codec)
3728{
3729 struct alc_spec *spec = codec->spec;
35a39f98 3730 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3731 bool hp1_pin_sense, hp2_pin_sense;
3732
1f680609
YY
3733 if (spec->ultra_low_power) {
3734 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3735 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3736 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3737 msleep(30);
3738 }
3739
60571929
KY
3740 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3741 spec->codec_variant != ALC269_TYPE_ALC245)
3c24e483
KY
3742 /* required only at boot or S3 and S4 resume time */
3743 if (!spec->done_hp_init ||
3744 is_s3_resume(codec) ||
3745 is_s4_resume(codec)) {
3746 alc285_hp_init(codec);
3747 spec->done_hp_init = true;
3748 }
3749
da911b1f 3750 if (!hp_pin)
d3ba58bb 3751 hp_pin = 0x21;
da911b1f
KY
3752 msleep(30);
3753
3754 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3755 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3756
3757 if (hp1_pin_sense || hp2_pin_sense)
3758 msleep(2);
3759
3760 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3761
d3ba58bb 3762 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3763 snd_hda_codec_write(codec, hp_pin, 0,
3764 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3765 if (hp2_pin_sense)
3766 snd_hda_codec_write(codec, 0x16, 0,
3767 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3768
d3ba58bb 3769 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3770 msleep(85);
3771
d3ba58bb 3772 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3773 snd_hda_codec_write(codec, hp_pin, 0,
3774 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3775 if (hp2_pin_sense)
3776 snd_hda_codec_write(codec, 0x16, 0,
3777 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3778
d3ba58bb 3779 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3780 msleep(100);
3781
3782 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3783 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3784}
3785
3786static void alc225_shutup(struct hda_codec *codec)
3787{
3788 struct alc_spec *spec = codec->spec;
35a39f98 3789 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3790 bool hp1_pin_sense, hp2_pin_sense;
3791
d3ba58bb
KY
3792 if (!hp_pin)
3793 hp_pin = 0x21;
476c02e0
HW
3794
3795 alc_disable_headset_jack_key(codec);
da911b1f
KY
3796 /* 3k pull low control for Headset jack. */
3797 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3798
3799 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3800 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3801
3802 if (hp1_pin_sense || hp2_pin_sense)
3803 msleep(2);
3804
d3ba58bb 3805 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3806 snd_hda_codec_write(codec, hp_pin, 0,
3807 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3808 if (hp2_pin_sense)
3809 snd_hda_codec_write(codec, 0x16, 0,
3810 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3811
d3ba58bb 3812 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3813 msleep(85);
3814
d3ba58bb 3815 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3816 snd_hda_codec_write(codec, hp_pin, 0,
3817 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3818 if (hp2_pin_sense)
3819 snd_hda_codec_write(codec, 0x16, 0,
3820 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3821
d3ba58bb 3822 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3823 msleep(100);
3824
3825 alc_auto_setup_eapd(codec, false);
c0ca5ece 3826 alc_shutup_pins(codec);
d3ba58bb
KY
3827 if (spec->ultra_low_power) {
3828 msleep(50);
3829 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3830 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3831 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3832 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3833 msleep(30);
3834 }
476c02e0
HW
3835
3836 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3837 alc_enable_headset_jack_key(codec);
da911b1f
KY
3838}
3839
c2d6af53
KY
3840static void alc_default_init(struct hda_codec *codec)
3841{
3842 struct alc_spec *spec = codec->spec;
35a39f98 3843 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3844 bool hp_pin_sense;
3845
3846 if (!hp_pin)
3847 return;
3848
3849 msleep(30);
3850
3851 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3852
3853 if (hp_pin_sense)
3854 msleep(2);
3855
3856 snd_hda_codec_write(codec, hp_pin, 0,
3857 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3858
3859 if (hp_pin_sense)
3860 msleep(85);
3861
3862 snd_hda_codec_write(codec, hp_pin, 0,
3863 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3864
3865 if (hp_pin_sense)
3866 msleep(100);
3867}
3868
3869static void alc_default_shutup(struct hda_codec *codec)
3870{
3871 struct alc_spec *spec = codec->spec;
35a39f98 3872 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3873 bool hp_pin_sense;
3874
3875 if (!hp_pin) {
3876 alc269_shutup(codec);
3877 return;
3878 }
3879
3880 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3881
3882 if (hp_pin_sense)
3883 msleep(2);
3884
3885 snd_hda_codec_write(codec, hp_pin, 0,
3886 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3887
3888 if (hp_pin_sense)
3889 msleep(85);
3890
c0ca5ece
TI
3891 if (!spec->no_shutup_pins)
3892 snd_hda_codec_write(codec, hp_pin, 0,
3893 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3894
3895 if (hp_pin_sense)
3896 msleep(100);
3897
3898 alc_auto_setup_eapd(codec, false);
c0ca5ece 3899 alc_shutup_pins(codec);
c2d6af53
KY
3900}
3901
693abe11
KY
3902static void alc294_hp_init(struct hda_codec *codec)
3903{
3904 struct alc_spec *spec = codec->spec;
35a39f98 3905 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3906 int i, val;
3907
3908 if (!hp_pin)
3909 return;
3910
3911 snd_hda_codec_write(codec, hp_pin, 0,
3912 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3913
3914 msleep(100);
3915
c0ca5ece
TI
3916 if (!spec->no_shutup_pins)
3917 snd_hda_codec_write(codec, hp_pin, 0,
3918 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3919
3920 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3921 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3922
3923 /* Wait for depop procedure finish */
3924 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3925 for (i = 0; i < 20 && val & 0x0080; i++) {
3926 msleep(50);
3927 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3928 }
3929 /* Set HP depop to auto mode */
3930 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3931 msleep(50);
3932}
3933
3934static void alc294_init(struct hda_codec *codec)
3935{
3936 struct alc_spec *spec = codec->spec;
3937
f6ef4e0e
TI
3938 /* required only at boot or S4 resume time */
3939 if (!spec->done_hp_init ||
3940 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3941 alc294_hp_init(codec);
3942 spec->done_hp_init = true;
3943 }
3944 alc_default_init(codec);
3945}
3946
ad60d502
KY
3947static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3948 unsigned int val)
3949{
3950 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3951 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3952 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3953}
3954
3955static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3956{
3957 unsigned int val;
3958
3959 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3960 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3961 & 0xffff;
3962 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3963 << 16;
3964 return val;
3965}
3966
3967static void alc5505_dsp_halt(struct hda_codec *codec)
3968{
3969 unsigned int val;
3970
3971 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3972 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3973 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3974 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3975 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3976 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3977 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3978 val = alc5505_coef_get(codec, 0x6220);
3979 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3980}
3981
3982static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3983{
3984 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3985 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3986 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3987 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3988 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3989 alc5505_coef_set(codec, 0x880c, 0x00000004);
3990}
3991
3992static void alc5505_dsp_init(struct hda_codec *codec)
3993{
3994 unsigned int val;
3995
3996 alc5505_dsp_halt(codec);
3997 alc5505_dsp_back_from_halt(codec);
3998 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3999 alc5505_coef_set(codec, 0x61b0, 0x5b16);
4000 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4001 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4002 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4003 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4004 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4005 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4006 alc5505_coef_set(codec, 0x61b8, 0x04173302);
4007 alc5505_coef_set(codec, 0x61b8, 0x04163302);
4008 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4009 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4010 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4011
4012 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4013 if (val <= 3)
4014 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4015 else
4016 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4017
4018 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4019 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4020 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4021 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4022 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4023 alc5505_coef_set(codec, 0x880c, 0x00000003);
4024 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
4025
4026#ifdef HALT_REALTEK_ALC5505
4027 alc5505_dsp_halt(codec);
4028#endif
ad60d502
KY
4029}
4030
cd63a5ff 4031#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
4032#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4033#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
4034#else
4035#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4036#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4037#endif
4038
2a43952a 4039#ifdef CONFIG_PM
ad60d502
KY
4040static int alc269_suspend(struct hda_codec *codec)
4041{
4042 struct alc_spec *spec = codec->spec;
4043
4044 if (spec->has_alc5505_dsp)
cd63a5ff 4045 alc5505_dsp_suspend(codec);
1873ebd3 4046
ad60d502
KY
4047 return alc_suspend(codec);
4048}
4049
1d045db9
TI
4050static int alc269_resume(struct hda_codec *codec)
4051{
adcc70b2
KY
4052 struct alc_spec *spec = codec->spec;
4053
1387e2d1
KY
4054 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4055 alc269vb_toggle_power_output(codec, 0);
4056 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4057 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4058 msleep(150);
4059 }
8c427226 4060
1d045db9 4061 codec->patch_ops.init(codec);
f1d4e28b 4062
1387e2d1
KY
4063 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4064 alc269vb_toggle_power_output(codec, 1);
4065 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4066 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4067 msleep(200);
4068 }
f1d4e28b 4069
1a462be5 4070 snd_hda_regmap_sync(codec);
1d045db9 4071 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4072
4073 /* on some machine, the BIOS will clear the codec gpio data when enter
4074 * suspend, and won't restore the data after resume, so we restore it
4075 * in the driver.
4076 */
d261eec8
TI
4077 if (spec->gpio_data)
4078 alc_write_gpio_data(codec);
f475371a 4079
ad60d502 4080 if (spec->has_alc5505_dsp)
cd63a5ff 4081 alc5505_dsp_resume(codec);
c5177c86 4082
1d045db9
TI
4083 return 0;
4084}
2a43952a 4085#endif /* CONFIG_PM */
f1d4e28b 4086
108cc108 4087static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4088 const struct hda_fixup *fix, int action)
108cc108
DH
4089{
4090 struct alc_spec *spec = codec->spec;
4091
1727a771 4092 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4093 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4094}
4095
fdcc968a
JMG
4096static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4097 const struct hda_fixup *fix,
4098 int action)
4099{
4100 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4101 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4102
4103 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4104 snd_hda_codec_set_pincfg(codec, 0x19,
4105 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4106 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4107}
4108
1d045db9 4109static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4110 const struct hda_fixup *fix, int action)
1d045db9 4111{
98b24883
TI
4112 if (action == HDA_FIXUP_ACT_INIT)
4113 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4114}
f1d4e28b 4115
7c478f03
DH
4116static void alc269_fixup_headset_mic(struct hda_codec *codec,
4117 const struct hda_fixup *fix, int action)
4118{
4119 struct alc_spec *spec = codec->spec;
4120
4121 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4122 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4123}
4124
1d045db9 4125static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4126 const struct hda_fixup *fix, int action)
1d045db9
TI
4127{
4128 static const struct hda_verb verbs[] = {
4129 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4130 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4131 {}
4132 };
4133 unsigned int cfg;
f1d4e28b 4134
7639a06c
TI
4135 if (strcmp(codec->core.chip_name, "ALC271X") &&
4136 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4137 return;
4138 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4139 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4140 snd_hda_sequence_write(codec, verbs);
4141}
f1d4e28b 4142
c8426b27
TI
4143/* Fix the speaker amp after resume, etc */
4144static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4145 const struct hda_fixup *fix,
4146 int action)
4147{
4148 if (action == HDA_FIXUP_ACT_INIT)
4149 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4150}
4151
017f2a10 4152static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4153 const struct hda_fixup *fix, int action)
017f2a10
TI
4154{
4155 struct alc_spec *spec = codec->spec;
4156
1727a771 4157 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4158 return;
4159
4160 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4161 * fix the sample rate of analog I/O to 44.1kHz
4162 */
08c189f2
TI
4163 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4164 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4165}
4166
adabb3ec 4167static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4168 const struct hda_fixup *fix, int action)
adabb3ec 4169{
adabb3ec
TI
4170 /* The digital-mic unit sends PDM (differential signal) instead of
4171 * the standard PCM, thus you can't record a valid mono stream as is.
4172 * Below is a workaround specific to ALC269 to control the dmic
4173 * signal source as mono.
4174 */
98b24883
TI
4175 if (action == HDA_FIXUP_ACT_INIT)
4176 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4177}
4178
24519911
TI
4179static void alc269_quanta_automute(struct hda_codec *codec)
4180{
08c189f2 4181 snd_hda_gen_update_outputs(codec);
24519911 4182
1687ccc8
TI
4183 alc_write_coef_idx(codec, 0x0c, 0x680);
4184 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4185}
4186
4187static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4188 const struct hda_fixup *fix, int action)
24519911
TI
4189{
4190 struct alc_spec *spec = codec->spec;
1727a771 4191 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4192 return;
08c189f2 4193 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4194}
4195
d240d1dc 4196static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4197 struct hda_jack_callback *jack)
d240d1dc
DH
4198{
4199 struct alc_spec *spec = codec->spec;
4200 int vref;
4201 msleep(200);
4202 snd_hda_gen_hp_automute(codec, jack);
4203
4204 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4205 msleep(100);
4206 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4207 vref);
4208 msleep(500);
4209 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4210 vref);
4211}
4212
a2ef03fe
TE
4213/*
4214 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4215 */
4216struct hda_alc298_mbxinit {
4217 unsigned char value_0x23;
4218 unsigned char value_0x25;
4219};
4220
4221static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4222 const struct hda_alc298_mbxinit *initval,
4223 bool first)
4224{
4225 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4226 alc_write_coef_idx(codec, 0x26, 0xb000);
4227
4228 if (first)
4229 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4230
4231 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4232 alc_write_coef_idx(codec, 0x26, 0xf000);
4233 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4234
4235 if (initval->value_0x23 != 0x1e)
4236 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4237
4238 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4239 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4240}
4241
4242static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4243 const struct hda_fixup *fix,
4244 int action)
4245{
4246 /* Initialization magic */
4247 static const struct hda_alc298_mbxinit dac_init[] = {
4248 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4249 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4250 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4251 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4252 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4253 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4254 {0x2f, 0x00},
4255 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4256 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4257 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4258 {}
4259 };
4260 const struct hda_alc298_mbxinit *seq;
4261
4262 if (action != HDA_FIXUP_ACT_INIT)
4263 return;
4264
4265 /* Start */
4266 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4267 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4268 alc_write_coef_idx(codec, 0x26, 0xf000);
4269 alc_write_coef_idx(codec, 0x22, 0x31);
4270 alc_write_coef_idx(codec, 0x23, 0x0b);
4271 alc_write_coef_idx(codec, 0x25, 0x00);
4272 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4273 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4274
4275 for (seq = dac_init; seq->value_0x23; seq++)
4276 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4277}
4278
d240d1dc
DH
4279static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4280 const struct hda_fixup *fix, int action)
4281{
4282 struct alc_spec *spec = codec->spec;
4283 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4284 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4285 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4286 }
4287}
4288
766538ac
TI
4289static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4290 bool polarity, bool on)
4291{
4292 unsigned int pinval;
4293
4294 if (!pin)
4295 return;
4296 if (polarity)
4297 on = !on;
4298 pinval = snd_hda_codec_get_pin_target(codec, pin);
4299 pinval &= ~AC_PINCTL_VREFEN;
4300 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4301 /* temporarily power up/down for setting VREF */
4302 snd_hda_power_up_pm(codec);
4303 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4304 snd_hda_power_down_pm(codec);
4305}
d240d1dc 4306
08fb0d0e 4307/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4308static int vref_mute_led_set(struct led_classdev *led_cdev,
4309 enum led_brightness brightness)
6d3cd5d4 4310{
8d3d1ece 4311 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4312 struct alc_spec *spec = codec->spec;
08fb0d0e 4313
766538ac
TI
4314 alc_update_vref_led(codec, spec->mute_led_nid,
4315 spec->mute_led_polarity, brightness);
8d3d1ece 4316 return 0;
6d3cd5d4
DH
4317}
4318
d5b6b65e
DH
4319/* Make sure the led works even in runtime suspend */
4320static unsigned int led_power_filter(struct hda_codec *codec,
4321 hda_nid_t nid,
4322 unsigned int power_state)
4323{
4324 struct alc_spec *spec = codec->spec;
4325
50dd9050
HW
4326 if (power_state != AC_PWRST_D3 || nid == 0 ||
4327 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4328 return power_state;
4329
4330 /* Set pin ctl again, it might have just been set to 0 */
4331 snd_hda_set_pin_ctl(codec, nid,
4332 snd_hda_codec_get_pin_target(codec, nid));
4333
cffd3966 4334 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4335}
4336
08fb0d0e
TI
4337static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4338 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4339{
4340 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4341 const struct dmi_device *dev = NULL;
4342
4343 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4344 return;
4345
4346 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4347 int pol, pin;
4348 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4349 continue;
4350 if (pin < 0x0a || pin >= 0x10)
4351 break;
4352 spec->mute_led_polarity = pol;
4353 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4354 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4355 codec->power_filter = led_power_filter;
4e76a883
TI
4356 codec_dbg(codec,
4357 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4358 spec->mute_led_polarity);
6d3cd5d4
DH
4359 break;
4360 }
4361}
4362
85c467dc
TI
4363static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4364 const struct hda_fixup *fix,
4365 int action, hda_nid_t pin)
d06ac143
DH
4366{
4367 struct alc_spec *spec = codec->spec;
85c467dc 4368
d06ac143
DH
4369 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4370 spec->mute_led_polarity = 0;
85c467dc 4371 spec->mute_led_nid = pin;
8d3d1ece 4372 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4373 codec->power_filter = led_power_filter;
d06ac143
DH
4374 }
4375}
4376
85c467dc
TI
4377static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4378 const struct hda_fixup *fix, int action)
4379{
4380 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4381}
4382
08fb0d0e
TI
4383static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4384 const struct hda_fixup *fix, int action)
420b0feb 4385{
85c467dc 4386 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4387}
4388
7f783bd5
TB
4389static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4390 const struct hda_fixup *fix, int action)
4391{
85c467dc 4392 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4393}
4394
0f32fd19
TI
4395/* update LED status via GPIO */
4396static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4397 int polarity, bool enabled)
9f5c6faf 4398{
dbd13179 4399 if (polarity)
0f32fd19 4400 enabled = !enabled;
d261eec8 4401 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4402}
4403
0f32fd19 4404/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4405static int gpio_mute_led_set(struct led_classdev *led_cdev,
4406 enum led_brightness brightness)
9f5c6faf 4407{
8d3d1ece 4408 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4409 struct alc_spec *spec = codec->spec;
9f5c6faf 4410
dbd13179 4411 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4412 spec->mute_led_polarity, !brightness);
4413 return 0;
0f32fd19 4414}
9f5c6faf 4415
0f32fd19 4416/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4417static int micmute_led_set(struct led_classdev *led_cdev,
4418 enum led_brightness brightness)
4419{
4420 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4421 struct alc_spec *spec = codec->spec;
4422
4423 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4424 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4425 return 0;
4426}
4427
01e4a275
TI
4428/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4429static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4430 int action,
4431 unsigned int mute_mask,
4432 unsigned int micmute_mask)
9f5c6faf
TI
4433{
4434 struct alc_spec *spec = codec->spec;
9f5c6faf 4435
01e4a275
TI
4436 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4437
4438 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4439 return;
4440 if (mute_mask) {
4441 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4442 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4443 }
4444 if (micmute_mask) {
4445 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4446 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4447 }
4448}
4449
e7d66cf7
JS
4450static void alc236_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, 0x01);
4454}
4455
01e4a275 4456static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4457 const struct hda_fixup *fix, int action)
4458{
01e4a275
TI
4459 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4460}
eaa8e5ef 4461
f5a88b0a
KHF
4462static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4463 const struct hda_fixup *fix, int action)
4464{
3e0650ab 4465 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4466}
4467
01e4a275
TI
4468static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4469 const struct hda_fixup *fix, int action)
4470{
4471 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4472}
4473
a0ccbc53
KY
4474static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4475 const struct hda_fixup *fix, int action)
4476{
4477 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4478}
4479
5fc462c3
JC
4480static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4481 const struct hda_fixup *fix, int action)
4482{
4483 struct alc_spec *spec = codec->spec;
4484
4485 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4486 spec->micmute_led_polarity = 1;
4487 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4488}
4489
8a503555
TI
4490/* turn on/off mic-mute LED per capture hook via VREF change */
4491static int vref_micmute_led_set(struct led_classdev *led_cdev,
4492 enum led_brightness brightness)
9c5dc3bf 4493{
8a503555 4494 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4495 struct alc_spec *spec = codec->spec;
9c5dc3bf 4496
766538ac
TI
4497 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4498 spec->micmute_led_polarity, brightness);
8a503555 4499 return 0;
9c5dc3bf
KY
4500}
4501
4502static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4503 const struct hda_fixup *fix, int action)
4504{
4505 struct alc_spec *spec = codec->spec;
9c5dc3bf 4506
01e4a275 4507 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4508 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4509 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4510 * enable headphone amp
4511 */
4512 spec->gpio_mask |= 0x10;
4513 spec->gpio_dir |= 0x10;
9c5dc3bf 4514 spec->cap_mute_led_nid = 0x18;
8a503555 4515 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4516 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4517 }
4518}
4519
7a5255f1
DH
4520static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4521 const struct hda_fixup *fix, int action)
4522{
7a5255f1 4523 struct alc_spec *spec = codec->spec;
7a5255f1 4524
01e4a275 4525 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4526 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4527 spec->cap_mute_led_nid = 0x18;
8a503555 4528 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4529 codec->power_filter = led_power_filter;
4530 }
4531}
4532
c3bb2b52
TI
4533/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4534 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4535 */
4536static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4537 const struct hda_fixup *fix, int action)
4538{
4539 struct alc_spec *spec = codec->spec;
4540
4541 switch (action) {
4542 case HDA_FIXUP_ACT_PRE_PROBE:
4543 spec->gpio_mask |= 0x01;
4544 spec->gpio_dir |= 0x01;
4545 break;
4546 case HDA_FIXUP_ACT_INIT:
4547 /* need to toggle GPIO to enable the amp */
4548 alc_update_gpio_data(codec, 0x01, true);
4549 msleep(100);
4550 alc_update_gpio_data(codec, 0x01, false);
4551 break;
4552 }
4553}
4554
622464c8
TI
4555/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4556static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4557 struct hda_codec *codec,
4558 struct snd_pcm_substream *substream,
4559 int action)
4560{
4561 switch (action) {
4562 case HDA_GEN_PCM_ACT_PREPARE:
4563 alc_update_gpio_data(codec, 0x04, true);
4564 break;
4565 case HDA_GEN_PCM_ACT_CLEANUP:
4566 alc_update_gpio_data(codec, 0x04, false);
4567 break;
4568 }
4569}
4570
4571static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4572 const struct hda_fixup *fix,
4573 int action)
4574{
4575 struct alc_spec *spec = codec->spec;
4576
4577 if (action == HDA_FIXUP_ACT_PROBE) {
4578 spec->gpio_mask |= 0x04;
4579 spec->gpio_dir |= 0x04;
4580 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4581 }
4582}
4583
766538ac
TI
4584static void alc_update_coef_led(struct hda_codec *codec,
4585 struct alc_coef_led *led,
4586 bool polarity, bool on)
4587{
4588 if (polarity)
4589 on = !on;
4590 /* temporarily power up/down for setting COEF bit */
4591 alc_update_coef_idx(codec, led->idx, led->mask,
4592 on ? led->on : led->off);
4593}
4594
431e76c3 4595/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4596static int coef_mute_led_set(struct led_classdev *led_cdev,
4597 enum led_brightness brightness)
431e76c3 4598{
8d3d1ece 4599 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4600 struct alc_spec *spec = codec->spec;
4601
766538ac
TI
4602 alc_update_coef_led(codec, &spec->mute_led_coef,
4603 spec->mute_led_polarity, brightness);
8d3d1ece 4604 return 0;
431e76c3
KY
4605}
4606
4607static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4608 const struct hda_fixup *fix,
4609 int action)
4610{
4611 struct alc_spec *spec = codec->spec;
4612
4613 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4614 spec->mute_led_polarity = 0;
766538ac
TI
4615 spec->mute_led_coef.idx = 0x0b;
4616 spec->mute_led_coef.mask = 1 << 3;
4617 spec->mute_led_coef.on = 1 << 3;
4618 spec->mute_led_coef.off = 0;
8d3d1ece 4619 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4620 }
4621}
4622
24164f43
KY
4623static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4624 const struct hda_fixup *fix,
4625 int action)
4626{
4627 struct alc_spec *spec = codec->spec;
4628
4629 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4630 spec->mute_led_polarity = 0;
766538ac
TI
4631 spec->mute_led_coef.idx = 0x34;
4632 spec->mute_led_coef.mask = 1 << 5;
4633 spec->mute_led_coef.on = 0;
4634 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4635 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4636 }
4637}
4638
0659400f
LG
4639static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4640 const struct hda_fixup *fix, int action)
4641{
4642 struct alc_spec *spec = codec->spec;
4643
4644 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4645 spec->mute_led_polarity = 0;
4646 spec->mute_led_coef.idx = 0x07;
4647 spec->mute_led_coef.mask = 1;
4648 spec->mute_led_coef.on = 1;
4649 spec->mute_led_coef.off = 0;
4650 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4651 }
4652}
4653
93dc18e1
SJ
4654static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4655 const struct hda_fixup *fix,
4656 int action)
4657{
4658 struct alc_spec *spec = codec->spec;
4659
4660 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4661 spec->mute_led_polarity = 0;
4662 spec->mute_led_coef.idx = 0x0b;
4663 spec->mute_led_coef.mask = 3 << 2;
4664 spec->mute_led_coef.on = 2 << 2;
4665 spec->mute_led_coef.off = 1 << 2;
4666 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4667 }
4668}
4669
431e76c3 4670/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4671static int coef_micmute_led_set(struct led_classdev *led_cdev,
4672 enum led_brightness brightness)
431e76c3 4673{
8a503555 4674 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4675 struct alc_spec *spec = codec->spec;
4676
766538ac
TI
4677 alc_update_coef_led(codec, &spec->mic_led_coef,
4678 spec->micmute_led_polarity, brightness);
8a503555 4679 return 0;
431e76c3
KY
4680}
4681
4682static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4683 const struct hda_fixup *fix, int action)
4684{
4685 struct alc_spec *spec = codec->spec;
4686
4687 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4688 spec->mic_led_coef.idx = 0x19;
4689 spec->mic_led_coef.mask = 1 << 13;
4690 spec->mic_led_coef.on = 1 << 13;
4691 spec->mic_led_coef.off = 0;
8a503555 4692 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4693 }
4694}
4695
ca88eeb3
LG
4696static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4697 const struct hda_fixup *fix, int action)
4698{
4699 struct alc_spec *spec = codec->spec;
4700
4701 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4702 spec->micmute_led_polarity = 1;
4703 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4704}
4705
24164f43
KY
4706static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4707 const struct hda_fixup *fix, int action)
4708{
4709 struct alc_spec *spec = codec->spec;
4710
4711 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4712 spec->mic_led_coef.idx = 0x35;
4713 spec->mic_led_coef.mask = 3 << 2;
4714 spec->mic_led_coef.on = 2 << 2;
4715 spec->mic_led_coef.off = 1 << 2;
8a503555 4716 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4717 }
4718}
4719
431e76c3
KY
4720static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4721 const struct hda_fixup *fix, int action)
4722{
4723 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4724 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4725}
4726
ca88eeb3
LG
4727static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4728 const struct hda_fixup *fix, int action)
4729{
4730 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4731 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4732}
4733
24164f43
KY
4734static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4735 const struct hda_fixup *fix, int action)
4736{
4737 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4738 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4739}
4740
75b62ab6
JW
4741static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4742 const struct hda_fixup *fix, int action)
4743{
4744 struct alc_spec *spec = codec->spec;
4745
4746 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4747 spec->cap_mute_led_nid = 0x1a;
4748 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4749 codec->power_filter = led_power_filter;
4750 }
4751}
4752
4753static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4754 const struct hda_fixup *fix, int action)
4755{
4756 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4757 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4758}
4759
a2d57ebe
KM
4760static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4761 const unsigned short coefs[2])
4762{
4763 alc_write_coef_idx(codec, 0x23, coefs[0]);
4764 alc_write_coef_idx(codec, 0x25, coefs[1]);
4765 alc_write_coef_idx(codec, 0x26, 0xb011);
4766}
4767
4768struct alc298_samsung_amp_desc {
4769 unsigned char nid;
4770 unsigned short init_seq[2][2];
4771};
4772
4773static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4774 const struct hda_fixup *fix, int action)
4775{
4776 int i, j;
4777 static const unsigned short init_seq[][2] = {
4778 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4779 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4780 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4781 { 0x41, 0x07 }, { 0x400, 0x1 }
4782 };
4783 static const struct alc298_samsung_amp_desc amps[] = {
4784 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4785 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4786 };
4787
4788 if (action != HDA_FIXUP_ACT_INIT)
4789 return;
4790
4791 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4792 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4793
4794 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4795 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4796
4797 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4798 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4799 }
4800}
4801
6a30abaa 4802#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4803static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4804 struct hda_jack_callback *event)
4805{
4806 struct alc_spec *spec = codec->spec;
4807
4808 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4809 send both key on and key off event for every interrupt. */
c7b60a89 4810 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4811 input_sync(spec->kb_dev);
c7b60a89 4812 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4813 input_sync(spec->kb_dev);
4814}
33f4acd3 4815
3694cb29
K
4816static int alc_register_micmute_input_device(struct hda_codec *codec)
4817{
4818 struct alc_spec *spec = codec->spec;
c7b60a89 4819 int i;
3694cb29
K
4820
4821 spec->kb_dev = input_allocate_device();
4822 if (!spec->kb_dev) {
4823 codec_err(codec, "Out of memory (input_allocate_device)\n");
4824 return -ENOMEM;
4825 }
c7b60a89
HW
4826
4827 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4828
3694cb29
K
4829 spec->kb_dev->name = "Microphone Mute Button";
4830 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4831 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4832 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4833 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4834 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4835 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4836
4837 if (input_register_device(spec->kb_dev)) {
4838 codec_err(codec, "input_register_device failed\n");
4839 input_free_device(spec->kb_dev);
4840 spec->kb_dev = NULL;
4841 return -ENOMEM;
4842 }
4843
4844 return 0;
4845}
4846
01e4a275
TI
4847/* GPIO1 = set according to SKU external amp
4848 * GPIO2 = mic mute hotkey
4849 * GPIO3 = mute LED
4850 * GPIO4 = mic mute LED
4851 */
33f4acd3
DH
4852static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4853 const struct hda_fixup *fix, int action)
4854{
33f4acd3
DH
4855 struct alc_spec *spec = codec->spec;
4856
01e4a275 4857 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4858 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4859 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4860 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4861 return;
33f4acd3 4862
01e4a275
TI
4863 spec->gpio_mask |= 0x06;
4864 spec->gpio_dir |= 0x02;
4865 spec->gpio_data |= 0x02;
7639a06c 4866 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4867 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4868 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4869 gpio2_mic_hotkey_event);
33f4acd3
DH
4870 return;
4871 }
4872
4873 if (!spec->kb_dev)
4874 return;
4875
4876 switch (action) {
33f4acd3
DH
4877 case HDA_FIXUP_ACT_FREE:
4878 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4879 spec->kb_dev = NULL;
4880 }
33f4acd3
DH
4881}
4882
01e4a275
TI
4883/* Line2 = mic mute hotkey
4884 * GPIO2 = mic mute LED
4885 */
3694cb29
K
4886static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4887 const struct hda_fixup *fix, int action)
4888{
3694cb29
K
4889 struct alc_spec *spec = codec->spec;
4890
01e4a275 4891 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4892 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4893 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4894 if (alc_register_micmute_input_device(codec) != 0)
4895 return;
4896
3694cb29
K
4897 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4898 gpio2_mic_hotkey_event);
3694cb29
K
4899 return;
4900 }
4901
4902 if (!spec->kb_dev)
4903 return;
4904
4905 switch (action) {
3694cb29
K
4906 case HDA_FIXUP_ACT_FREE:
4907 input_unregister_device(spec->kb_dev);
4908 spec->kb_dev = NULL;
4909 }
4910}
c469652b
TI
4911#else /* INPUT */
4912#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4913#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4914#endif /* INPUT */
3694cb29 4915
9c5dc3bf
KY
4916static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4917 const struct hda_fixup *fix, int action)
4918{
4919 struct alc_spec *spec = codec->spec;
4920
1bce62a6 4921 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4922 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4923 spec->cap_mute_led_nid = 0x18;
8a503555 4924 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4925 }
4926}
4927
6b0f95c4 4928static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4929 UPDATE_COEF(0x4a, 1<<8, 0),
4930 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4931 UPDATE_COEF(0x63, 3<<14, 3<<14),
4932 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4933 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4934 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4935 UPDATE_COEF(0x4a, 3<<10, 0),
4936 {}
4937};
4938
73bdd597
DH
4939static void alc_headset_mode_unplugged(struct hda_codec *codec)
4940{
92666d45 4941 struct alc_spec *spec = codec->spec;
6b0f95c4 4942 static const struct coef_fw coef0255[] = {
717f43d8 4943 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4944 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4945 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4946 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4947 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4948 {}
4949 };
6b0f95c4 4950 static const struct coef_fw coef0256[] = {
e69e7e03 4951 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4952 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4953 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4954 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4955 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4956 {}
4957 };
6b0f95c4 4958 static const struct coef_fw coef0233[] = {
54db6c39
TI
4959 WRITE_COEF(0x1b, 0x0c0b),
4960 WRITE_COEF(0x45, 0xc429),
4961 UPDATE_COEF(0x35, 0x4000, 0),
4962 WRITE_COEF(0x06, 0x2104),
4963 WRITE_COEF(0x1a, 0x0001),
4964 WRITE_COEF(0x26, 0x0004),
4965 WRITE_COEF(0x32, 0x42a3),
4966 {}
4967 };
6b0f95c4 4968 static const struct coef_fw coef0288[] = {
f3b70332
KY
4969 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4970 UPDATE_COEF(0x50, 0x2000, 0x2000),
4971 UPDATE_COEF(0x56, 0x0006, 0x0006),
4972 UPDATE_COEF(0x66, 0x0008, 0),
4973 UPDATE_COEF(0x67, 0x2000, 0),
4974 {}
4975 };
6b0f95c4 4976 static const struct coef_fw coef0298[] = {
89542936
KY
4977 UPDATE_COEF(0x19, 0x1300, 0x0300),
4978 {}
4979 };
6b0f95c4 4980 static const struct coef_fw coef0292[] = {
54db6c39
TI
4981 WRITE_COEF(0x76, 0x000e),
4982 WRITE_COEF(0x6c, 0x2400),
4983 WRITE_COEF(0x18, 0x7308),
4984 WRITE_COEF(0x6b, 0xc429),
4985 {}
4986 };
6b0f95c4 4987 static const struct coef_fw coef0293[] = {
54db6c39
TI
4988 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4989 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4990 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4991 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4992 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4993 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4994 {}
4995 };
6b0f95c4 4996 static const struct coef_fw coef0668[] = {
54db6c39
TI
4997 WRITE_COEF(0x15, 0x0d40),
4998 WRITE_COEF(0xb7, 0x802b),
4999 {}
5000 };
6b0f95c4 5001 static const struct coef_fw coef0225[] = {
5a36767a 5002 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
5003 {}
5004 };
6b0f95c4 5005 static const struct coef_fw coef0274[] = {
71683c32
KY
5006 UPDATE_COEF(0x4a, 0x0100, 0),
5007 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5008 UPDATE_COEF(0x6b, 0xf000, 0x5000),
5009 UPDATE_COEF(0x4a, 0x0010, 0),
5010 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5011 WRITE_COEF(0x45, 0x5289),
5012 UPDATE_COEF(0x4a, 0x0c00, 0),
5013 {}
5014 };
54db6c39 5015
92666d45
KY
5016 if (spec->no_internal_mic_pin) {
5017 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5018 return;
5019 }
5020
7639a06c 5021 switch (codec->core.vendor_id) {
9a22a8f5 5022 case 0x10ec0255:
e69e7e03
KY
5023 alc_process_coef_fw(codec, coef0255);
5024 break;
1948fc06 5025 case 0x10ec0230:
736f20a7 5026 case 0x10ec0236:
7081adf3 5027 case 0x10ec0256:
527f4643 5028 case 0x19e58326:
e69e7e03 5029 alc_process_coef_fw(codec, coef0256);
9a22a8f5 5030 break;
71683c32
KY
5031 case 0x10ec0234:
5032 case 0x10ec0274:
5033 case 0x10ec0294:
5034 alc_process_coef_fw(codec, coef0274);
5035 break;
13fd08a3 5036 case 0x10ec0233:
73bdd597 5037 case 0x10ec0283:
54db6c39 5038 alc_process_coef_fw(codec, coef0233);
73bdd597 5039 break;
f3b70332
KY
5040 case 0x10ec0286:
5041 case 0x10ec0288:
89542936
KY
5042 alc_process_coef_fw(codec, coef0288);
5043 break;
1a5bc8d9 5044 case 0x10ec0298:
89542936 5045 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
5046 alc_process_coef_fw(codec, coef0288);
5047 break;
73bdd597 5048 case 0x10ec0292:
54db6c39 5049 alc_process_coef_fw(codec, coef0292);
73bdd597 5050 break;
a22aa26f 5051 case 0x10ec0293:
54db6c39 5052 alc_process_coef_fw(codec, coef0293);
a22aa26f 5053 break;
73bdd597 5054 case 0x10ec0668:
54db6c39 5055 alc_process_coef_fw(codec, coef0668);
73bdd597 5056 break;
c2b691ee 5057 case 0x10ec0215:
4cc9b9d6 5058 case 0x10ec0225:
c2b691ee 5059 case 0x10ec0285:
7d727869 5060 case 0x10ec0295:
c2b691ee 5061 case 0x10ec0289:
28f1f9b2 5062 case 0x10ec0299:
4d4b0c52 5063 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5064 alc_process_coef_fw(codec, coef0225);
5065 break;
78f4f7c2
KY
5066 case 0x10ec0867:
5067 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5068 break;
73bdd597 5069 }
4e76a883 5070 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
5071}
5072
5073
5074static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5075 hda_nid_t mic_pin)
5076{
6b0f95c4 5077 static const struct coef_fw coef0255[] = {
54db6c39
TI
5078 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5079 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5080 {}
5081 };
6b0f95c4 5082 static const struct coef_fw coef0256[] = {
717f43d8
KY
5083 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5084 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5085 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5086 {}
5087 };
6b0f95c4 5088 static const struct coef_fw coef0233[] = {
54db6c39
TI
5089 UPDATE_COEF(0x35, 0, 1<<14),
5090 WRITE_COEF(0x06, 0x2100),
5091 WRITE_COEF(0x1a, 0x0021),
5092 WRITE_COEF(0x26, 0x008c),
5093 {}
5094 };
6b0f95c4 5095 static const struct coef_fw coef0288[] = {
89542936 5096 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
5097 UPDATE_COEF(0x50, 0x2000, 0),
5098 UPDATE_COEF(0x56, 0x0006, 0),
5099 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5100 UPDATE_COEF(0x66, 0x0008, 0x0008),
5101 UPDATE_COEF(0x67, 0x2000, 0x2000),
5102 {}
5103 };
6b0f95c4 5104 static const struct coef_fw coef0292[] = {
54db6c39
TI
5105 WRITE_COEF(0x19, 0xa208),
5106 WRITE_COEF(0x2e, 0xacf0),
5107 {}
5108 };
6b0f95c4 5109 static const struct coef_fw coef0293[] = {
54db6c39
TI
5110 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5111 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5112 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5113 {}
5114 };
6b0f95c4 5115 static const struct coef_fw coef0688[] = {
54db6c39
TI
5116 WRITE_COEF(0xb7, 0x802b),
5117 WRITE_COEF(0xb5, 0x1040),
5118 UPDATE_COEF(0xc3, 0, 1<<12),
5119 {}
5120 };
6b0f95c4 5121 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
5122 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5123 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5124 UPDATE_COEF(0x63, 3<<14, 0),
5125 {}
5126 };
6b0f95c4 5127 static const struct coef_fw coef0274[] = {
71683c32
KY
5128 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5129 UPDATE_COEF(0x4a, 0x0010, 0),
5130 UPDATE_COEF(0x6b, 0xf000, 0),
5131 {}
5132 };
54db6c39 5133
7639a06c 5134 switch (codec->core.vendor_id) {
9a22a8f5
KY
5135 case 0x10ec0255:
5136 alc_write_coef_idx(codec, 0x45, 0xc489);
5137 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5138 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5139 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5140 break;
1948fc06 5141 case 0x10ec0230:
717f43d8
KY
5142 case 0x10ec0236:
5143 case 0x10ec0256:
527f4643 5144 case 0x19e58326:
717f43d8
KY
5145 alc_write_coef_idx(codec, 0x45, 0xc489);
5146 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5147 alc_process_coef_fw(codec, coef0256);
5148 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5149 break;
71683c32
KY
5150 case 0x10ec0234:
5151 case 0x10ec0274:
5152 case 0x10ec0294:
5153 alc_write_coef_idx(codec, 0x45, 0x4689);
5154 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5155 alc_process_coef_fw(codec, coef0274);
5156 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5157 break;
13fd08a3 5158 case 0x10ec0233:
73bdd597
DH
5159 case 0x10ec0283:
5160 alc_write_coef_idx(codec, 0x45, 0xc429);
5161 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5162 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5163 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5164 break;
f3b70332
KY
5165 case 0x10ec0286:
5166 case 0x10ec0288:
1a5bc8d9 5167 case 0x10ec0298:
f3b70332
KY
5168 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5169 alc_process_coef_fw(codec, coef0288);
5170 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5171 break;
73bdd597
DH
5172 case 0x10ec0292:
5173 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5174 alc_process_coef_fw(codec, coef0292);
73bdd597 5175 break;
a22aa26f
KY
5176 case 0x10ec0293:
5177 /* Set to TRS mode */
5178 alc_write_coef_idx(codec, 0x45, 0xc429);
5179 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5180 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5181 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5182 break;
78f4f7c2
KY
5183 case 0x10ec0867:
5184 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5185 fallthrough;
9eb5d0e6 5186 case 0x10ec0221:
1f8b46cd
DH
5187 case 0x10ec0662:
5188 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5189 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5190 break;
73bdd597
DH
5191 case 0x10ec0668:
5192 alc_write_coef_idx(codec, 0x11, 0x0001);
5193 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5194 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5195 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5196 break;
c2b691ee 5197 case 0x10ec0215:
4cc9b9d6 5198 case 0x10ec0225:
c2b691ee 5199 case 0x10ec0285:
7d727869 5200 case 0x10ec0295:
c2b691ee 5201 case 0x10ec0289:
28f1f9b2 5202 case 0x10ec0299:
5a36767a 5203 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5204 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5205 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5206 alc_process_coef_fw(codec, coef0225);
5207 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5208 break;
73bdd597 5209 }
4e76a883 5210 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5211}
5212
5213static void alc_headset_mode_default(struct hda_codec *codec)
5214{
6b0f95c4 5215 static const struct coef_fw coef0225[] = {
5a36767a
KY
5216 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5217 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5218 UPDATE_COEF(0x49, 3<<8, 0<<8),
5219 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5220 UPDATE_COEF(0x63, 3<<14, 0),
5221 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5222 {}
5223 };
6b0f95c4 5224 static const struct coef_fw coef0255[] = {
54db6c39
TI
5225 WRITE_COEF(0x45, 0xc089),
5226 WRITE_COEF(0x45, 0xc489),
5227 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5228 WRITE_COEF(0x49, 0x0049),
5229 {}
5230 };
6b0f95c4 5231 static const struct coef_fw coef0256[] = {
717f43d8
KY
5232 WRITE_COEF(0x45, 0xc489),
5233 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5234 WRITE_COEF(0x49, 0x0049),
5235 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5236 WRITE_COEF(0x06, 0x6100),
5237 {}
5238 };
6b0f95c4 5239 static const struct coef_fw coef0233[] = {
54db6c39
TI
5240 WRITE_COEF(0x06, 0x2100),
5241 WRITE_COEF(0x32, 0x4ea3),
5242 {}
5243 };
6b0f95c4 5244 static const struct coef_fw coef0288[] = {
f3b70332
KY
5245 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5246 UPDATE_COEF(0x50, 0x2000, 0x2000),
5247 UPDATE_COEF(0x56, 0x0006, 0x0006),
5248 UPDATE_COEF(0x66, 0x0008, 0),
5249 UPDATE_COEF(0x67, 0x2000, 0),
5250 {}
5251 };
6b0f95c4 5252 static const struct coef_fw coef0292[] = {
54db6c39
TI
5253 WRITE_COEF(0x76, 0x000e),
5254 WRITE_COEF(0x6c, 0x2400),
5255 WRITE_COEF(0x6b, 0xc429),
5256 WRITE_COEF(0x18, 0x7308),
5257 {}
5258 };
6b0f95c4 5259 static const struct coef_fw coef0293[] = {
54db6c39
TI
5260 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5261 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5262 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5263 {}
5264 };
6b0f95c4 5265 static const struct coef_fw coef0688[] = {
54db6c39
TI
5266 WRITE_COEF(0x11, 0x0041),
5267 WRITE_COEF(0x15, 0x0d40),
5268 WRITE_COEF(0xb7, 0x802b),
5269 {}
5270 };
6b0f95c4 5271 static const struct coef_fw coef0274[] = {
71683c32
KY
5272 WRITE_COEF(0x45, 0x4289),
5273 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5274 UPDATE_COEF(0x6b, 0x0f00, 0),
5275 UPDATE_COEF(0x49, 0x0300, 0x0300),
5276 {}
5277 };
54db6c39 5278
7639a06c 5279 switch (codec->core.vendor_id) {
c2b691ee 5280 case 0x10ec0215:
2ae95577 5281 case 0x10ec0225:
c2b691ee 5282 case 0x10ec0285:
7d727869 5283 case 0x10ec0295:
c2b691ee 5284 case 0x10ec0289:
28f1f9b2 5285 case 0x10ec0299:
5a36767a 5286 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5287 alc_process_coef_fw(codec, coef0225);
5288 break;
9a22a8f5 5289 case 0x10ec0255:
54db6c39 5290 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5291 break;
1948fc06 5292 case 0x10ec0230:
717f43d8
KY
5293 case 0x10ec0236:
5294 case 0x10ec0256:
527f4643 5295 case 0x19e58326:
717f43d8
KY
5296 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5297 alc_write_coef_idx(codec, 0x45, 0xc089);
5298 msleep(50);
5299 alc_process_coef_fw(codec, coef0256);
5300 break;
71683c32
KY
5301 case 0x10ec0234:
5302 case 0x10ec0274:
5303 case 0x10ec0294:
5304 alc_process_coef_fw(codec, coef0274);
5305 break;
13fd08a3 5306 case 0x10ec0233:
73bdd597 5307 case 0x10ec0283:
54db6c39 5308 alc_process_coef_fw(codec, coef0233);
73bdd597 5309 break;
f3b70332
KY
5310 case 0x10ec0286:
5311 case 0x10ec0288:
1a5bc8d9 5312 case 0x10ec0298:
f3b70332
KY
5313 alc_process_coef_fw(codec, coef0288);
5314 break;
73bdd597 5315 case 0x10ec0292:
54db6c39 5316 alc_process_coef_fw(codec, coef0292);
73bdd597 5317 break;
a22aa26f 5318 case 0x10ec0293:
54db6c39 5319 alc_process_coef_fw(codec, coef0293);
a22aa26f 5320 break;
73bdd597 5321 case 0x10ec0668:
54db6c39 5322 alc_process_coef_fw(codec, coef0688);
73bdd597 5323 break;
78f4f7c2
KY
5324 case 0x10ec0867:
5325 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5326 break;
73bdd597 5327 }
4e76a883 5328 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5329}
5330
5331/* Iphone type */
5332static void alc_headset_mode_ctia(struct hda_codec *codec)
5333{
89542936
KY
5334 int val;
5335
6b0f95c4 5336 static const struct coef_fw coef0255[] = {
54db6c39
TI
5337 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5338 WRITE_COEF(0x1b, 0x0c2b),
5339 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5340 {}
5341 };
6b0f95c4 5342 static const struct coef_fw coef0256[] = {
e69e7e03 5343 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5344 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5345 {}
5346 };
6b0f95c4 5347 static const struct coef_fw coef0233[] = {
54db6c39
TI
5348 WRITE_COEF(0x45, 0xd429),
5349 WRITE_COEF(0x1b, 0x0c2b),
5350 WRITE_COEF(0x32, 0x4ea3),
5351 {}
5352 };
6b0f95c4 5353 static const struct coef_fw coef0288[] = {
f3b70332
KY
5354 UPDATE_COEF(0x50, 0x2000, 0x2000),
5355 UPDATE_COEF(0x56, 0x0006, 0x0006),
5356 UPDATE_COEF(0x66, 0x0008, 0),
5357 UPDATE_COEF(0x67, 0x2000, 0),
5358 {}
5359 };
6b0f95c4 5360 static const struct coef_fw coef0292[] = {
54db6c39
TI
5361 WRITE_COEF(0x6b, 0xd429),
5362 WRITE_COEF(0x76, 0x0008),
5363 WRITE_COEF(0x18, 0x7388),
5364 {}
5365 };
6b0f95c4 5366 static const struct coef_fw coef0293[] = {
54db6c39
TI
5367 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5368 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5369 {}
5370 };
6b0f95c4 5371 static const struct coef_fw coef0688[] = {
54db6c39
TI
5372 WRITE_COEF(0x11, 0x0001),
5373 WRITE_COEF(0x15, 0x0d60),
5374 WRITE_COEF(0xc3, 0x0000),
5375 {}
5376 };
6b0f95c4 5377 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5378 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5379 UPDATE_COEF(0x63, 3<<14, 2<<14),
5380 {}
5381 };
6b0f95c4 5382 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5383 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5384 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5385 {}
5386 };
54db6c39 5387
7639a06c 5388 switch (codec->core.vendor_id) {
9a22a8f5 5389 case 0x10ec0255:
54db6c39 5390 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5391 break;
1948fc06 5392 case 0x10ec0230:
736f20a7 5393 case 0x10ec0236:
e69e7e03 5394 case 0x10ec0256:
527f4643 5395 case 0x19e58326:
e69e7e03
KY
5396 alc_process_coef_fw(codec, coef0256);
5397 break;
71683c32
KY
5398 case 0x10ec0234:
5399 case 0x10ec0274:
5400 case 0x10ec0294:
5401 alc_write_coef_idx(codec, 0x45, 0xd689);
5402 break;
13fd08a3 5403 case 0x10ec0233:
73bdd597 5404 case 0x10ec0283:
54db6c39 5405 alc_process_coef_fw(codec, coef0233);
73bdd597 5406 break;
1a5bc8d9 5407 case 0x10ec0298:
89542936
KY
5408 val = alc_read_coef_idx(codec, 0x50);
5409 if (val & (1 << 12)) {
5410 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5411 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5412 msleep(300);
5413 } else {
5414 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5415 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5416 msleep(300);
5417 }
5418 break;
f3b70332
KY
5419 case 0x10ec0286:
5420 case 0x10ec0288:
5421 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5422 msleep(300);
5423 alc_process_coef_fw(codec, coef0288);
5424 break;
73bdd597 5425 case 0x10ec0292:
54db6c39 5426 alc_process_coef_fw(codec, coef0292);
73bdd597 5427 break;
a22aa26f 5428 case 0x10ec0293:
54db6c39 5429 alc_process_coef_fw(codec, coef0293);
a22aa26f 5430 break;
73bdd597 5431 case 0x10ec0668:
54db6c39 5432 alc_process_coef_fw(codec, coef0688);
73bdd597 5433 break;
c2b691ee 5434 case 0x10ec0215:
4cc9b9d6 5435 case 0x10ec0225:
c2b691ee 5436 case 0x10ec0285:
7d727869 5437 case 0x10ec0295:
c2b691ee 5438 case 0x10ec0289:
28f1f9b2 5439 case 0x10ec0299:
5a36767a
KY
5440 val = alc_read_coef_idx(codec, 0x45);
5441 if (val & (1 << 9))
5442 alc_process_coef_fw(codec, coef0225_2);
5443 else
5444 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5445 break;
78f4f7c2
KY
5446 case 0x10ec0867:
5447 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5448 break;
73bdd597 5449 }
4e76a883 5450 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5451}
5452
5453/* Nokia type */
5454static void alc_headset_mode_omtp(struct hda_codec *codec)
5455{
6b0f95c4 5456 static const struct coef_fw coef0255[] = {
54db6c39
TI
5457 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5458 WRITE_COEF(0x1b, 0x0c2b),
5459 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5460 {}
5461 };
6b0f95c4 5462 static const struct coef_fw coef0256[] = {
e69e7e03 5463 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5464 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5465 {}
5466 };
6b0f95c4 5467 static const struct coef_fw coef0233[] = {
54db6c39
TI
5468 WRITE_COEF(0x45, 0xe429),
5469 WRITE_COEF(0x1b, 0x0c2b),
5470 WRITE_COEF(0x32, 0x4ea3),
5471 {}
5472 };
6b0f95c4 5473 static const struct coef_fw coef0288[] = {
f3b70332
KY
5474 UPDATE_COEF(0x50, 0x2000, 0x2000),
5475 UPDATE_COEF(0x56, 0x0006, 0x0006),
5476 UPDATE_COEF(0x66, 0x0008, 0),
5477 UPDATE_COEF(0x67, 0x2000, 0),
5478 {}
5479 };
6b0f95c4 5480 static const struct coef_fw coef0292[] = {
54db6c39
TI
5481 WRITE_COEF(0x6b, 0xe429),
5482 WRITE_COEF(0x76, 0x0008),
5483 WRITE_COEF(0x18, 0x7388),
5484 {}
5485 };
6b0f95c4 5486 static const struct coef_fw coef0293[] = {
54db6c39
TI
5487 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5488 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5489 {}
5490 };
6b0f95c4 5491 static const struct coef_fw coef0688[] = {
54db6c39
TI
5492 WRITE_COEF(0x11, 0x0001),
5493 WRITE_COEF(0x15, 0x0d50),
5494 WRITE_COEF(0xc3, 0x0000),
5495 {}
5496 };
6b0f95c4 5497 static const struct coef_fw coef0225[] = {
4cc9b9d6 5498 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5499 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5500 {}
5501 };
54db6c39 5502
7639a06c 5503 switch (codec->core.vendor_id) {
9a22a8f5 5504 case 0x10ec0255:
54db6c39 5505 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5506 break;
1948fc06 5507 case 0x10ec0230:
736f20a7 5508 case 0x10ec0236:
e69e7e03 5509 case 0x10ec0256:
527f4643 5510 case 0x19e58326:
e69e7e03
KY
5511 alc_process_coef_fw(codec, coef0256);
5512 break;
71683c32
KY
5513 case 0x10ec0234:
5514 case 0x10ec0274:
5515 case 0x10ec0294:
5516 alc_write_coef_idx(codec, 0x45, 0xe689);
5517 break;
13fd08a3 5518 case 0x10ec0233:
73bdd597 5519 case 0x10ec0283:
54db6c39 5520 alc_process_coef_fw(codec, coef0233);
73bdd597 5521 break;
1a5bc8d9
KY
5522 case 0x10ec0298:
5523 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5524 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5525 msleep(300);
5526 break;
f3b70332
KY
5527 case 0x10ec0286:
5528 case 0x10ec0288:
5529 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5530 msleep(300);
5531 alc_process_coef_fw(codec, coef0288);
5532 break;
73bdd597 5533 case 0x10ec0292:
54db6c39 5534 alc_process_coef_fw(codec, coef0292);
73bdd597 5535 break;
a22aa26f 5536 case 0x10ec0293:
54db6c39 5537 alc_process_coef_fw(codec, coef0293);
a22aa26f 5538 break;
73bdd597 5539 case 0x10ec0668:
54db6c39 5540 alc_process_coef_fw(codec, coef0688);
73bdd597 5541 break;
c2b691ee 5542 case 0x10ec0215:
4cc9b9d6 5543 case 0x10ec0225:
c2b691ee 5544 case 0x10ec0285:
7d727869 5545 case 0x10ec0295:
c2b691ee 5546 case 0x10ec0289:
28f1f9b2 5547 case 0x10ec0299:
4cc9b9d6
KY
5548 alc_process_coef_fw(codec, coef0225);
5549 break;
73bdd597 5550 }
4e76a883 5551 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5552}
5553
5554static void alc_determine_headset_type(struct hda_codec *codec)
5555{
5556 int val;
5557 bool is_ctia = false;
5558 struct alc_spec *spec = codec->spec;
6b0f95c4 5559 static const struct coef_fw coef0255[] = {
54db6c39
TI
5560 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5561 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5562 conteol) */
5563 {}
5564 };
6b0f95c4 5565 static const struct coef_fw coef0288[] = {
f3b70332
KY
5566 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5567 {}
5568 };
6b0f95c4 5569 static const struct coef_fw coef0298[] = {
89542936
KY
5570 UPDATE_COEF(0x50, 0x2000, 0x2000),
5571 UPDATE_COEF(0x56, 0x0006, 0x0006),
5572 UPDATE_COEF(0x66, 0x0008, 0),
5573 UPDATE_COEF(0x67, 0x2000, 0),
5574 UPDATE_COEF(0x19, 0x1300, 0x1300),
5575 {}
5576 };
6b0f95c4 5577 static const struct coef_fw coef0293[] = {
54db6c39
TI
5578 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5579 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5580 {}
5581 };
6b0f95c4 5582 static const struct coef_fw coef0688[] = {
54db6c39
TI
5583 WRITE_COEF(0x11, 0x0001),
5584 WRITE_COEF(0xb7, 0x802b),
5585 WRITE_COEF(0x15, 0x0d60),
5586 WRITE_COEF(0xc3, 0x0c00),
5587 {}
5588 };
6b0f95c4 5589 static const struct coef_fw coef0274[] = {
71683c32
KY
5590 UPDATE_COEF(0x4a, 0x0010, 0),
5591 UPDATE_COEF(0x4a, 0x8000, 0),
5592 WRITE_COEF(0x45, 0xd289),
5593 UPDATE_COEF(0x49, 0x0300, 0x0300),
5594 {}
5595 };
73bdd597 5596
92666d45
KY
5597 if (spec->no_internal_mic_pin) {
5598 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5599 return;
5600 }
5601
7639a06c 5602 switch (codec->core.vendor_id) {
9a22a8f5 5603 case 0x10ec0255:
717f43d8
KY
5604 alc_process_coef_fw(codec, coef0255);
5605 msleep(300);
5606 val = alc_read_coef_idx(codec, 0x46);
5607 is_ctia = (val & 0x0070) == 0x0070;
5608 break;
1948fc06 5609 case 0x10ec0230:
717f43d8 5610 case 0x10ec0236:
7081adf3 5611 case 0x10ec0256:
527f4643 5612 case 0x19e58326:
717f43d8
KY
5613 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5614 alc_write_coef_idx(codec, 0x06, 0x6104);
5615 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5616
5617 snd_hda_codec_write(codec, 0x21, 0,
5618 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5619 msleep(80);
5620 snd_hda_codec_write(codec, 0x21, 0,
5621 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5622
54db6c39 5623 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5624 msleep(300);
5625 val = alc_read_coef_idx(codec, 0x46);
5626 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5627
5628 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5629 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5630
5631 snd_hda_codec_write(codec, 0x21, 0,
5632 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5633 msleep(80);
5634 snd_hda_codec_write(codec, 0x21, 0,
5635 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5636 break;
71683c32
KY
5637 case 0x10ec0234:
5638 case 0x10ec0274:
5639 case 0x10ec0294:
5640 alc_process_coef_fw(codec, coef0274);
febf2256 5641 msleep(850);
71683c32
KY
5642 val = alc_read_coef_idx(codec, 0x46);
5643 is_ctia = (val & 0x00f0) == 0x00f0;
5644 break;
13fd08a3 5645 case 0x10ec0233:
73bdd597
DH
5646 case 0x10ec0283:
5647 alc_write_coef_idx(codec, 0x45, 0xd029);
5648 msleep(300);
5649 val = alc_read_coef_idx(codec, 0x46);
5650 is_ctia = (val & 0x0070) == 0x0070;
5651 break;
1a5bc8d9 5652 case 0x10ec0298:
89542936
KY
5653 snd_hda_codec_write(codec, 0x21, 0,
5654 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5655 msleep(100);
5656 snd_hda_codec_write(codec, 0x21, 0,
5657 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5658 msleep(200);
5659
5660 val = alc_read_coef_idx(codec, 0x50);
5661 if (val & (1 << 12)) {
5662 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5663 alc_process_coef_fw(codec, coef0288);
5664 msleep(350);
5665 val = alc_read_coef_idx(codec, 0x50);
5666 is_ctia = (val & 0x0070) == 0x0070;
5667 } else {
5668 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5669 alc_process_coef_fw(codec, coef0288);
5670 msleep(350);
5671 val = alc_read_coef_idx(codec, 0x50);
5672 is_ctia = (val & 0x0070) == 0x0070;
5673 }
5674 alc_process_coef_fw(codec, coef0298);
5675 snd_hda_codec_write(codec, 0x21, 0,
5676 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5677 msleep(75);
5678 snd_hda_codec_write(codec, 0x21, 0,
5679 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5680 break;
f3b70332
KY
5681 case 0x10ec0286:
5682 case 0x10ec0288:
5683 alc_process_coef_fw(codec, coef0288);
5684 msleep(350);
5685 val = alc_read_coef_idx(codec, 0x50);
5686 is_ctia = (val & 0x0070) == 0x0070;
5687 break;
73bdd597
DH
5688 case 0x10ec0292:
5689 alc_write_coef_idx(codec, 0x6b, 0xd429);
5690 msleep(300);
5691 val = alc_read_coef_idx(codec, 0x6c);
5692 is_ctia = (val & 0x001c) == 0x001c;
5693 break;
a22aa26f 5694 case 0x10ec0293:
54db6c39 5695 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5696 msleep(300);
5697 val = alc_read_coef_idx(codec, 0x46);
5698 is_ctia = (val & 0x0070) == 0x0070;
5699 break;
73bdd597 5700 case 0x10ec0668:
54db6c39 5701 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5702 msleep(300);
5703 val = alc_read_coef_idx(codec, 0xbe);
5704 is_ctia = (val & 0x1c02) == 0x1c02;
5705 break;
c2b691ee 5706 case 0x10ec0215:
4cc9b9d6 5707 case 0x10ec0225:
c2b691ee 5708 case 0x10ec0285:
7d727869 5709 case 0x10ec0295:
c2b691ee 5710 case 0x10ec0289:
28f1f9b2 5711 case 0x10ec0299:
da911b1f
KY
5712 snd_hda_codec_write(codec, 0x21, 0,
5713 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5714 msleep(80);
5715 snd_hda_codec_write(codec, 0x21, 0,
5716 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5717
5a36767a
KY
5718 alc_process_coef_fw(codec, alc225_pre_hsmode);
5719 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5720 val = alc_read_coef_idx(codec, 0x45);
5721 if (val & (1 << 9)) {
5722 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5723 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5724 msleep(800);
5725 val = alc_read_coef_idx(codec, 0x46);
5726 is_ctia = (val & 0x00f0) == 0x00f0;
5727 } else {
5728 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5729 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5730 msleep(800);
5731 val = alc_read_coef_idx(codec, 0x46);
5732 is_ctia = (val & 0x00f0) == 0x00f0;
5733 }
5734 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5735 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5736 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5737
5738 snd_hda_codec_write(codec, 0x21, 0,
5739 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5740 msleep(80);
5741 snd_hda_codec_write(codec, 0x21, 0,
5742 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5743 break;
78f4f7c2
KY
5744 case 0x10ec0867:
5745 is_ctia = true;
5746 break;
73bdd597
DH
5747 }
5748
4e76a883 5749 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5750 is_ctia ? "yes" : "no");
5751 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5752}
5753
5754static void alc_update_headset_mode(struct hda_codec *codec)
5755{
5756 struct alc_spec *spec = codec->spec;
5757
5758 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5759 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5760
5761 int new_headset_mode;
5762
5763 if (!snd_hda_jack_detect(codec, hp_pin))
5764 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5765 else if (mux_pin == spec->headset_mic_pin)
5766 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5767 else if (mux_pin == spec->headphone_mic_pin)
5768 new_headset_mode = ALC_HEADSET_MODE_MIC;
5769 else
5770 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5771
5959a6bc
DH
5772 if (new_headset_mode == spec->current_headset_mode) {
5773 snd_hda_gen_update_outputs(codec);
73bdd597 5774 return;
5959a6bc 5775 }
73bdd597
DH
5776
5777 switch (new_headset_mode) {
5778 case ALC_HEADSET_MODE_UNPLUGGED:
5779 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5780 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5781 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5782 spec->gen.hp_jack_present = false;
5783 break;
5784 case ALC_HEADSET_MODE_HEADSET:
5785 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5786 alc_determine_headset_type(codec);
5787 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5788 alc_headset_mode_ctia(codec);
5789 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5790 alc_headset_mode_omtp(codec);
5791 spec->gen.hp_jack_present = true;
5792 break;
5793 case ALC_HEADSET_MODE_MIC:
5794 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5795 spec->gen.hp_jack_present = false;
5796 break;
5797 case ALC_HEADSET_MODE_HEADPHONE:
5798 alc_headset_mode_default(codec);
5799 spec->gen.hp_jack_present = true;
5800 break;
5801 }
5802 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5803 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5804 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5805 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5806 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5807 PIN_VREFHIZ);
5808 }
5809 spec->current_headset_mode = new_headset_mode;
5810
5811 snd_hda_gen_update_outputs(codec);
5812}
5813
5814static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5815 struct snd_kcontrol *kcontrol,
5816 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5817{
5818 alc_update_headset_mode(codec);
5819}
5820
1a4f69d5
TI
5821static void alc_update_headset_jack_cb(struct hda_codec *codec,
5822 struct hda_jack_callback *jack)
73bdd597 5823{
73bdd597 5824 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5825 alc_update_headset_mode(codec);
73bdd597
DH
5826}
5827
5828static void alc_probe_headset_mode(struct hda_codec *codec)
5829{
5830 int i;
5831 struct alc_spec *spec = codec->spec;
5832 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5833
5834 /* Find mic pins */
5835 for (i = 0; i < cfg->num_inputs; i++) {
5836 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5837 spec->headset_mic_pin = cfg->inputs[i].pin;
5838 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5839 spec->headphone_mic_pin = cfg->inputs[i].pin;
5840 }
5841
0bed2aa3 5842 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5843 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5844 spec->gen.automute_hook = alc_update_headset_mode;
5845 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5846}
5847
5848static void alc_fixup_headset_mode(struct hda_codec *codec,
5849 const struct hda_fixup *fix, int action)
5850{
5851 struct alc_spec *spec = codec->spec;
5852
5853 switch (action) {
5854 case HDA_FIXUP_ACT_PRE_PROBE:
5855 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5856 break;
5857 case HDA_FIXUP_ACT_PROBE:
5858 alc_probe_headset_mode(codec);
5859 break;
5860 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5861 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5862 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5863 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5864 }
73bdd597
DH
5865 alc_update_headset_mode(codec);
5866 break;
5867 }
5868}
5869
5870static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5871 const struct hda_fixup *fix, int action)
5872{
5873 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5874 struct alc_spec *spec = codec->spec;
5875 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5876 }
5877 else
5878 alc_fixup_headset_mode(codec, fix, action);
5879}
5880
31278997
KY
5881static void alc255_set_default_jack_type(struct hda_codec *codec)
5882{
5883 /* Set to iphone type */
6b0f95c4 5884 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5885 WRITE_COEF(0x1b, 0x880b),
5886 WRITE_COEF(0x45, 0xd089),
5887 WRITE_COEF(0x1b, 0x080b),
5888 WRITE_COEF(0x46, 0x0004),
5889 WRITE_COEF(0x1b, 0x0c0b),
5890 {}
5891 };
6b0f95c4 5892 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5893 WRITE_COEF(0x1b, 0x884b),
5894 WRITE_COEF(0x45, 0xd089),
5895 WRITE_COEF(0x1b, 0x084b),
5896 WRITE_COEF(0x46, 0x0004),
5897 WRITE_COEF(0x1b, 0x0c4b),
5898 {}
5899 };
5900 switch (codec->core.vendor_id) {
5901 case 0x10ec0255:
5902 alc_process_coef_fw(codec, alc255fw);
5903 break;
1948fc06 5904 case 0x10ec0230:
736f20a7 5905 case 0x10ec0236:
e69e7e03 5906 case 0x10ec0256:
527f4643 5907 case 0x19e58326:
e69e7e03
KY
5908 alc_process_coef_fw(codec, alc256fw);
5909 break;
5910 }
31278997
KY
5911 msleep(30);
5912}
5913
9a22a8f5
KY
5914static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5915 const struct hda_fixup *fix, int action)
5916{
5917 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5918 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5919 }
5920 alc_fixup_headset_mode(codec, fix, action);
5921}
5922
31278997
KY
5923static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5924 const struct hda_fixup *fix, int action)
5925{
5926 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5927 struct alc_spec *spec = codec->spec;
5928 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5929 alc255_set_default_jack_type(codec);
72cea3a3 5930 }
31278997
KY
5931 else
5932 alc_fixup_headset_mode(codec, fix, action);
5933}
5934
e1e62b98
KY
5935static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5936 struct hda_jack_callback *jack)
5937{
5938 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5939
5940 alc_update_headset_jack_cb(codec, jack);
5941 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5942 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5943}
5944
5945static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5946 const struct hda_fixup *fix, int action)
5947{
5948 alc_fixup_headset_mode(codec, fix, action);
5949 if (action == HDA_FIXUP_ACT_PROBE) {
5950 struct alc_spec *spec = codec->spec;
d44a6864
TI
5951 /* toggled via hp_automute_hook */
5952 spec->gpio_mask |= 0x40;
5953 spec->gpio_dir |= 0x40;
e1e62b98
KY
5954 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5955 }
5956}
5957
493a52a9
HW
5958static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5959 const struct hda_fixup *fix, int action)
5960{
5961 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5962 struct alc_spec *spec = codec->spec;
5963 spec->gen.auto_mute_via_amp = 1;
5964 }
5965}
5966
9b745ab8
TI
5967static void alc_fixup_no_shutup(struct hda_codec *codec,
5968 const struct hda_fixup *fix, int action)
5969{
efe55732 5970 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5971 struct alc_spec *spec = codec->spec;
c0ca5ece 5972 spec->no_shutup_pins = 1;
9b745ab8
TI
5973 }
5974}
5975
5e6db669
GM
5976static void alc_fixup_disable_aamix(struct hda_codec *codec,
5977 const struct hda_fixup *fix, int action)
5978{
5979 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5980 struct alc_spec *spec = codec->spec;
5981 /* Disable AA-loopback as it causes white noise */
5982 spec->gen.mixer_nid = 0;
5983 }
5984}
5985
7f57d803
TI
5986/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5987static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5988 const struct hda_fixup *fix, int action)
5989{
5990 static const struct hda_pintbl pincfgs[] = {
5991 { 0x16, 0x21211010 }, /* dock headphone */
5992 { 0x19, 0x21a11010 }, /* dock mic */
5993 { }
5994 };
5995 struct alc_spec *spec = codec->spec;
5996
5997 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5998 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5999 codec->power_save_node = 0; /* avoid click noises */
6000 snd_hda_apply_pincfgs(codec, pincfgs);
6001 }
6002}
6003
61fcf8ec
KY
6004static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6005 const struct hda_fixup *fix, int action)
6006{
6007 static const struct hda_pintbl pincfgs[] = {
6008 { 0x17, 0x21211010 }, /* dock headphone */
6009 { 0x19, 0x21a11010 }, /* dock mic */
6010 { }
6011 };
6012 struct alc_spec *spec = codec->spec;
6013
6014 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6015 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
6016 snd_hda_apply_pincfgs(codec, pincfgs);
6017 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
6018 /* Enable DOCK device */
6019 snd_hda_codec_write(codec, 0x17, 0,
6020 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6021 /* Enable DOCK device */
6022 snd_hda_codec_write(codec, 0x19, 0,
6023 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
6024 }
6025}
6026
399c01aa
TI
6027static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6028 const struct hda_fixup *fix, int action)
6029{
6030 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6031 * the speaker output becomes too low by some reason on Thinkpads with
6032 * ALC298 codec
6033 */
6034 static const hda_nid_t preferred_pairs[] = {
6035 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6036 0
6037 };
6038 struct alc_spec *spec = codec->spec;
6039
6040 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6041 spec->gen.preferred_dacs = preferred_pairs;
6042}
6043
8eedd3a7
TI
6044static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6045 const struct hda_fixup *fix, int action)
6046{
6047 static const hda_nid_t preferred_pairs[] = {
6048 0x17, 0x02, 0x21, 0x03, 0
6049 };
6050 struct alc_spec *spec = codec->spec;
6051
6052 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6053 spec->gen.preferred_dacs = preferred_pairs;
6054}
6055
9476d369 6056static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
6057{
6058 struct alc_spec *spec = codec->spec;
35a39f98 6059 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 6060
9476d369
GM
6061 /* Prevent pop noises when headphones are plugged in */
6062 snd_hda_codec_write(codec, hp_pin, 0,
6063 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6064 msleep(20);
033b0a7c
GM
6065}
6066
6067static void alc_fixup_dell_xps13(struct hda_codec *codec,
6068 const struct hda_fixup *fix, int action)
6069{
3e1b0c4a
TI
6070 struct alc_spec *spec = codec->spec;
6071 struct hda_input_mux *imux = &spec->gen.input_mux;
6072 int i;
f38663ab 6073
3e1b0c4a
TI
6074 switch (action) {
6075 case HDA_FIXUP_ACT_PRE_PROBE:
6076 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6077 * it causes a click noise at start up
6078 */
6079 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 6080 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
6081 break;
6082 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
6083 /* Make the internal mic the default input source. */
6084 for (i = 0; i < imux->num_items; i++) {
6085 if (spec->gen.imux_pins[i] == 0x12) {
6086 spec->gen.cur_mux[0] = i;
6087 break;
6088 }
6089 }
3e1b0c4a 6090 break;
033b0a7c
GM
6091 }
6092}
6093
1f8b46cd
DH
6094static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6095 const struct hda_fixup *fix, int action)
6096{
6097 struct alc_spec *spec = codec->spec;
6098
6099 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6100 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6101 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
6102
6103 /* Disable boost for mic-in permanently. (This code is only called
6104 from quirks that guarantee that the headphone is at NID 0x1b.) */
6105 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6106 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
6107 } else
6108 alc_fixup_headset_mode(codec, fix, action);
6109}
6110
73bdd597
DH
6111static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6112 const struct hda_fixup *fix, int action)
6113{
6114 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 6115 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 6116 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
6117 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6118 }
6119 alc_fixup_headset_mode(codec, fix, action);
6120}
6121
bde7bc60
CCC
6122/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6123static int find_ext_mic_pin(struct hda_codec *codec)
6124{
6125 struct alc_spec *spec = codec->spec;
6126 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6127 hda_nid_t nid;
6128 unsigned int defcfg;
6129 int i;
6130
6131 for (i = 0; i < cfg->num_inputs; i++) {
6132 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6133 continue;
6134 nid = cfg->inputs[i].pin;
6135 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6136 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6137 continue;
6138 return nid;
6139 }
6140
6141 return 0;
6142}
6143
08a978db 6144static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6145 const struct hda_fixup *fix,
08a978db
DR
6146 int action)
6147{
6148 struct alc_spec *spec = codec->spec;
6149
0db75790 6150 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6151 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6152 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6153
6154 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6155 return;
bde7bc60 6156 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6157 }
08a978db 6158}
693b613d 6159
3e0d611b
DH
6160static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6161 const struct hda_fixup *fix,
6162 int action)
6163{
6164 struct alc_spec *spec = codec->spec;
6165 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6166 int i;
6167
6168 /* The mic boosts on level 2 and 3 are too noisy
6169 on the internal mic input.
6170 Therefore limit the boost to 0 or 1. */
6171
6172 if (action != HDA_FIXUP_ACT_PROBE)
6173 return;
6174
6175 for (i = 0; i < cfg->num_inputs; i++) {
6176 hda_nid_t nid = cfg->inputs[i].pin;
6177 unsigned int defcfg;
6178 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6179 continue;
6180 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6181 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6182 continue;
6183
6184 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6185 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6186 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6187 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6188 (0 << AC_AMPCAP_MUTE_SHIFT));
6189 }
6190}
6191
cd217a63 6192static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6193 struct hda_jack_callback *jack)
cd217a63
KY
6194{
6195 struct alc_spec *spec = codec->spec;
6196 int vref;
6197
6198 msleep(200);
6199 snd_hda_gen_hp_automute(codec, jack);
6200
6201 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6202
6203 msleep(600);
6204 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6205 vref);
6206}
6207
cd217a63
KY
6208static void alc283_fixup_chromebook(struct hda_codec *codec,
6209 const struct hda_fixup *fix, int action)
6210{
6211 struct alc_spec *spec = codec->spec;
cd217a63
KY
6212
6213 switch (action) {
6214 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6215 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6216 /* Disable AA-loopback as it causes white noise */
6217 spec->gen.mixer_nid = 0;
38070219 6218 break;
0202e99c 6219 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6220 /* MIC2-VREF control */
6221 /* Set to manual mode */
98b24883 6222 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6223 /* Enable Line1 input control by verb */
98b24883 6224 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6225 break;
6226 }
6227}
6228
6229static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6230 const struct hda_fixup *fix, int action)
6231{
6232 struct alc_spec *spec = codec->spec;
0202e99c
KY
6233
6234 switch (action) {
6235 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6236 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6237 break;
6238 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6239 /* MIC2-VREF control */
6240 /* Set to manual mode */
98b24883 6241 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6242 break;
6243 }
6244}
6245
7bba2157
TI
6246/* mute tablet speaker pin (0x14) via dock plugging in addition */
6247static void asus_tx300_automute(struct hda_codec *codec)
6248{
6249 struct alc_spec *spec = codec->spec;
6250 snd_hda_gen_update_outputs(codec);
6251 if (snd_hda_jack_detect(codec, 0x1b))
6252 spec->gen.mute_bits |= (1ULL << 0x14);
6253}
6254
6255static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6256 const struct hda_fixup *fix, int action)
6257{
6258 struct alc_spec *spec = codec->spec;
7bba2157
TI
6259 static const struct hda_pintbl dock_pins[] = {
6260 { 0x1b, 0x21114000 }, /* dock speaker pin */
6261 {}
6262 };
7bba2157
TI
6263
6264 switch (action) {
6265 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6266 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6267 /* TX300 needs to set up GPIO2 for the speaker amp */
6268 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6269 snd_hda_apply_pincfgs(codec, dock_pins);
6270 spec->gen.auto_mute_via_amp = 1;
6271 spec->gen.automute_hook = asus_tx300_automute;
6272 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6273 snd_hda_gen_hp_automute);
6274 break;
5579cd6f
TI
6275 case HDA_FIXUP_ACT_PROBE:
6276 spec->init_amp = ALC_INIT_DEFAULT;
6277 break;
7bba2157
TI
6278 case HDA_FIXUP_ACT_BUILD:
6279 /* this is a bit tricky; give more sane names for the main
6280 * (tablet) speaker and the dock speaker, respectively
6281 */
56798e6b
TI
6282 rename_ctl(codec, "Speaker Playback Switch",
6283 "Dock Speaker Playback Switch");
6284 rename_ctl(codec, "Bass Speaker Playback Switch",
6285 "Speaker Playback Switch");
7bba2157
TI
6286 break;
6287 }
6288}
6289
338cae56
DH
6290static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6291 const struct hda_fixup *fix, int action)
6292{
0f4881dc
DH
6293 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6294 /* DAC node 0x03 is giving mono output. We therefore want to
6295 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6296 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6297 static const hda_nid_t conn1[] = { 0x0c };
6298 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6299 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6300 }
338cae56
DH
6301}
6302
dd9aa335
HW
6303static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6304 const struct hda_fixup *fix, int action)
6305{
6306 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6307 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6308 we can't adjust the speaker's volume since this node does not has
6309 Amp-out capability. we change the speaker's route to:
6310 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6311 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6312 speaker's volume now. */
6313
caf3c043
MM
6314 static const hda_nid_t conn1[] = { 0x0c };
6315 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6316 }
6317}
6318
e312a869
TI
6319/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6320static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6321 const struct hda_fixup *fix, int action)
6322{
6323 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6324 static const hda_nid_t conn[] = { 0x02, 0x03 };
6325 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6326 }
6327}
6328
d2cd795c
JK
6329/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6330static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6331 const struct hda_fixup *fix, int action)
6332{
6333 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6334 static const hda_nid_t conn[] = { 0x02 };
6335 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6336 }
6337}
6338
98973f2f
KP
6339/* Hook to update amp GPIO4 for automute */
6340static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6341 struct hda_jack_callback *jack)
6342{
6343 struct alc_spec *spec = codec->spec;
6344
6345 snd_hda_gen_hp_automute(codec, jack);
6346 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6347 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6348 !spec->gen.hp_jack_present);
98973f2f
KP
6349}
6350
6351/* Manage GPIOs for HP EliteBook Folio 9480m.
6352 *
6353 * GPIO4 is the headphone amplifier power control
6354 * GPIO3 is the audio output mute indicator LED
6355 */
6356
6357static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6358 const struct hda_fixup *fix,
6359 int action)
6360{
6361 struct alc_spec *spec = codec->spec;
98973f2f 6362
01e4a275 6363 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6364 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6365 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6366 spec->gpio_mask |= 0x10;
6367 spec->gpio_dir |= 0x10;
98973f2f 6368 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6369 }
6370}
6371
ae065f1c
TI
6372static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6373 const struct hda_fixup *fix,
6374 int action)
6375{
6376 struct alc_spec *spec = codec->spec;
6377
6378 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6379 spec->gpio_mask |= 0x04;
6380 spec->gpio_dir |= 0x04;
6381 /* set data bit low */
6382 }
6383}
6384
6a6660d0
TI
6385/* Quirk for Thinkpad X1 7th and 8th Gen
6386 * The following fixed routing needed
6387 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6388 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6389 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6390 */
6391static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6392 const struct hda_fixup *fix, int action)
6393{
6394 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6395 static const hda_nid_t preferred_pairs[] = {
6396 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6397 };
6398 struct alc_spec *spec = codec->spec;
6399
6400 switch (action) {
6401 case HDA_FIXUP_ACT_PRE_PROBE:
6402 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6403 spec->gen.preferred_dacs = preferred_pairs;
6404 break;
6405 case HDA_FIXUP_ACT_BUILD:
6406 /* The generic parser creates somewhat unintuitive volume ctls
6407 * with the fixed routing above, and the shared DAC2 may be
6408 * confusing for PA.
6409 * Rename those to unique names so that PA doesn't touch them
6410 * and use only Master volume.
6411 */
6412 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6413 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6414 break;
6415 }
6416}
6417
ca169cc2
KY
6418static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6419 const struct hda_fixup *fix,
6420 int action)
6421{
6422 alc_fixup_dual_codecs(codec, fix, action);
6423 switch (action) {
6424 case HDA_FIXUP_ACT_PRE_PROBE:
6425 /* override card longname to provide a unique UCM profile */
6426 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6427 break;
6428 case HDA_FIXUP_ACT_BUILD:
6429 /* rename Capture controls depending on the codec */
6430 rename_ctl(codec, "Capture Volume",
6431 codec->addr == 0 ?
6432 "Rear-Panel Capture Volume" :
6433 "Front-Panel Capture Volume");
6434 rename_ctl(codec, "Capture Switch",
6435 codec->addr == 0 ?
6436 "Rear-Panel Capture Switch" :
6437 "Front-Panel Capture Switch");
6438 break;
6439 }
6440}
6441
52e4e368
KHF
6442static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6443 const struct hda_fixup *fix, int action)
6444{
6445 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6446 return;
6447
6448 codec->power_save_node = 1;
6449}
6450
92266651
KY
6451/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6452static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6453 const struct hda_fixup *fix, int action)
6454{
6455 struct alc_spec *spec = codec->spec;
caf3c043 6456 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6457 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6458 0
6459 };
6460
6461 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6462 return;
6463
6464 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6465 spec->gen.auto_mute_via_amp = 1;
6466 codec->power_save_node = 0;
92266651
KY
6467}
6468
c84bfedc
TI
6469/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6470static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6471 const struct hda_fixup *fix, int action)
6472{
6473 static const hda_nid_t preferred_pairs[] = {
6474 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6475 };
6476 struct alc_spec *spec = codec->spec;
6477
6478 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6479 spec->gen.preferred_dacs = preferred_pairs;
6480 spec->gen.obey_preferred_dacs = 1;
6481 }
6482}
6483
c4cfcf6f
HW
6484/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6485static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6486 const struct hda_fixup *fix, int action)
6487{
6488 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6489 return;
6490
6491 snd_hda_override_wcaps(codec, 0x03, 0);
6492}
6493
8a8de09c
KY
6494static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6495{
6496 switch (codec->core.vendor_id) {
6497 case 0x10ec0274:
6498 case 0x10ec0294:
6499 case 0x10ec0225:
6500 case 0x10ec0295:
6501 case 0x10ec0299:
6502 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6503 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6504 break;
1948fc06 6505 case 0x10ec0230:
8a8de09c
KY
6506 case 0x10ec0235:
6507 case 0x10ec0236:
6508 case 0x10ec0255:
6509 case 0x10ec0256:
cae2bdb5 6510 case 0x10ec0257:
527f4643 6511 case 0x19e58326:
8a8de09c
KY
6512 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6513 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6514 break;
6515 }
6516}
6517
8983eb60
KY
6518static void alc295_fixup_chromebook(struct hda_codec *codec,
6519 const struct hda_fixup *fix, int action)
6520{
d3ba58bb
KY
6521 struct alc_spec *spec = codec->spec;
6522
8983eb60 6523 switch (action) {
d3ba58bb
KY
6524 case HDA_FIXUP_ACT_PRE_PROBE:
6525 spec->ultra_low_power = true;
6526 break;
8983eb60 6527 case HDA_FIXUP_ACT_INIT:
8a8de09c 6528 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6529 break;
6530 }
6531}
6532
d1dd4211
KY
6533static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6534 const struct hda_fixup *fix, int action)
6535{
6536 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6537 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6538}
6539
c3cdf189
LJ
6540
6541static void alc294_gx502_toggle_output(struct hda_codec *codec,
6542 struct hda_jack_callback *cb)
6543{
6544 /* The Windows driver sets the codec up in a very different way where
6545 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6546 */
6547 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6548 alc_write_coef_idx(codec, 0x10, 0x8a20);
6549 else
6550 alc_write_coef_idx(codec, 0x10, 0x0a20);
6551}
6552
6553static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6554 const struct hda_fixup *fix, int action)
6555{
6556 /* Pin 0x21: headphones/headset mic */
6557 if (!is_jack_detectable(codec, 0x21))
6558 return;
6559
6560 switch (action) {
6561 case HDA_FIXUP_ACT_PRE_PROBE:
6562 snd_hda_jack_detect_enable_callback(codec, 0x21,
6563 alc294_gx502_toggle_output);
6564 break;
6565 case HDA_FIXUP_ACT_INIT:
6566 /* Make sure to start in a correct state, i.e. if
6567 * headphones have been plugged in before powering up the system
6568 */
6569 alc294_gx502_toggle_output(codec, NULL);
6570 break;
6571 }
6572}
6573
c1b55029
DC
6574static void alc294_gu502_toggle_output(struct hda_codec *codec,
6575 struct hda_jack_callback *cb)
6576{
6577 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6578 * responsible from changes between speakers and headphones
6579 */
6580 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6581 alc_write_coef_idx(codec, 0x10, 0x8420);
6582 else
6583 alc_write_coef_idx(codec, 0x10, 0x0a20);
6584}
6585
6586static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6587 const struct hda_fixup *fix, int action)
6588{
6589 if (!is_jack_detectable(codec, 0x21))
6590 return;
6591
6592 switch (action) {
6593 case HDA_FIXUP_ACT_PRE_PROBE:
6594 snd_hda_jack_detect_enable_callback(codec, 0x21,
6595 alc294_gu502_toggle_output);
6596 break;
6597 case HDA_FIXUP_ACT_INIT:
6598 alc294_gu502_toggle_output(codec, NULL);
6599 break;
6600 }
6601}
6602
56496253
KY
6603static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6604 const struct hda_fixup *fix, int action)
6605{
6606 if (action != HDA_FIXUP_ACT_INIT)
6607 return;
6608
6609 msleep(100);
6610 alc_write_coef_idx(codec, 0x65, 0x0);
6611}
6612
8a8de09c
KY
6613static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6614 const struct hda_fixup *fix, int action)
6615{
6616 switch (action) {
6617 case HDA_FIXUP_ACT_INIT:
6618 alc_combo_jack_hp_jd_restart(codec);
6619 break;
6620 }
6621}
6622
92666d45
KY
6623static void alc_fixup_no_int_mic(struct hda_codec *codec,
6624 const struct hda_fixup *fix, int action)
6625{
6626 struct alc_spec *spec = codec->spec;
6627
6628 switch (action) {
6629 case HDA_FIXUP_ACT_PRE_PROBE:
6630 /* Mic RING SLEEVE swap for combo jack */
6631 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6632 spec->no_internal_mic_pin = true;
6633 break;
6634 case HDA_FIXUP_ACT_INIT:
6635 alc_combo_jack_hp_jd_restart(codec);
6636 break;
6637 }
6638}
6639
d94befbb
DB
6640/* GPIO1 = amplifier on/off
6641 * GPIO3 = mic mute LED
6642 */
6643static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6644 const struct hda_fixup *fix, int action)
6645{
6646 static const hda_nid_t conn[] = { 0x02 };
6647
6648 struct alc_spec *spec = codec->spec;
6649 static const struct hda_pintbl pincfgs[] = {
6650 { 0x14, 0x90170110 }, /* front/high speakers */
6651 { 0x17, 0x90170130 }, /* back/bass speakers */
6652 { }
6653 };
6654
6655 //enable micmute led
6656 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6657
6658 switch (action) {
6659 case HDA_FIXUP_ACT_PRE_PROBE:
6660 spec->micmute_led_polarity = 1;
6661 /* needed for amp of back speakers */
6662 spec->gpio_mask |= 0x01;
6663 spec->gpio_dir |= 0x01;
6664 snd_hda_apply_pincfgs(codec, pincfgs);
6665 /* share DAC to have unified volume control */
6666 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6667 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6668 break;
6669 case HDA_FIXUP_ACT_INIT:
6670 /* need to toggle GPIO to enable the amp of back speakers */
6671 alc_update_gpio_data(codec, 0x01, true);
6672 msleep(100);
6673 alc_update_gpio_data(codec, 0x01, false);
6674 break;
6675 }
6676}
6677
434591b2
ED
6678static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6679 const struct hda_fixup *fix, int action)
6680{
6681 static const hda_nid_t conn[] = { 0x02 };
6682 static const struct hda_pintbl pincfgs[] = {
6683 { 0x14, 0x90170110 }, /* rear speaker */
6684 { }
6685 };
6686
6687 switch (action) {
6688 case HDA_FIXUP_ACT_PRE_PROBE:
6689 snd_hda_apply_pincfgs(codec, pincfgs);
6690 /* force front speaker to DAC1 */
6691 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6692 break;
6693 }
6694}
6695
b317b032
TI
6696/* for hda_fixup_thinkpad_acpi() */
6697#include "thinkpad_helper.c"
b67ae3f1 6698
d5a6cabf
TI
6699static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6700 const struct hda_fixup *fix, int action)
6701{
6702 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6703 hda_fixup_thinkpad_acpi(codec, fix, action);
6704}
6705
ad7cc2d4
CB
6706/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6707static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6708 const struct hda_fixup *fix,
6709 int action)
6710{
6711 struct alc_spec *spec = codec->spec;
6712
6713 switch (action) {
6714 case HDA_FIXUP_ACT_PRE_PROBE:
6715 spec->gen.suppress_auto_mute = 1;
6716 break;
6717 }
6718}
6719
7ce66933
SB
6720#ifdef CONFIG_ACPI
6721static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
6722{
6723 struct hda_codec *cdc = data;
6724 struct alc_spec *spec = cdc->spec;
6725 int i;
6726
6727 codec_info(cdc, "ACPI Notification %d\n", event);
6728
6729 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6730 if (spec->comps[i].dev && spec->comps[i].acpi_notify)
6731 spec->comps[i].acpi_notify(acpi_device_handle(spec->comps[i].adev), event,
6732 spec->comps[i].dev);
6733 }
6734}
6735
6736static int comp_bind_acpi(struct device *dev)
6737{
6738 struct hda_codec *cdc = dev_to_hda_codec(dev);
6739 struct alc_spec *spec = cdc->spec;
6740 bool support_notifications = false;
6741 struct acpi_device *adev;
6742 int ret;
6743 int i;
6744
6745 adev = spec->comps[0].adev;
6746 if (!acpi_device_handle(adev))
6747 return 0;
6748
6749 for (i = 0; i < HDA_MAX_COMPONENTS; i++)
6750 support_notifications = support_notifications ||
6751 spec->comps[i].acpi_notifications_supported;
6752
6753 if (support_notifications) {
6754 ret = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
6755 comp_acpi_device_notify, cdc);
6756 if (ret < 0) {
6757 codec_warn(cdc, "Failed to install notify handler: %d\n", ret);
6758 return 0;
6759 }
6760
6761 codec_dbg(cdc, "Notify handler installed\n");
6762 }
6763
6764 return 0;
6765}
6766
6767static void comp_unbind_acpi(struct device *dev)
6768{
6769 struct hda_codec *cdc = dev_to_hda_codec(dev);
6770 struct alc_spec *spec = cdc->spec;
6771 struct acpi_device *adev;
6772 int ret;
6773
6774 adev = spec->comps[0].adev;
6775 if (!acpi_device_handle(adev))
6776 return;
6777
6778 ret = acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY,
6779 comp_acpi_device_notify);
6780 if (ret < 0)
6781 codec_warn(cdc, "Failed to uninstall notify handler: %d\n", ret);
6782}
6783#else
6784static int comp_bind_acpi(struct device *dev)
6785{
6786 return 0;
6787}
6788
6789static void comp_unbind_acpi(struct device *dev)
6790{
6791}
6792#endif
6793
d3dca026
LT
6794static int comp_bind(struct device *dev)
6795{
6796 struct hda_codec *cdc = dev_to_hda_codec(dev);
6797 struct alc_spec *spec = cdc->spec;
7ce66933
SB
6798 int ret;
6799
6800 ret = component_bind_all(dev, spec->comps);
6801 if (ret)
6802 return ret;
1873ebd3 6803
7ce66933 6804 return comp_bind_acpi(dev);
d3dca026
LT
6805}
6806
6807static void comp_unbind(struct device *dev)
6808{
6809 struct hda_codec *cdc = dev_to_hda_codec(dev);
6810 struct alc_spec *spec = cdc->spec;
6811
7ce66933 6812 comp_unbind_acpi(dev);
d3dca026
LT
6813 component_unbind_all(dev, spec->comps);
6814}
6815
6816static const struct component_master_ops comp_master_ops = {
6817 .bind = comp_bind,
6818 .unbind = comp_unbind,
6819};
6820
6821static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6822 struct snd_pcm_substream *sub, int action)
6823{
6824 struct alc_spec *spec = cdc->spec;
6825 int i;
6826
6827 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
4eae4892
SB
6828 if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
6829 spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
6830 }
6831 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6832 if (spec->comps[i].dev && spec->comps[i].playback_hook)
d3dca026
LT
6833 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6834 }
4eae4892
SB
6835 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6836 if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
6837 spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
6838 }
d3dca026
LT
6839}
6840
3babae91 6841struct scodec_dev_name {
35a17444
TI
6842 const char *bus;
6843 const char *hid;
6844 int index;
6845};
6846
6847/* match the device name in a slightly relaxed manner */
6848static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
6849{
3babae91 6850 struct scodec_dev_name *p = data;
35a17444
TI
6851 const char *d = dev_name(dev);
6852 int n = strlen(p->bus);
6853 char tmp[32];
6854
6855 /* check the bus name */
6856 if (strncmp(d, p->bus, n))
6857 return 0;
6858 /* skip the bus number */
6859 if (isdigit(d[n]))
6860 n++;
6861 /* the rest must be exact matching */
6862 snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
6863 return !strcmp(d + n, tmp);
6864}
6865
3babae91
SD
6866static int comp_match_tas2781_dev_name(struct device *dev,
6867 void *data)
6868{
6869 struct scodec_dev_name *p = data;
6870 const char *d = dev_name(dev);
6871 int n = strlen(p->bus);
6872 char tmp[32];
6873
6874 /* check the bus name */
6875 if (strncmp(d, p->bus, n))
6876 return 0;
6877 /* skip the bus number */
6878 if (isdigit(d[n]))
6879 n++;
6880 /* the rest must be exact matching */
6881 snprintf(tmp, sizeof(tmp), "-%s:00", p->hid);
6882
6883 return !strcmp(d + n, tmp);
6884}
6885
ae7abe36
SB
6886static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6887 const char *hid, int count)
6888{
6889 struct device *dev = hda_codec_dev(cdc);
6890 struct alc_spec *spec = cdc->spec;
3babae91 6891 struct scodec_dev_name *rec;
ae7abe36
SB
6892 int ret, i;
6893
6894 switch (action) {
6895 case HDA_FIXUP_ACT_PRE_PROBE:
6896 for (i = 0; i < count; i++) {
35a17444
TI
6897 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6898 if (!rec)
ae7abe36 6899 return;
35a17444
TI
6900 rec->bus = bus;
6901 rec->hid = hid;
6902 rec->index = i;
22d5cbd2 6903 spec->comps[i].codec = cdc;
35a17444
TI
6904 component_match_add(dev, &spec->match,
6905 comp_match_cs35l41_dev_name, rec);
ae7abe36
SB
6906 }
6907 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6908 if (ret)
6909 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6910 else
6911 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6912 break;
ebcbfd84
SB
6913 case HDA_FIXUP_ACT_FREE:
6914 component_master_del(dev, &comp_master_ops);
6915 break;
ae7abe36
SB
6916 }
6917}
6918
3babae91
SD
6919static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
6920 const char *bus, const char *hid)
6921{
6922 struct device *dev = hda_codec_dev(cdc);
6923 struct alc_spec *spec = cdc->spec;
6924 struct scodec_dev_name *rec;
6925 int ret;
6926
6927 switch (action) {
6928 case HDA_FIXUP_ACT_PRE_PROBE:
6929 rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
6930 if (!rec)
6931 return;
6932 rec->bus = bus;
6933 rec->hid = hid;
6934 rec->index = 0;
6935 spec->comps[0].codec = cdc;
6936 component_match_add(dev, &spec->match,
6937 comp_match_tas2781_dev_name, rec);
6938 ret = component_master_add_with_match(dev, &comp_master_ops,
6939 spec->match);
6940 if (ret)
6941 codec_err(cdc,
6942 "Fail to register component aggregator %d\n",
6943 ret);
6944 else
6945 spec->gen.pcm_playback_hook =
6946 comp_generic_playback_hook;
6947 break;
6948 case HDA_FIXUP_ACT_FREE:
6949 component_master_del(dev, &comp_master_ops);
6950 break;
6951 }
6952}
6953
ae7abe36
SB
6954static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6955{
6956 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6957}
6958
42320660
SB
6959static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6960{
6961 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 4);
6962}
6963
07bcab93
LT
6964static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6965{
35a17444 6966 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
225f6e1b
TI
6967}
6968
07bcab93
LT
6969static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6970{
35a17444 6971 cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
07bcab93
LT
6972}
6973
d3dca026
LT
6974static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6975 int action)
6976{
14e42cee 6977 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
d3dca026
LT
6978}
6979
1e24881d
LT
6980static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6981 int action)
6982{
6983 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
6984}
6985
3babae91
SD
6986static void tas2781_fixup_i2c(struct hda_codec *cdc,
6987 const struct hda_fixup *fix, int action)
6988{
6989 tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
6990}
6991
b5cb53fd
GK
6992static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
6993 const struct hda_fixup *fix, int action)
6994{
6995 tas2781_generic_fixup(cdc, action, "i2c", "INT8866");
6996}
6997
bbf8ff6b
TB
6998/* for alc295_fixup_hp_top_speakers */
6999#include "hp_x360_helper.c"
7000
26928ca1
TI
7001/* for alc285_fixup_ideapad_s740_coef() */
7002#include "ideapad_s740_helper.c"
7003
619764cc
WS
7004static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7005 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7006 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7007 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7008 {}
7009};
7010
7011static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7012 const struct hda_fixup *fix,
7013 int action)
dd6dd6e3
WS
7014{
7015 /*
619764cc
WS
7016 * A certain other OS sets these coeffs to different values. On at least
7017 * one TongFang barebone these settings might survive even a cold
7018 * reboot. So to restore a clean slate the values are explicitly reset
7019 * to default here. Without this, the external microphone is always in a
7020 * plugged-in state, while the internal microphone is always in an
7021 * unplugged state, breaking the ability to use the internal microphone.
7022 */
7023 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
7024}
7025
174a7fb3
WS
7026static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7027 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7028 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7029 WRITE_COEF(0x49, 0x0149),
7030 {}
7031};
7032
7033static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7034 const struct hda_fixup *fix,
7035 int action)
7036{
7037 /*
7038 * The audio jack input and output is not detected on the ASRock NUC Box
7039 * 1100 series when cold booting without this fix. Warm rebooting from a
7040 * certain other OS makes the audio functional, as COEF settings are
7041 * preserved in this case. This fix sets these altered COEF values as
7042 * the default.
7043 */
7044 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7045}
7046
edca7cc4
WS
7047static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7048 const struct hda_fixup *fix,
7049 int action)
7050{
7051 /*
7052 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7053 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7054 * needs an additional quirk for sound working after suspend and resume.
7055 */
7056 if (codec->core.vendor_id == 0x10ec0256) {
7057 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7058 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7059 } else {
7060 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7061 }
7062}
7063
1efcdd9c
GM
7064static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7065 const struct hda_fixup *fix,
7066 int action)
7067{
7068 struct alc_spec *spec = codec->spec;
7069 struct hda_input_mux *imux = &spec->gen.input_mux;
7070 int i;
7071
7072 alc269_fixup_limit_int_mic_boost(codec, fix, action);
7073
7074 switch (action) {
7075 case HDA_FIXUP_ACT_PRE_PROBE:
7076 /**
7077 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7078 * to Hi-Z to avoid pop noises at startup and when plugging and
7079 * unplugging headphones.
7080 */
7081 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7082 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7083 break;
7084 case HDA_FIXUP_ACT_PROBE:
7085 /**
7086 * Make the internal mic (0x12) the default input source to
7087 * prevent pop noises on cold boot.
7088 */
7089 for (i = 0; i < imux->num_items; i++) {
7090 if (spec->gen.imux_pins[i] == 0x12) {
7091 spec->gen.cur_mux[0] = i;
7092 break;
7093 }
7094 }
7095 break;
7096 }
7097}
7098
3790a3d6
PJ
7099static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7100 const struct hda_fixup *fix, int action)
7101{
7102 /*
7103 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7104 * unconnected.
7105 */
7106 static const struct hda_pintbl pincfgs[] = {
7107 { 0x17, 0x90170121 },
7108 { }
7109 };
7110 /*
7111 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7112 * DAC 0x02 and 0x03 would be fine.
7113 */
7114 static const hda_nid_t conn[] = { 0x02, 0x03 };
7115 /*
7116 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7117 * Headphones (0x21) are connected to DAC 0x03.
7118 */
7119 static const hda_nid_t preferred_pairs[] = {
7120 0x14, 0x02,
7121 0x17, 0x02,
7122 0x21, 0x03,
7123 0
7124 };
7125 struct alc_spec *spec = codec->spec;
7126
7127 switch (action) {
7128 case HDA_FIXUP_ACT_PRE_PROBE:
7129 snd_hda_apply_pincfgs(codec, pincfgs);
7130 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7131 spec->gen.preferred_dacs = preferred_pairs;
7132 break;
7133 }
7134}
7135
2912cdda
PJ
7136static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7137 const struct hda_fixup *fix, int action)
7138{
7139 static const struct hda_pintbl pincfgs[] = {
7140 { 0x14, 0x90170151 },
7141 { 0x17, 0x90170150 },
7142 { }
7143 };
7144 static const hda_nid_t conn[] = { 0x02, 0x03 };
7145 static const hda_nid_t preferred_pairs[] = {
7146 0x14, 0x02,
7147 0x17, 0x03,
7148 0x21, 0x02,
7149 0
7150 };
7151 struct alc_spec *spec = codec->spec;
7152
7153 alc_fixup_no_shutup(codec, fix, action);
7154
7155 switch (action) {
7156 case HDA_FIXUP_ACT_PRE_PROBE:
7157 snd_hda_apply_pincfgs(codec, pincfgs);
7158 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7159 spec->gen.preferred_dacs = preferred_pairs;
7160 break;
7161 }
7162}
7163
e43252db
KY
7164/* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7165static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7166 const struct hda_fixup *fix, int action)
7167{
7168 struct alc_spec *spec = codec->spec;
7169 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7170 static const hda_nid_t preferred_pairs[] = {
7171 0x17, 0x02, 0x21, 0x03, 0
7172 };
7173
7174 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7175 return;
7176
7177 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7178 spec->gen.preferred_dacs = preferred_pairs;
7179 spec->gen.auto_mute_via_amp = 1;
fb6254df
KY
7180 if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7181 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7182 0x0); /* Make sure 0x14 was disable */
7183 }
e43252db 7184}
c8c0a03e
KY
7185/* Fix none verb table of Headset Mic pin */
7186static void alc_fixup_headset_mic(struct hda_codec *codec,
7187 const struct hda_fixup *fix, int action)
7188{
7189 struct alc_spec *spec = codec->spec;
7190 static const struct hda_pintbl pincfgs[] = {
7191 { 0x19, 0x03a1103c },
7192 { }
7193 };
7194
7195 switch (action) {
7196 case HDA_FIXUP_ACT_PRE_PROBE:
7197 snd_hda_apply_pincfgs(codec, pincfgs);
7198 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7199 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7200 break;
7201 }
7202}
e43252db
KY
7203
7204
1d045db9 7205enum {
f73bbf63 7206 ALC269_FIXUP_GPIO2,
1d045db9
TI
7207 ALC269_FIXUP_SONY_VAIO,
7208 ALC275_FIXUP_SONY_VAIO_GPIO2,
7209 ALC269_FIXUP_DELL_M101Z,
7210 ALC269_FIXUP_SKU_IGNORE,
7211 ALC269_FIXUP_ASUS_G73JW,
e959f2be
PLB
7212 ALC269_FIXUP_ASUS_N7601ZM_PINS,
7213 ALC269_FIXUP_ASUS_N7601ZM,
1d045db9
TI
7214 ALC269_FIXUP_LENOVO_EAPD,
7215 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 7216 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 7217 ALC271_FIXUP_DMIC,
017f2a10 7218 ALC269_FIXUP_PCM_44K,
adabb3ec 7219 ALC269_FIXUP_STEREO_DMIC,
7c478f03 7220 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
7221 ALC269_FIXUP_QUANTA_MUTE,
7222 ALC269_FIXUP_LIFEBOOK,
2041d564 7223 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 7224 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 7225 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 7226 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
7227 ALC269_FIXUP_AMIC,
7228 ALC269_FIXUP_DMIC,
7229 ALC269VB_FIXUP_AMIC,
7230 ALC269VB_FIXUP_DMIC,
08fb0d0e 7231 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 7232 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 7233 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 7234 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 7235 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
7236 ALC269_FIXUP_HP_GPIO_MIC1_LED,
7237 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 7238 ALC269_FIXUP_INV_DMIC,
108cc108 7239 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 7240 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 7241 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 7242 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 7243 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
7244 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7245 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 7246 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 7247 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
1efcdd9c 7248 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
73bdd597
DH
7249 ALC269_FIXUP_HEADSET_MODE,
7250 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 7251 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
7252 ALC269_FIXUP_ASUS_X101_FUNC,
7253 ALC269_FIXUP_ASUS_X101_VERB,
7254 ALC269_FIXUP_ASUS_X101,
08a978db
DR
7255 ALC271_FIXUP_AMIC_MIC2,
7256 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 7257 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 7258 ALC269_FIXUP_ACER_AC700,
3e0d611b 7259 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 7260 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 7261 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
f882c4be 7262 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
8e35cd4a 7263 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 7264 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 7265 ALC283_FIXUP_CHROME_BOOK,
0202e99c 7266 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 7267 ALC282_FIXUP_ASUS_TX300,
1bb3e062 7268 ALC283_FIXUP_INT_MIC,
338cae56 7269 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
7270 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7271 ALC290_FIXUP_SUBWOOFER,
7272 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 7273 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 7274 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7c9caa29 7275 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
5824ce8d 7276 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 7277 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 7278 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 7279 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 7280 ALC255_FIXUP_HEADSET_MODE,
31278997 7281 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 7282 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 7283 ALC292_FIXUP_TPT440_DOCK,
9a811230 7284 ALC292_FIXUP_TPT440,
abaa2274 7285 ALC283_FIXUP_HEADSET_MIC,
b3802783 7286 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 7287 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 7288 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 7289 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 7290 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 7291 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 7292 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 7293 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 7294 ALC280_FIXUP_HP_9480M,
c3bb2b52 7295 ALC245_FIXUP_HP_X360_AMP,
d94befbb 7296 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
e1e62b98
KY
7297 ALC288_FIXUP_DELL_HEADSET_MODE,
7298 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
7299 ALC288_FIXUP_DELL_XPS_13,
7300 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 7301 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
7302 ALC292_FIXUP_DELL_E7X,
7303 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 7304 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 7305 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 7306 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 7307 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 7308 ALC275_FIXUP_DELL_XPS,
23adc192 7309 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 7310 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 7311 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 7312 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 7313 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 7314 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 7315 ALC285_FIXUP_SPEAKER2_TO_DAC1,
4b963ae1
AS
7316 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7317 ALC285_FIXUP_ASUS_HEADSET_MIC,
b759a5f0 7318 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
8cc87c05
LJ
7319 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7320 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
f883982d 7321 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 7322 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 7323 ALC292_FIXUP_TPT460,
dd9aa335 7324 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 7325 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 7326 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 7327 ALC269_FIXUP_ATIV_BOOK_8,
4ba5c853 7328 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
9eb5d0e6 7329 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
7330 ALC256_FIXUP_ASUS_HEADSET_MODE,
7331 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 7332 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
7333 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7334 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 7335 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 7336 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 7337 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 7338 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 7339 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 7340 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
7341 ALC274_FIXUP_DELL_BIND_DACS,
7342 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 7343 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 7344 ALC298_FIXUP_TPT470_DOCK,
ae104a21 7345 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 7346 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 7347 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 7348 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 7349 ALC295_FIXUP_HP_X360,
8a328ac1 7350 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 7351 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 7352 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 7353 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 7354 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
7355 ALC294_FIXUP_ASUS_HEADSET_MIC,
7356 ALC294_FIXUP_ASUS_SPK,
89e3a568 7357 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 7358 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 7359 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 7360 ALC295_FIXUP_CHROME_BOOK,
8983eb60 7361 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
7362 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7363 ALC225_FIXUP_WYSE_AUTO_MUTE,
7364 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 7365 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 7366 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 7367 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 7368 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 7369 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
f0d9da19 7370 ALC289_FIXUP_DELL_SPK1,
e79c2269
KY
7371 ALC289_FIXUP_DELL_SPK2,
7372 ALC289_FIXUP_DUAL_SPK,
f0d9da19 7373 ALC289_FIXUP_RTK_AMP_DUAL_SPK,
48e01504
CC
7374 ALC294_FIXUP_SPK2_TO_DAC1,
7375 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 7376 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 7377 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
724418b8
MA
7378 ALC294_FIXUP_ASUS_ALLY,
7379 ALC294_FIXUP_ASUS_ALLY_PINS,
7380 ALC294_FIXUP_ASUS_ALLY_VERBS,
7381 ALC294_FIXUP_ASUS_ALLY_SPEAKER,
8b33a134 7382 ALC294_FIXUP_ASUS_HPE,
1b94e59d 7383 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
7384 ALC294_FIXUP_ASUS_GX502_HP,
7385 ALC294_FIXUP_ASUS_GX502_PINS,
7386 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
7387 ALC294_FIXUP_ASUS_GU502_HP,
7388 ALC294_FIXUP_ASUS_GU502_PINS,
7389 ALC294_FIXUP_ASUS_GU502_VERBS,
c611e659 7390 ALC294_FIXUP_ASUS_G513_PINS,
bc2c2354 7391 ALC285_FIXUP_ASUS_G533Z_PINS,
f5a88b0a 7392 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 7393 ALC285_FIXUP_HP_MUTE_LED,
ca88eeb3 7394 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
0659400f 7395 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
e7d66cf7 7396 ALC236_FIXUP_HP_GPIO_LED,
24164f43 7397 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 7398 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
a2d57ebe 7399 ALC298_FIXUP_SAMSUNG_AMP,
14425f1f 7400 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ef248d9b 7401 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 7402 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 7403 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 7404 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 7405 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 7406 ALC289_FIXUP_ASUS_GA401,
4b43d05a 7407 ALC289_FIXUP_ASUS_GA502,
f50a121d 7408 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 7409 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
7410 ALC269_FIXUP_CZC_B20,
7411 ALC269_FIXUP_CZC_TMI,
7412 ALC269_FIXUP_CZC_L101,
7413 ALC269_FIXUP_LEMOTE_A1802,
7414 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 7415 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
7416 ALC233_FIXUP_INTEL_NUC8_DMIC,
7417 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 7418 ALC256_FIXUP_INTEL_NUC10,
fc19d559 7419 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 7420 ALC274_FIXUP_HP_MIC,
8a8de09c 7421 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 7422 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 7423 ALC256_FIXUP_ASUS_HPE,
446b8185 7424 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 7425 ALC287_FIXUP_HP_GPIO_LED,
9e885770 7426 ALC256_FIXUP_HP_HEADSET_MIC,
5fc462c3 7427 ALC245_FIXUP_HP_GPIO_LED,
92666d45 7428 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 7429 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 7430 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 7431 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 7432 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 7433 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 7434 ALC295_FIXUP_ASUS_DACS,
5d84b531 7435 ALC295_FIXUP_HP_OMEN,
f2be77fe 7436 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 7437 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 7438 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 7439 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 7440 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
7441 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7442 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7443 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
56ec3e75 7444 ALC298_FIXUP_LENOVO_C940_DUET7,
dd6dd6e3 7445 ALC287_FIXUP_13S_GEN2_SPEAKERS,
619764cc 7446 ALC256_FIXUP_SET_COEF_DEFAULTS,
1278cc5a 7447 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
174a7fb3 7448 ALC233_FIXUP_NO_AUDIO_JACK,
edca7cc4 7449 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
8f4c9042
BF
7450 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7451 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
d3dca026 7452 ALC287_FIXUP_LEGION_16ACHG6,
ae7abe36 7453 ALC287_FIXUP_CS35L41_I2C_2,
b3fbe536 7454 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
42320660 7455 ALC287_FIXUP_CS35L41_I2C_4,
07bcab93 7456 ALC245_FIXUP_CS35L41_SPI_2,
ce18f905 7457 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
07bcab93
LT
7458 ALC245_FIXUP_CS35L41_SPI_4,
7459 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
91502a9a 7460 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
309d7363 7461 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
1e24881d 7462 ALC287_FIXUP_LEGION_16ITHG6,
3790a3d6
PJ
7463 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7464 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
2912cdda 7465 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
a4517c4f 7466 ALC236_FIXUP_DELL_DUAL_CODECS,
f7b069cf 7467 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
3babae91 7468 ALC287_FIXUP_TAS2781_I2C,
b5cb53fd 7469 ALC287_FIXUP_YOGA7_14ARB7_I2C,
93dc18e1 7470 ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
c99c26b1 7471 ALC245_FIXUP_HP_X360_MUTE_LEDS,
e43252db 7472 ALC287_FIXUP_THINKPAD_I2S_SPK,
d93eeca6 7473 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
c8c0a03e 7474 ALC2XX_FIXUP_HEADSET_MIC,
f0d9da19 7475 ALC289_FIXUP_DELL_CS35L41_SPI_2,
6ae90e90 7476 ALC294_FIXUP_CS35L41_I2C_2,
f1d4e28b
KY
7477};
7478
56ec3e75
TI
7479/* A special fixup for Lenovo C940 and Yoga Duet 7;
7480 * both have the very same PCI SSID, and we need to apply different fixups
7481 * depending on the codec ID
7482 */
7483static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7484 const struct hda_fixup *fix,
7485 int action)
7486{
7487 int id;
7488
7489 if (codec->core.vendor_id == 0x10ec0298)
7490 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7491 else
7492 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7493 __snd_hda_apply_fixup(codec, id, action, 0);
7494}
7495
1727a771 7496static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
7497 [ALC269_FIXUP_GPIO2] = {
7498 .type = HDA_FIXUP_FUNC,
7499 .v.func = alc_fixup_gpio2,
7500 },
1d045db9 7501 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
7502 .type = HDA_FIXUP_PINCTLS,
7503 .v.pins = (const struct hda_pintbl[]) {
7504 {0x19, PIN_VREFGRD},
1d045db9
TI
7505 {}
7506 }
f1d4e28b 7507 },
1d045db9 7508 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
7509 .type = HDA_FIXUP_FUNC,
7510 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
7511 .chained = true,
7512 .chain_id = ALC269_FIXUP_SONY_VAIO
7513 },
7514 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 7515 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7516 .v.verbs = (const struct hda_verb[]) {
7517 /* Enables internal speaker */
7518 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7519 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7520 {}
7521 }
7522 },
7523 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 7524 .type = HDA_FIXUP_FUNC,
23d30f28 7525 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
7526 },
7527 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
7528 .type = HDA_FIXUP_PINS,
7529 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
7530 { 0x17, 0x99130111 }, /* subwoofer */
7531 { }
7532 }
7533 },
e959f2be
PLB
7534 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7535 .type = HDA_FIXUP_PINS,
7536 .v.pins = (const struct hda_pintbl[]) {
7537 { 0x19, 0x03A11050 },
7538 { 0x1a, 0x03A11C30 },
7539 { 0x21, 0x03211420 },
7540 { }
7541 }
7542 },
7543 [ALC269_FIXUP_ASUS_N7601ZM] = {
7544 .type = HDA_FIXUP_VERBS,
7545 .v.verbs = (const struct hda_verb[]) {
7546 {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7547 {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7548 {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7549 {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7550 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7551 {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7552 { }
7553 },
7554 .chained = true,
7555 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7556 },
1d045db9 7557 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 7558 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7559 .v.verbs = (const struct hda_verb[]) {
7560 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7561 {}
7562 }
7563 },
7564 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 7565 .type = HDA_FIXUP_FUNC,
1d045db9
TI
7566 .v.func = alc269_fixup_hweq,
7567 .chained = true,
7568 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7569 },
e9bd7d5c
TI
7570 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7571 .type = HDA_FIXUP_FUNC,
7572 .v.func = alc_fixup_disable_aamix,
7573 .chained = true,
7574 .chain_id = ALC269_FIXUP_SONY_VAIO
7575 },
1d045db9 7576 [ALC271_FIXUP_DMIC] = {
1727a771 7577 .type = HDA_FIXUP_FUNC,
1d045db9 7578 .v.func = alc271_fixup_dmic,
f1d4e28b 7579 },
017f2a10 7580 [ALC269_FIXUP_PCM_44K] = {
1727a771 7581 .type = HDA_FIXUP_FUNC,
017f2a10 7582 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
7583 .chained = true,
7584 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 7585 },
adabb3ec 7586 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 7587 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
7588 .v.func = alc269_fixup_stereo_dmic,
7589 },
7c478f03
DH
7590 [ALC269_FIXUP_HEADSET_MIC] = {
7591 .type = HDA_FIXUP_FUNC,
7592 .v.func = alc269_fixup_headset_mic,
7593 },
24519911 7594 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 7595 .type = HDA_FIXUP_FUNC,
24519911
TI
7596 .v.func = alc269_fixup_quanta_mute,
7597 },
7598 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
7599 .type = HDA_FIXUP_PINS,
7600 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
7601 { 0x1a, 0x2101103f }, /* dock line-out */
7602 { 0x1b, 0x23a11040 }, /* dock mic-in */
7603 { }
7604 },
7605 .chained = true,
7606 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7607 },
2041d564
DH
7608 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7609 .type = HDA_FIXUP_PINS,
7610 .v.pins = (const struct hda_pintbl[]) {
7611 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7612 { }
7613 },
7614 },
cc7016ab
TI
7615 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7616 .type = HDA_FIXUP_PINS,
7617 .v.pins = (const struct hda_pintbl[]) {
7618 { 0x21, 0x0221102f }, /* HP out */
7619 { }
7620 },
7621 },
4df3fd17
TI
7622 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7623 .type = HDA_FIXUP_FUNC,
7624 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7625 },
fdcc968a
JMG
7626 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7627 .type = HDA_FIXUP_FUNC,
7628 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7629 },
7c9caa29
VK
7630 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7631 .type = HDA_FIXUP_PINS,
7632 .v.pins = (const struct hda_pintbl[]) {
7633 { 0x18, 0x03a19020 }, /* headset mic */
7634 { 0x1b, 0x90170150 }, /* speaker */
7635 { }
7636 },
7637 },
a4297b5d 7638 [ALC269_FIXUP_AMIC] = {
1727a771
TI
7639 .type = HDA_FIXUP_PINS,
7640 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7641 { 0x14, 0x99130110 }, /* speaker */
7642 { 0x15, 0x0121401f }, /* HP out */
7643 { 0x18, 0x01a19c20 }, /* mic */
7644 { 0x19, 0x99a3092f }, /* int-mic */
7645 { }
7646 },
7647 },
7648 [ALC269_FIXUP_DMIC] = {
1727a771
TI
7649 .type = HDA_FIXUP_PINS,
7650 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7651 { 0x12, 0x99a3092f }, /* int-mic */
7652 { 0x14, 0x99130110 }, /* speaker */
7653 { 0x15, 0x0121401f }, /* HP out */
7654 { 0x18, 0x01a19c20 }, /* mic */
7655 { }
7656 },
7657 },
7658 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
7659 .type = HDA_FIXUP_PINS,
7660 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7661 { 0x14, 0x99130110 }, /* speaker */
7662 { 0x18, 0x01a19c20 }, /* mic */
7663 { 0x19, 0x99a3092f }, /* int-mic */
7664 { 0x21, 0x0121401f }, /* HP out */
7665 { }
7666 },
7667 },
2267ea97 7668 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7669 .type = HDA_FIXUP_PINS,
7670 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7671 { 0x12, 0x99a3092f }, /* int-mic */
7672 { 0x14, 0x99130110 }, /* speaker */
7673 { 0x18, 0x01a19c20 }, /* mic */
7674 { 0x21, 0x0121401f }, /* HP out */
7675 { }
7676 },
7677 },
08fb0d0e 7678 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7679 .type = HDA_FIXUP_FUNC,
08fb0d0e 7680 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7681 },
d06ac143
DH
7682 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7683 .type = HDA_FIXUP_FUNC,
7684 .v.func = alc269_fixup_hp_mute_led_mic1,
7685 },
08fb0d0e 7686 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7687 .type = HDA_FIXUP_FUNC,
08fb0d0e 7688 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7689 },
7f783bd5
TB
7690 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7691 .type = HDA_FIXUP_FUNC,
7692 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7693 .chained = true,
7694 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7695 },
9f5c6faf
TI
7696 [ALC269_FIXUP_HP_GPIO_LED] = {
7697 .type = HDA_FIXUP_FUNC,
7698 .v.func = alc269_fixup_hp_gpio_led,
7699 },
9c5dc3bf
KY
7700 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7701 .type = HDA_FIXUP_FUNC,
7702 .v.func = alc269_fixup_hp_gpio_mic1_led,
7703 },
7704 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7705 .type = HDA_FIXUP_FUNC,
7706 .v.func = alc269_fixup_hp_line1_mic1_led,
7707 },
693b613d 7708 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7709 .type = HDA_FIXUP_FUNC,
9d36a7dc 7710 .v.func = alc_fixup_inv_dmic,
693b613d 7711 },
9b745ab8
TI
7712 [ALC269_FIXUP_NO_SHUTUP] = {
7713 .type = HDA_FIXUP_FUNC,
7714 .v.func = alc_fixup_no_shutup,
7715 },
108cc108 7716 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7717 .type = HDA_FIXUP_PINS,
7718 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7719 { 0x19, 0x23a11040 }, /* dock mic */
7720 { 0x1b, 0x2121103f }, /* dock headphone */
7721 { }
7722 },
7723 .chained = true,
7724 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7725 },
b590b38c
TI
7726 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7727 .type = HDA_FIXUP_FUNC,
7728 .v.func = alc269_fixup_limit_int_mic_boost,
7729 .chained = true,
7730 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7731 },
108cc108 7732 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7733 .type = HDA_FIXUP_FUNC,
108cc108 7734 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7735 .chained = true,
7736 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7737 },
73bdd597
DH
7738 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7739 .type = HDA_FIXUP_PINS,
7740 .v.pins = (const struct hda_pintbl[]) {
7741 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7742 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7743 { }
7744 },
7745 .chained = true,
7746 .chain_id = ALC269_FIXUP_HEADSET_MODE
7747 },
7748 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7749 .type = HDA_FIXUP_PINS,
7750 .v.pins = (const struct hda_pintbl[]) {
7751 { 0x16, 0x21014020 }, /* dock line out */
7752 { 0x19, 0x21a19030 }, /* dock mic */
7753 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7754 { }
7755 },
7756 .chained = true,
7757 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7758 },
338cae56
DH
7759 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7760 .type = HDA_FIXUP_PINS,
7761 .v.pins = (const struct hda_pintbl[]) {
7762 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7763 { }
7764 },
7765 .chained = true,
7766 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7767 },
fcc6c877
KY
7768 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7769 .type = HDA_FIXUP_PINS,
7770 .v.pins = (const struct hda_pintbl[]) {
7771 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7772 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7773 { }
7774 },
7775 .chained = true,
7776 .chain_id = ALC269_FIXUP_HEADSET_MODE
7777 },
73bdd597
DH
7778 [ALC269_FIXUP_HEADSET_MODE] = {
7779 .type = HDA_FIXUP_FUNC,
7780 .v.func = alc_fixup_headset_mode,
6676f308 7781 .chained = true,
b3802783 7782 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7783 },
7784 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7785 .type = HDA_FIXUP_FUNC,
7786 .v.func = alc_fixup_headset_mode_no_hp_mic,
7787 },
7819717b
TI
7788 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7789 .type = HDA_FIXUP_PINS,
7790 .v.pins = (const struct hda_pintbl[]) {
7791 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7792 { }
7793 },
7794 .chained = true,
7795 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7796 },
88cfcf86
DH
7797 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7798 .type = HDA_FIXUP_PINS,
7799 .v.pins = (const struct hda_pintbl[]) {
7800 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7801 { }
7802 },
fbc78ad6
DH
7803 .chained = true,
7804 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7805 },
0fbf21c3 7806 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7807 .type = HDA_FIXUP_PINS,
7808 .v.pins = (const struct hda_pintbl[]) {
7809 {0x12, 0x90a60130},
7810 {0x13, 0x40000000},
7811 {0x14, 0x90170110},
7812 {0x18, 0x411111f0},
7813 {0x19, 0x04a11040},
7814 {0x1a, 0x411111f0},
7815 {0x1b, 0x90170112},
7816 {0x1d, 0x40759a05},
7817 {0x1e, 0x411111f0},
7818 {0x21, 0x04211020},
7819 { }
7820 },
e2744fd7
AB
7821 .chained = true,
7822 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7823 },
a2ef03fe
TE
7824 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7825 .type = HDA_FIXUP_FUNC,
7826 .v.func = alc298_fixup_huawei_mbx_stereo,
7827 .chained = true,
7828 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7829 },
d240d1dc
DH
7830 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7831 .type = HDA_FIXUP_FUNC,
7832 .v.func = alc269_fixup_x101_headset_mic,
7833 },
7834 [ALC269_FIXUP_ASUS_X101_VERB] = {
7835 .type = HDA_FIXUP_VERBS,
7836 .v.verbs = (const struct hda_verb[]) {
7837 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7838 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7839 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7840 { }
7841 },
7842 .chained = true,
7843 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7844 },
7845 [ALC269_FIXUP_ASUS_X101] = {
7846 .type = HDA_FIXUP_PINS,
7847 .v.pins = (const struct hda_pintbl[]) {
7848 { 0x18, 0x04a1182c }, /* Headset mic */
7849 { }
7850 },
7851 .chained = true,
7852 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7853 },
08a978db 7854 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7855 .type = HDA_FIXUP_PINS,
7856 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7857 { 0x14, 0x99130110 }, /* speaker */
7858 { 0x19, 0x01a19c20 }, /* mic */
7859 { 0x1b, 0x99a7012f }, /* int-mic */
7860 { 0x21, 0x0121401f }, /* HP out */
7861 { }
7862 },
7863 },
7864 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7865 .type = HDA_FIXUP_FUNC,
08a978db
DR
7866 .v.func = alc271_hp_gate_mic_jack,
7867 .chained = true,
7868 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7869 },
b1e8972e
OR
7870 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7871 .type = HDA_FIXUP_FUNC,
7872 .v.func = alc269_fixup_limit_int_mic_boost,
7873 .chained = true,
7874 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7875 },
42397004
DR
7876 [ALC269_FIXUP_ACER_AC700] = {
7877 .type = HDA_FIXUP_PINS,
7878 .v.pins = (const struct hda_pintbl[]) {
7879 { 0x12, 0x99a3092f }, /* int-mic */
7880 { 0x14, 0x99130110 }, /* speaker */
7881 { 0x18, 0x03a11c20 }, /* mic */
7882 { 0x1e, 0x0346101e }, /* SPDIF1 */
7883 { 0x21, 0x0321101f }, /* HP out */
7884 { }
7885 },
7886 .chained = true,
7887 .chain_id = ALC271_FIXUP_DMIC,
7888 },
3e0d611b
DH
7889 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7890 .type = HDA_FIXUP_FUNC,
7891 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7892 .chained = true,
7893 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7894 },
2cede303
OR
7895 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7896 .type = HDA_FIXUP_FUNC,
7897 .v.func = alc269_fixup_limit_int_mic_boost,
7898 .chained = true,
7899 .chain_id = ALC269VB_FIXUP_DMIC,
7900 },
23870831
TI
7901 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7902 .type = HDA_FIXUP_VERBS,
7903 .v.verbs = (const struct hda_verb[]) {
7904 /* class-D output amp +5dB */
7905 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7906 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7907 {}
7908 },
7909 .chained = true,
7910 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7911 },
f882c4be
MT
7912 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7913 .type = HDA_FIXUP_PINS,
7914 .v.pins = (const struct hda_pintbl[]) {
7915 { 0x18, 0x01a110f0 }, /* use as headset mic */
7916 { }
7917 },
7918 .chained = true,
7919 .chain_id = ALC269_FIXUP_HEADSET_MIC
7920 },
8e35cd4a
DH
7921 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7922 .type = HDA_FIXUP_FUNC,
7923 .v.func = alc269_fixup_limit_int_mic_boost,
7924 .chained = true,
7925 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7926 },
02b504d9
AA
7927 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7928 .type = HDA_FIXUP_PINS,
7929 .v.pins = (const struct hda_pintbl[]) {
7930 { 0x12, 0x99a3092f }, /* int-mic */
7931 { 0x18, 0x03a11d20 }, /* mic */
7932 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7933 { }
7934 },
7935 },
cd217a63
KY
7936 [ALC283_FIXUP_CHROME_BOOK] = {
7937 .type = HDA_FIXUP_FUNC,
7938 .v.func = alc283_fixup_chromebook,
7939 },
0202e99c
KY
7940 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7941 .type = HDA_FIXUP_FUNC,
7942 .v.func = alc283_fixup_sense_combo_jack,
7943 .chained = true,
7944 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7945 },
7bba2157
TI
7946 [ALC282_FIXUP_ASUS_TX300] = {
7947 .type = HDA_FIXUP_FUNC,
7948 .v.func = alc282_fixup_asus_tx300,
7949 },
1bb3e062
KY
7950 [ALC283_FIXUP_INT_MIC] = {
7951 .type = HDA_FIXUP_VERBS,
7952 .v.verbs = (const struct hda_verb[]) {
7953 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7954 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7955 { }
7956 },
7957 .chained = true,
7958 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7959 },
0f4881dc
DH
7960 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7961 .type = HDA_FIXUP_PINS,
7962 .v.pins = (const struct hda_pintbl[]) {
7963 { 0x17, 0x90170112 }, /* subwoofer */
7964 { }
7965 },
7966 .chained = true,
7967 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7968 },
7969 [ALC290_FIXUP_SUBWOOFER] = {
7970 .type = HDA_FIXUP_PINS,
7971 .v.pins = (const struct hda_pintbl[]) {
7972 { 0x17, 0x90170112 }, /* subwoofer */
7973 { }
7974 },
7975 .chained = true,
7976 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7977 },
338cae56
DH
7978 [ALC290_FIXUP_MONO_SPEAKERS] = {
7979 .type = HDA_FIXUP_FUNC,
7980 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
7981 },
7982 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7983 .type = HDA_FIXUP_FUNC,
7984 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
7985 .chained = true,
7986 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7987 },
b67ae3f1
DH
7988 [ALC269_FIXUP_THINKPAD_ACPI] = {
7989 .type = HDA_FIXUP_FUNC,
d5a6cabf 7990 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
7991 .chained = true,
7992 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 7993 },
56f27013
DH
7994 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7995 .type = HDA_FIXUP_FUNC,
7996 .v.func = alc_fixup_inv_dmic,
7997 .chained = true,
7998 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7999 },
5824ce8d 8000 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
8001 .type = HDA_FIXUP_PINS,
8002 .v.pins = (const struct hda_pintbl[]) {
8003 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8004 { }
5824ce8d
CC
8005 },
8006 .chained = true,
17d30460 8007 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 8008 },
615966ad
CC
8009 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8010 .type = HDA_FIXUP_PINS,
8011 .v.pins = (const struct hda_pintbl[]) {
8012 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8013 { }
8014 },
8015 .chained = true,
8016 .chain_id = ALC255_FIXUP_HEADSET_MODE
8017 },
9a22a8f5
KY
8018 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8019 .type = HDA_FIXUP_PINS,
8020 .v.pins = (const struct hda_pintbl[]) {
8021 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8022 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8023 { }
8024 },
8025 .chained = true,
8026 .chain_id = ALC255_FIXUP_HEADSET_MODE
8027 },
31278997
KY
8028 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8029 .type = HDA_FIXUP_PINS,
8030 .v.pins = (const struct hda_pintbl[]) {
8031 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8032 { }
8033 },
8034 .chained = true,
8035 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8036 },
9a22a8f5
KY
8037 [ALC255_FIXUP_HEADSET_MODE] = {
8038 .type = HDA_FIXUP_FUNC,
8039 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 8040 .chained = true,
b3802783 8041 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 8042 },
31278997
KY
8043 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8044 .type = HDA_FIXUP_FUNC,
8045 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8046 },
a22aa26f
KY
8047 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8048 .type = HDA_FIXUP_PINS,
8049 .v.pins = (const struct hda_pintbl[]) {
8050 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8051 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8052 { }
8053 },
8054 .chained = true,
8055 .chain_id = ALC269_FIXUP_HEADSET_MODE
8056 },
1c37c223 8057 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 8058 .type = HDA_FIXUP_FUNC,
7f57d803 8059 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
8060 .chained = true,
8061 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8062 },
9a811230
TI
8063 [ALC292_FIXUP_TPT440] = {
8064 .type = HDA_FIXUP_FUNC,
157f0b7f 8065 .v.func = alc_fixup_disable_aamix,
9a811230
TI
8066 .chained = true,
8067 .chain_id = ALC292_FIXUP_TPT440_DOCK,
8068 },
abaa2274 8069 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
8070 .type = HDA_FIXUP_PINS,
8071 .v.pins = (const struct hda_pintbl[]) {
8072 { 0x19, 0x04a110f0 },
8073 { },
8074 },
8075 },
b3802783 8076 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 8077 .type = HDA_FIXUP_FUNC,
8a503555 8078 .v.func = alc_fixup_micmute_led,
00ef9940 8079 },
1a22e775
TI
8080 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
8081 .type = HDA_FIXUP_PINS,
8082 .v.pins = (const struct hda_pintbl[]) {
8083 { 0x12, 0x90a60130 },
8084 { 0x14, 0x90170110 },
8085 { 0x17, 0x40000008 },
8086 { 0x18, 0x411111f0 },
0420694d 8087 { 0x19, 0x01a1913c },
1a22e775
TI
8088 { 0x1a, 0x411111f0 },
8089 { 0x1b, 0x411111f0 },
8090 { 0x1d, 0x40f89b2d },
8091 { 0x1e, 0x411111f0 },
8092 { 0x21, 0x0321101f },
8093 { },
8094 },
8095 },
c8426b27
TI
8096 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8097 .type = HDA_FIXUP_FUNC,
8098 .v.func = alc269vb_fixup_aspire_e1_coef,
8099 },
7a5255f1
DH
8100 [ALC280_FIXUP_HP_GPIO4] = {
8101 .type = HDA_FIXUP_FUNC,
8102 .v.func = alc280_fixup_hp_gpio4,
8103 },
eaa8e5ef
KY
8104 [ALC286_FIXUP_HP_GPIO_LED] = {
8105 .type = HDA_FIXUP_FUNC,
8106 .v.func = alc286_fixup_hp_gpio_led,
8107 },
33f4acd3
DH
8108 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8109 .type = HDA_FIXUP_FUNC,
8110 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8111 },
b4b33f9d
TC
8112 [ALC280_FIXUP_HP_DOCK_PINS] = {
8113 .type = HDA_FIXUP_PINS,
8114 .v.pins = (const struct hda_pintbl[]) {
8115 { 0x1b, 0x21011020 }, /* line-out */
8116 { 0x1a, 0x01a1903c }, /* headset mic */
8117 { 0x18, 0x2181103f }, /* line-in */
8118 { },
8119 },
8120 .chained = true,
8121 .chain_id = ALC280_FIXUP_HP_GPIO4
8122 },
04d5466a
JK
8123 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8124 .type = HDA_FIXUP_PINS,
8125 .v.pins = (const struct hda_pintbl[]) {
8126 { 0x1b, 0x21011020 }, /* line-out */
8127 { 0x18, 0x2181103f }, /* line-in */
8128 { },
8129 },
8130 .chained = true,
8131 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8132 },
98973f2f
KP
8133 [ALC280_FIXUP_HP_9480M] = {
8134 .type = HDA_FIXUP_FUNC,
8135 .v.func = alc280_fixup_hp_9480m,
8136 },
c3bb2b52
TI
8137 [ALC245_FIXUP_HP_X360_AMP] = {
8138 .type = HDA_FIXUP_FUNC,
8139 .v.func = alc245_fixup_hp_x360_amp,
5fc462c3
JC
8140 .chained = true,
8141 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 8142 },
e1e62b98
KY
8143 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
8144 .type = HDA_FIXUP_FUNC,
8145 .v.func = alc_fixup_headset_mode_dell_alc288,
8146 .chained = true,
b3802783 8147 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
8148 },
8149 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8150 .type = HDA_FIXUP_PINS,
8151 .v.pins = (const struct hda_pintbl[]) {
8152 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8153 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8154 { }
8155 },
8156 .chained = true,
8157 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8158 },
831bfdf9
HW
8159 [ALC288_FIXUP_DISABLE_AAMIX] = {
8160 .type = HDA_FIXUP_FUNC,
8161 .v.func = alc_fixup_disable_aamix,
8162 .chained = true,
d44a6864 8163 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
8164 },
8165 [ALC288_FIXUP_DELL_XPS_13] = {
8166 .type = HDA_FIXUP_FUNC,
8167 .v.func = alc_fixup_dell_xps13,
8168 .chained = true,
8169 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
8170 },
8b99aba7
TI
8171 [ALC292_FIXUP_DISABLE_AAMIX] = {
8172 .type = HDA_FIXUP_FUNC,
8173 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
8174 .chained = true,
8175 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 8176 },
c04017ea
DH
8177 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8178 .type = HDA_FIXUP_FUNC,
8179 .v.func = alc_fixup_disable_aamix,
8180 .chained = true,
8181 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8182 },
5fab5829 8183 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
8184 .type = HDA_FIXUP_FUNC,
8185 .v.func = alc_fixup_dell_xps13,
8186 .chained = true,
8187 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
8188 },
5fab5829
TI
8189 [ALC292_FIXUP_DELL_E7X] = {
8190 .type = HDA_FIXUP_FUNC,
8a503555 8191 .v.func = alc_fixup_micmute_led,
5fab5829
TI
8192 /* micmute fixup must be applied at last */
8193 .chained_before = true,
8194 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8195 },
54324221
JM
8196 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8197 .type = HDA_FIXUP_PINS,
8198 .v.pins = (const struct hda_pintbl[]) {
8199 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8200 { }
8201 },
8202 .chained_before = true,
8203 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8204 },
977e6276
KY
8205 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8206 .type = HDA_FIXUP_PINS,
8207 .v.pins = (const struct hda_pintbl[]) {
8208 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8209 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8210 { }
8211 },
8212 .chained = true,
8213 .chain_id = ALC269_FIXUP_HEADSET_MODE
8214 },
2f726aec
HW
8215 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8216 .type = HDA_FIXUP_PINS,
8217 .v.pins = (const struct hda_pintbl[]) {
8218 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8219 { }
8220 },
8221 .chained = true,
8222 .chain_id = ALC269_FIXUP_HEADSET_MODE
8223 },
6ed1131f
KY
8224 [ALC275_FIXUP_DELL_XPS] = {
8225 .type = HDA_FIXUP_VERBS,
8226 .v.verbs = (const struct hda_verb[]) {
8227 /* Enables internal speaker */
8228 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8229 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8230 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8231 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8232 {}
8233 }
8234 },
23adc192
HW
8235 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8236 .type = HDA_FIXUP_FUNC,
8237 .v.func = alc_fixup_disable_aamix,
8238 .chained = true,
8239 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8240 },
3694cb29
K
8241 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8242 .type = HDA_FIXUP_FUNC,
8243 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8244 },
d1ee66c5
PC
8245 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8246 .type = HDA_FIXUP_FUNC,
8247 .v.func = alc_fixup_inv_dmic,
8248 .chained = true,
8249 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8250 },
8251 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8252 .type = HDA_FIXUP_FUNC,
8253 .v.func = alc269_fixup_limit_int_mic_boost
8254 },
3b43b71f
KHF
8255 [ALC255_FIXUP_DELL_SPK_NOISE] = {
8256 .type = HDA_FIXUP_FUNC,
8257 .v.func = alc_fixup_disable_aamix,
8258 .chained = true,
8259 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8260 },
d1dd4211
KY
8261 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
8262 .type = HDA_FIXUP_FUNC,
8263 .v.func = alc_fixup_disable_mic_vref,
8264 .chained = true,
8265 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8266 },
2ae95577
DH
8267 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8268 .type = HDA_FIXUP_VERBS,
8269 .v.verbs = (const struct hda_verb[]) {
8270 /* Disable pass-through path for FRONT 14h */
8271 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8272 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8273 {}
8274 },
8275 .chained = true,
d1dd4211 8276 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 8277 },
f883982d
TI
8278 [ALC280_FIXUP_HP_HEADSET_MIC] = {
8279 .type = HDA_FIXUP_FUNC,
8280 .v.func = alc_fixup_disable_aamix,
8281 .chained = true,
8282 .chain_id = ALC269_FIXUP_HEADSET_MIC,
8283 },
e549d190
HW
8284 [ALC221_FIXUP_HP_FRONT_MIC] = {
8285 .type = HDA_FIXUP_PINS,
8286 .v.pins = (const struct hda_pintbl[]) {
8287 { 0x19, 0x02a19020 }, /* Front Mic */
8288 { }
8289 },
8290 },
c636b95e
SE
8291 [ALC292_FIXUP_TPT460] = {
8292 .type = HDA_FIXUP_FUNC,
8293 .v.func = alc_fixup_tpt440_dock,
8294 .chained = true,
8295 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8296 },
dd9aa335
HW
8297 [ALC298_FIXUP_SPK_VOLUME] = {
8298 .type = HDA_FIXUP_FUNC,
8299 .v.func = alc298_fixup_speaker_volume,
59ec4b57 8300 .chained = true,
2f726aec 8301 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 8302 },
f86de9b1
KY
8303 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8304 .type = HDA_FIXUP_FUNC,
8305 .v.func = alc298_fixup_speaker_volume,
8306 },
e312a869
TI
8307 [ALC295_FIXUP_DISABLE_DAC3] = {
8308 .type = HDA_FIXUP_FUNC,
8309 .v.func = alc295_fixup_disable_dac3,
8310 },
d2cd795c
JK
8311 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8312 .type = HDA_FIXUP_FUNC,
8313 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
8314 .chained = true,
8315 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 8316 },
4b963ae1
AS
8317 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8318 .type = HDA_FIXUP_FUNC,
8319 .v.func = alc285_fixup_speaker2_to_dac1,
8320 .chained = true,
8321 .chain_id = ALC245_FIXUP_CS35L41_SPI_2
8322 },
8323 [ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8324 .type = HDA_FIXUP_PINS,
8325 .v.pins = (const struct hda_pintbl[]) {
8326 { 0x19, 0x03a11050 },
8327 { 0x1b, 0x03a11c30 },
8328 { }
8329 },
8330 .chained = true,
8331 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8332 },
b759a5f0
LJ
8333 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8334 .type = HDA_FIXUP_PINS,
8335 .v.pins = (const struct hda_pintbl[]) {
8336 { 0x14, 0x90170120 },
8337 { }
8338 },
8339 .chained = true,
8340 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8341 },
8cc87c05
LJ
8342 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8343 .type = HDA_FIXUP_FUNC,
8344 .v.func = alc285_fixup_speaker2_to_dac1,
8345 .chained = true,
8346 .chain_id = ALC287_FIXUP_CS35L41_I2C_2
8347 },
8348 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8349 .type = HDA_FIXUP_PINS,
8350 .v.pins = (const struct hda_pintbl[]) {
8351 { 0x19, 0x03a11050 },
8352 { 0x1b, 0x03a11c30 },
8353 { }
8354 },
8355 .chained = true,
8356 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8357 },
fd06c77e
KHF
8358 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8359 .type = HDA_FIXUP_PINS,
8360 .v.pins = (const struct hda_pintbl[]) {
8361 { 0x1b, 0x90170151 },
8362 { }
8363 },
8364 .chained = true,
8365 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8366 },
823ff161
GM
8367 [ALC269_FIXUP_ATIV_BOOK_8] = {
8368 .type = HDA_FIXUP_FUNC,
8369 .v.func = alc_fixup_auto_mute_via_amp,
8370 .chained = true,
8371 .chain_id = ALC269_FIXUP_NO_SHUTUP
8372 },
4ba5c853
MT
8373 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8374 .type = HDA_FIXUP_PINS,
8375 .v.pins = (const struct hda_pintbl[]) {
8376 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8377 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8378 { }
8379 },
8380 .chained = true,
8381 .chain_id = ALC269_FIXUP_HEADSET_MODE
8382 },
9eb5d0e6
KY
8383 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8384 .type = HDA_FIXUP_PINS,
8385 .v.pins = (const struct hda_pintbl[]) {
8386 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8387 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8388 { }
8389 },
8390 .chained = true,
8391 .chain_id = ALC269_FIXUP_HEADSET_MODE
8392 },
c1732ede
CC
8393 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8394 .type = HDA_FIXUP_FUNC,
8395 .v.func = alc_fixup_headset_mode,
8396 },
8397 [ALC256_FIXUP_ASUS_MIC] = {
8398 .type = HDA_FIXUP_PINS,
8399 .v.pins = (const struct hda_pintbl[]) {
8400 { 0x13, 0x90a60160 }, /* use as internal mic */
8401 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8402 { }
8403 },
8404 .chained = true,
8405 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8406 },
eeed4cd1 8407 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
8408 .type = HDA_FIXUP_FUNC,
8409 /* Set up GPIO2 for the speaker amp */
8410 .v.func = alc_fixup_gpio4,
eeed4cd1 8411 },
216d7aeb
CC
8412 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8413 .type = HDA_FIXUP_PINS,
8414 .v.pins = (const struct hda_pintbl[]) {
8415 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8416 { }
8417 },
8418 .chained = true,
8419 .chain_id = ALC269_FIXUP_HEADSET_MIC
8420 },
8421 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8422 .type = HDA_FIXUP_VERBS,
8423 .v.verbs = (const struct hda_verb[]) {
8424 /* Enables internal speaker */
8425 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8426 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8427 {}
8428 },
8429 .chained = true,
8430 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8431 },
ca169cc2
KY
8432 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8433 .type = HDA_FIXUP_FUNC,
8434 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
8435 .chained = true,
8436 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 8437 },
ea5c7eba
JHP
8438 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
8439 .type = HDA_FIXUP_VERBS,
8440 .v.verbs = (const struct hda_verb[]) {
8441 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8442 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8443 { }
8444 },
8445 .chained = true,
8446 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8447 },
f33f79f3
HW
8448 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8449 .type = HDA_FIXUP_PINS,
8450 .v.pins = (const struct hda_pintbl[]) {
8451 /* Change the mic location from front to right, otherwise there are
8452 two front mics with the same name, pulseaudio can't handle them.
8453 This is just a temporary workaround, after applying this fixup,
8454 there will be one "Front Mic" and one "Mic" in this machine.
8455 */
8456 { 0x1a, 0x04a19040 },
8457 { }
8458 },
8459 },
5f364135
KY
8460 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8461 .type = HDA_FIXUP_PINS,
8462 .v.pins = (const struct hda_pintbl[]) {
8463 { 0x16, 0x0101102f }, /* Rear Headset HP */
8464 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8465 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8466 { 0x1b, 0x02011020 },
8467 { }
8468 },
8469 .chained = true,
52e4e368
KHF
8470 .chain_id = ALC225_FIXUP_S3_POP_NOISE
8471 },
8472 [ALC225_FIXUP_S3_POP_NOISE] = {
8473 .type = HDA_FIXUP_FUNC,
8474 .v.func = alc225_fixup_s3_pop_noise,
8475 .chained = true,
5f364135
KY
8476 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8477 },
b84e8436
PH
8478 [ALC700_FIXUP_INTEL_REFERENCE] = {
8479 .type = HDA_FIXUP_VERBS,
8480 .v.verbs = (const struct hda_verb[]) {
8481 /* Enables internal speaker */
8482 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8483 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8484 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8485 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8486 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8487 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8488 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8489 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8490 {}
8491 }
8492 },
92266651
KY
8493 [ALC274_FIXUP_DELL_BIND_DACS] = {
8494 .type = HDA_FIXUP_FUNC,
8495 .v.func = alc274_fixup_bind_dacs,
8496 .chained = true,
8497 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8498 },
8499 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8500 .type = HDA_FIXUP_PINS,
8501 .v.pins = (const struct hda_pintbl[]) {
8502 { 0x1b, 0x0401102f },
8503 { }
8504 },
8505 .chained = true,
8506 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
8507 },
399c01aa 8508 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
8509 .type = HDA_FIXUP_FUNC,
8510 .v.func = alc_fixup_tpt470_dock,
8511 .chained = true,
8512 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8513 },
399c01aa
TI
8514 [ALC298_FIXUP_TPT470_DOCK] = {
8515 .type = HDA_FIXUP_FUNC,
8516 .v.func = alc_fixup_tpt470_dacs,
8517 .chained = true,
8518 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8519 },
ae104a21
KY
8520 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8521 .type = HDA_FIXUP_PINS,
8522 .v.pins = (const struct hda_pintbl[]) {
8523 { 0x14, 0x0201101f },
8524 { }
8525 },
8526 .chained = true,
8527 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8528 },
f0ba9d69
KY
8529 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
8530 .type = HDA_FIXUP_PINS,
8531 .v.pins = (const struct hda_pintbl[]) {
8532 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8533 { }
8534 },
3ce0d5aa
HW
8535 .chained = true,
8536 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 8537 },
bbf8ff6b
TB
8538 [ALC295_FIXUP_HP_X360] = {
8539 .type = HDA_FIXUP_FUNC,
8540 .v.func = alc295_fixup_hp_top_speakers,
8541 .chained = true,
8542 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
8543 },
8544 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8545 .type = HDA_FIXUP_PINS,
8546 .v.pins = (const struct hda_pintbl[]) {
8547 { 0x19, 0x0181313f},
8548 { }
8549 },
8550 .chained = true,
8551 .chain_id = ALC269_FIXUP_HEADSET_MIC
8552 },
c4cfcf6f
HW
8553 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8554 .type = HDA_FIXUP_FUNC,
8555 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
8556 .chained = true,
8557 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 8558 },
e8ed64b0
GKK
8559 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8560 .type = HDA_FIXUP_FUNC,
8561 .v.func = alc_fixup_auto_mute_via_amp,
8562 },
33aaebd4
CC
8563 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8564 .type = HDA_FIXUP_PINS,
8565 .v.pins = (const struct hda_pintbl[]) {
8566 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8567 { }
8568 },
8569 .chained = true,
8570 .chain_id = ALC269_FIXUP_HEADSET_MIC
8571 },
d8ae458e
CC
8572 [ALC294_FIXUP_ASUS_MIC] = {
8573 .type = HDA_FIXUP_PINS,
8574 .v.pins = (const struct hda_pintbl[]) {
8575 { 0x13, 0x90a60160 }, /* use as internal mic */
8576 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8577 { }
8578 },
8579 .chained = true,
ef9ddb9d 8580 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 8581 },
4e051106
JHP
8582 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8583 .type = HDA_FIXUP_PINS,
8584 .v.pins = (const struct hda_pintbl[]) {
82b01149 8585 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
8586 { }
8587 },
8588 .chained = true,
ef9ddb9d 8589 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
8590 },
8591 [ALC294_FIXUP_ASUS_SPK] = {
8592 .type = HDA_FIXUP_VERBS,
8593 .v.verbs = (const struct hda_verb[]) {
8594 /* Set EAPD high */
8595 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8596 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
8597 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8598 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
8599 { }
8600 },
8601 .chained = true,
8602 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8603 },
c8a9afa6 8604 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 8605 .type = HDA_FIXUP_FUNC,
c8a9afa6 8606 .v.func = alc295_fixup_chromebook,
8983eb60
KY
8607 .chained = true,
8608 .chain_id = ALC225_FIXUP_HEADSET_JACK
8609 },
8610 [ALC225_FIXUP_HEADSET_JACK] = {
8611 .type = HDA_FIXUP_FUNC,
8612 .v.func = alc_fixup_headset_jack,
e854747d 8613 },
89e3a568
JS
8614 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8615 .type = HDA_FIXUP_PINS,
8616 .v.pins = (const struct hda_pintbl[]) {
8617 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8618 { }
8619 },
8620 .chained = true,
8621 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8622 },
c8c6ee61
HW
8623 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8624 .type = HDA_FIXUP_VERBS,
8625 .v.verbs = (const struct hda_verb[]) {
8626 /* Disable PCBEEP-IN passthrough */
8627 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8628 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8629 { }
8630 },
8631 .chained = true,
8632 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8633 },
cbc05fd6
JHP
8634 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8635 .type = HDA_FIXUP_PINS,
8636 .v.pins = (const struct hda_pintbl[]) {
8637 { 0x19, 0x03a11130 },
8638 { 0x1a, 0x90a60140 }, /* use as internal mic */
8639 { }
8640 },
8641 .chained = true,
8642 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8643 },
136824ef
KY
8644 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8645 .type = HDA_FIXUP_PINS,
8646 .v.pins = (const struct hda_pintbl[]) {
8647 { 0x16, 0x01011020 }, /* Rear Line out */
8648 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8649 { }
8650 },
8651 .chained = true,
8652 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8653 },
8654 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8655 .type = HDA_FIXUP_FUNC,
8656 .v.func = alc_fixup_auto_mute_via_amp,
8657 .chained = true,
8658 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8659 },
8660 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8661 .type = HDA_FIXUP_FUNC,
8662 .v.func = alc_fixup_disable_mic_vref,
8663 .chained = true,
8664 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8665 },
667a8f73
JHP
8666 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8667 .type = HDA_FIXUP_VERBS,
8668 .v.verbs = (const struct hda_verb[]) {
8669 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8670 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8671 { }
8672 },
8673 .chained = true,
8674 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8675 },
8c8967a7
DD
8676 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8677 .type = HDA_FIXUP_PINS,
8678 .v.pins = (const struct hda_pintbl[]) {
8679 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8680 { }
8681 },
8682 .chained = true,
8683 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8684 },
e1037354
JHP
8685 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8686 .type = HDA_FIXUP_PINS,
8687 .v.pins = (const struct hda_pintbl[]) {
8688 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8689 { }
8690 },
8691 .chained = true,
8692 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8693 },
e2a829b3
BR
8694 [ALC299_FIXUP_PREDATOR_SPK] = {
8695 .type = HDA_FIXUP_PINS,
8696 .v.pins = (const struct hda_pintbl[]) {
8697 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8698 { }
8699 }
8700 },
bd9c10bc 8701 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
8702 .type = HDA_FIXUP_PINS,
8703 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
8704 { 0x19, 0x04a11040 },
8705 { 0x21, 0x04211020 },
60083f9e
JHP
8706 { }
8707 },
8708 .chained = true,
bd9c10bc 8709 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 8710 },
f0d9da19
KY
8711 [ALC289_FIXUP_DELL_SPK1] = {
8712 .type = HDA_FIXUP_PINS,
8713 .v.pins = (const struct hda_pintbl[]) {
8714 { 0x14, 0x90170140 },
8715 { }
8716 },
8717 .chained = true,
8718 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8719 },
e79c2269 8720 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
8721 .type = HDA_FIXUP_PINS,
8722 .v.pins = (const struct hda_pintbl[]) {
e79c2269 8723 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
8724 { }
8725 },
8726 .chained = true,
e79c2269 8727 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 8728 },
e79c2269
KY
8729 [ALC289_FIXUP_DUAL_SPK] = {
8730 .type = HDA_FIXUP_FUNC,
8731 .v.func = alc285_fixup_speaker2_to_dac1,
8732 .chained = true,
8733 .chain_id = ALC289_FIXUP_DELL_SPK2
8734 },
f0d9da19
KY
8735 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
8736 .type = HDA_FIXUP_FUNC,
8737 .v.func = alc285_fixup_speaker2_to_dac1,
8738 .chained = true,
8739 .chain_id = ALC289_FIXUP_DELL_SPK1
8740 },
48e01504
CC
8741 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8742 .type = HDA_FIXUP_FUNC,
8743 .v.func = alc285_fixup_speaker2_to_dac1,
8744 .chained = true,
8745 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8746 },
8747 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8748 .type = HDA_FIXUP_FUNC,
8749 /* The GPIO must be pulled to initialize the AMP */
8750 .v.func = alc_fixup_gpio4,
8751 .chained = true,
48e01504 8752 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8753 },
724418b8
MA
8754 [ALC294_FIXUP_ASUS_ALLY] = {
8755 .type = HDA_FIXUP_FUNC,
8756 .v.func = cs35l41_fixup_i2c_two,
8757 .chained = true,
8758 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8759 },
8760 [ALC294_FIXUP_ASUS_ALLY_PINS] = {
8761 .type = HDA_FIXUP_PINS,
8762 .v.pins = (const struct hda_pintbl[]) {
8763 { 0x19, 0x03a11050 },
8764 { 0x1a, 0x03a11c30 },
8765 { 0x21, 0x03211420 },
8766 { }
8767 },
8768 .chained = true,
8769 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8770 },
8771 [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
8772 .type = HDA_FIXUP_VERBS,
8773 .v.verbs = (const struct hda_verb[]) {
8774 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8775 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8776 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
8777 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
8778 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
8779 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
8780 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
8781 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
8782 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
8783 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
8784 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
8785 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
8786 { }
8787 },
8788 .chained = true,
8789 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
8790 },
8791 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
8792 .type = HDA_FIXUP_FUNC,
8793 .v.func = alc285_fixup_speaker2_to_dac1,
8794 },
6a6660d0
TI
8795 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8796 .type = HDA_FIXUP_FUNC,
8797 .v.func = alc285_fixup_thinkpad_x1_gen7,
8798 .chained = true,
8799 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8800 },
76f7dec0
KY
8801 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8802 .type = HDA_FIXUP_FUNC,
8803 .v.func = alc_fixup_headset_jack,
8804 .chained = true,
6a6660d0 8805 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8806 },
8b33a134
JHP
8807 [ALC294_FIXUP_ASUS_HPE] = {
8808 .type = HDA_FIXUP_VERBS,
8809 .v.verbs = (const struct hda_verb[]) {
8810 /* Set EAPD high */
8811 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8812 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8813 { }
8814 },
8815 .chained = true,
8816 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8817 },
c3cdf189
LJ
8818 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8819 .type = HDA_FIXUP_PINS,
8820 .v.pins = (const struct hda_pintbl[]) {
8821 { 0x19, 0x03a11050 }, /* front HP mic */
8822 { 0x1a, 0x01a11830 }, /* rear external mic */
8823 { 0x21, 0x03211020 }, /* front HP out */
8824 { }
8825 },
8826 .chained = true,
8827 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8828 },
8829 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8830 .type = HDA_FIXUP_VERBS,
8831 .v.verbs = (const struct hda_verb[]) {
8832 /* set 0x15 to HP-OUT ctrl */
8833 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8834 /* unmute the 0x15 amp */
8835 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8836 { }
8837 },
8838 .chained = true,
8839 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8840 },
8841 [ALC294_FIXUP_ASUS_GX502_HP] = {
8842 .type = HDA_FIXUP_FUNC,
8843 .v.func = alc294_fixup_gx502_hp,
8844 },
c1b55029
DC
8845 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8846 .type = HDA_FIXUP_PINS,
8847 .v.pins = (const struct hda_pintbl[]) {
8848 { 0x19, 0x01a11050 }, /* rear HP mic */
8849 { 0x1a, 0x01a11830 }, /* rear external mic */
8850 { 0x21, 0x012110f0 }, /* rear HP out */
8851 { }
8852 },
8853 .chained = true,
8854 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8855 },
8856 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8857 .type = HDA_FIXUP_VERBS,
8858 .v.verbs = (const struct hda_verb[]) {
8859 /* set 0x15 to HP-OUT ctrl */
8860 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8861 /* unmute the 0x15 amp */
8862 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8863 /* set 0x1b to HP-OUT */
8864 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8865 { }
8866 },
8867 .chained = true,
8868 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8869 },
8870 [ALC294_FIXUP_ASUS_GU502_HP] = {
8871 .type = HDA_FIXUP_FUNC,
8872 .v.func = alc294_fixup_gu502_hp,
c611e659
LJ
8873 },
8874 [ALC294_FIXUP_ASUS_G513_PINS] = {
8875 .type = HDA_FIXUP_PINS,
8876 .v.pins = (const struct hda_pintbl[]) {
8877 { 0x19, 0x03a11050 }, /* front HP mic */
8878 { 0x1a, 0x03a11c30 }, /* rear external mic */
8879 { 0x21, 0x03211420 }, /* front HP out */
8880 { }
8881 },
c1b55029 8882 },
bc2c2354
LJ
8883 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8884 .type = HDA_FIXUP_PINS,
8885 .v.pins = (const struct hda_pintbl[]) {
66ba7c88
LJ
8886 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8887 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8888 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8889 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8890 { 0x21, 0x03211420 },
bc2c2354
LJ
8891 { }
8892 },
bc2c2354 8893 },
1b94e59d
TI
8894 [ALC294_FIXUP_ASUS_COEF_1B] = {
8895 .type = HDA_FIXUP_VERBS,
8896 .v.verbs = (const struct hda_verb[]) {
8897 /* Set bit 10 to correct noisy output after reboot from
8898 * Windows 10 (due to pop noise reduction?)
8899 */
8900 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8901 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8902 { }
8903 },
f8fbcdfb
TI
8904 .chained = true,
8905 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8906 },
f5a88b0a
KHF
8907 [ALC285_FIXUP_HP_GPIO_LED] = {
8908 .type = HDA_FIXUP_FUNC,
8909 .v.func = alc285_fixup_hp_gpio_led,
8910 },
431e76c3
KY
8911 [ALC285_FIXUP_HP_MUTE_LED] = {
8912 .type = HDA_FIXUP_FUNC,
8913 .v.func = alc285_fixup_hp_mute_led,
8914 },
ca88eeb3
LG
8915 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8916 .type = HDA_FIXUP_FUNC,
8917 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
8918 },
0659400f
LG
8919 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
8920 .type = HDA_FIXUP_FUNC,
8921 .v.func = alc236_fixup_hp_mute_led_coefbit2,
8922 },
e7d66cf7
JS
8923 [ALC236_FIXUP_HP_GPIO_LED] = {
8924 .type = HDA_FIXUP_FUNC,
8925 .v.func = alc236_fixup_hp_gpio_led,
8926 },
24164f43
KY
8927 [ALC236_FIXUP_HP_MUTE_LED] = {
8928 .type = HDA_FIXUP_FUNC,
8929 .v.func = alc236_fixup_hp_mute_led,
8930 },
75b62ab6
JW
8931 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8932 .type = HDA_FIXUP_FUNC,
8933 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8934 },
a2d57ebe
KM
8935 [ALC298_FIXUP_SAMSUNG_AMP] = {
8936 .type = HDA_FIXUP_FUNC,
8937 .v.func = alc298_fixup_samsung_amp,
8938 .chained = true,
8939 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8940 },
14425f1f
MP
8941 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8942 .type = HDA_FIXUP_VERBS,
8943 .v.verbs = (const struct hda_verb[]) {
8944 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8945 { }
8946 },
8947 },
ef248d9b
MK
8948 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8949 .type = HDA_FIXUP_VERBS,
8950 .v.verbs = (const struct hda_verb[]) {
8951 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8952 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8953 { }
8954 },
8955 },
9e43342b
CC
8956 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8957 .type = HDA_FIXUP_PINS,
8958 .v.pins = (const struct hda_pintbl[]) {
8959 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8960 { }
8961 },
8962 .chained = true,
8963 .chain_id = ALC269_FIXUP_HEADSET_MODE
8964 },
8eae7e9b
JHP
8965 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8966 .type = HDA_FIXUP_PINS,
8967 .v.pins = (const struct hda_pintbl[]) {
8968 { 0x14, 0x90100120 }, /* use as internal speaker */
8969 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8970 { 0x1a, 0x01011020 }, /* use as line out */
8971 { },
8972 },
8973 .chained = true,
8974 .chain_id = ALC269_FIXUP_HEADSET_MIC
8975 },
6e15d126
JHP
8976 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8977 .type = HDA_FIXUP_PINS,
8978 .v.pins = (const struct hda_pintbl[]) {
8979 { 0x18, 0x02a11030 }, /* use as headset mic */
8980 { }
8981 },
8982 .chained = true,
8983 .chain_id = ALC269_FIXUP_HEADSET_MIC
8984 },
781c90c0
JHP
8985 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8986 .type = HDA_FIXUP_PINS,
8987 .v.pins = (const struct hda_pintbl[]) {
8988 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8989 { }
8990 },
8991 .chained = true,
8992 .chain_id = ALC269_FIXUP_HEADSET_MIC
8993 },
293a92c1 8994 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
8995 .type = HDA_FIXUP_FUNC,
8996 .v.func = alc289_fixup_asus_ga401,
8997 .chained = true,
8998 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 8999 },
4b43d05a
AS
9000 [ALC289_FIXUP_ASUS_GA502] = {
9001 .type = HDA_FIXUP_PINS,
9002 .v.pins = (const struct hda_pintbl[]) {
9003 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
9004 { }
9005 },
9006 },
f50a121d
JHP
9007 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9008 .type = HDA_FIXUP_PINS,
9009 .v.pins = (const struct hda_pintbl[]) {
9010 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9011 { }
9012 },
9013 .chained = true,
9014 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9015 },
56496253
KY
9016 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9017 .type = HDA_FIXUP_FUNC,
9018 .v.func = alc285_fixup_hp_gpio_amp_init,
9019 .chained = true,
9020 .chain_id = ALC285_FIXUP_HP_GPIO_LED
9021 },
f1ec5be1
HC
9022 [ALC269_FIXUP_CZC_B20] = {
9023 .type = HDA_FIXUP_PINS,
9024 .v.pins = (const struct hda_pintbl[]) {
9025 { 0x12, 0x411111f0 },
9026 { 0x14, 0x90170110 }, /* speaker */
9027 { 0x15, 0x032f1020 }, /* HP out */
9028 { 0x17, 0x411111f0 },
9029 { 0x18, 0x03ab1040 }, /* mic */
9030 { 0x19, 0xb7a7013f },
9031 { 0x1a, 0x0181305f },
9032 { 0x1b, 0x411111f0 },
9033 { 0x1d, 0x411111f0 },
9034 { 0x1e, 0x411111f0 },
9035 { }
9036 },
9037 .chain_id = ALC269_FIXUP_DMIC,
9038 },
9039 [ALC269_FIXUP_CZC_TMI] = {
9040 .type = HDA_FIXUP_PINS,
9041 .v.pins = (const struct hda_pintbl[]) {
9042 { 0x12, 0x4000c000 },
9043 { 0x14, 0x90170110 }, /* speaker */
9044 { 0x15, 0x0421401f }, /* HP out */
9045 { 0x17, 0x411111f0 },
9046 { 0x18, 0x04a19020 }, /* mic */
9047 { 0x19, 0x411111f0 },
9048 { 0x1a, 0x411111f0 },
9049 { 0x1b, 0x411111f0 },
9050 { 0x1d, 0x40448505 },
9051 { 0x1e, 0x411111f0 },
9052 { 0x20, 0x8000ffff },
9053 { }
9054 },
9055 .chain_id = ALC269_FIXUP_DMIC,
9056 },
9057 [ALC269_FIXUP_CZC_L101] = {
9058 .type = HDA_FIXUP_PINS,
9059 .v.pins = (const struct hda_pintbl[]) {
9060 { 0x12, 0x40000000 },
9061 { 0x14, 0x01014010 }, /* speaker */
9062 { 0x15, 0x411111f0 }, /* HP out */
9063 { 0x16, 0x411111f0 },
9064 { 0x18, 0x01a19020 }, /* mic */
9065 { 0x19, 0x02a19021 },
9066 { 0x1a, 0x0181302f },
9067 { 0x1b, 0x0221401f },
9068 { 0x1c, 0x411111f0 },
9069 { 0x1d, 0x4044c601 },
9070 { 0x1e, 0x411111f0 },
9071 { }
9072 },
9073 .chain_id = ALC269_FIXUP_DMIC,
9074 },
9075 [ALC269_FIXUP_LEMOTE_A1802] = {
9076 .type = HDA_FIXUP_PINS,
9077 .v.pins = (const struct hda_pintbl[]) {
9078 { 0x12, 0x40000000 },
9079 { 0x14, 0x90170110 }, /* speaker */
9080 { 0x17, 0x411111f0 },
9081 { 0x18, 0x03a19040 }, /* mic1 */
9082 { 0x19, 0x90a70130 }, /* mic2 */
9083 { 0x1a, 0x411111f0 },
9084 { 0x1b, 0x411111f0 },
9085 { 0x1d, 0x40489d2d },
9086 { 0x1e, 0x411111f0 },
9087 { 0x20, 0x0003ffff },
9088 { 0x21, 0x03214020 },
9089 { }
9090 },
9091 .chain_id = ALC269_FIXUP_DMIC,
9092 },
9093 [ALC269_FIXUP_LEMOTE_A190X] = {
9094 .type = HDA_FIXUP_PINS,
9095 .v.pins = (const struct hda_pintbl[]) {
9096 { 0x14, 0x99130110 }, /* speaker */
9097 { 0x15, 0x0121401f }, /* HP out */
9098 { 0x18, 0x01a19c20 }, /* rear mic */
9099 { 0x19, 0x99a3092f }, /* front mic */
9100 { 0x1b, 0x0201401f }, /* front lineout */
9101 { }
9102 },
9103 .chain_id = ALC269_FIXUP_DMIC,
9104 },
e2d2fded
KHF
9105 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9106 .type = HDA_FIXUP_PINS,
9107 .v.pins = (const struct hda_pintbl[]) {
9108 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9109 { }
9110 },
9111 .chained = true,
9112 .chain_id = ALC269_FIXUP_HEADSET_MODE
9113 },
73e7161e
WS
9114 [ALC256_FIXUP_INTEL_NUC10] = {
9115 .type = HDA_FIXUP_PINS,
9116 .v.pins = (const struct hda_pintbl[]) {
9117 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9118 { }
9119 },
9120 .chained = true,
9121 .chain_id = ALC269_FIXUP_HEADSET_MODE
9122 },
fc19d559
HW
9123 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9124 .type = HDA_FIXUP_VERBS,
9125 .v.verbs = (const struct hda_verb[]) {
9126 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9127 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9128 { }
9129 },
9130 .chained = true,
c84bfedc 9131 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 9132 },
13468bfa
HW
9133 [ALC274_FIXUP_HP_MIC] = {
9134 .type = HDA_FIXUP_VERBS,
9135 .v.verbs = (const struct hda_verb[]) {
9136 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9137 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9138 { }
9139 },
9140 },
8a8de09c
KY
9141 [ALC274_FIXUP_HP_HEADSET_MIC] = {
9142 .type = HDA_FIXUP_FUNC,
9143 .v.func = alc274_fixup_hp_headset_mic,
9144 .chained = true,
9145 .chain_id = ALC274_FIXUP_HP_MIC
9146 },
622464c8
TI
9147 [ALC274_FIXUP_HP_ENVY_GPIO] = {
9148 .type = HDA_FIXUP_FUNC,
9149 .v.func = alc274_fixup_hp_envy_gpio,
9150 },
ef9ce66f
KY
9151 [ALC256_FIXUP_ASUS_HPE] = {
9152 .type = HDA_FIXUP_VERBS,
9153 .v.verbs = (const struct hda_verb[]) {
9154 /* Set EAPD high */
9155 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9156 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9157 { }
9158 },
9159 .chained = true,
9160 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9161 },
446b8185
KY
9162 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9163 .type = HDA_FIXUP_FUNC,
9164 .v.func = alc_fixup_headset_jack,
9165 .chained = true,
9166 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9167 },
a0ccbc53
KY
9168 [ALC287_FIXUP_HP_GPIO_LED] = {
9169 .type = HDA_FIXUP_FUNC,
9170 .v.func = alc287_fixup_hp_gpio_led,
9171 },
9e885770
KY
9172 [ALC256_FIXUP_HP_HEADSET_MIC] = {
9173 .type = HDA_FIXUP_FUNC,
9174 .v.func = alc274_fixup_hp_headset_mic,
9175 },
92666d45
KY
9176 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9177 .type = HDA_FIXUP_FUNC,
9178 .v.func = alc_fixup_no_int_mic,
9179 .chained = true,
9180 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9181 },
34cdf405
CC
9182 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9183 .type = HDA_FIXUP_PINS,
9184 .v.pins = (const struct hda_pintbl[]) {
9185 { 0x1b, 0x411111f0 },
9186 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9187 { },
9188 },
9189 .chained = true,
9190 .chain_id = ALC269_FIXUP_HEADSET_MODE
9191 },
495dc763
CC
9192 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9193 .type = HDA_FIXUP_FUNC,
9194 .v.func = alc269_fixup_limit_int_mic_boost,
9195 .chained = true,
9196 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9197 },
d0e18561
CC
9198 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
9199 .type = HDA_FIXUP_PINS,
9200 .v.pins = (const struct hda_pintbl[]) {
9201 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9202 { 0x1a, 0x90a1092f }, /* use as internal mic */
9203 { }
9204 },
9205 .chained = true,
9206 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9207 },
26928ca1
TI
9208 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9209 .type = HDA_FIXUP_FUNC,
9210 .v.func = alc285_fixup_ideapad_s740_coef,
9211 .chained = true,
9212 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9213 },
bd15b155
KHF
9214 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9215 .type = HDA_FIXUP_FUNC,
9216 .v.func = alc269_fixup_limit_int_mic_boost,
9217 .chained = true,
9218 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9219 },
8eedd3a7
TI
9220 [ALC295_FIXUP_ASUS_DACS] = {
9221 .type = HDA_FIXUP_FUNC,
9222 .v.func = alc295_fixup_asus_dacs,
9223 },
5d84b531
TI
9224 [ALC295_FIXUP_HP_OMEN] = {
9225 .type = HDA_FIXUP_PINS,
9226 .v.pins = (const struct hda_pintbl[]) {
9227 { 0x12, 0xb7a60130 },
9228 { 0x13, 0x40000000 },
9229 { 0x14, 0x411111f0 },
9230 { 0x16, 0x411111f0 },
9231 { 0x17, 0x90170110 },
9232 { 0x18, 0x411111f0 },
9233 { 0x19, 0x02a11030 },
9234 { 0x1a, 0x411111f0 },
9235 { 0x1b, 0x04a19030 },
9236 { 0x1d, 0x40600001 },
9237 { 0x1e, 0x411111f0 },
9238 { 0x21, 0x03211020 },
9239 {}
9240 },
9241 .chained = true,
9242 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9243 },
f2be77fe 9244 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
9245 .type = HDA_FIXUP_FUNC,
9246 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 9247 },
d94befbb
DB
9248 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9249 .type = HDA_FIXUP_FUNC,
9250 .v.func = alc285_fixup_hp_spectre_x360_eb1
9251 },
9ebaef05
HW
9252 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9253 .type = HDA_FIXUP_FUNC,
9254 .v.func = alc285_fixup_ideapad_s740_coef,
9255 .chained = true,
9256 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9257 },
29c8f40b
PU
9258 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9259 .type = HDA_FIXUP_FUNC,
9260 .v.func = alc_fixup_no_shutup,
9261 .chained = true,
9262 .chain_id = ALC283_FIXUP_HEADSET_MIC,
9263 },
57c9e21a
HW
9264 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9265 .type = HDA_FIXUP_PINS,
9266 .v.pins = (const struct hda_pintbl[]) {
9267 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9268 { }
9269 },
9270 .chained = true,
9271 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9272 },
8903376d
KHF
9273 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9274 .type = HDA_FIXUP_FUNC,
9275 .v.func = alc269_fixup_limit_int_mic_boost,
9276 .chained = true,
9277 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9278 },
8f4c9042
BF
9279 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9280 .type = HDA_FIXUP_FUNC,
9281 .v.func = alc285_fixup_ideapad_s740_coef,
9282 .chained = true,
9283 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9284 },
9285 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9286 .type = HDA_FIXUP_FUNC,
9287 .v.func = alc287_fixup_legion_15imhg05_speakers,
9288 .chained = true,
9289 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9290 },
ad7cc2d4
CB
9291 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9292 .type = HDA_FIXUP_VERBS,
9293 //.v.verbs = legion_15imhg05_coefs,
9294 .v.verbs = (const struct hda_verb[]) {
9295 // set left speaker Legion 7i.
9296 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9297 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9298
9299 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9300 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9301 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9302 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9303 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9304
9305 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9306 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9307 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9308 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9309 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9310
9311 // set right speaker Legion 7i.
9312 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9313 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9314
9315 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9316 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9317 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9318 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9319 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9320
9321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9322 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9323 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9324 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9325 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9326 {}
9327 },
9328 .chained = true,
9329 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9330 },
9331 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9332 .type = HDA_FIXUP_FUNC,
9333 .v.func = alc287_fixup_legion_15imhg05_speakers,
9334 .chained = true,
9335 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9336 },
9337 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9338 .type = HDA_FIXUP_VERBS,
9339 .v.verbs = (const struct hda_verb[]) {
9340 // set left speaker Yoga 7i.
9341 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9342 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9343
9344 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9345 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9346 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9347 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9348 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9349
9350 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9351 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9352 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9353 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9354 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9355
9356 // set right speaker Yoga 7i.
9357 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9358 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9359
9360 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9361 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9362 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9363 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9364 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9365
9366 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9367 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9368 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9369 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9370 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9371 {}
9372 },
9373 .chained = true,
9374 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9375 },
56ec3e75
TI
9376 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
9377 .type = HDA_FIXUP_FUNC,
9378 .v.func = alc298_fixup_lenovo_c940_duet7,
9379 },
ad7cc2d4
CB
9380 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9381 .type = HDA_FIXUP_VERBS,
9382 .v.verbs = (const struct hda_verb[]) {
9383 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9384 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 9385 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
9386 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9387 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9388 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9389 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9390 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9391 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9392 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9393 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9394 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9395 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9396 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9397 {}
9398 },
9399 .chained = true,
9400 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9401 },
619764cc 9402 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 9403 .type = HDA_FIXUP_FUNC,
619764cc 9404 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 9405 },
5fc462c3
JC
9406 [ALC245_FIXUP_HP_GPIO_LED] = {
9407 .type = HDA_FIXUP_FUNC,
9408 .v.func = alc245_fixup_hp_gpio_led,
9409 },
1278cc5a
JS
9410 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9411 .type = HDA_FIXUP_PINS,
9412 .v.pins = (const struct hda_pintbl[]) {
9413 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9414 { }
9415 },
9416 .chained = true,
9417 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9418 },
174a7fb3
WS
9419 [ALC233_FIXUP_NO_AUDIO_JACK] = {
9420 .type = HDA_FIXUP_FUNC,
9421 .v.func = alc233_fixup_no_audio_jack,
9422 },
edca7cc4
WS
9423 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9424 .type = HDA_FIXUP_FUNC,
9425 .v.func = alc256_fixup_mic_no_presence_and_resume,
9426 .chained = true,
9427 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9428 },
d3dca026
LT
9429 [ALC287_FIXUP_LEGION_16ACHG6] = {
9430 .type = HDA_FIXUP_FUNC,
9431 .v.func = alc287_fixup_legion_16achg6_speakers,
9432 },
ae7abe36
SB
9433 [ALC287_FIXUP_CS35L41_I2C_2] = {
9434 .type = HDA_FIXUP_FUNC,
9435 .v.func = cs35l41_fixup_i2c_two,
9436 },
b3fbe536
AC
9437 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9438 .type = HDA_FIXUP_FUNC,
9439 .v.func = cs35l41_fixup_i2c_two,
9440 .chained = true,
9441 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
ae7abe36 9442 },
42320660
SB
9443 [ALC287_FIXUP_CS35L41_I2C_4] = {
9444 .type = HDA_FIXUP_FUNC,
9445 .v.func = cs35l41_fixup_i2c_four,
9446 },
07bcab93
LT
9447 [ALC245_FIXUP_CS35L41_SPI_2] = {
9448 .type = HDA_FIXUP_FUNC,
9449 .v.func = cs35l41_fixup_spi_two,
9450 },
ce18f905
KHF
9451 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9452 .type = HDA_FIXUP_FUNC,
9453 .v.func = cs35l41_fixup_spi_two,
9454 .chained = true,
9455 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9456 },
07bcab93
LT
9457 [ALC245_FIXUP_CS35L41_SPI_4] = {
9458 .type = HDA_FIXUP_FUNC,
9459 .v.func = cs35l41_fixup_spi_four,
9460 },
9461 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9462 .type = HDA_FIXUP_FUNC,
864cb14c 9463 .v.func = cs35l41_fixup_spi_four,
07bcab93 9464 .chained = true,
864cb14c 9465 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
07bcab93 9466 },
91502a9a
AS
9467 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9468 .type = HDA_FIXUP_VERBS,
9469 .v.verbs = (const struct hda_verb[]) {
9470 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9471 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9472 { }
9473 },
9474 .chained = true,
9475 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9476 },
1efcdd9c
GM
9477 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9478 .type = HDA_FIXUP_FUNC,
9479 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
9480 .chained = true,
9481 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9482 },
309d7363
DH
9483 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9484 .type = HDA_FIXUP_PINS,
9485 .v.pins = (const struct hda_pintbl[]) {
9486 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9487 { }
9488 },
9489 .chained = true,
9490 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9491 },
1e24881d
LT
9492 [ALC287_FIXUP_LEGION_16ITHG6] = {
9493 .type = HDA_FIXUP_FUNC,
9494 .v.func = alc287_fixup_legion_16ithg6_speakers,
9495 },
3790a3d6
PJ
9496 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9497 .type = HDA_FIXUP_VERBS,
9498 .v.verbs = (const struct hda_verb[]) {
9499 // enable left speaker
9500 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9501 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9502
9503 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9504 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9505 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9506 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9507 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9508
9509 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9510 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9511 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9512 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9513 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9514
9515 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9516 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9517 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9518 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9519 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9520
9521 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9522 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9523 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9524 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9525 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9526
9527 // enable right speaker
9528 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9529 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9530
9531 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9532 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9533 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9534 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9535 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9536
9537 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9538 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9539 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9540 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9541 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9542
9543 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9544 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9545 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9546 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9547 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9548
9549 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9550 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9551 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9552 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9553 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9554
9555 { },
9556 },
9557 },
9558 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9559 .type = HDA_FIXUP_FUNC,
9560 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9561 .chained = true,
9562 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9563 },
2912cdda
PJ
9564 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9565 .type = HDA_FIXUP_FUNC,
9566 .v.func = alc295_fixup_dell_inspiron_top_speakers,
9567 .chained = true,
9568 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9569 },
a4517c4f
CC
9570 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
9571 .type = HDA_FIXUP_PINS,
9572 .v.func = alc1220_fixup_gb_dual_codecs,
9573 .chained = true,
9574 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9575 },
f7b069cf
VR
9576 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9577 .type = HDA_FIXUP_FUNC,
9578 .v.func = cs35l41_fixup_i2c_two,
9579 .chained = true,
9580 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9581 },
3babae91
SD
9582 [ALC287_FIXUP_TAS2781_I2C] = {
9583 .type = HDA_FIXUP_FUNC,
9584 .v.func = tas2781_fixup_i2c,
9585 .chained = true,
9586 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9587 },
b5cb53fd
GK
9588 [ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
9589 .type = HDA_FIXUP_FUNC,
9590 .v.func = yoga7_14arb7_fixup_i2c,
9591 .chained = true,
9592 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9593 },
93dc18e1
SJ
9594 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9595 .type = HDA_FIXUP_FUNC,
9596 .v.func = alc245_fixup_hp_mute_led_coefbit,
9597 },
c99c26b1
FV
9598 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9599 .type = HDA_FIXUP_FUNC,
9600 .v.func = alc245_fixup_hp_mute_led_coefbit,
9601 .chained = true,
9602 .chain_id = ALC245_FIXUP_HP_GPIO_LED
9603 },
e43252db
KY
9604 [ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9605 .type = HDA_FIXUP_FUNC,
9606 .v.func = alc287_fixup_bind_dacs,
9607 },
d93eeca6
KY
9608 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9609 .type = HDA_FIXUP_FUNC,
9610 .v.func = alc287_fixup_bind_dacs,
9611 .chained = true,
9612 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9613 },
c8c0a03e
KY
9614 [ALC2XX_FIXUP_HEADSET_MIC] = {
9615 .type = HDA_FIXUP_FUNC,
9616 .v.func = alc_fixup_headset_mic,
9617 },
f0d9da19
KY
9618 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9619 .type = HDA_FIXUP_FUNC,
9620 .v.func = cs35l41_fixup_spi_two,
9621 .chained = true,
9622 .chain_id = ALC289_FIXUP_DUAL_SPK
9623 },
6ae90e90
VT
9624 [ALC294_FIXUP_CS35L41_I2C_2] = {
9625 .type = HDA_FIXUP_FUNC,
9626 .v.func = cs35l41_fixup_i2c_two,
9627 },
f1d4e28b
KY
9628};
9629
1d045db9 9630static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 9631 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
9632 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9633 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 9634 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 9635 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
9636 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9637 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 9638 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 9639 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 9640 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 9641 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 9642 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 9643 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 9644 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 9645 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 9646 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 9647 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
9648 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9649 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
9650 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9651 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 9652 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 9653 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 9654 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 9655 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
667a8f73
JHP
9656 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9657 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9658 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 9659 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
5f3fe25e 9660 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
35171fbf 9661 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 9662 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 9663 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 9664 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
2a5bb694 9665 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 9666 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 9667 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 9668 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
6a28a25d 9669 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
aaedfb47 9670 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
841bdf85 9671 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
6ed1131f 9672 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 9673 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 9674 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
9675 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9676 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 9677 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
9678 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9679 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9680 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
9681 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9682 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 9683 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 9684 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 9685 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
9686 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9687 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 9688 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 9689 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 9690 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 9691 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
9692 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9693 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
9694 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9695 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9696 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9697 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9698 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 9699 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 9700 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 9701 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 9702 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 9703 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 9704 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 9705 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 9706 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
9707 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9708 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
9709 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9710 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 9711 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 9712 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 9713 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 9714 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 9715 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 9716 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
9717 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9718 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
9719 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9720 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
1efcdd9c 9721 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
c1e89523 9722 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 9723 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 9724 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
9725 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9726 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
15dad62f 9727 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
bdc9b739 9728 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
42320660
SB
9729 SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
9730 SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
2912cdda
PJ
9731 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9732 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
cd14dedf 9733 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
a5751933 9734 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
a4517c4f
CC
9735 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9736 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9737 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9738 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9739 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9740 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
42320660 9741 SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
f0d9da19
KY
9742 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9743 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9744 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9745 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9746 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9747 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9748 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9749 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9750 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
a22aa26f
KY
9751 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9752 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 9753 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 9754 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 9755 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 9756 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9757 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9758 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9759 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9760 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9761 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9762 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
9763 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9764 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9765 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9766 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 9767 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
9768 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9769 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9770 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9771 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9772 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 9773 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 9774 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 9775 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 9776 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9777 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9778 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9779 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9780 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9781 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9782 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9783 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9784 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 9785 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9786 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9787 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9788 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9789 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 9790 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9791 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9792 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9793 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9794 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9795 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9796 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9797 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9798 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9799 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9800 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9801 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9802 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9803 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9804 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9805 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
9806 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9807 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9808 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9809 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4ba5c853 9810 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
167897f4
JK
9811 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9812 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
9813 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9814 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
92553ee0 9815 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
e549d190 9816 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 9817 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 9818 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
9819 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9820 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 9821 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 9822 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 9823 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9b726bf6 9824 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
5d84b531 9825 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 9826 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 9827 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
b6ce6e6c 9828 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
d296a74b 9829 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 9830 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 9831 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
622464c8 9832 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
24df5428
IH
9833 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9834 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
ca88eeb3 9835 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
15d295b5 9836 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 9837 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 9838 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
c058493d 9839 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 9840 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 9841 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
05ec7161 9842 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 9843 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 9844 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
6b3d14b7 9845 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
431e76c3 9846 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 9847 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
9848 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9849 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9850 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9851 ALC285_FIXUP_HP_GPIO_AMP_INIT),
30267718 9852 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
b2e6b3d9 9853 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
375f8426 9854 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
48422958 9855 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 9856 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 9857 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 9858 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 9859 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
9860 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9861 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 9862 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 9863 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
bc7863d1 9864 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
d07149ab 9865 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 9866 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
9867 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9868 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
d510acb6 9869 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
53b861be 9870 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 9871 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 9872 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 9873 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
9874 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9875 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 9876 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 9877 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 9878 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0659400f 9879 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
c99c26b1 9880 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
600dd2a7 9881 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
91502a9a 9882 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
0e68c4b1 9883 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 9884 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 9885 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
49632230 9886 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
8384c0ba 9887 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
e7477cb9 9888 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
f86bfeb6 9889 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
5f5d8890
AC
9890 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9891 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9892 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9893 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9894 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9895 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93
LT
9896 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9897 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9898 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9899 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9900 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 9901 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 9902 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
e6194c8d
AC
9903 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9904 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
024a7ad9 9905 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
e6194c8d
AC
9906 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9907 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
f86bfeb6 9908 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93 9909 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
ce18f905 9910 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
f7ac570d 9911 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9a6804aa 9912 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
13a5b211 9913 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
56e85993 9914 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
93dc18e1 9915 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
5f3d696e 9916 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
61d30785
JS
9917 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9918 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9919 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9920 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
3e10f6ca 9921 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
c578d5da
KHF
9922 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9923 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
b944aa9d 9924 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9251584a
AC
9925 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9926 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9927 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9928 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9929 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9930 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
1d8025ec
AC
9931 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9932 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
3e10f6ca 9933 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
2ae147d6 9934 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9fdc1605 9935 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
e94f1f96
AC
9936 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9937 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9938 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
3e10f6ca 9939 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
6c4715aa
AC
9940 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9941 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
5007b848 9942 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
6c4715aa
AC
9943 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
9944 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
9945 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
b752a385 9946 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
858c5415 9947 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
56fc217f 9948 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9dc68a4f 9949 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9c694fbf 9950 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
fb8cce69
SB
9951 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9952 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9953 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9954 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9955 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9956 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9957 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
18a434f3 9958 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b018cee7 9959 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
5d639b60
SB
9960 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9961 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9962 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
c1732ede 9963 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 9964 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 9965 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 9966 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 9967 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 9968 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
713f040c 9969 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
3e0d611b 9970 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 9971 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 9972 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 9973 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
9974 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9975 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
e959f2be 9976 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
461122b9 9977 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
c1732ede 9978 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 9979 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
f882c4be 9980 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
c1732ede 9981 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 9982 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
a40ce9f4
SB
9983 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
9984 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
9985 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
9986 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
9987 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
9988 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
9989 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
9990 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
23870831 9991 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
a40ce9f4
SB
9992 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
9993 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
b16c8f22 9994 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 9995 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
7e2d0662 9996 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
b16c8f22 9997 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
ae53e219 9998 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
3e0d611b 9999 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
ae53e219 10000 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
8eedd3a7 10001 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 10002 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 10003 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
ae53e219 10004 SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
3cd0ed63 10005 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 10006 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
c5c325bb 10007 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
4963d66b 10008 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 10009 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
4fad4fb9 10010 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 10011 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 10012 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 10013 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 10014 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 10015 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
61cbc08f 10016 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
6ae90e90 10017 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
461122b9 10018 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1b94e59d 10019 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
693b613d 10020 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
811dd426 10021 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
615966ad 10022 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
61cbc08f 10023 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
4eab0ea1 10024 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61cbc08f
SB
10025 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10026 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
a4671b7f 10027 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
bc2c2354 10028 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
a40ce9f4
SB
10029 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10030 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
c1732ede 10031 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
a40ce9f4
SB
10032 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10033 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10034 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10035 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
b16c8f22 10036 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ef9ce66f 10037 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
51d97607 10038 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
07058dce
KA
10039 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
10040 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
26fd31ef 10041 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
4b43d05a 10042 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
51d97607 10043 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
c1b55029 10044 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
c611e659 10045 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
76fae618 10046 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
51d97607 10047 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
ba1f8180 10048 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
293a92c1 10049 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8d06679b 10050 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
ae53e219 10051 SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
51d97607 10052 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
2ea8e129 10053 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 10054 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
811dd426
SB
10055 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
10056 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10057 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC245_FIXUP_CS35L41_SPI_2),
10058 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
10059 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
adabb3ec
TI
10060 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10061 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10062 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10063 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 10064 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
10065 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10066 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10067 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 10068 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
10069 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10070 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 10071 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 10072 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 10073 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 10074 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 10075 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 10076 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 10077 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 10078 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 10079 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
4f2e56a5 10080 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
10081 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10082 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ccbd88be 10083 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
0fca97a2 10084 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
a33cc48d 10085 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
a2d57ebe
KM
10086 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10087 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10088 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10089 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
b18a4563 10090 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
1abfd71e 10091 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
823ff161 10092 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
a2d57ebe
KM
10093 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10094 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
ef248d9b 10095 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
bd401fd7 10096 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
a86e79e3 10097 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
abaa2274
AA
10098 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10099 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 10100 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 10101 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
b5acfe15 10102 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 10103 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10104 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10105 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10106 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10107 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10108 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10109 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10110 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
be561ffa 10111 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10112 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10113 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10114 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
10115 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10116 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10117 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10118 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10119 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10120 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10121 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
10122 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10123 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10124 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 10125 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10126 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10127 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10128 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10129 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10130 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10131 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
da209f7a 10132 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
c250ef89 10133 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 10134 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10135 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10136 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10137 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10138 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10139 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10140 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
627ce0d6 10141 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
90d74fdb 10142 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11bea269 10143 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0a6b36c5 10144 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10145 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10146 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10147 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10148 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10149 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
10150 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10151 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10152 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10153 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10154 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 10155 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9cb72750 10156 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
86222af0 10157 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0c20fce1 10158 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10159 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
edca7cc4 10160 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
10161 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10162 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10163 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10164 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 10165 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10166 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10167 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
10168 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10169 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
22065e42 10170 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 10171 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10172 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10173 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10174 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10175 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10176 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10177 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 10178 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 10179 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
10180 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10181 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10182 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10183 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10184 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 10185 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 10186 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 10187 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 10188 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 10189 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 10190 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 10191 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 10192 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 10193 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 10194 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 10195 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 10196 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 10197 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 10198 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 10199 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 10200 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
10201 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10202 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 10203 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 10204 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
10205 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10206 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10207 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 10208 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
10209 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10210 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10211 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 10212 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 10213 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 10214 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
10215 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10216 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
d93eeca6
KY
10217 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10218 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10219 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10220 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10221 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10222 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10223 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10224 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
3694cb29 10225 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 10226 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 10227 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 10228 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 10229 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 10230 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 10231 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 10232 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
10233 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10234 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 10235 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
fb3c007f 10236 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
3790a3d6 10237 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
85743a84 10238 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
2aac550d 10239 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
56ec3e75 10240 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
2aac550d 10241 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
3b79954f 10242 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8f4c9042 10243 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
2aac550d 10244 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b81e9e5c 10245 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
c07f2c7b 10246 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 10247 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
d3dca026 10248 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
2aac550d 10249 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
10250 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10251 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1e24881d 10252 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
70cfdd03 10253 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
b5cb53fd 10254 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
3babae91
SD
10255 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10256 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
f286620b 10257 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
634e5e1e 10258 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
3babae91
SD
10259 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10260 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10261 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10262 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
99af5b11
DC
10263 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10264 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10265 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10266 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
3babae91
SD
10267 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10268 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10269 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10270 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10271 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10272 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10273 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
56f27013 10274 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 10275 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 10276 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 10277 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 10278 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 10279 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 10280 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 10281 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 10282 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 10283 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 10284 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 10285 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 10286 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 10287 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 10288 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 10289 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
10290 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10291 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10292 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
264fb034 10293 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
cd5302c0 10294 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
10295 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10296 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 10297 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
52aad393 10298 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
174a7fb3 10299 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
79e28f2a 10300 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
0fbf21c3 10301 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
cbcdf8c4 10302 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
f1ec5be1
HC
10303 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10304 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10305 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 10306 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
10307 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10308 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
88d18b88 10309 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
619764cc 10310 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8b3b2392
WS
10311 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10312 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10313 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10314 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10315 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10316 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10317 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10318 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
fc19d559 10319 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 10320 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 10321 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9b043a8f 10322 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 10323 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
7c9caa29 10324 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
d1ee66c5 10325 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 10326 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 10327 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
ccbd88be 10328 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
309d7363 10329 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
8804fa04 10330 SND_PCI_QUIRK(0xf111, 0x0005, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
33038efb 10331 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
a4297b5d 10332
a7f3eedc 10333#if 0
a4297b5d
TI
10334 /* Below is a quirk table taken from the old code.
10335 * Basically the device should work as is without the fixup table.
10336 * If BIOS doesn't give a proper info, enable the corresponding
10337 * fixup entry.
7d7eb9ea 10338 */
a4297b5d
TI
10339 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10340 ALC269_FIXUP_AMIC),
10341 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
10342 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10343 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10344 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10345 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10346 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10347 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10348 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10349 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10350 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10351 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10352 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10353 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10354 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10355 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10356 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10357 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10358 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10359 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10360 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10361 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10362 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10363 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10364 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10365 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10366 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10367 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10368 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10369 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10370 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10371 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10372 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10373 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10374 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10375 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10376 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10377 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10378 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10379 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10380#endif
10381 {}
10382};
10383
214eef76
DH
10384static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10385 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10386 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10387 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10388 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 10389 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
10390 {}
10391};
10392
1727a771 10393static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
10394 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10395 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
10396 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10397 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10398 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 10399 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
10400 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10401 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 10402 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 10403 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 10404 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 10405 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
10406 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10407 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
10408 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10409 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 10410 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 10411 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 10412 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 10413 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 10414 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 10415 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 10416 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 10417 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 10418 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
10419 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10420 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10421 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10422 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10423 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10424 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10425 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10426 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10427 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10428 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10429 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10430 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10431 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10432 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10433 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10434 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10435 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10436 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10437 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10438 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10439 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10440 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10441 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10442 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10443 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10444 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10445 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10446 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10447 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10448 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10449 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10450 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10451 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10452 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10453 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10454 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10455 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10456 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10457 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10458 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 10459 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 10460 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 10461 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
10462 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10463 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10464 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10465 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10466 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10467 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10468 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10469 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10470 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10471 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10472 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10473 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10474 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10475 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
10476 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10477 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10478 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 10479 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 10480 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 10481 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
10482 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10483 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10484 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10485 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10486 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10487 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10488 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10489 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10490 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10491 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10492 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10493 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10494 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10495 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10496 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10497 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10498 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
10499 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10500 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 10501 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 10502 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 10503 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
a2d57ebe 10504 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
ef248d9b 10505 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
fc19d559 10506 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 10507 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 10508 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 10509 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 10510 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 10511 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9ebaef05 10512 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
3790a3d6 10513 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
29c8f40b 10514 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 10515 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
aa723946 10516 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 10517 {}
6dda9f4a 10518};
cfc5a845 10519#define ALC225_STANDARD_PINS \
cfc5a845 10520 {0x21, 0x04211020}
6dda9f4a 10521
e8191a8e
HW
10522#define ALC256_STANDARD_PINS \
10523 {0x12, 0x90a60140}, \
10524 {0x14, 0x90170110}, \
e8191a8e
HW
10525 {0x21, 0x02211020}
10526
fea185e2 10527#define ALC282_STANDARD_PINS \
11580297 10528 {0x14, 0x90170110}
e1e62b98 10529
fea185e2 10530#define ALC290_STANDARD_PINS \
11580297 10531 {0x12, 0x99a30130}
fea185e2
DH
10532
10533#define ALC292_STANDARD_PINS \
10534 {0x14, 0x90170110}, \
11580297 10535 {0x15, 0x0221401f}
977e6276 10536
3f640970
HW
10537#define ALC295_STANDARD_PINS \
10538 {0x12, 0xb7a60130}, \
10539 {0x14, 0x90170110}, \
3f640970
HW
10540 {0x21, 0x04211020}
10541
703867e2
WS
10542#define ALC298_STANDARD_PINS \
10543 {0x12, 0x90a60130}, \
10544 {0x21, 0x03211020}
10545
e1918938 10546static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
10547 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10548 {0x14, 0x01014020},
10549 {0x17, 0x90170110},
10550 {0x18, 0x02a11030},
10551 {0x19, 0x0181303F},
10552 {0x21, 0x0221102f}),
5824ce8d
CC
10553 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10554 {0x12, 0x90a601c0},
10555 {0x14, 0x90171120},
10556 {0x21, 0x02211030}),
615966ad
CC
10557 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10558 {0x14, 0x90170110},
10559 {0x1b, 0x90a70130},
10560 {0x21, 0x03211020}),
10561 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10562 {0x1a, 0x90a70130},
10563 {0x1b, 0x90170110},
10564 {0x21, 0x03211020}),
2ae95577 10565 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10566 ALC225_STANDARD_PINS,
8a132099 10567 {0x12, 0xb7a60130},
cfc5a845 10568 {0x14, 0x901701a0}),
2ae95577 10569 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10570 ALC225_STANDARD_PINS,
8a132099 10571 {0x12, 0xb7a60130},
cfc5a845 10572 {0x14, 0x901701b0}),
8a132099
HW
10573 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10574 ALC225_STANDARD_PINS,
10575 {0x12, 0xb7a60150},
10576 {0x14, 0x901701a0}),
10577 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10578 ALC225_STANDARD_PINS,
10579 {0x12, 0xb7a60150},
10580 {0x14, 0x901701b0}),
10581 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10582 ALC225_STANDARD_PINS,
10583 {0x12, 0xb7a60130},
10584 {0x1b, 0x90170110}),
0ce48e17
KHF
10585 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10586 {0x1b, 0x01111010},
10587 {0x1e, 0x01451130},
10588 {0x21, 0x02211020}),
986376b6
HW
10589 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10590 {0x12, 0x90a60140},
10591 {0x14, 0x90170110},
10592 {0x19, 0x02a11030},
10593 {0x21, 0x02211020}),
e41fc8c5
HW
10594 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10595 {0x14, 0x90170110},
10596 {0x19, 0x02a11030},
10597 {0x1a, 0x02a11040},
10598 {0x1b, 0x01014020},
10599 {0x21, 0x0221101f}),
d06fb562
HW
10600 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10601 {0x14, 0x90170110},
10602 {0x19, 0x02a11030},
10603 {0x1a, 0x02a11040},
10604 {0x1b, 0x01011020},
10605 {0x21, 0x0221101f}),
c6b17f10
HW
10606 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10607 {0x14, 0x90170110},
10608 {0x19, 0x02a11020},
10609 {0x1a, 0x02a11030},
10610 {0x21, 0x0221101f}),
92666d45
KY
10611 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10612 {0x21, 0x02211010}),
9e885770
KY
10613 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10614 {0x14, 0x90170110},
10615 {0x19, 0x02a11020},
10616 {0x21, 0x02211030}),
c77900e6 10617 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 10618 {0x14, 0x90170110},
c77900e6 10619 {0x21, 0x02211020}),
86c72d1c
HW
10620 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10621 {0x14, 0x90170130},
10622 {0x21, 0x02211040}),
76c2132e
DH
10623 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10624 {0x12, 0x90a60140},
10625 {0x14, 0x90170110},
76c2132e
DH
10626 {0x21, 0x02211020}),
10627 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10628 {0x12, 0x90a60160},
10629 {0x14, 0x90170120},
76c2132e 10630 {0x21, 0x02211030}),
392c9da2
HW
10631 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10632 {0x14, 0x90170110},
10633 {0x1b, 0x02011020},
10634 {0x21, 0x0221101f}),
6aecd871
HW
10635 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10636 {0x14, 0x90170110},
10637 {0x1b, 0x01011020},
10638 {0x21, 0x0221101f}),
cba59972 10639 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 10640 {0x14, 0x90170130},
cba59972 10641 {0x1b, 0x01014020},
cba59972 10642 {0x21, 0x0221103f}),
6aecd871
HW
10643 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10644 {0x14, 0x90170130},
10645 {0x1b, 0x01011020},
10646 {0x21, 0x0221103f}),
59ec4b57
HW
10647 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10648 {0x14, 0x90170130},
10649 {0x1b, 0x02011020},
10650 {0x21, 0x0221103f}),
e9c28e16 10651 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10652 {0x14, 0x90170150},
e9c28e16 10653 {0x1b, 0x02011020},
e9c28e16
WS
10654 {0x21, 0x0221105f}),
10655 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10656 {0x14, 0x90170110},
e9c28e16 10657 {0x1b, 0x01014020},
e9c28e16 10658 {0x21, 0x0221101f}),
76c2132e
DH
10659 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10660 {0x12, 0x90a60160},
10661 {0x14, 0x90170120},
10662 {0x17, 0x90170140},
76c2132e
DH
10663 {0x21, 0x0321102f}),
10664 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10665 {0x12, 0x90a60160},
10666 {0x14, 0x90170130},
76c2132e
DH
10667 {0x21, 0x02211040}),
10668 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10669 {0x12, 0x90a60160},
10670 {0x14, 0x90170140},
76c2132e
DH
10671 {0x21, 0x02211050}),
10672 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10673 {0x12, 0x90a60170},
10674 {0x14, 0x90170120},
76c2132e
DH
10675 {0x21, 0x02211030}),
10676 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10677 {0x12, 0x90a60170},
10678 {0x14, 0x90170130},
76c2132e 10679 {0x21, 0x02211040}),
0a1f90a9
HW
10680 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10681 {0x12, 0x90a60170},
10682 {0x14, 0x90171130},
10683 {0x21, 0x02211040}),
70658b99 10684 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
10685 {0x12, 0x90a60170},
10686 {0x14, 0x90170140},
70658b99 10687 {0x21, 0x02211050}),
9b5a4e39 10688 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
10689 {0x12, 0x90a60180},
10690 {0x14, 0x90170130},
9b5a4e39 10691 {0x21, 0x02211040}),
f90d83b3
AK
10692 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10693 {0x12, 0x90a60180},
10694 {0x14, 0x90170120},
10695 {0x21, 0x02211030}),
989dbe4a
HW
10696 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10697 {0x1b, 0x01011020},
10698 {0x21, 0x02211010}),
c1732ede
CC
10699 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10700 {0x14, 0x90170110},
10701 {0x1b, 0x90a70130},
10702 {0x21, 0x04211020}),
10703 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10704 {0x14, 0x90170110},
10705 {0x1b, 0x90a70130},
10706 {0x21, 0x03211020}),
a806ef1c
CC
10707 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10708 {0x12, 0x90a60130},
10709 {0x14, 0x90170110},
10710 {0x21, 0x03211020}),
6ac371aa
JHP
10711 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10712 {0x12, 0x90a60130},
10713 {0x14, 0x90170110},
10714 {0x21, 0x04211020}),
e1037354
JHP
10715 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10716 {0x1a, 0x90a70130},
10717 {0x1b, 0x90170110},
10718 {0x21, 0x03211020}),
9e885770
KY
10719 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10720 {0x14, 0x90170110},
10721 {0x19, 0x02a11020},
10722 {0x21, 0x0221101f}),
8a8de09c
KY
10723 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10724 {0x17, 0x90170110},
10725 {0x19, 0x03a11030},
10726 {0x21, 0x03211020}),
cf51eb9d
DH
10727 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10728 {0x12, 0x90a60130},
cf51eb9d
DH
10729 {0x14, 0x90170110},
10730 {0x15, 0x0421101f},
11580297 10731 {0x1a, 0x04a11020}),
0279661b
HW
10732 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10733 {0x12, 0x90a60140},
0279661b
HW
10734 {0x14, 0x90170110},
10735 {0x15, 0x0421101f},
0279661b 10736 {0x18, 0x02811030},
0279661b 10737 {0x1a, 0x04a1103f},
11580297 10738 {0x1b, 0x02011020}),
42304474 10739 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10740 ALC282_STANDARD_PINS,
42304474 10741 {0x12, 0x99a30130},
42304474 10742 {0x19, 0x03a11020},
42304474 10743 {0x21, 0x0321101f}),
2c609999 10744 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10745 ALC282_STANDARD_PINS,
2c609999 10746 {0x12, 0x99a30130},
2c609999 10747 {0x19, 0x03a11020},
2c609999
HW
10748 {0x21, 0x03211040}),
10749 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10750 ALC282_STANDARD_PINS,
2c609999 10751 {0x12, 0x99a30130},
2c609999 10752 {0x19, 0x03a11030},
2c609999
HW
10753 {0x21, 0x03211020}),
10754 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10755 ALC282_STANDARD_PINS,
2c609999 10756 {0x12, 0x99a30130},
2c609999 10757 {0x19, 0x04a11020},
2c609999 10758 {0x21, 0x0421101f}),
200afc09 10759 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 10760 ALC282_STANDARD_PINS,
200afc09 10761 {0x12, 0x90a60140},
200afc09 10762 {0x19, 0x04a11030},
200afc09 10763 {0x21, 0x04211020}),
34cdf405
CC
10764 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10765 ALC282_STANDARD_PINS,
10766 {0x12, 0x90a609c0},
10767 {0x18, 0x03a11830},
10768 {0x19, 0x04a19831},
10769 {0x1a, 0x0481303f},
10770 {0x1b, 0x04211020},
10771 {0x21, 0x0321101f}),
10772 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
10773 ALC282_STANDARD_PINS,
10774 {0x12, 0x90a60940},
10775 {0x18, 0x03a11830},
10776 {0x19, 0x04a19831},
10777 {0x1a, 0x0481303f},
10778 {0x1b, 0x04211020},
10779 {0x21, 0x0321101f}),
76c2132e 10780 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10781 ALC282_STANDARD_PINS,
76c2132e 10782 {0x12, 0x90a60130},
76c2132e
DH
10783 {0x21, 0x0321101f}),
10784 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10785 {0x12, 0x90a60160},
10786 {0x14, 0x90170120},
76c2132e 10787 {0x21, 0x02211030}),
bc262179 10788 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10789 ALC282_STANDARD_PINS,
bc262179 10790 {0x12, 0x90a60130},
bc262179 10791 {0x19, 0x03a11020},
bc262179 10792 {0x21, 0x0321101f}),
c8c6ee61 10793 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
10794 {0x12, 0x90a60130},
10795 {0x14, 0x90170110},
10796 {0x19, 0x04a11040},
10797 {0x21, 0x04211020}),
10798 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
10799 {0x14, 0x90170110},
10800 {0x19, 0x04a11040},
10801 {0x1d, 0x40600001},
10802 {0x21, 0x04211020}),
10803 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
10804 {0x14, 0x90170110},
10805 {0x19, 0x04a11040},
10806 {0x21, 0x04211020}),
c72b9bfe
HW
10807 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10808 {0x14, 0x90170110},
10809 {0x17, 0x90170111},
10810 {0x19, 0x03a11030},
10811 {0x21, 0x03211020}),
e43252db
KY
10812 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10813 {0x17, 0x90170110},
10814 {0x19, 0x03a11030},
10815 {0x21, 0x03211020}),
41b07476
KY
10816 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
10817 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
10818 {0x19, 0x04a11040},
10819 {0x21, 0x04211020}),
33aaebd4
CC
10820 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
10821 {0x12, 0x90a60130},
10822 {0x17, 0x90170110},
10823 {0x21, 0x02211020}),
d44a6864 10824 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 10825 {0x12, 0x90a60120},
e1e62b98 10826 {0x14, 0x90170110},
e1e62b98 10827 {0x21, 0x0321101f}),
e4442bcf 10828 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10829 ALC290_STANDARD_PINS,
e4442bcf 10830 {0x15, 0x04211040},
e4442bcf 10831 {0x18, 0x90170112},
11580297 10832 {0x1a, 0x04a11020}),
e4442bcf 10833 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10834 ALC290_STANDARD_PINS,
e4442bcf 10835 {0x15, 0x04211040},
e4442bcf 10836 {0x18, 0x90170110},
11580297 10837 {0x1a, 0x04a11020}),
e4442bcf 10838 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10839 ALC290_STANDARD_PINS,
e4442bcf 10840 {0x15, 0x0421101f},
11580297 10841 {0x1a, 0x04a11020}),
e4442bcf 10842 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10843 ALC290_STANDARD_PINS,
e4442bcf 10844 {0x15, 0x04211020},
11580297 10845 {0x1a, 0x04a11040}),
e4442bcf 10846 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10847 ALC290_STANDARD_PINS,
e4442bcf
HW
10848 {0x14, 0x90170110},
10849 {0x15, 0x04211020},
11580297 10850 {0x1a, 0x04a11040}),
e4442bcf 10851 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10852 ALC290_STANDARD_PINS,
e4442bcf
HW
10853 {0x14, 0x90170110},
10854 {0x15, 0x04211020},
11580297 10855 {0x1a, 0x04a11020}),
e4442bcf 10856 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10857 ALC290_STANDARD_PINS,
e4442bcf
HW
10858 {0x14, 0x90170110},
10859 {0x15, 0x0421101f},
11580297 10860 {0x1a, 0x04a11020}),
e8818fa8 10861 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10862 ALC292_STANDARD_PINS,
e8818fa8 10863 {0x12, 0x90a60140},
e8818fa8 10864 {0x16, 0x01014020},
11580297 10865 {0x19, 0x01a19030}),
e8818fa8 10866 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 10867 ALC292_STANDARD_PINS,
e8818fa8 10868 {0x12, 0x90a60140},
e8818fa8
HW
10869 {0x16, 0x01014020},
10870 {0x18, 0x02a19031},
11580297 10871 {0x19, 0x01a1903e}),
76c2132e 10872 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 10873 ALC292_STANDARD_PINS,
11580297 10874 {0x12, 0x90a60140}),
76c2132e 10875 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10876 ALC292_STANDARD_PINS,
76c2132e 10877 {0x13, 0x90a60140},
76c2132e 10878 {0x16, 0x21014020},
11580297 10879 {0x19, 0x21a19030}),
e03fdbde 10880 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 10881 ALC292_STANDARD_PINS,
11580297 10882 {0x13, 0x90a60140}),
eeacd80f
JHP
10883 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
10884 {0x17, 0x90170110},
10885 {0x21, 0x04211020}),
d8ae458e
CC
10886 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
10887 {0x14, 0x90170110},
10888 {0x1b, 0x90a70130},
10889 {0x21, 0x04211020}),
8bb37a2a
JHP
10890 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10891 {0x12, 0x90a60130},
10892 {0x17, 0x90170110},
10893 {0x21, 0x03211020}),
0bea4cc8
JHP
10894 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10895 {0x12, 0x90a60130},
10896 {0x17, 0x90170110},
10897 {0x21, 0x04211020}),
3887c26c
TI
10898 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
10899 {0x12, 0x90a60130},
10900 {0x17, 0x90170110},
10901 {0x21, 0x03211020}),
9e43342b 10902 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
10903 {0x12, 0x90a60120},
10904 {0x17, 0x90170110},
10905 {0x21, 0x04211030}),
10906 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
10907 {0x12, 0x90a60130},
10908 {0x17, 0x90170110},
10909 {0x21, 0x03211020}),
10910 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
10911 {0x12, 0x90a60130},
10912 {0x17, 0x90170110},
10913 {0x21, 0x03211020}),
9f502ff5
TI
10914 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10915 ALC298_STANDARD_PINS,
10916 {0x17, 0x90170110}),
977e6276 10917 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
10918 ALC298_STANDARD_PINS,
10919 {0x17, 0x90170140}),
10920 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
10921 ALC298_STANDARD_PINS,
9f502ff5 10922 {0x17, 0x90170150}),
9f1bc2c4
KHF
10923 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
10924 {0x12, 0xb7a60140},
10925 {0x13, 0xb7a60150},
10926 {0x17, 0x90170110},
10927 {0x1a, 0x03011020},
10928 {0x21, 0x03211030}),
54324221
JM
10929 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10930 {0x12, 0xb7a60140},
10931 {0x17, 0x90170110},
10932 {0x1a, 0x03a11030},
10933 {0x21, 0x03211020}),
fcc6c877
KY
10934 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10935 ALC225_STANDARD_PINS,
10936 {0x12, 0xb7a60130},
fcc6c877 10937 {0x17, 0x90170110}),
573fcbfd
HW
10938 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10939 {0x14, 0x01014010},
10940 {0x17, 0x90170120},
10941 {0x18, 0x02a11030},
10942 {0x19, 0x02a1103f},
10943 {0x21, 0x0221101f}),
e1918938
HW
10944 {}
10945};
6dda9f4a 10946
7c0a6939
HW
10947/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10948 * more machines, don't need to match all valid pins, just need to match
10949 * all the pins defined in the tbl. Just because of this reason, it is possible
10950 * that a single machine matches multiple tbls, so there is one limitation:
10951 * at most one tbl is allowed to define for the same vendor and same codec
10952 */
10953static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10954 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10955 {0x19, 0x40000000},
10956 {0x1b, 0x40000000}),
4b21a669
KY
10957 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10958 {0x19, 0x40000000},
10959 {0x1b, 0x40000000}),
aed8c7f4
HW
10960 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10961 {0x19, 0x40000000},
10962 {0x1a, 0x40000000}),
d64ebdbf
HW
10963 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10964 {0x19, 0x40000000},
10965 {0x1a, 0x40000000}),
5815bdfd
HW
10966 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
10967 {0x19, 0x40000000},
10968 {0x1a, 0x40000000}),
c8c0a03e
KY
10969 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
10970 {0x19, 0x40000000}),
7c0a6939
HW
10971 {}
10972};
10973
546bb678 10974static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 10975{
526af6eb 10976 struct alc_spec *spec = codec->spec;
1d045db9 10977 int val;
ebb83eeb 10978
526af6eb 10979 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 10980 return;
526af6eb 10981
1bb7e43e 10982 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
10983 alc_write_coef_idx(codec, 0xf, 0x960b);
10984 alc_write_coef_idx(codec, 0xe, 0x8817);
10985 }
ebb83eeb 10986
1bb7e43e 10987 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
10988 alc_write_coef_idx(codec, 0xf, 0x960b);
10989 alc_write_coef_idx(codec, 0xe, 0x8814);
10990 }
ebb83eeb 10991
1bb7e43e 10992 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 10993 /* Power up output pin */
98b24883 10994 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 10995 }
ebb83eeb 10996
1bb7e43e 10997 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 10998 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 10999 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
11000 /* Capless ramp up clock control */
11001 alc_write_coef_idx(codec, 0xd, val | (1<<10));
11002 }
11003 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 11004 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
11005 /* Class D power on reset */
11006 alc_write_coef_idx(codec, 0x17, val | (1<<7));
11007 }
11008 }
ebb83eeb 11009
98b24883
TI
11010 /* HP */
11011 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 11012}
a7f2371f 11013
1d045db9
TI
11014/*
11015 */
1d045db9
TI
11016static int patch_alc269(struct hda_codec *codec)
11017{
11018 struct alc_spec *spec;
3de95173 11019 int err;
f1d4e28b 11020
3de95173 11021 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 11022 if (err < 0)
3de95173
TI
11023 return err;
11024
11025 spec = codec->spec;
08c189f2 11026 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 11027 codec->power_save_node = 0;
46cdff23 11028 spec->en_3kpull_low = true;
e16fb6d1 11029
225068ab
TI
11030#ifdef CONFIG_PM
11031 codec->patch_ops.suspend = alc269_suspend;
11032 codec->patch_ops.resume = alc269_resume;
11033#endif
c2d6af53
KY
11034 spec->shutup = alc_default_shutup;
11035 spec->init_hook = alc_default_init;
225068ab 11036
7639a06c 11037 switch (codec->core.vendor_id) {
065380f0 11038 case 0x10ec0269:
1d045db9 11039 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
11040 switch (alc_get_coef0(codec) & 0x00f0) {
11041 case 0x0010:
5100cd07
TI
11042 if (codec->bus->pci &&
11043 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11044 spec->cdefine.platform_type == 1)
20ca0c35 11045 err = alc_codec_rename(codec, "ALC271X");
1d045db9 11046 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
11047 break;
11048 case 0x0020:
5100cd07
TI
11049 if (codec->bus->pci &&
11050 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 11051 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 11052 err = alc_codec_rename(codec, "ALC3202");
1d045db9 11053 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 11054 break;
adcc70b2
KY
11055 case 0x0030:
11056 spec->codec_variant = ALC269_TYPE_ALC269VD;
11057 break;
1bb7e43e 11058 default:
1d045db9 11059 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 11060 }
e16fb6d1
TI
11061 if (err < 0)
11062 goto error;
c2d6af53 11063 spec->shutup = alc269_shutup;
546bb678 11064 spec->init_hook = alc269_fill_coef;
1d045db9 11065 alc269_fill_coef(codec);
065380f0
KY
11066 break;
11067
11068 case 0x10ec0280:
11069 case 0x10ec0290:
11070 spec->codec_variant = ALC269_TYPE_ALC280;
11071 break;
11072 case 0x10ec0282:
065380f0 11073 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
11074 spec->shutup = alc282_shutup;
11075 spec->init_hook = alc282_init;
065380f0 11076 break;
2af02be7
KY
11077 case 0x10ec0233:
11078 case 0x10ec0283:
11079 spec->codec_variant = ALC269_TYPE_ALC283;
11080 spec->shutup = alc283_shutup;
11081 spec->init_hook = alc283_init;
11082 break;
065380f0
KY
11083 case 0x10ec0284:
11084 case 0x10ec0292:
11085 spec->codec_variant = ALC269_TYPE_ALC284;
11086 break;
161ebf29 11087 case 0x10ec0293:
4731d5de 11088 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 11089 break;
7fc7d047 11090 case 0x10ec0286:
7c665932 11091 case 0x10ec0288:
7fc7d047
KY
11092 spec->codec_variant = ALC269_TYPE_ALC286;
11093 break;
506b62c3
KY
11094 case 0x10ec0298:
11095 spec->codec_variant = ALC269_TYPE_ALC298;
11096 break;
ea04a1db 11097 case 0x10ec0235:
1d04c9de
KY
11098 case 0x10ec0255:
11099 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
11100 spec->shutup = alc256_shutup;
11101 spec->init_hook = alc256_init;
1d04c9de 11102 break;
1948fc06 11103 case 0x10ec0230:
736f20a7 11104 case 0x10ec0236:
4344aec8 11105 case 0x10ec0256:
527f4643 11106 case 0x19e58326:
4344aec8 11107 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
11108 spec->shutup = alc256_shutup;
11109 spec->init_hook = alc256_init;
7d1b6e29 11110 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
46cdff23
KY
11111 if (codec->core.vendor_id == 0x10ec0236 &&
11112 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11113 spec->en_3kpull_low = false;
4344aec8 11114 break;
f429e7e4
KY
11115 case 0x10ec0257:
11116 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
11117 spec->shutup = alc256_shutup;
11118 spec->init_hook = alc256_init;
f429e7e4 11119 spec->gen.mixer_nid = 0;
46cdff23 11120 spec->en_3kpull_low = false;
f429e7e4 11121 break;
0a6f0600 11122 case 0x10ec0215:
7fbdcd83 11123 case 0x10ec0245:
0a6f0600
KY
11124 case 0x10ec0285:
11125 case 0x10ec0289:
60571929
KY
11126 if (alc_get_coef0(codec) & 0x0010)
11127 spec->codec_variant = ALC269_TYPE_ALC245;
11128 else
11129 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
11130 spec->shutup = alc225_shutup;
11131 spec->init_hook = alc225_init;
0a6f0600
KY
11132 spec->gen.mixer_nid = 0;
11133 break;
4231430d 11134 case 0x10ec0225:
7d727869 11135 case 0x10ec0295:
28f1f9b2 11136 case 0x10ec0299:
4231430d 11137 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
11138 spec->shutup = alc225_shutup;
11139 spec->init_hook = alc225_init;
c1350bff 11140 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 11141 break;
99cee034
KY
11142 case 0x10ec0287:
11143 spec->codec_variant = ALC269_TYPE_ALC287;
11144 spec->shutup = alc225_shutup;
11145 spec->init_hook = alc225_init;
11146 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11147 break;
dcd4f0db
KY
11148 case 0x10ec0234:
11149 case 0x10ec0274:
11150 case 0x10ec0294:
11151 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 11152 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 11153 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 11154 spec->init_hook = alc294_init;
dcd4f0db 11155 break;
1078bef0
KY
11156 case 0x10ec0300:
11157 spec->codec_variant = ALC269_TYPE_ALC300;
11158 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 11159 break;
f0778871
KY
11160 case 0x10ec0623:
11161 spec->codec_variant = ALC269_TYPE_ALC623;
11162 break;
6fbae35a
KY
11163 case 0x10ec0700:
11164 case 0x10ec0701:
11165 case 0x10ec0703:
83629532 11166 case 0x10ec0711:
6fbae35a
KY
11167 spec->codec_variant = ALC269_TYPE_ALC700;
11168 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 11169 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 11170 spec->init_hook = alc294_init;
6fbae35a
KY
11171 break;
11172
1d045db9 11173 }
6dda9f4a 11174
ad60d502 11175 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 11176 spec->has_alc5505_dsp = 1;
ad60d502
KY
11177 spec->init_hook = alc5505_dsp_init;
11178 }
11179
c9af753f
TI
11180 alc_pre_init(codec);
11181
efe55732
TI
11182 snd_hda_pick_fixup(codec, alc269_fixup_models,
11183 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
11184 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11185 * the quirk breaks the latter (bko#214101).
11186 * Clear the wrong entry.
11187 */
11188 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11189 codec->core.vendor_id == 0x10ec0294) {
11190 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11191 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11192 }
11193
0fc1e447 11194 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 11195 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
11196 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
11197 alc269_fixups);
11198 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11199
11200 alc_auto_parse_customize_define(codec);
11201
11202 if (has_cdefine_beep(codec))
11203 spec->gen.beep_nid = 0x01;
11204
a4297b5d
TI
11205 /* automatic parse from the BIOS config */
11206 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
11207 if (err < 0)
11208 goto error;
6dda9f4a 11209
fea80fae
TI
11210 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11211 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11212 if (err < 0)
11213 goto error;
11214 }
f1d4e28b 11215
1727a771 11216 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11217
1d045db9 11218 return 0;
e16fb6d1
TI
11219
11220 error:
11221 alc_free(codec);
11222 return err;
1d045db9 11223}
f1d4e28b 11224
1d045db9
TI
11225/*
11226 * ALC861
11227 */
622e84cd 11228
1d045db9 11229static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 11230{
1d045db9 11231 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11232 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11233 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
11234}
11235
1d045db9
TI
11236/* Pin config fixes */
11237enum {
e652f4c8
TI
11238 ALC861_FIXUP_FSC_AMILO_PI1505,
11239 ALC861_FIXUP_AMP_VREF_0F,
11240 ALC861_FIXUP_NO_JACK_DETECT,
11241 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 11242 ALC660_FIXUP_ASUS_W7J,
1d045db9 11243};
7085ec12 11244
31150f23
TI
11245/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11246static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 11247 const struct hda_fixup *fix, int action)
31150f23
TI
11248{
11249 struct alc_spec *spec = codec->spec;
11250 unsigned int val;
11251
1727a771 11252 if (action != HDA_FIXUP_ACT_INIT)
31150f23 11253 return;
d3f02d60 11254 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
11255 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11256 val |= AC_PINCTL_IN_EN;
11257 val |= AC_PINCTL_VREF_50;
cdd03ced 11258 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 11259 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
11260}
11261
e652f4c8
TI
11262/* suppress the jack-detection */
11263static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 11264 const struct hda_fixup *fix, int action)
e652f4c8 11265{
1727a771 11266 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 11267 codec->no_jack_detect = 1;
7d7eb9ea 11268}
e652f4c8 11269
1727a771 11270static const struct hda_fixup alc861_fixups[] = {
e652f4c8 11271 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
11272 .type = HDA_FIXUP_PINS,
11273 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
11274 { 0x0b, 0x0221101f }, /* HP */
11275 { 0x0f, 0x90170310 }, /* speaker */
11276 { }
11277 }
11278 },
e652f4c8 11279 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 11280 .type = HDA_FIXUP_FUNC,
31150f23 11281 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 11282 },
e652f4c8 11283 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 11284 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
11285 .v.func = alc_fixup_no_jack_detect,
11286 },
11287 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 11288 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
11289 .v.func = alc861_fixup_asus_amp_vref_0f,
11290 .chained = true,
11291 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
11292 },
11293 [ALC660_FIXUP_ASUS_W7J] = {
11294 .type = HDA_FIXUP_VERBS,
11295 .v.verbs = (const struct hda_verb[]) {
11296 /* ASUS W7J needs a magic pin setup on unused NID 0x10
11297 * for enabling outputs
11298 */
11299 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11300 { }
11301 },
e652f4c8 11302 }
1d045db9 11303};
7085ec12 11304
1d045db9 11305static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 11306 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 11307 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
11308 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11309 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11310 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 11311 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 11312 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
11313 {}
11314};
3af9ee6b 11315
1d045db9
TI
11316/*
11317 */
1d045db9 11318static int patch_alc861(struct hda_codec *codec)
7085ec12 11319{
1d045db9 11320 struct alc_spec *spec;
1d045db9 11321 int err;
7085ec12 11322
3de95173
TI
11323 err = alc_alloc_spec(codec, 0x15);
11324 if (err < 0)
11325 return err;
1d045db9 11326
3de95173 11327 spec = codec->spec;
2722b535
TI
11328 if (has_cdefine_beep(codec))
11329 spec->gen.beep_nid = 0x23;
1d045db9 11330
225068ab
TI
11331#ifdef CONFIG_PM
11332 spec->power_hook = alc_power_eapd;
11333#endif
11334
c9af753f
TI
11335 alc_pre_init(codec);
11336
1727a771
TI
11337 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11338 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 11339
cb4e4824
TI
11340 /* automatic parse from the BIOS config */
11341 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
11342 if (err < 0)
11343 goto error;
3af9ee6b 11344
fea80fae
TI
11345 if (!spec->gen.no_analog) {
11346 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11347 if (err < 0)
11348 goto error;
11349 }
7085ec12 11350
1727a771 11351 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11352
1d045db9 11353 return 0;
e16fb6d1
TI
11354
11355 error:
11356 alc_free(codec);
11357 return err;
7085ec12
TI
11358}
11359
1d045db9
TI
11360/*
11361 * ALC861-VD support
11362 *
11363 * Based on ALC882
11364 *
11365 * In addition, an independent DAC
11366 */
1d045db9 11367static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 11368{
1d045db9 11369 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11370 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11371 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
11372}
11373
1d045db9 11374enum {
8fdcb6fe
TI
11375 ALC660VD_FIX_ASUS_GPIO1,
11376 ALC861VD_FIX_DALLAS,
1d045db9 11377};
ce764ab2 11378
8fdcb6fe
TI
11379/* exclude VREF80 */
11380static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 11381 const struct hda_fixup *fix, int action)
8fdcb6fe 11382{
1727a771 11383 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
11384 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11385 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
11386 }
11387}
11388
df73d83f
TI
11389/* reset GPIO1 */
11390static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11391 const struct hda_fixup *fix, int action)
11392{
11393 struct alc_spec *spec = codec->spec;
11394
11395 if (action == HDA_FIXUP_ACT_PRE_PROBE)
11396 spec->gpio_mask |= 0x02;
11397 alc_fixup_gpio(codec, action, 0x01);
11398}
11399
1727a771 11400static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 11401 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
11402 .type = HDA_FIXUP_FUNC,
11403 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 11404 },
8fdcb6fe 11405 [ALC861VD_FIX_DALLAS] = {
1727a771 11406 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
11407 .v.func = alc861vd_fixup_dallas,
11408 },
1d045db9 11409};
ce764ab2 11410
1d045db9 11411static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 11412 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 11413 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 11414 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
11415 {}
11416};
ce764ab2 11417
1d045db9
TI
11418/*
11419 */
1d045db9 11420static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 11421{
1d045db9 11422 struct alc_spec *spec;
cb4e4824 11423 int err;
ce764ab2 11424
3de95173
TI
11425 err = alc_alloc_spec(codec, 0x0b);
11426 if (err < 0)
11427 return err;
1d045db9 11428
3de95173 11429 spec = codec->spec;
2722b535
TI
11430 if (has_cdefine_beep(codec))
11431 spec->gen.beep_nid = 0x23;
1d045db9 11432
225068ab
TI
11433 spec->shutup = alc_eapd_shutup;
11434
c9af753f
TI
11435 alc_pre_init(codec);
11436
1727a771
TI
11437 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11438 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 11439
cb4e4824
TI
11440 /* automatic parse from the BIOS config */
11441 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
11442 if (err < 0)
11443 goto error;
ce764ab2 11444
fea80fae
TI
11445 if (!spec->gen.no_analog) {
11446 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11447 if (err < 0)
11448 goto error;
11449 }
1d045db9 11450
1727a771 11451 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11452
ce764ab2 11453 return 0;
e16fb6d1
TI
11454
11455 error:
11456 alc_free(codec);
11457 return err;
ce764ab2
TI
11458}
11459
1d045db9
TI
11460/*
11461 * ALC662 support
11462 *
11463 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11464 * configuration. Each pin widget can choose any input DACs and a mixer.
11465 * Each ADC is connected from a mixer of all inputs. This makes possible
11466 * 6-channel independent captures.
11467 *
11468 * In addition, an independent DAC for the multi-playback (not used in this
11469 * driver yet).
11470 */
1d045db9
TI
11471
11472/*
11473 * BIOS auto configuration
11474 */
11475
bc9f98a9
KY
11476static int alc662_parse_auto_config(struct hda_codec *codec)
11477{
4c6d72d1 11478 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11479 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11480 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11481 const hda_nid_t *ssids;
ee979a14 11482
7639a06c
TI
11483 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11484 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11485 codec->core.vendor_id == 0x10ec0671)
3e6179b8 11486 ssids = alc663_ssids;
6227cdce 11487 else
3e6179b8
TI
11488 ssids = alc662_ssids;
11489 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
11490}
11491
6be7948f 11492static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 11493 const struct hda_fixup *fix, int action)
6fc398cb 11494{
9bb1f06f 11495 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 11496 return;
6be7948f
TB
11497 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11498 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11499 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11500 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11501 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 11502 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
11503}
11504
8e383953
TI
11505static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11506 { .channels = 2,
11507 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11508 { .channels = 4,
11509 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11510 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11511 { }
11512};
11513
11514/* override the 2.1 chmap */
eb9ca3ab 11515static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
11516 const struct hda_fixup *fix, int action)
11517{
11518 if (action == HDA_FIXUP_ACT_BUILD) {
11519 struct alc_spec *spec = codec->spec;
bbbc7e85 11520 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
11521 }
11522}
11523
bf68665d
TI
11524/* avoid D3 for keeping GPIO up */
11525static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11526 hda_nid_t nid,
11527 unsigned int power_state)
11528{
11529 struct alc_spec *spec = codec->spec;
d261eec8 11530 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
11531 return AC_PWRST_D0;
11532 return power_state;
11533}
11534
3e887f37
TI
11535static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11536 const struct hda_fixup *fix, int action)
11537{
11538 struct alc_spec *spec = codec->spec;
3e887f37 11539
01e4a275 11540 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 11541 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 11542 spec->mute_led_polarity = 1;
bf68665d 11543 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
11544 }
11545}
11546
c6790c8e
KY
11547static void alc662_usi_automute_hook(struct hda_codec *codec,
11548 struct hda_jack_callback *jack)
11549{
11550 struct alc_spec *spec = codec->spec;
11551 int vref;
11552 msleep(200);
11553 snd_hda_gen_hp_automute(codec, jack);
11554
11555 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11556 msleep(100);
11557 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11558 vref);
11559}
11560
11561static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11562 const struct hda_fixup *fix, int action)
11563{
11564 struct alc_spec *spec = codec->spec;
11565 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11566 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11567 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11568 }
11569}
11570
00066e97
SB
11571static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11572 struct hda_jack_callback *cb)
11573{
11574 /* surround speakers at 0x1b already get muted automatically when
11575 * headphones are plugged in, but we have to mute/unmute the remaining
11576 * channels manually:
11577 * 0x15 - front left/front right
11578 * 0x18 - front center/ LFE
11579 */
11580 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11581 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11582 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11583 } else {
11584 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11585 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11586 }
11587}
11588
11589static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11590 const struct hda_fixup *fix, int action)
11591{
11592 /* Pin 0x1b: shared headphones jack and surround speakers */
11593 if (!is_jack_detectable(codec, 0x1b))
11594 return;
11595
11596 switch (action) {
11597 case HDA_FIXUP_ACT_PRE_PROBE:
11598 snd_hda_jack_detect_enable_callback(codec, 0x1b,
11599 alc662_aspire_ethos_mute_speakers);
336820c4
TI
11600 /* subwoofer needs an extra GPIO setting to become audible */
11601 alc_setup_gpio(codec, 0x02);
00066e97
SB
11602 break;
11603 case HDA_FIXUP_ACT_INIT:
11604 /* Make sure to start in a correct state, i.e. if
11605 * headphones have been plugged in before powering up the system
11606 */
11607 alc662_aspire_ethos_mute_speakers(codec, NULL);
11608 break;
11609 }
11610}
11611
5af29028
KY
11612static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11613 const struct hda_fixup *fix, int action)
11614{
11615 struct alc_spec *spec = codec->spec;
11616
11617 static const struct hda_pintbl pincfgs[] = {
11618 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11619 { 0x1b, 0x0181304f },
11620 { }
11621 };
11622
11623 switch (action) {
11624 case HDA_FIXUP_ACT_PRE_PROBE:
11625 spec->gen.mixer_nid = 0;
11626 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11627 snd_hda_apply_pincfgs(codec, pincfgs);
11628 break;
11629 case HDA_FIXUP_ACT_INIT:
11630 alc_write_coef_idx(codec, 0x19, 0xa054);
11631 break;
11632 }
11633}
11634
d7f32791
KY
11635static void alc897_hp_automute_hook(struct hda_codec *codec,
11636 struct hda_jack_callback *jack)
11637{
11638 struct alc_spec *spec = codec->spec;
11639 int vref;
11640
11641 snd_hda_gen_hp_automute(codec, jack);
11642 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
11643 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11644 vref);
11645}
11646
11647static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11648 const struct hda_fixup *fix, int action)
11649{
11650 struct alc_spec *spec = codec->spec;
11651 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11652 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11653 }
11654}
11655
4bf5bf54
EP
11656static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11657 const struct hda_fixup *fix, int action)
11658{
11659 struct alc_spec *spec = codec->spec;
11660
11661 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11662 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11663 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11664 }
11665}
11666
6b0f95c4 11667static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
11668 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
11669 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
11670 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
11671 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11672 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11673 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11674 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
11675 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
11676 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11677 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11678 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11679 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11680 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
11681 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11682 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
11683 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
11684 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11685 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11686 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11687 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11688 {}
11689};
11690
11691static void alc668_restore_default_value(struct hda_codec *codec)
11692{
11693 alc_process_coef_fw(codec, alc668_coefs);
11694}
11695
6cb3b707 11696enum {
2df03514 11697 ALC662_FIXUP_ASPIRE,
3e887f37 11698 ALC662_FIXUP_LED_GPIO1,
6cb3b707 11699 ALC662_FIXUP_IDEAPAD,
6be7948f 11700 ALC272_FIXUP_MARIO,
f1ec5be1 11701 ALC662_FIXUP_CZC_ET26,
d2ebd479 11702 ALC662_FIXUP_CZC_P10T,
94024cd1 11703 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 11704 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
11705 ALC662_FIXUP_ASUS_MODE1,
11706 ALC662_FIXUP_ASUS_MODE2,
11707 ALC662_FIXUP_ASUS_MODE3,
11708 ALC662_FIXUP_ASUS_MODE4,
11709 ALC662_FIXUP_ASUS_MODE5,
11710 ALC662_FIXUP_ASUS_MODE6,
11711 ALC662_FIXUP_ASUS_MODE7,
11712 ALC662_FIXUP_ASUS_MODE8,
1565cc35 11713 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 11714 ALC662_FIXUP_ZOTAC_Z68,
125821ae 11715 ALC662_FIXUP_INV_DMIC,
1f8b46cd 11716 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 11717 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11718 ALC662_FIXUP_HEADSET_MODE,
73bdd597 11719 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 11720 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 11721 ALC662_FIXUP_BASS_16,
a30c9aaa 11722 ALC662_FIXUP_BASS_1A,
8e54b4ac 11723 ALC662_FIXUP_BASS_CHMAP,
493a52a9 11724 ALC668_FIXUP_AUTO_MUTE,
5e6db669 11725 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 11726 ALC668_FIXUP_DELL_XPS13,
9d4dc584 11727 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 11728 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11729 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 11730 ALC668_FIXUP_MIC_COEF,
11ba6111 11731 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
11732 ALC891_FIXUP_HEADSET_MODE,
11733 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 11734 ALC662_FIXUP_ACER_VERITON,
1a3f0991 11735 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
11736 ALC662_FIXUP_USI_FUNC,
11737 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 11738 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 11739 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 11740 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 11741 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 11742 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 11743 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
11744 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
11745 ALC668_FIXUP_HEADSET_MIC,
11746 ALC668_FIXUP_MIC_DET_COEF,
d7f32791
KY
11747 ALC897_FIXUP_LENOVO_HEADSET_MIC,
11748 ALC897_FIXUP_HEADSET_MIC_PIN,
fe6900bd 11749 ALC897_FIXUP_HP_HSMIC_VERB,
4bf5bf54
EP
11750 ALC897_FIXUP_LENOVO_HEADSET_MODE,
11751 ALC897_FIXUP_HEADSET_MIC_PIN2,
73f1c75d 11752 ALC897_FIXUP_UNIS_H3C_X500S,
6cb3b707
DH
11753};
11754
1727a771 11755static const struct hda_fixup alc662_fixups[] = {
2df03514 11756 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
11757 .type = HDA_FIXUP_PINS,
11758 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
11759 { 0x15, 0x99130112 }, /* subwoofer */
11760 { }
11761 }
11762 },
3e887f37
TI
11763 [ALC662_FIXUP_LED_GPIO1] = {
11764 .type = HDA_FIXUP_FUNC,
11765 .v.func = alc662_fixup_led_gpio1,
11766 },
6cb3b707 11767 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
11768 .type = HDA_FIXUP_PINS,
11769 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
11770 { 0x17, 0x99130112 }, /* subwoofer */
11771 { }
3e887f37
TI
11772 },
11773 .chained = true,
11774 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 11775 },
6be7948f 11776 [ALC272_FIXUP_MARIO] = {
1727a771 11777 .type = HDA_FIXUP_FUNC,
b5bfbc67 11778 .v.func = alc272_fixup_mario,
d2ebd479 11779 },
f1ec5be1
HC
11780 [ALC662_FIXUP_CZC_ET26] = {
11781 .type = HDA_FIXUP_PINS,
11782 .v.pins = (const struct hda_pintbl[]) {
11783 {0x12, 0x403cc000},
11784 {0x14, 0x90170110}, /* speaker */
11785 {0x15, 0x411111f0},
11786 {0x16, 0x411111f0},
11787 {0x18, 0x01a19030}, /* mic */
11788 {0x19, 0x90a7013f}, /* int-mic */
11789 {0x1a, 0x01014020},
11790 {0x1b, 0x0121401f},
11791 {0x1c, 0x411111f0},
11792 {0x1d, 0x411111f0},
11793 {0x1e, 0x40478e35},
11794 {}
11795 },
11796 .chained = true,
11797 .chain_id = ALC662_FIXUP_SKU_IGNORE
11798 },
d2ebd479 11799 [ALC662_FIXUP_CZC_P10T] = {
1727a771 11800 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
11801 .v.verbs = (const struct hda_verb[]) {
11802 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
11803 {}
11804 }
11805 },
94024cd1 11806 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 11807 .type = HDA_FIXUP_FUNC,
23d30f28 11808 .v.func = alc_fixup_sku_ignore,
c6b35874 11809 },
e59ea3ed 11810 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
11811 .type = HDA_FIXUP_PINS,
11812 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
11813 { 0x14, 0x0221201f }, /* HP out */
11814 { }
11815 },
11816 .chained = true,
11817 .chain_id = ALC662_FIXUP_SKU_IGNORE
11818 },
53c334ad 11819 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
11820 .type = HDA_FIXUP_PINS,
11821 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11822 { 0x14, 0x99130110 }, /* speaker */
11823 { 0x18, 0x01a19c20 }, /* mic */
11824 { 0x19, 0x99a3092f }, /* int-mic */
11825 { 0x21, 0x0121401f }, /* HP out */
11826 { }
11827 },
11828 .chained = true,
11829 .chain_id = ALC662_FIXUP_SKU_IGNORE
11830 },
11831 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
11832 .type = HDA_FIXUP_PINS,
11833 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
11834 { 0x14, 0x99130110 }, /* speaker */
11835 { 0x18, 0x01a19820 }, /* mic */
11836 { 0x19, 0x99a3092f }, /* int-mic */
11837 { 0x1b, 0x0121401f }, /* HP out */
11838 { }
11839 },
53c334ad
TI
11840 .chained = true,
11841 .chain_id = ALC662_FIXUP_SKU_IGNORE
11842 },
11843 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
11844 .type = HDA_FIXUP_PINS,
11845 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11846 { 0x14, 0x99130110 }, /* speaker */
11847 { 0x15, 0x0121441f }, /* HP */
11848 { 0x18, 0x01a19840 }, /* mic */
11849 { 0x19, 0x99a3094f }, /* int-mic */
11850 { 0x21, 0x01211420 }, /* HP2 */
11851 { }
11852 },
11853 .chained = true,
11854 .chain_id = ALC662_FIXUP_SKU_IGNORE
11855 },
11856 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
11857 .type = HDA_FIXUP_PINS,
11858 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11859 { 0x14, 0x99130110 }, /* speaker */
11860 { 0x16, 0x99130111 }, /* speaker */
11861 { 0x18, 0x01a19840 }, /* mic */
11862 { 0x19, 0x99a3094f }, /* int-mic */
11863 { 0x21, 0x0121441f }, /* HP */
11864 { }
11865 },
11866 .chained = true,
11867 .chain_id = ALC662_FIXUP_SKU_IGNORE
11868 },
11869 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
11870 .type = HDA_FIXUP_PINS,
11871 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11872 { 0x14, 0x99130110 }, /* speaker */
11873 { 0x15, 0x0121441f }, /* HP */
11874 { 0x16, 0x99130111 }, /* speaker */
11875 { 0x18, 0x01a19840 }, /* mic */
11876 { 0x19, 0x99a3094f }, /* int-mic */
11877 { }
11878 },
11879 .chained = true,
11880 .chain_id = ALC662_FIXUP_SKU_IGNORE
11881 },
11882 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
11883 .type = HDA_FIXUP_PINS,
11884 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11885 { 0x14, 0x99130110 }, /* speaker */
11886 { 0x15, 0x01211420 }, /* HP2 */
11887 { 0x18, 0x01a19840 }, /* mic */
11888 { 0x19, 0x99a3094f }, /* int-mic */
11889 { 0x1b, 0x0121441f }, /* HP */
11890 { }
11891 },
11892 .chained = true,
11893 .chain_id = ALC662_FIXUP_SKU_IGNORE
11894 },
11895 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
11896 .type = HDA_FIXUP_PINS,
11897 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11898 { 0x14, 0x99130110 }, /* speaker */
11899 { 0x17, 0x99130111 }, /* speaker */
11900 { 0x18, 0x01a19840 }, /* mic */
11901 { 0x19, 0x99a3094f }, /* int-mic */
11902 { 0x1b, 0x01214020 }, /* HP */
11903 { 0x21, 0x0121401f }, /* HP */
11904 { }
11905 },
11906 .chained = true,
11907 .chain_id = ALC662_FIXUP_SKU_IGNORE
11908 },
11909 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
11910 .type = HDA_FIXUP_PINS,
11911 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
11912 { 0x14, 0x99130110 }, /* speaker */
11913 { 0x12, 0x99a30970 }, /* int-mic */
11914 { 0x15, 0x01214020 }, /* HP */
11915 { 0x17, 0x99130111 }, /* speaker */
11916 { 0x18, 0x01a19840 }, /* mic */
11917 { 0x21, 0x0121401f }, /* HP */
11918 { }
11919 },
11920 .chained = true,
11921 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 11922 },
1565cc35 11923 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 11924 .type = HDA_FIXUP_FUNC,
1565cc35
TI
11925 .v.func = alc_fixup_no_jack_detect,
11926 },
edfe3bfc 11927 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
11928 .type = HDA_FIXUP_PINS,
11929 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
11930 { 0x1b, 0x02214020 }, /* Front HP */
11931 { }
11932 }
11933 },
125821ae 11934 [ALC662_FIXUP_INV_DMIC] = {
1727a771 11935 .type = HDA_FIXUP_FUNC,
9d36a7dc 11936 .v.func = alc_fixup_inv_dmic,
125821ae 11937 },
033b0a7c
GM
11938 [ALC668_FIXUP_DELL_XPS13] = {
11939 .type = HDA_FIXUP_FUNC,
11940 .v.func = alc_fixup_dell_xps13,
11941 .chained = true,
11942 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11943 },
5e6db669
GM
11944 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11945 .type = HDA_FIXUP_FUNC,
11946 .v.func = alc_fixup_disable_aamix,
11947 .chained = true,
11948 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11949 },
493a52a9
HW
11950 [ALC668_FIXUP_AUTO_MUTE] = {
11951 .type = HDA_FIXUP_FUNC,
11952 .v.func = alc_fixup_auto_mute_via_amp,
11953 .chained = true,
11954 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11955 },
1f8b46cd
DH
11956 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11957 .type = HDA_FIXUP_PINS,
11958 .v.pins = (const struct hda_pintbl[]) {
11959 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11960 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
11961 { }
11962 },
11963 .chained = true,
11964 .chain_id = ALC662_FIXUP_HEADSET_MODE
11965 },
11966 [ALC662_FIXUP_HEADSET_MODE] = {
11967 .type = HDA_FIXUP_FUNC,
11968 .v.func = alc_fixup_headset_mode_alc662,
11969 },
73bdd597
DH
11970 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
11971 .type = HDA_FIXUP_PINS,
11972 .v.pins = (const struct hda_pintbl[]) {
11973 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11974 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11975 { }
11976 },
11977 .chained = true,
11978 .chain_id = ALC668_FIXUP_HEADSET_MODE
11979 },
11980 [ALC668_FIXUP_HEADSET_MODE] = {
11981 .type = HDA_FIXUP_FUNC,
11982 .v.func = alc_fixup_headset_mode_alc668,
11983 },
8e54b4ac 11984 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 11985 .type = HDA_FIXUP_FUNC,
eb9ca3ab 11986 .v.func = alc_fixup_bass_chmap,
8e383953
TI
11987 .chained = true,
11988 .chain_id = ALC662_FIXUP_ASUS_MODE4
11989 },
61a75f13
DH
11990 [ALC662_FIXUP_BASS_16] = {
11991 .type = HDA_FIXUP_PINS,
11992 .v.pins = (const struct hda_pintbl[]) {
11993 {0x16, 0x80106111}, /* bass speaker */
11994 {}
11995 },
11996 .chained = true,
11997 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11998 },
a30c9aaa
TI
11999 [ALC662_FIXUP_BASS_1A] = {
12000 .type = HDA_FIXUP_PINS,
12001 .v.pins = (const struct hda_pintbl[]) {
12002 {0x1a, 0x80106111}, /* bass speaker */
12003 {}
12004 },
8e54b4ac
DH
12005 .chained = true,
12006 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 12007 },
8e54b4ac 12008 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 12009 .type = HDA_FIXUP_FUNC,
eb9ca3ab 12010 .v.func = alc_fixup_bass_chmap,
a30c9aaa 12011 },
9d4dc584
BM
12012 [ALC662_FIXUP_ASUS_Nx50] = {
12013 .type = HDA_FIXUP_FUNC,
12014 .v.func = alc_fixup_auto_mute_via_amp,
12015 .chained = true,
12016 .chain_id = ALC662_FIXUP_BASS_1A
12017 },
fc7438b1
MP
12018 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12019 .type = HDA_FIXUP_FUNC,
12020 .v.func = alc_fixup_headset_mode_alc668,
12021 .chain_id = ALC662_FIXUP_BASS_CHMAP
12022 },
3231e205
YP
12023 [ALC668_FIXUP_ASUS_Nx51] = {
12024 .type = HDA_FIXUP_PINS,
12025 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
12026 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12027 { 0x1a, 0x90170151 }, /* bass speaker */
12028 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
12029 {}
12030 },
12031 .chained = true,
fc7438b1 12032 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 12033 },
5b7c5e1f 12034 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
12035 .type = HDA_FIXUP_VERBS,
12036 .v.verbs = (const struct hda_verb[]) {
12037 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12038 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12039 {}
12040 },
12041 },
5b7c5e1f
TI
12042 [ALC668_FIXUP_ASUS_G751] = {
12043 .type = HDA_FIXUP_PINS,
12044 .v.pins = (const struct hda_pintbl[]) {
12045 { 0x16, 0x0421101f }, /* HP */
12046 {}
12047 },
12048 .chained = true,
12049 .chain_id = ALC668_FIXUP_MIC_COEF
12050 },
78f4f7c2
KY
12051 [ALC891_FIXUP_HEADSET_MODE] = {
12052 .type = HDA_FIXUP_FUNC,
12053 .v.func = alc_fixup_headset_mode,
12054 },
12055 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12056 .type = HDA_FIXUP_PINS,
12057 .v.pins = (const struct hda_pintbl[]) {
12058 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12059 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12060 { }
12061 },
12062 .chained = true,
12063 .chain_id = ALC891_FIXUP_HEADSET_MODE
12064 },
9b51fe3e
SB
12065 [ALC662_FIXUP_ACER_VERITON] = {
12066 .type = HDA_FIXUP_PINS,
12067 .v.pins = (const struct hda_pintbl[]) {
12068 { 0x15, 0x50170120 }, /* no internal speaker */
12069 { }
12070 }
12071 },
1a3f0991
TI
12072 [ALC892_FIXUP_ASROCK_MOBO] = {
12073 .type = HDA_FIXUP_PINS,
12074 .v.pins = (const struct hda_pintbl[]) {
12075 { 0x15, 0x40f000f0 }, /* disabled */
12076 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
12077 { }
12078 }
12079 },
c6790c8e
KY
12080 [ALC662_FIXUP_USI_FUNC] = {
12081 .type = HDA_FIXUP_FUNC,
12082 .v.func = alc662_fixup_usi_headset_mic,
12083 },
12084 [ALC662_FIXUP_USI_HEADSET_MODE] = {
12085 .type = HDA_FIXUP_PINS,
12086 .v.pins = (const struct hda_pintbl[]) {
12087 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12088 { 0x18, 0x01a1903d },
12089 { }
12090 },
12091 .chained = true,
12092 .chain_id = ALC662_FIXUP_USI_FUNC
12093 },
ca169cc2
KY
12094 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12095 .type = HDA_FIXUP_FUNC,
12096 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12097 },
00066e97
SB
12098 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12099 .type = HDA_FIXUP_FUNC,
12100 .v.func = alc662_fixup_aspire_ethos_hp,
12101 },
00066e97
SB
12102 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12103 .type = HDA_FIXUP_PINS,
12104 .v.pins = (const struct hda_pintbl[]) {
12105 { 0x15, 0x92130110 }, /* front speakers */
12106 { 0x18, 0x99130111 }, /* center/subwoofer */
12107 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
12108 { }
12109 },
12110 .chained = true,
336820c4 12111 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 12112 },
5af29028
KY
12113 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
12114 .type = HDA_FIXUP_FUNC,
12115 .v.func = alc671_fixup_hp_headset_mic2,
12116 },
d858c706
JHP
12117 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12118 .type = HDA_FIXUP_PINS,
12119 .v.pins = (const struct hda_pintbl[]) {
12120 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12121 { }
12122 },
12123 .chained = true,
12124 .chain_id = ALC662_FIXUP_USI_FUNC
12125 },
a124458a
JHP
12126 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12127 .type = HDA_FIXUP_PINS,
12128 .v.pins = (const struct hda_pintbl[]) {
12129 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12130 { 0x1b, 0x0221144f },
12131 { }
12132 },
12133 .chained = true,
12134 .chain_id = ALC662_FIXUP_USI_FUNC
12135 },
a3fd1a98
HW
12136 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12137 .type = HDA_FIXUP_PINS,
12138 .v.pins = (const struct hda_pintbl[]) {
12139 { 0x1b, 0x04a1112c },
12140 { }
12141 },
12142 .chained = true,
12143 .chain_id = ALC668_FIXUP_HEADSET_MIC
12144 },
12145 [ALC668_FIXUP_HEADSET_MIC] = {
12146 .type = HDA_FIXUP_FUNC,
12147 .v.func = alc269_fixup_headset_mic,
12148 .chained = true,
12149 .chain_id = ALC668_FIXUP_MIC_DET_COEF
12150 },
12151 [ALC668_FIXUP_MIC_DET_COEF] = {
12152 .type = HDA_FIXUP_VERBS,
12153 .v.verbs = (const struct hda_verb[]) {
12154 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12155 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12156 {}
12157 },
12158 },
d7f32791
KY
12159 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12160 .type = HDA_FIXUP_FUNC,
12161 .v.func = alc897_fixup_lenovo_headset_mic,
12162 },
12163 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
12164 .type = HDA_FIXUP_PINS,
12165 .v.pins = (const struct hda_pintbl[]) {
12166 { 0x1a, 0x03a11050 },
12167 { }
12168 },
12169 .chained = true,
12170 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12171 },
fe6900bd
KY
12172 [ALC897_FIXUP_HP_HSMIC_VERB] = {
12173 .type = HDA_FIXUP_PINS,
12174 .v.pins = (const struct hda_pintbl[]) {
12175 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12176 { }
12177 },
12178 },
4bf5bf54
EP
12179 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12180 .type = HDA_FIXUP_FUNC,
12181 .v.func = alc897_fixup_lenovo_headset_mode,
12182 },
12183 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12184 .type = HDA_FIXUP_PINS,
12185 .v.pins = (const struct hda_pintbl[]) {
12186 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12187 { }
12188 },
12189 .chained = true,
12190 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12191 },
73f1c75d 12192 [ALC897_FIXUP_UNIS_H3C_X500S] = {
12193 .type = HDA_FIXUP_VERBS,
12194 .v.verbs = (const struct hda_verb[]) {
12195 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12196 {}
12197 },
12198 },
6cb3b707
DH
12199};
12200
a9111321 12201static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 12202 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 12203 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 12204 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 12205 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 12206 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 12207 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 12208 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 12209 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 12210 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 12211 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 12212 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
12213 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12214 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 12215 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 12216 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 12217 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 12218 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 12219 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
12220 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12221 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 12222 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 12223 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
ea24b995 12224 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
fe6900bd 12225 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
90670ef7 12226 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
148ebf54 12227 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
527c356b 12228 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
dbe75d31 12229 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
882bd07f 12230 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 12231 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 12232 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 12233 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 12234 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 12235 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 12236 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 12237 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
12238 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12239 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 12240 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 12241 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 12242 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 12243 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 12244 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 12245 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 12246 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 12247 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 12248 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
5a873857 12249 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
7ca4c8d4 12250 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
d7f32791
KY
12251 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12252 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12253 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12254 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
4ca110ca
BL
12255 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12256 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
6f7e4664 12257 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
4bf5bf54 12258 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
d4118588 12259 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 12260 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 12261 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 12262 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 12263 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 12264 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 12265 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
a2a87148 12266 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
53c334ad
TI
12267
12268#if 0
12269 /* Below is a quirk table taken from the old code.
12270 * Basically the device should work as is without the fixup table.
12271 * If BIOS doesn't give a proper info, enable the corresponding
12272 * fixup entry.
7d7eb9ea 12273 */
53c334ad
TI
12274 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12275 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12276 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12277 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12278 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12279 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12280 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12281 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12282 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12283 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12284 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12285 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12286 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12287 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12288 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12289 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12290 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12291 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12292 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12293 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12294 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12295 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12296 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12297 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12298 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12299 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12300 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12301 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12302 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12303 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12304 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12305 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12306 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12307 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12308 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12309 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12310 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12311 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12312 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12313 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12314 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12315 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12316 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12317 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12318 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12319 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12320 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12321 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12322 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12323 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12324#endif
6cb3b707
DH
12325 {}
12326};
12327
1727a771 12328static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
12329 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12330 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 12331 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 12332 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
12333 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12334 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12335 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12336 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12337 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12338 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12339 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12340 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 12341 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 12342 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 12343 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 12344 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
12345 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12346 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12347 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12348 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12349 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12350 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12351 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12352 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 12353 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
12354 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12355 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12356 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12357 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12358 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 12359 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 12360 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
73f1c75d 12361 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
6be7948f
TB
12362 {}
12363};
6cb3b707 12364
532895c5 12365static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
12366 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12367 {0x17, 0x02211010},
12368 {0x18, 0x01a19030},
12369 {0x1a, 0x01813040},
12370 {0x21, 0x01014020}),
4b4e0e32
HW
12371 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12372 {0x16, 0x01813030},
12373 {0x17, 0x02211010},
12374 {0x18, 0x01a19040},
12375 {0x21, 0x01014020}),
1f8b46cd 12376 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 12377 {0x14, 0x01014010},
1f8b46cd 12378 {0x18, 0x01a19020},
1f8b46cd 12379 {0x1a, 0x0181302f},
11580297 12380 {0x1b, 0x0221401f}),
76c2132e
DH
12381 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12382 {0x12, 0x99a30130},
12383 {0x14, 0x90170110},
12384 {0x15, 0x0321101f},
11580297 12385 {0x16, 0x03011020}),
76c2132e
DH
12386 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12387 {0x12, 0x99a30140},
12388 {0x14, 0x90170110},
12389 {0x15, 0x0321101f},
11580297 12390 {0x16, 0x03011020}),
76c2132e
DH
12391 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12392 {0x12, 0x99a30150},
12393 {0x14, 0x90170110},
12394 {0x15, 0x0321101f},
11580297 12395 {0x16, 0x03011020}),
76c2132e 12396 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
12397 {0x14, 0x90170110},
12398 {0x15, 0x0321101f},
11580297 12399 {0x16, 0x03011020}),
76c2132e
DH
12400 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12401 {0x12, 0x90a60130},
12402 {0x14, 0x90170110},
11580297 12403 {0x15, 0x0321101f}),
5af29028
KY
12404 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12405 {0x14, 0x01014010},
12406 {0x17, 0x90170150},
f2adbae0 12407 {0x19, 0x02a11060},
5af29028
KY
12408 {0x1b, 0x01813030},
12409 {0x21, 0x02211020}),
12410 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12411 {0x14, 0x01014010},
12412 {0x18, 0x01a19040},
12413 {0x1b, 0x01813030},
12414 {0x21, 0x02211020}),
12415 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12416 {0x14, 0x01014020},
12417 {0x17, 0x90170110},
12418 {0x18, 0x01a19050},
12419 {0x1b, 0x01813040},
12420 {0x21, 0x02211030}),
532895c5
HW
12421 {}
12422};
12423
1d045db9
TI
12424/*
12425 */
bc9f98a9
KY
12426static int patch_alc662(struct hda_codec *codec)
12427{
12428 struct alc_spec *spec;
3de95173 12429 int err;
bc9f98a9 12430
3de95173
TI
12431 err = alc_alloc_spec(codec, 0x0b);
12432 if (err < 0)
12433 return err;
bc9f98a9 12434
3de95173 12435 spec = codec->spec;
1f0f4b80 12436
225068ab
TI
12437 spec->shutup = alc_eapd_shutup;
12438
53c334ad
TI
12439 /* handle multiple HPs as is */
12440 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12441
2c3bf9ab
TI
12442 alc_fix_pll_init(codec, 0x20, 0x04, 15);
12443
7639a06c 12444 switch (codec->core.vendor_id) {
f3f9185f
KY
12445 case 0x10ec0668:
12446 spec->init_hook = alc668_restore_default_value;
12447 break;
f3f9185f 12448 }
8663ff75 12449
c9af753f
TI
12450 alc_pre_init(codec);
12451
1727a771 12452 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 12453 alc662_fixup_tbl, alc662_fixups);
0fc1e447 12454 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 12455 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
12456
12457 alc_auto_parse_customize_define(codec);
12458
7504b6cd
TI
12459 if (has_cdefine_beep(codec))
12460 spec->gen.beep_nid = 0x01;
12461
1bb7e43e 12462 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 12463 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 12464 spec->cdefine.platform_type == 1) {
6134b1a2
WY
12465 err = alc_codec_rename(codec, "ALC272X");
12466 if (err < 0)
e16fb6d1 12467 goto error;
20ca0c35 12468 }
274693f3 12469
b9c5106c
TI
12470 /* automatic parse from the BIOS config */
12471 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
12472 if (err < 0)
12473 goto error;
bc9f98a9 12474
7504b6cd 12475 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 12476 switch (codec->core.vendor_id) {
da00c244 12477 case 0x10ec0662:
fea80fae 12478 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
12479 break;
12480 case 0x10ec0272:
12481 case 0x10ec0663:
12482 case 0x10ec0665:
9ad54547 12483 case 0x10ec0668:
fea80fae 12484 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
12485 break;
12486 case 0x10ec0273:
fea80fae 12487 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
12488 break;
12489 }
fea80fae
TI
12490 if (err < 0)
12491 goto error;
cec27c89 12492 }
2134ea4f 12493
1727a771 12494 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 12495
bc9f98a9 12496 return 0;
801f49d3 12497
e16fb6d1
TI
12498 error:
12499 alc_free(codec);
12500 return err;
b478b998
KY
12501}
12502
d1eb57f4
KY
12503/*
12504 * ALC680 support
12505 */
d1eb57f4 12506
d1eb57f4
KY
12507static int alc680_parse_auto_config(struct hda_codec *codec)
12508{
3e6179b8 12509 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
12510}
12511
d1eb57f4 12512/*
d1eb57f4 12513 */
d1eb57f4
KY
12514static int patch_alc680(struct hda_codec *codec)
12515{
d1eb57f4
KY
12516 int err;
12517
1f0f4b80 12518 /* ALC680 has no aa-loopback mixer */
3de95173
TI
12519 err = alc_alloc_spec(codec, 0);
12520 if (err < 0)
12521 return err;
1f0f4b80 12522
1ebec5f2
TI
12523 /* automatic parse from the BIOS config */
12524 err = alc680_parse_auto_config(codec);
12525 if (err < 0) {
12526 alc_free(codec);
12527 return err;
d1eb57f4
KY
12528 }
12529
d1eb57f4
KY
12530 return 0;
12531}
12532
1da177e4
LT
12533/*
12534 * patch entries
12535 */
b9a94a9c 12536static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 12537 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 12538 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 12539 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 12540 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 12541 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
12542 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12543 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 12544 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 12545 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 12546 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 12547 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
12548 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12549 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 12550 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
12551 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12552 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12553 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12554 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12555 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12556 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12557 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 12558 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
12559 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12560 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12561 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12562 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12563 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12564 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 12565 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 12566 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 12567 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 12568 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 12569 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
12570 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12571 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12572 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 12573 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 12574 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 12575 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 12576 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 12577 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 12578 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
12579 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12580 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12581 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12582 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12583 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12584 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12585 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12586 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12587 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12588 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12589 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12590 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12591 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12592 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
12593 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12594 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12595 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 12596 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 12597 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
12598 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12599 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12600 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12601 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12602 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12603 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12604 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12605 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12606 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12607 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12608 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 12609 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
12610 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12611 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 12612 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 12613 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 12614 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
527f4643 12615 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
1da177e4
LT
12616 {} /* terminator */
12617};
b9a94a9c 12618MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
12619
12620MODULE_LICENSE("GPL");
12621MODULE_DESCRIPTION("Realtek HD-audio codec");
12622
d8a766a1 12623static struct hda_codec_driver realtek_driver = {
b9a94a9c 12624 .id = snd_hda_id_realtek,
1289e9e8
TI
12625};
12626
d8a766a1 12627module_hda_codec_driver(realtek_driver);