]> git.ipfire.org Git - thirdparty/linux.git/blame - sound/pci/hda/patch_realtek.c
Merge tag 'io_uring-6.16-20250630' of git://git.kernel.dk/linux
[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>
03c5c350 14#include <linux/cleanup.h>
1da177e4
LT
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/slab.h>
18#include <linux/pci.h>
08fb0d0e 19#include <linux/dmi.h>
da155d5b 20#include <linux/module.h>
03c5c350 21#include <linux/i2c.h>
33f4acd3 22#include <linux/input.h>
87dc3648 23#include <linux/leds.h>
35a17444 24#include <linux/ctype.h>
03c5c350 25#include <linux/spi/spi.h>
1da177e4 26#include <sound/core.h>
9ad0e496 27#include <sound/jack.h>
be57bfff 28#include <sound/hda_codec.h>
1da177e4 29#include "hda_local.h"
23d30f28 30#include "hda_auto_parser.h"
aa85822c 31#include "hda_beep.h"
1835a0f9 32#include "hda_jack.h"
08c189f2 33#include "hda_generic.h"
d3dca026 34#include "hda_component.h"
1da177e4 35
cd63a5ff
TI
36/* keep halting ALC5505 DSP, for power saving */
37#define HALT_REALTEK_ALC5505
38
4a79ba34
TI
39/* extra amp-initialization sequence types */
40enum {
1c76aa5f 41 ALC_INIT_UNDEFINED,
4a79ba34
TI
42 ALC_INIT_NONE,
43 ALC_INIT_DEFAULT,
4a79ba34
TI
44};
45
73bdd597
DH
46enum {
47 ALC_HEADSET_MODE_UNKNOWN,
48 ALC_HEADSET_MODE_UNPLUGGED,
49 ALC_HEADSET_MODE_HEADSET,
50 ALC_HEADSET_MODE_MIC,
51 ALC_HEADSET_MODE_HEADPHONE,
52};
53
54enum {
55 ALC_HEADSET_TYPE_UNKNOWN,
56 ALC_HEADSET_TYPE_CTIA,
57 ALC_HEADSET_TYPE_OMTP,
58};
59
c7b60a89
HW
60enum {
61 ALC_KEY_MICMUTE_INDEX,
62};
63
da00c244
KY
64struct alc_customize_define {
65 unsigned int sku_cfg;
66 unsigned char port_connectivity;
67 unsigned char check_sum;
68 unsigned char customization;
69 unsigned char external_amp;
70 unsigned int enable_pcbeep:1;
71 unsigned int platform_type:1;
72 unsigned int swap:1;
73 unsigned int override:1;
90622917 74 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
da00c244
KY
75};
76
766538ac
TI
77struct alc_coef_led {
78 unsigned int idx;
79 unsigned int mask;
80 unsigned int on;
81 unsigned int off;
82};
83
1da177e4 84struct alc_spec {
08c189f2 85 struct hda_gen_spec gen; /* must be at head */
23d30f28 86
1da177e4 87 /* codec parameterization */
da00c244 88 struct alc_customize_define cdefine;
08c189f2 89 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
834be88d 90
5579cd6f
TI
91 /* GPIO bits */
92 unsigned int gpio_mask;
93 unsigned int gpio_dir;
94 unsigned int gpio_data;
215c850c 95 bool gpio_write_delay; /* add a delay before writing gpio_data */
5579cd6f 96
8d3d1ece 97 /* mute LED for HP laptops, see vref_mute_led_set() */
08fb0d0e 98 int mute_led_polarity;
dbd13179 99 int micmute_led_polarity;
08fb0d0e 100 hda_nid_t mute_led_nid;
9c5dc3bf 101 hda_nid_t cap_mute_led_nid;
08fb0d0e 102
0f32fd19
TI
103 unsigned int gpio_mute_led_mask;
104 unsigned int gpio_mic_led_mask;
766538ac
TI
105 struct alc_coef_led mute_led_coef;
106 struct alc_coef_led mic_led_coef;
b837a9f5 107 struct mutex coef_mutex;
9f5c6faf 108
73bdd597
DH
109 hda_nid_t headset_mic_pin;
110 hda_nid_t headphone_mic_pin;
111 int current_headset_mode;
112 int current_headset_type;
113
ae6b813a
TI
114 /* hooks */
115 void (*init_hook)(struct hda_codec *codec);
c97259df 116 void (*power_hook)(struct hda_codec *codec);
1c716153 117 void (*shutup)(struct hda_codec *codec);
d922b51d 118
4a79ba34 119 int init_amp;
d433a678 120 int codec_variant; /* flag for other variants */
97a26570
KY
121 unsigned int has_alc5505_dsp:1;
122 unsigned int no_depop_delay:1;
693abe11 123 unsigned int done_hp_init:1;
c0ca5ece 124 unsigned int no_shutup_pins:1;
d3ba58bb 125 unsigned int ultra_low_power:1;
476c02e0 126 unsigned int has_hs_key:1;
92666d45 127 unsigned int no_internal_mic_pin:1;
69ea4c9d 128 unsigned int en_3kpull_low:1;
7e4d4b32 129 int num_speaker_amps;
e64f14f4 130
2c3bf9ab
TI
131 /* for PLL fix */
132 hda_nid_t pll_nid;
133 unsigned int pll_coef_idx, pll_coef_bit;
1bb7e43e 134 unsigned int coef0;
33f4acd3 135 struct input_dev *kb_dev;
c7b60a89 136 u8 alc_mute_keycode_map[1];
d3dca026
LT
137
138 /* component binding */
960ccf6e 139 struct hda_component_parent comps;
df694daa
KY
140};
141
f2a227cd
TI
142/*
143 * COEF access helper functions
144 */
145
2a845837
TI
146static void coef_mutex_lock(struct hda_codec *codec)
147{
148 struct alc_spec *spec = codec->spec;
149
150 snd_hda_power_up_pm(codec);
151 mutex_lock(&spec->coef_mutex);
152}
153
154static void coef_mutex_unlock(struct hda_codec *codec)
155{
156 struct alc_spec *spec = codec->spec;
157
158 mutex_unlock(&spec->coef_mutex);
159 snd_hda_power_down_pm(codec);
160}
161
b837a9f5
TI
162static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
163 unsigned int coef_idx)
f2a227cd
TI
164{
165 unsigned int val;
166
167 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
168 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
169 return val;
170}
171
b837a9f5
TI
172static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
173 unsigned int coef_idx)
174{
b837a9f5
TI
175 unsigned int val;
176
2a845837 177 coef_mutex_lock(codec);
b837a9f5 178 val = __alc_read_coefex_idx(codec, nid, coef_idx);
2a845837 179 coef_mutex_unlock(codec);
b837a9f5
TI
180 return val;
181}
182
f2a227cd
TI
183#define alc_read_coef_idx(codec, coef_idx) \
184 alc_read_coefex_idx(codec, 0x20, coef_idx)
185
b837a9f5
TI
186static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
187 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
188{
189 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
190 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
191}
192
b837a9f5
TI
193static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
194 unsigned int coef_idx, unsigned int coef_val)
195{
2a845837 196 coef_mutex_lock(codec);
b837a9f5 197 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
2a845837 198 coef_mutex_unlock(codec);
b837a9f5
TI
199}
200
f2a227cd
TI
201#define alc_write_coef_idx(codec, coef_idx, coef_val) \
202 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
203
b837a9f5
TI
204static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
205 unsigned int coef_idx, unsigned int mask,
206 unsigned int bits_set)
207{
208 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
209
210 if (val != -1)
211 __alc_write_coefex_idx(codec, nid, coef_idx,
212 (val & ~mask) | bits_set);
213}
214
98b24883
TI
215static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
216 unsigned int coef_idx, unsigned int mask,
217 unsigned int bits_set)
218{
2a845837 219 coef_mutex_lock(codec);
b837a9f5 220 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
2a845837 221 coef_mutex_unlock(codec);
98b24883
TI
222}
223
224#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
225 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
226
f2a227cd
TI
227/* a special bypass for COEF 0; read the cached value at the second time */
228static unsigned int alc_get_coef0(struct hda_codec *codec)
229{
230 struct alc_spec *spec = codec->spec;
231
232 if (!spec->coef0)
233 spec->coef0 = alc_read_coef_idx(codec, 0);
234 return spec->coef0;
235}
236
54db6c39
TI
237/* coef writes/updates batch */
238struct coef_fw {
239 unsigned char nid;
240 unsigned char idx;
241 unsigned short mask;
242 unsigned short val;
243};
244
245#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
246 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
247#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
248#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
249#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
250
251static void alc_process_coef_fw(struct hda_codec *codec,
252 const struct coef_fw *fw)
253{
2a845837 254 coef_mutex_lock(codec);
54db6c39
TI
255 for (; fw->nid; fw++) {
256 if (fw->mask == (unsigned short)-1)
b837a9f5 257 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 258 else
b837a9f5
TI
259 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
260 fw->mask, fw->val);
54db6c39 261 }
2a845837 262 coef_mutex_unlock(codec);
54db6c39
TI
263}
264
df694daa 265/*
1d045db9 266 * GPIO setup tables, used in initialization
df694daa 267 */
5579cd6f 268
bc9f98a9 269/* Enable GPIO mask and set output */
5579cd6f
TI
270static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
271{
272 struct alc_spec *spec = codec->spec;
bc9f98a9 273
5579cd6f
TI
274 spec->gpio_mask |= mask;
275 spec->gpio_dir |= mask;
276 spec->gpio_data |= mask;
277}
bc9f98a9 278
5579cd6f
TI
279static void alc_write_gpio_data(struct hda_codec *codec)
280{
281 struct alc_spec *spec = codec->spec;
282
283 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
284 spec->gpio_data);
285}
286
aaf312de
TI
287static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
288 bool on)
289{
290 struct alc_spec *spec = codec->spec;
291 unsigned int oldval = spec->gpio_data;
292
293 if (on)
294 spec->gpio_data |= mask;
295 else
296 spec->gpio_data &= ~mask;
297 if (oldval != spec->gpio_data)
298 alc_write_gpio_data(codec);
299}
300
5579cd6f
TI
301static void alc_write_gpio(struct hda_codec *codec)
302{
303 struct alc_spec *spec = codec->spec;
304
305 if (!spec->gpio_mask)
306 return;
307
308 snd_hda_codec_write(codec, codec->core.afg, 0,
309 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
310 snd_hda_codec_write(codec, codec->core.afg, 0,
311 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
312 if (spec->gpio_write_delay)
313 msleep(1);
5579cd6f
TI
314 alc_write_gpio_data(codec);
315}
316
317static void alc_fixup_gpio(struct hda_codec *codec, int action,
318 unsigned int mask)
319{
320 if (action == HDA_FIXUP_ACT_PRE_PROBE)
321 alc_setup_gpio(codec, mask);
322}
323
324static void alc_fixup_gpio1(struct hda_codec *codec,
325 const struct hda_fixup *fix, int action)
326{
327 alc_fixup_gpio(codec, action, 0x01);
328}
329
330static void alc_fixup_gpio2(struct hda_codec *codec,
331 const struct hda_fixup *fix, int action)
332{
333 alc_fixup_gpio(codec, action, 0x02);
334}
335
336static void alc_fixup_gpio3(struct hda_codec *codec,
337 const struct hda_fixup *fix, int action)
338{
339 alc_fixup_gpio(codec, action, 0x03);
340}
bdd148a3 341
ae065f1c
TI
342static void alc_fixup_gpio4(struct hda_codec *codec,
343 const struct hda_fixup *fix, int action)
344{
345 alc_fixup_gpio(codec, action, 0x04);
346}
347
8a503555
TI
348static void alc_fixup_micmute_led(struct hda_codec *codec,
349 const struct hda_fixup *fix, int action)
350{
e65bf997 351 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
352 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
353}
354
2c3bf9ab
TI
355/*
356 * Fix hardware PLL issue
357 * On some codecs, the analog PLL gating control must be off while
358 * the default value is 1.
359 */
360static void alc_fix_pll(struct hda_codec *codec)
361{
362 struct alc_spec *spec = codec->spec;
2c3bf9ab 363
98b24883
TI
364 if (spec->pll_nid)
365 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
366 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
367}
368
369static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
370 unsigned int coef_idx, unsigned int coef_bit)
371{
372 struct alc_spec *spec = codec->spec;
373 spec->pll_nid = nid;
374 spec->pll_coef_idx = coef_idx;
375 spec->pll_coef_bit = coef_bit;
376 alc_fix_pll(codec);
377}
378
cf5a2279 379/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
380static void alc_update_knob_master(struct hda_codec *codec,
381 struct hda_jack_callback *jack)
cf5a2279
TI
382{
383 unsigned int val;
384 struct snd_kcontrol *kctl;
385 struct snd_ctl_elem_value *uctl;
386
387 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
388 if (!kctl)
389 return;
390 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
391 if (!uctl)
392 return;
2ebab40e 393 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
394 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
395 val &= HDA_AMP_VOLMASK;
396 uctl->value.integer.value[0] = val;
397 uctl->value.integer.value[1] = val;
398 kctl->put(kctl, uctl);
399 kfree(uctl);
400}
401
29adc4b9 402static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 403{
29adc4b9
DH
404 /* For some reason, the res given from ALC880 is broken.
405 Here we adjust it properly. */
406 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
407}
408
394c97f8
KY
409/* Change EAPD to verb control */
410static void alc_fill_eapd_coef(struct hda_codec *codec)
411{
412 int coef;
413
414 coef = alc_get_coef0(codec);
415
7639a06c 416 switch (codec->core.vendor_id) {
394c97f8
KY
417 case 0x10ec0262:
418 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
419 break;
420 case 0x10ec0267:
421 case 0x10ec0268:
422 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
423 break;
424 case 0x10ec0269:
425 if ((coef & 0x00f0) == 0x0010)
426 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
427 if ((coef & 0x00f0) == 0x0020)
428 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
429 if ((coef & 0x00f0) == 0x0030)
430 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
431 break;
432 case 0x10ec0280:
433 case 0x10ec0284:
434 case 0x10ec0290:
435 case 0x10ec0292:
436 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
437 break;
4231430d 438 case 0x10ec0225:
44be77c5
TI
439 case 0x10ec0295:
440 case 0x10ec0299:
441 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 442 fallthrough;
44be77c5 443 case 0x10ec0215:
494d0939
KY
444 case 0x10ec0236:
445 case 0x10ec0245:
446 case 0x10ec0256:
447 case 0x10ec0257:
fcfc9f71
KY
448 case 0x10ec0285:
449 case 0x10ec0289:
450 alc_update_coef_idx(codec, 0x36, 1<<13, 0);
451 fallthrough;
1948fc06 452 case 0x10ec0230:
394c97f8 453 case 0x10ec0233:
ea04a1db 454 case 0x10ec0235:
394c97f8 455 case 0x10ec0255:
527f4643 456 case 0x19e58326:
394c97f8
KY
457 case 0x10ec0282:
458 case 0x10ec0283:
459 case 0x10ec0286:
460 case 0x10ec0288:
506b62c3 461 case 0x10ec0298:
1078bef0 462 case 0x10ec0300:
394c97f8
KY
463 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
464 break;
3aabf94c
KY
465 case 0x10ec0275:
466 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
467 break;
8822702f
HW
468 case 0x10ec0287:
469 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
470 alc_write_coef_idx(codec, 0x8, 0x4ab7);
471 break;
394c97f8
KY
472 case 0x10ec0293:
473 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
474 break;
dcd4f0db
KY
475 case 0x10ec0234:
476 case 0x10ec0274:
155699cc
KY
477 alc_write_coef_idx(codec, 0x6e, 0x0c25);
478 fallthrough;
dcd4f0db 479 case 0x10ec0294:
6fbae35a
KY
480 case 0x10ec0700:
481 case 0x10ec0701:
482 case 0x10ec0703:
83629532 483 case 0x10ec0711:
dcd4f0db
KY
484 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
485 break;
394c97f8
KY
486 case 0x10ec0662:
487 if ((coef & 0x00f0) == 0x0030)
488 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
489 break;
490 case 0x10ec0272:
491 case 0x10ec0273:
492 case 0x10ec0663:
493 case 0x10ec0665:
494 case 0x10ec0670:
495 case 0x10ec0671:
496 case 0x10ec0672:
497 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
498 break;
9194a1eb 499 case 0x10ec0222:
f0778871
KY
500 case 0x10ec0623:
501 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
502 break;
394c97f8
KY
503 case 0x10ec0668:
504 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
505 break;
506 case 0x10ec0867:
507 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
508 break;
509 case 0x10ec0888:
510 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
511 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
512 break;
513 case 0x10ec0892:
e5782a5d 514 case 0x10ec0897:
394c97f8
KY
515 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
516 break;
517 case 0x10ec0899:
518 case 0x10ec0900:
6d9ffcff 519 case 0x10ec0b00:
65553b12 520 case 0x10ec1168:
a535ad57 521 case 0x10ec1220:
394c97f8
KY
522 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
523 break;
524 }
525}
526
f9423e7a
KY
527/* additional initialization for ALC888 variants */
528static void alc888_coef_init(struct hda_codec *codec)
529{
1df8874b
KY
530 switch (alc_get_coef0(codec) & 0x00f0) {
531 /* alc888-VA */
532 case 0x00:
533 /* alc888-VB */
534 case 0x10:
535 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
536 break;
537 }
87a8c370
JK
538}
539
3fb4a508
TI
540/* turn on/off EAPD control (only if available) */
541static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
542{
543 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
544 return;
545 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
546 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
547 on ? 2 : 0);
548}
549
691f1fcc
TI
550/* turn on/off EAPD controls of the codec */
551static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
552{
553 /* We currently only handle front, HP */
caf3c043 554 static const hda_nid_t pins[] = {
af95b414 555 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 556 };
caf3c043 557 const hda_nid_t *p;
39fa84e9
TI
558 for (p = pins; *p; p++)
559 set_eapd(codec, *p, on);
691f1fcc
TI
560}
561
dad3197d
KY
562static int find_ext_mic_pin(struct hda_codec *codec);
563
564static void alc_headset_mic_no_shutup(struct hda_codec *codec)
565{
566 const struct hda_pincfg *pin;
567 int mic_pin = find_ext_mic_pin(codec);
568 int i;
569
570 /* don't shut up pins when unloading the driver; otherwise it breaks
571 * the default pin setup at the next load of the driver
572 */
573 if (codec->bus->shutdown)
574 return;
575
576 snd_array_for_each(&codec->init_pins, i, pin) {
577 /* use read here for syncing after issuing each verb */
578 if (pin->nid != mic_pin)
579 snd_hda_codec_read(codec, pin->nid, 0,
580 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
581 }
582
583 codec->pins_shutup = 1;
584}
585
c0ca5ece
TI
586static void alc_shutup_pins(struct hda_codec *codec)
587{
588 struct alc_spec *spec = codec->spec;
589
5a0c72c1
TI
590 if (spec->no_shutup_pins)
591 return;
592
dad3197d 593 switch (codec->core.vendor_id) {
5aec9891
KY
594 case 0x10ec0236:
595 case 0x10ec0256:
05df9732 596 case 0x10ec0257:
527f4643 597 case 0x19e58326:
66c5d718 598 case 0x10ec0283:
70794b95 599 case 0x10ec0285:
dad3197d 600 case 0x10ec0286:
70794b95 601 case 0x10ec0287:
dad3197d 602 case 0x10ec0288:
70794b95 603 case 0x10ec0295:
dad3197d
KY
604 case 0x10ec0298:
605 alc_headset_mic_no_shutup(codec);
606 break;
607 default:
5a0c72c1 608 snd_hda_shutup_pins(codec);
dad3197d
KY
609 break;
610 }
c0ca5ece
TI
611}
612
1c716153 613/* generic shutup callback;
4ce8e6a5 614 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
615 */
616static void alc_eapd_shutup(struct hda_codec *codec)
617{
97a26570
KY
618 struct alc_spec *spec = codec->spec;
619
1c716153 620 alc_auto_setup_eapd(codec, false);
97a26570
KY
621 if (!spec->no_depop_delay)
622 msleep(200);
c0ca5ece 623 alc_shutup_pins(codec);
1c716153
TI
624}
625
1d045db9 626/* generic EAPD initialization */
4a79ba34 627static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 628{
39fa84e9 629 alc_auto_setup_eapd(codec, true);
5579cd6f 630 alc_write_gpio(codec);
4a79ba34 631 switch (type) {
4a79ba34 632 case ALC_INIT_DEFAULT:
7639a06c 633 switch (codec->core.vendor_id) {
c9b58006 634 case 0x10ec0260:
98b24883 635 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 636 break;
c9b58006
KY
637 case 0x10ec0880:
638 case 0x10ec0882:
639 case 0x10ec0883:
640 case 0x10ec0885:
1df8874b 641 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 642 break;
f9423e7a 643 case 0x10ec0888:
4a79ba34 644 alc888_coef_init(codec);
f9423e7a 645 break;
bc9f98a9 646 }
4a79ba34
TI
647 break;
648 }
649}
650
35a39f98
TI
651/* get a primary headphone pin if available */
652static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
653{
654 if (spec->gen.autocfg.hp_pins[0])
655 return spec->gen.autocfg.hp_pins[0];
656 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
657 return spec->gen.autocfg.line_out_pins[0];
658 return 0;
659}
08c189f2 660
1d045db9 661/*
08c189f2 662 * Realtek SSID verification
1d045db9 663 */
42cf0d01 664
08c189f2
TI
665/* Could be any non-zero and even value. When used as fixup, tells
666 * the driver to ignore any present sku defines.
667 */
668#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 669
08c189f2
TI
670static void alc_fixup_sku_ignore(struct hda_codec *codec,
671 const struct hda_fixup *fix, int action)
1a1455de 672{
1a1455de 673 struct alc_spec *spec = codec->spec;
08c189f2
TI
674 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
675 spec->cdefine.fixup = 1;
676 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 677 }
1a1455de
TI
678}
679
b5c6611f
ML
680static void alc_fixup_no_depop_delay(struct hda_codec *codec,
681 const struct hda_fixup *fix, int action)
682{
683 struct alc_spec *spec = codec->spec;
684
84d2dc3e 685 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 686 spec->no_depop_delay = 1;
84d2dc3e
ML
687 codec->depop_delay = 0;
688 }
b5c6611f
ML
689}
690
08c189f2 691static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 692{
08c189f2
TI
693 unsigned int ass, tmp, i;
694 unsigned nid = 0;
4a79ba34
TI
695 struct alc_spec *spec = codec->spec;
696
08c189f2 697 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 698
08c189f2
TI
699 if (spec->cdefine.fixup) {
700 ass = spec->cdefine.sku_cfg;
701 if (ass == ALC_FIXUP_SKU_IGNORE)
702 return -1;
703 goto do_sku;
bb35febd
TI
704 }
705
5100cd07
TI
706 if (!codec->bus->pci)
707 return -1;
7639a06c 708 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
709 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
710 goto do_sku;
4a79ba34 711
08c189f2 712 nid = 0x1d;
7639a06c 713 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
714 nid = 0x17;
715 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 716
08c189f2 717 if (!(ass & 1)) {
4e76a883 718 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 719 codec->core.chip_name, ass);
08c189f2 720 return -1;
42cf0d01
DH
721 }
722
08c189f2
TI
723 /* check sum */
724 tmp = 0;
725 for (i = 1; i < 16; i++) {
726 if ((ass >> i) & 1)
727 tmp++;
ae8a60a5 728 }
08c189f2
TI
729 if (((ass >> 16) & 0xf) != tmp)
730 return -1;
ae8a60a5 731
da00c244
KY
732 spec->cdefine.port_connectivity = ass >> 30;
733 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
734 spec->cdefine.check_sum = (ass >> 16) & 0xf;
735 spec->cdefine.customization = ass >> 8;
736do_sku:
737 spec->cdefine.sku_cfg = ass;
738 spec->cdefine.external_amp = (ass & 0x38) >> 3;
739 spec->cdefine.platform_type = (ass & 0x4) >> 2;
740 spec->cdefine.swap = (ass & 0x2) >> 1;
741 spec->cdefine.override = ass & 0x1;
742
4e76a883 743 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 744 nid, spec->cdefine.sku_cfg);
4e76a883 745 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 746 spec->cdefine.port_connectivity);
4e76a883
TI
747 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
748 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
749 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
750 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
751 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
752 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
753 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
754
755 return 0;
756}
757
08c189f2
TI
758/* return the position of NID in the list, or -1 if not found */
759static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
760{
761 int i;
762 for (i = 0; i < nums; i++)
763 if (list[i] == nid)
764 return i;
765 return -1;
766}
1d045db9 767/* return true if the given NID is found in the list */
3af9ee6b
TI
768static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
769{
21268961 770 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
771}
772
4a79ba34
TI
773/* check subsystem ID and set up device-specific initialization;
774 * return 1 if initialized, 0 if invalid SSID
775 */
776/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
777 * 31 ~ 16 : Manufacture ID
778 * 15 ~ 8 : SKU ID
779 * 7 ~ 0 : Assembly ID
780 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
781 */
58c57cfa 782static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
783{
784 unsigned int ass, tmp, i;
785 unsigned nid;
786 struct alc_spec *spec = codec->spec;
787
90622917
DH
788 if (spec->cdefine.fixup) {
789 ass = spec->cdefine.sku_cfg;
790 if (ass == ALC_FIXUP_SKU_IGNORE)
791 return 0;
792 goto do_sku;
793 }
794
7639a06c 795 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
796 if (codec->bus->pci &&
797 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
798 goto do_sku;
799
800 /* invalid SSID, check the special NID pin defcfg instead */
801 /*
def319f9 802 * 31~30 : port connectivity
4a79ba34
TI
803 * 29~21 : reserve
804 * 20 : PCBEEP input
805 * 19~16 : Check sum (15:1)
806 * 15~1 : Custom
807 * 0 : override
808 */
809 nid = 0x1d;
7639a06c 810 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
811 nid = 0x17;
812 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
813 codec_dbg(codec,
814 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 815 ass, nid);
6227cdce 816 if (!(ass & 1))
4a79ba34
TI
817 return 0;
818 if ((ass >> 30) != 1) /* no physical connection */
819 return 0;
820
821 /* check sum */
822 tmp = 0;
823 for (i = 1; i < 16; i++) {
824 if ((ass >> i) & 1)
825 tmp++;
826 }
827 if (((ass >> 16) & 0xf) != tmp)
828 return 0;
829do_sku:
4e76a883 830 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 831 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
832 /*
833 * 0 : override
834 * 1 : Swap Jack
835 * 2 : 0 --> Desktop, 1 --> Laptop
836 * 3~5 : External Amplifier control
837 * 7~6 : Reserved
838 */
839 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
840 if (spec->init_amp == ALC_INIT_UNDEFINED) {
841 switch (tmp) {
842 case 1:
5579cd6f 843 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
844 break;
845 case 3:
5579cd6f 846 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
847 break;
848 case 7:
2bdccfd2 849 alc_setup_gpio(codec, 0x04);
1c76aa5f
TI
850 break;
851 case 5:
852 default:
853 spec->init_amp = ALC_INIT_DEFAULT;
854 break;
855 }
bc9f98a9 856 }
ea1fb29a 857
8c427226 858 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
859 * when the external headphone out jack is plugged"
860 */
8c427226 861 if (!(ass & 0x8000))
4a79ba34 862 return 1;
c9b58006
KY
863 /*
864 * 10~8 : Jack location
865 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
866 * 14~13: Resvered
867 * 15 : 1 --> enable the function "Mute internal speaker
868 * when the external headphone out jack is plugged"
869 */
35a39f98 870 if (!alc_get_hp_pin(spec)) {
01d4825d 871 hda_nid_t nid;
c9b58006 872 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 873 nid = ports[tmp];
08c189f2
TI
874 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
875 spec->gen.autocfg.line_outs))
3af9ee6b 876 return 1;
08c189f2 877 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 878 }
4a79ba34
TI
879 return 1;
880}
ea1fb29a 881
3e6179b8
TI
882/* Check the validity of ALC subsystem-id
883 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
884static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 885{
58c57cfa 886 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 887 struct alc_spec *spec = codec->spec;
67791202
TI
888 if (spec->init_amp == ALC_INIT_UNDEFINED) {
889 codec_dbg(codec,
890 "realtek: Enable default setup for auto mode as fallback\n");
891 spec->init_amp = ALC_INIT_DEFAULT;
892 }
4a79ba34 893 }
21268961 894}
1a1455de 895
1d720a2d 896/* inverted digital-mic */
9d36a7dc
DH
897static void alc_fixup_inv_dmic(struct hda_codec *codec,
898 const struct hda_fixup *fix, int action)
125821ae
TI
899{
900 struct alc_spec *spec = codec->spec;
668d1e96 901
9d36a7dc 902 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
903}
904
e9edcee0 905
08c189f2 906static int alc_build_controls(struct hda_codec *codec)
1d045db9 907{
a5cb463a 908 int err;
e9427969 909
08c189f2
TI
910 err = snd_hda_gen_build_controls(codec);
911 if (err < 0)
912 return err;
1da177e4 913
1727a771 914 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 915 return 0;
a361d84b
KY
916}
917
a361d84b 918
df694daa 919/*
08c189f2 920 * Common callbacks
df694daa 921 */
a361d84b 922
c9af753f
TI
923static void alc_pre_init(struct hda_codec *codec)
924{
925 alc_fill_eapd_coef(codec);
926}
927
aeac1a0d
KY
928#define is_s3_resume(codec) \
929 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
930#define is_s4_resume(codec) \
931 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
1e707769
KY
932#define is_s4_suspend(codec) \
933 ((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
c9af753f 934
08c189f2 935static int alc_init(struct hda_codec *codec)
1d045db9
TI
936{
937 struct alc_spec *spec = codec->spec;
a361d84b 938
c9af753f
TI
939 /* hibernation resume needs the full chip initialization */
940 if (is_s4_resume(codec))
941 alc_pre_init(codec);
942
08c189f2
TI
943 if (spec->init_hook)
944 spec->init_hook(codec);
a361d84b 945
89781d08 946 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 947 snd_hda_gen_init(codec);
08c189f2
TI
948 alc_fix_pll(codec);
949 alc_auto_init_amp(codec, spec->init_amp);
89781d08 950 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 951
1727a771 952 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 953
1d045db9
TI
954 return 0;
955}
a361d84b 956
2186fe21
ST
957/* forward declaration */
958static const struct component_master_ops comp_master_ops;
959
960static void alc_free(struct hda_codec *codec)
961{
962 struct alc_spec *spec = codec->spec;
963
964 if (spec)
965 hda_component_manager_free(&spec->comps, &comp_master_ops);
966
967 snd_hda_gen_free(codec);
968}
c3d9ca93 969
08c189f2 970static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
971{
972 struct alc_spec *spec = codec->spec;
a361d84b 973
c7273bd6
TI
974 if (!snd_hda_get_bool_hint(codec, "shutup"))
975 return; /* disabled explicitly by hints */
976
08c189f2
TI
977 if (spec && spec->shutup)
978 spec->shutup(codec);
9bfb2844 979 else
c0ca5ece 980 alc_shutup_pins(codec);
1d045db9
TI
981}
982
08c189f2 983static void alc_power_eapd(struct hda_codec *codec)
1d045db9 984{
08c189f2 985 alc_auto_setup_eapd(codec, false);
1d045db9 986}
2134ea4f 987
08c189f2 988static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
989{
990 struct alc_spec *spec = codec->spec;
08c189f2
TI
991 alc_shutup(codec);
992 if (spec && spec->power_hook)
993 spec->power_hook(codec);
a361d84b
KY
994 return 0;
995}
996
08c189f2 997static int alc_resume(struct hda_codec *codec)
1d045db9 998{
97a26570
KY
999 struct alc_spec *spec = codec->spec;
1000
1001 if (!spec->no_depop_delay)
1002 msleep(150); /* to avoid pop noise */
08c189f2 1003 codec->patch_ops.init(codec);
1a462be5 1004 snd_hda_regmap_sync(codec);
08c189f2
TI
1005 hda_call_check_power_status(codec, 0x01);
1006 return 0;
1d045db9 1007}
f6a92248 1008
1d045db9 1009/*
1d045db9 1010 */
08c189f2
TI
1011static const struct hda_codec_ops alc_patch_ops = {
1012 .build_controls = alc_build_controls,
1013 .build_pcms = snd_hda_gen_build_pcms,
1014 .init = alc_init,
1015 .free = alc_free,
1016 .unsol_event = snd_hda_jack_unsol_event,
08c189f2 1017 .resume = alc_resume,
08c189f2 1018 .suspend = alc_suspend,
fce52a3b 1019 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 1020};
f6a92248 1021
f53281e6 1022
ded255be 1023#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 1024
e4770629 1025/*
4b016931 1026 * Rename codecs appropriately from COEF value or subvendor id
e4770629 1027 */
08c189f2
TI
1028struct alc_codec_rename_table {
1029 unsigned int vendor_id;
1030 unsigned short coef_mask;
1031 unsigned short coef_bits;
1032 const char *name;
1033};
84898e87 1034
4b016931
KY
1035struct alc_codec_rename_pci_table {
1036 unsigned int codec_vendor_id;
1037 unsigned short pci_subvendor;
1038 unsigned short pci_subdevice;
1039 const char *name;
1040};
1041
6b0f95c4 1042static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1043 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1044 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1045 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1046 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1047 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1048 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1049 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1050 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1051 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1052 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1053 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1054 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1055 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1056 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1057 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1058 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1059 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1060 { } /* terminator */
1061};
84898e87 1062
6b0f95c4 1063static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1064 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1065 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1066 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1067 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1068 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1069 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1070 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1071 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1072 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1073 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1074 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1075 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1076 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1077 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1078 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1079 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1080 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1081 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1082 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1083 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1084 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1085 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1086 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1087 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1088 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1089 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1090 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1091 { } /* terminator */
1092};
1093
08c189f2 1094static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1095{
08c189f2 1096 const struct alc_codec_rename_table *p;
4b016931 1097 const struct alc_codec_rename_pci_table *q;
60db6b53 1098
08c189f2 1099 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1100 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1101 continue;
1102 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1103 return alc_codec_rename(codec, p->name);
1d045db9 1104 }
4b016931 1105
5100cd07
TI
1106 if (!codec->bus->pci)
1107 return 0;
4b016931 1108 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1109 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1110 continue;
1111 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1112 continue;
1113 if (!q->pci_subdevice ||
1114 q->pci_subdevice == codec->bus->pci->subsystem_device)
1115 return alc_codec_rename(codec, q->name);
1116 }
1117
08c189f2 1118 return 0;
1d045db9 1119}
f53281e6 1120
e4770629 1121
1d045db9
TI
1122/*
1123 * Digital-beep handlers
1124 */
1125#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1126
1127/* additional beep mixers; private_value will be overwritten */
1128static const struct snd_kcontrol_new alc_beep_mixer[] = {
1129 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1130 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1131};
1132
1133/* set up and create beep controls */
1134static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1135 int idx, int dir)
1136{
1137 struct snd_kcontrol_new *knew;
1138 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1139 int i;
1140
1141 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1142 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1143 &alc_beep_mixer[i]);
1144 if (!knew)
1145 return -ENOMEM;
1146 knew->private_value = beep_amp;
1147 }
1148 return 0;
1149}
84898e87 1150
6317e5eb 1151static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1152 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1153 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1154 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1155 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1156 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1157 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1158 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1159 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1160 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1161 /* denylist -- no beep available */
051c78af
TI
1162 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1163 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1164 {}
fe3eb0a7
KY
1165};
1166
1d045db9
TI
1167static inline int has_cdefine_beep(struct hda_codec *codec)
1168{
1169 struct alc_spec *spec = codec->spec;
1170 const struct snd_pci_quirk *q;
6317e5eb 1171 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1172 if (q)
1173 return q->value;
1174 return spec->cdefine.enable_pcbeep;
1175}
1176#else
fea80fae 1177#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1178#define has_cdefine_beep(codec) 0
1179#endif
84898e87 1180
1d045db9
TI
1181/* parse the BIOS configuration and set up the alc_spec */
1182/* return 1 if successful, 0 if the proper config is not found,
1183 * or a negative error code
1184 */
3e6179b8
TI
1185static int alc_parse_auto_config(struct hda_codec *codec,
1186 const hda_nid_t *ignore_nids,
1187 const hda_nid_t *ssid_nids)
1d045db9
TI
1188{
1189 struct alc_spec *spec = codec->spec;
08c189f2 1190 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1191 int err;
26f5df26 1192
53c334ad
TI
1193 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1194 spec->parse_flags);
1d045db9
TI
1195 if (err < 0)
1196 return err;
3e6179b8
TI
1197
1198 if (ssid_nids)
1199 alc_ssid_check(codec, ssid_nids);
64154835 1200
08c189f2
TI
1201 err = snd_hda_gen_parse_auto_config(codec, cfg);
1202 if (err < 0)
1203 return err;
070cff4c 1204
1d045db9 1205 return 1;
60db6b53 1206}
f6a92248 1207
3de95173
TI
1208/* common preparation job for alc_spec */
1209static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1210{
1211 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1212 int err;
1213
1214 if (!spec)
1215 return -ENOMEM;
1216 codec->spec = spec;
08c189f2
TI
1217 snd_hda_gen_spec_init(&spec->gen);
1218 spec->gen.mixer_nid = mixer_nid;
1219 spec->gen.own_eapd_ctl = 1;
1098b7c2 1220 codec->single_adc_amp = 1;
08c189f2
TI
1221 /* FIXME: do we need this for all Realtek codec models? */
1222 codec->spdif_status_reset = 1;
a6e7d0a4 1223 codec->forced_resume = 1;
225068ab 1224 codec->patch_ops = alc_patch_ops;
b837a9f5 1225 mutex_init(&spec->coef_mutex);
3de95173
TI
1226
1227 err = alc_codec_rename_from_preset(codec);
1228 if (err < 0) {
1229 kfree(spec);
1230 return err;
1231 }
1232 return 0;
1233}
1234
3e6179b8
TI
1235static int alc880_parse_auto_config(struct hda_codec *codec)
1236{
1237 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1238 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1239 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1240}
1241
ee3b2969
TI
1242/*
1243 * ALC880 fix-ups
1244 */
1245enum {
411225a0 1246 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1247 ALC880_FIXUP_GPIO2,
1248 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1249 ALC880_FIXUP_LG,
db8a38e5 1250 ALC880_FIXUP_LG_LW25,
f02aab5d 1251 ALC880_FIXUP_W810,
27e917f8 1252 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1253 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1254 ALC880_FIXUP_VOL_KNOB,
1255 ALC880_FIXUP_FUJITSU,
ba533818 1256 ALC880_FIXUP_F1734,
817de92f 1257 ALC880_FIXUP_UNIWILL,
967b88c4 1258 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1259 ALC880_FIXUP_Z71V,
487a588d 1260 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1261 ALC880_FIXUP_3ST_BASE,
1262 ALC880_FIXUP_3ST,
1263 ALC880_FIXUP_3ST_DIG,
1264 ALC880_FIXUP_5ST_BASE,
1265 ALC880_FIXUP_5ST,
1266 ALC880_FIXUP_5ST_DIG,
1267 ALC880_FIXUP_6ST_BASE,
1268 ALC880_FIXUP_6ST,
1269 ALC880_FIXUP_6ST_DIG,
5397145f 1270 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1271};
1272
cf5a2279
TI
1273/* enable the volume-knob widget support on NID 0x21 */
1274static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1275 const struct hda_fixup *fix, int action)
cf5a2279 1276{
1727a771 1277 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1278 snd_hda_jack_detect_enable_callback(codec, 0x21,
1279 alc_update_knob_master);
cf5a2279
TI
1280}
1281
1727a771 1282static const struct hda_fixup alc880_fixups[] = {
411225a0 1283 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1284 .type = HDA_FIXUP_FUNC,
1285 .v.func = alc_fixup_gpio1,
411225a0 1286 },
ee3b2969 1287 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1288 .type = HDA_FIXUP_FUNC,
1289 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1290 },
1291 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1292 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1293 .v.verbs = (const struct hda_verb[]) {
1294 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1295 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1296 { }
1297 },
1298 .chained = true,
1299 .chain_id = ALC880_FIXUP_GPIO2,
1300 },
dc6af52d 1301 [ALC880_FIXUP_LG] = {
1727a771
TI
1302 .type = HDA_FIXUP_PINS,
1303 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1304 /* disable bogus unused pins */
1305 { 0x16, 0x411111f0 },
1306 { 0x18, 0x411111f0 },
1307 { 0x1a, 0x411111f0 },
1308 { }
1309 }
1310 },
db8a38e5
TI
1311 [ALC880_FIXUP_LG_LW25] = {
1312 .type = HDA_FIXUP_PINS,
1313 .v.pins = (const struct hda_pintbl[]) {
1314 { 0x1a, 0x0181344f }, /* line-in */
1315 { 0x1b, 0x0321403f }, /* headphone */
1316 { }
1317 }
1318 },
f02aab5d 1319 [ALC880_FIXUP_W810] = {
1727a771
TI
1320 .type = HDA_FIXUP_PINS,
1321 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1322 /* disable bogus unused pins */
1323 { 0x17, 0x411111f0 },
1324 { }
1325 },
1326 .chained = true,
1327 .chain_id = ALC880_FIXUP_GPIO2,
1328 },
27e917f8 1329 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1330 .type = HDA_FIXUP_VERBS,
27e917f8
TI
1331 .v.verbs = (const struct hda_verb[]) {
1332 /* change to EAPD mode */
1333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1334 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1335 {}
1336 },
1337 },
b9368f5c 1338 [ALC880_FIXUP_TCL_S700] = {
1727a771 1339 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1340 .v.verbs = (const struct hda_verb[]) {
1341 /* change to EAPD mode */
1342 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1343 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1344 {}
1345 },
1346 .chained = true,
1347 .chain_id = ALC880_FIXUP_GPIO2,
1348 },
cf5a2279 1349 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1350 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1351 .v.func = alc880_fixup_vol_knob,
1352 },
1353 [ALC880_FIXUP_FUJITSU] = {
1354 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1355 .type = HDA_FIXUP_PINS,
1356 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1357 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1358 { 0x15, 0x99030120 }, /* speaker */
1359 { 0x16, 0x99030130 }, /* bass speaker */
1360 { 0x17, 0x411111f0 }, /* N/A */
1361 { 0x18, 0x411111f0 }, /* N/A */
1362 { 0x19, 0x01a19950 }, /* mic-in */
1363 { 0x1a, 0x411111f0 }, /* N/A */
1364 { 0x1b, 0x411111f0 }, /* N/A */
1365 { 0x1c, 0x411111f0 }, /* N/A */
1366 { 0x1d, 0x411111f0 }, /* N/A */
1367 { 0x1e, 0x01454140 }, /* SPDIF out */
1368 { }
1369 },
1370 .chained = true,
1371 .chain_id = ALC880_FIXUP_VOL_KNOB,
1372 },
ba533818
TI
1373 [ALC880_FIXUP_F1734] = {
1374 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1375 .type = HDA_FIXUP_PINS,
1376 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1377 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1378 { 0x15, 0x99030120 }, /* speaker */
1379 { 0x16, 0x411111f0 }, /* N/A */
1380 { 0x17, 0x411111f0 }, /* N/A */
1381 { 0x18, 0x411111f0 }, /* N/A */
1382 { 0x19, 0x01a19950 }, /* mic-in */
1383 { 0x1a, 0x411111f0 }, /* N/A */
1384 { 0x1b, 0x411111f0 }, /* N/A */
1385 { 0x1c, 0x411111f0 }, /* N/A */
1386 { 0x1d, 0x411111f0 }, /* N/A */
1387 { 0x1e, 0x411111f0 }, /* N/A */
1388 { }
1389 },
1390 .chained = true,
1391 .chain_id = ALC880_FIXUP_VOL_KNOB,
1392 },
817de92f
TI
1393 [ALC880_FIXUP_UNIWILL] = {
1394 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1395 .type = HDA_FIXUP_PINS,
1396 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1397 { 0x14, 0x0121411f }, /* HP */
1398 { 0x15, 0x99030120 }, /* speaker */
1399 { 0x16, 0x99030130 }, /* bass speaker */
1400 { }
1401 },
1402 },
967b88c4 1403 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1404 .type = HDA_FIXUP_PINS,
1405 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1406 /* disable bogus unused pins */
1407 { 0x17, 0x411111f0 },
1408 { 0x19, 0x411111f0 },
1409 { 0x1b, 0x411111f0 },
1410 { 0x1f, 0x411111f0 },
1411 { }
1412 }
1413 },
96e225f6 1414 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1415 .type = HDA_FIXUP_PINS,
1416 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1417 /* set up the whole pins as BIOS is utterly broken */
1418 { 0x14, 0x99030120 }, /* speaker */
1419 { 0x15, 0x0121411f }, /* HP */
1420 { 0x16, 0x411111f0 }, /* N/A */
1421 { 0x17, 0x411111f0 }, /* N/A */
1422 { 0x18, 0x01a19950 }, /* mic-in */
1423 { 0x19, 0x411111f0 }, /* N/A */
1424 { 0x1a, 0x01813031 }, /* line-in */
1425 { 0x1b, 0x411111f0 }, /* N/A */
1426 { 0x1c, 0x411111f0 }, /* N/A */
1427 { 0x1d, 0x411111f0 }, /* N/A */
1428 { 0x1e, 0x0144111e }, /* SPDIF */
1429 { }
1430 }
1431 },
487a588d
TI
1432 [ALC880_FIXUP_ASUS_W5A] = {
1433 .type = HDA_FIXUP_PINS,
1434 .v.pins = (const struct hda_pintbl[]) {
1435 /* set up the whole pins as BIOS is utterly broken */
1436 { 0x14, 0x0121411f }, /* HP */
1437 { 0x15, 0x411111f0 }, /* N/A */
1438 { 0x16, 0x411111f0 }, /* N/A */
1439 { 0x17, 0x411111f0 }, /* N/A */
1440 { 0x18, 0x90a60160 }, /* mic */
1441 { 0x19, 0x411111f0 }, /* N/A */
1442 { 0x1a, 0x411111f0 }, /* N/A */
1443 { 0x1b, 0x411111f0 }, /* N/A */
1444 { 0x1c, 0x411111f0 }, /* N/A */
1445 { 0x1d, 0x411111f0 }, /* N/A */
1446 { 0x1e, 0xb743111e }, /* SPDIF out */
1447 { }
1448 },
1449 .chained = true,
1450 .chain_id = ALC880_FIXUP_GPIO1,
1451 },
67b6ec31 1452 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1453 .type = HDA_FIXUP_PINS,
1454 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1455 { 0x14, 0x01014010 }, /* line-out */
1456 { 0x15, 0x411111f0 }, /* N/A */
1457 { 0x16, 0x411111f0 }, /* N/A */
1458 { 0x17, 0x411111f0 }, /* N/A */
1459 { 0x18, 0x01a19c30 }, /* mic-in */
1460 { 0x19, 0x0121411f }, /* HP */
1461 { 0x1a, 0x01813031 }, /* line-in */
1462 { 0x1b, 0x02a19c40 }, /* front-mic */
1463 { 0x1c, 0x411111f0 }, /* N/A */
1464 { 0x1d, 0x411111f0 }, /* N/A */
1465 /* 0x1e is filled in below */
1466 { 0x1f, 0x411111f0 }, /* N/A */
1467 { }
1468 }
1469 },
1470 [ALC880_FIXUP_3ST] = {
1727a771
TI
1471 .type = HDA_FIXUP_PINS,
1472 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1473 { 0x1e, 0x411111f0 }, /* N/A */
1474 { }
1475 },
1476 .chained = true,
1477 .chain_id = ALC880_FIXUP_3ST_BASE,
1478 },
1479 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1480 .type = HDA_FIXUP_PINS,
1481 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1482 { 0x1e, 0x0144111e }, /* SPDIF */
1483 { }
1484 },
1485 .chained = true,
1486 .chain_id = ALC880_FIXUP_3ST_BASE,
1487 },
1488 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1489 .type = HDA_FIXUP_PINS,
1490 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1491 { 0x14, 0x01014010 }, /* front */
1492 { 0x15, 0x411111f0 }, /* N/A */
1493 { 0x16, 0x01011411 }, /* CLFE */
1494 { 0x17, 0x01016412 }, /* surr */
1495 { 0x18, 0x01a19c30 }, /* mic-in */
1496 { 0x19, 0x0121411f }, /* HP */
1497 { 0x1a, 0x01813031 }, /* line-in */
1498 { 0x1b, 0x02a19c40 }, /* front-mic */
1499 { 0x1c, 0x411111f0 }, /* N/A */
1500 { 0x1d, 0x411111f0 }, /* N/A */
1501 /* 0x1e is filled in below */
1502 { 0x1f, 0x411111f0 }, /* N/A */
1503 { }
1504 }
1505 },
1506 [ALC880_FIXUP_5ST] = {
1727a771
TI
1507 .type = HDA_FIXUP_PINS,
1508 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1509 { 0x1e, 0x411111f0 }, /* N/A */
1510 { }
1511 },
1512 .chained = true,
1513 .chain_id = ALC880_FIXUP_5ST_BASE,
1514 },
1515 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1516 .type = HDA_FIXUP_PINS,
1517 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1518 { 0x1e, 0x0144111e }, /* SPDIF */
1519 { }
1520 },
1521 .chained = true,
1522 .chain_id = ALC880_FIXUP_5ST_BASE,
1523 },
1524 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1525 .type = HDA_FIXUP_PINS,
1526 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1527 { 0x14, 0x01014010 }, /* front */
1528 { 0x15, 0x01016412 }, /* surr */
1529 { 0x16, 0x01011411 }, /* CLFE */
1530 { 0x17, 0x01012414 }, /* side */
1531 { 0x18, 0x01a19c30 }, /* mic-in */
1532 { 0x19, 0x02a19c40 }, /* front-mic */
1533 { 0x1a, 0x01813031 }, /* line-in */
1534 { 0x1b, 0x0121411f }, /* HP */
1535 { 0x1c, 0x411111f0 }, /* N/A */
1536 { 0x1d, 0x411111f0 }, /* N/A */
1537 /* 0x1e is filled in below */
1538 { 0x1f, 0x411111f0 }, /* N/A */
1539 { }
1540 }
1541 },
1542 [ALC880_FIXUP_6ST] = {
1727a771
TI
1543 .type = HDA_FIXUP_PINS,
1544 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1545 { 0x1e, 0x411111f0 }, /* N/A */
1546 { }
1547 },
1548 .chained = true,
1549 .chain_id = ALC880_FIXUP_6ST_BASE,
1550 },
1551 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1552 .type = HDA_FIXUP_PINS,
1553 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1554 { 0x1e, 0x0144111e }, /* SPDIF */
1555 { }
1556 },
1557 .chained = true,
1558 .chain_id = ALC880_FIXUP_6ST_BASE,
1559 },
5397145f
TI
1560 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1561 .type = HDA_FIXUP_PINS,
1562 .v.pins = (const struct hda_pintbl[]) {
1563 { 0x1b, 0x0121401f }, /* HP with jack detect */
1564 { }
1565 },
1566 .chained_before = true,
1567 .chain_id = ALC880_FIXUP_6ST_BASE,
1568 },
ee3b2969
TI
1569};
1570
5b1913a7 1571static const struct hda_quirk alc880_fixup_tbl[] = {
f02aab5d 1572 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1573 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1574 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1575 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1576 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1577 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1578 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1579 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1580 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1581 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1582 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1583 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1584 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1585 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1586 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1587 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1588 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1589 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1590 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1591 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1592 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1593 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1594 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1595
1596 /* Below is the copied entries from alc880_quirks.c.
1597 * It's not quite sure whether BIOS sets the correct pin-config table
1598 * on these machines, thus they are kept to be compatible with
1599 * the old static quirks. Once when it's confirmed to work without
1600 * these overrides, it'd be better to remove.
1601 */
1602 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1603 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1604 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1605 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1606 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1607 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1608 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1609 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1610 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1611 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1612 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1613 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1614 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1615 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1616 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1617 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1618 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1619 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1620 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1621 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1622 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1623 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1624 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1625 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1626 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1627 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1628 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1629 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1630 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1631 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1632 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1633 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1634 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1635 /* default Intel */
1636 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1637 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1638 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1639 {}
1640};
1641
1727a771 1642static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1643 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1644 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1645 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1646 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1647 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1648 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1649 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1650 {}
1651};
1652
1653
1d045db9
TI
1654/*
1655 * OK, here we have finally the patch for ALC880
1656 */
1d045db9 1657static int patch_alc880(struct hda_codec *codec)
60db6b53 1658{
1d045db9 1659 struct alc_spec *spec;
1d045db9 1660 int err;
f6a92248 1661
3de95173
TI
1662 err = alc_alloc_spec(codec, 0x0b);
1663 if (err < 0)
1664 return err;
64154835 1665
3de95173 1666 spec = codec->spec;
08c189f2 1667 spec->gen.need_dac_fix = 1;
7504b6cd 1668 spec->gen.beep_nid = 0x01;
f53281e6 1669
225068ab
TI
1670 codec->patch_ops.unsol_event = alc880_unsol_event;
1671
c9af753f
TI
1672 alc_pre_init(codec);
1673
1727a771 1674 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1675 alc880_fixups);
1727a771 1676 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1677
67b6ec31
TI
1678 /* automatic parse from the BIOS config */
1679 err = alc880_parse_auto_config(codec);
1680 if (err < 0)
1681 goto error;
fe3eb0a7 1682
fea80fae
TI
1683 if (!spec->gen.no_analog) {
1684 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1685 if (err < 0)
1686 goto error;
1687 }
f53281e6 1688
1727a771 1689 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1690
1d045db9 1691 return 0;
e16fb6d1
TI
1692
1693 error:
1694 alc_free(codec);
1695 return err;
226b1ec8
KY
1696}
1697
1d045db9 1698
60db6b53 1699/*
1d045db9 1700 * ALC260 support
60db6b53 1701 */
1d045db9 1702static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1703{
1d045db9 1704 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1705 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1706 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1707}
1708
1d045db9
TI
1709/*
1710 * Pin config fixes
1711 */
1712enum {
ca8f0424
TI
1713 ALC260_FIXUP_HP_DC5750,
1714 ALC260_FIXUP_HP_PIN_0F,
1715 ALC260_FIXUP_COEF,
15317ab2 1716 ALC260_FIXUP_GPIO1,
20f7d928
TI
1717 ALC260_FIXUP_GPIO1_TOGGLE,
1718 ALC260_FIXUP_REPLACER,
0a1c4fa2 1719 ALC260_FIXUP_HP_B1900,
118cb4a4 1720 ALC260_FIXUP_KN1,
39aedee7 1721 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1722 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1723 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1724};
1725
20f7d928
TI
1726static void alc260_gpio1_automute(struct hda_codec *codec)
1727{
1728 struct alc_spec *spec = codec->spec;
aaf312de
TI
1729
1730 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1731}
1732
1733static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1734 const struct hda_fixup *fix, int action)
20f7d928
TI
1735{
1736 struct alc_spec *spec = codec->spec;
1727a771 1737 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1738 /* although the machine has only one output pin, we need to
1739 * toggle GPIO1 according to the jack state
1740 */
08c189f2
TI
1741 spec->gen.automute_hook = alc260_gpio1_automute;
1742 spec->gen.detect_hp = 1;
1743 spec->gen.automute_speaker = 1;
1744 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1745 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1746 snd_hda_gen_hp_automute);
5579cd6f 1747 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1748 }
1749}
1750
118cb4a4 1751static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1752 const struct hda_fixup *fix, int action)
118cb4a4
TI
1753{
1754 struct alc_spec *spec = codec->spec;
1727a771 1755 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1756 { 0x0f, 0x02214000 }, /* HP/speaker */
1757 { 0x12, 0x90a60160 }, /* int mic */
1758 { 0x13, 0x02a19000 }, /* ext mic */
1759 { 0x18, 0x01446000 }, /* SPDIF out */
1760 /* disable bogus I/O pins */
1761 { 0x10, 0x411111f0 },
1762 { 0x11, 0x411111f0 },
1763 { 0x14, 0x411111f0 },
1764 { 0x15, 0x411111f0 },
1765 { 0x16, 0x411111f0 },
1766 { 0x17, 0x411111f0 },
1767 { 0x19, 0x411111f0 },
1768 { }
1769 };
1770
1771 switch (action) {
1727a771
TI
1772 case HDA_FIXUP_ACT_PRE_PROBE:
1773 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1774 spec->init_amp = ALC_INIT_NONE;
1775 break;
1776 }
1777}
1778
39aedee7
TI
1779static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1780 const struct hda_fixup *fix, int action)
1781{
1782 struct alc_spec *spec = codec->spec;
1c76aa5f 1783 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1784 spec->init_amp = ALC_INIT_NONE;
1785}
39aedee7 1786
5ebd3bbd
TI
1787static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1788 const struct hda_fixup *fix, int action)
1789{
1790 struct alc_spec *spec = codec->spec;
1791 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1792 spec->gen.add_jack_modes = 1;
5ebd3bbd 1793 spec->gen.hp_mic = 1;
e6e0ee50 1794 }
39aedee7
TI
1795}
1796
1727a771 1797static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1798 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1799 .type = HDA_FIXUP_PINS,
1800 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1801 { 0x11, 0x90130110 }, /* speaker */
1802 { }
1803 }
1804 },
ca8f0424 1805 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1806 .type = HDA_FIXUP_PINS,
1807 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1808 { 0x0f, 0x01214000 }, /* HP */
1809 { }
1810 }
1811 },
1812 [ALC260_FIXUP_COEF] = {
1727a771 1813 .type = HDA_FIXUP_VERBS,
ca8f0424 1814 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1815 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1816 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1817 { }
1818 },
ca8f0424 1819 },
15317ab2 1820 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1821 .type = HDA_FIXUP_FUNC,
1822 .v.func = alc_fixup_gpio1,
15317ab2 1823 },
20f7d928 1824 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1825 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1826 .v.func = alc260_fixup_gpio1_toggle,
1827 .chained = true,
1828 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1829 },
1830 [ALC260_FIXUP_REPLACER] = {
1727a771 1831 .type = HDA_FIXUP_VERBS,
20f7d928 1832 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1833 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1834 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1835 { }
1836 },
1837 .chained = true,
1838 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1839 },
0a1c4fa2 1840 [ALC260_FIXUP_HP_B1900] = {
1727a771 1841 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1842 .v.func = alc260_fixup_gpio1_toggle,
1843 .chained = true,
1844 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1845 },
1846 [ALC260_FIXUP_KN1] = {
1727a771 1847 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1848 .v.func = alc260_fixup_kn1,
1849 },
39aedee7
TI
1850 [ALC260_FIXUP_FSC_S7020] = {
1851 .type = HDA_FIXUP_FUNC,
1852 .v.func = alc260_fixup_fsc_s7020,
1853 },
5ebd3bbd
TI
1854 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1855 .type = HDA_FIXUP_FUNC,
1856 .v.func = alc260_fixup_fsc_s7020_jwse,
1857 .chained = true,
1858 .chain_id = ALC260_FIXUP_FSC_S7020,
1859 },
d08c5ef2
TI
1860 [ALC260_FIXUP_VAIO_PINS] = {
1861 .type = HDA_FIXUP_PINS,
1862 .v.pins = (const struct hda_pintbl[]) {
1863 /* Pin configs are missing completely on some VAIOs */
1864 { 0x0f, 0x01211020 },
1865 { 0x10, 0x0001003f },
1866 { 0x11, 0x411111f0 },
1867 { 0x12, 0x01a15930 },
1868 { 0x13, 0x411111f0 },
1869 { 0x14, 0x411111f0 },
1870 { 0x15, 0x411111f0 },
1871 { 0x16, 0x411111f0 },
1872 { 0x17, 0x411111f0 },
1873 { 0x18, 0x411111f0 },
1874 { 0x19, 0x411111f0 },
1875 { }
1876 }
1877 },
1d045db9
TI
1878};
1879
5b1913a7 1880static const struct hda_quirk alc260_fixup_tbl[] = {
15317ab2 1881 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1882 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1883 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1884 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1885 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1886 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1887 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1888 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1889 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1890 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1891 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1892 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1893 {}
1894};
1895
5ebd3bbd
TI
1896static const struct hda_model_fixup alc260_fixup_models[] = {
1897 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1898 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1899 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1900 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1901 {}
1902};
1903
1d045db9
TI
1904/*
1905 */
1d045db9 1906static int patch_alc260(struct hda_codec *codec)
977ddd6b 1907{
1d045db9 1908 struct alc_spec *spec;
c3c2c9e7 1909 int err;
1d045db9 1910
3de95173
TI
1911 err = alc_alloc_spec(codec, 0x07);
1912 if (err < 0)
1913 return err;
1d045db9 1914
3de95173 1915 spec = codec->spec;
ea46c3c8
TI
1916 /* as quite a few machines require HP amp for speaker outputs,
1917 * it's easier to enable it unconditionally; even if it's unneeded,
1918 * it's almost harmless.
1919 */
1920 spec->gen.prefer_hp_amp = 1;
7504b6cd 1921 spec->gen.beep_nid = 0x01;
1d045db9 1922
225068ab
TI
1923 spec->shutup = alc_eapd_shutup;
1924
c9af753f
TI
1925 alc_pre_init(codec);
1926
5ebd3bbd
TI
1927 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1928 alc260_fixups);
1727a771 1929 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1930
c3c2c9e7
TI
1931 /* automatic parse from the BIOS config */
1932 err = alc260_parse_auto_config(codec);
1933 if (err < 0)
1934 goto error;
977ddd6b 1935
fea80fae
TI
1936 if (!spec->gen.no_analog) {
1937 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1938 if (err < 0)
1939 goto error;
1940 }
977ddd6b 1941
1727a771 1942 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1943
1d045db9 1944 return 0;
e16fb6d1
TI
1945
1946 error:
1947 alc_free(codec);
1948 return err;
6981d184
TI
1949}
1950
1d045db9
TI
1951
1952/*
1953 * ALC882/883/885/888/889 support
1954 *
1955 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1956 * configuration. Each pin widget can choose any input DACs and a mixer.
1957 * Each ADC is connected from a mixer of all inputs. This makes possible
1958 * 6-channel independent captures.
1959 *
1960 * In addition, an independent DAC for the multi-playback (not used in this
1961 * driver yet).
1962 */
1d045db9
TI
1963
1964/*
1965 * Pin config fixes
1966 */
ff818c24 1967enum {
5c0ebfbe
TI
1968 ALC882_FIXUP_ABIT_AW9D_MAX,
1969 ALC882_FIXUP_LENOVO_Y530,
1970 ALC882_FIXUP_PB_M5210,
1971 ALC882_FIXUP_ACER_ASPIRE_7736,
1972 ALC882_FIXUP_ASUS_W90V,
8f239214 1973 ALC889_FIXUP_CD,
b2c53e20 1974 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1975 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1976 ALC888_FIXUP_EEE1601,
4841b8e6 1977 ALC886_FIXUP_EAPD,
177943a3 1978 ALC882_FIXUP_EAPD,
7a6069bf 1979 ALC883_FIXUP_EAPD,
8812c4f9 1980 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1981 ALC882_FIXUP_GPIO1,
1982 ALC882_FIXUP_GPIO2,
eb844d51 1983 ALC882_FIXUP_GPIO3,
68ef0561
TI
1984 ALC889_FIXUP_COEF,
1985 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1986 ALC882_FIXUP_ACER_ASPIRE_4930G,
1987 ALC882_FIXUP_ACER_ASPIRE_8930G,
1988 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1989 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1990 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1991 ALC889_FIXUP_MBP_VREF,
1992 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1993 ALC889_FIXUP_MBA11_VREF,
0756f09c 1994 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1995 ALC889_FIXUP_MP11_VREF,
9f660a1c 1996 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1997 ALC882_FIXUP_INV_DMIC,
e427c237 1998 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1999 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 2000 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 2001 ALC1220_FIXUP_GB_DUAL_CODECS,
c1933008 2002 ALC1220_FIXUP_GB_X570,
0202f5cd 2003 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
2004 ALC1220_FIXUP_CLEVO_PB51ED,
2005 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
2006 ALC887_FIXUP_ASUS_AUDIO,
2007 ALC887_FIXUP_ASUS_HMIC,
9bfa7b36 2008 ALCS1200A_FIXUP_MIC_VREF,
baaacbff 2009 ALC888VD_FIXUP_MIC_100VREF,
ff818c24
TI
2010};
2011
68ef0561 2012static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 2013 const struct hda_fixup *fix, int action)
68ef0561 2014{
1727a771 2015 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 2016 return;
1df8874b 2017 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
2018}
2019
5671087f
TI
2020/* set up GPIO at initialization */
2021static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 2022 const struct hda_fixup *fix, int action)
5671087f 2023{
215c850c
TI
2024 struct alc_spec *spec = codec->spec;
2025
2026 spec->gpio_write_delay = true;
2027 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
2028}
2029
02a237b2
TI
2030/* Fix the connection of some pins for ALC889:
2031 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2032 * work correctly (bko#42740)
2033 */
2034static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 2035 const struct hda_fixup *fix, int action)
02a237b2 2036{
1727a771 2037 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2038 /* fake the connections during parsing the tree */
caf3c043
MM
2039 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2040 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2041 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2042 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2043 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2044 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2045 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2046 /* restore the connections */
caf3c043
MM
2047 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2048 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2049 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2050 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2051 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2052 }
2053}
2054
1a97b7f2
TI
2055/* Set VREF on HP pin */
2056static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2057 const struct hda_fixup *fix, int action)
1a97b7f2 2058{
caf3c043 2059 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2060 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2061 int i;
2062
1727a771 2063 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2064 return;
2065 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2066 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2067 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2068 continue;
d3f02d60 2069 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2070 val |= AC_PINCTL_VREF_80;
cdd03ced 2071 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2072 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2073 break;
2074 }
2075}
2076
0756f09c
TI
2077static void alc889_fixup_mac_pins(struct hda_codec *codec,
2078 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2079{
2080 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2081 int i;
2082
0756f09c 2083 for (i = 0; i < num_nids; i++) {
1a97b7f2 2084 unsigned int val;
d3f02d60 2085 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2086 val |= AC_PINCTL_VREF_50;
cdd03ced 2087 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2088 }
08c189f2 2089 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2090}
2091
0756f09c
TI
2092/* Set VREF on speaker pins on imac91 */
2093static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2094 const struct hda_fixup *fix, int action)
2095{
caf3c043 2096 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2097
2098 if (action == HDA_FIXUP_ACT_INIT)
2099 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2100}
2101
e7729a41
AV
2102/* Set VREF on speaker pins on mba11 */
2103static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2104 const struct hda_fixup *fix, int action)
2105{
caf3c043 2106 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2107
2108 if (action == HDA_FIXUP_ACT_INIT)
2109 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2110}
2111
0756f09c
TI
2112/* Set VREF on speaker pins on mba21 */
2113static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2114 const struct hda_fixup *fix, int action)
2115{
caf3c043 2116 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2117
2118 if (action == HDA_FIXUP_ACT_INIT)
2119 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2120}
2121
e427c237 2122/* Don't take HP output as primary
d9111496
FLVC
2123 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2124 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2125 */
2126static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2127 const struct hda_fixup *fix, int action)
e427c237
TI
2128{
2129 struct alc_spec *spec = codec->spec;
da96fb5b 2130 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2131 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2132 spec->gen.no_multi_io = 1;
2133 }
e427c237
TI
2134}
2135
eb9ca3ab
TI
2136static void alc_fixup_bass_chmap(struct hda_codec *codec,
2137 const struct hda_fixup *fix, int action);
2138
7beb3a6e
TI
2139/* For dual-codec configuration, we need to disable some features to avoid
2140 * conflicts of kctls and PCM streams
2141 */
2142static void alc_fixup_dual_codecs(struct hda_codec *codec,
2143 const struct hda_fixup *fix, int action)
2144{
2145 struct alc_spec *spec = codec->spec;
2146
2147 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2148 return;
2149 /* disable vmaster */
2150 spec->gen.suppress_vmaster = 1;
2151 /* auto-mute and auto-mic switch don't work with multiple codecs */
2152 spec->gen.suppress_auto_mute = 1;
2153 spec->gen.suppress_auto_mic = 1;
2154 /* disable aamix as well */
2155 spec->gen.mixer_nid = 0;
2156 /* add location prefix to avoid conflicts */
2157 codec->force_pin_prefix = 1;
2158}
2159
2160static void rename_ctl(struct hda_codec *codec, const char *oldname,
2161 const char *newname)
2162{
2163 struct snd_kcontrol *kctl;
2164
2165 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2166 if (kctl)
b51c2253 2167 snd_ctl_rename(codec->card, kctl, newname);
7beb3a6e
TI
2168}
2169
2170static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2171 const struct hda_fixup *fix,
2172 int action)
2173{
2174 alc_fixup_dual_codecs(codec, fix, action);
2175 switch (action) {
2176 case HDA_FIXUP_ACT_PRE_PROBE:
2177 /* override card longname to provide a unique UCM profile */
2178 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2179 break;
2180 case HDA_FIXUP_ACT_BUILD:
2181 /* rename Capture controls depending on the codec */
2182 rename_ctl(codec, "Capture Volume",
2183 codec->addr == 0 ?
2184 "Rear-Panel Capture Volume" :
2185 "Front-Panel Capture Volume");
2186 rename_ctl(codec, "Capture Switch",
2187 codec->addr == 0 ?
2188 "Rear-Panel Capture Switch" :
2189 "Front-Panel Capture Switch");
2190 break;
2191 }
2192}
2193
c1933008
CL
2194static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2195 const struct hda_fixup *fix,
2196 int action)
2197{
2198 static const hda_nid_t conn1[] = { 0x0c };
2199 static const struct coef_fw gb_x570_coefs[] = {
41a86013 2200 WRITE_COEF(0x07, 0x03c0),
c1933008
CL
2201 WRITE_COEF(0x1a, 0x01c1),
2202 WRITE_COEF(0x1b, 0x0202),
2203 WRITE_COEF(0x43, 0x3005),
2204 {}
2205 };
2206
2207 switch (action) {
2208 case HDA_FIXUP_ACT_PRE_PROBE:
2209 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2210 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2211 break;
2212 case HDA_FIXUP_ACT_INIT:
2213 alc_process_coef_fw(codec, gb_x570_coefs);
2214 break;
2215 }
2216}
2217
0202f5cd
P
2218static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2219 const struct hda_fixup *fix,
2220 int action)
2221{
caf3c043 2222 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2223
2224 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2225 return;
2226
2227 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2228 /* We therefore want to make sure 0x14 (front headphone) and
2229 * 0x1b (speakers) use the stereo DAC 0x02
2230 */
caf3c043
MM
2231 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2232 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2233}
2234
7f665b1c
JS
2235static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2236 const struct hda_fixup *fix, int action);
2237
80690a27 2238static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2239 const struct hda_fixup *fix,
2240 int action)
2241{
2242 alc1220_fixup_clevo_p950(codec, fix, action);
2243 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2244}
2245
ca184355
JHP
2246static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2247 struct hda_jack_callback *jack)
2248{
2249 struct alc_spec *spec = codec->spec;
2250 unsigned int vref;
2251
2252 snd_hda_gen_hp_automute(codec, jack);
2253
2254 if (spec->gen.hp_jack_present)
2255 vref = AC_PINCTL_VREF_80;
2256 else
2257 vref = AC_PINCTL_VREF_HIZ;
2258 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2259}
2260
2261static void alc887_fixup_asus_jack(struct hda_codec *codec,
2262 const struct hda_fixup *fix, int action)
2263{
2264 struct alc_spec *spec = codec->spec;
2265 if (action != HDA_FIXUP_ACT_PROBE)
2266 return;
2267 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2268 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2269}
2270
1727a771 2271static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2272 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2273 .type = HDA_FIXUP_PINS,
2274 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2275 { 0x15, 0x01080104 }, /* side */
2276 { 0x16, 0x01011012 }, /* rear */
2277 { 0x17, 0x01016011 }, /* clfe */
2785591a 2278 { }
145a902b
DH
2279 }
2280 },
5c0ebfbe 2281 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2282 .type = HDA_FIXUP_PINS,
2283 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2284 { 0x15, 0x99130112 }, /* rear int speakers */
2285 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2286 { }
2287 }
2288 },
5c0ebfbe 2289 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2290 .type = HDA_FIXUP_PINCTLS,
2291 .v.pins = (const struct hda_pintbl[]) {
2292 { 0x19, PIN_VREF50 },
357f915e
KY
2293 {}
2294 }
2295 },
5c0ebfbe 2296 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2297 .type = HDA_FIXUP_FUNC,
23d30f28 2298 .v.func = alc_fixup_sku_ignore,
6981d184 2299 },
5c0ebfbe 2300 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2301 .type = HDA_FIXUP_PINS,
2302 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2303 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2304 { }
2305 }
2306 },
8f239214 2307 [ALC889_FIXUP_CD] = {
1727a771
TI
2308 .type = HDA_FIXUP_PINS,
2309 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2310 { 0x1c, 0x993301f0 }, /* CD */
2311 { }
2312 }
2313 },
b2c53e20
DH
2314 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2315 .type = HDA_FIXUP_PINS,
2316 .v.pins = (const struct hda_pintbl[]) {
2317 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2318 { }
2319 },
2320 .chained = true,
2321 .chain_id = ALC889_FIXUP_CD,
2322 },
5c0ebfbe 2323 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2324 .type = HDA_FIXUP_PINS,
2325 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2326 { 0x17, 0x90170111 }, /* hidden surround speaker */
2327 { }
2328 }
2329 },
0e7cc2e7 2330 [ALC888_FIXUP_EEE1601] = {
1727a771 2331 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2332 .v.verbs = (const struct hda_verb[]) {
2333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2334 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2335 { }
2336 }
177943a3 2337 },
4841b8e6
PH
2338 [ALC886_FIXUP_EAPD] = {
2339 .type = HDA_FIXUP_VERBS,
2340 .v.verbs = (const struct hda_verb[]) {
2341 /* change to EAPD mode */
2342 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2343 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2344 { }
2345 }
2346 },
177943a3 2347 [ALC882_FIXUP_EAPD] = {
1727a771 2348 .type = HDA_FIXUP_VERBS,
177943a3
TI
2349 .v.verbs = (const struct hda_verb[]) {
2350 /* change to EAPD mode */
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2353 { }
2354 }
2355 },
7a6069bf 2356 [ALC883_FIXUP_EAPD] = {
1727a771 2357 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2358 .v.verbs = (const struct hda_verb[]) {
2359 /* change to EAPD mode */
2360 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2361 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2362 { }
2363 }
2364 },
8812c4f9 2365 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2366 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2367 .v.verbs = (const struct hda_verb[]) {
2368 /* eanable EAPD on Acer laptops */
2369 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2370 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2371 { }
2372 }
2373 },
1a97b7f2 2374 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2375 .type = HDA_FIXUP_FUNC,
2376 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2377 },
2378 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2379 .type = HDA_FIXUP_FUNC,
2380 .v.func = alc_fixup_gpio2,
1a97b7f2 2381 },
eb844d51 2382 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2383 .type = HDA_FIXUP_FUNC,
2384 .v.func = alc_fixup_gpio3,
eb844d51 2385 },
68ef0561 2386 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2387 .type = HDA_FIXUP_FUNC,
2388 .v.func = alc_fixup_gpio1,
68ef0561
TI
2389 .chained = true,
2390 .chain_id = ALC882_FIXUP_EAPD,
2391 },
2392 [ALC889_FIXUP_COEF] = {
1727a771 2393 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2394 .v.func = alc889_fixup_coef,
2395 },
c3e837bb 2396 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2397 .type = HDA_FIXUP_PINS,
2398 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2399 { 0x16, 0x99130111 }, /* CLFE speaker */
2400 { 0x17, 0x99130112 }, /* surround speaker */
2401 { }
038d4fef
TI
2402 },
2403 .chained = true,
2404 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2405 },
2406 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2407 .type = HDA_FIXUP_PINS,
2408 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2409 { 0x16, 0x99130111 }, /* CLFE speaker */
2410 { 0x1b, 0x99130112 }, /* surround speaker */
2411 { }
2412 },
2413 .chained = true,
2414 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2415 },
2416 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2417 /* additional init verbs for Acer Aspire 8930G */
1727a771 2418 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2419 .v.verbs = (const struct hda_verb[]) {
2420 /* Enable all DACs */
2421 /* DAC DISABLE/MUTE 1? */
2422 /* setting bits 1-5 disables DAC nids 0x02-0x06
2423 * apparently. Init=0x38 */
2424 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2425 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2426 /* DAC DISABLE/MUTE 2? */
2427 /* some bit here disables the other DACs.
2428 * Init=0x4900 */
2429 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2430 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2431 /* DMIC fix
2432 * This laptop has a stereo digital microphone.
2433 * The mics are only 1cm apart which makes the stereo
2434 * useless. However, either the mic or the ALC889
2435 * makes the signal become a difference/sum signal
2436 * instead of standard stereo, which is annoying.
2437 * So instead we flip this bit which makes the
2438 * codec replicate the sum signal to both channels,
2439 * turning it into a normal mono mic.
2440 */
2441 /* DMIC_CONTROL? Init value = 0x0001 */
2442 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2443 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2444 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2445 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2446 { }
038d4fef
TI
2447 },
2448 .chained = true,
2449 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2450 },
5671087f 2451 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2452 .type = HDA_FIXUP_FUNC,
5671087f
TI
2453 .v.func = alc885_fixup_macpro_gpio,
2454 },
02a237b2 2455 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2456 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2457 .v.func = alc889_fixup_dac_route,
2458 },
1a97b7f2 2459 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2460 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2461 .v.func = alc889_fixup_mbp_vref,
2462 .chained = true,
2463 .chain_id = ALC882_FIXUP_GPIO1,
2464 },
2465 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2466 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2467 .v.func = alc889_fixup_imac91_vref,
2468 .chained = true,
2469 .chain_id = ALC882_FIXUP_GPIO1,
2470 },
e7729a41
AV
2471 [ALC889_FIXUP_MBA11_VREF] = {
2472 .type = HDA_FIXUP_FUNC,
2473 .v.func = alc889_fixup_mba11_vref,
2474 .chained = true,
2475 .chain_id = ALC889_FIXUP_MBP_VREF,
2476 },
0756f09c
TI
2477 [ALC889_FIXUP_MBA21_VREF] = {
2478 .type = HDA_FIXUP_FUNC,
2479 .v.func = alc889_fixup_mba21_vref,
2480 .chained = true,
2481 .chain_id = ALC889_FIXUP_MBP_VREF,
2482 },
c20f31ec
TI
2483 [ALC889_FIXUP_MP11_VREF] = {
2484 .type = HDA_FIXUP_FUNC,
2485 .v.func = alc889_fixup_mba11_vref,
2486 .chained = true,
2487 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2488 },
9f660a1c
MK
2489 [ALC889_FIXUP_MP41_VREF] = {
2490 .type = HDA_FIXUP_FUNC,
2491 .v.func = alc889_fixup_mbp_vref,
2492 .chained = true,
2493 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2494 },
6e72aa5f 2495 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2496 .type = HDA_FIXUP_FUNC,
9d36a7dc 2497 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2498 },
e427c237 2499 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2500 .type = HDA_FIXUP_FUNC,
e427c237
TI
2501 .v.func = alc882_fixup_no_primary_hp,
2502 },
1f0bbf03
TI
2503 [ALC887_FIXUP_ASUS_BASS] = {
2504 .type = HDA_FIXUP_PINS,
2505 .v.pins = (const struct hda_pintbl[]) {
2506 {0x16, 0x99130130}, /* bass speaker */
2507 {}
2508 },
eb9ca3ab
TI
2509 .chained = true,
2510 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2511 },
2512 [ALC887_FIXUP_BASS_CHMAP] = {
2513 .type = HDA_FIXUP_FUNC,
2514 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2515 },
7beb3a6e
TI
2516 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2517 .type = HDA_FIXUP_FUNC,
2518 .v.func = alc1220_fixup_gb_dual_codecs,
2519 },
c1933008
CL
2520 [ALC1220_FIXUP_GB_X570] = {
2521 .type = HDA_FIXUP_FUNC,
2522 .v.func = alc1220_fixup_gb_x570,
2523 },
0202f5cd
P
2524 [ALC1220_FIXUP_CLEVO_P950] = {
2525 .type = HDA_FIXUP_FUNC,
2526 .v.func = alc1220_fixup_clevo_p950,
2527 },
80690a27 2528 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2529 .type = HDA_FIXUP_FUNC,
80690a27 2530 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2531 },
80690a27 2532 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2533 .type = HDA_FIXUP_PINS,
2534 .v.pins = (const struct hda_pintbl[]) {
2535 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2536 {}
2537 },
2538 .chained = true,
80690a27 2539 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2540 },
ca184355
JHP
2541 [ALC887_FIXUP_ASUS_AUDIO] = {
2542 .type = HDA_FIXUP_PINS,
2543 .v.pins = (const struct hda_pintbl[]) {
2544 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2545 { 0x19, 0x22219420 },
2546 {}
2547 },
2548 },
2549 [ALC887_FIXUP_ASUS_HMIC] = {
2550 .type = HDA_FIXUP_FUNC,
2551 .v.func = alc887_fixup_asus_jack,
2552 .chained = true,
2553 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2554 },
9bfa7b36
ML
2555 [ALCS1200A_FIXUP_MIC_VREF] = {
2556 .type = HDA_FIXUP_PINCTLS,
2557 .v.pins = (const struct hda_pintbl[]) {
2558 { 0x18, PIN_VREF50 }, /* rear mic */
2559 { 0x19, PIN_VREF50 }, /* front mic */
2560 {}
2561 }
2562 },
baaacbff
KY
2563 [ALC888VD_FIXUP_MIC_100VREF] = {
2564 .type = HDA_FIXUP_PINCTLS,
2565 .v.pins = (const struct hda_pintbl[]) {
2566 { 0x18, PIN_VREF100 }, /* headset mic */
2567 {}
2568 }
2569 },
ff818c24
TI
2570};
2571
5b1913a7 2572static const struct hda_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2573 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2574 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2575 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2576 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2577 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2578 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2579 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2580 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2581 ALC882_FIXUP_ACER_ASPIRE_4930G),
2582 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2583 ALC882_FIXUP_ACER_ASPIRE_4930G),
2584 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2585 ALC882_FIXUP_ACER_ASPIRE_8930G),
2586 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2587 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2588 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2589 ALC882_FIXUP_ACER_ASPIRE_4930G),
2590 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2591 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2592 ALC882_FIXUP_ACER_ASPIRE_4930G),
2593 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2594 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2595 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2596 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2597 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2598 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2599 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2600 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2601 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2602 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2603 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2604 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2605 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2606 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
9bfa7b36 2607 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
b7529c18
TI
2608 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2609 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2610 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2611 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2612 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2613
2614 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2615 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2616 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2617 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2618 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2619 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2620 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2621 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2622 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2623 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2624 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2625 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2626 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2627 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2628 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2629 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2630 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2631 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2632 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2633 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2634 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2635 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2636 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2637
7a6069bf 2638 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
baaacbff 2639 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
4841b8e6 2640 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2641 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2642 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
c1933008 2643 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
ea354196 2644 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
41a86013 2645 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
a0b03952 2646 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2647 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2648 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2649 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2650 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2651 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2652 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2653 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2654 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2655 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2656 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
36d4d213 2657 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2658 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
e41687b5 2659 SND_PCI_QUIRK(0x1558, 0x5802, "Clevo X58[05]WN[RST]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2660 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2661 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2662 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2663 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2664 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
9eb6f5c3 2665 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
b7a58228 2666 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
33affa7f 2667 SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2668 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2669 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2670 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
dbfe8350 2671 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
d4995121 2672 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2673 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2674 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2675 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2676 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2677 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2678 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2679 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2680 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2681 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2682 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2683 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2684 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2685 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2686 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2687 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
b7a58228 2688 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
7a6069bf
TI
2689 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2690 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2691 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2692 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2693 {}
2694};
2695
1727a771 2696static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2697 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2698 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2699 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2700 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2701 {.id = ALC889_FIXUP_CD, .name = "cd"},
2702 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2703 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2704 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2705 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2706 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2707 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2708 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2709 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2710 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2711 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2712 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2713 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2714 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2715 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2716 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2717 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2718 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2719 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2720 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2721 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2722 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2723 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2724 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2725 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2726 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
63394a16 2727 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2728 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2729 {}
2730};
2731
119b75c1
HW
2732static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2733 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2734 {0x14, 0x01014010},
2735 {0x15, 0x01011012},
2736 {0x16, 0x01016011},
2737 {0x18, 0x01a19040},
2738 {0x19, 0x02a19050},
2739 {0x1a, 0x0181304f},
2740 {0x1b, 0x0221401f},
2741 {0x1e, 0x01456130}),
2742 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2743 {0x14, 0x01015010},
2744 {0x15, 0x01011012},
2745 {0x16, 0x01011011},
2746 {0x18, 0x01a11040},
2747 {0x19, 0x02a19050},
2748 {0x1a, 0x0181104f},
2749 {0x1b, 0x0221401f},
2750 {0x1e, 0x01451130}),
2751 {}
2752};
2753
f6a92248 2754/*
1d045db9 2755 * BIOS auto configuration
f6a92248 2756 */
1d045db9
TI
2757/* almost identical with ALC880 parser... */
2758static int alc882_parse_auto_config(struct hda_codec *codec)
2759{
1d045db9 2760 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2761 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2762 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2763}
b896b4eb 2764
1d045db9
TI
2765/*
2766 */
1d045db9 2767static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2768{
2769 struct alc_spec *spec;
1a97b7f2 2770 int err;
f6a92248 2771
3de95173
TI
2772 err = alc_alloc_spec(codec, 0x0b);
2773 if (err < 0)
2774 return err;
f6a92248 2775
3de95173 2776 spec = codec->spec;
1f0f4b80 2777
7639a06c 2778 switch (codec->core.vendor_id) {
1d045db9
TI
2779 case 0x10ec0882:
2780 case 0x10ec0885:
acf08081 2781 case 0x10ec0900:
6d9ffcff 2782 case 0x10ec0b00:
a535ad57 2783 case 0x10ec1220:
1d045db9
TI
2784 break;
2785 default:
2786 /* ALC883 and variants */
2787 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2788 break;
c793bec5 2789 }
977ddd6b 2790
c9af753f
TI
2791 alc_pre_init(codec);
2792
1727a771 2793 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2794 alc882_fixups);
119b75c1 2795 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2796 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2797
1d045db9
TI
2798 alc_auto_parse_customize_define(codec);
2799
7504b6cd
TI
2800 if (has_cdefine_beep(codec))
2801 spec->gen.beep_nid = 0x01;
2802
1a97b7f2
TI
2803 /* automatic parse from the BIOS config */
2804 err = alc882_parse_auto_config(codec);
2805 if (err < 0)
2806 goto error;
f6a92248 2807
fea80fae
TI
2808 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2809 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2810 if (err < 0)
2811 goto error;
2812 }
f6a92248 2813
1727a771 2814 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2815
f6a92248 2816 return 0;
e16fb6d1
TI
2817
2818 error:
2819 alc_free(codec);
2820 return err;
f6a92248
KY
2821}
2822
df694daa 2823
df694daa 2824/*
1d045db9 2825 * ALC262 support
df694daa 2826 */
1d045db9 2827static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2828{
1d045db9 2829 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2830 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2831 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2832}
2833
df694daa 2834/*
1d045db9 2835 * Pin config fixes
df694daa 2836 */
cfc9b06f 2837enum {
ea4e7af1 2838 ALC262_FIXUP_FSC_H270,
7513e6da 2839 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2840 ALC262_FIXUP_HP_Z200,
2841 ALC262_FIXUP_TYAN,
c470150c 2842 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2843 ALC262_FIXUP_BENQ,
2844 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2845 ALC262_FIXUP_INV_DMIC,
b5c6611f 2846 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2847};
2848
1727a771 2849static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2850 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2851 .type = HDA_FIXUP_PINS,
2852 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2853 { 0x14, 0x99130110 }, /* speaker */
2854 { 0x15, 0x0221142f }, /* front HP */
2855 { 0x1b, 0x0121141f }, /* rear HP */
2856 { }
2857 }
2858 },
7513e6da
TI
2859 [ALC262_FIXUP_FSC_S7110] = {
2860 .type = HDA_FIXUP_PINS,
2861 .v.pins = (const struct hda_pintbl[]) {
2862 { 0x15, 0x90170110 }, /* speaker */
2863 { }
2864 },
2865 .chained = true,
2866 .chain_id = ALC262_FIXUP_BENQ,
2867 },
ea4e7af1 2868 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2869 .type = HDA_FIXUP_PINS,
2870 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2871 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2872 { }
2873 }
cfc9b06f 2874 },
ea4e7af1 2875 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2876 .type = HDA_FIXUP_PINS,
2877 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2878 { 0x14, 0x1993e1f0 }, /* int AUX */
2879 { }
2880 }
2881 },
c470150c 2882 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2883 .type = HDA_FIXUP_PINCTLS,
2884 .v.pins = (const struct hda_pintbl[]) {
2885 { 0x19, PIN_VREF50 },
b42590b8
TI
2886 {}
2887 },
2888 .chained = true,
2889 .chain_id = ALC262_FIXUP_BENQ,
2890 },
2891 [ALC262_FIXUP_BENQ] = {
1727a771 2892 .type = HDA_FIXUP_VERBS,
b42590b8 2893 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2894 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2895 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2896 {}
2897 }
2898 },
b42590b8 2899 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2900 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2901 .v.verbs = (const struct hda_verb[]) {
2902 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2903 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2904 {}
2905 }
2906 },
6e72aa5f 2907 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2908 .type = HDA_FIXUP_FUNC,
9d36a7dc 2909 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2910 },
b5c6611f
ML
2911 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2912 .type = HDA_FIXUP_FUNC,
2913 .v.func = alc_fixup_no_depop_delay,
2914 },
cfc9b06f
TI
2915};
2916
5b1913a7 2917static const struct hda_quirk alc262_fixup_tbl[] = {
ea4e7af1 2918 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2919 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2920 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2921 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2922 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2923 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2924 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2925 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2926 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2927 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2928 {}
2929};
df694daa 2930
1727a771 2931static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2932 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2933 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2934 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2935 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2936 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2937 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2938 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2939 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2940 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2941 {}
2942};
1d045db9 2943
1d045db9
TI
2944/*
2945 */
1d045db9 2946static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2947{
2948 struct alc_spec *spec;
df694daa
KY
2949 int err;
2950
3de95173
TI
2951 err = alc_alloc_spec(codec, 0x0b);
2952 if (err < 0)
2953 return err;
df694daa 2954
3de95173 2955 spec = codec->spec;
08c189f2 2956 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2957
225068ab
TI
2958 spec->shutup = alc_eapd_shutup;
2959
1d045db9
TI
2960#if 0
2961 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2962 * under-run
2963 */
98b24883 2964 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2965#endif
1d045db9
TI
2966 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2967
c9af753f
TI
2968 alc_pre_init(codec);
2969
1727a771 2970 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2971 alc262_fixups);
1727a771 2972 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2973
af741c15
TI
2974 alc_auto_parse_customize_define(codec);
2975
7504b6cd
TI
2976 if (has_cdefine_beep(codec))
2977 spec->gen.beep_nid = 0x01;
2978
42399f7a
TI
2979 /* automatic parse from the BIOS config */
2980 err = alc262_parse_auto_config(codec);
2981 if (err < 0)
2982 goto error;
df694daa 2983
fea80fae
TI
2984 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2985 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2986 if (err < 0)
2987 goto error;
2988 }
2134ea4f 2989
1727a771 2990 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2991
1da177e4 2992 return 0;
e16fb6d1
TI
2993
2994 error:
2995 alc_free(codec);
2996 return err;
1da177e4
LT
2997}
2998
f32610ed 2999/*
1d045db9 3000 * ALC268
f32610ed 3001 */
1d045db9 3002/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
3003static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
3004 struct snd_ctl_elem_value *ucontrol)
3005{
3006 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
3007 unsigned long pval;
3008 int err;
3009
3010 mutex_lock(&codec->control_mutex);
3011 pval = kcontrol->private_value;
3012 kcontrol->private_value = (pval & ~0xff) | 0x0f;
3013 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3014 if (err >= 0) {
3015 kcontrol->private_value = (pval & ~0xff) | 0x10;
3016 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3017 }
3018 kcontrol->private_value = pval;
3019 mutex_unlock(&codec->control_mutex);
3020 return err;
3021}
f32610ed 3022
1d045db9
TI
3023static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3024 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
3025 {
3026 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3027 .name = "Beep Playback Switch",
3028 .subdevice = HDA_SUBDEV_AMP_FLAG,
3029 .info = snd_hda_mixer_amp_switch_info,
3030 .get = snd_hda_mixer_amp_switch_get,
3031 .put = alc268_beep_switch_put,
3032 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3033 },
f32610ed
JS
3034};
3035
1d045db9
TI
3036/* set PCBEEP vol = 0, mute connections */
3037static const struct hda_verb alc268_beep_init_verbs[] = {
3038 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3039 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3040 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3041 { }
f32610ed
JS
3042};
3043
6e72aa5f
TI
3044enum {
3045 ALC268_FIXUP_INV_DMIC,
cb766404 3046 ALC268_FIXUP_HP_EAPD,
24eff328 3047 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
3048};
3049
1727a771 3050static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 3051 [ALC268_FIXUP_INV_DMIC] = {
1727a771 3052 .type = HDA_FIXUP_FUNC,
9d36a7dc 3053 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3054 },
cb766404 3055 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3056 .type = HDA_FIXUP_VERBS,
cb766404
TI
3057 .v.verbs = (const struct hda_verb[]) {
3058 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3059 {}
3060 }
3061 },
24eff328
TI
3062 [ALC268_FIXUP_SPDIF] = {
3063 .type = HDA_FIXUP_PINS,
3064 .v.pins = (const struct hda_pintbl[]) {
3065 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3066 {}
3067 }
3068 },
6e72aa5f
TI
3069};
3070
1727a771 3071static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3072 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3073 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3074 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3075 {}
3076};
3077
5b1913a7 3078static const struct hda_quirk alc268_fixup_tbl[] = {
24eff328 3079 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3080 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3081 /* below is codec SSID since multiple Toshiba laptops have the
3082 * same PCI SSID 1179:ff00
3083 */
3084 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3085 {}
3086};
3087
f32610ed
JS
3088/*
3089 * BIOS auto configuration
3090 */
1d045db9 3091static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3092{
3e6179b8 3093 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3094 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3095}
3096
1d045db9
TI
3097/*
3098 */
1d045db9 3099static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3100{
3101 struct alc_spec *spec;
a5cb463a 3102 int i, err;
f32610ed 3103
1d045db9 3104 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3105 err = alc_alloc_spec(codec, 0);
3106 if (err < 0)
3107 return err;
3108
3109 spec = codec->spec;
2722b535
TI
3110 if (has_cdefine_beep(codec))
3111 spec->gen.beep_nid = 0x01;
1f0f4b80 3112
225068ab
TI
3113 spec->shutup = alc_eapd_shutup;
3114
c9af753f
TI
3115 alc_pre_init(codec);
3116
1727a771
TI
3117 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3118 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3119
6ebb8053
TI
3120 /* automatic parse from the BIOS config */
3121 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3122 if (err < 0)
3123 goto error;
f32610ed 3124
7504b6cd
TI
3125 if (err > 0 && !spec->gen.no_analog &&
3126 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3127 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3128 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3129 &alc268_beep_mixer[i])) {
3130 err = -ENOMEM;
3131 goto error;
3132 }
3133 }
7504b6cd 3134 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3135 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3136 /* override the amp caps for beep generator */
3137 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3138 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3139 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3140 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3141 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3142 }
3143
1727a771 3144 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3145
f32610ed 3146 return 0;
e16fb6d1
TI
3147
3148 error:
3149 alc_free(codec);
3150 return err;
f32610ed
JS
3151}
3152
bc9f98a9 3153/*
1d045db9 3154 * ALC269
bc9f98a9 3155 */
08c189f2 3156
1d045db9 3157static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3158 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3159};
3160
1d045db9 3161static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3162 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3163};
291702f0 3164
1d045db9
TI
3165/* different alc269-variants */
3166enum {
3167 ALC269_TYPE_ALC269VA,
3168 ALC269_TYPE_ALC269VB,
3169 ALC269_TYPE_ALC269VC,
adcc70b2 3170 ALC269_TYPE_ALC269VD,
065380f0
KY
3171 ALC269_TYPE_ALC280,
3172 ALC269_TYPE_ALC282,
2af02be7 3173 ALC269_TYPE_ALC283,
065380f0 3174 ALC269_TYPE_ALC284,
4731d5de 3175 ALC269_TYPE_ALC293,
7fc7d047 3176 ALC269_TYPE_ALC286,
506b62c3 3177 ALC269_TYPE_ALC298,
1d04c9de 3178 ALC269_TYPE_ALC255,
4344aec8 3179 ALC269_TYPE_ALC256,
f429e7e4 3180 ALC269_TYPE_ALC257,
0a6f0600 3181 ALC269_TYPE_ALC215,
4231430d 3182 ALC269_TYPE_ALC225,
60571929 3183 ALC269_TYPE_ALC245,
99cee034 3184 ALC269_TYPE_ALC287,
dcd4f0db 3185 ALC269_TYPE_ALC294,
1078bef0 3186 ALC269_TYPE_ALC300,
f0778871 3187 ALC269_TYPE_ALC623,
6fbae35a 3188 ALC269_TYPE_ALC700,
bc9f98a9
KY
3189};
3190
3191/*
1d045db9 3192 * BIOS auto configuration
bc9f98a9 3193 */
1d045db9
TI
3194static int alc269_parse_auto_config(struct hda_codec *codec)
3195{
1d045db9 3196 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3197 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3198 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3199 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3200 const hda_nid_t *ssids;
3201
3202 switch (spec->codec_variant) {
3203 case ALC269_TYPE_ALC269VA:
3204 case ALC269_TYPE_ALC269VC:
065380f0
KY
3205 case ALC269_TYPE_ALC280:
3206 case ALC269_TYPE_ALC284:
4731d5de 3207 case ALC269_TYPE_ALC293:
adcc70b2
KY
3208 ssids = alc269va_ssids;
3209 break;
3210 case ALC269_TYPE_ALC269VB:
3211 case ALC269_TYPE_ALC269VD:
065380f0 3212 case ALC269_TYPE_ALC282:
2af02be7 3213 case ALC269_TYPE_ALC283:
7fc7d047 3214 case ALC269_TYPE_ALC286:
506b62c3 3215 case ALC269_TYPE_ALC298:
1d04c9de 3216 case ALC269_TYPE_ALC255:
4344aec8 3217 case ALC269_TYPE_ALC256:
f429e7e4 3218 case ALC269_TYPE_ALC257:
0a6f0600 3219 case ALC269_TYPE_ALC215:
4231430d 3220 case ALC269_TYPE_ALC225:
60571929 3221 case ALC269_TYPE_ALC245:
99cee034 3222 case ALC269_TYPE_ALC287:
dcd4f0db 3223 case ALC269_TYPE_ALC294:
1078bef0 3224 case ALC269_TYPE_ALC300:
f0778871 3225 case ALC269_TYPE_ALC623:
6fbae35a 3226 case ALC269_TYPE_ALC700:
adcc70b2
KY
3227 ssids = alc269_ssids;
3228 break;
3229 default:
3230 ssids = alc269_ssids;
3231 break;
3232 }
bc9f98a9 3233
3e6179b8 3234 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3235}
bc9f98a9 3236
476c02e0
HW
3237static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3238 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3239 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3240 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3241 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3242 {}
3243};
3244
3245static void alc_headset_btn_callback(struct hda_codec *codec,
3246 struct hda_jack_callback *jack)
3247{
3248 int report = 0;
3249
3250 if (jack->unsol_res & (7 << 13))
3251 report |= SND_JACK_BTN_0;
3252
3253 if (jack->unsol_res & (1 << 16 | 3 << 8))
3254 report |= SND_JACK_BTN_1;
3255
3256 /* Volume up key */
3257 if (jack->unsol_res & (7 << 23))
3258 report |= SND_JACK_BTN_2;
3259
3260 /* Volume down key */
3261 if (jack->unsol_res & (7 << 10))
3262 report |= SND_JACK_BTN_3;
3263
04f7791b 3264 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3265}
3266
3267static void alc_disable_headset_jack_key(struct hda_codec *codec)
3268{
3269 struct alc_spec *spec = codec->spec;
3270
3271 if (!spec->has_hs_key)
3272 return;
3273
3274 switch (codec->core.vendor_id) {
3275 case 0x10ec0215:
3276 case 0x10ec0225:
3277 case 0x10ec0285:
c72b9bfe 3278 case 0x10ec0287:
476c02e0
HW
3279 case 0x10ec0295:
3280 case 0x10ec0289:
3281 case 0x10ec0299:
3282 alc_write_coef_idx(codec, 0x48, 0x0);
3283 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3284 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3285 break;
1948fc06 3286 case 0x10ec0230:
476c02e0
HW
3287 case 0x10ec0236:
3288 case 0x10ec0256:
cae2bdb5 3289 case 0x10ec0257:
527f4643 3290 case 0x19e58326:
476c02e0
HW
3291 alc_write_coef_idx(codec, 0x48, 0x0);
3292 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3293 break;
3294 }
3295}
3296
3297static void alc_enable_headset_jack_key(struct hda_codec *codec)
3298{
3299 struct alc_spec *spec = codec->spec;
3300
3301 if (!spec->has_hs_key)
3302 return;
3303
3304 switch (codec->core.vendor_id) {
3305 case 0x10ec0215:
3306 case 0x10ec0225:
3307 case 0x10ec0285:
c72b9bfe 3308 case 0x10ec0287:
476c02e0
HW
3309 case 0x10ec0295:
3310 case 0x10ec0289:
3311 case 0x10ec0299:
3312 alc_write_coef_idx(codec, 0x48, 0xd011);
3313 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3314 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3315 break;
1948fc06 3316 case 0x10ec0230:
476c02e0
HW
3317 case 0x10ec0236:
3318 case 0x10ec0256:
cae2bdb5 3319 case 0x10ec0257:
527f4643 3320 case 0x19e58326:
476c02e0
HW
3321 alc_write_coef_idx(codec, 0x48, 0xd011);
3322 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3323 break;
3324 }
3325}
3326
3327static void alc_fixup_headset_jack(struct hda_codec *codec,
3328 const struct hda_fixup *fix, int action)
3329{
3330 struct alc_spec *spec = codec->spec;
04f7791b 3331 hda_nid_t hp_pin;
476c02e0
HW
3332
3333 switch (action) {
3334 case HDA_FIXUP_ACT_PRE_PROBE:
3335 spec->has_hs_key = 1;
3336 snd_hda_jack_detect_enable_callback(codec, 0x55,
3337 alc_headset_btn_callback);
476c02e0 3338 break;
04f7791b
HW
3339 case HDA_FIXUP_ACT_BUILD:
3340 hp_pin = alc_get_hp_pin(spec);
3341 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3342 alc_headset_btn_keymap,
3343 hp_pin))
3344 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3345 false, SND_JACK_HEADSET,
3346 alc_headset_btn_keymap);
3347
476c02e0
HW
3348 alc_enable_headset_jack_key(codec);
3349 break;
3350 }
3351}
3352
1387e2d1 3353static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3354{
98b24883 3355 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3356}
291702f0 3357
1d045db9
TI
3358static void alc269_shutup(struct hda_codec *codec)
3359{
adcc70b2
KY
3360 struct alc_spec *spec = codec->spec;
3361
1387e2d1
KY
3362 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3363 alc269vb_toggle_power_output(codec, 0);
3364 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3365 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3366 msleep(150);
3367 }
c0ca5ece 3368 alc_shutup_pins(codec);
1d045db9 3369}
291702f0 3370
6b0f95c4 3371static const struct coef_fw alc282_coefs[] = {
54db6c39 3372 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3373 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3374 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3375 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3376 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3377 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3378 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3379 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3380 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3381 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3382 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3383 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3384 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3385 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3386 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3387 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3388 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3389 WRITE_COEF(0x63, 0x2902), /* PLL */
3390 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3391 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3392 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3393 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3394 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3395 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3396 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3397 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3398 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3399 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3400 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3401 {}
3402};
3403
cb149cb3
KY
3404static void alc282_restore_default_value(struct hda_codec *codec)
3405{
54db6c39 3406 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3407}
3408
7b5c7a02
KY
3409static void alc282_init(struct hda_codec *codec)
3410{
3411 struct alc_spec *spec = codec->spec;
35a39f98 3412 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3413 bool hp_pin_sense;
3414 int coef78;
3415
cb149cb3
KY
3416 alc282_restore_default_value(codec);
3417
7b5c7a02
KY
3418 if (!hp_pin)
3419 return;
3420 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3421 coef78 = alc_read_coef_idx(codec, 0x78);
3422
3423 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3424 /* Headphone capless set to high power mode */
3425 alc_write_coef_idx(codec, 0x78, 0x9004);
3426
3427 if (hp_pin_sense)
3428 msleep(2);
3429
3430 snd_hda_codec_write(codec, hp_pin, 0,
3431 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3432
3433 if (hp_pin_sense)
3434 msleep(85);
3435
3436 snd_hda_codec_write(codec, hp_pin, 0,
3437 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3438
3439 if (hp_pin_sense)
3440 msleep(100);
3441
3442 /* Headphone capless set to normal mode */
3443 alc_write_coef_idx(codec, 0x78, coef78);
3444}
3445
3446static void alc282_shutup(struct hda_codec *codec)
3447{
3448 struct alc_spec *spec = codec->spec;
35a39f98 3449 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3450 bool hp_pin_sense;
3451 int coef78;
3452
3453 if (!hp_pin) {
3454 alc269_shutup(codec);
3455 return;
3456 }
3457
3458 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3459 coef78 = alc_read_coef_idx(codec, 0x78);
3460 alc_write_coef_idx(codec, 0x78, 0x9004);
3461
3462 if (hp_pin_sense)
3463 msleep(2);
3464
3465 snd_hda_codec_write(codec, hp_pin, 0,
3466 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3467
3468 if (hp_pin_sense)
3469 msleep(85);
3470
c0ca5ece
TI
3471 if (!spec->no_shutup_pins)
3472 snd_hda_codec_write(codec, hp_pin, 0,
3473 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3474
3475 if (hp_pin_sense)
3476 msleep(100);
3477
3478 alc_auto_setup_eapd(codec, false);
c0ca5ece 3479 alc_shutup_pins(codec);
7b5c7a02
KY
3480 alc_write_coef_idx(codec, 0x78, coef78);
3481}
3482
6b0f95c4 3483static const struct coef_fw alc283_coefs[] = {
54db6c39 3484 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3485 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3486 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3487 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3488 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3489 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3490 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3491 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3492 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3493 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3494 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3495 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3496 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3497 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3498 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3499 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3500 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3501 WRITE_COEF(0x2e, 0x2902), /* PLL */
3502 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3503 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3504 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3505 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3506 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3507 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3508 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3509 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3510 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3511 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3512 WRITE_COEF(0x49, 0x0), /* test mode */
3513 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3514 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3515 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3516 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3517 {}
3518};
3519
6bd55b04
KY
3520static void alc283_restore_default_value(struct hda_codec *codec)
3521{
54db6c39 3522 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3523}
3524
2af02be7
KY
3525static void alc283_init(struct hda_codec *codec)
3526{
3527 struct alc_spec *spec = codec->spec;
35a39f98 3528 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3529 bool hp_pin_sense;
2af02be7 3530
6bd55b04
KY
3531 alc283_restore_default_value(codec);
3532
2af02be7
KY
3533 if (!hp_pin)
3534 return;
a59d7199
KY
3535
3536 msleep(30);
2af02be7
KY
3537 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3538
3539 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3540 /* Headphone capless set to high power mode */
3541 alc_write_coef_idx(codec, 0x43, 0x9004);
3542
3543 snd_hda_codec_write(codec, hp_pin, 0,
3544 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3545
3546 if (hp_pin_sense)
3547 msleep(85);
3548
3549 snd_hda_codec_write(codec, hp_pin, 0,
3550 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3551
3552 if (hp_pin_sense)
3553 msleep(85);
3554 /* Index 0x46 Combo jack auto switch control 2 */
3555 /* 3k pull low control for Headset jack. */
98b24883 3556 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3557 /* Headphone capless set to normal mode */
3558 alc_write_coef_idx(codec, 0x43, 0x9614);
3559}
3560
3561static void alc283_shutup(struct hda_codec *codec)
3562{
3563 struct alc_spec *spec = codec->spec;
35a39f98 3564 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3565 bool hp_pin_sense;
2af02be7
KY
3566
3567 if (!hp_pin) {
3568 alc269_shutup(codec);
3569 return;
3570 }
3571
3572 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3573
3574 alc_write_coef_idx(codec, 0x43, 0x9004);
3575
b450b17c
HP
3576 /*depop hp during suspend*/
3577 alc_write_coef_idx(codec, 0x06, 0x2100);
3578
2af02be7
KY
3579 snd_hda_codec_write(codec, hp_pin, 0,
3580 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3581
3582 if (hp_pin_sense)
88011c09 3583 msleep(100);
2af02be7 3584
c0ca5ece
TI
3585 if (!spec->no_shutup_pins)
3586 snd_hda_codec_write(codec, hp_pin, 0,
3587 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3588
98b24883 3589 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3590
3591 if (hp_pin_sense)
88011c09 3592 msleep(100);
0435b3ff 3593 alc_auto_setup_eapd(codec, false);
c0ca5ece 3594 alc_shutup_pins(codec);
2af02be7
KY
3595 alc_write_coef_idx(codec, 0x43, 0x9614);
3596}
3597
4a219ef8
KY
3598static void alc256_init(struct hda_codec *codec)
3599{
3600 struct alc_spec *spec = codec->spec;
35a39f98 3601 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3602 bool hp_pin_sense;
3603
1f680609
YY
3604 if (spec->ultra_low_power) {
3605 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3606 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3607 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3608 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3609 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3610 msleep(30);
3611 }
3612
4a219ef8 3613 if (!hp_pin)
6447c962 3614 hp_pin = 0x21;
4a219ef8
KY
3615
3616 msleep(30);
3617
3618 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3619
cc3d0b5d 3620 if (hp_pin_sense) {
4a219ef8 3621 msleep(2);
cc3d0b5d 3622 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
4a219ef8 3623
cc3d0b5d 3624 snd_hda_codec_write(codec, hp_pin, 0,
4a219ef8
KY
3625 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3626
cc3d0b5d 3627 msleep(75);
4a219ef8 3628
cc3d0b5d
KY
3629 snd_hda_codec_write(codec, hp_pin, 0,
3630 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3631
3632 msleep(75);
3633 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3634 }
4a219ef8 3635 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
88d42b2b
KY
3636 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3637 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3638 /*
3639 * Expose headphone mic (or possibly Line In on some machines) instead
3640 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3641 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3642 * this register.
3643 */
3644 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3645}
3646
3647static void alc256_shutup(struct hda_codec *codec)
3648{
3649 struct alc_spec *spec = codec->spec;
35a39f98 3650 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3651 bool hp_pin_sense;
3652
6447c962
KY
3653 if (!hp_pin)
3654 hp_pin = 0x21;
4a219ef8 3655
69ea4c9d 3656 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
4a219ef8
KY
3657 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3658
cc3d0b5d 3659 if (hp_pin_sense) {
4a219ef8
KY
3660 msleep(2);
3661
cc3d0b5d 3662 snd_hda_codec_write(codec, hp_pin, 0,
4a219ef8
KY
3663 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3664
cc3d0b5d 3665 msleep(75);
4a219ef8 3666
1c9609e3
TI
3667 /* 3k pull low control for Headset jack. */
3668 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3669 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3670 * when booting with headset plugged. So skip setting it for the codec alc257
3671 */
cc3d0b5d
KY
3672 if (spec->en_3kpull_low)
3673 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3674
cc3d0b5d
KY
3675 if (!spec->no_shutup_pins)
3676 snd_hda_codec_write(codec, hp_pin, 0,
c0ca5ece 3677 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3678
cc3d0b5d
KY
3679 msleep(75);
3680 }
4a219ef8
KY
3681
3682 alc_auto_setup_eapd(codec, false);
c0ca5ece 3683 alc_shutup_pins(codec);
6447c962
KY
3684 if (spec->ultra_low_power) {
3685 msleep(50);
3686 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3687 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3688 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3689 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3690 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3691 msleep(30);
3692 }
4a219ef8
KY
3693}
3694
3c24e483
KY
3695static void alc285_hp_init(struct hda_codec *codec)
3696{
3697 struct alc_spec *spec = codec->spec;
3698 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3699 int i, val;
3700 int coef38, coef0d, coef36;
3701
b34bf658 3702 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3c24e483
KY
3703 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3704 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3705 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3706 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3707 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3708 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3709
3710 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3711
3712 if (hp_pin)
3713 snd_hda_codec_write(codec, hp_pin, 0,
3714 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3715
3716 msleep(130);
3717 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3718 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3719
3720 if (hp_pin)
3721 snd_hda_codec_write(codec, hp_pin, 0,
3722 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3723 msleep(10);
3724 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3725 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3726 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3727 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3728
3729 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3730 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3731 for (i = 0; i < 20 && val & 0x8000; i++) {
3732 msleep(50);
3733 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3734 } /* Wait for depop procedure finish */
3735
3736 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3737 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3738 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3739 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3740
3741 msleep(50);
3742 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3743}
3744
da911b1f
KY
3745static void alc225_init(struct hda_codec *codec)
3746{
3747 struct alc_spec *spec = codec->spec;
35a39f98 3748 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3749 bool hp1_pin_sense, hp2_pin_sense;
3750
1f680609
YY
3751 if (spec->ultra_low_power) {
3752 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3753 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3754 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3755 msleep(30);
3756 }
3757
60571929
KY
3758 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3759 spec->codec_variant != ALC269_TYPE_ALC245)
3c24e483
KY
3760 /* required only at boot or S3 and S4 resume time */
3761 if (!spec->done_hp_init ||
3762 is_s3_resume(codec) ||
3763 is_s4_resume(codec)) {
3764 alc285_hp_init(codec);
3765 spec->done_hp_init = true;
3766 }
3767
da911b1f 3768 if (!hp_pin)
d3ba58bb 3769 hp_pin = 0x21;
da911b1f
KY
3770 msleep(30);
3771
3772 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3773 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3774
1fd50509 3775 if (hp1_pin_sense || hp2_pin_sense) {
da911b1f 3776 msleep(2);
1fd50509 3777 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
da911b1f 3778
1fd50509
KY
3779 if (hp1_pin_sense)
3780 snd_hda_codec_write(codec, hp_pin, 0,
3781 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3782 if (hp2_pin_sense)
3783 snd_hda_codec_write(codec, 0x16, 0,
3784 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3785 msleep(75);
da911b1f 3786
1fd50509
KY
3787 if (hp1_pin_sense)
3788 snd_hda_codec_write(codec, hp_pin, 0,
3789 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3790 if (hp2_pin_sense)
3791 snd_hda_codec_write(codec, 0x16, 0,
3792 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
da911b1f 3793
1fd50509 3794 msleep(75);
174448ba 3795 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
1fd50509
KY
3796 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3797 }
da911b1f
KY
3798}
3799
3800static void alc225_shutup(struct hda_codec *codec)
3801{
3802 struct alc_spec *spec = codec->spec;
35a39f98 3803 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3804 bool hp1_pin_sense, hp2_pin_sense;
3805
d3ba58bb
KY
3806 if (!hp_pin)
3807 hp_pin = 0x21;
476c02e0 3808
da911b1f
KY
3809 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3810 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3811
1fd50509
KY
3812 if (hp1_pin_sense || hp2_pin_sense) {
3813 alc_disable_headset_jack_key(codec);
3814 /* 3k pull low control for Headset jack. */
3815 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
da911b1f
KY
3816 msleep(2);
3817
1fd50509
KY
3818 if (hp1_pin_sense)
3819 snd_hda_codec_write(codec, hp_pin, 0,
3820 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3821 if (hp2_pin_sense)
3822 snd_hda_codec_write(codec, 0x16, 0,
3823 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
da911b1f 3824
1fd50509 3825 msleep(75);
da911b1f 3826
1fd50509
KY
3827 if (hp1_pin_sense)
3828 snd_hda_codec_write(codec, hp_pin, 0,
3829 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3830 if (hp2_pin_sense)
3831 snd_hda_codec_write(codec, 0x16, 0,
3832 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
da911b1f 3833
1fd50509
KY
3834 msleep(75);
3835 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3836 alc_enable_headset_jack_key(codec);
3837 }
da911b1f 3838 alc_auto_setup_eapd(codec, false);
c0ca5ece 3839 alc_shutup_pins(codec);
d3ba58bb
KY
3840 if (spec->ultra_low_power) {
3841 msleep(50);
3842 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3843 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3844 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3845 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3846 msleep(30);
3847 }
da911b1f
KY
3848}
3849
ca0dedaf
KY
3850static void alc222_init(struct hda_codec *codec)
3851{
3852 struct alc_spec *spec = codec->spec;
3853 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3854 bool hp1_pin_sense, hp2_pin_sense;
3855
3856 if (!hp_pin)
3857 return;
3858
3859 msleep(30);
3860
3861 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3862 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
3863
3864 if (hp1_pin_sense || hp2_pin_sense) {
3865 msleep(2);
3866
3867 if (hp1_pin_sense)
3868 snd_hda_codec_write(codec, hp_pin, 0,
3869 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3870 if (hp2_pin_sense)
3871 snd_hda_codec_write(codec, 0x14, 0,
3872 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3873 msleep(75);
3874
3875 if (hp1_pin_sense)
3876 snd_hda_codec_write(codec, hp_pin, 0,
3877 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3878 if (hp2_pin_sense)
3879 snd_hda_codec_write(codec, 0x14, 0,
3880 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3881
3882 msleep(75);
3883 }
3884}
3885
3886static void alc222_shutup(struct hda_codec *codec)
3887{
3888 struct alc_spec *spec = codec->spec;
3889 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3890 bool hp1_pin_sense, hp2_pin_sense;
3891
3892 if (!hp_pin)
3893 hp_pin = 0x21;
3894
3895 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3896 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
3897
3898 if (hp1_pin_sense || hp2_pin_sense) {
3899 msleep(2);
3900
3901 if (hp1_pin_sense)
3902 snd_hda_codec_write(codec, hp_pin, 0,
3903 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3904 if (hp2_pin_sense)
3905 snd_hda_codec_write(codec, 0x14, 0,
3906 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3907
3908 msleep(75);
3909
3910 if (hp1_pin_sense)
3911 snd_hda_codec_write(codec, hp_pin, 0,
3912 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3913 if (hp2_pin_sense)
3914 snd_hda_codec_write(codec, 0x14, 0,
3915 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3916
3917 msleep(75);
3918 }
3919 alc_auto_setup_eapd(codec, false);
3920 alc_shutup_pins(codec);
3921}
3922
c2d6af53
KY
3923static void alc_default_init(struct hda_codec *codec)
3924{
3925 struct alc_spec *spec = codec->spec;
35a39f98 3926 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3927 bool hp_pin_sense;
3928
3929 if (!hp_pin)
3930 return;
3931
3932 msleep(30);
3933
3934 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3935
e3ea2757 3936 if (hp_pin_sense) {
c2d6af53
KY
3937 msleep(2);
3938
e3ea2757
KY
3939 snd_hda_codec_write(codec, hp_pin, 0,
3940 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
c2d6af53 3941
e3ea2757 3942 msleep(75);
c2d6af53 3943
e3ea2757
KY
3944 snd_hda_codec_write(codec, hp_pin, 0,
3945 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3946 msleep(75);
3947 }
c2d6af53
KY
3948}
3949
3950static void alc_default_shutup(struct hda_codec *codec)
3951{
3952 struct alc_spec *spec = codec->spec;
35a39f98 3953 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3954 bool hp_pin_sense;
3955
3956 if (!hp_pin) {
3957 alc269_shutup(codec);
3958 return;
3959 }
3960
3961 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3962
e3ea2757 3963 if (hp_pin_sense) {
c2d6af53
KY
3964 msleep(2);
3965
c0ca5ece 3966 snd_hda_codec_write(codec, hp_pin, 0,
e3ea2757 3967 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
c2d6af53 3968
e3ea2757 3969 msleep(75);
c2d6af53 3970
e3ea2757
KY
3971 if (!spec->no_shutup_pins)
3972 snd_hda_codec_write(codec, hp_pin, 0,
3973 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53 3974
e3ea2757
KY
3975 msleep(75);
3976 }
c2d6af53 3977 alc_auto_setup_eapd(codec, false);
c0ca5ece 3978 alc_shutup_pins(codec);
c2d6af53
KY
3979}
3980
693abe11
KY
3981static void alc294_hp_init(struct hda_codec *codec)
3982{
3983 struct alc_spec *spec = codec->spec;
35a39f98 3984 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3985 int i, val;
3986
3987 if (!hp_pin)
3988 return;
3989
3990 snd_hda_codec_write(codec, hp_pin, 0,
3991 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3992
3993 msleep(100);
3994
c0ca5ece
TI
3995 if (!spec->no_shutup_pins)
3996 snd_hda_codec_write(codec, hp_pin, 0,
3997 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3998
3999 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
4000 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
4001
4002 /* Wait for depop procedure finish */
4003 val = alc_read_coefex_idx(codec, 0x58, 0x01);
4004 for (i = 0; i < 20 && val & 0x0080; i++) {
4005 msleep(50);
4006 val = alc_read_coefex_idx(codec, 0x58, 0x01);
4007 }
4008 /* Set HP depop to auto mode */
4009 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
4010 msleep(50);
4011}
4012
4013static void alc294_init(struct hda_codec *codec)
4014{
4015 struct alc_spec *spec = codec->spec;
4016
f6ef4e0e
TI
4017 /* required only at boot or S4 resume time */
4018 if (!spec->done_hp_init ||
4019 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
4020 alc294_hp_init(codec);
4021 spec->done_hp_init = true;
4022 }
4023 alc_default_init(codec);
4024}
4025
ad60d502
KY
4026static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
4027 unsigned int val)
4028{
4029 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
4030 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
4031 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
4032}
4033
4034static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
4035{
4036 unsigned int val;
4037
4038 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
4039 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
4040 & 0xffff;
4041 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
4042 << 16;
4043 return val;
4044}
4045
4046static void alc5505_dsp_halt(struct hda_codec *codec)
4047{
4048 unsigned int val;
4049
4050 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
4051 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
4052 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
4053 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
4054 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
4055 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
4056 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
4057 val = alc5505_coef_get(codec, 0x6220);
4058 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
4059}
4060
4061static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
4062{
4063 alc5505_coef_set(codec, 0x61b8, 0x04133302);
4064 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
4065 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
4066 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
4067 alc5505_coef_set(codec, 0x6220, 0x2002010f);
4068 alc5505_coef_set(codec, 0x880c, 0x00000004);
4069}
4070
4071static void alc5505_dsp_init(struct hda_codec *codec)
4072{
4073 unsigned int val;
4074
4075 alc5505_dsp_halt(codec);
4076 alc5505_dsp_back_from_halt(codec);
4077 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4078 alc5505_coef_set(codec, 0x61b0, 0x5b16);
4079 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4080 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4081 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4082 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4083 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4084 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4085 alc5505_coef_set(codec, 0x61b8, 0x04173302);
4086 alc5505_coef_set(codec, 0x61b8, 0x04163302);
4087 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4088 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4089 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4090
4091 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4092 if (val <= 3)
4093 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4094 else
4095 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4096
4097 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4098 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4099 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4100 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4101 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4102 alc5505_coef_set(codec, 0x880c, 0x00000003);
4103 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
4104
4105#ifdef HALT_REALTEK_ALC5505
4106 alc5505_dsp_halt(codec);
4107#endif
ad60d502
KY
4108}
4109
cd63a5ff 4110#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
4111#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4112#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
4113#else
4114#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4115#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4116#endif
4117
ad60d502
KY
4118static int alc269_suspend(struct hda_codec *codec)
4119{
4120 struct alc_spec *spec = codec->spec;
4121
4122 if (spec->has_alc5505_dsp)
cd63a5ff 4123 alc5505_dsp_suspend(codec);
1873ebd3 4124
ad60d502
KY
4125 return alc_suspend(codec);
4126}
4127
1d045db9
TI
4128static int alc269_resume(struct hda_codec *codec)
4129{
adcc70b2
KY
4130 struct alc_spec *spec = codec->spec;
4131
1387e2d1
KY
4132 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4133 alc269vb_toggle_power_output(codec, 0);
4134 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4135 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4136 msleep(150);
4137 }
8c427226 4138
1d045db9 4139 codec->patch_ops.init(codec);
f1d4e28b 4140
1387e2d1
KY
4141 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4142 alc269vb_toggle_power_output(codec, 1);
4143 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4144 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4145 msleep(200);
4146 }
f1d4e28b 4147
1a462be5 4148 snd_hda_regmap_sync(codec);
1d045db9 4149 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4150
4151 /* on some machine, the BIOS will clear the codec gpio data when enter
4152 * suspend, and won't restore the data after resume, so we restore it
4153 * in the driver.
4154 */
d261eec8
TI
4155 if (spec->gpio_data)
4156 alc_write_gpio_data(codec);
f475371a 4157
ad60d502 4158 if (spec->has_alc5505_dsp)
cd63a5ff 4159 alc5505_dsp_resume(codec);
c5177c86 4160
1d045db9
TI
4161 return 0;
4162}
f1d4e28b 4163
108cc108 4164static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4165 const struct hda_fixup *fix, int action)
108cc108
DH
4166{
4167 struct alc_spec *spec = codec->spec;
4168
1727a771 4169 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4170 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4171}
4172
fdcc968a
JMG
4173static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4174 const struct hda_fixup *fix,
4175 int action)
4176{
4177 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4178 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4179
4180 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4181 snd_hda_codec_set_pincfg(codec, 0x19,
4182 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4183 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4184}
4185
1d045db9 4186static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4187 const struct hda_fixup *fix, int action)
1d045db9 4188{
98b24883
TI
4189 if (action == HDA_FIXUP_ACT_INIT)
4190 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4191}
f1d4e28b 4192
7c478f03
DH
4193static void alc269_fixup_headset_mic(struct hda_codec *codec,
4194 const struct hda_fixup *fix, int action)
4195{
4196 struct alc_spec *spec = codec->spec;
4197
4198 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4199 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4200}
4201
1d045db9 4202static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4203 const struct hda_fixup *fix, int action)
1d045db9
TI
4204{
4205 static const struct hda_verb verbs[] = {
4206 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4207 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4208 {}
4209 };
4210 unsigned int cfg;
f1d4e28b 4211
7639a06c
TI
4212 if (strcmp(codec->core.chip_name, "ALC271X") &&
4213 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4214 return;
4215 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4216 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4217 snd_hda_sequence_write(codec, verbs);
4218}
f1d4e28b 4219
c8426b27
TI
4220/* Fix the speaker amp after resume, etc */
4221static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4222 const struct hda_fixup *fix,
4223 int action)
4224{
4225 if (action == HDA_FIXUP_ACT_INIT)
4226 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4227}
4228
017f2a10 4229static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4230 const struct hda_fixup *fix, int action)
017f2a10
TI
4231{
4232 struct alc_spec *spec = codec->spec;
4233
1727a771 4234 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4235 return;
4236
4237 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4238 * fix the sample rate of analog I/O to 44.1kHz
4239 */
08c189f2
TI
4240 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4241 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4242}
4243
adabb3ec 4244static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4245 const struct hda_fixup *fix, int action)
adabb3ec 4246{
adabb3ec
TI
4247 /* The digital-mic unit sends PDM (differential signal) instead of
4248 * the standard PCM, thus you can't record a valid mono stream as is.
4249 * Below is a workaround specific to ALC269 to control the dmic
4250 * signal source as mono.
4251 */
98b24883
TI
4252 if (action == HDA_FIXUP_ACT_INIT)
4253 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4254}
4255
24519911
TI
4256static void alc269_quanta_automute(struct hda_codec *codec)
4257{
08c189f2 4258 snd_hda_gen_update_outputs(codec);
24519911 4259
1687ccc8
TI
4260 alc_write_coef_idx(codec, 0x0c, 0x680);
4261 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4262}
4263
4264static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4265 const struct hda_fixup *fix, int action)
24519911
TI
4266{
4267 struct alc_spec *spec = codec->spec;
1727a771 4268 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4269 return;
08c189f2 4270 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4271}
4272
d240d1dc 4273static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4274 struct hda_jack_callback *jack)
d240d1dc
DH
4275{
4276 struct alc_spec *spec = codec->spec;
4277 int vref;
4278 msleep(200);
4279 snd_hda_gen_hp_automute(codec, jack);
4280
4281 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4282 msleep(100);
4283 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4284 vref);
4285 msleep(500);
4286 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4287 vref);
4288}
4289
a2ef03fe
TE
4290/*
4291 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4292 */
4293struct hda_alc298_mbxinit {
4294 unsigned char value_0x23;
4295 unsigned char value_0x25;
4296};
4297
4298static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4299 const struct hda_alc298_mbxinit *initval,
4300 bool first)
4301{
4302 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4303 alc_write_coef_idx(codec, 0x26, 0xb000);
4304
4305 if (first)
4306 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4307
4308 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4309 alc_write_coef_idx(codec, 0x26, 0xf000);
4310 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4311
4312 if (initval->value_0x23 != 0x1e)
4313 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4314
4315 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4316 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4317}
4318
4319static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4320 const struct hda_fixup *fix,
4321 int action)
4322{
4323 /* Initialization magic */
4324 static const struct hda_alc298_mbxinit dac_init[] = {
4325 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4326 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4327 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4328 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4329 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4330 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4331 {0x2f, 0x00},
4332 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4333 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4334 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4335 {}
4336 };
4337 const struct hda_alc298_mbxinit *seq;
4338
4339 if (action != HDA_FIXUP_ACT_INIT)
4340 return;
4341
4342 /* Start */
4343 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4344 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4345 alc_write_coef_idx(codec, 0x26, 0xf000);
4346 alc_write_coef_idx(codec, 0x22, 0x31);
4347 alc_write_coef_idx(codec, 0x23, 0x0b);
4348 alc_write_coef_idx(codec, 0x25, 0x00);
4349 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4350 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4351
4352 for (seq = dac_init; seq->value_0x23; seq++)
4353 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4354}
4355
d240d1dc
DH
4356static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4357 const struct hda_fixup *fix, int action)
4358{
4359 struct alc_spec *spec = codec->spec;
4360 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4361 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4362 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4363 }
4364}
4365
766538ac
TI
4366static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4367 bool polarity, bool on)
4368{
4369 unsigned int pinval;
4370
4371 if (!pin)
4372 return;
4373 if (polarity)
4374 on = !on;
4375 pinval = snd_hda_codec_get_pin_target(codec, pin);
4376 pinval &= ~AC_PINCTL_VREFEN;
4377 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4378 /* temporarily power up/down for setting VREF */
4379 snd_hda_power_up_pm(codec);
4380 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4381 snd_hda_power_down_pm(codec);
4382}
d240d1dc 4383
08fb0d0e 4384/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4385static int vref_mute_led_set(struct led_classdev *led_cdev,
4386 enum led_brightness brightness)
6d3cd5d4 4387{
8d3d1ece 4388 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4389 struct alc_spec *spec = codec->spec;
08fb0d0e 4390
766538ac
TI
4391 alc_update_vref_led(codec, spec->mute_led_nid,
4392 spec->mute_led_polarity, brightness);
8d3d1ece 4393 return 0;
6d3cd5d4
DH
4394}
4395
d5b6b65e
DH
4396/* Make sure the led works even in runtime suspend */
4397static unsigned int led_power_filter(struct hda_codec *codec,
4398 hda_nid_t nid,
4399 unsigned int power_state)
4400{
4401 struct alc_spec *spec = codec->spec;
4402
50dd9050
HW
4403 if (power_state != AC_PWRST_D3 || nid == 0 ||
4404 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4405 return power_state;
4406
4407 /* Set pin ctl again, it might have just been set to 0 */
4408 snd_hda_set_pin_ctl(codec, nid,
4409 snd_hda_codec_get_pin_target(codec, nid));
4410
cffd3966 4411 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4412}
4413
08fb0d0e
TI
4414static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4415 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4416{
4417 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4418 const struct dmi_device *dev = NULL;
4419
4420 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4421 return;
4422
4423 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4424 int pol, pin;
4425 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4426 continue;
4427 if (pin < 0x0a || pin >= 0x10)
4428 break;
4429 spec->mute_led_polarity = pol;
4430 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4431 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4432 codec->power_filter = led_power_filter;
4e76a883
TI
4433 codec_dbg(codec,
4434 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4435 spec->mute_led_polarity);
6d3cd5d4
DH
4436 break;
4437 }
4438}
4439
85c467dc
TI
4440static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4441 const struct hda_fixup *fix,
4442 int action, hda_nid_t pin)
d06ac143
DH
4443{
4444 struct alc_spec *spec = codec->spec;
85c467dc 4445
d06ac143
DH
4446 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4447 spec->mute_led_polarity = 0;
85c467dc 4448 spec->mute_led_nid = pin;
8d3d1ece 4449 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4450 codec->power_filter = led_power_filter;
d06ac143
DH
4451 }
4452}
4453
85c467dc
TI
4454static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4455 const struct hda_fixup *fix, int action)
4456{
4457 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4458}
4459
08fb0d0e
TI
4460static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4461 const struct hda_fixup *fix, int action)
420b0feb 4462{
85c467dc 4463 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4464}
4465
7f783bd5
TB
4466static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4467 const struct hda_fixup *fix, int action)
4468{
85c467dc 4469 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4470}
4471
0f32fd19
TI
4472/* update LED status via GPIO */
4473static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4474 int polarity, bool enabled)
9f5c6faf 4475{
dbd13179 4476 if (polarity)
0f32fd19 4477 enabled = !enabled;
d261eec8 4478 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4479}
4480
0f32fd19 4481/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4482static int gpio_mute_led_set(struct led_classdev *led_cdev,
4483 enum led_brightness brightness)
9f5c6faf 4484{
8d3d1ece 4485 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4486 struct alc_spec *spec = codec->spec;
9f5c6faf 4487
dbd13179 4488 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4489 spec->mute_led_polarity, !brightness);
4490 return 0;
0f32fd19 4491}
9f5c6faf 4492
0f32fd19 4493/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4494static int micmute_led_set(struct led_classdev *led_cdev,
4495 enum led_brightness brightness)
4496{
4497 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4498 struct alc_spec *spec = codec->spec;
4499
4500 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4501 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4502 return 0;
4503}
4504
01e4a275
TI
4505/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4506static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4507 int action,
4508 unsigned int mute_mask,
4509 unsigned int micmute_mask)
9f5c6faf
TI
4510{
4511 struct alc_spec *spec = codec->spec;
9f5c6faf 4512
01e4a275
TI
4513 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4514
4515 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4516 return;
4517 if (mute_mask) {
4518 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4519 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4520 }
4521 if (micmute_mask) {
4522 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4523 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4524 }
4525}
4526
e7d66cf7
JS
4527static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4528 const struct hda_fixup *fix, int action)
4529{
4530 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4531}
4532
01e4a275 4533static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4534 const struct hda_fixup *fix, int action)
4535{
01e4a275
TI
4536 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4537}
eaa8e5ef 4538
f5a88b0a
KHF
4539static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4540 const struct hda_fixup *fix, int action)
4541{
3e0650ab 4542 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4543}
4544
01e4a275
TI
4545static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4546 const struct hda_fixup *fix, int action)
4547{
4548 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4549}
4550
a0ccbc53
KY
4551static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4552 const struct hda_fixup *fix, int action)
4553{
4554 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4555}
4556
5fc462c3
JC
4557static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4558 const struct hda_fixup *fix, int action)
4559{
4560 struct alc_spec *spec = codec->spec;
4561
4562 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4563 spec->micmute_led_polarity = 1;
4564 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4565}
4566
8a503555
TI
4567/* turn on/off mic-mute LED per capture hook via VREF change */
4568static int vref_micmute_led_set(struct led_classdev *led_cdev,
4569 enum led_brightness brightness)
9c5dc3bf 4570{
8a503555 4571 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4572 struct alc_spec *spec = codec->spec;
9c5dc3bf 4573
766538ac
TI
4574 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4575 spec->micmute_led_polarity, brightness);
8a503555 4576 return 0;
9c5dc3bf
KY
4577}
4578
4579static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4580 const struct hda_fixup *fix, int action)
4581{
4582 struct alc_spec *spec = codec->spec;
9c5dc3bf 4583
01e4a275 4584 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4585 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4586 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4587 * enable headphone amp
4588 */
4589 spec->gpio_mask |= 0x10;
4590 spec->gpio_dir |= 0x10;
9c5dc3bf 4591 spec->cap_mute_led_nid = 0x18;
8a503555 4592 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4593 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4594 }
4595}
4596
7a5255f1
DH
4597static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4598 const struct hda_fixup *fix, int action)
4599{
7a5255f1 4600 struct alc_spec *spec = codec->spec;
7a5255f1 4601
01e4a275 4602 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4604 spec->cap_mute_led_nid = 0x18;
8a503555 4605 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4606 codec->power_filter = led_power_filter;
4607 }
4608}
4609
c3bb2b52
TI
4610/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4611 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4612 */
4613static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4614 const struct hda_fixup *fix, int action)
4615{
4616 struct alc_spec *spec = codec->spec;
4617
4618 switch (action) {
4619 case HDA_FIXUP_ACT_PRE_PROBE:
4620 spec->gpio_mask |= 0x01;
4621 spec->gpio_dir |= 0x01;
4622 break;
4623 case HDA_FIXUP_ACT_INIT:
4624 /* need to toggle GPIO to enable the amp */
4625 alc_update_gpio_data(codec, 0x01, true);
4626 msleep(100);
4627 alc_update_gpio_data(codec, 0x01, false);
4628 break;
4629 }
4630}
4631
622464c8
TI
4632/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4633static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4634 struct hda_codec *codec,
4635 struct snd_pcm_substream *substream,
4636 int action)
4637{
4638 switch (action) {
4639 case HDA_GEN_PCM_ACT_PREPARE:
4640 alc_update_gpio_data(codec, 0x04, true);
4641 break;
4642 case HDA_GEN_PCM_ACT_CLEANUP:
4643 alc_update_gpio_data(codec, 0x04, false);
4644 break;
4645 }
4646}
4647
4648static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4649 const struct hda_fixup *fix,
4650 int action)
4651{
4652 struct alc_spec *spec = codec->spec;
4653
4654 if (action == HDA_FIXUP_ACT_PROBE) {
4655 spec->gpio_mask |= 0x04;
4656 spec->gpio_dir |= 0x04;
4657 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4658 }
4659}
4660
766538ac
TI
4661static void alc_update_coef_led(struct hda_codec *codec,
4662 struct alc_coef_led *led,
4663 bool polarity, bool on)
4664{
4665 if (polarity)
4666 on = !on;
4667 /* temporarily power up/down for setting COEF bit */
4668 alc_update_coef_idx(codec, led->idx, led->mask,
4669 on ? led->on : led->off);
4670}
4671
431e76c3 4672/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4673static int coef_mute_led_set(struct led_classdev *led_cdev,
4674 enum led_brightness brightness)
431e76c3 4675{
8d3d1ece 4676 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4677 struct alc_spec *spec = codec->spec;
4678
766538ac
TI
4679 alc_update_coef_led(codec, &spec->mute_led_coef,
4680 spec->mute_led_polarity, brightness);
8d3d1ece 4681 return 0;
431e76c3
KY
4682}
4683
4684static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4685 const struct hda_fixup *fix,
4686 int action)
4687{
4688 struct alc_spec *spec = codec->spec;
4689
4690 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4691 spec->mute_led_polarity = 0;
766538ac
TI
4692 spec->mute_led_coef.idx = 0x0b;
4693 spec->mute_led_coef.mask = 1 << 3;
4694 spec->mute_led_coef.on = 1 << 3;
4695 spec->mute_led_coef.off = 0;
8d3d1ece 4696 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4697 }
4698}
4699
24164f43
KY
4700static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4701 const struct hda_fixup *fix,
4702 int action)
4703{
4704 struct alc_spec *spec = codec->spec;
4705
4706 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4707 spec->mute_led_polarity = 0;
766538ac
TI
4708 spec->mute_led_coef.idx = 0x34;
4709 spec->mute_led_coef.mask = 1 << 5;
4710 spec->mute_led_coef.on = 0;
4711 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4712 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4713 }
4714}
4715
0659400f
LG
4716static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4717 const struct hda_fixup *fix, int action)
4718{
4719 struct alc_spec *spec = codec->spec;
4720
4721 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4722 spec->mute_led_polarity = 0;
4723 spec->mute_led_coef.idx = 0x07;
4724 spec->mute_led_coef.mask = 1;
4725 spec->mute_led_coef.on = 1;
4726 spec->mute_led_coef.off = 0;
4727 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4728 }
4729}
4730
93dc18e1
SJ
4731static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4732 const struct hda_fixup *fix,
4733 int action)
4734{
4735 struct alc_spec *spec = codec->spec;
4736
4737 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4738 spec->mute_led_polarity = 0;
4739 spec->mute_led_coef.idx = 0x0b;
4740 spec->mute_led_coef.mask = 3 << 2;
4741 spec->mute_led_coef.on = 2 << 2;
4742 spec->mute_led_coef.off = 1 << 2;
4743 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4744 }
4745}
4746
e5182305
SK
4747static void alc245_fixup_hp_mute_led_v1_coefbit(struct hda_codec *codec,
4748 const struct hda_fixup *fix,
4749 int action)
4750{
4751 struct alc_spec *spec = codec->spec;
4752
4753 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4754 spec->mute_led_polarity = 0;
4755 spec->mute_led_coef.idx = 0x0b;
4756 spec->mute_led_coef.mask = 1 << 3;
4757 spec->mute_led_coef.on = 1 << 3;
4758 spec->mute_led_coef.off = 0;
4759 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4760 }
4761}
4762
431e76c3 4763/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4764static int coef_micmute_led_set(struct led_classdev *led_cdev,
4765 enum led_brightness brightness)
431e76c3 4766{
8a503555 4767 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4768 struct alc_spec *spec = codec->spec;
4769
766538ac
TI
4770 alc_update_coef_led(codec, &spec->mic_led_coef,
4771 spec->micmute_led_polarity, brightness);
8a503555 4772 return 0;
431e76c3
KY
4773}
4774
4775static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4776 const struct hda_fixup *fix, int action)
4777{
4778 struct alc_spec *spec = codec->spec;
4779
4780 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4781 spec->mic_led_coef.idx = 0x19;
4782 spec->mic_led_coef.mask = 1 << 13;
4783 spec->mic_led_coef.on = 1 << 13;
4784 spec->mic_led_coef.off = 0;
8a503555 4785 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4786 }
4787}
4788
ca88eeb3
LG
4789static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4790 const struct hda_fixup *fix, int action)
4791{
4792 struct alc_spec *spec = codec->spec;
4793
4794 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4795 spec->micmute_led_polarity = 1;
4796 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4797}
4798
24164f43
KY
4799static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4800 const struct hda_fixup *fix, int action)
4801{
4802 struct alc_spec *spec = codec->spec;
4803
4804 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4805 spec->mic_led_coef.idx = 0x35;
4806 spec->mic_led_coef.mask = 3 << 2;
4807 spec->mic_led_coef.on = 2 << 2;
4808 spec->mic_led_coef.off = 1 << 2;
8a503555 4809 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4810 }
4811}
4812
b11a74ac
NJL
4813static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec,
4814 const struct hda_fixup *fix, int action)
4815{
4816 struct alc_spec *spec = codec->spec;
4817
4818 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4819 spec->mute_led_polarity = 0;
4820 spec->mute_led_coef.idx = 0xb;
4821 spec->mute_led_coef.mask = 3 << 3;
4822 spec->mute_led_coef.on = 1 << 3;
4823 spec->mute_led_coef.off = 1 << 4;
4824 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4825 }
4826}
4827
431e76c3
KY
4828static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4829 const struct hda_fixup *fix, int action)
4830{
4831 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4832 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4833}
4834
ca88eeb3
LG
4835static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4836 const struct hda_fixup *fix, int action)
4837{
4838 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4839 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4840}
4841
24164f43
KY
4842static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4843 const struct hda_fixup *fix, int action)
4844{
4845 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4846 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4847}
4848
75b62ab6
JW
4849static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4850 const struct hda_fixup *fix, int action)
4851{
4852 struct alc_spec *spec = codec->spec;
4853
4854 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4855 spec->cap_mute_led_nid = 0x1a;
4856 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4857 codec->power_filter = led_power_filter;
4858 }
4859}
4860
4861static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4862 const struct hda_fixup *fix, int action)
4863{
4864 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4865 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4866}
4867
a2d57ebe
KM
4868static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4869 const unsigned short coefs[2])
4870{
4871 alc_write_coef_idx(codec, 0x23, coefs[0]);
4872 alc_write_coef_idx(codec, 0x25, coefs[1]);
4873 alc_write_coef_idx(codec, 0x26, 0xb011);
4874}
4875
4876struct alc298_samsung_amp_desc {
4877 unsigned char nid;
4878 unsigned short init_seq[2][2];
4879};
4880
4881static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4882 const struct hda_fixup *fix, int action)
4883{
4884 int i, j;
4885 static const unsigned short init_seq[][2] = {
4886 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4887 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4888 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4889 { 0x41, 0x07 }, { 0x400, 0x1 }
4890 };
4891 static const struct alc298_samsung_amp_desc amps[] = {
4892 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4893 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4894 };
4895
4896 if (action != HDA_FIXUP_ACT_INIT)
4897 return;
4898
4899 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4900 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4901
4902 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4903 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4904
4905 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4906 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4907 }
4908}
4909
7e4d4b32
JG
4910struct alc298_samsung_v2_amp_desc {
4911 unsigned short nid;
4912 int init_seq_size;
4913 unsigned short init_seq[18][2];
4914};
4915
4916static const struct alc298_samsung_v2_amp_desc
4917alc298_samsung_v2_amp_desc_tbl[] = {
4918 { 0x38, 18, {
4919 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4920 { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4921 { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4922 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4923 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4924 { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4925 }},
4926 { 0x39, 18, {
4927 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4928 { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4929 { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4930 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4931 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
4932 { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
4933 }},
4934 { 0x3c, 15, {
4935 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4936 { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
4937 { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4938 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4939 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4940 }},
4941 { 0x3d, 15, {
4942 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
4943 { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
4944 { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
4945 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
4946 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
4947 }}
4948};
4949
4950static void alc298_samsung_v2_enable_amps(struct hda_codec *codec)
4951{
4952 struct alc_spec *spec = codec->spec;
4953 static const unsigned short enable_seq[][2] = {
4954 { 0x203a, 0x0081 }, { 0x23ff, 0x0001 },
4955 };
4956 int i, j;
4957
4958 for (i = 0; i < spec->num_speaker_amps; i++) {
4959 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4960 for (j = 0; j < ARRAY_SIZE(enable_seq); j++)
4961 alc298_samsung_write_coef_pack(codec, enable_seq[j]);
4962 codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n",
4963 alc298_samsung_v2_amp_desc_tbl[i].nid);
4964 }
4965}
4966
4967static void alc298_samsung_v2_disable_amps(struct hda_codec *codec)
4968{
4969 struct alc_spec *spec = codec->spec;
4970 static const unsigned short disable_seq[][2] = {
4971 { 0x23ff, 0x0000 }, { 0x203a, 0x0080 },
4972 };
4973 int i, j;
4974
4975 for (i = 0; i < spec->num_speaker_amps; i++) {
4976 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
4977 for (j = 0; j < ARRAY_SIZE(disable_seq); j++)
4978 alc298_samsung_write_coef_pack(codec, disable_seq[j]);
4979 codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n",
4980 alc298_samsung_v2_amp_desc_tbl[i].nid);
4981 }
4982}
4983
4984static void alc298_samsung_v2_playback_hook(struct hda_pcm_stream *hinfo,
4985 struct hda_codec *codec,
4986 struct snd_pcm_substream *substream,
4987 int action)
4988{
4989 /* Dynamically enable/disable speaker amps before and after playback */
4990 if (action == HDA_GEN_PCM_ACT_OPEN)
4991 alc298_samsung_v2_enable_amps(codec);
4992 if (action == HDA_GEN_PCM_ACT_CLOSE)
4993 alc298_samsung_v2_disable_amps(codec);
4994}
4995
4996static void alc298_samsung_v2_init_amps(struct hda_codec *codec,
4997 int num_speaker_amps)
4998{
4999 struct alc_spec *spec = codec->spec;
5000 int i, j;
5001
5002 /* Set spec's num_speaker_amps before doing anything else */
5003 spec->num_speaker_amps = num_speaker_amps;
5004
5005 /* Disable speaker amps before init to prevent any physical damage */
5006 alc298_samsung_v2_disable_amps(codec);
5007
5008 /* Initialize the speaker amps */
5009 for (i = 0; i < spec->num_speaker_amps; i++) {
5010 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
5011 for (j = 0; j < alc298_samsung_v2_amp_desc_tbl[i].init_seq_size; j++) {
5012 alc298_samsung_write_coef_pack(codec,
5013 alc298_samsung_v2_amp_desc_tbl[i].init_seq[j]);
5014 }
5015 alc_write_coef_idx(codec, 0x89, 0x0);
5016 codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n",
5017 alc298_samsung_v2_amp_desc_tbl[i].nid);
5018 }
5019
5020 /* register hook to enable speaker amps only when they are needed */
5021 spec->gen.pcm_playback_hook = alc298_samsung_v2_playback_hook;
5022}
5023
5024static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec,
5025 const struct hda_fixup *fix, int action)
5026{
5027 if (action == HDA_FIXUP_ACT_PROBE)
5028 alc298_samsung_v2_init_amps(codec, 2);
5029}
5030
5031static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec,
5032 const struct hda_fixup *fix, int action)
5033{
5034 if (action == HDA_FIXUP_ACT_PROBE)
5035 alc298_samsung_v2_init_amps(codec, 4);
5036}
dcfed708 5037
33f4acd3
DH
5038static void gpio2_mic_hotkey_event(struct hda_codec *codec,
5039 struct hda_jack_callback *event)
5040{
5041 struct alc_spec *spec = codec->spec;
5042
5043 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
5044 send both key on and key off event for every interrupt. */
c7b60a89 5045 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 5046 input_sync(spec->kb_dev);
c7b60a89 5047 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
5048 input_sync(spec->kb_dev);
5049}
33f4acd3 5050
3694cb29
K
5051static int alc_register_micmute_input_device(struct hda_codec *codec)
5052{
5053 struct alc_spec *spec = codec->spec;
c7b60a89 5054 int i;
3694cb29
K
5055
5056 spec->kb_dev = input_allocate_device();
5057 if (!spec->kb_dev) {
5058 codec_err(codec, "Out of memory (input_allocate_device)\n");
5059 return -ENOMEM;
5060 }
c7b60a89
HW
5061
5062 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
5063
3694cb29
K
5064 spec->kb_dev->name = "Microphone Mute Button";
5065 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
5066 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
5067 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
5068 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
5069 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
5070 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
5071
5072 if (input_register_device(spec->kb_dev)) {
5073 codec_err(codec, "input_register_device failed\n");
5074 input_free_device(spec->kb_dev);
5075 spec->kb_dev = NULL;
5076 return -ENOMEM;
5077 }
5078
5079 return 0;
5080}
5081
01e4a275
TI
5082/* GPIO1 = set according to SKU external amp
5083 * GPIO2 = mic mute hotkey
5084 * GPIO3 = mute LED
5085 * GPIO4 = mic mute LED
5086 */
33f4acd3
DH
5087static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
5088 const struct hda_fixup *fix, int action)
5089{
33f4acd3
DH
5090 struct alc_spec *spec = codec->spec;
5091
01e4a275 5092 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 5093 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 5094 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 5095 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 5096 return;
33f4acd3 5097
01e4a275
TI
5098 spec->gpio_mask |= 0x06;
5099 spec->gpio_dir |= 0x02;
5100 spec->gpio_data |= 0x02;
7639a06c 5101 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 5102 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 5103 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 5104 gpio2_mic_hotkey_event);
33f4acd3
DH
5105 return;
5106 }
5107
5108 if (!spec->kb_dev)
5109 return;
5110
5111 switch (action) {
33f4acd3
DH
5112 case HDA_FIXUP_ACT_FREE:
5113 input_unregister_device(spec->kb_dev);
33f4acd3
DH
5114 spec->kb_dev = NULL;
5115 }
33f4acd3
DH
5116}
5117
01e4a275
TI
5118/* Line2 = mic mute hotkey
5119 * GPIO2 = mic mute LED
5120 */
3694cb29
K
5121static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
5122 const struct hda_fixup *fix, int action)
5123{
3694cb29
K
5124 struct alc_spec *spec = codec->spec;
5125
01e4a275 5126 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 5127 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 5128 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
5129 if (alc_register_micmute_input_device(codec) != 0)
5130 return;
5131
3694cb29
K
5132 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5133 gpio2_mic_hotkey_event);
3694cb29
K
5134 return;
5135 }
5136
5137 if (!spec->kb_dev)
5138 return;
5139
5140 switch (action) {
3694cb29
K
5141 case HDA_FIXUP_ACT_FREE:
5142 input_unregister_device(spec->kb_dev);
5143 spec->kb_dev = NULL;
5144 }
5145}
5146
9c5dc3bf
KY
5147static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
5148 const struct hda_fixup *fix, int action)
5149{
5150 struct alc_spec *spec = codec->spec;
5151
1bce62a6 5152 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 5153 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 5154 spec->cap_mute_led_nid = 0x18;
8a503555 5155 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
5156 }
5157}
5158
f603b159
KY
5159static void alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec *codec,
5160 const struct hda_fixup *fix, int action)
5161{
5162 struct alc_spec *spec = codec->spec;
5163
5164 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5165 spec->micmute_led_polarity = 1;
5166 alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action);
5167}
5168
9b82ff13
KY
5169static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
5170{
5171 if (delay <= 0)
5172 delay = 75;
5173 snd_hda_codec_write(codec, 0x21, 0,
5174 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5175 msleep(delay);
5176 snd_hda_codec_write(codec, 0x21, 0,
5177 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5178 msleep(delay);
5179}
5180
5181static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
5182{
5183 if (delay <= 0)
5184 delay = 75;
5185 snd_hda_codec_write(codec, 0x21, 0,
5186 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5187 msleep(delay);
5188 snd_hda_codec_write(codec, 0x21, 0,
5189 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5190 msleep(delay);
5191}
5192
6b0f95c4 5193static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
5194 UPDATE_COEF(0x4a, 1<<8, 0),
5195 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
5196 UPDATE_COEF(0x63, 3<<14, 3<<14),
5197 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5198 UPDATE_COEF(0x4a, 3<<10, 3<<10),
5199 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
5200 UPDATE_COEF(0x4a, 3<<10, 0),
5201 {}
5202};
5203
73bdd597
DH
5204static void alc_headset_mode_unplugged(struct hda_codec *codec)
5205{
92666d45 5206 struct alc_spec *spec = codec->spec;
6b0f95c4 5207 static const struct coef_fw coef0255[] = {
717f43d8 5208 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
5209 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5210 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5211 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5212 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
5213 {}
5214 };
6b0f95c4 5215 static const struct coef_fw coef0256[] = {
e69e7e03 5216 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
5217 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
5218 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
5219 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
5220 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
5221 {}
5222 };
6b0f95c4 5223 static const struct coef_fw coef0233[] = {
54db6c39
TI
5224 WRITE_COEF(0x1b, 0x0c0b),
5225 WRITE_COEF(0x45, 0xc429),
5226 UPDATE_COEF(0x35, 0x4000, 0),
5227 WRITE_COEF(0x06, 0x2104),
5228 WRITE_COEF(0x1a, 0x0001),
5229 WRITE_COEF(0x26, 0x0004),
5230 WRITE_COEF(0x32, 0x42a3),
5231 {}
5232 };
6b0f95c4 5233 static const struct coef_fw coef0288[] = {
f3b70332
KY
5234 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5235 UPDATE_COEF(0x50, 0x2000, 0x2000),
5236 UPDATE_COEF(0x56, 0x0006, 0x0006),
5237 UPDATE_COEF(0x66, 0x0008, 0),
5238 UPDATE_COEF(0x67, 0x2000, 0),
5239 {}
5240 };
6b0f95c4 5241 static const struct coef_fw coef0298[] = {
89542936
KY
5242 UPDATE_COEF(0x19, 0x1300, 0x0300),
5243 {}
5244 };
6b0f95c4 5245 static const struct coef_fw coef0292[] = {
54db6c39
TI
5246 WRITE_COEF(0x76, 0x000e),
5247 WRITE_COEF(0x6c, 0x2400),
5248 WRITE_COEF(0x18, 0x7308),
5249 WRITE_COEF(0x6b, 0xc429),
5250 {}
5251 };
6b0f95c4 5252 static const struct coef_fw coef0293[] = {
54db6c39
TI
5253 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
5254 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
5255 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
5256 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
5257 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
5258 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5259 {}
5260 };
6b0f95c4 5261 static const struct coef_fw coef0668[] = {
54db6c39
TI
5262 WRITE_COEF(0x15, 0x0d40),
5263 WRITE_COEF(0xb7, 0x802b),
5264 {}
5265 };
6b0f95c4 5266 static const struct coef_fw coef0225[] = {
5a36767a 5267 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
5268 {}
5269 };
6b0f95c4 5270 static const struct coef_fw coef0274[] = {
71683c32
KY
5271 UPDATE_COEF(0x4a, 0x0100, 0),
5272 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5273 UPDATE_COEF(0x6b, 0xf000, 0x5000),
5274 UPDATE_COEF(0x4a, 0x0010, 0),
5275 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5276 WRITE_COEF(0x45, 0x5289),
5277 UPDATE_COEF(0x4a, 0x0c00, 0),
5278 {}
5279 };
54db6c39 5280
92666d45
KY
5281 if (spec->no_internal_mic_pin) {
5282 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5283 return;
5284 }
5285
7639a06c 5286 switch (codec->core.vendor_id) {
9a22a8f5 5287 case 0x10ec0255:
e69e7e03
KY
5288 alc_process_coef_fw(codec, coef0255);
5289 break;
1948fc06 5290 case 0x10ec0230:
736f20a7 5291 case 0x10ec0236:
7081adf3 5292 case 0x10ec0256:
527f4643 5293 case 0x19e58326:
9b82ff13 5294 alc_hp_mute_disable(codec, 75);
e69e7e03 5295 alc_process_coef_fw(codec, coef0256);
9a22a8f5 5296 break;
71683c32
KY
5297 case 0x10ec0234:
5298 case 0x10ec0274:
5299 case 0x10ec0294:
5300 alc_process_coef_fw(codec, coef0274);
5301 break;
13fd08a3 5302 case 0x10ec0233:
73bdd597 5303 case 0x10ec0283:
54db6c39 5304 alc_process_coef_fw(codec, coef0233);
73bdd597 5305 break;
f3b70332
KY
5306 case 0x10ec0286:
5307 case 0x10ec0288:
89542936
KY
5308 alc_process_coef_fw(codec, coef0288);
5309 break;
1a5bc8d9 5310 case 0x10ec0298:
89542936 5311 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
5312 alc_process_coef_fw(codec, coef0288);
5313 break;
73bdd597 5314 case 0x10ec0292:
54db6c39 5315 alc_process_coef_fw(codec, coef0292);
73bdd597 5316 break;
a22aa26f 5317 case 0x10ec0293:
54db6c39 5318 alc_process_coef_fw(codec, coef0293);
a22aa26f 5319 break;
73bdd597 5320 case 0x10ec0668:
54db6c39 5321 alc_process_coef_fw(codec, coef0668);
73bdd597 5322 break;
c2b691ee 5323 case 0x10ec0215:
4cc9b9d6 5324 case 0x10ec0225:
c2b691ee 5325 case 0x10ec0285:
7d727869 5326 case 0x10ec0295:
c2b691ee 5327 case 0x10ec0289:
28f1f9b2 5328 case 0x10ec0299:
1fa7b099 5329 alc_hp_mute_disable(codec, 75);
4d4b0c52 5330 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5331 alc_process_coef_fw(codec, coef0225);
5332 break;
78f4f7c2
KY
5333 case 0x10ec0867:
5334 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5335 break;
73bdd597 5336 }
4e76a883 5337 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
5338}
5339
5340
5341static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5342 hda_nid_t mic_pin)
5343{
6b0f95c4 5344 static const struct coef_fw coef0255[] = {
54db6c39
TI
5345 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5346 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5347 {}
5348 };
6b0f95c4 5349 static const struct coef_fw coef0256[] = {
717f43d8
KY
5350 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5351 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5352 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5353 {}
5354 };
6b0f95c4 5355 static const struct coef_fw coef0233[] = {
54db6c39
TI
5356 UPDATE_COEF(0x35, 0, 1<<14),
5357 WRITE_COEF(0x06, 0x2100),
5358 WRITE_COEF(0x1a, 0x0021),
5359 WRITE_COEF(0x26, 0x008c),
5360 {}
5361 };
6b0f95c4 5362 static const struct coef_fw coef0288[] = {
89542936 5363 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
5364 UPDATE_COEF(0x50, 0x2000, 0),
5365 UPDATE_COEF(0x56, 0x0006, 0),
5366 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5367 UPDATE_COEF(0x66, 0x0008, 0x0008),
5368 UPDATE_COEF(0x67, 0x2000, 0x2000),
5369 {}
5370 };
6b0f95c4 5371 static const struct coef_fw coef0292[] = {
54db6c39
TI
5372 WRITE_COEF(0x19, 0xa208),
5373 WRITE_COEF(0x2e, 0xacf0),
5374 {}
5375 };
6b0f95c4 5376 static const struct coef_fw coef0293[] = {
54db6c39
TI
5377 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5378 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5379 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5380 {}
5381 };
6b0f95c4 5382 static const struct coef_fw coef0688[] = {
54db6c39
TI
5383 WRITE_COEF(0xb7, 0x802b),
5384 WRITE_COEF(0xb5, 0x1040),
5385 UPDATE_COEF(0xc3, 0, 1<<12),
5386 {}
5387 };
6b0f95c4 5388 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
5389 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5390 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5391 UPDATE_COEF(0x63, 3<<14, 0),
5392 {}
5393 };
6b0f95c4 5394 static const struct coef_fw coef0274[] = {
71683c32
KY
5395 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5396 UPDATE_COEF(0x4a, 0x0010, 0),
5397 UPDATE_COEF(0x6b, 0xf000, 0),
5398 {}
5399 };
54db6c39 5400
7639a06c 5401 switch (codec->core.vendor_id) {
9a22a8f5
KY
5402 case 0x10ec0255:
5403 alc_write_coef_idx(codec, 0x45, 0xc489);
5404 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5405 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5406 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5407 break;
1948fc06 5408 case 0x10ec0230:
717f43d8
KY
5409 case 0x10ec0236:
5410 case 0x10ec0256:
527f4643 5411 case 0x19e58326:
717f43d8
KY
5412 alc_write_coef_idx(codec, 0x45, 0xc489);
5413 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5414 alc_process_coef_fw(codec, coef0256);
5415 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5416 break;
71683c32
KY
5417 case 0x10ec0234:
5418 case 0x10ec0274:
5419 case 0x10ec0294:
5420 alc_write_coef_idx(codec, 0x45, 0x4689);
5421 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5422 alc_process_coef_fw(codec, coef0274);
5423 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5424 break;
13fd08a3 5425 case 0x10ec0233:
73bdd597
DH
5426 case 0x10ec0283:
5427 alc_write_coef_idx(codec, 0x45, 0xc429);
5428 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5429 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5430 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5431 break;
f3b70332
KY
5432 case 0x10ec0286:
5433 case 0x10ec0288:
1a5bc8d9 5434 case 0x10ec0298:
f3b70332
KY
5435 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5436 alc_process_coef_fw(codec, coef0288);
5437 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5438 break;
73bdd597
DH
5439 case 0x10ec0292:
5440 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5441 alc_process_coef_fw(codec, coef0292);
73bdd597 5442 break;
a22aa26f
KY
5443 case 0x10ec0293:
5444 /* Set to TRS mode */
5445 alc_write_coef_idx(codec, 0x45, 0xc429);
5446 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5447 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5448 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5449 break;
78f4f7c2
KY
5450 case 0x10ec0867:
5451 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5452 fallthrough;
9eb5d0e6 5453 case 0x10ec0221:
1f8b46cd
DH
5454 case 0x10ec0662:
5455 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5456 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5457 break;
73bdd597
DH
5458 case 0x10ec0668:
5459 alc_write_coef_idx(codec, 0x11, 0x0001);
5460 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5461 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5462 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5463 break;
c2b691ee 5464 case 0x10ec0215:
4cc9b9d6 5465 case 0x10ec0225:
c2b691ee 5466 case 0x10ec0285:
7d727869 5467 case 0x10ec0295:
c2b691ee 5468 case 0x10ec0289:
28f1f9b2 5469 case 0x10ec0299:
5a36767a 5470 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5471 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5472 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5473 alc_process_coef_fw(codec, coef0225);
5474 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5475 break;
73bdd597 5476 }
4e76a883 5477 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5478}
5479
5480static void alc_headset_mode_default(struct hda_codec *codec)
5481{
6b0f95c4 5482 static const struct coef_fw coef0225[] = {
5a36767a
KY
5483 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5484 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5485 UPDATE_COEF(0x49, 3<<8, 0<<8),
5486 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5487 UPDATE_COEF(0x63, 3<<14, 0),
5488 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5489 {}
5490 };
6b0f95c4 5491 static const struct coef_fw coef0255[] = {
54db6c39
TI
5492 WRITE_COEF(0x45, 0xc089),
5493 WRITE_COEF(0x45, 0xc489),
5494 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5495 WRITE_COEF(0x49, 0x0049),
5496 {}
5497 };
6b0f95c4 5498 static const struct coef_fw coef0256[] = {
717f43d8
KY
5499 WRITE_COEF(0x45, 0xc489),
5500 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5501 WRITE_COEF(0x49, 0x0049),
5502 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5503 WRITE_COEF(0x06, 0x6100),
5504 {}
5505 };
6b0f95c4 5506 static const struct coef_fw coef0233[] = {
54db6c39
TI
5507 WRITE_COEF(0x06, 0x2100),
5508 WRITE_COEF(0x32, 0x4ea3),
5509 {}
5510 };
6b0f95c4 5511 static const struct coef_fw coef0288[] = {
f3b70332
KY
5512 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5513 UPDATE_COEF(0x50, 0x2000, 0x2000),
5514 UPDATE_COEF(0x56, 0x0006, 0x0006),
5515 UPDATE_COEF(0x66, 0x0008, 0),
5516 UPDATE_COEF(0x67, 0x2000, 0),
5517 {}
5518 };
6b0f95c4 5519 static const struct coef_fw coef0292[] = {
54db6c39
TI
5520 WRITE_COEF(0x76, 0x000e),
5521 WRITE_COEF(0x6c, 0x2400),
5522 WRITE_COEF(0x6b, 0xc429),
5523 WRITE_COEF(0x18, 0x7308),
5524 {}
5525 };
6b0f95c4 5526 static const struct coef_fw coef0293[] = {
54db6c39
TI
5527 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5528 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5529 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5530 {}
5531 };
6b0f95c4 5532 static const struct coef_fw coef0688[] = {
54db6c39
TI
5533 WRITE_COEF(0x11, 0x0041),
5534 WRITE_COEF(0x15, 0x0d40),
5535 WRITE_COEF(0xb7, 0x802b),
5536 {}
5537 };
6b0f95c4 5538 static const struct coef_fw coef0274[] = {
71683c32
KY
5539 WRITE_COEF(0x45, 0x4289),
5540 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5541 UPDATE_COEF(0x6b, 0x0f00, 0),
5542 UPDATE_COEF(0x49, 0x0300, 0x0300),
5543 {}
5544 };
54db6c39 5545
7639a06c 5546 switch (codec->core.vendor_id) {
c2b691ee 5547 case 0x10ec0215:
2ae95577 5548 case 0x10ec0225:
c2b691ee 5549 case 0x10ec0285:
7d727869 5550 case 0x10ec0295:
c2b691ee 5551 case 0x10ec0289:
28f1f9b2 5552 case 0x10ec0299:
5a36767a 5553 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577 5554 alc_process_coef_fw(codec, coef0225);
1fa7b099 5555 alc_hp_enable_unmute(codec, 75);
2ae95577 5556 break;
9a22a8f5 5557 case 0x10ec0255:
54db6c39 5558 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5559 break;
1948fc06 5560 case 0x10ec0230:
717f43d8
KY
5561 case 0x10ec0236:
5562 case 0x10ec0256:
527f4643 5563 case 0x19e58326:
717f43d8
KY
5564 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5565 alc_write_coef_idx(codec, 0x45, 0xc089);
5566 msleep(50);
5567 alc_process_coef_fw(codec, coef0256);
9b82ff13 5568 alc_hp_enable_unmute(codec, 75);
717f43d8 5569 break;
71683c32
KY
5570 case 0x10ec0234:
5571 case 0x10ec0274:
5572 case 0x10ec0294:
5573 alc_process_coef_fw(codec, coef0274);
5574 break;
13fd08a3 5575 case 0x10ec0233:
73bdd597 5576 case 0x10ec0283:
54db6c39 5577 alc_process_coef_fw(codec, coef0233);
73bdd597 5578 break;
f3b70332
KY
5579 case 0x10ec0286:
5580 case 0x10ec0288:
1a5bc8d9 5581 case 0x10ec0298:
f3b70332
KY
5582 alc_process_coef_fw(codec, coef0288);
5583 break;
73bdd597 5584 case 0x10ec0292:
54db6c39 5585 alc_process_coef_fw(codec, coef0292);
73bdd597 5586 break;
a22aa26f 5587 case 0x10ec0293:
54db6c39 5588 alc_process_coef_fw(codec, coef0293);
a22aa26f 5589 break;
73bdd597 5590 case 0x10ec0668:
54db6c39 5591 alc_process_coef_fw(codec, coef0688);
73bdd597 5592 break;
78f4f7c2
KY
5593 case 0x10ec0867:
5594 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5595 break;
73bdd597 5596 }
4e76a883 5597 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5598}
5599
5600/* Iphone type */
5601static void alc_headset_mode_ctia(struct hda_codec *codec)
5602{
89542936
KY
5603 int val;
5604
6b0f95c4 5605 static const struct coef_fw coef0255[] = {
54db6c39
TI
5606 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5607 WRITE_COEF(0x1b, 0x0c2b),
5608 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5609 {}
5610 };
6b0f95c4 5611 static const struct coef_fw coef0256[] = {
e69e7e03 5612 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5613 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5614 {}
5615 };
6b0f95c4 5616 static const struct coef_fw coef0233[] = {
54db6c39
TI
5617 WRITE_COEF(0x45, 0xd429),
5618 WRITE_COEF(0x1b, 0x0c2b),
5619 WRITE_COEF(0x32, 0x4ea3),
5620 {}
5621 };
6b0f95c4 5622 static const struct coef_fw coef0288[] = {
f3b70332
KY
5623 UPDATE_COEF(0x50, 0x2000, 0x2000),
5624 UPDATE_COEF(0x56, 0x0006, 0x0006),
5625 UPDATE_COEF(0x66, 0x0008, 0),
5626 UPDATE_COEF(0x67, 0x2000, 0),
5627 {}
5628 };
6b0f95c4 5629 static const struct coef_fw coef0292[] = {
54db6c39
TI
5630 WRITE_COEF(0x6b, 0xd429),
5631 WRITE_COEF(0x76, 0x0008),
5632 WRITE_COEF(0x18, 0x7388),
5633 {}
5634 };
6b0f95c4 5635 static const struct coef_fw coef0293[] = {
54db6c39
TI
5636 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5637 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5638 {}
5639 };
6b0f95c4 5640 static const struct coef_fw coef0688[] = {
54db6c39
TI
5641 WRITE_COEF(0x11, 0x0001),
5642 WRITE_COEF(0x15, 0x0d60),
5643 WRITE_COEF(0xc3, 0x0000),
5644 {}
5645 };
6b0f95c4 5646 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5647 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5648 UPDATE_COEF(0x63, 3<<14, 2<<14),
5649 {}
5650 };
6b0f95c4 5651 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5652 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5653 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5654 {}
5655 };
54db6c39 5656
7639a06c 5657 switch (codec->core.vendor_id) {
9a22a8f5 5658 case 0x10ec0255:
54db6c39 5659 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5660 break;
1948fc06 5661 case 0x10ec0230:
736f20a7 5662 case 0x10ec0236:
e69e7e03 5663 case 0x10ec0256:
527f4643 5664 case 0x19e58326:
e69e7e03 5665 alc_process_coef_fw(codec, coef0256);
9b82ff13 5666 alc_hp_enable_unmute(codec, 75);
e69e7e03 5667 break;
71683c32
KY
5668 case 0x10ec0234:
5669 case 0x10ec0274:
5670 case 0x10ec0294:
5671 alc_write_coef_idx(codec, 0x45, 0xd689);
5672 break;
13fd08a3 5673 case 0x10ec0233:
73bdd597 5674 case 0x10ec0283:
54db6c39 5675 alc_process_coef_fw(codec, coef0233);
73bdd597 5676 break;
1a5bc8d9 5677 case 0x10ec0298:
89542936
KY
5678 val = alc_read_coef_idx(codec, 0x50);
5679 if (val & (1 << 12)) {
5680 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5681 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5682 msleep(300);
5683 } else {
5684 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5685 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5686 msleep(300);
5687 }
5688 break;
f3b70332
KY
5689 case 0x10ec0286:
5690 case 0x10ec0288:
5691 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5692 msleep(300);
5693 alc_process_coef_fw(codec, coef0288);
5694 break;
73bdd597 5695 case 0x10ec0292:
54db6c39 5696 alc_process_coef_fw(codec, coef0292);
73bdd597 5697 break;
a22aa26f 5698 case 0x10ec0293:
54db6c39 5699 alc_process_coef_fw(codec, coef0293);
a22aa26f 5700 break;
73bdd597 5701 case 0x10ec0668:
54db6c39 5702 alc_process_coef_fw(codec, coef0688);
73bdd597 5703 break;
c2b691ee 5704 case 0x10ec0215:
4cc9b9d6 5705 case 0x10ec0225:
c2b691ee 5706 case 0x10ec0285:
7d727869 5707 case 0x10ec0295:
c2b691ee 5708 case 0x10ec0289:
28f1f9b2 5709 case 0x10ec0299:
5a36767a
KY
5710 val = alc_read_coef_idx(codec, 0x45);
5711 if (val & (1 << 9))
5712 alc_process_coef_fw(codec, coef0225_2);
5713 else
5714 alc_process_coef_fw(codec, coef0225_1);
1fa7b099 5715 alc_hp_enable_unmute(codec, 75);
4cc9b9d6 5716 break;
78f4f7c2
KY
5717 case 0x10ec0867:
5718 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5719 break;
73bdd597 5720 }
4e76a883 5721 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5722}
5723
5724/* Nokia type */
5725static void alc_headset_mode_omtp(struct hda_codec *codec)
5726{
6b0f95c4 5727 static const struct coef_fw coef0255[] = {
54db6c39
TI
5728 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5729 WRITE_COEF(0x1b, 0x0c2b),
5730 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5731 {}
5732 };
6b0f95c4 5733 static const struct coef_fw coef0256[] = {
e69e7e03 5734 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5735 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5736 {}
5737 };
6b0f95c4 5738 static const struct coef_fw coef0233[] = {
54db6c39
TI
5739 WRITE_COEF(0x45, 0xe429),
5740 WRITE_COEF(0x1b, 0x0c2b),
5741 WRITE_COEF(0x32, 0x4ea3),
5742 {}
5743 };
6b0f95c4 5744 static const struct coef_fw coef0288[] = {
f3b70332
KY
5745 UPDATE_COEF(0x50, 0x2000, 0x2000),
5746 UPDATE_COEF(0x56, 0x0006, 0x0006),
5747 UPDATE_COEF(0x66, 0x0008, 0),
5748 UPDATE_COEF(0x67, 0x2000, 0),
5749 {}
5750 };
6b0f95c4 5751 static const struct coef_fw coef0292[] = {
54db6c39
TI
5752 WRITE_COEF(0x6b, 0xe429),
5753 WRITE_COEF(0x76, 0x0008),
5754 WRITE_COEF(0x18, 0x7388),
5755 {}
5756 };
6b0f95c4 5757 static const struct coef_fw coef0293[] = {
54db6c39
TI
5758 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5759 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5760 {}
5761 };
6b0f95c4 5762 static const struct coef_fw coef0688[] = {
54db6c39
TI
5763 WRITE_COEF(0x11, 0x0001),
5764 WRITE_COEF(0x15, 0x0d50),
5765 WRITE_COEF(0xc3, 0x0000),
5766 {}
5767 };
6b0f95c4 5768 static const struct coef_fw coef0225[] = {
4cc9b9d6 5769 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5770 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5771 {}
5772 };
54db6c39 5773
7639a06c 5774 switch (codec->core.vendor_id) {
9a22a8f5 5775 case 0x10ec0255:
54db6c39 5776 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5777 break;
1948fc06 5778 case 0x10ec0230:
736f20a7 5779 case 0x10ec0236:
e69e7e03 5780 case 0x10ec0256:
527f4643 5781 case 0x19e58326:
e69e7e03 5782 alc_process_coef_fw(codec, coef0256);
9b82ff13 5783 alc_hp_enable_unmute(codec, 75);
e69e7e03 5784 break;
71683c32
KY
5785 case 0x10ec0234:
5786 case 0x10ec0274:
5787 case 0x10ec0294:
5788 alc_write_coef_idx(codec, 0x45, 0xe689);
5789 break;
13fd08a3 5790 case 0x10ec0233:
73bdd597 5791 case 0x10ec0283:
54db6c39 5792 alc_process_coef_fw(codec, coef0233);
73bdd597 5793 break;
1a5bc8d9
KY
5794 case 0x10ec0298:
5795 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5796 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5797 msleep(300);
5798 break;
f3b70332
KY
5799 case 0x10ec0286:
5800 case 0x10ec0288:
5801 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5802 msleep(300);
5803 alc_process_coef_fw(codec, coef0288);
5804 break;
73bdd597 5805 case 0x10ec0292:
54db6c39 5806 alc_process_coef_fw(codec, coef0292);
73bdd597 5807 break;
a22aa26f 5808 case 0x10ec0293:
54db6c39 5809 alc_process_coef_fw(codec, coef0293);
a22aa26f 5810 break;
73bdd597 5811 case 0x10ec0668:
54db6c39 5812 alc_process_coef_fw(codec, coef0688);
73bdd597 5813 break;
c2b691ee 5814 case 0x10ec0215:
4cc9b9d6 5815 case 0x10ec0225:
c2b691ee 5816 case 0x10ec0285:
7d727869 5817 case 0x10ec0295:
c2b691ee 5818 case 0x10ec0289:
28f1f9b2 5819 case 0x10ec0299:
4cc9b9d6 5820 alc_process_coef_fw(codec, coef0225);
1fa7b099 5821 alc_hp_enable_unmute(codec, 75);
4cc9b9d6 5822 break;
73bdd597 5823 }
4e76a883 5824 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5825}
5826
5827static void alc_determine_headset_type(struct hda_codec *codec)
5828{
5829 int val;
5830 bool is_ctia = false;
5831 struct alc_spec *spec = codec->spec;
6b0f95c4 5832 static const struct coef_fw coef0255[] = {
54db6c39
TI
5833 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5834 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5835 conteol) */
5836 {}
5837 };
6b0f95c4 5838 static const struct coef_fw coef0288[] = {
f3b70332
KY
5839 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5840 {}
5841 };
6b0f95c4 5842 static const struct coef_fw coef0298[] = {
89542936
KY
5843 UPDATE_COEF(0x50, 0x2000, 0x2000),
5844 UPDATE_COEF(0x56, 0x0006, 0x0006),
5845 UPDATE_COEF(0x66, 0x0008, 0),
5846 UPDATE_COEF(0x67, 0x2000, 0),
5847 UPDATE_COEF(0x19, 0x1300, 0x1300),
5848 {}
5849 };
6b0f95c4 5850 static const struct coef_fw coef0293[] = {
54db6c39
TI
5851 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5852 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5853 {}
5854 };
6b0f95c4 5855 static const struct coef_fw coef0688[] = {
54db6c39
TI
5856 WRITE_COEF(0x11, 0x0001),
5857 WRITE_COEF(0xb7, 0x802b),
5858 WRITE_COEF(0x15, 0x0d60),
5859 WRITE_COEF(0xc3, 0x0c00),
5860 {}
5861 };
6b0f95c4 5862 static const struct coef_fw coef0274[] = {
71683c32
KY
5863 UPDATE_COEF(0x4a, 0x0010, 0),
5864 UPDATE_COEF(0x4a, 0x8000, 0),
5865 WRITE_COEF(0x45, 0xd289),
5866 UPDATE_COEF(0x49, 0x0300, 0x0300),
5867 {}
5868 };
73bdd597 5869
92666d45
KY
5870 if (spec->no_internal_mic_pin) {
5871 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5872 return;
5873 }
5874
7639a06c 5875 switch (codec->core.vendor_id) {
9a22a8f5 5876 case 0x10ec0255:
717f43d8
KY
5877 alc_process_coef_fw(codec, coef0255);
5878 msleep(300);
5879 val = alc_read_coef_idx(codec, 0x46);
5880 is_ctia = (val & 0x0070) == 0x0070;
5881 break;
1948fc06 5882 case 0x10ec0230:
717f43d8 5883 case 0x10ec0236:
7081adf3 5884 case 0x10ec0256:
527f4643 5885 case 0x19e58326:
717f43d8
KY
5886 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5887 alc_write_coef_idx(codec, 0x06, 0x6104);
5888 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5889
54db6c39 5890 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5891 msleep(300);
5892 val = alc_read_coef_idx(codec, 0x46);
5893 is_ctia = (val & 0x0070) == 0x0070;
9b82ff13
KY
5894 if (!is_ctia) {
5895 alc_write_coef_idx(codec, 0x45, 0xe089);
5896 msleep(100);
5897 val = alc_read_coef_idx(codec, 0x46);
5898 if ((val & 0x0070) == 0x0070)
5899 is_ctia = false;
5900 else
5901 is_ctia = true;
5902 }
717f43d8
KY
5903 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5904 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
9a22a8f5 5905 break;
71683c32
KY
5906 case 0x10ec0234:
5907 case 0x10ec0274:
5908 case 0x10ec0294:
5909 alc_process_coef_fw(codec, coef0274);
febf2256 5910 msleep(850);
71683c32
KY
5911 val = alc_read_coef_idx(codec, 0x46);
5912 is_ctia = (val & 0x00f0) == 0x00f0;
5913 break;
13fd08a3 5914 case 0x10ec0233:
73bdd597
DH
5915 case 0x10ec0283:
5916 alc_write_coef_idx(codec, 0x45, 0xd029);
5917 msleep(300);
5918 val = alc_read_coef_idx(codec, 0x46);
5919 is_ctia = (val & 0x0070) == 0x0070;
5920 break;
1a5bc8d9 5921 case 0x10ec0298:
89542936
KY
5922 snd_hda_codec_write(codec, 0x21, 0,
5923 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5924 msleep(100);
5925 snd_hda_codec_write(codec, 0x21, 0,
5926 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5927 msleep(200);
5928
5929 val = alc_read_coef_idx(codec, 0x50);
5930 if (val & (1 << 12)) {
5931 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5932 alc_process_coef_fw(codec, coef0288);
5933 msleep(350);
5934 val = alc_read_coef_idx(codec, 0x50);
5935 is_ctia = (val & 0x0070) == 0x0070;
5936 } else {
5937 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5938 alc_process_coef_fw(codec, coef0288);
5939 msleep(350);
5940 val = alc_read_coef_idx(codec, 0x50);
5941 is_ctia = (val & 0x0070) == 0x0070;
5942 }
5943 alc_process_coef_fw(codec, coef0298);
5944 snd_hda_codec_write(codec, 0x21, 0,
5945 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5946 msleep(75);
5947 snd_hda_codec_write(codec, 0x21, 0,
5948 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5949 break;
f3b70332
KY
5950 case 0x10ec0286:
5951 case 0x10ec0288:
5952 alc_process_coef_fw(codec, coef0288);
5953 msleep(350);
5954 val = alc_read_coef_idx(codec, 0x50);
5955 is_ctia = (val & 0x0070) == 0x0070;
5956 break;
73bdd597
DH
5957 case 0x10ec0292:
5958 alc_write_coef_idx(codec, 0x6b, 0xd429);
5959 msleep(300);
5960 val = alc_read_coef_idx(codec, 0x6c);
5961 is_ctia = (val & 0x001c) == 0x001c;
5962 break;
a22aa26f 5963 case 0x10ec0293:
54db6c39 5964 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5965 msleep(300);
5966 val = alc_read_coef_idx(codec, 0x46);
5967 is_ctia = (val & 0x0070) == 0x0070;
5968 break;
73bdd597 5969 case 0x10ec0668:
54db6c39 5970 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5971 msleep(300);
5972 val = alc_read_coef_idx(codec, 0xbe);
5973 is_ctia = (val & 0x1c02) == 0x1c02;
5974 break;
c2b691ee 5975 case 0x10ec0215:
4cc9b9d6 5976 case 0x10ec0225:
c2b691ee 5977 case 0x10ec0285:
7d727869 5978 case 0x10ec0295:
c2b691ee 5979 case 0x10ec0289:
28f1f9b2 5980 case 0x10ec0299:
5a36767a
KY
5981 alc_process_coef_fw(codec, alc225_pre_hsmode);
5982 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5983 val = alc_read_coef_idx(codec, 0x45);
5984 if (val & (1 << 9)) {
5985 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5986 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5987 msleep(800);
5988 val = alc_read_coef_idx(codec, 0x46);
5989 is_ctia = (val & 0x00f0) == 0x00f0;
5990 } else {
5991 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5992 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5993 msleep(800);
5994 val = alc_read_coef_idx(codec, 0x46);
5995 is_ctia = (val & 0x00f0) == 0x00f0;
5996 }
1fa7b099
KY
5997 if (!is_ctia) {
5998 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
5999 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
6000 msleep(100);
6001 val = alc_read_coef_idx(codec, 0x46);
6002 if ((val & 0x00f0) == 0x00f0)
6003 is_ctia = false;
6004 else
6005 is_ctia = true;
6006 }
5a36767a
KY
6007 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
6008 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
6009 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
4cc9b9d6 6010 break;
78f4f7c2
KY
6011 case 0x10ec0867:
6012 is_ctia = true;
6013 break;
73bdd597
DH
6014 }
6015
4e76a883 6016 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
550033fd 6017 str_yes_no(is_ctia));
73bdd597
DH
6018 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
6019}
6020
6021static void alc_update_headset_mode(struct hda_codec *codec)
6022{
6023 struct alc_spec *spec = codec->spec;
6024
6025 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 6026 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
6027
6028 int new_headset_mode;
6029
6030 if (!snd_hda_jack_detect(codec, hp_pin))
6031 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
6032 else if (mux_pin == spec->headset_mic_pin)
6033 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
6034 else if (mux_pin == spec->headphone_mic_pin)
6035 new_headset_mode = ALC_HEADSET_MODE_MIC;
6036 else
6037 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
6038
5959a6bc
DH
6039 if (new_headset_mode == spec->current_headset_mode) {
6040 snd_hda_gen_update_outputs(codec);
73bdd597 6041 return;
5959a6bc 6042 }
73bdd597
DH
6043
6044 switch (new_headset_mode) {
6045 case ALC_HEADSET_MODE_UNPLUGGED:
6046 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
6047 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
6048 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
6049 spec->gen.hp_jack_present = false;
6050 break;
6051 case ALC_HEADSET_MODE_HEADSET:
6052 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
6053 alc_determine_headset_type(codec);
6054 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
6055 alc_headset_mode_ctia(codec);
6056 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
6057 alc_headset_mode_omtp(codec);
6058 spec->gen.hp_jack_present = true;
6059 break;
6060 case ALC_HEADSET_MODE_MIC:
6061 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
6062 spec->gen.hp_jack_present = false;
6063 break;
6064 case ALC_HEADSET_MODE_HEADPHONE:
6065 alc_headset_mode_default(codec);
6066 spec->gen.hp_jack_present = true;
6067 break;
6068 }
6069 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
6070 snd_hda_set_pin_ctl_cache(codec, hp_pin,
6071 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 6072 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
6073 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
6074 PIN_VREFHIZ);
6075 }
6076 spec->current_headset_mode = new_headset_mode;
6077
6078 snd_hda_gen_update_outputs(codec);
6079}
6080
6081static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
6082 struct snd_kcontrol *kcontrol,
6083 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
6084{
6085 alc_update_headset_mode(codec);
6086}
6087
1a4f69d5
TI
6088static void alc_update_headset_jack_cb(struct hda_codec *codec,
6089 struct hda_jack_callback *jack)
73bdd597 6090{
73bdd597 6091 snd_hda_gen_hp_automute(codec, jack);
e54f30be 6092 alc_update_headset_mode(codec);
73bdd597
DH
6093}
6094
6095static void alc_probe_headset_mode(struct hda_codec *codec)
6096{
6097 int i;
6098 struct alc_spec *spec = codec->spec;
6099 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6100
6101 /* Find mic pins */
6102 for (i = 0; i < cfg->num_inputs; i++) {
6103 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
6104 spec->headset_mic_pin = cfg->inputs[i].pin;
6105 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
6106 spec->headphone_mic_pin = cfg->inputs[i].pin;
6107 }
6108
0bed2aa3 6109 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
6110 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
6111 spec->gen.automute_hook = alc_update_headset_mode;
6112 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
6113}
6114
6115static void alc_fixup_headset_mode(struct hda_codec *codec,
6116 const struct hda_fixup *fix, int action)
6117{
6118 struct alc_spec *spec = codec->spec;
6119
6120 switch (action) {
6121 case HDA_FIXUP_ACT_PRE_PROBE:
6122 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
6123 break;
6124 case HDA_FIXUP_ACT_PROBE:
6125 alc_probe_headset_mode(codec);
6126 break;
6127 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
6128 if (is_s3_resume(codec) || is_s4_resume(codec)) {
6129 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
6130 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
6131 }
73bdd597
DH
6132 alc_update_headset_mode(codec);
6133 break;
6134 }
6135}
6136
6137static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
6138 const struct hda_fixup *fix, int action)
6139{
6140 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6141 struct alc_spec *spec = codec->spec;
6142 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6143 }
6144 else
6145 alc_fixup_headset_mode(codec, fix, action);
6146}
6147
31278997
KY
6148static void alc255_set_default_jack_type(struct hda_codec *codec)
6149{
6150 /* Set to iphone type */
6b0f95c4 6151 static const struct coef_fw alc255fw[] = {
54db6c39
TI
6152 WRITE_COEF(0x1b, 0x880b),
6153 WRITE_COEF(0x45, 0xd089),
6154 WRITE_COEF(0x1b, 0x080b),
6155 WRITE_COEF(0x46, 0x0004),
6156 WRITE_COEF(0x1b, 0x0c0b),
6157 {}
6158 };
6b0f95c4 6159 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
6160 WRITE_COEF(0x1b, 0x884b),
6161 WRITE_COEF(0x45, 0xd089),
6162 WRITE_COEF(0x1b, 0x084b),
6163 WRITE_COEF(0x46, 0x0004),
6164 WRITE_COEF(0x1b, 0x0c4b),
6165 {}
6166 };
6167 switch (codec->core.vendor_id) {
6168 case 0x10ec0255:
6169 alc_process_coef_fw(codec, alc255fw);
6170 break;
1948fc06 6171 case 0x10ec0230:
736f20a7 6172 case 0x10ec0236:
e69e7e03 6173 case 0x10ec0256:
527f4643 6174 case 0x19e58326:
e69e7e03
KY
6175 alc_process_coef_fw(codec, alc256fw);
6176 break;
6177 }
31278997
KY
6178 msleep(30);
6179}
6180
9a22a8f5
KY
6181static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
6182 const struct hda_fixup *fix, int action)
6183{
6184 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 6185 alc255_set_default_jack_type(codec);
9a22a8f5
KY
6186 }
6187 alc_fixup_headset_mode(codec, fix, action);
6188}
6189
31278997
KY
6190static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
6191 const struct hda_fixup *fix, int action)
6192{
6193 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6194 struct alc_spec *spec = codec->spec;
6195 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6196 alc255_set_default_jack_type(codec);
72cea3a3 6197 }
31278997
KY
6198 else
6199 alc_fixup_headset_mode(codec, fix, action);
6200}
6201
e1e62b98
KY
6202static void alc288_update_headset_jack_cb(struct hda_codec *codec,
6203 struct hda_jack_callback *jack)
6204{
6205 struct alc_spec *spec = codec->spec;
e1e62b98
KY
6206
6207 alc_update_headset_jack_cb(codec, jack);
6208 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 6209 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
6210}
6211
6212static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
6213 const struct hda_fixup *fix, int action)
6214{
6215 alc_fixup_headset_mode(codec, fix, action);
6216 if (action == HDA_FIXUP_ACT_PROBE) {
6217 struct alc_spec *spec = codec->spec;
d44a6864
TI
6218 /* toggled via hp_automute_hook */
6219 spec->gpio_mask |= 0x40;
6220 spec->gpio_dir |= 0x40;
e1e62b98
KY
6221 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
6222 }
6223}
6224
493a52a9
HW
6225static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
6226 const struct hda_fixup *fix, int action)
6227{
6228 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6229 struct alc_spec *spec = codec->spec;
6230 spec->gen.auto_mute_via_amp = 1;
6231 }
6232}
6233
9b745ab8
TI
6234static void alc_fixup_no_shutup(struct hda_codec *codec,
6235 const struct hda_fixup *fix, int action)
6236{
efe55732 6237 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 6238 struct alc_spec *spec = codec->spec;
c0ca5ece 6239 spec->no_shutup_pins = 1;
9b745ab8
TI
6240 }
6241}
6242
5e6db669
GM
6243static void alc_fixup_disable_aamix(struct hda_codec *codec,
6244 const struct hda_fixup *fix, int action)
6245{
6246 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6247 struct alc_spec *spec = codec->spec;
6248 /* Disable AA-loopback as it causes white noise */
6249 spec->gen.mixer_nid = 0;
6250 }
6251}
6252
7f57d803
TI
6253/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
6254static void alc_fixup_tpt440_dock(struct hda_codec *codec,
6255 const struct hda_fixup *fix, int action)
6256{
6257 static const struct hda_pintbl pincfgs[] = {
6258 { 0x16, 0x21211010 }, /* dock headphone */
6259 { 0x19, 0x21a11010 }, /* dock mic */
6260 { }
6261 };
6262 struct alc_spec *spec = codec->spec;
6263
6264 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6265 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6266 codec->power_save_node = 0; /* avoid click noises */
6267 snd_hda_apply_pincfgs(codec, pincfgs);
6268 }
6269}
6270
61fcf8ec
KY
6271static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6272 const struct hda_fixup *fix, int action)
6273{
6274 static const struct hda_pintbl pincfgs[] = {
6275 { 0x17, 0x21211010 }, /* dock headphone */
6276 { 0x19, 0x21a11010 }, /* dock mic */
6277 { }
6278 };
6279 struct alc_spec *spec = codec->spec;
6280
6281 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6282 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
6283 snd_hda_apply_pincfgs(codec, pincfgs);
6284 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
6285 /* Enable DOCK device */
6286 snd_hda_codec_write(codec, 0x17, 0,
6287 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6288 /* Enable DOCK device */
6289 snd_hda_codec_write(codec, 0x19, 0,
6290 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
6291 }
6292}
6293
399c01aa
TI
6294static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6295 const struct hda_fixup *fix, int action)
6296{
6297 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6298 * the speaker output becomes too low by some reason on Thinkpads with
6299 * ALC298 codec
6300 */
6301 static const hda_nid_t preferred_pairs[] = {
6302 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6303 0
6304 };
6305 struct alc_spec *spec = codec->spec;
6306
6307 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6308 spec->gen.preferred_dacs = preferred_pairs;
6309}
6310
8eedd3a7
TI
6311static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6312 const struct hda_fixup *fix, int action)
6313{
6314 static const hda_nid_t preferred_pairs[] = {
6315 0x17, 0x02, 0x21, 0x03, 0
6316 };
6317 struct alc_spec *spec = codec->spec;
6318
6319 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6320 spec->gen.preferred_dacs = preferred_pairs;
6321}
6322
9476d369 6323static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
6324{
6325 struct alc_spec *spec = codec->spec;
35a39f98 6326 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 6327
9476d369
GM
6328 /* Prevent pop noises when headphones are plugged in */
6329 snd_hda_codec_write(codec, hp_pin, 0,
6330 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6331 msleep(20);
033b0a7c
GM
6332}
6333
6334static void alc_fixup_dell_xps13(struct hda_codec *codec,
6335 const struct hda_fixup *fix, int action)
6336{
3e1b0c4a
TI
6337 struct alc_spec *spec = codec->spec;
6338 struct hda_input_mux *imux = &spec->gen.input_mux;
6339 int i;
f38663ab 6340
3e1b0c4a
TI
6341 switch (action) {
6342 case HDA_FIXUP_ACT_PRE_PROBE:
6343 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6344 * it causes a click noise at start up
6345 */
6346 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 6347 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
6348 break;
6349 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
6350 /* Make the internal mic the default input source. */
6351 for (i = 0; i < imux->num_items; i++) {
6352 if (spec->gen.imux_pins[i] == 0x12) {
6353 spec->gen.cur_mux[0] = i;
6354 break;
6355 }
6356 }
3e1b0c4a 6357 break;
033b0a7c
GM
6358 }
6359}
6360
1f8b46cd
DH
6361static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6362 const struct hda_fixup *fix, int action)
6363{
6364 struct alc_spec *spec = codec->spec;
6365
6366 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6367 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6368 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
6369
6370 /* Disable boost for mic-in permanently. (This code is only called
6371 from quirks that guarantee that the headphone is at NID 0x1b.) */
6372 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6373 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
6374 } else
6375 alc_fixup_headset_mode(codec, fix, action);
6376}
6377
73bdd597
DH
6378static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6379 const struct hda_fixup *fix, int action)
6380{
6381 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 6382 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 6383 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
6384 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6385 }
6386 alc_fixup_headset_mode(codec, fix, action);
6387}
6388
bde7bc60
CCC
6389/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6390static int find_ext_mic_pin(struct hda_codec *codec)
6391{
6392 struct alc_spec *spec = codec->spec;
6393 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6394 hda_nid_t nid;
6395 unsigned int defcfg;
6396 int i;
6397
6398 for (i = 0; i < cfg->num_inputs; i++) {
6399 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6400 continue;
6401 nid = cfg->inputs[i].pin;
6402 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6403 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6404 continue;
6405 return nid;
6406 }
6407
6408 return 0;
6409}
6410
08a978db 6411static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6412 const struct hda_fixup *fix,
08a978db
DR
6413 int action)
6414{
6415 struct alc_spec *spec = codec->spec;
6416
0db75790 6417 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6418 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6419 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6420
6421 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6422 return;
bde7bc60 6423 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6424 }
08a978db 6425}
693b613d 6426
3e0d611b
DH
6427static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6428 const struct hda_fixup *fix,
6429 int action)
6430{
6431 struct alc_spec *spec = codec->spec;
6432 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6433 int i;
6434
6435 /* The mic boosts on level 2 and 3 are too noisy
6436 on the internal mic input.
6437 Therefore limit the boost to 0 or 1. */
6438
6439 if (action != HDA_FIXUP_ACT_PROBE)
6440 return;
6441
6442 for (i = 0; i < cfg->num_inputs; i++) {
6443 hda_nid_t nid = cfg->inputs[i].pin;
6444 unsigned int defcfg;
6445 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6446 continue;
6447 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6448 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6449 continue;
6450
6451 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6452 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6453 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6454 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6455 (0 << AC_AMPCAP_MUTE_SHIFT));
6456 }
6457}
6458
cd217a63 6459static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6460 struct hda_jack_callback *jack)
cd217a63
KY
6461{
6462 struct alc_spec *spec = codec->spec;
6463 int vref;
6464
6465 msleep(200);
6466 snd_hda_gen_hp_automute(codec, jack);
6467
6468 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6469
6470 msleep(600);
6471 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6472 vref);
6473}
6474
cd217a63
KY
6475static void alc283_fixup_chromebook(struct hda_codec *codec,
6476 const struct hda_fixup *fix, int action)
6477{
6478 struct alc_spec *spec = codec->spec;
cd217a63
KY
6479
6480 switch (action) {
6481 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6482 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6483 /* Disable AA-loopback as it causes white noise */
6484 spec->gen.mixer_nid = 0;
38070219 6485 break;
0202e99c 6486 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6487 /* MIC2-VREF control */
6488 /* Set to manual mode */
98b24883 6489 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6490 /* Enable Line1 input control by verb */
98b24883 6491 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6492 break;
6493 }
6494}
6495
6496static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6497 const struct hda_fixup *fix, int action)
6498{
6499 struct alc_spec *spec = codec->spec;
0202e99c
KY
6500
6501 switch (action) {
6502 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6503 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6504 break;
6505 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6506 /* MIC2-VREF control */
6507 /* Set to manual mode */
98b24883 6508 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6509 break;
6510 }
6511}
6512
7bba2157
TI
6513/* mute tablet speaker pin (0x14) via dock plugging in addition */
6514static void asus_tx300_automute(struct hda_codec *codec)
6515{
6516 struct alc_spec *spec = codec->spec;
6517 snd_hda_gen_update_outputs(codec);
6518 if (snd_hda_jack_detect(codec, 0x1b))
6519 spec->gen.mute_bits |= (1ULL << 0x14);
6520}
6521
6522static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6523 const struct hda_fixup *fix, int action)
6524{
6525 struct alc_spec *spec = codec->spec;
7bba2157
TI
6526 static const struct hda_pintbl dock_pins[] = {
6527 { 0x1b, 0x21114000 }, /* dock speaker pin */
6528 {}
6529 };
7bba2157
TI
6530
6531 switch (action) {
6532 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6533 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6534 /* TX300 needs to set up GPIO2 for the speaker amp */
6535 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6536 snd_hda_apply_pincfgs(codec, dock_pins);
6537 spec->gen.auto_mute_via_amp = 1;
6538 spec->gen.automute_hook = asus_tx300_automute;
6539 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6540 snd_hda_gen_hp_automute);
6541 break;
5579cd6f
TI
6542 case HDA_FIXUP_ACT_PROBE:
6543 spec->init_amp = ALC_INIT_DEFAULT;
6544 break;
7bba2157
TI
6545 case HDA_FIXUP_ACT_BUILD:
6546 /* this is a bit tricky; give more sane names for the main
6547 * (tablet) speaker and the dock speaker, respectively
6548 */
56798e6b
TI
6549 rename_ctl(codec, "Speaker Playback Switch",
6550 "Dock Speaker Playback Switch");
6551 rename_ctl(codec, "Bass Speaker Playback Switch",
6552 "Speaker Playback Switch");
7bba2157
TI
6553 break;
6554 }
6555}
6556
338cae56
DH
6557static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6558 const struct hda_fixup *fix, int action)
6559{
0f4881dc
DH
6560 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6561 /* DAC node 0x03 is giving mono output. We therefore want to
6562 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6563 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6564 static const hda_nid_t conn1[] = { 0x0c };
6565 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6566 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6567 }
338cae56
DH
6568}
6569
dd9aa335
HW
6570static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6571 const struct hda_fixup *fix, int action)
6572{
6573 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6574 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6575 we can't adjust the speaker's volume since this node does not has
6576 Amp-out capability. we change the speaker's route to:
6577 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6578 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6579 speaker's volume now. */
6580
caf3c043
MM
6581 static const hda_nid_t conn1[] = { 0x0c };
6582 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6583 }
6584}
6585
e312a869
TI
6586/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6587static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6588 const struct hda_fixup *fix, int action)
6589{
6590 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6591 static const hda_nid_t conn[] = { 0x02, 0x03 };
6592 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6593 }
6594}
6595
d2cd795c
JK
6596/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6597static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6598 const struct hda_fixup *fix, int action)
6599{
6600 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6601 static const hda_nid_t conn[] = { 0x02 };
6602 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6603 }
6604}
6605
a7df7f90
JK
6606/* disable DAC3 (0x06) selection on NID 0x15 - share Speaker/Bass Speaker DAC 0x03 */
6607static void alc294_fixup_bass_speaker_15(struct hda_codec *codec,
6608 const struct hda_fixup *fix, int action)
6609{
6610 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6611 static const hda_nid_t conn[] = { 0x02, 0x03 };
6612 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
41c66461 6613 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
a7df7f90
JK
6614 }
6615}
6616
98973f2f
KP
6617/* Hook to update amp GPIO4 for automute */
6618static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6619 struct hda_jack_callback *jack)
6620{
6621 struct alc_spec *spec = codec->spec;
6622
6623 snd_hda_gen_hp_automute(codec, jack);
6624 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6625 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6626 !spec->gen.hp_jack_present);
98973f2f
KP
6627}
6628
6629/* Manage GPIOs for HP EliteBook Folio 9480m.
6630 *
6631 * GPIO4 is the headphone amplifier power control
6632 * GPIO3 is the audio output mute indicator LED
6633 */
6634
6635static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6636 const struct hda_fixup *fix,
6637 int action)
6638{
6639 struct alc_spec *spec = codec->spec;
98973f2f 6640
01e4a275 6641 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6642 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6643 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6644 spec->gpio_mask |= 0x10;
6645 spec->gpio_dir |= 0x10;
98973f2f 6646 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6647 }
6648}
6649
ae065f1c
TI
6650static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6651 const struct hda_fixup *fix,
6652 int action)
6653{
6654 struct alc_spec *spec = codec->spec;
6655
6656 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6657 spec->gpio_mask |= 0x04;
6658 spec->gpio_dir |= 0x04;
6659 /* set data bit low */
6660 }
6661}
6662
6a6660d0
TI
6663/* Quirk for Thinkpad X1 7th and 8th Gen
6664 * The following fixed routing needed
6665 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6666 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6667 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6668 */
6669static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6670 const struct hda_fixup *fix, int action)
6671{
6672 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6673 static const hda_nid_t preferred_pairs[] = {
6674 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6675 };
6676 struct alc_spec *spec = codec->spec;
6677
6678 switch (action) {
6679 case HDA_FIXUP_ACT_PRE_PROBE:
6680 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6681 spec->gen.preferred_dacs = preferred_pairs;
6682 break;
6683 case HDA_FIXUP_ACT_BUILD:
6684 /* The generic parser creates somewhat unintuitive volume ctls
6685 * with the fixed routing above, and the shared DAC2 may be
6686 * confusing for PA.
6687 * Rename those to unique names so that PA doesn't touch them
6688 * and use only Master volume.
6689 */
6690 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6691 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6692 break;
6693 }
6694}
6695
ca169cc2
KY
6696static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6697 const struct hda_fixup *fix,
6698 int action)
6699{
6700 alc_fixup_dual_codecs(codec, fix, action);
6701 switch (action) {
6702 case HDA_FIXUP_ACT_PRE_PROBE:
6703 /* override card longname to provide a unique UCM profile */
6704 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6705 break;
6706 case HDA_FIXUP_ACT_BUILD:
6707 /* rename Capture controls depending on the codec */
6708 rename_ctl(codec, "Capture Volume",
6709 codec->addr == 0 ?
6710 "Rear-Panel Capture Volume" :
6711 "Front-Panel Capture Volume");
6712 rename_ctl(codec, "Capture Switch",
6713 codec->addr == 0 ?
6714 "Rear-Panel Capture Switch" :
6715 "Front-Panel Capture Switch");
6716 break;
6717 }
6718}
6719
52e4e368
KHF
6720static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6721 const struct hda_fixup *fix, int action)
6722{
6723 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6724 return;
6725
6726 codec->power_save_node = 1;
6727}
6728
92266651
KY
6729/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6730static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6731 const struct hda_fixup *fix, int action)
6732{
6733 struct alc_spec *spec = codec->spec;
caf3c043 6734 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6735 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6736 0
6737 };
6738
6739 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6740 return;
6741
6742 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6743 spec->gen.auto_mute_via_amp = 1;
6744 codec->power_save_node = 0;
92266651
KY
6745}
6746
e8fa236e
CC
6747/* avoid DAC 0x06 for speaker switch 0x17; it has no volume control */
6748static void alc274_fixup_hp_aio_bind_dacs(struct hda_codec *codec,
6749 const struct hda_fixup *fix, int action)
6750{
6751 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6752 /* The speaker is routed to the Node 0x06 by a mistake, thus the
6753 * speaker's volume can't be adjusted since the node doesn't have
6754 * Amp-out capability. Assure the speaker and lineout pin to be
6755 * coupled with DAC NID 0x02.
6756 */
6757 static const hda_nid_t preferred_pairs[] = {
6758 0x16, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6759 };
6760 struct alc_spec *spec = codec->spec;
6761
6762 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6763 spec->gen.preferred_dacs = preferred_pairs;
6764}
6765
c84bfedc
TI
6766/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6767static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6768 const struct hda_fixup *fix, int action)
6769{
6770 static const hda_nid_t preferred_pairs[] = {
6771 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6772 };
6773 struct alc_spec *spec = codec->spec;
6774
864773f9 6775 if (action == HDA_FIXUP_ACT_PRE_PROBE)
c84bfedc 6776 spec->gen.preferred_dacs = preferred_pairs;
c84bfedc
TI
6777}
6778
c4cfcf6f
HW
6779/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6780static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6781 const struct hda_fixup *fix, int action)
6782{
6783 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6784 return;
6785
6786 snd_hda_override_wcaps(codec, 0x03, 0);
6787}
6788
8a8de09c
KY
6789static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6790{
6791 switch (codec->core.vendor_id) {
6792 case 0x10ec0274:
6793 case 0x10ec0294:
6794 case 0x10ec0225:
6795 case 0x10ec0295:
6796 case 0x10ec0299:
6797 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6798 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6799 break;
1948fc06 6800 case 0x10ec0230:
8a8de09c
KY
6801 case 0x10ec0235:
6802 case 0x10ec0236:
6803 case 0x10ec0255:
6804 case 0x10ec0256:
cae2bdb5 6805 case 0x10ec0257:
527f4643 6806 case 0x19e58326:
8a8de09c
KY
6807 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6808 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6809 break;
6810 }
6811}
6812
8983eb60
KY
6813static void alc295_fixup_chromebook(struct hda_codec *codec,
6814 const struct hda_fixup *fix, int action)
6815{
d3ba58bb
KY
6816 struct alc_spec *spec = codec->spec;
6817
8983eb60 6818 switch (action) {
d3ba58bb
KY
6819 case HDA_FIXUP_ACT_PRE_PROBE:
6820 spec->ultra_low_power = true;
6821 break;
8983eb60 6822 case HDA_FIXUP_ACT_INIT:
8a8de09c 6823 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6824 break;
6825 }
6826}
6827
0df2b9ed
KY
6828static void alc256_fixup_chromebook(struct hda_codec *codec,
6829 const struct hda_fixup *fix, int action)
6830{
6831 struct alc_spec *spec = codec->spec;
6832
6833 switch (action) {
6834 case HDA_FIXUP_ACT_PRE_PROBE:
5ad8a4dd
KY
6835 if (codec->core.subsystem_id == 0x10280d76)
6836 spec->gen.suppress_auto_mute = 0;
6837 else
6838 spec->gen.suppress_auto_mute = 1;
0df2b9ed
KY
6839 spec->gen.suppress_auto_mic = 1;
6840 spec->en_3kpull_low = false;
6841 break;
6842 }
6843}
6844
d1dd4211
KY
6845static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6846 const struct hda_fixup *fix, int action)
6847{
6848 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6849 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6850}
6851
c3cdf189
LJ
6852
6853static void alc294_gx502_toggle_output(struct hda_codec *codec,
6854 struct hda_jack_callback *cb)
6855{
6856 /* The Windows driver sets the codec up in a very different way where
6857 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6858 */
6859 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6860 alc_write_coef_idx(codec, 0x10, 0x8a20);
6861 else
6862 alc_write_coef_idx(codec, 0x10, 0x0a20);
6863}
6864
6865static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6866 const struct hda_fixup *fix, int action)
6867{
6868 /* Pin 0x21: headphones/headset mic */
6869 if (!is_jack_detectable(codec, 0x21))
6870 return;
6871
6872 switch (action) {
6873 case HDA_FIXUP_ACT_PRE_PROBE:
6874 snd_hda_jack_detect_enable_callback(codec, 0x21,
6875 alc294_gx502_toggle_output);
6876 break;
6877 case HDA_FIXUP_ACT_INIT:
6878 /* Make sure to start in a correct state, i.e. if
6879 * headphones have been plugged in before powering up the system
6880 */
6881 alc294_gx502_toggle_output(codec, NULL);
6882 break;
6883 }
6884}
6885
c1b55029
DC
6886static void alc294_gu502_toggle_output(struct hda_codec *codec,
6887 struct hda_jack_callback *cb)
6888{
6889 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6890 * responsible from changes between speakers and headphones
6891 */
6892 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6893 alc_write_coef_idx(codec, 0x10, 0x8420);
6894 else
6895 alc_write_coef_idx(codec, 0x10, 0x0a20);
6896}
6897
6898static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6899 const struct hda_fixup *fix, int action)
6900{
6901 if (!is_jack_detectable(codec, 0x21))
6902 return;
6903
6904 switch (action) {
6905 case HDA_FIXUP_ACT_PRE_PROBE:
6906 snd_hda_jack_detect_enable_callback(codec, 0x21,
6907 alc294_gu502_toggle_output);
6908 break;
6909 case HDA_FIXUP_ACT_INIT:
6910 alc294_gu502_toggle_output(codec, NULL);
6911 break;
6912 }
6913}
6914
56496253
KY
6915static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6916 const struct hda_fixup *fix, int action)
6917{
6918 if (action != HDA_FIXUP_ACT_INIT)
6919 return;
6920
6921 msleep(100);
6922 alc_write_coef_idx(codec, 0x65, 0x0);
6923}
6924
8a8de09c
KY
6925static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6926 const struct hda_fixup *fix, int action)
6927{
6928 switch (action) {
6929 case HDA_FIXUP_ACT_INIT:
6930 alc_combo_jack_hp_jd_restart(codec);
6931 break;
6932 }
6933}
6934
92666d45
KY
6935static void alc_fixup_no_int_mic(struct hda_codec *codec,
6936 const struct hda_fixup *fix, int action)
6937{
6938 struct alc_spec *spec = codec->spec;
6939
6940 switch (action) {
6941 case HDA_FIXUP_ACT_PRE_PROBE:
6942 /* Mic RING SLEEVE swap for combo jack */
6943 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6944 spec->no_internal_mic_pin = true;
6945 break;
6946 case HDA_FIXUP_ACT_INIT:
6947 alc_combo_jack_hp_jd_restart(codec);
6948 break;
6949 }
6950}
6951
d94befbb
DB
6952/* GPIO1 = amplifier on/off
6953 * GPIO3 = mic mute LED
6954 */
6955static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6956 const struct hda_fixup *fix, int action)
6957{
6958 static const hda_nid_t conn[] = { 0x02 };
6959
6960 struct alc_spec *spec = codec->spec;
6961 static const struct hda_pintbl pincfgs[] = {
6962 { 0x14, 0x90170110 }, /* front/high speakers */
6963 { 0x17, 0x90170130 }, /* back/bass speakers */
6964 { }
6965 };
6966
6967 //enable micmute led
6968 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6969
6970 switch (action) {
6971 case HDA_FIXUP_ACT_PRE_PROBE:
6972 spec->micmute_led_polarity = 1;
6973 /* needed for amp of back speakers */
6974 spec->gpio_mask |= 0x01;
6975 spec->gpio_dir |= 0x01;
6976 snd_hda_apply_pincfgs(codec, pincfgs);
6977 /* share DAC to have unified volume control */
6978 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6979 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6980 break;
6981 case HDA_FIXUP_ACT_INIT:
6982 /* need to toggle GPIO to enable the amp of back speakers */
6983 alc_update_gpio_data(codec, 0x01, true);
6984 msleep(100);
6985 alc_update_gpio_data(codec, 0x01, false);
6986 break;
6987 }
6988}
6989
be0c40da
TI
6990/* GPIO1 = amplifier on/off */
6991static void alc285_fixup_hp_spectre_x360_df1(struct hda_codec *codec,
6992 const struct hda_fixup *fix,
6993 int action)
6994{
6995 struct alc_spec *spec = codec->spec;
6996 static const hda_nid_t conn[] = { 0x02 };
6997 static const struct hda_pintbl pincfgs[] = {
6998 { 0x14, 0x90170110 }, /* front/high speakers */
6999 { 0x17, 0x90170130 }, /* back/bass speakers */
7000 { }
7001 };
7002
7003 // enable mute led
7004 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
7005
7006 switch (action) {
7007 case HDA_FIXUP_ACT_PRE_PROBE:
7008 /* needed for amp of back speakers */
7009 spec->gpio_mask |= 0x01;
7010 spec->gpio_dir |= 0x01;
7011 snd_hda_apply_pincfgs(codec, pincfgs);
7012 /* share DAC to have unified volume control */
7013 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
7014 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7015 break;
7016 case HDA_FIXUP_ACT_INIT:
7017 /* need to toggle GPIO to enable the amp of back speakers */
7018 alc_update_gpio_data(codec, 0x01, true);
7019 msleep(100);
7020 alc_update_gpio_data(codec, 0x01, false);
7021 break;
7022 }
7023}
7024
434591b2
ED
7025static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
7026 const struct hda_fixup *fix, int action)
7027{
7028 static const hda_nid_t conn[] = { 0x02 };
7029 static const struct hda_pintbl pincfgs[] = {
7030 { 0x14, 0x90170110 }, /* rear speaker */
7031 { }
7032 };
7033
7034 switch (action) {
7035 case HDA_FIXUP_ACT_PRE_PROBE:
7036 snd_hda_apply_pincfgs(codec, pincfgs);
7037 /* force front speaker to DAC1 */
7038 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7039 break;
7040 }
7041}
7042
c0621669
AA
7043static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
7044 const struct hda_fixup *fix,
7045 int action)
7046{
7047 static const struct coef_fw coefs[] = {
7048 WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
7049 WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
7050 WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
7051 WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
7052 WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
7053 WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
7054 WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
7055 WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
7056 WRITE_COEF(0x6e, 0x1005), { }
7057 };
7058
7059 static const struct hda_pintbl pincfgs[] = {
7060 { 0x12, 0xb7a60130 }, /* Internal microphone*/
7061 { 0x14, 0x90170150 }, /* B&O soundbar speakers */
7062 { 0x17, 0x90170153 }, /* Side speakers */
7063 { 0x19, 0x03a11040 }, /* Headset microphone */
7064 { }
7065 };
7066
7067 switch (action) {
7068 case HDA_FIXUP_ACT_PRE_PROBE:
7069 snd_hda_apply_pincfgs(codec, pincfgs);
7070
7071 /* Fixes volume control problem for side speakers */
7072 alc295_fixup_disable_dac3(codec, fix, action);
7073
7074 /* Fixes no sound from headset speaker */
7075 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
7076
7077 /* Auto-enable headset mic when plugged */
7078 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
7079
7080 /* Headset mic volume enhancement */
7081 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
7082 break;
7083 case HDA_FIXUP_ACT_INIT:
7084 alc_process_coef_fw(codec, coefs);
7085 break;
7086 case HDA_FIXUP_ACT_BUILD:
7087 rename_ctl(codec, "Bass Speaker Playback Volume",
7088 "B&O-Tuned Playback Volume");
7089 rename_ctl(codec, "Front Playback Switch",
7090 "B&O Soundbar Playback Switch");
7091 rename_ctl(codec, "Bass Speaker Playback Switch",
7092 "Side Speaker Playback Switch");
7093 break;
7094 }
7095}
7096
aa85822c
MS
7097static void alc285_fixup_hp_beep(struct hda_codec *codec,
7098 const struct hda_fixup *fix, int action)
7099{
7100 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7101 codec->beep_just_power_on = true;
7102 } else if (action == HDA_FIXUP_ACT_INIT) {
7103#ifdef CONFIG_SND_HDA_INPUT_BEEP
7104 /*
7105 * Just enable loopback to internal speaker and headphone jack.
7106 * Disable amplification to get about the same beep volume as
7107 * was on pure BIOS setup before loading the driver.
7108 */
7109 alc_update_coef_idx(codec, 0x36, 0x7070, BIT(13));
7110
7111 snd_hda_enable_beep_device(codec, 1);
7112
7113#if !IS_ENABLED(CONFIG_INPUT_PCSPKR)
7114 dev_warn_once(hda_codec_dev(codec),
7115 "enable CONFIG_INPUT_PCSPKR to get PC beeps\n");
7116#endif
7117#endif
7118 }
7119}
7120
b317b032
TI
7121/* for hda_fixup_thinkpad_acpi() */
7122#include "thinkpad_helper.c"
b67ae3f1 7123
d5a6cabf
TI
7124static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
7125 const struct hda_fixup *fix, int action)
7126{
7127 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
7128 hda_fixup_thinkpad_acpi(codec, fix, action);
7129}
7130
d466887a
JD
7131/* for hda_fixup_ideapad_acpi() */
7132#include "ideapad_hotkey_led_helper.c"
7133
7134static void alc_fixup_ideapad_acpi(struct hda_codec *codec,
7135 const struct hda_fixup *fix, int action)
7136{
7137 hda_fixup_ideapad_acpi(codec, fix, action);
7138}
7139
ad7cc2d4
CB
7140/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
7141static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
7142 const struct hda_fixup *fix,
7143 int action)
7144{
7145 struct alc_spec *spec = codec->spec;
7146
7147 switch (action) {
7148 case HDA_FIXUP_ACT_PRE_PROBE:
7149 spec->gen.suppress_auto_mute = 1;
7150 break;
7151 }
7152}
7153
7ce66933
SB
7154static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
7155{
7156 struct hda_codec *cdc = data;
7157 struct alc_spec *spec = cdc->spec;
7ce66933
SB
7158
7159 codec_info(cdc, "ACPI Notification %d\n", event);
7160
960ccf6e 7161 hda_component_acpi_device_notify(&spec->comps, handle, event, data);
7ce66933
SB
7162}
7163
d3dca026
LT
7164static int comp_bind(struct device *dev)
7165{
7166 struct hda_codec *cdc = dev_to_hda_codec(dev);
7167 struct alc_spec *spec = cdc->spec;
7ce66933
SB
7168 int ret;
7169
960ccf6e 7170 ret = hda_component_manager_bind(cdc, &spec->comps);
7ce66933
SB
7171 if (ret)
7172 return ret;
1873ebd3 7173
fd895a74 7174 return hda_component_manager_bind_acpi_notifications(cdc,
960ccf6e 7175 &spec->comps,
fd895a74 7176 comp_acpi_device_notify, cdc);
d3dca026
LT
7177}
7178
7179static void comp_unbind(struct device *dev)
7180{
7181 struct hda_codec *cdc = dev_to_hda_codec(dev);
7182 struct alc_spec *spec = cdc->spec;
7183
960ccf6e
ST
7184 hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify);
7185 hda_component_manager_unbind(cdc, &spec->comps);
d3dca026
LT
7186}
7187
7188static const struct component_master_ops comp_master_ops = {
7189 .bind = comp_bind,
7190 .unbind = comp_unbind,
7191};
7192
7193static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
7194 struct snd_pcm_substream *sub, int action)
7195{
7196 struct alc_spec *spec = cdc->spec;
ae7abe36 7197
960ccf6e 7198 hda_component_manager_playback_hook(&spec->comps, action);
ae7abe36
SB
7199}
7200
cf0d9566
RF
7201static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
7202 const char *hid, const char *match_str, int count)
3babae91 7203{
3babae91 7204 struct alc_spec *spec = cdc->spec;
3babae91
SD
7205 int ret;
7206
7207 switch (action) {
7208 case HDA_FIXUP_ACT_PRE_PROBE:
960ccf6e 7209 ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid,
fd895a74 7210 match_str, &comp_master_ops);
3babae91 7211 if (ret)
fd895a74
RF
7212 return;
7213
7214 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
3babae91
SD
7215 break;
7216 case HDA_FIXUP_ACT_FREE:
2186fe21 7217 hda_component_manager_free(&spec->comps, &comp_master_ops);
3babae91
SD
7218 break;
7219 }
7220}
7221
2186fe21 7222static void find_cirrus_companion_amps(struct hda_codec *cdc)
03c5c350
ST
7223{
7224 struct device *dev = hda_codec_dev(cdc);
7225 struct acpi_device *adev;
7226 struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
7227 const char *bus = NULL;
7228 static const struct {
7229 const char *hid;
7230 const char *name;
7231 } acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
7232 { "CSC3556", "cs35l56-hda" },
7233 { "CSC3557", "cs35l57-hda" }};
7234 char *match;
7235 int i, count = 0, count_devindex = 0;
7236
2186fe21
ST
7237 for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
7238 adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
7239 if (adev)
7240 break;
7241 }
7242 if (!adev) {
7243 codec_dbg(cdc, "Did not find ACPI entry for a Cirrus Amp\n");
7244 return;
7245 }
03c5c350 7246
2186fe21
ST
7247 count = i2c_acpi_client_count(adev);
7248 if (count > 0) {
7249 bus = "i2c";
7250 } else {
7251 count = acpi_spi_count_resources(adev);
7252 if (count > 0)
7253 bus = "spi";
7254 }
03c5c350 7255
2186fe21
ST
7256 fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
7257 acpi_dev_put(adev);
03c5c350 7258
2186fe21
ST
7259 if (!bus) {
7260 codec_err(cdc, "Did not find any buses for %s\n", acpi_ids[i].hid);
7261 return;
7262 }
03c5c350 7263
2186fe21
ST
7264 if (!fwnode) {
7265 codec_err(cdc, "Could not get fwnode for %s\n", acpi_ids[i].hid);
7266 return;
7267 }
03c5c350 7268
2186fe21
ST
7269 /*
7270 * When available the cirrus,dev-index property is an accurate
7271 * count of the amps in a system and is used in preference to
7272 * the count of bus devices that can contain additional address
7273 * alias entries.
7274 */
7275 count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
7276 if (count_devindex > 0)
7277 count = count_devindex;
03c5c350 7278
2186fe21
ST
7279 match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
7280 if (!match)
7281 return;
7282 codec_info(cdc, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
7283 comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
03c5c350
ST
7284}
7285
ae7abe36
SB
7286static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7287{
cf0d9566 7288 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
ae7abe36
SB
7289}
7290
42320660
SB
7291static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7292{
cf0d9566 7293 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
42320660
SB
7294}
7295
07bcab93
LT
7296static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7297{
cf0d9566 7298 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
225f6e1b
TI
7299}
7300
07bcab93
LT
7301static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
7302{
cf0d9566 7303 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
07bcab93
LT
7304}
7305
d3dca026
LT
7306static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7307 int action)
7308{
cf0d9566 7309 comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
d3dca026
LT
7310}
7311
1e24881d
LT
7312static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
7313 int action)
7314{
cf0d9566 7315 comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
1e24881d
LT
7316}
7317
c33f0d4f
ST
7318static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7319{
7320 /*
7321 * The same SSID has been re-used in different hardware, they have
7322 * different codecs and the newer GA403U has a ALC285.
7323 */
2186fe21 7324 if (cdc->core.vendor_id != 0x10ec0285)
c33f0d4f
ST
7325 alc_fixup_inv_dmic(cdc, fix, action);
7326}
7327
3babae91
SD
7328static void tas2781_fixup_i2c(struct hda_codec *cdc,
7329 const struct hda_fixup *fix, int action)
7330{
cf0d9566 7331 comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
3babae91
SD
7332}
7333
bb5f86ea
BX
7334static void tas2781_fixup_spi(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
7335{
7336 comp_generic_fixup(cdc, action, "spi", "TXNW2781", "-%s:00-tas2781-hda.%d", 2);
7337}
7338
b5cb53fd
GK
7339static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
7340 const struct hda_fixup *fix, int action)
7341{
cf0d9566 7342 comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
b5cb53fd
GK
7343}
7344
bd2d8305
IM
7345static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
7346 const struct hda_fixup *fix, int action)
7347{
7348 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
7349}
7350
7351
bbf8ff6b
TB
7352/* for alc295_fixup_hp_top_speakers */
7353#include "hp_x360_helper.c"
7354
26928ca1
TI
7355/* for alc285_fixup_ideapad_s740_coef() */
7356#include "ideapad_s740_helper.c"
7357
619764cc
WS
7358static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
7359 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
7360 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
7361 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
7362 {}
7363};
7364
7365static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
7366 const struct hda_fixup *fix,
7367 int action)
dd6dd6e3
WS
7368{
7369 /*
619764cc
WS
7370 * A certain other OS sets these coeffs to different values. On at least
7371 * one TongFang barebone these settings might survive even a cold
7372 * reboot. So to restore a clean slate the values are explicitly reset
7373 * to default here. Without this, the external microphone is always in a
7374 * plugged-in state, while the internal microphone is always in an
7375 * unplugged state, breaking the ability to use the internal microphone.
7376 */
7377 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
7378}
7379
174a7fb3
WS
7380static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
7381 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
7382 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
7383 WRITE_COEF(0x49, 0x0149),
7384 {}
7385};
7386
7387static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
7388 const struct hda_fixup *fix,
7389 int action)
7390{
7391 /*
7392 * The audio jack input and output is not detected on the ASRock NUC Box
7393 * 1100 series when cold booting without this fix. Warm rebooting from a
7394 * certain other OS makes the audio functional, as COEF settings are
7395 * preserved in this case. This fix sets these altered COEF values as
7396 * the default.
7397 */
7398 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
7399}
7400
edca7cc4
WS
7401static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
7402 const struct hda_fixup *fix,
7403 int action)
7404{
7405 /*
7406 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
7407 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
7408 * needs an additional quirk for sound working after suspend and resume.
7409 */
7410 if (codec->core.vendor_id == 0x10ec0256) {
7411 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
7412 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
7413 } else {
7414 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
7415 }
7416}
7417
1e5dc398
HW
7418static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
7419 const struct hda_fixup *fix, int action)
7420{
7421 u32 caps;
7422 u8 nsteps, offs;
7423
7424 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7425 return;
7426
7427 caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
7428 nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
7429 offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
7430 caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
7431 caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
7432
7433 if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
7434 codec_warn(codec, "failed to override amp caps for NID 0x3\n");
7435}
7436
1efcdd9c
GM
7437static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7438 const struct hda_fixup *fix,
7439 int action)
7440{
7441 struct alc_spec *spec = codec->spec;
7442 struct hda_input_mux *imux = &spec->gen.input_mux;
7443 int i;
7444
7445 alc269_fixup_limit_int_mic_boost(codec, fix, action);
7446
7447 switch (action) {
7448 case HDA_FIXUP_ACT_PRE_PROBE:
7449 /**
7450 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7451 * to Hi-Z to avoid pop noises at startup and when plugging and
7452 * unplugging headphones.
7453 */
7454 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7455 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7456 break;
7457 case HDA_FIXUP_ACT_PROBE:
7458 /**
7459 * Make the internal mic (0x12) the default input source to
7460 * prevent pop noises on cold boot.
7461 */
7462 for (i = 0; i < imux->num_items; i++) {
7463 if (spec->gen.imux_pins[i] == 0x12) {
7464 spec->gen.cur_mux[0] = i;
7465 break;
7466 }
7467 }
7468 break;
7469 }
7470}
7471
3790a3d6
PJ
7472static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7473 const struct hda_fixup *fix, int action)
7474{
7475 /*
7476 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7477 * unconnected.
7478 */
7479 static const struct hda_pintbl pincfgs[] = {
7480 { 0x17, 0x90170121 },
7481 { }
7482 };
7483 /*
7484 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7485 * DAC 0x02 and 0x03 would be fine.
7486 */
7487 static const hda_nid_t conn[] = { 0x02, 0x03 };
7488 /*
7489 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7490 * Headphones (0x21) are connected to DAC 0x03.
7491 */
7492 static const hda_nid_t preferred_pairs[] = {
7493 0x14, 0x02,
7494 0x17, 0x02,
7495 0x21, 0x03,
7496 0
7497 };
7498 struct alc_spec *spec = codec->spec;
7499
7500 switch (action) {
7501 case HDA_FIXUP_ACT_PRE_PROBE:
7502 snd_hda_apply_pincfgs(codec, pincfgs);
7503 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7504 spec->gen.preferred_dacs = preferred_pairs;
7505 break;
7506 }
7507}
7508
2912cdda
PJ
7509static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7510 const struct hda_fixup *fix, int action)
7511{
7512 static const struct hda_pintbl pincfgs[] = {
7513 { 0x14, 0x90170151 },
7514 { 0x17, 0x90170150 },
7515 { }
7516 };
7517 static const hda_nid_t conn[] = { 0x02, 0x03 };
7518 static const hda_nid_t preferred_pairs[] = {
7519 0x14, 0x02,
7520 0x17, 0x03,
7521 0x21, 0x02,
7522 0
7523 };
7524 struct alc_spec *spec = codec->spec;
7525
7526 alc_fixup_no_shutup(codec, fix, action);
7527
7528 switch (action) {
7529 case HDA_FIXUP_ACT_PRE_PROBE:
7530 snd_hda_apply_pincfgs(codec, pincfgs);
7531 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7532 spec->gen.preferred_dacs = preferred_pairs;
7533 break;
7534 }
7535}
7536
e43252db
KY
7537/* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7538static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7539 const struct hda_fixup *fix, int action)
7540{
7541 struct alc_spec *spec = codec->spec;
7542 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7543 static const hda_nid_t preferred_pairs[] = {
7544 0x17, 0x02, 0x21, 0x03, 0
7545 };
7546
7547 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7548 return;
7549
7550 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7551 spec->gen.preferred_dacs = preferred_pairs;
7552 spec->gen.auto_mute_via_amp = 1;
fb6254df
KY
7553 if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7554 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7555 0x0); /* Make sure 0x14 was disable */
7556 }
e43252db 7557}
c8c0a03e
KY
7558/* Fix none verb table of Headset Mic pin */
7559static void alc_fixup_headset_mic(struct hda_codec *codec,
7560 const struct hda_fixup *fix, int action)
7561{
7562 struct alc_spec *spec = codec->spec;
7563 static const struct hda_pintbl pincfgs[] = {
7564 { 0x19, 0x03a1103c },
7565 { }
7566 };
7567
7568 switch (action) {
7569 case HDA_FIXUP_ACT_PRE_PROBE:
7570 snd_hda_apply_pincfgs(codec, pincfgs);
7571 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7572 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7573 break;
7574 }
7575}
e43252db 7576
61456da0
AG
7577static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
7578 const struct hda_fixup *fix, int action)
7579{
7580 /*
7581 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7582 * unconnected.
7583 * The Pin Complex 0x17 for the bass speakers has the lowest association
7584 * and sequence values so shift it up a bit to squeeze 0x14 in.
7585 */
7586 static const struct hda_pintbl pincfgs[] = {
7587 { 0x14, 0x90170110 }, // top/treble
7588 { 0x17, 0x90170111 }, // bottom/bass
7589 { }
7590 };
7591
7592 /*
7593 * Force DAC 0x02 for the bass speakers 0x17.
7594 */
7595 static const hda_nid_t conn[] = { 0x02 };
7596
7597 switch (action) {
7598 case HDA_FIXUP_ACT_PRE_PROBE:
7599 snd_hda_apply_pincfgs(codec, pincfgs);
7600 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7601 break;
7602 }
7603
7604 cs35l41_fixup_i2c_two(codec, fix, action);
7605 alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7606 alc245_fixup_hp_gpio_led(codec, fix, action);
7607}
7608
557f6e4a 7609/* some changes for Spectre x360 16, 2024 model */
7610static void alc245_fixup_hp_spectre_x360_16_aa0xxx(struct hda_codec *codec,
7611 const struct hda_fixup *fix, int action)
7612{
7613 /*
7614 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7615 * unconnected.
7616 * The Pin Complex 0x17 for the bass speakers has the lowest association
7617 * and sequence values so shift it up a bit to squeeze 0x14 in.
7618 */
7619 struct alc_spec *spec = codec->spec;
7620 static const struct hda_pintbl pincfgs[] = {
7621 { 0x14, 0x90170110 }, // top/treble
7622 { 0x17, 0x90170111 }, // bottom/bass
7623 { }
7624 };
7625
7626 /*
7627 * Force DAC 0x02 for the bass speakers 0x17.
7628 */
7629 static const hda_nid_t conn[] = { 0x02 };
7630
7631 switch (action) {
7632 case HDA_FIXUP_ACT_PRE_PROBE:
7633 /* needed for amp of back speakers */
7634 spec->gpio_mask |= 0x01;
7635 spec->gpio_dir |= 0x01;
7636 snd_hda_apply_pincfgs(codec, pincfgs);
7637 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7638 break;
7639 case HDA_FIXUP_ACT_INIT:
7640 /* need to toggle GPIO to enable the amp of back speakers */
7641 alc_update_gpio_data(codec, 0x01, true);
7642 msleep(100);
7643 alc_update_gpio_data(codec, 0x01, false);
7644 break;
7645 }
7646
7647 cs35l41_fixup_i2c_two(codec, fix, action);
7648 alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7649 alc245_fixup_hp_gpio_led(codec, fix, action);
7650}
7651
22c7f772
KY
7652static void alc245_fixup_hp_zbook_firefly_g12a(struct hda_codec *codec,
7653 const struct hda_fixup *fix, int action)
7654{
7655 struct alc_spec *spec = codec->spec;
7656 static const hda_nid_t conn[] = { 0x02 };
7657
7658 switch (action) {
7659 case HDA_FIXUP_ACT_PRE_PROBE:
7660 spec->gen.auto_mute_via_amp = 1;
7661 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7662 break;
7663 }
7664
7665 cs35l41_fixup_i2c_two(codec, fix, action);
7666 alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7667 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
7668}
7669
1e707769
KY
7670/*
7671 * ALC287 PCM hooks
7672 */
7673static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
7674 struct hda_codec *codec,
7675 struct snd_pcm_substream *substream,
7676 int action)
7677{
1e707769
KY
7678 switch (action) {
7679 case HDA_GEN_PCM_ACT_OPEN:
7680 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
7681 break;
7682 case HDA_GEN_PCM_ACT_CLOSE:
7683 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7684 break;
7685 }
7686}
7687
03002d18 7688static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
1e707769
KY
7689{
7690 if (is_s4_suspend(codec)) {
1e707769
KY
7691 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7692 }
7693}
7694
7695static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
7696 const struct hda_fixup *fix, int action)
7697{
7698 struct alc_spec *spec = codec->spec;
2143c8ae
KY
7699 static const struct coef_fw coefs[] = {
7700 WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC300),
7701 WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
7702 WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC301),
7703 WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
7704 };
1e707769
KY
7705
7706 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7707 return;
2143c8ae
KY
7708 alc_update_coef_idx(codec, 0x10, 1<<11, 1<<11);
7709 alc_process_coef_fw(codec, coefs);
1e707769
KY
7710 spec->power_hook = alc287_s4_power_gpio3_default;
7711 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
7712}
7713
8c2fa441
TI
7714/*
7715 * Clear COEF 0x0d (PCBEEP passthrough) bit 0x40 where BIOS sets it wrongly
7716 * at PM resume
7717 */
7718static void alc283_fixup_dell_hp_resume(struct hda_codec *codec,
7719 const struct hda_fixup *fix, int action)
7720{
7721 if (action == HDA_FIXUP_ACT_INIT)
7722 alc_write_coef_idx(codec, 0xd, 0x2800);
7723}
e43252db 7724
1d045db9 7725enum {
f73bbf63 7726 ALC269_FIXUP_GPIO2,
1d045db9
TI
7727 ALC269_FIXUP_SONY_VAIO,
7728 ALC275_FIXUP_SONY_VAIO_GPIO2,
7729 ALC269_FIXUP_DELL_M101Z,
7730 ALC269_FIXUP_SKU_IGNORE,
7731 ALC269_FIXUP_ASUS_G73JW,
e959f2be
PLB
7732 ALC269_FIXUP_ASUS_N7601ZM_PINS,
7733 ALC269_FIXUP_ASUS_N7601ZM,
1d045db9
TI
7734 ALC269_FIXUP_LENOVO_EAPD,
7735 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 7736 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 7737 ALC271_FIXUP_DMIC,
017f2a10 7738 ALC269_FIXUP_PCM_44K,
adabb3ec 7739 ALC269_FIXUP_STEREO_DMIC,
7c478f03 7740 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
7741 ALC269_FIXUP_QUANTA_MUTE,
7742 ALC269_FIXUP_LIFEBOOK,
2041d564 7743 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 7744 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 7745 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 7746 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
7747 ALC269_FIXUP_AMIC,
7748 ALC269_FIXUP_DMIC,
7749 ALC269VB_FIXUP_AMIC,
7750 ALC269VB_FIXUP_DMIC,
08fb0d0e 7751 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 7752 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 7753 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 7754 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 7755 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
7756 ALC269_FIXUP_HP_GPIO_MIC1_LED,
7757 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 7758 ALC269_FIXUP_INV_DMIC,
108cc108 7759 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 7760 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 7761 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 7762 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 7763 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597 7764 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
78e7be01 7765 ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
73bdd597 7766 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 7767 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 7768 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
1efcdd9c 7769 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
73bdd597
DH
7770 ALC269_FIXUP_HEADSET_MODE,
7771 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 7772 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
7773 ALC269_FIXUP_ASUS_X101_FUNC,
7774 ALC269_FIXUP_ASUS_X101_VERB,
7775 ALC269_FIXUP_ASUS_X101,
08a978db
DR
7776 ALC271_FIXUP_AMIC_MIC2,
7777 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 7778 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 7779 ALC269_FIXUP_ACER_AC700,
3e0d611b 7780 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 7781 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 7782 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
f882c4be 7783 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
8e35cd4a 7784 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 7785 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 7786 ALC283_FIXUP_CHROME_BOOK,
0202e99c 7787 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 7788 ALC282_FIXUP_ASUS_TX300,
1bb3e062 7789 ALC283_FIXUP_INT_MIC,
338cae56 7790 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
7791 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7792 ALC290_FIXUP_SUBWOOFER,
7793 ALC290_FIXUP_SUBWOOFER_HSJACK,
b11a74ac 7794 ALC295_FIXUP_HP_MUTE_LED_COEFBIT11,
b67ae3f1 7795 ALC269_FIXUP_THINKPAD_ACPI,
d466887a 7796 ALC269_FIXUP_LENOVO_XPAD_ACPI,
56f27013 7797 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
ef5fbdf7 7798 ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13,
5ebe792a 7799 ALC269VC_FIXUP_INFINIX_Y4_MAX,
7c9caa29 7800 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
5824ce8d 7801 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 7802 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 7803 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
78e7be01 7804 ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
31278997 7805 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 7806 ALC255_FIXUP_HEADSET_MODE,
31278997 7807 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 7808 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 7809 ALC292_FIXUP_TPT440_DOCK,
9a811230 7810 ALC292_FIXUP_TPT440,
abaa2274 7811 ALC283_FIXUP_HEADSET_MIC,
b3802783 7812 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 7813 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 7814 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 7815 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 7816 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 7817 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 7818 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 7819 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 7820 ALC280_FIXUP_HP_9480M,
c3bb2b52 7821 ALC245_FIXUP_HP_X360_AMP,
d94befbb 7822 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
be0c40da 7823 ALC285_FIXUP_HP_SPECTRE_X360_DF1,
c0621669 7824 ALC285_FIXUP_HP_ENVY_X360,
e1e62b98
KY
7825 ALC288_FIXUP_DELL_HEADSET_MODE,
7826 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
7827 ALC288_FIXUP_DELL_XPS_13,
7828 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 7829 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
7830 ALC292_FIXUP_DELL_E7X,
7831 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 7832 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 7833 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 7834 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 7835 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 7836 ALC275_FIXUP_DELL_XPS,
23adc192 7837 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 7838 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
f603b159 7839 ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED,
3b43b71f 7840 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 7841 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 7842 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 7843 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 7844 ALC285_FIXUP_SPEAKER2_TO_DAC1,
4b963ae1
AS
7845 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7846 ALC285_FIXUP_ASUS_HEADSET_MIC,
b759a5f0 7847 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
8cc87c05
LJ
7848 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7849 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
f883982d 7850 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 7851 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 7852 ALC292_FIXUP_TPT460,
dd9aa335 7853 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 7854 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 7855 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 7856 ALC269_FIXUP_ATIV_BOOK_8,
4ba5c853 7857 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
9eb5d0e6 7858 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
7859 ALC256_FIXUP_ASUS_HEADSET_MODE,
7860 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 7861 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
7862 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7863 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 7864 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 7865 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 7866 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 7867 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 7868 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 7869 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
7870 ALC274_FIXUP_DELL_BIND_DACS,
7871 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 7872 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 7873 ALC298_FIXUP_TPT470_DOCK,
ae104a21 7874 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 7875 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 7876 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 7877 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 7878 ALC295_FIXUP_HP_X360,
8a328ac1 7879 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 7880 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 7881 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 7882 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 7883 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
7884 ALC294_FIXUP_ASUS_HEADSET_MIC,
7885 ALC294_FIXUP_ASUS_SPK,
89e3a568 7886 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 7887 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 7888 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 7889 ALC295_FIXUP_CHROME_BOOK,
8983eb60 7890 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
7891 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7892 ALC225_FIXUP_WYSE_AUTO_MUTE,
7893 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 7894 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 7895 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 7896 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
35fdc6e1 7897 ALC255_FIXUP_PREDATOR_SUBWOOFER,
e2a829b3 7898 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 7899 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
f0d9da19 7900 ALC289_FIXUP_DELL_SPK1,
e79c2269
KY
7901 ALC289_FIXUP_DELL_SPK2,
7902 ALC289_FIXUP_DUAL_SPK,
f0d9da19 7903 ALC289_FIXUP_RTK_AMP_DUAL_SPK,
48e01504
CC
7904 ALC294_FIXUP_SPK2_TO_DAC1,
7905 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 7906 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 7907 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
724418b8
MA
7908 ALC294_FIXUP_ASUS_ALLY,
7909 ALC294_FIXUP_ASUS_ALLY_PINS,
7910 ALC294_FIXUP_ASUS_ALLY_VERBS,
7911 ALC294_FIXUP_ASUS_ALLY_SPEAKER,
8b33a134 7912 ALC294_FIXUP_ASUS_HPE,
1b94e59d 7913 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
7914 ALC294_FIXUP_ASUS_GX502_HP,
7915 ALC294_FIXUP_ASUS_GX502_PINS,
7916 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
7917 ALC294_FIXUP_ASUS_GU502_HP,
7918 ALC294_FIXUP_ASUS_GU502_PINS,
7919 ALC294_FIXUP_ASUS_GU502_VERBS,
c611e659 7920 ALC294_FIXUP_ASUS_G513_PINS,
bc2c2354 7921 ALC285_FIXUP_ASUS_G533Z_PINS,
f5a88b0a 7922 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 7923 ALC285_FIXUP_HP_MUTE_LED,
ca88eeb3 7924 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
aa85822c 7925 ALC285_FIXUP_HP_BEEP_MICMUTE_LED,
0659400f 7926 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
e7d66cf7 7927 ALC236_FIXUP_HP_GPIO_LED,
24164f43 7928 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 7929 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
ef27e89e 7930 ALC236_FIXUP_LENOVO_INV_DMIC,
a2d57ebe 7931 ALC298_FIXUP_SAMSUNG_AMP,
7e4d4b32
JG
7932 ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS,
7933 ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS,
14425f1f 7934 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ef248d9b 7935 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 7936 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 7937 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 7938 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 7939 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 7940 ALC289_FIXUP_ASUS_GA401,
4b43d05a 7941 ALC289_FIXUP_ASUS_GA502,
f50a121d 7942 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 7943 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
7944 ALC269_FIXUP_CZC_B20,
7945 ALC269_FIXUP_CZC_TMI,
7946 ALC269_FIXUP_CZC_L101,
7947 ALC269_FIXUP_LEMOTE_A1802,
7948 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 7949 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
7950 ALC233_FIXUP_INTEL_NUC8_DMIC,
7951 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 7952 ALC256_FIXUP_INTEL_NUC10,
fc19d559 7953 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 7954 ALC274_FIXUP_HP_MIC,
8a8de09c 7955 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 7956 ALC274_FIXUP_HP_ENVY_GPIO,
1b452c2d 7957 ALC274_FIXUP_ASUS_ZEN_AIO_27,
ef9ce66f 7958 ALC256_FIXUP_ASUS_HPE,
446b8185 7959 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 7960 ALC287_FIXUP_HP_GPIO_LED,
9e885770 7961 ALC256_FIXUP_HP_HEADSET_MIC,
5fc462c3 7962 ALC245_FIXUP_HP_GPIO_LED,
92666d45 7963 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 7964 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 7965 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 7966 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 7967 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 7968 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 7969 ALC295_FIXUP_ASUS_DACS,
5d84b531 7970 ALC295_FIXUP_HP_OMEN,
f2be77fe 7971 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 7972 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 7973 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 7974 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 7975 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
7976 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7977 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7978 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
56ec3e75 7979 ALC298_FIXUP_LENOVO_C940_DUET7,
dd6dd6e3 7980 ALC287_FIXUP_13S_GEN2_SPEAKERS,
619764cc 7981 ALC256_FIXUP_SET_COEF_DEFAULTS,
1278cc5a 7982 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
174a7fb3 7983 ALC233_FIXUP_NO_AUDIO_JACK,
edca7cc4 7984 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
8f4c9042
BF
7985 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7986 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
d3dca026 7987 ALC287_FIXUP_LEGION_16ACHG6,
ae7abe36 7988 ALC287_FIXUP_CS35L41_I2C_2,
b3fbe536 7989 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
42320660 7990 ALC287_FIXUP_CS35L41_I2C_4,
07bcab93 7991 ALC245_FIXUP_CS35L41_SPI_2,
ce18f905 7992 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
07bcab93
LT
7993 ALC245_FIXUP_CS35L41_SPI_4,
7994 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
91502a9a 7995 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
309d7363 7996 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
1e24881d 7997 ALC287_FIXUP_LEGION_16ITHG6,
3790a3d6
PJ
7998 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7999 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
9b714a59 8000 ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
2912cdda 8001 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
a4517c4f 8002 ALC236_FIXUP_DELL_DUAL_CODECS,
f7b069cf 8003 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
3babae91 8004 ALC287_FIXUP_TAS2781_I2C,
bb5f86ea 8005 ALC245_FIXUP_TAS2781_SPI_2,
b5cb53fd 8006 ALC287_FIXUP_YOGA7_14ARB7_I2C,
93dc18e1 8007 ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
e5182305 8008 ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT,
c99c26b1 8009 ALC245_FIXUP_HP_X360_MUTE_LEDS,
e43252db 8010 ALC287_FIXUP_THINKPAD_I2S_SPK,
d93eeca6 8011 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
c8c0a03e 8012 ALC2XX_FIXUP_HEADSET_MIC,
f0d9da19 8013 ALC289_FIXUP_DELL_CS35L41_SPI_2,
6ae90e90 8014 ALC294_FIXUP_CS35L41_I2C_2,
bd2d8305 8015 ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
1e5dc398 8016 ALC256_FIXUP_HEADPHONE_AMP_VOL,
61456da0 8017 ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
557f6e4a 8018 ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX,
22c7f772 8019 ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A,
c33f0d4f 8020 ALC285_FIXUP_ASUS_GA403U,
0672b017
VT
8021 ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
8022 ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
8023 ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
1e707769
KY
8024 ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
8025 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
0df2b9ed 8026 ALC256_FIXUP_CHROME_BOOK,
56275550 8027 ALC245_FIXUP_CLEVO_NOISY_MIC,
fc09ea51 8028 ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
31917b7b 8029 ALC233_FIXUP_MEDION_MTL_SPK,
a7df7f90 8030 ALC294_FIXUP_BASS_SPEAKER_15,
8c2fa441 8031 ALC283_FIXUP_DELL_HP_RESUME,
b5458fca 8032 ALC294_FIXUP_ASUS_CS35L41_SPI_2,
e8fa236e 8033 ALC274_FIXUP_HP_AIO_BIND_DACS,
d64cbb5e 8034 ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2,
60599e4f
ST
8035 ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC,
8036 ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1,
33bdee12 8037 ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC,
f1d4e28b
KY
8038};
8039
56ec3e75
TI
8040/* A special fixup for Lenovo C940 and Yoga Duet 7;
8041 * both have the very same PCI SSID, and we need to apply different fixups
8042 * depending on the codec ID
8043 */
8044static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
8045 const struct hda_fixup *fix,
8046 int action)
8047{
8048 int id;
8049
8050 if (codec->core.vendor_id == 0x10ec0298)
8051 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
8052 else
8053 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
8054 __snd_hda_apply_fixup(codec, id, action, 0);
8055}
8056
1727a771 8057static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
8058 [ALC269_FIXUP_GPIO2] = {
8059 .type = HDA_FIXUP_FUNC,
8060 .v.func = alc_fixup_gpio2,
8061 },
1d045db9 8062 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
8063 .type = HDA_FIXUP_PINCTLS,
8064 .v.pins = (const struct hda_pintbl[]) {
8065 {0x19, PIN_VREFGRD},
1d045db9
TI
8066 {}
8067 }
f1d4e28b 8068 },
1d045db9 8069 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
8070 .type = HDA_FIXUP_FUNC,
8071 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
8072 .chained = true,
8073 .chain_id = ALC269_FIXUP_SONY_VAIO
8074 },
8075 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 8076 .type = HDA_FIXUP_VERBS,
1d045db9
TI
8077 .v.verbs = (const struct hda_verb[]) {
8078 /* Enables internal speaker */
8079 {0x20, AC_VERB_SET_COEF_INDEX, 13},
8080 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
8081 {}
8082 }
8083 },
8084 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 8085 .type = HDA_FIXUP_FUNC,
23d30f28 8086 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
8087 },
8088 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
8089 .type = HDA_FIXUP_PINS,
8090 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
8091 { 0x17, 0x99130111 }, /* subwoofer */
8092 { }
8093 }
8094 },
e959f2be
PLB
8095 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
8096 .type = HDA_FIXUP_PINS,
8097 .v.pins = (const struct hda_pintbl[]) {
8098 { 0x19, 0x03A11050 },
8099 { 0x1a, 0x03A11C30 },
8100 { 0x21, 0x03211420 },
8101 { }
8102 }
8103 },
8104 [ALC269_FIXUP_ASUS_N7601ZM] = {
8105 .type = HDA_FIXUP_VERBS,
8106 .v.verbs = (const struct hda_verb[]) {
8107 {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
8108 {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
8109 {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
8110 {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
8111 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
8112 {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
8113 { }
8114 },
8115 .chained = true,
8116 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
8117 },
1d045db9 8118 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 8119 .type = HDA_FIXUP_VERBS,
1d045db9
TI
8120 .v.verbs = (const struct hda_verb[]) {
8121 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8122 {}
8123 }
8124 },
8125 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 8126 .type = HDA_FIXUP_FUNC,
1d045db9
TI
8127 .v.func = alc269_fixup_hweq,
8128 .chained = true,
8129 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
8130 },
e9bd7d5c
TI
8131 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
8132 .type = HDA_FIXUP_FUNC,
8133 .v.func = alc_fixup_disable_aamix,
8134 .chained = true,
8135 .chain_id = ALC269_FIXUP_SONY_VAIO
8136 },
1d045db9 8137 [ALC271_FIXUP_DMIC] = {
1727a771 8138 .type = HDA_FIXUP_FUNC,
1d045db9 8139 .v.func = alc271_fixup_dmic,
f1d4e28b 8140 },
017f2a10 8141 [ALC269_FIXUP_PCM_44K] = {
1727a771 8142 .type = HDA_FIXUP_FUNC,
017f2a10 8143 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
8144 .chained = true,
8145 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 8146 },
adabb3ec 8147 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 8148 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
8149 .v.func = alc269_fixup_stereo_dmic,
8150 },
7c478f03
DH
8151 [ALC269_FIXUP_HEADSET_MIC] = {
8152 .type = HDA_FIXUP_FUNC,
8153 .v.func = alc269_fixup_headset_mic,
8154 },
24519911 8155 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 8156 .type = HDA_FIXUP_FUNC,
24519911
TI
8157 .v.func = alc269_fixup_quanta_mute,
8158 },
8159 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
8160 .type = HDA_FIXUP_PINS,
8161 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
8162 { 0x1a, 0x2101103f }, /* dock line-out */
8163 { 0x1b, 0x23a11040 }, /* dock mic-in */
8164 { }
8165 },
8166 .chained = true,
8167 .chain_id = ALC269_FIXUP_QUANTA_MUTE
8168 },
2041d564
DH
8169 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
8170 .type = HDA_FIXUP_PINS,
8171 .v.pins = (const struct hda_pintbl[]) {
8172 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
8173 { }
8174 },
8175 },
cc7016ab
TI
8176 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
8177 .type = HDA_FIXUP_PINS,
8178 .v.pins = (const struct hda_pintbl[]) {
8179 { 0x21, 0x0221102f }, /* HP out */
8180 { }
8181 },
8182 },
4df3fd17
TI
8183 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
8184 .type = HDA_FIXUP_FUNC,
8185 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
8186 },
fdcc968a
JMG
8187 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
8188 .type = HDA_FIXUP_FUNC,
8189 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
8190 },
ef5fbdf7
PRC
8191 [ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13] = {
8192 .type = HDA_FIXUP_PINS,
8193 .v.pins = (const struct hda_pintbl[]) {
8194 { 0x14, 0x90170151 }, /* use as internal speaker (LFE) */
8195 { 0x1b, 0x90170152 }, /* use as internal speaker (back) */
8196 { }
8197 },
8198 .chained = true,
8199 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8200 },
5ebe792a
DK
8201 [ALC269VC_FIXUP_INFINIX_Y4_MAX] = {
8202 .type = HDA_FIXUP_PINS,
8203 .v.pins = (const struct hda_pintbl[]) {
8204 { 0x1b, 0x90170150 }, /* use as internal speaker */
8205 { }
8206 },
8207 .chained = true,
8208 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8209 },
7c9caa29
VK
8210 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
8211 .type = HDA_FIXUP_PINS,
8212 .v.pins = (const struct hda_pintbl[]) {
8213 { 0x18, 0x03a19020 }, /* headset mic */
8214 { 0x1b, 0x90170150 }, /* speaker */
8215 { }
8216 },
8217 },
a4297b5d 8218 [ALC269_FIXUP_AMIC] = {
1727a771
TI
8219 .type = HDA_FIXUP_PINS,
8220 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
8221 { 0x14, 0x99130110 }, /* speaker */
8222 { 0x15, 0x0121401f }, /* HP out */
8223 { 0x18, 0x01a19c20 }, /* mic */
8224 { 0x19, 0x99a3092f }, /* int-mic */
8225 { }
8226 },
8227 },
8228 [ALC269_FIXUP_DMIC] = {
1727a771
TI
8229 .type = HDA_FIXUP_PINS,
8230 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
8231 { 0x12, 0x99a3092f }, /* int-mic */
8232 { 0x14, 0x99130110 }, /* speaker */
8233 { 0x15, 0x0121401f }, /* HP out */
8234 { 0x18, 0x01a19c20 }, /* mic */
8235 { }
8236 },
8237 },
8238 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
8239 .type = HDA_FIXUP_PINS,
8240 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
8241 { 0x14, 0x99130110 }, /* speaker */
8242 { 0x18, 0x01a19c20 }, /* mic */
8243 { 0x19, 0x99a3092f }, /* int-mic */
8244 { 0x21, 0x0121401f }, /* HP out */
8245 { }
8246 },
8247 },
2267ea97 8248 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
8249 .type = HDA_FIXUP_PINS,
8250 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
8251 { 0x12, 0x99a3092f }, /* int-mic */
8252 { 0x14, 0x99130110 }, /* speaker */
8253 { 0x18, 0x01a19c20 }, /* mic */
8254 { 0x21, 0x0121401f }, /* HP out */
8255 { }
8256 },
8257 },
08fb0d0e 8258 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 8259 .type = HDA_FIXUP_FUNC,
08fb0d0e 8260 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 8261 },
d06ac143
DH
8262 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
8263 .type = HDA_FIXUP_FUNC,
8264 .v.func = alc269_fixup_hp_mute_led_mic1,
8265 },
08fb0d0e 8266 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 8267 .type = HDA_FIXUP_FUNC,
08fb0d0e 8268 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 8269 },
7f783bd5
TB
8270 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
8271 .type = HDA_FIXUP_FUNC,
8272 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
8273 .chained = true,
8274 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 8275 },
9f5c6faf
TI
8276 [ALC269_FIXUP_HP_GPIO_LED] = {
8277 .type = HDA_FIXUP_FUNC,
8278 .v.func = alc269_fixup_hp_gpio_led,
8279 },
9c5dc3bf
KY
8280 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
8281 .type = HDA_FIXUP_FUNC,
8282 .v.func = alc269_fixup_hp_gpio_mic1_led,
8283 },
8284 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
8285 .type = HDA_FIXUP_FUNC,
8286 .v.func = alc269_fixup_hp_line1_mic1_led,
8287 },
693b613d 8288 [ALC269_FIXUP_INV_DMIC] = {
1727a771 8289 .type = HDA_FIXUP_FUNC,
9d36a7dc 8290 .v.func = alc_fixup_inv_dmic,
693b613d 8291 },
9b745ab8
TI
8292 [ALC269_FIXUP_NO_SHUTUP] = {
8293 .type = HDA_FIXUP_FUNC,
8294 .v.func = alc_fixup_no_shutup,
8295 },
108cc108 8296 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
8297 .type = HDA_FIXUP_PINS,
8298 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
8299 { 0x19, 0x23a11040 }, /* dock mic */
8300 { 0x1b, 0x2121103f }, /* dock headphone */
8301 { }
8302 },
8303 .chained = true,
8304 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
8305 },
b590b38c
TI
8306 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
8307 .type = HDA_FIXUP_FUNC,
8308 .v.func = alc269_fixup_limit_int_mic_boost,
8309 .chained = true,
8310 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
8311 },
108cc108 8312 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 8313 .type = HDA_FIXUP_FUNC,
108cc108 8314 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
8315 .chained = true,
8316 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 8317 },
73bdd597
DH
8318 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8319 .type = HDA_FIXUP_PINS,
8320 .v.pins = (const struct hda_pintbl[]) {
8321 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8322 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8323 { }
8324 },
8325 .chained = true,
8326 .chain_id = ALC269_FIXUP_HEADSET_MODE
8327 },
78e7be01
KY
8328 [ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
8329 .type = HDA_FIXUP_FUNC,
8330 .v.func = alc269_fixup_limit_int_mic_boost,
8331 .chained = true,
8332 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8333 },
73bdd597
DH
8334 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8335 .type = HDA_FIXUP_PINS,
8336 .v.pins = (const struct hda_pintbl[]) {
8337 { 0x16, 0x21014020 }, /* dock line out */
8338 { 0x19, 0x21a19030 }, /* dock mic */
8339 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8340 { }
8341 },
8342 .chained = true,
8343 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8344 },
338cae56
DH
8345 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
8346 .type = HDA_FIXUP_PINS,
8347 .v.pins = (const struct hda_pintbl[]) {
8348 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8349 { }
8350 },
8351 .chained = true,
8352 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8353 },
fcc6c877
KY
8354 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
8355 .type = HDA_FIXUP_PINS,
8356 .v.pins = (const struct hda_pintbl[]) {
8357 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8358 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8359 { }
8360 },
8361 .chained = true,
8362 .chain_id = ALC269_FIXUP_HEADSET_MODE
8363 },
73bdd597
DH
8364 [ALC269_FIXUP_HEADSET_MODE] = {
8365 .type = HDA_FIXUP_FUNC,
8366 .v.func = alc_fixup_headset_mode,
6676f308 8367 .chained = true,
b3802783 8368 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
8369 },
8370 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8371 .type = HDA_FIXUP_FUNC,
8372 .v.func = alc_fixup_headset_mode_no_hp_mic,
8373 },
7819717b
TI
8374 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
8375 .type = HDA_FIXUP_PINS,
8376 .v.pins = (const struct hda_pintbl[]) {
8377 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
8378 { }
8379 },
8380 .chained = true,
8381 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8382 },
88cfcf86
DH
8383 [ALC286_FIXUP_SONY_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 { }
8388 },
fbc78ad6
DH
8389 .chained = true,
8390 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 8391 },
0fbf21c3 8392 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
8393 .type = HDA_FIXUP_PINS,
8394 .v.pins = (const struct hda_pintbl[]) {
8395 {0x12, 0x90a60130},
8396 {0x13, 0x40000000},
8397 {0x14, 0x90170110},
8398 {0x18, 0x411111f0},
8399 {0x19, 0x04a11040},
8400 {0x1a, 0x411111f0},
8401 {0x1b, 0x90170112},
8402 {0x1d, 0x40759a05},
8403 {0x1e, 0x411111f0},
8404 {0x21, 0x04211020},
8405 { }
8406 },
e2744fd7
AB
8407 .chained = true,
8408 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 8409 },
a2ef03fe
TE
8410 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
8411 .type = HDA_FIXUP_FUNC,
8412 .v.func = alc298_fixup_huawei_mbx_stereo,
8413 .chained = true,
8414 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8415 },
d240d1dc
DH
8416 [ALC269_FIXUP_ASUS_X101_FUNC] = {
8417 .type = HDA_FIXUP_FUNC,
8418 .v.func = alc269_fixup_x101_headset_mic,
8419 },
8420 [ALC269_FIXUP_ASUS_X101_VERB] = {
8421 .type = HDA_FIXUP_VERBS,
8422 .v.verbs = (const struct hda_verb[]) {
8423 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
8424 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8425 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
8426 { }
8427 },
8428 .chained = true,
8429 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
8430 },
8431 [ALC269_FIXUP_ASUS_X101] = {
8432 .type = HDA_FIXUP_PINS,
8433 .v.pins = (const struct hda_pintbl[]) {
8434 { 0x18, 0x04a1182c }, /* Headset mic */
8435 { }
8436 },
8437 .chained = true,
8438 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
8439 },
08a978db 8440 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
8441 .type = HDA_FIXUP_PINS,
8442 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
8443 { 0x14, 0x99130110 }, /* speaker */
8444 { 0x19, 0x01a19c20 }, /* mic */
8445 { 0x1b, 0x99a7012f }, /* int-mic */
8446 { 0x21, 0x0121401f }, /* HP out */
8447 { }
8448 },
8449 },
8450 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 8451 .type = HDA_FIXUP_FUNC,
08a978db
DR
8452 .v.func = alc271_hp_gate_mic_jack,
8453 .chained = true,
8454 .chain_id = ALC271_FIXUP_AMIC_MIC2,
8455 },
b1e8972e
OR
8456 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
8457 .type = HDA_FIXUP_FUNC,
8458 .v.func = alc269_fixup_limit_int_mic_boost,
8459 .chained = true,
8460 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
8461 },
42397004
DR
8462 [ALC269_FIXUP_ACER_AC700] = {
8463 .type = HDA_FIXUP_PINS,
8464 .v.pins = (const struct hda_pintbl[]) {
8465 { 0x12, 0x99a3092f }, /* int-mic */
8466 { 0x14, 0x99130110 }, /* speaker */
8467 { 0x18, 0x03a11c20 }, /* mic */
8468 { 0x1e, 0x0346101e }, /* SPDIF1 */
8469 { 0x21, 0x0321101f }, /* HP out */
8470 { }
8471 },
8472 .chained = true,
8473 .chain_id = ALC271_FIXUP_DMIC,
8474 },
3e0d611b
DH
8475 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
8476 .type = HDA_FIXUP_FUNC,
8477 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
8478 .chained = true,
8479 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 8480 },
2cede303
OR
8481 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
8482 .type = HDA_FIXUP_FUNC,
8483 .v.func = alc269_fixup_limit_int_mic_boost,
8484 .chained = true,
8485 .chain_id = ALC269VB_FIXUP_DMIC,
8486 },
23870831
TI
8487 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
8488 .type = HDA_FIXUP_VERBS,
8489 .v.verbs = (const struct hda_verb[]) {
8490 /* class-D output amp +5dB */
8491 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
8492 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
8493 {}
8494 },
8495 .chained = true,
8496 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
8497 },
f882c4be
MT
8498 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8499 .type = HDA_FIXUP_PINS,
8500 .v.pins = (const struct hda_pintbl[]) {
8501 { 0x18, 0x01a110f0 }, /* use as headset mic */
8502 { }
8503 },
8504 .chained = true,
8505 .chain_id = ALC269_FIXUP_HEADSET_MIC
8506 },
8e35cd4a
DH
8507 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8508 .type = HDA_FIXUP_FUNC,
8509 .v.func = alc269_fixup_limit_int_mic_boost,
8510 .chained = true,
8511 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8512 },
02b504d9
AA
8513 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8514 .type = HDA_FIXUP_PINS,
8515 .v.pins = (const struct hda_pintbl[]) {
8516 { 0x12, 0x99a3092f }, /* int-mic */
8517 { 0x18, 0x03a11d20 }, /* mic */
8518 { 0x19, 0x411111f0 }, /* Unused bogus pin */
8519 { }
8520 },
8521 },
cd217a63
KY
8522 [ALC283_FIXUP_CHROME_BOOK] = {
8523 .type = HDA_FIXUP_FUNC,
8524 .v.func = alc283_fixup_chromebook,
8525 },
0202e99c
KY
8526 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
8527 .type = HDA_FIXUP_FUNC,
8528 .v.func = alc283_fixup_sense_combo_jack,
8529 .chained = true,
8530 .chain_id = ALC283_FIXUP_CHROME_BOOK,
8531 },
7bba2157
TI
8532 [ALC282_FIXUP_ASUS_TX300] = {
8533 .type = HDA_FIXUP_FUNC,
8534 .v.func = alc282_fixup_asus_tx300,
8535 },
1bb3e062
KY
8536 [ALC283_FIXUP_INT_MIC] = {
8537 .type = HDA_FIXUP_VERBS,
8538 .v.verbs = (const struct hda_verb[]) {
8539 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8540 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8541 { }
8542 },
8543 .chained = true,
8544 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8545 },
0f4881dc
DH
8546 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8547 .type = HDA_FIXUP_PINS,
8548 .v.pins = (const struct hda_pintbl[]) {
8549 { 0x17, 0x90170112 }, /* subwoofer */
8550 { }
8551 },
8552 .chained = true,
8553 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8554 },
8555 [ALC290_FIXUP_SUBWOOFER] = {
8556 .type = HDA_FIXUP_PINS,
8557 .v.pins = (const struct hda_pintbl[]) {
8558 { 0x17, 0x90170112 }, /* subwoofer */
8559 { }
8560 },
8561 .chained = true,
8562 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8563 },
338cae56
DH
8564 [ALC290_FIXUP_MONO_SPEAKERS] = {
8565 .type = HDA_FIXUP_FUNC,
8566 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
8567 },
8568 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8569 .type = HDA_FIXUP_FUNC,
8570 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
8571 .chained = true,
8572 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8573 },
b67ae3f1
DH
8574 [ALC269_FIXUP_THINKPAD_ACPI] = {
8575 .type = HDA_FIXUP_FUNC,
d5a6cabf 8576 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
8577 .chained = true,
8578 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 8579 },
d466887a
JD
8580 [ALC269_FIXUP_LENOVO_XPAD_ACPI] = {
8581 .type = HDA_FIXUP_FUNC,
8582 .v.func = alc_fixup_ideapad_acpi,
8583 .chained = true,
8584 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8585 },
56f27013
DH
8586 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8587 .type = HDA_FIXUP_FUNC,
8588 .v.func = alc_fixup_inv_dmic,
8589 .chained = true,
8590 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8591 },
5824ce8d 8592 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
8593 .type = HDA_FIXUP_PINS,
8594 .v.pins = (const struct hda_pintbl[]) {
8595 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8596 { }
5824ce8d
CC
8597 },
8598 .chained = true,
17d30460 8599 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 8600 },
615966ad
CC
8601 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8602 .type = HDA_FIXUP_PINS,
8603 .v.pins = (const struct hda_pintbl[]) {
8604 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8605 { }
8606 },
8607 .chained = true,
8608 .chain_id = ALC255_FIXUP_HEADSET_MODE
8609 },
9a22a8f5
KY
8610 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8611 .type = HDA_FIXUP_PINS,
8612 .v.pins = (const struct hda_pintbl[]) {
8613 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8614 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8615 { }
8616 },
8617 .chained = true,
8618 .chain_id = ALC255_FIXUP_HEADSET_MODE
8619 },
78e7be01
KY
8620 [ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
8621 .type = HDA_FIXUP_FUNC,
8622 .v.func = alc269_fixup_limit_int_mic_boost,
8623 .chained = true,
8624 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8625 },
31278997
KY
8626 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8627 .type = HDA_FIXUP_PINS,
8628 .v.pins = (const struct hda_pintbl[]) {
8629 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8630 { }
8631 },
8632 .chained = true,
8633 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8634 },
9a22a8f5
KY
8635 [ALC255_FIXUP_HEADSET_MODE] = {
8636 .type = HDA_FIXUP_FUNC,
8637 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 8638 .chained = true,
b3802783 8639 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 8640 },
31278997
KY
8641 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8642 .type = HDA_FIXUP_FUNC,
8643 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8644 },
a22aa26f
KY
8645 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8646 .type = HDA_FIXUP_PINS,
8647 .v.pins = (const struct hda_pintbl[]) {
8648 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8649 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8650 { }
8651 },
8652 .chained = true,
8653 .chain_id = ALC269_FIXUP_HEADSET_MODE
8654 },
1c37c223 8655 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 8656 .type = HDA_FIXUP_FUNC,
7f57d803 8657 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
8658 .chained = true,
8659 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8660 },
9a811230
TI
8661 [ALC292_FIXUP_TPT440] = {
8662 .type = HDA_FIXUP_FUNC,
157f0b7f 8663 .v.func = alc_fixup_disable_aamix,
9a811230
TI
8664 .chained = true,
8665 .chain_id = ALC292_FIXUP_TPT440_DOCK,
8666 },
abaa2274 8667 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
8668 .type = HDA_FIXUP_PINS,
8669 .v.pins = (const struct hda_pintbl[]) {
8670 { 0x19, 0x04a110f0 },
8671 { },
8672 },
8673 },
b3802783 8674 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 8675 .type = HDA_FIXUP_FUNC,
8a503555 8676 .v.func = alc_fixup_micmute_led,
00ef9940 8677 },
1a22e775
TI
8678 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
8679 .type = HDA_FIXUP_PINS,
8680 .v.pins = (const struct hda_pintbl[]) {
8681 { 0x12, 0x90a60130 },
8682 { 0x14, 0x90170110 },
8683 { 0x17, 0x40000008 },
8684 { 0x18, 0x411111f0 },
0420694d 8685 { 0x19, 0x01a1913c },
1a22e775
TI
8686 { 0x1a, 0x411111f0 },
8687 { 0x1b, 0x411111f0 },
8688 { 0x1d, 0x40f89b2d },
8689 { 0x1e, 0x411111f0 },
8690 { 0x21, 0x0321101f },
8691 { },
8692 },
8693 },
c8426b27
TI
8694 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8695 .type = HDA_FIXUP_FUNC,
8696 .v.func = alc269vb_fixup_aspire_e1_coef,
8697 },
7a5255f1
DH
8698 [ALC280_FIXUP_HP_GPIO4] = {
8699 .type = HDA_FIXUP_FUNC,
8700 .v.func = alc280_fixup_hp_gpio4,
8701 },
eaa8e5ef
KY
8702 [ALC286_FIXUP_HP_GPIO_LED] = {
8703 .type = HDA_FIXUP_FUNC,
8704 .v.func = alc286_fixup_hp_gpio_led,
8705 },
33f4acd3
DH
8706 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8707 .type = HDA_FIXUP_FUNC,
8708 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8709 },
b4b33f9d
TC
8710 [ALC280_FIXUP_HP_DOCK_PINS] = {
8711 .type = HDA_FIXUP_PINS,
8712 .v.pins = (const struct hda_pintbl[]) {
8713 { 0x1b, 0x21011020 }, /* line-out */
8714 { 0x1a, 0x01a1903c }, /* headset mic */
8715 { 0x18, 0x2181103f }, /* line-in */
8716 { },
8717 },
8718 .chained = true,
8719 .chain_id = ALC280_FIXUP_HP_GPIO4
8720 },
04d5466a
JK
8721 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8722 .type = HDA_FIXUP_PINS,
8723 .v.pins = (const struct hda_pintbl[]) {
8724 { 0x1b, 0x21011020 }, /* line-out */
8725 { 0x18, 0x2181103f }, /* line-in */
8726 { },
8727 },
8728 .chained = true,
8729 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8730 },
98973f2f
KP
8731 [ALC280_FIXUP_HP_9480M] = {
8732 .type = HDA_FIXUP_FUNC,
8733 .v.func = alc280_fixup_hp_9480m,
8734 },
c3bb2b52
TI
8735 [ALC245_FIXUP_HP_X360_AMP] = {
8736 .type = HDA_FIXUP_FUNC,
8737 .v.func = alc245_fixup_hp_x360_amp,
5fc462c3
JC
8738 .chained = true,
8739 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 8740 },
e1e62b98
KY
8741 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
8742 .type = HDA_FIXUP_FUNC,
8743 .v.func = alc_fixup_headset_mode_dell_alc288,
8744 .chained = true,
b3802783 8745 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
8746 },
8747 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8748 .type = HDA_FIXUP_PINS,
8749 .v.pins = (const struct hda_pintbl[]) {
8750 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8751 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8752 { }
8753 },
8754 .chained = true,
8755 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8756 },
831bfdf9
HW
8757 [ALC288_FIXUP_DISABLE_AAMIX] = {
8758 .type = HDA_FIXUP_FUNC,
8759 .v.func = alc_fixup_disable_aamix,
8760 .chained = true,
d44a6864 8761 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
8762 },
8763 [ALC288_FIXUP_DELL_XPS_13] = {
8764 .type = HDA_FIXUP_FUNC,
8765 .v.func = alc_fixup_dell_xps13,
8766 .chained = true,
8767 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
8768 },
8b99aba7
TI
8769 [ALC292_FIXUP_DISABLE_AAMIX] = {
8770 .type = HDA_FIXUP_FUNC,
8771 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
8772 .chained = true,
8773 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 8774 },
c04017ea
DH
8775 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8776 .type = HDA_FIXUP_FUNC,
8777 .v.func = alc_fixup_disable_aamix,
8778 .chained = true,
8779 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8780 },
5fab5829 8781 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
8782 .type = HDA_FIXUP_FUNC,
8783 .v.func = alc_fixup_dell_xps13,
8784 .chained = true,
8785 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
8786 },
5fab5829
TI
8787 [ALC292_FIXUP_DELL_E7X] = {
8788 .type = HDA_FIXUP_FUNC,
8a503555 8789 .v.func = alc_fixup_micmute_led,
5fab5829
TI
8790 /* micmute fixup must be applied at last */
8791 .chained_before = true,
8792 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8793 },
54324221
JM
8794 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8795 .type = HDA_FIXUP_PINS,
8796 .v.pins = (const struct hda_pintbl[]) {
8797 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8798 { }
8799 },
8800 .chained_before = true,
8801 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8802 },
977e6276
KY
8803 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8804 .type = HDA_FIXUP_PINS,
8805 .v.pins = (const struct hda_pintbl[]) {
8806 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8807 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8808 { }
8809 },
8810 .chained = true,
8811 .chain_id = ALC269_FIXUP_HEADSET_MODE
8812 },
2f726aec
HW
8813 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8814 .type = HDA_FIXUP_PINS,
8815 .v.pins = (const struct hda_pintbl[]) {
8816 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8817 { }
8818 },
8819 .chained = true,
8820 .chain_id = ALC269_FIXUP_HEADSET_MODE
8821 },
6ed1131f
KY
8822 [ALC275_FIXUP_DELL_XPS] = {
8823 .type = HDA_FIXUP_VERBS,
8824 .v.verbs = (const struct hda_verb[]) {
8825 /* Enables internal speaker */
8826 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8827 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8828 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8829 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8830 {}
8831 }
8832 },
23adc192
HW
8833 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8834 .type = HDA_FIXUP_FUNC,
8835 .v.func = alc_fixup_disable_aamix,
8836 .chained = true,
8837 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8838 },
3694cb29
K
8839 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8840 .type = HDA_FIXUP_FUNC,
8841 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8842 },
f603b159
KY
8843 [ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED] = {
8844 .type = HDA_FIXUP_FUNC,
8845 .v.func = alc233_fixup_lenovo_low_en_micmute_led,
8846 },
d1ee66c5
PC
8847 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8848 .type = HDA_FIXUP_FUNC,
8849 .v.func = alc_fixup_inv_dmic,
8850 .chained = true,
8851 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8852 },
8853 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8854 .type = HDA_FIXUP_FUNC,
8855 .v.func = alc269_fixup_limit_int_mic_boost
8856 },
3b43b71f
KHF
8857 [ALC255_FIXUP_DELL_SPK_NOISE] = {
8858 .type = HDA_FIXUP_FUNC,
8859 .v.func = alc_fixup_disable_aamix,
8860 .chained = true,
8861 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8862 },
d1dd4211
KY
8863 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
8864 .type = HDA_FIXUP_FUNC,
8865 .v.func = alc_fixup_disable_mic_vref,
8866 .chained = true,
8867 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8868 },
2ae95577
DH
8869 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8870 .type = HDA_FIXUP_VERBS,
8871 .v.verbs = (const struct hda_verb[]) {
8872 /* Disable pass-through path for FRONT 14h */
8873 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8874 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8875 {}
8876 },
8877 .chained = true,
d1dd4211 8878 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 8879 },
f883982d
TI
8880 [ALC280_FIXUP_HP_HEADSET_MIC] = {
8881 .type = HDA_FIXUP_FUNC,
8882 .v.func = alc_fixup_disable_aamix,
8883 .chained = true,
8884 .chain_id = ALC269_FIXUP_HEADSET_MIC,
8885 },
e549d190
HW
8886 [ALC221_FIXUP_HP_FRONT_MIC] = {
8887 .type = HDA_FIXUP_PINS,
8888 .v.pins = (const struct hda_pintbl[]) {
8889 { 0x19, 0x02a19020 }, /* Front Mic */
8890 { }
8891 },
8892 },
c636b95e
SE
8893 [ALC292_FIXUP_TPT460] = {
8894 .type = HDA_FIXUP_FUNC,
8895 .v.func = alc_fixup_tpt440_dock,
8896 .chained = true,
8897 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8898 },
dd9aa335
HW
8899 [ALC298_FIXUP_SPK_VOLUME] = {
8900 .type = HDA_FIXUP_FUNC,
8901 .v.func = alc298_fixup_speaker_volume,
59ec4b57 8902 .chained = true,
2f726aec 8903 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 8904 },
f86de9b1
KY
8905 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8906 .type = HDA_FIXUP_FUNC,
8907 .v.func = alc298_fixup_speaker_volume,
8908 },
e312a869
TI
8909 [ALC295_FIXUP_DISABLE_DAC3] = {
8910 .type = HDA_FIXUP_FUNC,
8911 .v.func = alc295_fixup_disable_dac3,
8912 },
d2cd795c
JK
8913 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8914 .type = HDA_FIXUP_FUNC,
8915 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
8916 .chained = true,
8917 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 8918 },
4b963ae1
AS
8919 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8920 .type = HDA_FIXUP_FUNC,
8921 .v.func = alc285_fixup_speaker2_to_dac1,
8922 .chained = true,
8923 .chain_id = ALC245_FIXUP_CS35L41_SPI_2
8924 },
8925 [ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8926 .type = HDA_FIXUP_PINS,
8927 .v.pins = (const struct hda_pintbl[]) {
8928 { 0x19, 0x03a11050 },
8929 { 0x1b, 0x03a11c30 },
8930 { }
8931 },
8932 .chained = true,
8933 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8934 },
b759a5f0
LJ
8935 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8936 .type = HDA_FIXUP_PINS,
8937 .v.pins = (const struct hda_pintbl[]) {
8938 { 0x14, 0x90170120 },
8939 { }
8940 },
8941 .chained = true,
8942 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8943 },
8cc87c05
LJ
8944 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8945 .type = HDA_FIXUP_FUNC,
8946 .v.func = alc285_fixup_speaker2_to_dac1,
8947 .chained = true,
8948 .chain_id = ALC287_FIXUP_CS35L41_I2C_2
8949 },
8950 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8951 .type = HDA_FIXUP_PINS,
8952 .v.pins = (const struct hda_pintbl[]) {
8953 { 0x19, 0x03a11050 },
8954 { 0x1b, 0x03a11c30 },
8955 { }
8956 },
8957 .chained = true,
8958 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8959 },
fd06c77e
KHF
8960 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8961 .type = HDA_FIXUP_PINS,
8962 .v.pins = (const struct hda_pintbl[]) {
8963 { 0x1b, 0x90170151 },
8964 { }
8965 },
8966 .chained = true,
8967 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8968 },
823ff161
GM
8969 [ALC269_FIXUP_ATIV_BOOK_8] = {
8970 .type = HDA_FIXUP_FUNC,
8971 .v.func = alc_fixup_auto_mute_via_amp,
8972 .chained = true,
8973 .chain_id = ALC269_FIXUP_NO_SHUTUP
8974 },
4ba5c853
MT
8975 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8976 .type = HDA_FIXUP_PINS,
8977 .v.pins = (const struct hda_pintbl[]) {
8978 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8979 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8980 { }
8981 },
8982 .chained = true,
8983 .chain_id = ALC269_FIXUP_HEADSET_MODE
8984 },
9eb5d0e6
KY
8985 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8986 .type = HDA_FIXUP_PINS,
8987 .v.pins = (const struct hda_pintbl[]) {
8988 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8989 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8990 { }
8991 },
8992 .chained = true,
8993 .chain_id = ALC269_FIXUP_HEADSET_MODE
8994 },
c1732ede
CC
8995 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8996 .type = HDA_FIXUP_FUNC,
8997 .v.func = alc_fixup_headset_mode,
8998 },
8999 [ALC256_FIXUP_ASUS_MIC] = {
9000 .type = HDA_FIXUP_PINS,
9001 .v.pins = (const struct hda_pintbl[]) {
9002 { 0x13, 0x90a60160 }, /* use as internal mic */
9003 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
9004 { }
9005 },
9006 .chained = true,
9007 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9008 },
eeed4cd1 9009 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
9010 .type = HDA_FIXUP_FUNC,
9011 /* Set up GPIO2 for the speaker amp */
9012 .v.func = alc_fixup_gpio4,
eeed4cd1 9013 },
216d7aeb
CC
9014 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9015 .type = HDA_FIXUP_PINS,
9016 .v.pins = (const struct hda_pintbl[]) {
9017 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9018 { }
9019 },
9020 .chained = true,
9021 .chain_id = ALC269_FIXUP_HEADSET_MIC
9022 },
9023 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
9024 .type = HDA_FIXUP_VERBS,
9025 .v.verbs = (const struct hda_verb[]) {
9026 /* Enables internal speaker */
9027 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
9028 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
9029 {}
9030 },
9031 .chained = true,
9032 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
9033 },
ca169cc2
KY
9034 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
9035 .type = HDA_FIXUP_FUNC,
9036 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
9037 .chained = true,
9038 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 9039 },
ea5c7eba
JHP
9040 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
9041 .type = HDA_FIXUP_VERBS,
9042 .v.verbs = (const struct hda_verb[]) {
9043 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9044 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9045 { }
9046 },
9047 .chained = true,
9048 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
9049 },
f33f79f3
HW
9050 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
9051 .type = HDA_FIXUP_PINS,
9052 .v.pins = (const struct hda_pintbl[]) {
9053 /* Change the mic location from front to right, otherwise there are
9054 two front mics with the same name, pulseaudio can't handle them.
9055 This is just a temporary workaround, after applying this fixup,
9056 there will be one "Front Mic" and one "Mic" in this machine.
9057 */
9058 { 0x1a, 0x04a19040 },
9059 { }
9060 },
9061 },
5f364135
KY
9062 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
9063 .type = HDA_FIXUP_PINS,
9064 .v.pins = (const struct hda_pintbl[]) {
9065 { 0x16, 0x0101102f }, /* Rear Headset HP */
9066 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
9067 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
9068 { 0x1b, 0x02011020 },
9069 { }
9070 },
9071 .chained = true,
52e4e368
KHF
9072 .chain_id = ALC225_FIXUP_S3_POP_NOISE
9073 },
9074 [ALC225_FIXUP_S3_POP_NOISE] = {
9075 .type = HDA_FIXUP_FUNC,
9076 .v.func = alc225_fixup_s3_pop_noise,
9077 .chained = true,
5f364135
KY
9078 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9079 },
b84e8436
PH
9080 [ALC700_FIXUP_INTEL_REFERENCE] = {
9081 .type = HDA_FIXUP_VERBS,
9082 .v.verbs = (const struct hda_verb[]) {
9083 /* Enables internal speaker */
9084 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
9085 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
9086 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
9087 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
9088 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
9089 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
9090 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
9091 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
9092 {}
9093 }
9094 },
92266651
KY
9095 [ALC274_FIXUP_DELL_BIND_DACS] = {
9096 .type = HDA_FIXUP_FUNC,
9097 .v.func = alc274_fixup_bind_dacs,
9098 .chained = true,
9099 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
9100 },
9101 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
9102 .type = HDA_FIXUP_PINS,
9103 .v.pins = (const struct hda_pintbl[]) {
9104 { 0x1b, 0x0401102f },
9105 { }
9106 },
9107 .chained = true,
9108 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
9109 },
399c01aa 9110 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
9111 .type = HDA_FIXUP_FUNC,
9112 .v.func = alc_fixup_tpt470_dock,
9113 .chained = true,
9114 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
9115 },
399c01aa
TI
9116 [ALC298_FIXUP_TPT470_DOCK] = {
9117 .type = HDA_FIXUP_FUNC,
9118 .v.func = alc_fixup_tpt470_dacs,
9119 .chained = true,
9120 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
9121 },
ae104a21
KY
9122 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
9123 .type = HDA_FIXUP_PINS,
9124 .v.pins = (const struct hda_pintbl[]) {
9125 { 0x14, 0x0201101f },
9126 { }
9127 },
9128 .chained = true,
9129 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9130 },
f0ba9d69
KY
9131 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
9132 .type = HDA_FIXUP_PINS,
9133 .v.pins = (const struct hda_pintbl[]) {
9134 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9135 { }
9136 },
3ce0d5aa
HW
9137 .chained = true,
9138 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 9139 },
bbf8ff6b
TB
9140 [ALC295_FIXUP_HP_X360] = {
9141 .type = HDA_FIXUP_FUNC,
9142 .v.func = alc295_fixup_hp_top_speakers,
9143 .chained = true,
9144 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
9145 },
9146 [ALC221_FIXUP_HP_HEADSET_MIC] = {
9147 .type = HDA_FIXUP_PINS,
9148 .v.pins = (const struct hda_pintbl[]) {
9149 { 0x19, 0x0181313f},
9150 { }
9151 },
9152 .chained = true,
9153 .chain_id = ALC269_FIXUP_HEADSET_MIC
9154 },
c4cfcf6f
HW
9155 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
9156 .type = HDA_FIXUP_FUNC,
9157 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
9158 .chained = true,
9159 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 9160 },
e8ed64b0
GKK
9161 [ALC295_FIXUP_HP_AUTO_MUTE] = {
9162 .type = HDA_FIXUP_FUNC,
9163 .v.func = alc_fixup_auto_mute_via_amp,
9164 },
33aaebd4
CC
9165 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
9166 .type = HDA_FIXUP_PINS,
9167 .v.pins = (const struct hda_pintbl[]) {
9168 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9169 { }
9170 },
9171 .chained = true,
9172 .chain_id = ALC269_FIXUP_HEADSET_MIC
9173 },
d8ae458e
CC
9174 [ALC294_FIXUP_ASUS_MIC] = {
9175 .type = HDA_FIXUP_PINS,
9176 .v.pins = (const struct hda_pintbl[]) {
9177 { 0x13, 0x90a60160 }, /* use as internal mic */
9178 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
9179 { }
9180 },
9181 .chained = true,
ef9ddb9d 9182 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 9183 },
4e051106
JHP
9184 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
9185 .type = HDA_FIXUP_PINS,
9186 .v.pins = (const struct hda_pintbl[]) {
82b01149 9187 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
9188 { }
9189 },
9190 .chained = true,
ef9ddb9d 9191 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
9192 },
9193 [ALC294_FIXUP_ASUS_SPK] = {
9194 .type = HDA_FIXUP_VERBS,
9195 .v.verbs = (const struct hda_verb[]) {
9196 /* Set EAPD high */
9197 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
9198 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
9199 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9200 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
9201 { }
9202 },
9203 .chained = true,
9204 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9205 },
c8a9afa6 9206 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 9207 .type = HDA_FIXUP_FUNC,
c8a9afa6 9208 .v.func = alc295_fixup_chromebook,
8983eb60
KY
9209 .chained = true,
9210 .chain_id = ALC225_FIXUP_HEADSET_JACK
9211 },
9212 [ALC225_FIXUP_HEADSET_JACK] = {
9213 .type = HDA_FIXUP_FUNC,
9214 .v.func = alc_fixup_headset_jack,
e854747d 9215 },
89e3a568
JS
9216 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9217 .type = HDA_FIXUP_PINS,
9218 .v.pins = (const struct hda_pintbl[]) {
9219 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9220 { }
9221 },
9222 .chained = true,
9223 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9224 },
c8c6ee61
HW
9225 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
9226 .type = HDA_FIXUP_VERBS,
9227 .v.verbs = (const struct hda_verb[]) {
9228 /* Disable PCBEEP-IN passthrough */
9229 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
9230 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
9231 { }
9232 },
9233 .chained = true,
9234 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
9235 },
cbc05fd6
JHP
9236 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
9237 .type = HDA_FIXUP_PINS,
9238 .v.pins = (const struct hda_pintbl[]) {
9239 { 0x19, 0x03a11130 },
9240 { 0x1a, 0x90a60140 }, /* use as internal mic */
9241 { }
9242 },
9243 .chained = true,
9244 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
9245 },
136824ef
KY
9246 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
9247 .type = HDA_FIXUP_PINS,
9248 .v.pins = (const struct hda_pintbl[]) {
9249 { 0x16, 0x01011020 }, /* Rear Line out */
9250 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
9251 { }
9252 },
9253 .chained = true,
9254 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
9255 },
9256 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
9257 .type = HDA_FIXUP_FUNC,
9258 .v.func = alc_fixup_auto_mute_via_amp,
9259 .chained = true,
9260 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
9261 },
9262 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
9263 .type = HDA_FIXUP_FUNC,
9264 .v.func = alc_fixup_disable_mic_vref,
9265 .chained = true,
9266 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9267 },
667a8f73
JHP
9268 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
9269 .type = HDA_FIXUP_VERBS,
9270 .v.verbs = (const struct hda_verb[]) {
9271 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
9272 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
9273 { }
9274 },
9275 .chained = true,
9276 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
9277 },
8c8967a7
DD
9278 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
9279 .type = HDA_FIXUP_PINS,
9280 .v.pins = (const struct hda_pintbl[]) {
9281 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
9282 { }
9283 },
9284 .chained = true,
9285 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9286 },
e1037354
JHP
9287 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9288 .type = HDA_FIXUP_PINS,
9289 .v.pins = (const struct hda_pintbl[]) {
9290 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
9291 { }
9292 },
9293 .chained = true,
9294 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9295 },
35fdc6e1
JR
9296 [ALC255_FIXUP_PREDATOR_SUBWOOFER] = {
9297 .type = HDA_FIXUP_PINS,
9298 .v.pins = (const struct hda_pintbl[]) {
9299 { 0x17, 0x90170151 }, /* use as internal speaker (LFE) */
9300 { 0x1b, 0x90170152 } /* use as internal speaker (back) */
9301 }
9302 },
e2a829b3
BR
9303 [ALC299_FIXUP_PREDATOR_SPK] = {
9304 .type = HDA_FIXUP_PINS,
9305 .v.pins = (const struct hda_pintbl[]) {
9306 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
9307 { }
9308 }
9309 },
d64cbb5e
SB
9310 [ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2] = {
9311 .type = HDA_FIXUP_FUNC,
9312 .v.func = cs35l41_fixup_i2c_two,
9313 .chained = true,
9314 .chain_id = ALC255_FIXUP_PREDATOR_SUBWOOFER
9315 },
bd9c10bc 9316 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
9317 .type = HDA_FIXUP_PINS,
9318 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
9319 { 0x19, 0x04a11040 },
9320 { 0x21, 0x04211020 },
60083f9e
JHP
9321 { }
9322 },
9323 .chained = true,
bd9c10bc 9324 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 9325 },
f0d9da19
KY
9326 [ALC289_FIXUP_DELL_SPK1] = {
9327 .type = HDA_FIXUP_PINS,
9328 .v.pins = (const struct hda_pintbl[]) {
9329 { 0x14, 0x90170140 },
9330 { }
9331 },
9332 .chained = true,
9333 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
9334 },
e79c2269 9335 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
9336 .type = HDA_FIXUP_PINS,
9337 .v.pins = (const struct hda_pintbl[]) {
e79c2269 9338 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
9339 { }
9340 },
9341 .chained = true,
e79c2269 9342 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 9343 },
e79c2269
KY
9344 [ALC289_FIXUP_DUAL_SPK] = {
9345 .type = HDA_FIXUP_FUNC,
9346 .v.func = alc285_fixup_speaker2_to_dac1,
9347 .chained = true,
9348 .chain_id = ALC289_FIXUP_DELL_SPK2
9349 },
f0d9da19
KY
9350 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
9351 .type = HDA_FIXUP_FUNC,
9352 .v.func = alc285_fixup_speaker2_to_dac1,
9353 .chained = true,
9354 .chain_id = ALC289_FIXUP_DELL_SPK1
9355 },
48e01504
CC
9356 [ALC294_FIXUP_SPK2_TO_DAC1] = {
9357 .type = HDA_FIXUP_FUNC,
9358 .v.func = alc285_fixup_speaker2_to_dac1,
9359 .chained = true,
9360 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9361 },
9362 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
9363 .type = HDA_FIXUP_FUNC,
9364 /* The GPIO must be pulled to initialize the AMP */
9365 .v.func = alc_fixup_gpio4,
9366 .chained = true,
48e01504 9367 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 9368 },
724418b8
MA
9369 [ALC294_FIXUP_ASUS_ALLY] = {
9370 .type = HDA_FIXUP_FUNC,
9371 .v.func = cs35l41_fixup_i2c_two,
9372 .chained = true,
9373 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
9374 },
9375 [ALC294_FIXUP_ASUS_ALLY_PINS] = {
9376 .type = HDA_FIXUP_PINS,
9377 .v.pins = (const struct hda_pintbl[]) {
9378 { 0x19, 0x03a11050 },
9379 { 0x1a, 0x03a11c30 },
9380 { 0x21, 0x03211420 },
9381 { }
9382 },
9383 .chained = true,
9384 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
9385 },
9386 [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
9387 .type = HDA_FIXUP_VERBS,
9388 .v.verbs = (const struct hda_verb[]) {
9389 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9390 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9391 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
9392 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
9393 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
9394 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
9395 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
9396 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
9397 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
9398 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
9399 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
9400 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
9401 { }
9402 },
9403 .chained = true,
9404 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
9405 },
9406 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
9407 .type = HDA_FIXUP_FUNC,
9408 .v.func = alc285_fixup_speaker2_to_dac1,
9409 },
6a6660d0
TI
9410 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
9411 .type = HDA_FIXUP_FUNC,
9412 .v.func = alc285_fixup_thinkpad_x1_gen7,
9413 .chained = true,
9414 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9415 },
76f7dec0
KY
9416 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
9417 .type = HDA_FIXUP_FUNC,
9418 .v.func = alc_fixup_headset_jack,
9419 .chained = true,
6a6660d0 9420 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 9421 },
8b33a134
JHP
9422 [ALC294_FIXUP_ASUS_HPE] = {
9423 .type = HDA_FIXUP_VERBS,
9424 .v.verbs = (const struct hda_verb[]) {
9425 /* Set EAPD high */
9426 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9427 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
9428 { }
9429 },
9430 .chained = true,
9431 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9432 },
c3cdf189
LJ
9433 [ALC294_FIXUP_ASUS_GX502_PINS] = {
9434 .type = HDA_FIXUP_PINS,
9435 .v.pins = (const struct hda_pintbl[]) {
9436 { 0x19, 0x03a11050 }, /* front HP mic */
9437 { 0x1a, 0x01a11830 }, /* rear external mic */
9438 { 0x21, 0x03211020 }, /* front HP out */
9439 { }
9440 },
9441 .chained = true,
9442 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
9443 },
9444 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
9445 .type = HDA_FIXUP_VERBS,
9446 .v.verbs = (const struct hda_verb[]) {
9447 /* set 0x15 to HP-OUT ctrl */
9448 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9449 /* unmute the 0x15 amp */
9450 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9451 { }
9452 },
9453 .chained = true,
9454 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
9455 },
9456 [ALC294_FIXUP_ASUS_GX502_HP] = {
9457 .type = HDA_FIXUP_FUNC,
9458 .v.func = alc294_fixup_gx502_hp,
9459 },
c1b55029
DC
9460 [ALC294_FIXUP_ASUS_GU502_PINS] = {
9461 .type = HDA_FIXUP_PINS,
9462 .v.pins = (const struct hda_pintbl[]) {
9463 { 0x19, 0x01a11050 }, /* rear HP mic */
9464 { 0x1a, 0x01a11830 }, /* rear external mic */
9465 { 0x21, 0x012110f0 }, /* rear HP out */
9466 { }
9467 },
9468 .chained = true,
9469 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
9470 },
9471 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
9472 .type = HDA_FIXUP_VERBS,
9473 .v.verbs = (const struct hda_verb[]) {
9474 /* set 0x15 to HP-OUT ctrl */
9475 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
9476 /* unmute the 0x15 amp */
9477 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
9478 /* set 0x1b to HP-OUT */
9479 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
9480 { }
9481 },
9482 .chained = true,
9483 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
9484 },
9485 [ALC294_FIXUP_ASUS_GU502_HP] = {
9486 .type = HDA_FIXUP_FUNC,
9487 .v.func = alc294_fixup_gu502_hp,
c611e659
LJ
9488 },
9489 [ALC294_FIXUP_ASUS_G513_PINS] = {
9490 .type = HDA_FIXUP_PINS,
9491 .v.pins = (const struct hda_pintbl[]) {
9492 { 0x19, 0x03a11050 }, /* front HP mic */
9493 { 0x1a, 0x03a11c30 }, /* rear external mic */
9494 { 0x21, 0x03211420 }, /* front HP out */
9495 { }
9496 },
c1b55029 9497 },
bc2c2354
LJ
9498 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
9499 .type = HDA_FIXUP_PINS,
9500 .v.pins = (const struct hda_pintbl[]) {
66ba7c88
LJ
9501 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
9502 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
9503 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
9504 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
9505 { 0x21, 0x03211420 },
bc2c2354
LJ
9506 { }
9507 },
bc2c2354 9508 },
1b94e59d
TI
9509 [ALC294_FIXUP_ASUS_COEF_1B] = {
9510 .type = HDA_FIXUP_VERBS,
9511 .v.verbs = (const struct hda_verb[]) {
9512 /* Set bit 10 to correct noisy output after reboot from
9513 * Windows 10 (due to pop noise reduction?)
9514 */
9515 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
9516 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
9517 { }
9518 },
f8fbcdfb
TI
9519 .chained = true,
9520 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 9521 },
f5a88b0a
KHF
9522 [ALC285_FIXUP_HP_GPIO_LED] = {
9523 .type = HDA_FIXUP_FUNC,
9524 .v.func = alc285_fixup_hp_gpio_led,
9525 },
431e76c3
KY
9526 [ALC285_FIXUP_HP_MUTE_LED] = {
9527 .type = HDA_FIXUP_FUNC,
9528 .v.func = alc285_fixup_hp_mute_led,
9529 },
ca88eeb3
LG
9530 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
9531 .type = HDA_FIXUP_FUNC,
9532 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
9533 },
aa85822c
MS
9534 [ALC285_FIXUP_HP_BEEP_MICMUTE_LED] = {
9535 .type = HDA_FIXUP_FUNC,
9536 .v.func = alc285_fixup_hp_beep,
9537 .chained = true,
9538 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9539 },
0659400f
LG
9540 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
9541 .type = HDA_FIXUP_FUNC,
9542 .v.func = alc236_fixup_hp_mute_led_coefbit2,
9543 },
e7d66cf7
JS
9544 [ALC236_FIXUP_HP_GPIO_LED] = {
9545 .type = HDA_FIXUP_FUNC,
9546 .v.func = alc236_fixup_hp_gpio_led,
9547 },
24164f43
KY
9548 [ALC236_FIXUP_HP_MUTE_LED] = {
9549 .type = HDA_FIXUP_FUNC,
9550 .v.func = alc236_fixup_hp_mute_led,
9551 },
75b62ab6
JW
9552 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9553 .type = HDA_FIXUP_FUNC,
9554 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
9555 },
ef27e89e
TC
9556 [ALC236_FIXUP_LENOVO_INV_DMIC] = {
9557 .type = HDA_FIXUP_FUNC,
9558 .v.func = alc_fixup_inv_dmic,
9559 .chained = true,
9560 .chain_id = ALC283_FIXUP_INT_MIC,
9561 },
b11a74ac
NJL
9562 [ALC295_FIXUP_HP_MUTE_LED_COEFBIT11] = {
9563 .type = HDA_FIXUP_FUNC,
9564 .v.func = alc295_fixup_hp_mute_led_coefbit11,
9565 },
a2d57ebe
KM
9566 [ALC298_FIXUP_SAMSUNG_AMP] = {
9567 .type = HDA_FIXUP_FUNC,
9568 .v.func = alc298_fixup_samsung_amp,
9569 .chained = true,
9570 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9571 },
7e4d4b32
JG
9572 [ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS] = {
9573 .type = HDA_FIXUP_FUNC,
9574 .v.func = alc298_fixup_samsung_amp_v2_2_amps
9575 },
9576 [ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS] = {
dcfed708 9577 .type = HDA_FIXUP_FUNC,
7e4d4b32 9578 .v.func = alc298_fixup_samsung_amp_v2_4_amps
dcfed708 9579 },
14425f1f
MP
9580 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9581 .type = HDA_FIXUP_VERBS,
9582 .v.verbs = (const struct hda_verb[]) {
9583 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9584 { }
9585 },
9586 },
ef248d9b
MK
9587 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9588 .type = HDA_FIXUP_VERBS,
9589 .v.verbs = (const struct hda_verb[]) {
9590 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9591 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9592 { }
9593 },
9594 },
9e43342b
CC
9595 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9596 .type = HDA_FIXUP_PINS,
9597 .v.pins = (const struct hda_pintbl[]) {
9598 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9599 { }
9600 },
9601 .chained = true,
9602 .chain_id = ALC269_FIXUP_HEADSET_MODE
9603 },
8eae7e9b
JHP
9604 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9605 .type = HDA_FIXUP_PINS,
9606 .v.pins = (const struct hda_pintbl[]) {
9607 { 0x14, 0x90100120 }, /* use as internal speaker */
9608 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9609 { 0x1a, 0x01011020 }, /* use as line out */
9610 { },
9611 },
9612 .chained = true,
9613 .chain_id = ALC269_FIXUP_HEADSET_MIC
9614 },
6e15d126
JHP
9615 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9616 .type = HDA_FIXUP_PINS,
9617 .v.pins = (const struct hda_pintbl[]) {
9618 { 0x18, 0x02a11030 }, /* use as headset mic */
9619 { }
9620 },
9621 .chained = true,
9622 .chain_id = ALC269_FIXUP_HEADSET_MIC
9623 },
781c90c0
JHP
9624 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9625 .type = HDA_FIXUP_PINS,
9626 .v.pins = (const struct hda_pintbl[]) {
9627 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9628 { }
9629 },
9630 .chained = true,
9631 .chain_id = ALC269_FIXUP_HEADSET_MIC
9632 },
293a92c1 9633 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
9634 .type = HDA_FIXUP_FUNC,
9635 .v.func = alc289_fixup_asus_ga401,
9636 .chained = true,
9637 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 9638 },
4b43d05a
AS
9639 [ALC289_FIXUP_ASUS_GA502] = {
9640 .type = HDA_FIXUP_PINS,
9641 .v.pins = (const struct hda_pintbl[]) {
9642 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
9643 { }
9644 },
9645 },
f50a121d
JHP
9646 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9647 .type = HDA_FIXUP_PINS,
9648 .v.pins = (const struct hda_pintbl[]) {
9649 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9650 { }
9651 },
9652 .chained = true,
9653 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9654 },
56496253
KY
9655 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9656 .type = HDA_FIXUP_FUNC,
9657 .v.func = alc285_fixup_hp_gpio_amp_init,
9658 .chained = true,
9659 .chain_id = ALC285_FIXUP_HP_GPIO_LED
9660 },
f1ec5be1
HC
9661 [ALC269_FIXUP_CZC_B20] = {
9662 .type = HDA_FIXUP_PINS,
9663 .v.pins = (const struct hda_pintbl[]) {
9664 { 0x12, 0x411111f0 },
9665 { 0x14, 0x90170110 }, /* speaker */
9666 { 0x15, 0x032f1020 }, /* HP out */
9667 { 0x17, 0x411111f0 },
9668 { 0x18, 0x03ab1040 }, /* mic */
9669 { 0x19, 0xb7a7013f },
9670 { 0x1a, 0x0181305f },
9671 { 0x1b, 0x411111f0 },
9672 { 0x1d, 0x411111f0 },
9673 { 0x1e, 0x411111f0 },
9674 { }
9675 },
9676 .chain_id = ALC269_FIXUP_DMIC,
9677 },
9678 [ALC269_FIXUP_CZC_TMI] = {
9679 .type = HDA_FIXUP_PINS,
9680 .v.pins = (const struct hda_pintbl[]) {
9681 { 0x12, 0x4000c000 },
9682 { 0x14, 0x90170110 }, /* speaker */
9683 { 0x15, 0x0421401f }, /* HP out */
9684 { 0x17, 0x411111f0 },
9685 { 0x18, 0x04a19020 }, /* mic */
9686 { 0x19, 0x411111f0 },
9687 { 0x1a, 0x411111f0 },
9688 { 0x1b, 0x411111f0 },
9689 { 0x1d, 0x40448505 },
9690 { 0x1e, 0x411111f0 },
9691 { 0x20, 0x8000ffff },
9692 { }
9693 },
9694 .chain_id = ALC269_FIXUP_DMIC,
9695 },
9696 [ALC269_FIXUP_CZC_L101] = {
9697 .type = HDA_FIXUP_PINS,
9698 .v.pins = (const struct hda_pintbl[]) {
9699 { 0x12, 0x40000000 },
9700 { 0x14, 0x01014010 }, /* speaker */
9701 { 0x15, 0x411111f0 }, /* HP out */
9702 { 0x16, 0x411111f0 },
9703 { 0x18, 0x01a19020 }, /* mic */
9704 { 0x19, 0x02a19021 },
9705 { 0x1a, 0x0181302f },
9706 { 0x1b, 0x0221401f },
9707 { 0x1c, 0x411111f0 },
9708 { 0x1d, 0x4044c601 },
9709 { 0x1e, 0x411111f0 },
9710 { }
9711 },
9712 .chain_id = ALC269_FIXUP_DMIC,
9713 },
9714 [ALC269_FIXUP_LEMOTE_A1802] = {
9715 .type = HDA_FIXUP_PINS,
9716 .v.pins = (const struct hda_pintbl[]) {
9717 { 0x12, 0x40000000 },
9718 { 0x14, 0x90170110 }, /* speaker */
9719 { 0x17, 0x411111f0 },
9720 { 0x18, 0x03a19040 }, /* mic1 */
9721 { 0x19, 0x90a70130 }, /* mic2 */
9722 { 0x1a, 0x411111f0 },
9723 { 0x1b, 0x411111f0 },
9724 { 0x1d, 0x40489d2d },
9725 { 0x1e, 0x411111f0 },
9726 { 0x20, 0x0003ffff },
9727 { 0x21, 0x03214020 },
9728 { }
9729 },
9730 .chain_id = ALC269_FIXUP_DMIC,
9731 },
9732 [ALC269_FIXUP_LEMOTE_A190X] = {
9733 .type = HDA_FIXUP_PINS,
9734 .v.pins = (const struct hda_pintbl[]) {
9735 { 0x14, 0x99130110 }, /* speaker */
9736 { 0x15, 0x0121401f }, /* HP out */
9737 { 0x18, 0x01a19c20 }, /* rear mic */
9738 { 0x19, 0x99a3092f }, /* front mic */
9739 { 0x1b, 0x0201401f }, /* front lineout */
9740 { }
9741 },
9742 .chain_id = ALC269_FIXUP_DMIC,
9743 },
e2d2fded
KHF
9744 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9745 .type = HDA_FIXUP_PINS,
9746 .v.pins = (const struct hda_pintbl[]) {
9747 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9748 { }
9749 },
9750 .chained = true,
9751 .chain_id = ALC269_FIXUP_HEADSET_MODE
9752 },
73e7161e
WS
9753 [ALC256_FIXUP_INTEL_NUC10] = {
9754 .type = HDA_FIXUP_PINS,
9755 .v.pins = (const struct hda_pintbl[]) {
9756 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9757 { }
9758 },
9759 .chained = true,
9760 .chain_id = ALC269_FIXUP_HEADSET_MODE
9761 },
fc19d559
HW
9762 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9763 .type = HDA_FIXUP_VERBS,
9764 .v.verbs = (const struct hda_verb[]) {
9765 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9766 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9767 { }
9768 },
9769 .chained = true,
c84bfedc 9770 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 9771 },
13468bfa
HW
9772 [ALC274_FIXUP_HP_MIC] = {
9773 .type = HDA_FIXUP_VERBS,
9774 .v.verbs = (const struct hda_verb[]) {
9775 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9776 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9777 { }
9778 },
9779 },
8a8de09c
KY
9780 [ALC274_FIXUP_HP_HEADSET_MIC] = {
9781 .type = HDA_FIXUP_FUNC,
9782 .v.func = alc274_fixup_hp_headset_mic,
9783 .chained = true,
9784 .chain_id = ALC274_FIXUP_HP_MIC
9785 },
622464c8
TI
9786 [ALC274_FIXUP_HP_ENVY_GPIO] = {
9787 .type = HDA_FIXUP_FUNC,
9788 .v.func = alc274_fixup_hp_envy_gpio,
9789 },
1b452c2d
VK
9790 [ALC274_FIXUP_ASUS_ZEN_AIO_27] = {
9791 .type = HDA_FIXUP_VERBS,
9792 .v.verbs = (const struct hda_verb[]) {
9793 { 0x20, AC_VERB_SET_COEF_INDEX, 0x10 },
9794 { 0x20, AC_VERB_SET_PROC_COEF, 0xc420 },
9795 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
9796 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
9797 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
9798 { 0x20, AC_VERB_SET_PROC_COEF, 0x0249 },
9799 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
9800 { 0x20, AC_VERB_SET_PROC_COEF, 0x202b },
9801 { 0x20, AC_VERB_SET_COEF_INDEX, 0x62 },
9802 { 0x20, AC_VERB_SET_PROC_COEF, 0xa007 },
9803 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
9804 { 0x20, AC_VERB_SET_PROC_COEF, 0x5060 },
9805 {}
9806 },
9807 .chained = true,
9808 .chain_id = ALC2XX_FIXUP_HEADSET_MIC,
9809 },
ef9ce66f
KY
9810 [ALC256_FIXUP_ASUS_HPE] = {
9811 .type = HDA_FIXUP_VERBS,
9812 .v.verbs = (const struct hda_verb[]) {
9813 /* Set EAPD high */
9814 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9815 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9816 { }
9817 },
9818 .chained = true,
9819 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9820 },
446b8185
KY
9821 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9822 .type = HDA_FIXUP_FUNC,
9823 .v.func = alc_fixup_headset_jack,
9824 .chained = true,
9825 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9826 },
a0ccbc53
KY
9827 [ALC287_FIXUP_HP_GPIO_LED] = {
9828 .type = HDA_FIXUP_FUNC,
9829 .v.func = alc287_fixup_hp_gpio_led,
9830 },
9e885770
KY
9831 [ALC256_FIXUP_HP_HEADSET_MIC] = {
9832 .type = HDA_FIXUP_FUNC,
9833 .v.func = alc274_fixup_hp_headset_mic,
9834 },
92666d45
KY
9835 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9836 .type = HDA_FIXUP_FUNC,
9837 .v.func = alc_fixup_no_int_mic,
9838 .chained = true,
9839 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9840 },
34cdf405
CC
9841 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9842 .type = HDA_FIXUP_PINS,
9843 .v.pins = (const struct hda_pintbl[]) {
9844 { 0x1b, 0x411111f0 },
9845 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9846 { },
9847 },
9848 .chained = true,
9849 .chain_id = ALC269_FIXUP_HEADSET_MODE
9850 },
495dc763
CC
9851 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9852 .type = HDA_FIXUP_FUNC,
9853 .v.func = alc269_fixup_limit_int_mic_boost,
9854 .chained = true,
9855 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9856 },
d0e18561
CC
9857 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
9858 .type = HDA_FIXUP_PINS,
9859 .v.pins = (const struct hda_pintbl[]) {
9860 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9861 { 0x1a, 0x90a1092f }, /* use as internal mic */
9862 { }
9863 },
9864 .chained = true,
9865 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9866 },
26928ca1
TI
9867 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9868 .type = HDA_FIXUP_FUNC,
9869 .v.func = alc285_fixup_ideapad_s740_coef,
9870 .chained = true,
9871 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9872 },
bd15b155
KHF
9873 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9874 .type = HDA_FIXUP_FUNC,
9875 .v.func = alc269_fixup_limit_int_mic_boost,
9876 .chained = true,
9877 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9878 },
8eedd3a7
TI
9879 [ALC295_FIXUP_ASUS_DACS] = {
9880 .type = HDA_FIXUP_FUNC,
9881 .v.func = alc295_fixup_asus_dacs,
9882 },
5d84b531
TI
9883 [ALC295_FIXUP_HP_OMEN] = {
9884 .type = HDA_FIXUP_PINS,
9885 .v.pins = (const struct hda_pintbl[]) {
9886 { 0x12, 0xb7a60130 },
9887 { 0x13, 0x40000000 },
9888 { 0x14, 0x411111f0 },
9889 { 0x16, 0x411111f0 },
9890 { 0x17, 0x90170110 },
9891 { 0x18, 0x411111f0 },
9892 { 0x19, 0x02a11030 },
9893 { 0x1a, 0x411111f0 },
9894 { 0x1b, 0x04a19030 },
9895 { 0x1d, 0x40600001 },
9896 { 0x1e, 0x411111f0 },
9897 { 0x21, 0x03211020 },
9898 {}
9899 },
9900 .chained = true,
9901 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9902 },
f2be77fe 9903 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
9904 .type = HDA_FIXUP_FUNC,
9905 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 9906 },
d94befbb
DB
9907 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9908 .type = HDA_FIXUP_FUNC,
9909 .v.func = alc285_fixup_hp_spectre_x360_eb1
9910 },
be0c40da
TI
9911 [ALC285_FIXUP_HP_SPECTRE_X360_DF1] = {
9912 .type = HDA_FIXUP_FUNC,
9913 .v.func = alc285_fixup_hp_spectre_x360_df1
9914 },
c0621669
AA
9915 [ALC285_FIXUP_HP_ENVY_X360] = {
9916 .type = HDA_FIXUP_FUNC,
9917 .v.func = alc285_fixup_hp_envy_x360,
9918 .chained = true,
9919 .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9920 },
9ebaef05
HW
9921 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9922 .type = HDA_FIXUP_FUNC,
9923 .v.func = alc285_fixup_ideapad_s740_coef,
9924 .chained = true,
9925 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9926 },
29c8f40b
PU
9927 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9928 .type = HDA_FIXUP_FUNC,
9929 .v.func = alc_fixup_no_shutup,
9930 .chained = true,
9931 .chain_id = ALC283_FIXUP_HEADSET_MIC,
9932 },
57c9e21a
HW
9933 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9934 .type = HDA_FIXUP_PINS,
9935 .v.pins = (const struct hda_pintbl[]) {
9936 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9937 { }
9938 },
9939 .chained = true,
9940 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9941 },
8903376d
KHF
9942 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9943 .type = HDA_FIXUP_FUNC,
9944 .v.func = alc269_fixup_limit_int_mic_boost,
9945 .chained = true,
9946 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9947 },
8f4c9042
BF
9948 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9949 .type = HDA_FIXUP_FUNC,
9950 .v.func = alc285_fixup_ideapad_s740_coef,
9951 .chained = true,
9952 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9953 },
9954 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9955 .type = HDA_FIXUP_FUNC,
9956 .v.func = alc287_fixup_legion_15imhg05_speakers,
9957 .chained = true,
9958 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9959 },
ad7cc2d4
CB
9960 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9961 .type = HDA_FIXUP_VERBS,
9962 //.v.verbs = legion_15imhg05_coefs,
9963 .v.verbs = (const struct hda_verb[]) {
9964 // set left speaker Legion 7i.
9965 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9966 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9967
9968 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9969 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9970 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9971 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9972 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9973
9974 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9975 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9976 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9977 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9978 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9979
9980 // set right speaker Legion 7i.
9981 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9982 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9983
9984 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9985 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9986 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9987 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9988 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9989
9990 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9991 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9992 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9993 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9994 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9995 {}
9996 },
9997 .chained = true,
9998 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9999 },
10000 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
10001 .type = HDA_FIXUP_FUNC,
10002 .v.func = alc287_fixup_legion_15imhg05_speakers,
10003 .chained = true,
10004 .chain_id = ALC269_FIXUP_HEADSET_MODE,
10005 },
10006 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
10007 .type = HDA_FIXUP_VERBS,
10008 .v.verbs = (const struct hda_verb[]) {
10009 // set left speaker Yoga 7i.
10010 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10011 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
10012
10013 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10014 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
10015 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10016 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
10017 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10018
10019 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10020 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10021 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10022 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10023 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10024
10025 // set right speaker Yoga 7i.
10026 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10027 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
10028
10029 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10030 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
10031 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10032 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
10033 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10034
10035 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10036 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10037 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10038 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10039 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10040 {}
10041 },
10042 .chained = true,
10043 .chain_id = ALC269_FIXUP_HEADSET_MODE,
10044 },
56ec3e75
TI
10045 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
10046 .type = HDA_FIXUP_FUNC,
10047 .v.func = alc298_fixup_lenovo_c940_duet7,
10048 },
ad7cc2d4
CB
10049 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
10050 .type = HDA_FIXUP_VERBS,
10051 .v.verbs = (const struct hda_verb[]) {
10052 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10053 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 10054 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
10055 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10056 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10057 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10058 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10059 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10060 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
10061 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10062 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10063 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10064 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10065 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10066 {}
10067 },
10068 .chained = true,
10069 .chain_id = ALC269_FIXUP_HEADSET_MODE,
10070 },
619764cc 10071 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 10072 .type = HDA_FIXUP_FUNC,
619764cc 10073 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 10074 },
5fc462c3
JC
10075 [ALC245_FIXUP_HP_GPIO_LED] = {
10076 .type = HDA_FIXUP_FUNC,
10077 .v.func = alc245_fixup_hp_gpio_led,
10078 },
1278cc5a
JS
10079 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
10080 .type = HDA_FIXUP_PINS,
10081 .v.pins = (const struct hda_pintbl[]) {
10082 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
10083 { }
10084 },
10085 .chained = true,
10086 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
10087 },
174a7fb3
WS
10088 [ALC233_FIXUP_NO_AUDIO_JACK] = {
10089 .type = HDA_FIXUP_FUNC,
10090 .v.func = alc233_fixup_no_audio_jack,
10091 },
edca7cc4
WS
10092 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
10093 .type = HDA_FIXUP_FUNC,
10094 .v.func = alc256_fixup_mic_no_presence_and_resume,
10095 .chained = true,
10096 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
10097 },
d3dca026
LT
10098 [ALC287_FIXUP_LEGION_16ACHG6] = {
10099 .type = HDA_FIXUP_FUNC,
10100 .v.func = alc287_fixup_legion_16achg6_speakers,
10101 },
ae7abe36
SB
10102 [ALC287_FIXUP_CS35L41_I2C_2] = {
10103 .type = HDA_FIXUP_FUNC,
10104 .v.func = cs35l41_fixup_i2c_two,
10105 },
b3fbe536
AC
10106 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
10107 .type = HDA_FIXUP_FUNC,
10108 .v.func = cs35l41_fixup_i2c_two,
10109 .chained = true,
10110 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
ae7abe36 10111 },
42320660
SB
10112 [ALC287_FIXUP_CS35L41_I2C_4] = {
10113 .type = HDA_FIXUP_FUNC,
10114 .v.func = cs35l41_fixup_i2c_four,
10115 },
07bcab93
LT
10116 [ALC245_FIXUP_CS35L41_SPI_2] = {
10117 .type = HDA_FIXUP_FUNC,
10118 .v.func = cs35l41_fixup_spi_two,
10119 },
ce18f905
KHF
10120 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
10121 .type = HDA_FIXUP_FUNC,
10122 .v.func = cs35l41_fixup_spi_two,
10123 .chained = true,
10124 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
10125 },
07bcab93
LT
10126 [ALC245_FIXUP_CS35L41_SPI_4] = {
10127 .type = HDA_FIXUP_FUNC,
10128 .v.func = cs35l41_fixup_spi_four,
10129 },
10130 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
10131 .type = HDA_FIXUP_FUNC,
864cb14c 10132 .v.func = cs35l41_fixup_spi_four,
07bcab93 10133 .chained = true,
864cb14c 10134 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
07bcab93 10135 },
91502a9a
AS
10136 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
10137 .type = HDA_FIXUP_VERBS,
10138 .v.verbs = (const struct hda_verb[]) {
10139 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
10140 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
10141 { }
10142 },
10143 .chained = true,
10144 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
10145 },
1efcdd9c
GM
10146 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
10147 .type = HDA_FIXUP_FUNC,
10148 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
10149 .chained = true,
10150 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10151 },
309d7363
DH
10152 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
10153 .type = HDA_FIXUP_PINS,
10154 .v.pins = (const struct hda_pintbl[]) {
10155 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
10156 { }
10157 },
10158 .chained = true,
10159 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
10160 },
1e24881d
LT
10161 [ALC287_FIXUP_LEGION_16ITHG6] = {
10162 .type = HDA_FIXUP_FUNC,
10163 .v.func = alc287_fixup_legion_16ithg6_speakers,
10164 },
3790a3d6
PJ
10165 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
10166 .type = HDA_FIXUP_VERBS,
10167 .v.verbs = (const struct hda_verb[]) {
10168 // enable left speaker
10169 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10170 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
10171
10172 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10173 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
10174 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10175 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
10176 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10177
10178 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10179 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
10180 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10181 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
10182 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10183
10184 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10185 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
10186 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10187 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
10188 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10189
10190 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10191 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10192 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10193 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10194 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10195
10196 // enable right speaker
10197 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
10198 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
10199
10200 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10201 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
10202 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10203 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
10204 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10205
10206 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10207 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
10208 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10209 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
10210 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10211
10212 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10213 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
10214 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10215 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
10216 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10217
10218 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
10219 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
10220 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10221 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
10222 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
10223
10224 { },
10225 },
10226 },
10227 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
10228 .type = HDA_FIXUP_FUNC,
10229 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
10230 .chained = true,
10231 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
10232 },
9b714a59
JZ
10233 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
10234 .type = HDA_FIXUP_FUNC,
10235 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
10236 .chained = true,
10237 .chain_id = ALC287_FIXUP_CS35L41_I2C_2,
10238 },
2912cdda
PJ
10239 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
10240 .type = HDA_FIXUP_FUNC,
10241 .v.func = alc295_fixup_dell_inspiron_top_speakers,
10242 .chained = true,
10243 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10244 },
a4517c4f
CC
10245 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
10246 .type = HDA_FIXUP_PINS,
10247 .v.func = alc1220_fixup_gb_dual_codecs,
10248 .chained = true,
10249 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10250 },
f7b069cf
VR
10251 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
10252 .type = HDA_FIXUP_FUNC,
10253 .v.func = cs35l41_fixup_i2c_two,
10254 .chained = true,
2468e892 10255 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
f7b069cf 10256 },
3babae91
SD
10257 [ALC287_FIXUP_TAS2781_I2C] = {
10258 .type = HDA_FIXUP_FUNC,
10259 .v.func = tas2781_fixup_i2c,
10260 .chained = true,
c1947ce6 10261 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
3babae91 10262 },
bb5f86ea
BX
10263 [ALC245_FIXUP_TAS2781_SPI_2] = {
10264 .type = HDA_FIXUP_FUNC,
10265 .v.func = tas2781_fixup_spi,
10266 .chained = true,
10267 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
10268 },
b5cb53fd
GK
10269 [ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
10270 .type = HDA_FIXUP_FUNC,
10271 .v.func = yoga7_14arb7_fixup_i2c,
10272 .chained = true,
10273 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
10274 },
93dc18e1
SJ
10275 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
10276 .type = HDA_FIXUP_FUNC,
10277 .v.func = alc245_fixup_hp_mute_led_coefbit,
10278 },
e5182305
SK
10279 [ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT] = {
10280 .type = HDA_FIXUP_FUNC,
10281 .v.func = alc245_fixup_hp_mute_led_v1_coefbit,
10282 },
c99c26b1
FV
10283 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
10284 .type = HDA_FIXUP_FUNC,
10285 .v.func = alc245_fixup_hp_mute_led_coefbit,
10286 .chained = true,
10287 .chain_id = ALC245_FIXUP_HP_GPIO_LED
10288 },
e43252db
KY
10289 [ALC287_FIXUP_THINKPAD_I2S_SPK] = {
10290 .type = HDA_FIXUP_FUNC,
10291 .v.func = alc287_fixup_bind_dacs,
2468e892
JR
10292 .chained = true,
10293 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
e43252db 10294 },
d93eeca6
KY
10295 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
10296 .type = HDA_FIXUP_FUNC,
10297 .v.func = alc287_fixup_bind_dacs,
10298 .chained = true,
10299 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
10300 },
c8c0a03e
KY
10301 [ALC2XX_FIXUP_HEADSET_MIC] = {
10302 .type = HDA_FIXUP_FUNC,
10303 .v.func = alc_fixup_headset_mic,
10304 },
f0d9da19
KY
10305 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
10306 .type = HDA_FIXUP_FUNC,
10307 .v.func = cs35l41_fixup_spi_two,
10308 .chained = true,
10309 .chain_id = ALC289_FIXUP_DUAL_SPK
10310 },
6ae90e90
VT
10311 [ALC294_FIXUP_CS35L41_I2C_2] = {
10312 .type = HDA_FIXUP_FUNC,
10313 .v.func = cs35l41_fixup_i2c_two,
10314 },
bd2d8305
IM
10315 [ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
10316 .type = HDA_FIXUP_FUNC,
10317 .v.func = alc256_fixup_acer_sfg16_micmute_led,
10318 },
1e5dc398
HW
10319 [ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
10320 .type = HDA_FIXUP_FUNC,
10321 .v.func = alc256_decrease_headphone_amp_val,
10322 },
61456da0
AG
10323 [ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
10324 .type = HDA_FIXUP_FUNC,
10325 .v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
10326 },
557f6e4a 10327 [ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX] = {
10328 .type = HDA_FIXUP_FUNC,
10329 .v.func = alc245_fixup_hp_spectre_x360_16_aa0xxx,
10330 },
22c7f772
KY
10331 [ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A] = {
10332 .type = HDA_FIXUP_FUNC,
10333 .v.func = alc245_fixup_hp_zbook_firefly_g12a,
10334 },
c33f0d4f
ST
10335 [ALC285_FIXUP_ASUS_GA403U] = {
10336 .type = HDA_FIXUP_FUNC,
10337 .v.func = alc285_fixup_asus_ga403u,
10338 },
0672b017
VT
10339 [ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
10340 .type = HDA_FIXUP_PINS,
10341 .v.pins = (const struct hda_pintbl[]) {
10342 { 0x19, 0x03a11050 },
10343 { 0x1b, 0x03a11c30 },
10344 { }
10345 },
10346 .chained = true,
10347 .chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
10348 },
10349 [ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
10350 .type = HDA_FIXUP_FUNC,
10351 .v.func = alc285_fixup_speaker2_to_dac1,
10352 .chained = true,
10353 .chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
10354 },
10355 [ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
10356 .type = HDA_FIXUP_PINS,
10357 .v.pins = (const struct hda_pintbl[]) {
10358 { 0x19, 0x03a11050 },
10359 { 0x1b, 0x03a11c30 },
10360 { }
10361 },
0672b017
VT
10362 },
10363 [ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
10364 .type = HDA_FIXUP_FUNC,
10365 .v.func = alc285_fixup_speaker2_to_dac1,
10366 .chained = true,
10367 .chain_id = ALC285_FIXUP_ASUS_GA403U,
10368 },
1e707769
KY
10369 [ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
10370 .type = HDA_FIXUP_FUNC,
10371 .v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
10372 .chained = true,
10373 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
10374 },
0df2b9ed
KY
10375 [ALC256_FIXUP_CHROME_BOOK] = {
10376 .type = HDA_FIXUP_FUNC,
10377 .v.func = alc256_fixup_chromebook,
10378 .chained = true,
10379 .chain_id = ALC225_FIXUP_HEADSET_JACK
10380 },
56275550
MMG
10381 [ALC245_FIXUP_CLEVO_NOISY_MIC] = {
10382 .type = HDA_FIXUP_FUNC,
10383 .v.func = alc269_fixup_limit_int_mic_boost,
10384 .chained = true,
10385 .chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
10386 },
fc09ea51
EJD
10387 [ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = {
10388 .type = HDA_FIXUP_PINS,
10389 .v.pins = (const struct hda_pintbl[]) {
10390 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10391 { 0x1b, 0x20a11040 }, /* dock mic */
10392 { }
10393 },
10394 .chained = true,
10395 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
10396 },
31917b7b
KY
10397 [ALC233_FIXUP_MEDION_MTL_SPK] = {
10398 .type = HDA_FIXUP_PINS,
10399 .v.pins = (const struct hda_pintbl[]) {
10400 { 0x1b, 0x90170110 },
10401 { }
10402 },
10403 },
a7df7f90
JK
10404 [ALC294_FIXUP_BASS_SPEAKER_15] = {
10405 .type = HDA_FIXUP_FUNC,
10406 .v.func = alc294_fixup_bass_speaker_15,
10407 },
8c2fa441
TI
10408 [ALC283_FIXUP_DELL_HP_RESUME] = {
10409 .type = HDA_FIXUP_FUNC,
10410 .v.func = alc283_fixup_dell_hp_resume,
10411 },
b5458fca
KY
10412 [ALC294_FIXUP_ASUS_CS35L41_SPI_2] = {
10413 .type = HDA_FIXUP_FUNC,
10414 .v.func = cs35l41_fixup_spi_two,
10415 .chained = true,
10416 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC,
10417 },
e8fa236e
CC
10418 [ALC274_FIXUP_HP_AIO_BIND_DACS] = {
10419 .type = HDA_FIXUP_FUNC,
10420 .v.func = alc274_fixup_hp_aio_bind_dacs,
10421 },
60599e4f
ST
10422 [ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC] = {
10423 .type = HDA_FIXUP_PINS,
10424 .v.pins = (const struct hda_pintbl[]) {
10425 { 0x19, 0x03a11050 },
10426 { 0x1b, 0x03a11c30 },
10427 { }
10428 },
10429 .chained = true,
10430 .chain_id = ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1
10431 },
10432 [ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1] = {
10433 .type = HDA_FIXUP_FUNC,
10434 .v.func = alc285_fixup_speaker2_to_dac1,
10435 },
33bdee12
EJD
10436 [ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC] = {
10437 .type = HDA_FIXUP_FUNC,
10438 .v.func = alc269_fixup_limit_int_mic_boost,
10439 .chained = true,
10440 .chain_id = ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
10441 },
f1d4e28b
KY
10442};
10443
5b1913a7 10444static const struct hda_quirk alc269_fixup_tbl[] = {
a6b92b66 10445 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
10446 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
10447 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 10448 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 10449 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
10450 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
10451 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 10452 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 10453 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 10454 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 10455 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 10456 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
3c0b6f92 10457 SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
13be30f1 10458 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 10459 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 10460 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 10461 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 10462 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
10463 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
10464 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
10465 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
10466 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
35fdc6e1
JR
10467 SND_PCI_QUIRK(0x1025, 0x1177, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
10468 SND_PCI_QUIRK(0x1025, 0x1178, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
e2a829b3 10469 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 10470 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 10471 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 10472 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
efb56d84 10473 SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
667a8f73
JHP
10474 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10475 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
10476 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 10477 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
5f3fe25e 10478 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
35171fbf 10479 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 10480 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 10481 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 10482 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
5cb4e5b0 10483 SND_PCI_QUIRK(0x1025, 0x1360, "Acer Aspire A115", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
2a5bb694 10484 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 10485 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 10486 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 10487 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
6a28a25d 10488 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
5a69e3d0 10489 SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC),
bd2d8305 10490 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
d64cbb5e
SB
10491 SND_PCI_QUIRK(0x1025, 0x1826, "Acer Helios ZPC", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
10492 SND_PCI_QUIRK(0x1025, 0x182c, "Acer Helios ZPD", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
10493 SND_PCI_QUIRK(0x1025, 0x1844, "Acer Helios ZPS", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
aaedfb47 10494 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
841bdf85 10495 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
6ed1131f 10496 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 10497 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 10498 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
10499 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
10500 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 10501 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
10502 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10503 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
10504 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8c2fa441 10505 SND_PCI_QUIRK(0x1028, 0x0604, "Dell Venue 11 Pro 7130", ALC283_FIXUP_DELL_HP_RESUME),
0f4881dc
DH
10506 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
10507 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 10508 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 10509 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 10510 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
10511 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10512 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 10513 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 10514 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 10515 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 10516 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
10517 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10518 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
10519 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10520 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10521 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10522 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
10523 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 10524 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 10525 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 10526 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 10527 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 10528 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 10529 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 10530 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 10531 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
10532 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
10533 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
10534 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
10535 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 10536 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
efa6bdf1 10537 SND_PCI_QUIRK(0x1028, 0x0879, "Dell Latitude 5420 Rugged", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
136824ef 10538 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 10539 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 10540 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 10541 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 10542 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
10543 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
10544 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
10545 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
10546 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
1efcdd9c 10547 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
c1e89523 10548 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 10549 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 10550 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
10551 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
10552 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
15dad62f 10553 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
bdc9b739 10554 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
42320660
SB
10555 SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
10556 SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
2912cdda
PJ
10557 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
10558 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
cd14dedf 10559 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
a5751933 10560 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
fddab35f 10561 SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
fcfc9f71 10562 SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
fddab35f 10563 SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
a4517c4f
CC
10564 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10565 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
10566 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10567 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
10568 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
10569 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
89a0dff6 10570 SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
42320660 10571 SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
1e9c708d
BX
10572 SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC287_FIXUP_TAS2781_I2C),
10573 SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC287_FIXUP_TAS2781_I2C),
f0d9da19
KY
10574 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10575 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10576 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10577 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
10578 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10579 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10580 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10581 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
10582 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
a22aa26f
KY
10583 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
10584 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 10585 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 10586 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 10587 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 10588 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 10589 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 10590 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
10591 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10592 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
10593 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10594 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
10595 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10596 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10597 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
10598 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 10599 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
10600 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10601 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10602 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10603 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10604 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 10605 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 10606 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 10607 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 10608 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
10609 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10610 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10611 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
10612 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10613 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10614 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10615 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10616 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 10617 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 10618 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 10619 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 10620 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 10621 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 10622 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 10623 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 10624 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 10625 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
10626 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10627 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10628 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10629 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10630 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 10631 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
10632 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10633 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
10634 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10635 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
10636 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
10637 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
10638 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10639 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10640 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
10641 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4ba5c853 10642 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
167897f4
JK
10643 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10644 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
10645 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
10646 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
92553ee0 10647 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
e549d190 10648 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 10649 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 10650 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
10651 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
10652 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 10653 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 10654 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 10655 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
b4695302 10656 SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9b726bf6 10657 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
5d84b531 10658 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 10659 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 10660 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
b6ce6e6c 10661 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b11a74ac 10662 SND_PCI_QUIRK(0x103c, 0x85c6, "HP Pavilion x360 Convertible 14-dy1xxx", ALC295_FIXUP_HP_MUTE_LED_COEFBIT11),
c0621669 10663 SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
d296a74b 10664 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 10665 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 10666 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
2d5af3ab 10667 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
622464c8 10668 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
24df5428 10669 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
be0c40da 10670 SND_PCI_QUIRK(0x103c, 0x863e, "HP Spectre x360 15-df1xxx", ALC285_FIXUP_HP_SPECTRE_X360_DF1),
24df5428 10671 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
ca88eeb3 10672 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
15d295b5 10673 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 10674 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 10675 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
c058493d 10676 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 10677 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 10678 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
05ec7161 10679 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 10680 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
aa85822c 10681 SND_PCI_QUIRK(0x103c, 0x8760, "HP EliteBook 8{4,5}5 G7", ALC285_FIXUP_HP_BEEP_MICMUTE_LED),
6b3d14b7 10682 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
431e76c3 10683 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 10684 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
10685 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10686 ALC285_FIXUP_HP_GPIO_AMP_INIT),
10687 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10688 ALC285_FIXUP_HP_GPIO_AMP_INIT),
30267718 10689 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
b2e6b3d9 10690 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
375f8426 10691 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
f0d78972 10692 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
48422958 10693 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
1d091a98 10694 SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
3a83f7ba 10695 SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
e7d66cf7 10696 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 10697 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 10698 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 10699 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
10700 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10701 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 10702 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 10703 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
47a9e8db 10704 SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
bc7863d1 10705 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
d07149ab 10706 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 10707 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
10708 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10709 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
d510acb6 10710 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
35ef1c79 10711 SND_PCI_QUIRK(0x103c, 0x881e, "HP Laptop 15s-du3xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
53b861be 10712 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 10713 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 10714 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 10715 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
10716 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10717 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 10718 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 10719 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 10720 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0659400f 10721 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
711aad3c 10722 SND_PCI_QUIRK(0x103c, 0x887c, "HP Laptop 14s-fq1xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
c99c26b1 10723 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
600dd2a7 10724 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
91502a9a 10725 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
0e68c4b1 10726 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 10727 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 10728 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
d75dba49 10729 SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
49632230 10730 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
8384c0ba 10731 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
e7477cb9 10732 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
f86bfeb6 10733 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
5f5d8890
AC
10734 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10735 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10736 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10737 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10738 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10739 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
67c3d771 10740 SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
07bcab93 10741 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
68cc9d3c 10742 SND_PCI_QUIRK(0x103c, 0x898a, "HP Pavilion 15-eg100", ALC287_FIXUP_HP_GPIO_LED),
07bcab93
LT
10743 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10744 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 10745 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 10746 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 10747 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 10748 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
e6194c8d
AC
10749 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10750 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
024a7ad9 10751 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
e6194c8d
AC
10752 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10753 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
f86bfeb6 10754 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93 10755 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
ce18f905 10756 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
f7ac570d 10757 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9a6804aa 10758 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
aa8e3ef4 10759 SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
13a5b211 10760 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
56e85993 10761 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
93dc18e1 10762 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
aa8e3ef4
SB
10763 SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
10764 SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10765 SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10766 SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10767 SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10768 SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10769 SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
aa8e3ef4
SB
10770 SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10771 SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10772 SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
300ab0df 10773 SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
5f3d696e 10774 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
61d30785
JS
10775 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10776 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10777 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10778 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
1fdf4e8b 10779 SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
3e10f6ca 10780 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
c578d5da
KHF
10781 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10782 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
aa8e3ef4 10783 SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
32f03f40 10784 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b944aa9d 10785 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
aa8e3ef4 10786 SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
67c3d771 10787 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
9251584a
AC
10788 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10789 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10790 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10791 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10792 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10793 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
32f03f40 10794 SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1d8025ec
AC
10795 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10796 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
96409eea 10797 SND_PCI_QUIRK(0x103c, 0x8b5f, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
3e10f6ca 10798 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
2ae147d6 10799 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9fdc1605 10800 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
e94f1f96
AC
10801 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10802 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10803 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
3e10f6ca 10804 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
6c4715aa
AC
10805 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10806 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
5007b848 10807 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
6c4715aa
AC
10808 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10809 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10810 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
b752a385 10811 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
858c5415 10812 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
56fc217f 10813 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9dc68a4f 10814 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
875e0cd5
SB
10815 SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10816 SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
a0914bf5 10817 SND_PCI_QUIRK(0x103c, 0x8bc8, "HP Victus 15-fa1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
e5182305 10818 SND_PCI_QUIRK(0x103c, 0x8bcd, "HP Omen 16-xd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
aa8e3ef4
SB
10819 SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10820 SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10821 SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10822 SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10823 SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10824 SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10825 SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10826 SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10827 SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10828 SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10829 SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10830 SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
9c694fbf 10831 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
61456da0 10832 SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
557f6e4a 10833 SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre x360 2-in-1 Laptop 16-aa0xxx", ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX),
aa8e3ef4 10834 SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
56314c0d 10835 SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS),
b474f60f 10836 SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
fb8cce69
SB
10837 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10838 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10839 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10840 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
875e0cd5
SB
10841 SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
10842 SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
aa8e3ef4
SB
10843 SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10844 SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10845 SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
2186fe21
ST
10846 SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC285_FIXUP_HP_GPIO_LED),
10847 SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC285_FIXUP_HP_GPIO_LED),
aa8e3ef4
SB
10848 SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10849 SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10850 SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10851 SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
fb8cce69
SB
10852 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10853 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10854 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
ea5f8c4c
AC
10855 SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10856 SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10857 SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10858 SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
3cd59d8e
DS
10859 SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10860 SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10861 SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b3b6f125 10862 SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
a17bd44c
AC
10863 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10864 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
b3b6f125
AC
10865 SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
10866 SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
a17bd44c
AC
10867 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10868 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
18a434f3 10869 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b018cee7 10870 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
a0914bf5 10871 SND_PCI_QUIRK(0x103c, 0x8c9c, "HP Victus 16-s1xxx (MB 8C9C)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
1513664f
AC
10872 SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10873 SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
5d639b60
SB
10874 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10875 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
cb2deca0 10876 SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
2dc43c5e 10877 SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
494d0939
KY
10878 SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
10879 SND_PCI_QUIRK(0x103c, 0x8cde, "HP OmniBook Ultra Flip Laptop 14t", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
84471d01
VR
10880 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10881 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
5d639b60 10882 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
0d08f0ee 10883 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED),
e8fa236e 10884 SND_PCI_QUIRK(0x103c, 0x8d18, "HP EliteStudio 8 AIO", ALC274_FIXUP_HP_AIO_BIND_DACS),
7ba81e4c 10885 SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED),
0b1b5161
CC
10886 SND_PCI_QUIRK(0x103c, 0x8d85, "HP EliteBook 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10887 SND_PCI_QUIRK(0x103c, 0x8d86, "HP Elite X360 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10888 SND_PCI_QUIRK(0x103c, 0x8d8c, "HP EliteBook 13 G12", ALC285_FIXUP_HP_GPIO_LED),
10889 SND_PCI_QUIRK(0x103c, 0x8d8d, "HP Elite X360 13 G12", ALC285_FIXUP_HP_GPIO_LED),
10890 SND_PCI_QUIRK(0x103c, 0x8d8e, "HP EliteBook 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10891 SND_PCI_QUIRK(0x103c, 0x8d8f, "HP EliteBook 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10892 SND_PCI_QUIRK(0x103c, 0x8d90, "HP EliteBook 16 G12", ALC285_FIXUP_HP_GPIO_LED),
0d08f0ee
CC
10893 SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED),
10894 SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED),
29951021
SB
10895 SND_PCI_QUIRK(0x103c, 0x8d9b, "HP 17 Turbine OmniBook 7 UMA", ALC287_FIXUP_CS35L41_I2C_2),
10896 SND_PCI_QUIRK(0x103c, 0x8d9c, "HP 17 Turbine OmniBook 7 DIS", ALC287_FIXUP_CS35L41_I2C_2),
10897 SND_PCI_QUIRK(0x103c, 0x8d9d, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2),
10898 SND_PCI_QUIRK(0x103c, 0x8d9e, "HP 17 Turbine OmniBook X DIS", ALC287_FIXUP_CS35L41_I2C_2),
10899 SND_PCI_QUIRK(0x103c, 0x8d9f, "HP 14 Cadet (x360)", ALC287_FIXUP_CS35L41_I2C_2),
10900 SND_PCI_QUIRK(0x103c, 0x8da0, "HP 16 Clipper OmniBook 7(X360)", ALC287_FIXUP_CS35L41_I2C_2),
10901 SND_PCI_QUIRK(0x103c, 0x8da1, "HP 16 Clipper OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
10902 SND_PCI_QUIRK(0x103c, 0x8da7, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
10903 SND_PCI_QUIRK(0x103c, 0x8da8, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
e8fa236e 10904 SND_PCI_QUIRK(0x103c, 0x8dd4, "HP EliteStudio 8 AIO", ALC274_FIXUP_HP_AIO_BIND_DACS),
bb5f86ea
BX
10905 SND_PCI_QUIRK(0x103c, 0x8de8, "HP Gemtree", ALC245_FIXUP_TAS2781_SPI_2),
10906 SND_PCI_QUIRK(0x103c, 0x8de9, "HP Gemtree", ALC245_FIXUP_TAS2781_SPI_2),
78f4ca3c 10907 SND_PCI_QUIRK(0x103c, 0x8dec, "HP EliteBook 640 G12", ALC236_FIXUP_HP_GPIO_LED),
63f5235e 10908 SND_PCI_QUIRK(0x103c, 0x8ded, "HP EliteBook 640 G12", ALC236_FIXUP_HP_GPIO_LED),
78f4ca3c 10909 SND_PCI_QUIRK(0x103c, 0x8dee, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED),
63f5235e 10910 SND_PCI_QUIRK(0x103c, 0x8def, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED),
78f4ca3c 10911 SND_PCI_QUIRK(0x103c, 0x8df0, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
63f5235e 10912 SND_PCI_QUIRK(0x103c, 0x8df1, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
9a07ca9a 10913 SND_PCI_QUIRK(0x103c, 0x8dfb, "HP EliteBook 6 G1a 14", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
78f4ca3c 10914 SND_PCI_QUIRK(0x103c, 0x8dfc, "HP EliteBook 645 G12", ALC236_FIXUP_HP_GPIO_LED),
9a07ca9a 10915 SND_PCI_QUIRK(0x103c, 0x8dfd, "HP EliteBook 6 G1a 16", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
78f4ca3c 10916 SND_PCI_QUIRK(0x103c, 0x8dfe, "HP EliteBook 665 G12", ALC236_FIXUP_HP_GPIO_LED),
29951021
SB
10917 SND_PCI_QUIRK(0x103c, 0x8e11, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2),
10918 SND_PCI_QUIRK(0x103c, 0x8e12, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2),
10919 SND_PCI_QUIRK(0x103c, 0x8e13, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2),
22c7f772
KY
10920 SND_PCI_QUIRK(0x103c, 0x8e14, "HP ZBook Firefly 14 G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10921 SND_PCI_QUIRK(0x103c, 0x8e15, "HP ZBook Firefly 14 G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10922 SND_PCI_QUIRK(0x103c, 0x8e16, "HP ZBook Firefly 14 G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10923 SND_PCI_QUIRK(0x103c, 0x8e17, "HP ZBook Firefly 14 G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10924 SND_PCI_QUIRK(0x103c, 0x8e18, "HP ZBook Firefly 14 G12A", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10925 SND_PCI_QUIRK(0x103c, 0x8e19, "HP ZBook Firefly 14 G12A", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10926 SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10927 SND_PCI_QUIRK(0x103c, 0x8e1b, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10928 SND_PCI_QUIRK(0x103c, 0x8e1c, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
f709b78a 10929 SND_PCI_QUIRK(0x103c, 0x8e1d, "HP ZBook X Gli 16 G12", ALC236_FIXUP_HP_GPIO_LED),
0b1b5161 10930 SND_PCI_QUIRK(0x103c, 0x8e2c, "HP EliteBook 16 G12", ALC285_FIXUP_HP_GPIO_LED),
29951021
SB
10931 SND_PCI_QUIRK(0x103c, 0x8e36, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
10932 SND_PCI_QUIRK(0x103c, 0x8e37, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
7150d57c
SB
10933 SND_PCI_QUIRK(0x103c, 0x8e3a, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
10934 SND_PCI_QUIRK(0x103c, 0x8e3b, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
29951021
SB
10935 SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
10936 SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
10937 SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
c6451a73 10938 SND_PCI_QUIRK(0x1043, 0x1032, "ASUS VivoBook X513EA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
7b23887a 10939 SND_PCI_QUIRK(0x1043, 0x1034, "ASUS GU605C", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
c1732ede 10940 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 10941 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9120b2b4 10942 SND_PCI_QUIRK(0x1043, 0x1054, "ASUS G614FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
3e0d611b 10943 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
829ee558 10944 SND_PCI_QUIRK(0x1043, 0x106f, "ASUS VivoBook X515UA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9120b2b4 10945 SND_PCI_QUIRK(0x1043, 0x1074, "ASUS G614PH/PM/PP", ALC287_FIXUP_CS35L41_I2C_2),
9cf6533e 10946 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
1e9c708d 10947 SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C),
c1732ede 10948 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 10949 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
713f040c 10950 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
1e9c708d 10951 SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C),
3e0d611b 10952 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8463d2ad 10953 SND_PCI_QUIRK(0x1043, 0x1194, "ASUS UM3406KA", ALC287_FIXUP_CS35L41_I2C_2),
4eab0ea1 10954 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
1e9c708d
BX
10955 SND_PCI_QUIRK(0x1043, 0x1204, "ASUS Strix G615JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
10956 SND_PCI_QUIRK(0x1043, 0x1214, "ASUS Strix G615LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
3cd0ed63 10957 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 10958 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1 10959 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
859a1191 10960 SND_PCI_QUIRK(0x1043, 0x1294, "ASUS B3405CVA", ALC245_FIXUP_CS35L41_SPI_2),
4eab0ea1 10961 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
e959f2be 10962 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
461122b9 10963 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
b5458fca 10964 SND_PCI_QUIRK(0x1043, 0x12b4, "ASUS B3405CCA / P3405CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
4d5b71b4
TI
10965 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
10966 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
f882c4be 10967 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
60599e4f 10968 SND_PCI_QUIRK(0x1043, 0x1314, "ASUS GA605K", ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC),
4d5b71b4 10969 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
2cede303 10970 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
a40ce9f4 10971 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
9e7c6779 10972 SND_PCI_QUIRK(0x1043, 0x1460, "Asus VivoBook 15", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
a40ce9f4
SB
10973 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10974 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10975 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10976 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10977 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10978 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
84c3c08f 10979 SND_PCI_QUIRK(0x1043, 0x14f2, "ASUS VivoBook X515JA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
a40ce9f4 10980 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
23870831 10981 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
a40ce9f4
SB
10982 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10983 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 10984 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 10985 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
7e2d0662 10986 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
852d432a 10987 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
b16c8f22 10988 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
ae53e219 10989 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
3e0d611b 10990 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
ae53e219 10991 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
8eedd3a7 10992 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 10993 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 10994 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
ae53e219 10995 SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
3cd0ed63 10996 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 10997 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
c5c325bb 10998 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
4963d66b 10999 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 11000 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
4fad4fb9 11001 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 11002 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 11003 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 11004 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 11005 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
61cbc08f 11006 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
6ae90e90 11007 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
461122b9 11008 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1b94e59d 11009 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
0672b017 11010 SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
811dd426 11011 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
615966ad 11012 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
61cbc08f 11013 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
4eab0ea1 11014 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61cbc08f
SB
11015 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
11016 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
a4671b7f 11017 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
0672b017 11018 SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
8983dc1b 11019 SND_PCI_QUIRK(0x1043, 0x1c80, "ASUS VivoBook TP401", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
bc2c2354 11020 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
a40ce9f4
SB
11021 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
11022 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
4d5b71b4 11023 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
a40ce9f4
SB
11024 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
11025 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
11026 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
11027 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
b16c8f22 11028 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ef9ce66f 11029 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
51d97607 11030 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
a7df7f90 11031 SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606WA", ALC294_FIXUP_BASS_SPEAKER_15),
be8cd366 11032 SND_PCI_QUIRK(0x1043, 0x1264, "ASUS UM5606KA", ALC294_FIXUP_BASS_SPEAKER_15),
07058dce 11033 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
7ab6847a 11034 SND_PCI_QUIRK(0x1043, 0x1e10, "ASUS VivoBook X507UAR", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4b43d05a 11035 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
b9105044 11036 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
a83e4c97 11037 SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
c1b55029 11038 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
c611e659 11039 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
44a48b26 11040 SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
f67b1ef2 11041 SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
76fae618 11042 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
1e9c708d 11043 SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C),
21a522f9 11044 SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
b9105044 11045 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
ba1f8180 11046 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
293a92c1 11047 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8d06679b 11048 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
ae53e219 11049 SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
51d97607 11050 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
f479ecc5 11051 SND_PCI_QUIRK(0x1043, 0x1f63, "ASUS P5405CSA", ALC245_FIXUP_CS35L41_SPI_2),
2ea8e129 11052 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
12784ca3 11053 SND_PCI_QUIRK(0x1043, 0x1fb3, "ASUS ROG Flow Z13 GZ302EA", ALC287_FIXUP_CS35L41_I2C_2),
859a1191 11054 SND_PCI_QUIRK(0x1043, 0x3011, "ASUS B5605CVA", ALC245_FIXUP_CS35L41_SPI_2),
eeed4cd1 11055 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
b5458fca
KY
11056 SND_PCI_QUIRK(0x1043, 0x3061, "ASUS B3405CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
11057 SND_PCI_QUIRK(0x1043, 0x3071, "ASUS B5405CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
11058 SND_PCI_QUIRK(0x1043, 0x30c1, "ASUS B3605CCA / P3605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
11059 SND_PCI_QUIRK(0x1043, 0x30d1, "ASUS B5405CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
11060 SND_PCI_QUIRK(0x1043, 0x30e1, "ASUS B5605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
1b452c2d 11061 SND_PCI_QUIRK(0x1043, 0x31d0, "ASUS Zen AIO 27 Z272SD_A272SD", ALC274_FIXUP_ASUS_ZEN_AIO_27),
b5458fca
KY
11062 SND_PCI_QUIRK(0x1043, 0x31e1, "ASUS B5605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
11063 SND_PCI_QUIRK(0x1043, 0x31f1, "ASUS B3605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
e6e18021
LJ
11064 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
11065 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
2be46155 11066 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
e6e18021 11067 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
0bfe1050 11068 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
16dc1573
SB
11069 SND_PCI_QUIRK(0x1043, 0x3d78, "ASUS GA603KH", ALC287_FIXUP_CS35L41_I2C_2),
11070 SND_PCI_QUIRK(0x1043, 0x3d88, "ASUS GA603KM", ALC287_FIXUP_CS35L41_I2C_2),
f2c11231
SB
11071 SND_PCI_QUIRK(0x1043, 0x3e00, "ASUS G814FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
11072 SND_PCI_QUIRK(0x1043, 0x3e20, "ASUS G814PH/PM/PP", ALC287_FIXUP_CS35L41_I2C_2),
1e9c708d
BX
11073 SND_PCI_QUIRK(0x1043, 0x3e30, "ASUS TP3607SA", ALC287_FIXUP_TAS2781_I2C),
11074 SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
11075 SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
11076 SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
11077 SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
11078 SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TAS2781_I2C),
11079 SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TAS2781_I2C),
859a1191
SB
11080 SND_PCI_QUIRK(0x1043, 0x3fd0, "ASUS B3605CVA", ALC245_FIXUP_CS35L41_SPI_2),
11081 SND_PCI_QUIRK(0x1043, 0x3ff0, "ASUS B5405CVA", ALC245_FIXUP_CS35L41_SPI_2),
adabb3ec
TI
11082 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
11083 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
11084 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
11085 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 11086 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
11087 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
11088 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
11089 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 11090 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
11091 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
11092 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 11093 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 11094 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 11095 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 11096 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 11097 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 11098 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 11099 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 11100 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8fc1e8b2 11101 SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
6db03b19 11102 SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6fa38ef1 11103 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
4f2e56a5 11104 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
11105 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
11106 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ccbd88be 11107 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
a0978123 11108 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
1576f263 11109 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
a33cc48d 11110 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
a2d57ebe
KM
11111 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
11112 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
11113 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
11114 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
b18a4563 11115 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
d7063c08 11116 SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
1abfd71e 11117 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
823ff161 11118 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
a2d57ebe
KM
11119 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
11120 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
ef248d9b 11121 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
bd401fd7 11122 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
e2974a22 11123 SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
a86e79e3 11124 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
7e4d4b32 11125 SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
5740434e 11126 SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
7e4d4b32
JG
11127 SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
11128 SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
11129 SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
abaa2274
AA
11130 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
11131 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 11132 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 11133 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
7caf3daa 11134 SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
33affa7f 11135 SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 11136 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 11137 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11138 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11139 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11140 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11141 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
33affa7f 11142 SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0b04fbe8 11143 SND_PCI_QUIRK(0x1558, 0x28c1, "Clevo V370VND", ALC2XX_FIXUP_HEADSET_MIC),
e41687b5
TC
11144 SND_PCI_QUIRK(0x1558, 0x35a1, "Clevo V3[56]0EN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11145 SND_PCI_QUIRK(0x1558, 0x35b1, "Clevo V3[57]0WN[MNP]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11146 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11147 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11148 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
be561ffa 11149 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11150 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11151 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11152 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
11153 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11154 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11155 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11156 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11157 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11158 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11159 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
11160 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11161 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 11162 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 11163 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 11164 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
11165 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11166 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11167 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11168 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11169 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
da209f7a 11170 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
c250ef89 11171 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 11172 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
e41687b5 11173 SND_PCI_QUIRK(0x1558, 0x5700, "Clevo X560WN[RST]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11174 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11175 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
11176 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11177 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11178 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11179 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
627ce0d6 11180 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
90d74fdb 11181 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11bea269 11182 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0a6b36c5 11183 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11184 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11185 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11186 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11187 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11188 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
11189 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11190 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11191 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
11192 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
11193 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 11194 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9cb72750 11195 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
86222af0 11196 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0c20fce1 11197 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 11198 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
edca7cc4 11199 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
11200 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11201 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11202 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11203 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 11204 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
11205 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11206 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 11207 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
fc09ea51 11208 SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE),
745f260b 11209 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
22065e42 11210 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 11211 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
56275550 11212 SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC),
e41687b5 11213 SND_PCI_QUIRK(0x1558, 0xa743, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
56275550 11214 SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
1d5cfca2
PH
11215 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11216 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11217 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11218 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11219 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11220 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 11221 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 11222 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
11223 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
11224 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
11225 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
11226 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
11227 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 11228 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 11229 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 11230 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 11231 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 11232 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 11233 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 11234 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 11235 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 11236 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 11237 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 11238 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 11239 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 11240 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 11241 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 11242 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 11243 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
11244 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11245 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 11246 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 11247 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
f74ab0c5 11248 SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
61fcf8ec
KY
11249 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
11250 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11251 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 11252 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
11253 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11254 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11255 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 11256 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 11257 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 11258 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
11259 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
11260 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
d93eeca6
KY
11261 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11262 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11263 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11264 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11265 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11266 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11267 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11268 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
1e707769
KY
11269 SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
11270 SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
1e5597e5 11271 SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C),
3694cb29 11272 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 11273 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 11274 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 11275 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 11276 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 11277 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 11278 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 11279 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
11280 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
11281 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 11282 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
fb3c007f 11283 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
f603b159
KY
11284 SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
11285 SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
11286 SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
3790a3d6 11287 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
504f052a
TI
11288 HDA_CODEC_QUIRK(0x17aa, 0x3802, "DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
11289 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8", ALC287_FIXUP_TAS2781_I2C),
2aac550d 11290 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
56ec3e75 11291 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
2aac550d 11292 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
504f052a
TI
11293 HDA_CODEC_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
11294 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8f4c9042 11295 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
2aac550d 11296 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b81e9e5c 11297 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
c07f2c7b 11298 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 11299 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
d3dca026 11300 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
2aac550d 11301 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
11302 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
11303 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1e24881d 11304 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
25f46354
SB
11305 SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
11306 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
70cfdd03 11307 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
504f052a
TI
11308 HDA_CODEC_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
11309 SND_PCI_QUIRK(0x17aa, 0x386e, "Yoga Pro 7 14ARP8", ALC285_FIXUP_SPEAKER2_TO_DAC1),
0f3a822a 11310 HDA_CODEC_QUIRK(0x17aa, 0x38a8, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C), /* this must match before PCI SSID 17aa:386f below */
504f052a 11311 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
b5cb53fd 11312 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
b67a7dc4
CB
11313 SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
11314 SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
3babae91
SD
11315 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
11316 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
1e9c708d
BX
11317 SND_PCI_QUIRK(0x17aa, 0x387f, "Yoga S780-16 pro dual LX", ALC287_FIXUP_TAS2781_I2C),
11318 SND_PCI_QUIRK(0x17aa, 0x3880, "Yoga S780-16 pro dual YC", ALC287_FIXUP_TAS2781_I2C),
f286620b 11319 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
634e5e1e 11320 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
3babae91
SD
11321 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
11322 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
ad22051a 11323 SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
1e9c708d 11324 SND_PCI_QUIRK(0x17aa, 0x38a5, "Y580P AMD dual", ALC287_FIXUP_TAS2781_I2C),
3babae91
SD
11325 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
11326 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
dca5f4df
HZ
11327 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11328 SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
99af5b11
DC
11329 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
11330 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
11331 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
11332 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
1e9c708d
BX
11333 SND_PCI_QUIRK(0x17aa, 0x38b8, "Yoga S780-14.5 proX AMD YC Dual", ALC287_FIXUP_TAS2781_I2C),
11334 SND_PCI_QUIRK(0x17aa, 0x38b9, "Yoga S780-14.5 proX AMD LX Dual", ALC287_FIXUP_TAS2781_I2C),
3babae91
SD
11335 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
11336 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
11337 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
11338 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
11339 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
4ecb16d9
SB
11340 SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
11341 SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
3babae91
SD
11342 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
11343 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
9b714a59 11344 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
1e9c708d
BX
11345 SND_PCI_QUIRK(0x17aa, 0x38d3, "Yoga S990-16 Pro IMH YC Dual", ALC287_FIXUP_TAS2781_I2C),
11346 SND_PCI_QUIRK(0x17aa, 0x38d4, "Yoga S990-16 Pro IMH VECO Dual", ALC287_FIXUP_TAS2781_I2C),
11347 SND_PCI_QUIRK(0x17aa, 0x38d5, "Yoga S990-16 Pro IMH YC Quad", ALC287_FIXUP_TAS2781_I2C),
11348 SND_PCI_QUIRK(0x17aa, 0x38d6, "Yoga S990-16 Pro IMH VECO Quad", ALC287_FIXUP_TAS2781_I2C),
9b714a59 11349 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
1e9c708d
BX
11350 SND_PCI_QUIRK(0x17aa, 0x38df, "Yoga Y990 Intel YC Dual", ALC287_FIXUP_TAS2781_I2C),
11351 SND_PCI_QUIRK(0x17aa, 0x38e0, "Yoga Y990 Intel VECO Dual", ALC287_FIXUP_TAS2781_I2C),
11352 SND_PCI_QUIRK(0x17aa, 0x38f8, "Yoga Book 9i", ALC287_FIXUP_TAS2781_I2C),
49f5ee95 11353 SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
34c8e74c
YG
11354 SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
11355 SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
1e9c708d 11356 SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
56f27013 11357 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8d705030 11358 SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
ef27e89e 11359 SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
1e9c708d
BX
11360 SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
11361 SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
fedb2245 11362 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 11363 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 11364 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 11365 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 11366 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 11367 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 11368 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 11369 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 11370 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 11371 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 11372 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 11373 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 11374 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 11375 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 11376 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
11377 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11378 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11379 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
264fb034 11380 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
cd5302c0 11381 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
11382 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
11383 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 11384 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
52aad393 11385 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
1aec3ed2 11386 SND_PCI_QUIRK(0x1849, 0x0269, "Positivo Master C6400", ALC269VB_FIXUP_ASUS_ZENBOOK),
174a7fb3 11387 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
79e28f2a 11388 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
1e5dc398
HW
11389 SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
11390 SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
7e4d4b32
JG
11391 SND_PCI_QUIRK(0x1854, 0x0488, "LG gram 16 (16Z90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
11392 SND_PCI_QUIRK(0x1854, 0x048a, "LG gram 17 (17ZD90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
0fbf21c3 11393 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
cbcdf8c4 11394 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
dee47695 11395 SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC),
f1ec5be1
HC
11396 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
11397 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
11398 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 11399 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
11400 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
11401 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
86a43386 11402 SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
88d18b88 11403 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
619764cc 11404 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8b3b2392
WS
11405 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
11406 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
11407 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
11408 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
11409 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
11410 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
11411 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
11412 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
daf6c468 11413 SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
e49370d7 11414 SND_PCI_QUIRK(0x1d05, 0x1409, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
7ee5faad 11415 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
fc19d559 11416 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 11417 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 11418 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9b043a8f 11419 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 11420 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
de5afadd 11421 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
76b0a22d 11422 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6db03b19 11423 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
ef5fbdf7 11424 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
7c9caa29 11425 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
33bdee12 11426 SND_PCI_QUIRK(0x2782, 0x1407, "Positivo P15X", ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC),
5ebe792a 11427 SND_PCI_QUIRK(0x2782, 0x1701, "Infinix Y4 Max", ALC269VC_FIXUP_INFINIX_Y4_MAX),
ca0f79f0 11428 SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
c7de2d9b 11429 SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
31917b7b 11430 SND_PCI_QUIRK(0x2782, 0x4900, "MEDION E15443", ALC233_FIXUP_MEDION_MTL_SPK),
d1ee66c5 11431 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 11432 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 11433 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
ccbd88be 11434 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
309d7363 11435 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
33038efb 11436 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
eb91c456 11437 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
7b509910 11438 SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
a4297b5d 11439
a7f3eedc 11440#if 0
a4297b5d
TI
11441 /* Below is a quirk table taken from the old code.
11442 * Basically the device should work as is without the fixup table.
11443 * If BIOS doesn't give a proper info, enable the corresponding
11444 * fixup entry.
7d7eb9ea 11445 */
a4297b5d
TI
11446 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
11447 ALC269_FIXUP_AMIC),
11448 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
11449 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
11450 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
11451 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
11452 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
11453 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
11454 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
11455 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
11456 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
11457 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
11458 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
11459 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
11460 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
11461 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
11462 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
11463 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
11464 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
11465 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
11466 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
11467 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
11468 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
11469 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
11470 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
11471 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
11472 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
11473 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
11474 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
11475 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
11476 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
11477 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
11478 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
11479 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
11480 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
11481 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
11482 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
11483 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
11484 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
11485 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
11486 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
11487#endif
11488 {}
11489};
11490
5b1913a7 11491static const struct hda_quirk alc269_fixup_vendor_tbl[] = {
214eef76
DH
11492 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
11493 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
11494 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
d466887a 11495 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo XPAD", ALC269_FIXUP_LENOVO_XPAD_ACPI),
0fbf21c3 11496 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
11497 {}
11498};
11499
1727a771 11500static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
11501 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
11502 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
11503 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
11504 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
11505 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 11506 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
11507 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
11508 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 11509 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 11510 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 11511 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 11512 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
11513 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11514 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
11515 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
11516 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
78e7be01 11517 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, .name = "dell-headset4-quiet"},
be8ef16a 11518 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 11519 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 11520 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 11521 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 11522 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 11523 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 11524 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 11525 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 11526 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
11527 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
11528 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
11529 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
11530 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
11531 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
11532 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
11533 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
11534 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
11535 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
11536 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
11537 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
11538 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
11539 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
11540 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
11541 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
11542 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
11543 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
11544 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
11545 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
11546 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
11547 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
11548 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
11549 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
11550 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
11551 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
11552 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
11553 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
11554 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
11555 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
11556 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
11557 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
11558 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
11559 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
d466887a 11560 {.id = ALC269_FIXUP_LENOVO_XPAD_ACPI, .name = "lenovo-xpad-led"},
a26d96c7
TI
11561 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
11562 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
11563 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
11564 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
11565 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
11566 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
11567 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 11568 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 11569 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 11570 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
11571 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
11572 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
11573 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
11574 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
11575 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
11576 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
11577 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
11578 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
11579 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
11580 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
11581 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
11582 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
11583 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
11584 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
11585 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
11586 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
11587 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 11588 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 11589 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 11590 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
11591 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
11592 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
11593 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
11594 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
11595 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
11596 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
11597 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
11598 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
11599 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
11600 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
11601 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
11602 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
11603 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
11604 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
11605 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
11606 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
11607 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
11608 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
11609 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
0df2b9ed 11610 {.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"},
e2a829b3 11611 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 11612 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 11613 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
a2d57ebe 11614 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
7e4d4b32
JG
11615 {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, .name = "alc298-samsung-amp-v2-2-amps"},
11616 {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, .name = "alc298-samsung-amp-v2-4-amps"},
ef248d9b 11617 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
fc19d559 11618 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 11619 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 11620 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 11621 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 11622 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 11623 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
be0c40da 11624 {.id = ALC285_FIXUP_HP_SPECTRE_X360_DF1, .name = "alc285-hp-spectre-x360-df1"},
c0621669 11625 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
9ebaef05 11626 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
3790a3d6 11627 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
29c8f40b 11628 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 11629 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
aa723946 11630 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
ef27e89e 11631 {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
50db91fc 11632 {.id = ALC2XX_FIXUP_HEADSET_MIC, .name = "alc2xx-fixup-headset-mic"},
1d045db9 11633 {}
6dda9f4a 11634};
cfc5a845 11635#define ALC225_STANDARD_PINS \
cfc5a845 11636 {0x21, 0x04211020}
6dda9f4a 11637
e8191a8e
HW
11638#define ALC256_STANDARD_PINS \
11639 {0x12, 0x90a60140}, \
11640 {0x14, 0x90170110}, \
e8191a8e
HW
11641 {0x21, 0x02211020}
11642
fea185e2 11643#define ALC282_STANDARD_PINS \
11580297 11644 {0x14, 0x90170110}
e1e62b98 11645
fea185e2 11646#define ALC290_STANDARD_PINS \
11580297 11647 {0x12, 0x99a30130}
fea185e2
DH
11648
11649#define ALC292_STANDARD_PINS \
11650 {0x14, 0x90170110}, \
11580297 11651 {0x15, 0x0221401f}
977e6276 11652
3f640970
HW
11653#define ALC295_STANDARD_PINS \
11654 {0x12, 0xb7a60130}, \
11655 {0x14, 0x90170110}, \
3f640970
HW
11656 {0x21, 0x04211020}
11657
703867e2
WS
11658#define ALC298_STANDARD_PINS \
11659 {0x12, 0x90a60130}, \
11660 {0x21, 0x03211020}
11661
e1918938 11662static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
11663 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
11664 {0x14, 0x01014020},
11665 {0x17, 0x90170110},
11666 {0x18, 0x02a11030},
11667 {0x19, 0x0181303F},
11668 {0x21, 0x0221102f}),
5824ce8d
CC
11669 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
11670 {0x12, 0x90a601c0},
11671 {0x14, 0x90171120},
11672 {0x21, 0x02211030}),
615966ad
CC
11673 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11674 {0x14, 0x90170110},
11675 {0x1b, 0x90a70130},
11676 {0x21, 0x03211020}),
11677 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
11678 {0x1a, 0x90a70130},
11679 {0x1b, 0x90170110},
11680 {0x21, 0x03211020}),
2ae95577 11681 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 11682 ALC225_STANDARD_PINS,
8a132099 11683 {0x12, 0xb7a60130},
cfc5a845 11684 {0x14, 0x901701a0}),
2ae95577 11685 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 11686 ALC225_STANDARD_PINS,
8a132099 11687 {0x12, 0xb7a60130},
cfc5a845 11688 {0x14, 0x901701b0}),
8a132099
HW
11689 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11690 ALC225_STANDARD_PINS,
11691 {0x12, 0xb7a60150},
11692 {0x14, 0x901701a0}),
11693 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11694 ALC225_STANDARD_PINS,
11695 {0x12, 0xb7a60150},
11696 {0x14, 0x901701b0}),
11697 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
11698 ALC225_STANDARD_PINS,
11699 {0x12, 0xb7a60130},
11700 {0x1b, 0x90170110}),
0ce48e17
KHF
11701 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11702 {0x1b, 0x01111010},
11703 {0x1e, 0x01451130},
11704 {0x21, 0x02211020}),
986376b6
HW
11705 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
11706 {0x12, 0x90a60140},
11707 {0x14, 0x90170110},
11708 {0x19, 0x02a11030},
11709 {0x21, 0x02211020}),
e41fc8c5
HW
11710 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11711 {0x14, 0x90170110},
11712 {0x19, 0x02a11030},
11713 {0x1a, 0x02a11040},
11714 {0x1b, 0x01014020},
11715 {0x21, 0x0221101f}),
d06fb562
HW
11716 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11717 {0x14, 0x90170110},
11718 {0x19, 0x02a11030},
11719 {0x1a, 0x02a11040},
11720 {0x1b, 0x01011020},
11721 {0x21, 0x0221101f}),
c6b17f10
HW
11722 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
11723 {0x14, 0x90170110},
11724 {0x19, 0x02a11020},
11725 {0x1a, 0x02a11030},
11726 {0x21, 0x0221101f}),
92666d45
KY
11727 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
11728 {0x21, 0x02211010}),
9e885770
KY
11729 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11730 {0x14, 0x90170110},
11731 {0x19, 0x02a11020},
11732 {0x21, 0x02211030}),
c77900e6 11733 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 11734 {0x14, 0x90170110},
c77900e6 11735 {0x21, 0x02211020}),
86c72d1c
HW
11736 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11737 {0x14, 0x90170130},
11738 {0x21, 0x02211040}),
76c2132e
DH
11739 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11740 {0x12, 0x90a60140},
11741 {0x14, 0x90170110},
76c2132e
DH
11742 {0x21, 0x02211020}),
11743 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11744 {0x12, 0x90a60160},
11745 {0x14, 0x90170120},
76c2132e 11746 {0x21, 0x02211030}),
392c9da2
HW
11747 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11748 {0x14, 0x90170110},
11749 {0x1b, 0x02011020},
11750 {0x21, 0x0221101f}),
6aecd871
HW
11751 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11752 {0x14, 0x90170110},
11753 {0x1b, 0x01011020},
11754 {0x21, 0x0221101f}),
cba59972 11755 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 11756 {0x14, 0x90170130},
cba59972 11757 {0x1b, 0x01014020},
cba59972 11758 {0x21, 0x0221103f}),
6aecd871
HW
11759 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11760 {0x14, 0x90170130},
11761 {0x1b, 0x01011020},
11762 {0x21, 0x0221103f}),
59ec4b57
HW
11763 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11764 {0x14, 0x90170130},
11765 {0x1b, 0x02011020},
11766 {0x21, 0x0221103f}),
e9c28e16 11767 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 11768 {0x14, 0x90170150},
e9c28e16 11769 {0x1b, 0x02011020},
e9c28e16
WS
11770 {0x21, 0x0221105f}),
11771 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 11772 {0x14, 0x90170110},
e9c28e16 11773 {0x1b, 0x01014020},
e9c28e16 11774 {0x21, 0x0221101f}),
76c2132e
DH
11775 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11776 {0x12, 0x90a60160},
11777 {0x14, 0x90170120},
11778 {0x17, 0x90170140},
76c2132e
DH
11779 {0x21, 0x0321102f}),
11780 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11781 {0x12, 0x90a60160},
11782 {0x14, 0x90170130},
76c2132e
DH
11783 {0x21, 0x02211040}),
11784 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11785 {0x12, 0x90a60160},
11786 {0x14, 0x90170140},
76c2132e
DH
11787 {0x21, 0x02211050}),
11788 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11789 {0x12, 0x90a60170},
11790 {0x14, 0x90170120},
76c2132e
DH
11791 {0x21, 0x02211030}),
11792 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11793 {0x12, 0x90a60170},
11794 {0x14, 0x90170130},
76c2132e 11795 {0x21, 0x02211040}),
0a1f90a9
HW
11796 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11797 {0x12, 0x90a60170},
11798 {0x14, 0x90171130},
11799 {0x21, 0x02211040}),
70658b99 11800 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
11801 {0x12, 0x90a60170},
11802 {0x14, 0x90170140},
70658b99 11803 {0x21, 0x02211050}),
9b5a4e39 11804 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
11805 {0x12, 0x90a60180},
11806 {0x14, 0x90170130},
9b5a4e39 11807 {0x21, 0x02211040}),
f90d83b3
AK
11808 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11809 {0x12, 0x90a60180},
11810 {0x14, 0x90170120},
11811 {0x21, 0x02211030}),
989dbe4a
HW
11812 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11813 {0x1b, 0x01011020},
11814 {0x21, 0x02211010}),
c1732ede
CC
11815 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11816 {0x14, 0x90170110},
11817 {0x1b, 0x90a70130},
11818 {0x21, 0x04211020}),
11819 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
11820 {0x14, 0x90170110},
11821 {0x1b, 0x90a70130},
11822 {0x21, 0x03211020}),
a806ef1c
CC
11823 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11824 {0x12, 0x90a60130},
11825 {0x14, 0x90170110},
11826 {0x21, 0x03211020}),
6ac371aa
JHP
11827 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11828 {0x12, 0x90a60130},
11829 {0x14, 0x90170110},
11830 {0x21, 0x04211020}),
e1037354
JHP
11831 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
11832 {0x1a, 0x90a70130},
11833 {0x1b, 0x90170110},
11834 {0x21, 0x03211020}),
9e885770
KY
11835 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
11836 {0x14, 0x90170110},
11837 {0x19, 0x02a11020},
11838 {0x21, 0x0221101f}),
8a8de09c
KY
11839 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
11840 {0x17, 0x90170110},
11841 {0x19, 0x03a11030},
11842 {0x21, 0x03211020}),
cf51eb9d
DH
11843 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
11844 {0x12, 0x90a60130},
cf51eb9d
DH
11845 {0x14, 0x90170110},
11846 {0x15, 0x0421101f},
11580297 11847 {0x1a, 0x04a11020}),
0279661b
HW
11848 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
11849 {0x12, 0x90a60140},
0279661b
HW
11850 {0x14, 0x90170110},
11851 {0x15, 0x0421101f},
0279661b 11852 {0x18, 0x02811030},
0279661b 11853 {0x1a, 0x04a1103f},
11580297 11854 {0x1b, 0x02011020}),
42304474 11855 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11856 ALC282_STANDARD_PINS,
42304474 11857 {0x12, 0x99a30130},
42304474 11858 {0x19, 0x03a11020},
42304474 11859 {0x21, 0x0321101f}),
2c609999 11860 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11861 ALC282_STANDARD_PINS,
2c609999 11862 {0x12, 0x99a30130},
2c609999 11863 {0x19, 0x03a11020},
2c609999
HW
11864 {0x21, 0x03211040}),
11865 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11866 ALC282_STANDARD_PINS,
2c609999 11867 {0x12, 0x99a30130},
2c609999 11868 {0x19, 0x03a11030},
2c609999
HW
11869 {0x21, 0x03211020}),
11870 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11871 ALC282_STANDARD_PINS,
2c609999 11872 {0x12, 0x99a30130},
2c609999 11873 {0x19, 0x04a11020},
2c609999 11874 {0x21, 0x0421101f}),
200afc09 11875 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 11876 ALC282_STANDARD_PINS,
200afc09 11877 {0x12, 0x90a60140},
200afc09 11878 {0x19, 0x04a11030},
200afc09 11879 {0x21, 0x04211020}),
34cdf405
CC
11880 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11881 ALC282_STANDARD_PINS,
11882 {0x12, 0x90a609c0},
11883 {0x18, 0x03a11830},
11884 {0x19, 0x04a19831},
11885 {0x1a, 0x0481303f},
11886 {0x1b, 0x04211020},
11887 {0x21, 0x0321101f}),
11888 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11889 ALC282_STANDARD_PINS,
11890 {0x12, 0x90a60940},
11891 {0x18, 0x03a11830},
11892 {0x19, 0x04a19831},
11893 {0x1a, 0x0481303f},
11894 {0x1b, 0x04211020},
11895 {0x21, 0x0321101f}),
76c2132e 11896 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11897 ALC282_STANDARD_PINS,
76c2132e 11898 {0x12, 0x90a60130},
76c2132e
DH
11899 {0x21, 0x0321101f}),
11900 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11901 {0x12, 0x90a60160},
11902 {0x14, 0x90170120},
76c2132e 11903 {0x21, 0x02211030}),
bc262179 11904 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11905 ALC282_STANDARD_PINS,
bc262179 11906 {0x12, 0x90a60130},
bc262179 11907 {0x19, 0x03a11020},
bc262179 11908 {0x21, 0x0321101f}),
c8c6ee61 11909 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
11910 {0x12, 0x90a60130},
11911 {0x14, 0x90170110},
11912 {0x19, 0x04a11040},
11913 {0x21, 0x04211020}),
11914 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11915 {0x14, 0x90170110},
11916 {0x19, 0x04a11040},
11917 {0x1d, 0x40600001},
11918 {0x21, 0x04211020}),
11919 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
11920 {0x14, 0x90170110},
11921 {0x19, 0x04a11040},
11922 {0x21, 0x04211020}),
c72b9bfe
HW
11923 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11924 {0x14, 0x90170110},
11925 {0x17, 0x90170111},
11926 {0x19, 0x03a11030},
11927 {0x21, 0x03211020}),
e43252db
KY
11928 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11929 {0x17, 0x90170110},
11930 {0x19, 0x03a11030},
11931 {0x21, 0x03211020}),
41b07476
KY
11932 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11933 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11934 {0x19, 0x04a11040},
11935 {0x21, 0x04211020}),
33aaebd4
CC
11936 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11937 {0x12, 0x90a60130},
11938 {0x17, 0x90170110},
11939 {0x21, 0x02211020}),
d44a6864 11940 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 11941 {0x12, 0x90a60120},
e1e62b98 11942 {0x14, 0x90170110},
e1e62b98 11943 {0x21, 0x0321101f}),
e4442bcf 11944 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11945 ALC290_STANDARD_PINS,
e4442bcf 11946 {0x15, 0x04211040},
e4442bcf 11947 {0x18, 0x90170112},
11580297 11948 {0x1a, 0x04a11020}),
e4442bcf 11949 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11950 ALC290_STANDARD_PINS,
e4442bcf 11951 {0x15, 0x04211040},
e4442bcf 11952 {0x18, 0x90170110},
11580297 11953 {0x1a, 0x04a11020}),
e4442bcf 11954 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11955 ALC290_STANDARD_PINS,
e4442bcf 11956 {0x15, 0x0421101f},
11580297 11957 {0x1a, 0x04a11020}),
e4442bcf 11958 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11959 ALC290_STANDARD_PINS,
e4442bcf 11960 {0x15, 0x04211020},
11580297 11961 {0x1a, 0x04a11040}),
e4442bcf 11962 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11963 ALC290_STANDARD_PINS,
e4442bcf
HW
11964 {0x14, 0x90170110},
11965 {0x15, 0x04211020},
11580297 11966 {0x1a, 0x04a11040}),
e4442bcf 11967 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11968 ALC290_STANDARD_PINS,
e4442bcf
HW
11969 {0x14, 0x90170110},
11970 {0x15, 0x04211020},
11580297 11971 {0x1a, 0x04a11020}),
e4442bcf 11972 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11973 ALC290_STANDARD_PINS,
e4442bcf
HW
11974 {0x14, 0x90170110},
11975 {0x15, 0x0421101f},
11580297 11976 {0x1a, 0x04a11020}),
e8818fa8 11977 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 11978 ALC292_STANDARD_PINS,
e8818fa8 11979 {0x12, 0x90a60140},
e8818fa8 11980 {0x16, 0x01014020},
11580297 11981 {0x19, 0x01a19030}),
e8818fa8 11982 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 11983 ALC292_STANDARD_PINS,
e8818fa8 11984 {0x12, 0x90a60140},
e8818fa8
HW
11985 {0x16, 0x01014020},
11986 {0x18, 0x02a19031},
11580297 11987 {0x19, 0x01a1903e}),
76c2132e 11988 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 11989 ALC292_STANDARD_PINS,
11580297 11990 {0x12, 0x90a60140}),
76c2132e 11991 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11992 ALC292_STANDARD_PINS,
76c2132e 11993 {0x13, 0x90a60140},
76c2132e 11994 {0x16, 0x21014020},
11580297 11995 {0x19, 0x21a19030}),
e03fdbde 11996 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11997 ALC292_STANDARD_PINS,
11580297 11998 {0x13, 0x90a60140}),
eeacd80f
JHP
11999 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
12000 {0x17, 0x90170110},
12001 {0x21, 0x04211020}),
d8ae458e
CC
12002 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
12003 {0x14, 0x90170110},
12004 {0x1b, 0x90a70130},
12005 {0x21, 0x04211020}),
8bb37a2a
JHP
12006 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
12007 {0x12, 0x90a60130},
12008 {0x17, 0x90170110},
12009 {0x21, 0x03211020}),
0bea4cc8
JHP
12010 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
12011 {0x12, 0x90a60130},
12012 {0x17, 0x90170110},
12013 {0x21, 0x04211020}),
3887c26c
TI
12014 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
12015 {0x12, 0x90a60130},
12016 {0x17, 0x90170110},
12017 {0x21, 0x03211020}),
9e43342b 12018 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
12019 {0x12, 0x90a60120},
12020 {0x17, 0x90170110},
12021 {0x21, 0x04211030}),
12022 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
12023 {0x12, 0x90a60130},
12024 {0x17, 0x90170110},
12025 {0x21, 0x03211020}),
12026 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
12027 {0x12, 0x90a60130},
12028 {0x17, 0x90170110},
12029 {0x21, 0x03211020}),
9f502ff5
TI
12030 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
12031 ALC298_STANDARD_PINS,
12032 {0x17, 0x90170110}),
977e6276 12033 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
12034 ALC298_STANDARD_PINS,
12035 {0x17, 0x90170140}),
12036 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
12037 ALC298_STANDARD_PINS,
9f502ff5 12038 {0x17, 0x90170150}),
9f1bc2c4
KHF
12039 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
12040 {0x12, 0xb7a60140},
12041 {0x13, 0xb7a60150},
12042 {0x17, 0x90170110},
12043 {0x1a, 0x03011020},
12044 {0x21, 0x03211030}),
54324221
JM
12045 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
12046 {0x12, 0xb7a60140},
12047 {0x17, 0x90170110},
12048 {0x1a, 0x03a11030},
12049 {0x21, 0x03211020}),
fcc6c877
KY
12050 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
12051 ALC225_STANDARD_PINS,
12052 {0x12, 0xb7a60130},
fcc6c877 12053 {0x17, 0x90170110}),
573fcbfd
HW
12054 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
12055 {0x14, 0x01014010},
12056 {0x17, 0x90170120},
12057 {0x18, 0x02a11030},
12058 {0x19, 0x02a1103f},
12059 {0x21, 0x0221101f}),
e1918938
HW
12060 {}
12061};
6dda9f4a 12062
7c0a6939
HW
12063/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
12064 * more machines, don't need to match all valid pins, just need to match
12065 * all the pins defined in the tbl. Just because of this reason, it is possible
12066 * that a single machine matches multiple tbls, so there is one limitation:
12067 * at most one tbl is allowed to define for the same vendor and same codec
12068 */
12069static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
34ab5bbc
KY
12070 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
12071 {0x19, 0x40000000}),
7c0a6939
HW
12072 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
12073 {0x19, 0x40000000},
12074 {0x1b, 0x40000000}),
78e7be01 12075 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
4b21a669
KY
12076 {0x19, 0x40000000},
12077 {0x1b, 0x40000000}),
aed8c7f4
HW
12078 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
12079 {0x19, 0x40000000},
12080 {0x1a, 0x40000000}),
78e7be01 12081 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
d64ebdbf
HW
12082 {0x19, 0x40000000},
12083 {0x1a, 0x40000000}),
78e7be01 12084 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
5815bdfd
HW
12085 {0x19, 0x40000000},
12086 {0x1a, 0x40000000}),
c8c0a03e
KY
12087 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
12088 {0x19, 0x40000000}),
42ee87df
KY
12089 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1558, "Clevo", ALC2XX_FIXUP_HEADSET_MIC,
12090 {0x19, 0x40000000}),
7c0a6939
HW
12091 {}
12092};
12093
546bb678 12094static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 12095{
526af6eb 12096 struct alc_spec *spec = codec->spec;
1d045db9 12097 int val;
ebb83eeb 12098
526af6eb 12099 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 12100 return;
526af6eb 12101
1bb7e43e 12102 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
12103 alc_write_coef_idx(codec, 0xf, 0x960b);
12104 alc_write_coef_idx(codec, 0xe, 0x8817);
12105 }
ebb83eeb 12106
1bb7e43e 12107 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
12108 alc_write_coef_idx(codec, 0xf, 0x960b);
12109 alc_write_coef_idx(codec, 0xe, 0x8814);
12110 }
ebb83eeb 12111
1bb7e43e 12112 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 12113 /* Power up output pin */
98b24883 12114 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 12115 }
ebb83eeb 12116
1bb7e43e 12117 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 12118 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 12119 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
12120 /* Capless ramp up clock control */
12121 alc_write_coef_idx(codec, 0xd, val | (1<<10));
12122 }
12123 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 12124 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
12125 /* Class D power on reset */
12126 alc_write_coef_idx(codec, 0x17, val | (1<<7));
12127 }
12128 }
ebb83eeb 12129
98b24883
TI
12130 /* HP */
12131 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 12132}
a7f2371f 12133
1d045db9
TI
12134/*
12135 */
1d045db9
TI
12136static int patch_alc269(struct hda_codec *codec)
12137{
12138 struct alc_spec *spec;
3de95173 12139 int err;
f1d4e28b 12140
3de95173 12141 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 12142 if (err < 0)
3de95173
TI
12143 return err;
12144
12145 spec = codec->spec;
08c189f2 12146 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 12147 codec->power_save_node = 0;
46cdff23 12148 spec->en_3kpull_low = true;
e16fb6d1 12149
225068ab
TI
12150 codec->patch_ops.suspend = alc269_suspend;
12151 codec->patch_ops.resume = alc269_resume;
c2d6af53
KY
12152 spec->shutup = alc_default_shutup;
12153 spec->init_hook = alc_default_init;
225068ab 12154
7639a06c 12155 switch (codec->core.vendor_id) {
065380f0 12156 case 0x10ec0269:
1d045db9 12157 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
12158 switch (alc_get_coef0(codec) & 0x00f0) {
12159 case 0x0010:
5100cd07
TI
12160 if (codec->bus->pci &&
12161 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 12162 spec->cdefine.platform_type == 1)
20ca0c35 12163 err = alc_codec_rename(codec, "ALC271X");
1d045db9 12164 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
12165 break;
12166 case 0x0020:
5100cd07
TI
12167 if (codec->bus->pci &&
12168 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 12169 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 12170 err = alc_codec_rename(codec, "ALC3202");
1d045db9 12171 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 12172 break;
adcc70b2
KY
12173 case 0x0030:
12174 spec->codec_variant = ALC269_TYPE_ALC269VD;
12175 break;
1bb7e43e 12176 default:
1d045db9 12177 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 12178 }
e16fb6d1
TI
12179 if (err < 0)
12180 goto error;
c2d6af53 12181 spec->shutup = alc269_shutup;
546bb678 12182 spec->init_hook = alc269_fill_coef;
1d045db9 12183 alc269_fill_coef(codec);
065380f0
KY
12184 break;
12185
12186 case 0x10ec0280:
12187 case 0x10ec0290:
12188 spec->codec_variant = ALC269_TYPE_ALC280;
12189 break;
12190 case 0x10ec0282:
065380f0 12191 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
12192 spec->shutup = alc282_shutup;
12193 spec->init_hook = alc282_init;
065380f0 12194 break;
2af02be7
KY
12195 case 0x10ec0233:
12196 case 0x10ec0283:
12197 spec->codec_variant = ALC269_TYPE_ALC283;
12198 spec->shutup = alc283_shutup;
12199 spec->init_hook = alc283_init;
12200 break;
065380f0
KY
12201 case 0x10ec0284:
12202 case 0x10ec0292:
12203 spec->codec_variant = ALC269_TYPE_ALC284;
12204 break;
161ebf29 12205 case 0x10ec0293:
4731d5de 12206 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 12207 break;
7fc7d047 12208 case 0x10ec0286:
7c665932 12209 case 0x10ec0288:
7fc7d047
KY
12210 spec->codec_variant = ALC269_TYPE_ALC286;
12211 break;
506b62c3
KY
12212 case 0x10ec0298:
12213 spec->codec_variant = ALC269_TYPE_ALC298;
12214 break;
ea04a1db 12215 case 0x10ec0235:
1d04c9de
KY
12216 case 0x10ec0255:
12217 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
12218 spec->shutup = alc256_shutup;
12219 spec->init_hook = alc256_init;
1d04c9de 12220 break;
1948fc06 12221 case 0x10ec0230:
736f20a7 12222 case 0x10ec0236:
4344aec8 12223 case 0x10ec0256:
527f4643 12224 case 0x19e58326:
4344aec8 12225 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
12226 spec->shutup = alc256_shutup;
12227 spec->init_hook = alc256_init;
7d1b6e29 12228 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
46cdff23
KY
12229 if (codec->core.vendor_id == 0x10ec0236 &&
12230 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
12231 spec->en_3kpull_low = false;
4344aec8 12232 break;
f429e7e4
KY
12233 case 0x10ec0257:
12234 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
12235 spec->shutup = alc256_shutup;
12236 spec->init_hook = alc256_init;
f429e7e4 12237 spec->gen.mixer_nid = 0;
46cdff23 12238 spec->en_3kpull_low = false;
f429e7e4 12239 break;
0a6f0600 12240 case 0x10ec0215:
7fbdcd83 12241 case 0x10ec0245:
0a6f0600
KY
12242 case 0x10ec0285:
12243 case 0x10ec0289:
60571929
KY
12244 if (alc_get_coef0(codec) & 0x0010)
12245 spec->codec_variant = ALC269_TYPE_ALC245;
12246 else
12247 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
12248 spec->shutup = alc225_shutup;
12249 spec->init_hook = alc225_init;
0a6f0600
KY
12250 spec->gen.mixer_nid = 0;
12251 break;
4231430d 12252 case 0x10ec0225:
7d727869 12253 case 0x10ec0295:
28f1f9b2 12254 case 0x10ec0299:
4231430d 12255 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
12256 spec->shutup = alc225_shutup;
12257 spec->init_hook = alc225_init;
c1350bff 12258 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 12259 break;
99cee034
KY
12260 case 0x10ec0287:
12261 spec->codec_variant = ALC269_TYPE_ALC287;
12262 spec->shutup = alc225_shutup;
12263 spec->init_hook = alc225_init;
12264 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
12265 break;
dcd4f0db
KY
12266 case 0x10ec0234:
12267 case 0x10ec0274:
12268 case 0x10ec0294:
12269 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 12270 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 12271 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 12272 spec->init_hook = alc294_init;
dcd4f0db 12273 break;
1078bef0
KY
12274 case 0x10ec0300:
12275 spec->codec_variant = ALC269_TYPE_ALC300;
12276 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 12277 break;
ca0dedaf 12278 case 0x10ec0222:
f0778871
KY
12279 case 0x10ec0623:
12280 spec->codec_variant = ALC269_TYPE_ALC623;
ca0dedaf
KY
12281 spec->shutup = alc222_shutup;
12282 spec->init_hook = alc222_init;
f0778871 12283 break;
6fbae35a
KY
12284 case 0x10ec0700:
12285 case 0x10ec0701:
12286 case 0x10ec0703:
83629532 12287 case 0x10ec0711:
6fbae35a
KY
12288 spec->codec_variant = ALC269_TYPE_ALC700;
12289 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 12290 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 12291 spec->init_hook = alc294_init;
6fbae35a
KY
12292 break;
12293
1d045db9 12294 }
6dda9f4a 12295
ad60d502 12296 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 12297 spec->has_alc5505_dsp = 1;
ad60d502
KY
12298 spec->init_hook = alc5505_dsp_init;
12299 }
12300
c9af753f
TI
12301 alc_pre_init(codec);
12302
efe55732
TI
12303 snd_hda_pick_fixup(codec, alc269_fixup_models,
12304 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
12305 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
12306 * the quirk breaks the latter (bko#214101).
12307 * Clear the wrong entry.
12308 */
12309 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
12310 codec->core.vendor_id == 0x10ec0294) {
12311 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
12312 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
12313 }
12314
0fc1e447 12315 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 12316 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
12317 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
12318 alc269_fixups);
2186fe21
ST
12319
12320 /*
12321 * Check whether ACPI describes companion amplifiers that require
12322 * component binding
12323 */
12324 find_cirrus_companion_amps(codec);
12325
efe55732
TI
12326 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
12327
12328 alc_auto_parse_customize_define(codec);
12329
12330 if (has_cdefine_beep(codec))
12331 spec->gen.beep_nid = 0x01;
12332
a4297b5d
TI
12333 /* automatic parse from the BIOS config */
12334 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
12335 if (err < 0)
12336 goto error;
6dda9f4a 12337
fea80fae
TI
12338 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
12339 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
12340 if (err < 0)
12341 goto error;
12342 }
f1d4e28b 12343
1727a771 12344 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 12345
1d045db9 12346 return 0;
e16fb6d1
TI
12347
12348 error:
12349 alc_free(codec);
12350 return err;
1d045db9 12351}
f1d4e28b 12352
1d045db9
TI
12353/*
12354 * ALC861
12355 */
622e84cd 12356
1d045db9 12357static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 12358{
1d045db9 12359 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
12360 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
12361 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
12362}
12363
1d045db9
TI
12364/* Pin config fixes */
12365enum {
e652f4c8
TI
12366 ALC861_FIXUP_FSC_AMILO_PI1505,
12367 ALC861_FIXUP_AMP_VREF_0F,
12368 ALC861_FIXUP_NO_JACK_DETECT,
12369 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 12370 ALC660_FIXUP_ASUS_W7J,
1d045db9 12371};
7085ec12 12372
31150f23
TI
12373/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
12374static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 12375 const struct hda_fixup *fix, int action)
31150f23
TI
12376{
12377 struct alc_spec *spec = codec->spec;
12378 unsigned int val;
12379
1727a771 12380 if (action != HDA_FIXUP_ACT_INIT)
31150f23 12381 return;
d3f02d60 12382 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
12383 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
12384 val |= AC_PINCTL_IN_EN;
12385 val |= AC_PINCTL_VREF_50;
cdd03ced 12386 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 12387 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
12388}
12389
e652f4c8
TI
12390/* suppress the jack-detection */
12391static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 12392 const struct hda_fixup *fix, int action)
e652f4c8 12393{
1727a771 12394 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 12395 codec->no_jack_detect = 1;
7d7eb9ea 12396}
e652f4c8 12397
1727a771 12398static const struct hda_fixup alc861_fixups[] = {
e652f4c8 12399 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
12400 .type = HDA_FIXUP_PINS,
12401 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
12402 { 0x0b, 0x0221101f }, /* HP */
12403 { 0x0f, 0x90170310 }, /* speaker */
12404 { }
12405 }
12406 },
e652f4c8 12407 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 12408 .type = HDA_FIXUP_FUNC,
31150f23 12409 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 12410 },
e652f4c8 12411 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 12412 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
12413 .v.func = alc_fixup_no_jack_detect,
12414 },
12415 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 12416 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
12417 .v.func = alc861_fixup_asus_amp_vref_0f,
12418 .chained = true,
12419 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
12420 },
12421 [ALC660_FIXUP_ASUS_W7J] = {
12422 .type = HDA_FIXUP_VERBS,
12423 .v.verbs = (const struct hda_verb[]) {
12424 /* ASUS W7J needs a magic pin setup on unused NID 0x10
12425 * for enabling outputs
12426 */
12427 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
12428 { }
12429 },
e652f4c8 12430 }
1d045db9 12431};
7085ec12 12432
5b1913a7 12433static const struct hda_quirk alc861_fixup_tbl[] = {
6ddf0fd1 12434 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 12435 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
12436 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
12437 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
12438 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 12439 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 12440 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
12441 {}
12442};
3af9ee6b 12443
1d045db9
TI
12444/*
12445 */
1d045db9 12446static int patch_alc861(struct hda_codec *codec)
7085ec12 12447{
1d045db9 12448 struct alc_spec *spec;
1d045db9 12449 int err;
7085ec12 12450
3de95173
TI
12451 err = alc_alloc_spec(codec, 0x15);
12452 if (err < 0)
12453 return err;
1d045db9 12454
3de95173 12455 spec = codec->spec;
2722b535
TI
12456 if (has_cdefine_beep(codec))
12457 spec->gen.beep_nid = 0x23;
1d045db9 12458
225068ab 12459 spec->power_hook = alc_power_eapd;
225068ab 12460
c9af753f
TI
12461 alc_pre_init(codec);
12462
1727a771
TI
12463 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
12464 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 12465
cb4e4824
TI
12466 /* automatic parse from the BIOS config */
12467 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
12468 if (err < 0)
12469 goto error;
3af9ee6b 12470
fea80fae
TI
12471 if (!spec->gen.no_analog) {
12472 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
12473 if (err < 0)
12474 goto error;
12475 }
7085ec12 12476
1727a771 12477 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 12478
1d045db9 12479 return 0;
e16fb6d1
TI
12480
12481 error:
12482 alc_free(codec);
12483 return err;
7085ec12
TI
12484}
12485
1d045db9
TI
12486/*
12487 * ALC861-VD support
12488 *
12489 * Based on ALC882
12490 *
12491 * In addition, an independent DAC
12492 */
1d045db9 12493static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 12494{
1d045db9 12495 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
12496 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
12497 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
12498}
12499
1d045db9 12500enum {
8fdcb6fe
TI
12501 ALC660VD_FIX_ASUS_GPIO1,
12502 ALC861VD_FIX_DALLAS,
1d045db9 12503};
ce764ab2 12504
8fdcb6fe
TI
12505/* exclude VREF80 */
12506static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 12507 const struct hda_fixup *fix, int action)
8fdcb6fe 12508{
1727a771 12509 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
12510 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
12511 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
12512 }
12513}
12514
df73d83f
TI
12515/* reset GPIO1 */
12516static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
12517 const struct hda_fixup *fix, int action)
12518{
12519 struct alc_spec *spec = codec->spec;
12520
12521 if (action == HDA_FIXUP_ACT_PRE_PROBE)
12522 spec->gpio_mask |= 0x02;
12523 alc_fixup_gpio(codec, action, 0x01);
12524}
12525
1727a771 12526static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 12527 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
12528 .type = HDA_FIXUP_FUNC,
12529 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 12530 },
8fdcb6fe 12531 [ALC861VD_FIX_DALLAS] = {
1727a771 12532 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
12533 .v.func = alc861vd_fixup_dallas,
12534 },
1d045db9 12535};
ce764ab2 12536
5b1913a7 12537static const struct hda_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 12538 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 12539 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 12540 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
12541 {}
12542};
ce764ab2 12543
1d045db9
TI
12544/*
12545 */
1d045db9 12546static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 12547{
1d045db9 12548 struct alc_spec *spec;
cb4e4824 12549 int err;
ce764ab2 12550
3de95173
TI
12551 err = alc_alloc_spec(codec, 0x0b);
12552 if (err < 0)
12553 return err;
1d045db9 12554
3de95173 12555 spec = codec->spec;
2722b535
TI
12556 if (has_cdefine_beep(codec))
12557 spec->gen.beep_nid = 0x23;
1d045db9 12558
225068ab
TI
12559 spec->shutup = alc_eapd_shutup;
12560
c9af753f
TI
12561 alc_pre_init(codec);
12562
1727a771
TI
12563 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
12564 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 12565
cb4e4824
TI
12566 /* automatic parse from the BIOS config */
12567 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
12568 if (err < 0)
12569 goto error;
ce764ab2 12570
fea80fae
TI
12571 if (!spec->gen.no_analog) {
12572 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12573 if (err < 0)
12574 goto error;
12575 }
1d045db9 12576
1727a771 12577 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 12578
ce764ab2 12579 return 0;
e16fb6d1
TI
12580
12581 error:
12582 alc_free(codec);
12583 return err;
ce764ab2
TI
12584}
12585
1d045db9
TI
12586/*
12587 * ALC662 support
12588 *
12589 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
12590 * configuration. Each pin widget can choose any input DACs and a mixer.
12591 * Each ADC is connected from a mixer of all inputs. This makes possible
12592 * 6-channel independent captures.
12593 *
12594 * In addition, an independent DAC for the multi-playback (not used in this
12595 * driver yet).
12596 */
1d045db9
TI
12597
12598/*
12599 * BIOS auto configuration
12600 */
12601
bc9f98a9
KY
12602static int alc662_parse_auto_config(struct hda_codec *codec)
12603{
4c6d72d1 12604 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
12605 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
12606 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
12607 const hda_nid_t *ssids;
ee979a14 12608
7639a06c
TI
12609 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
12610 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
12611 codec->core.vendor_id == 0x10ec0671)
3e6179b8 12612 ssids = alc663_ssids;
6227cdce 12613 else
3e6179b8
TI
12614 ssids = alc662_ssids;
12615 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
12616}
12617
6be7948f 12618static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 12619 const struct hda_fixup *fix, int action)
6fc398cb 12620{
9bb1f06f 12621 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 12622 return;
6be7948f
TB
12623 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
12624 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
12625 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
12626 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
12627 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 12628 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
12629}
12630
8e383953
TI
12631static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
12632 { .channels = 2,
12633 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
12634 { .channels = 4,
12635 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
12636 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
12637 { }
12638};
12639
12640/* override the 2.1 chmap */
eb9ca3ab 12641static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
12642 const struct hda_fixup *fix, int action)
12643{
12644 if (action == HDA_FIXUP_ACT_BUILD) {
12645 struct alc_spec *spec = codec->spec;
bbbc7e85 12646 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
12647 }
12648}
12649
bf68665d
TI
12650/* avoid D3 for keeping GPIO up */
12651static unsigned int gpio_led_power_filter(struct hda_codec *codec,
12652 hda_nid_t nid,
12653 unsigned int power_state)
12654{
12655 struct alc_spec *spec = codec->spec;
d261eec8 12656 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
12657 return AC_PWRST_D0;
12658 return power_state;
12659}
12660
3e887f37
TI
12661static void alc662_fixup_led_gpio1(struct hda_codec *codec,
12662 const struct hda_fixup *fix, int action)
12663{
12664 struct alc_spec *spec = codec->spec;
3e887f37 12665
01e4a275 12666 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 12667 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 12668 spec->mute_led_polarity = 1;
bf68665d 12669 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
12670 }
12671}
12672
c6790c8e
KY
12673static void alc662_usi_automute_hook(struct hda_codec *codec,
12674 struct hda_jack_callback *jack)
12675{
12676 struct alc_spec *spec = codec->spec;
12677 int vref;
12678 msleep(200);
12679 snd_hda_gen_hp_automute(codec, jack);
12680
12681 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
12682 msleep(100);
12683 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
12684 vref);
12685}
12686
12687static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
12688 const struct hda_fixup *fix, int action)
12689{
12690 struct alc_spec *spec = codec->spec;
12691 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12692 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12693 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
12694 }
12695}
12696
00066e97
SB
12697static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
12698 struct hda_jack_callback *cb)
12699{
12700 /* surround speakers at 0x1b already get muted automatically when
12701 * headphones are plugged in, but we have to mute/unmute the remaining
12702 * channels manually:
12703 * 0x15 - front left/front right
12704 * 0x18 - front center/ LFE
12705 */
12706 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
12707 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
12708 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
12709 } else {
12710 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
12711 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
12712 }
12713}
12714
12715static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
12716 const struct hda_fixup *fix, int action)
12717{
12718 /* Pin 0x1b: shared headphones jack and surround speakers */
12719 if (!is_jack_detectable(codec, 0x1b))
12720 return;
12721
12722 switch (action) {
12723 case HDA_FIXUP_ACT_PRE_PROBE:
12724 snd_hda_jack_detect_enable_callback(codec, 0x1b,
12725 alc662_aspire_ethos_mute_speakers);
336820c4
TI
12726 /* subwoofer needs an extra GPIO setting to become audible */
12727 alc_setup_gpio(codec, 0x02);
00066e97
SB
12728 break;
12729 case HDA_FIXUP_ACT_INIT:
12730 /* Make sure to start in a correct state, i.e. if
12731 * headphones have been plugged in before powering up the system
12732 */
12733 alc662_aspire_ethos_mute_speakers(codec, NULL);
12734 break;
12735 }
12736}
12737
5af29028
KY
12738static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
12739 const struct hda_fixup *fix, int action)
12740{
12741 struct alc_spec *spec = codec->spec;
12742
12743 static const struct hda_pintbl pincfgs[] = {
12744 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
12745 { 0x1b, 0x0181304f },
12746 { }
12747 };
12748
12749 switch (action) {
12750 case HDA_FIXUP_ACT_PRE_PROBE:
12751 spec->gen.mixer_nid = 0;
12752 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12753 snd_hda_apply_pincfgs(codec, pincfgs);
12754 break;
12755 case HDA_FIXUP_ACT_INIT:
12756 alc_write_coef_idx(codec, 0x19, 0xa054);
12757 break;
12758 }
12759}
12760
d7f32791
KY
12761static void alc897_hp_automute_hook(struct hda_codec *codec,
12762 struct hda_jack_callback *jack)
12763{
12764 struct alc_spec *spec = codec->spec;
12765 int vref;
12766
12767 snd_hda_gen_hp_automute(codec, jack);
12768 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
d397b6e5 12769 snd_hda_set_pin_ctl(codec, 0x1b, vref);
d7f32791
KY
12770}
12771
12772static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
12773 const struct hda_fixup *fix, int action)
12774{
12775 struct alc_spec *spec = codec->spec;
12776 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12777 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
d397b6e5
KY
12778 spec->no_shutup_pins = 1;
12779 }
12780 if (action == HDA_FIXUP_ACT_PROBE) {
12781 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
d7f32791
KY
12782 }
12783}
12784
4bf5bf54
EP
12785static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
12786 const struct hda_fixup *fix, int action)
12787{
12788 struct alc_spec *spec = codec->spec;
12789
12790 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
12791 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
12792 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
12793 }
12794}
12795
6b0f95c4 12796static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
12797 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
12798 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
12799 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
12800 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
12801 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
12802 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
12803 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
12804 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
12805 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
12806 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
12807 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
12808 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
12809 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
12810 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
12811 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
12812 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
12813 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
12814 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
12815 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
12816 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
12817 {}
12818};
12819
12820static void alc668_restore_default_value(struct hda_codec *codec)
12821{
12822 alc_process_coef_fw(codec, alc668_coefs);
12823}
12824
6cb3b707 12825enum {
2df03514 12826 ALC662_FIXUP_ASPIRE,
3e887f37 12827 ALC662_FIXUP_LED_GPIO1,
6cb3b707 12828 ALC662_FIXUP_IDEAPAD,
6be7948f 12829 ALC272_FIXUP_MARIO,
f1ec5be1 12830 ALC662_FIXUP_CZC_ET26,
d2ebd479 12831 ALC662_FIXUP_CZC_P10T,
94024cd1 12832 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 12833 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
12834 ALC662_FIXUP_ASUS_MODE1,
12835 ALC662_FIXUP_ASUS_MODE2,
12836 ALC662_FIXUP_ASUS_MODE3,
12837 ALC662_FIXUP_ASUS_MODE4,
12838 ALC662_FIXUP_ASUS_MODE5,
12839 ALC662_FIXUP_ASUS_MODE6,
12840 ALC662_FIXUP_ASUS_MODE7,
12841 ALC662_FIXUP_ASUS_MODE8,
1565cc35 12842 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 12843 ALC662_FIXUP_ZOTAC_Z68,
125821ae 12844 ALC662_FIXUP_INV_DMIC,
1f8b46cd 12845 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 12846 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 12847 ALC662_FIXUP_HEADSET_MODE,
73bdd597 12848 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 12849 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 12850 ALC662_FIXUP_BASS_16,
a30c9aaa 12851 ALC662_FIXUP_BASS_1A,
8e54b4ac 12852 ALC662_FIXUP_BASS_CHMAP,
493a52a9 12853 ALC668_FIXUP_AUTO_MUTE,
5e6db669 12854 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 12855 ALC668_FIXUP_DELL_XPS13,
9d4dc584 12856 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 12857 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 12858 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 12859 ALC668_FIXUP_MIC_COEF,
11ba6111 12860 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
12861 ALC891_FIXUP_HEADSET_MODE,
12862 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 12863 ALC662_FIXUP_ACER_VERITON,
1a3f0991 12864 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
12865 ALC662_FIXUP_USI_FUNC,
12866 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 12867 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 12868 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 12869 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 12870 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 12871 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 12872 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
12873 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12874 ALC668_FIXUP_HEADSET_MIC,
12875 ALC668_FIXUP_MIC_DET_COEF,
d7f32791
KY
12876 ALC897_FIXUP_LENOVO_HEADSET_MIC,
12877 ALC897_FIXUP_HEADSET_MIC_PIN,
fe6900bd 12878 ALC897_FIXUP_HP_HSMIC_VERB,
4bf5bf54
EP
12879 ALC897_FIXUP_LENOVO_HEADSET_MODE,
12880 ALC897_FIXUP_HEADSET_MIC_PIN2,
73f1c75d 12881 ALC897_FIXUP_UNIS_H3C_X500S,
45e37f9c 12882 ALC897_FIXUP_HEADSET_MIC_PIN3,
6cb3b707
DH
12883};
12884
1727a771 12885static const struct hda_fixup alc662_fixups[] = {
2df03514 12886 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
12887 .type = HDA_FIXUP_PINS,
12888 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
12889 { 0x15, 0x99130112 }, /* subwoofer */
12890 { }
12891 }
12892 },
3e887f37
TI
12893 [ALC662_FIXUP_LED_GPIO1] = {
12894 .type = HDA_FIXUP_FUNC,
12895 .v.func = alc662_fixup_led_gpio1,
12896 },
6cb3b707 12897 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
12898 .type = HDA_FIXUP_PINS,
12899 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
12900 { 0x17, 0x99130112 }, /* subwoofer */
12901 { }
3e887f37
TI
12902 },
12903 .chained = true,
12904 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 12905 },
6be7948f 12906 [ALC272_FIXUP_MARIO] = {
1727a771 12907 .type = HDA_FIXUP_FUNC,
b5bfbc67 12908 .v.func = alc272_fixup_mario,
d2ebd479 12909 },
f1ec5be1
HC
12910 [ALC662_FIXUP_CZC_ET26] = {
12911 .type = HDA_FIXUP_PINS,
12912 .v.pins = (const struct hda_pintbl[]) {
12913 {0x12, 0x403cc000},
12914 {0x14, 0x90170110}, /* speaker */
12915 {0x15, 0x411111f0},
12916 {0x16, 0x411111f0},
12917 {0x18, 0x01a19030}, /* mic */
12918 {0x19, 0x90a7013f}, /* int-mic */
12919 {0x1a, 0x01014020},
12920 {0x1b, 0x0121401f},
12921 {0x1c, 0x411111f0},
12922 {0x1d, 0x411111f0},
12923 {0x1e, 0x40478e35},
12924 {}
12925 },
12926 .chained = true,
12927 .chain_id = ALC662_FIXUP_SKU_IGNORE
12928 },
d2ebd479 12929 [ALC662_FIXUP_CZC_P10T] = {
1727a771 12930 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
12931 .v.verbs = (const struct hda_verb[]) {
12932 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12933 {}
12934 }
12935 },
94024cd1 12936 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 12937 .type = HDA_FIXUP_FUNC,
23d30f28 12938 .v.func = alc_fixup_sku_ignore,
c6b35874 12939 },
e59ea3ed 12940 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
12941 .type = HDA_FIXUP_PINS,
12942 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
12943 { 0x14, 0x0221201f }, /* HP out */
12944 { }
12945 },
12946 .chained = true,
12947 .chain_id = ALC662_FIXUP_SKU_IGNORE
12948 },
53c334ad 12949 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
12950 .type = HDA_FIXUP_PINS,
12951 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12952 { 0x14, 0x99130110 }, /* speaker */
12953 { 0x18, 0x01a19c20 }, /* mic */
12954 { 0x19, 0x99a3092f }, /* int-mic */
12955 { 0x21, 0x0121401f }, /* HP out */
12956 { }
12957 },
12958 .chained = true,
12959 .chain_id = ALC662_FIXUP_SKU_IGNORE
12960 },
12961 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
12962 .type = HDA_FIXUP_PINS,
12963 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
12964 { 0x14, 0x99130110 }, /* speaker */
12965 { 0x18, 0x01a19820 }, /* mic */
12966 { 0x19, 0x99a3092f }, /* int-mic */
12967 { 0x1b, 0x0121401f }, /* HP out */
12968 { }
12969 },
53c334ad
TI
12970 .chained = true,
12971 .chain_id = ALC662_FIXUP_SKU_IGNORE
12972 },
12973 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
12974 .type = HDA_FIXUP_PINS,
12975 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12976 { 0x14, 0x99130110 }, /* speaker */
12977 { 0x15, 0x0121441f }, /* HP */
12978 { 0x18, 0x01a19840 }, /* mic */
12979 { 0x19, 0x99a3094f }, /* int-mic */
12980 { 0x21, 0x01211420 }, /* HP2 */
12981 { }
12982 },
12983 .chained = true,
12984 .chain_id = ALC662_FIXUP_SKU_IGNORE
12985 },
12986 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
12987 .type = HDA_FIXUP_PINS,
12988 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12989 { 0x14, 0x99130110 }, /* speaker */
12990 { 0x16, 0x99130111 }, /* speaker */
12991 { 0x18, 0x01a19840 }, /* mic */
12992 { 0x19, 0x99a3094f }, /* int-mic */
12993 { 0x21, 0x0121441f }, /* HP */
12994 { }
12995 },
12996 .chained = true,
12997 .chain_id = ALC662_FIXUP_SKU_IGNORE
12998 },
12999 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
13000 .type = HDA_FIXUP_PINS,
13001 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
13002 { 0x14, 0x99130110 }, /* speaker */
13003 { 0x15, 0x0121441f }, /* HP */
13004 { 0x16, 0x99130111 }, /* speaker */
13005 { 0x18, 0x01a19840 }, /* mic */
13006 { 0x19, 0x99a3094f }, /* int-mic */
13007 { }
13008 },
13009 .chained = true,
13010 .chain_id = ALC662_FIXUP_SKU_IGNORE
13011 },
13012 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
13013 .type = HDA_FIXUP_PINS,
13014 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
13015 { 0x14, 0x99130110 }, /* speaker */
13016 { 0x15, 0x01211420 }, /* HP2 */
13017 { 0x18, 0x01a19840 }, /* mic */
13018 { 0x19, 0x99a3094f }, /* int-mic */
13019 { 0x1b, 0x0121441f }, /* HP */
13020 { }
13021 },
13022 .chained = true,
13023 .chain_id = ALC662_FIXUP_SKU_IGNORE
13024 },
13025 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
13026 .type = HDA_FIXUP_PINS,
13027 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
13028 { 0x14, 0x99130110 }, /* speaker */
13029 { 0x17, 0x99130111 }, /* speaker */
13030 { 0x18, 0x01a19840 }, /* mic */
13031 { 0x19, 0x99a3094f }, /* int-mic */
13032 { 0x1b, 0x01214020 }, /* HP */
13033 { 0x21, 0x0121401f }, /* HP */
13034 { }
13035 },
13036 .chained = true,
13037 .chain_id = ALC662_FIXUP_SKU_IGNORE
13038 },
13039 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
13040 .type = HDA_FIXUP_PINS,
13041 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
13042 { 0x14, 0x99130110 }, /* speaker */
13043 { 0x12, 0x99a30970 }, /* int-mic */
13044 { 0x15, 0x01214020 }, /* HP */
13045 { 0x17, 0x99130111 }, /* speaker */
13046 { 0x18, 0x01a19840 }, /* mic */
13047 { 0x21, 0x0121401f }, /* HP */
13048 { }
13049 },
13050 .chained = true,
13051 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 13052 },
1565cc35 13053 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 13054 .type = HDA_FIXUP_FUNC,
1565cc35
TI
13055 .v.func = alc_fixup_no_jack_detect,
13056 },
edfe3bfc 13057 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
13058 .type = HDA_FIXUP_PINS,
13059 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
13060 { 0x1b, 0x02214020 }, /* Front HP */
13061 { }
13062 }
13063 },
125821ae 13064 [ALC662_FIXUP_INV_DMIC] = {
1727a771 13065 .type = HDA_FIXUP_FUNC,
9d36a7dc 13066 .v.func = alc_fixup_inv_dmic,
125821ae 13067 },
033b0a7c
GM
13068 [ALC668_FIXUP_DELL_XPS13] = {
13069 .type = HDA_FIXUP_FUNC,
13070 .v.func = alc_fixup_dell_xps13,
13071 .chained = true,
13072 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
13073 },
5e6db669
GM
13074 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
13075 .type = HDA_FIXUP_FUNC,
13076 .v.func = alc_fixup_disable_aamix,
13077 .chained = true,
13078 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
13079 },
493a52a9
HW
13080 [ALC668_FIXUP_AUTO_MUTE] = {
13081 .type = HDA_FIXUP_FUNC,
13082 .v.func = alc_fixup_auto_mute_via_amp,
13083 .chained = true,
13084 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
13085 },
1f8b46cd
DH
13086 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
13087 .type = HDA_FIXUP_PINS,
13088 .v.pins = (const struct hda_pintbl[]) {
13089 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
13090 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
13091 { }
13092 },
13093 .chained = true,
13094 .chain_id = ALC662_FIXUP_HEADSET_MODE
13095 },
13096 [ALC662_FIXUP_HEADSET_MODE] = {
13097 .type = HDA_FIXUP_FUNC,
13098 .v.func = alc_fixup_headset_mode_alc662,
13099 },
73bdd597
DH
13100 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
13101 .type = HDA_FIXUP_PINS,
13102 .v.pins = (const struct hda_pintbl[]) {
13103 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
13104 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
13105 { }
13106 },
13107 .chained = true,
13108 .chain_id = ALC668_FIXUP_HEADSET_MODE
13109 },
13110 [ALC668_FIXUP_HEADSET_MODE] = {
13111 .type = HDA_FIXUP_FUNC,
13112 .v.func = alc_fixup_headset_mode_alc668,
13113 },
8e54b4ac 13114 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 13115 .type = HDA_FIXUP_FUNC,
eb9ca3ab 13116 .v.func = alc_fixup_bass_chmap,
8e383953
TI
13117 .chained = true,
13118 .chain_id = ALC662_FIXUP_ASUS_MODE4
13119 },
61a75f13
DH
13120 [ALC662_FIXUP_BASS_16] = {
13121 .type = HDA_FIXUP_PINS,
13122 .v.pins = (const struct hda_pintbl[]) {
13123 {0x16, 0x80106111}, /* bass speaker */
13124 {}
13125 },
13126 .chained = true,
13127 .chain_id = ALC662_FIXUP_BASS_CHMAP,
13128 },
a30c9aaa
TI
13129 [ALC662_FIXUP_BASS_1A] = {
13130 .type = HDA_FIXUP_PINS,
13131 .v.pins = (const struct hda_pintbl[]) {
13132 {0x1a, 0x80106111}, /* bass speaker */
13133 {}
13134 },
8e54b4ac
DH
13135 .chained = true,
13136 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 13137 },
8e54b4ac 13138 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 13139 .type = HDA_FIXUP_FUNC,
eb9ca3ab 13140 .v.func = alc_fixup_bass_chmap,
a30c9aaa 13141 },
9d4dc584
BM
13142 [ALC662_FIXUP_ASUS_Nx50] = {
13143 .type = HDA_FIXUP_FUNC,
13144 .v.func = alc_fixup_auto_mute_via_amp,
13145 .chained = true,
13146 .chain_id = ALC662_FIXUP_BASS_1A
13147 },
fc7438b1
MP
13148 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
13149 .type = HDA_FIXUP_FUNC,
13150 .v.func = alc_fixup_headset_mode_alc668,
13151 .chain_id = ALC662_FIXUP_BASS_CHMAP
13152 },
3231e205
YP
13153 [ALC668_FIXUP_ASUS_Nx51] = {
13154 .type = HDA_FIXUP_PINS,
13155 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
13156 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
13157 { 0x1a, 0x90170151 }, /* bass speaker */
13158 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
13159 {}
13160 },
13161 .chained = true,
fc7438b1 13162 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 13163 },
5b7c5e1f 13164 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
13165 .type = HDA_FIXUP_VERBS,
13166 .v.verbs = (const struct hda_verb[]) {
13167 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
13168 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
13169 {}
13170 },
13171 },
5b7c5e1f
TI
13172 [ALC668_FIXUP_ASUS_G751] = {
13173 .type = HDA_FIXUP_PINS,
13174 .v.pins = (const struct hda_pintbl[]) {
13175 { 0x16, 0x0421101f }, /* HP */
13176 {}
13177 },
13178 .chained = true,
13179 .chain_id = ALC668_FIXUP_MIC_COEF
13180 },
78f4f7c2
KY
13181 [ALC891_FIXUP_HEADSET_MODE] = {
13182 .type = HDA_FIXUP_FUNC,
13183 .v.func = alc_fixup_headset_mode,
13184 },
13185 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
13186 .type = HDA_FIXUP_PINS,
13187 .v.pins = (const struct hda_pintbl[]) {
13188 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
13189 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
13190 { }
13191 },
13192 .chained = true,
13193 .chain_id = ALC891_FIXUP_HEADSET_MODE
13194 },
9b51fe3e
SB
13195 [ALC662_FIXUP_ACER_VERITON] = {
13196 .type = HDA_FIXUP_PINS,
13197 .v.pins = (const struct hda_pintbl[]) {
13198 { 0x15, 0x50170120 }, /* no internal speaker */
13199 { }
13200 }
13201 },
1a3f0991
TI
13202 [ALC892_FIXUP_ASROCK_MOBO] = {
13203 .type = HDA_FIXUP_PINS,
13204 .v.pins = (const struct hda_pintbl[]) {
13205 { 0x15, 0x40f000f0 }, /* disabled */
13206 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
13207 { }
13208 }
13209 },
c6790c8e
KY
13210 [ALC662_FIXUP_USI_FUNC] = {
13211 .type = HDA_FIXUP_FUNC,
13212 .v.func = alc662_fixup_usi_headset_mic,
13213 },
13214 [ALC662_FIXUP_USI_HEADSET_MODE] = {
13215 .type = HDA_FIXUP_PINS,
13216 .v.pins = (const struct hda_pintbl[]) {
13217 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
13218 { 0x18, 0x01a1903d },
13219 { }
13220 },
13221 .chained = true,
13222 .chain_id = ALC662_FIXUP_USI_FUNC
13223 },
ca169cc2
KY
13224 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
13225 .type = HDA_FIXUP_FUNC,
13226 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
13227 },
00066e97
SB
13228 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
13229 .type = HDA_FIXUP_FUNC,
13230 .v.func = alc662_fixup_aspire_ethos_hp,
13231 },
00066e97
SB
13232 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
13233 .type = HDA_FIXUP_PINS,
13234 .v.pins = (const struct hda_pintbl[]) {
13235 { 0x15, 0x92130110 }, /* front speakers */
13236 { 0x18, 0x99130111 }, /* center/subwoofer */
13237 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
13238 { }
13239 },
13240 .chained = true,
336820c4 13241 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 13242 },
5af29028
KY
13243 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
13244 .type = HDA_FIXUP_FUNC,
13245 .v.func = alc671_fixup_hp_headset_mic2,
13246 },
d858c706
JHP
13247 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
13248 .type = HDA_FIXUP_PINS,
13249 .v.pins = (const struct hda_pintbl[]) {
13250 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
13251 { }
13252 },
13253 .chained = true,
13254 .chain_id = ALC662_FIXUP_USI_FUNC
13255 },
a124458a
JHP
13256 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
13257 .type = HDA_FIXUP_PINS,
13258 .v.pins = (const struct hda_pintbl[]) {
13259 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
13260 { 0x1b, 0x0221144f },
13261 { }
13262 },
13263 .chained = true,
13264 .chain_id = ALC662_FIXUP_USI_FUNC
13265 },
a3fd1a98
HW
13266 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
13267 .type = HDA_FIXUP_PINS,
13268 .v.pins = (const struct hda_pintbl[]) {
13269 { 0x1b, 0x04a1112c },
13270 { }
13271 },
13272 .chained = true,
13273 .chain_id = ALC668_FIXUP_HEADSET_MIC
13274 },
13275 [ALC668_FIXUP_HEADSET_MIC] = {
13276 .type = HDA_FIXUP_FUNC,
13277 .v.func = alc269_fixup_headset_mic,
13278 .chained = true,
13279 .chain_id = ALC668_FIXUP_MIC_DET_COEF
13280 },
13281 [ALC668_FIXUP_MIC_DET_COEF] = {
13282 .type = HDA_FIXUP_VERBS,
13283 .v.verbs = (const struct hda_verb[]) {
13284 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
13285 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
13286 {}
13287 },
13288 },
d7f32791
KY
13289 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
13290 .type = HDA_FIXUP_FUNC,
13291 .v.func = alc897_fixup_lenovo_headset_mic,
13292 },
13293 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
13294 .type = HDA_FIXUP_PINS,
13295 .v.pins = (const struct hda_pintbl[]) {
13296 { 0x1a, 0x03a11050 },
13297 { }
13298 },
13299 .chained = true,
13300 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
13301 },
fe6900bd
KY
13302 [ALC897_FIXUP_HP_HSMIC_VERB] = {
13303 .type = HDA_FIXUP_PINS,
13304 .v.pins = (const struct hda_pintbl[]) {
13305 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
13306 { }
13307 },
13308 },
4bf5bf54
EP
13309 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
13310 .type = HDA_FIXUP_FUNC,
13311 .v.func = alc897_fixup_lenovo_headset_mode,
13312 },
13313 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
13314 .type = HDA_FIXUP_PINS,
13315 .v.pins = (const struct hda_pintbl[]) {
13316 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
13317 { }
13318 },
13319 .chained = true,
13320 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
13321 },
73f1c75d 13322 [ALC897_FIXUP_UNIS_H3C_X500S] = {
13323 .type = HDA_FIXUP_VERBS,
13324 .v.verbs = (const struct hda_verb[]) {
13325 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
13326 {}
13327 },
13328 },
45e37f9c
JHP
13329 [ALC897_FIXUP_HEADSET_MIC_PIN3] = {
13330 .type = HDA_FIXUP_PINS,
13331 .v.pins = (const struct hda_pintbl[]) {
13332 { 0x19, 0x03a11050 }, /* use as headset mic */
13333 { }
13334 },
13335 },
6cb3b707
DH
13336};
13337
5b1913a7 13338static const struct hda_quirk alc662_fixup_tbl[] = {
53c334ad 13339 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
45e37f9c 13340 SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
d3d3835c 13341 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 13342 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 13343 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 13344 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 13345 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 13346 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 13347 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 13348 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 13349 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 13350 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
13351 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
13352 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 13353 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 13354 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 13355 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 13356 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 13357 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
13358 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
13359 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 13360 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 13361 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
ea24b995 13362 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
fe6900bd 13363 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
90670ef7 13364 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
148ebf54 13365 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
527c356b 13366 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
dbe75d31 13367 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
882bd07f 13368 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 13369 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 13370 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 13371 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 13372 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 13373 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 13374 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 13375 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
13376 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
13377 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 13378 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 13379 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 13380 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 13381 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 13382 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 13383 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 13384 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 13385 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 13386 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
5a873857 13387 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
7ca4c8d4 13388 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
d7f32791
KY
13389 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
13390 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
13391 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
13392 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
4ca110ca
BL
13393 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
13394 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
6f7e4664 13395 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
4bf5bf54 13396 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
d4118588 13397 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 13398 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 13399 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 13400 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 13401 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 13402 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 13403 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
a2a87148 13404 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
53c334ad
TI
13405
13406#if 0
13407 /* Below is a quirk table taken from the old code.
13408 * Basically the device should work as is without the fixup table.
13409 * If BIOS doesn't give a proper info, enable the corresponding
13410 * fixup entry.
7d7eb9ea 13411 */
53c334ad
TI
13412 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
13413 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
13414 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
13415 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
13416 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
13417 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13418 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
13419 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
13420 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
13421 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13422 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
13423 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
13424 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
13425 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
13426 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
13427 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13428 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
13429 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
13430 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13431 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
13432 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
13433 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13434 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
13435 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
13436 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
13437 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13438 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
13439 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
13440 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13441 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
13442 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13443 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13444 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
13445 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
13446 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
13447 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
13448 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
13449 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
13450 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
13451 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
13452 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
13453 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
13454 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
13455 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
13456 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
13457 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
13458 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
13459 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
13460 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
13461 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
13462#endif
6cb3b707
DH
13463 {}
13464};
13465
1727a771 13466static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
13467 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
13468 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 13469 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 13470 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
13471 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
13472 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
13473 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
13474 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
13475 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
13476 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
13477 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
13478 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 13479 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 13480 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 13481 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 13482 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
13483 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
13484 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
13485 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
13486 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
13487 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
13488 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
13489 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
13490 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 13491 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
13492 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
13493 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
13494 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
13495 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
13496 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 13497 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 13498 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
73f1c75d 13499 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
6be7948f
TB
13500 {}
13501};
6cb3b707 13502
532895c5 13503static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
13504 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
13505 {0x17, 0x02211010},
13506 {0x18, 0x01a19030},
13507 {0x1a, 0x01813040},
13508 {0x21, 0x01014020}),
4b4e0e32
HW
13509 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
13510 {0x16, 0x01813030},
13511 {0x17, 0x02211010},
13512 {0x18, 0x01a19040},
13513 {0x21, 0x01014020}),
1f8b46cd 13514 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 13515 {0x14, 0x01014010},
1f8b46cd 13516 {0x18, 0x01a19020},
1f8b46cd 13517 {0x1a, 0x0181302f},
11580297 13518 {0x1b, 0x0221401f}),
76c2132e
DH
13519 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
13520 {0x12, 0x99a30130},
13521 {0x14, 0x90170110},
13522 {0x15, 0x0321101f},
11580297 13523 {0x16, 0x03011020}),
76c2132e
DH
13524 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
13525 {0x12, 0x99a30140},
13526 {0x14, 0x90170110},
13527 {0x15, 0x0321101f},
11580297 13528 {0x16, 0x03011020}),
76c2132e
DH
13529 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
13530 {0x12, 0x99a30150},
13531 {0x14, 0x90170110},
13532 {0x15, 0x0321101f},
11580297 13533 {0x16, 0x03011020}),
76c2132e 13534 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
13535 {0x14, 0x90170110},
13536 {0x15, 0x0321101f},
11580297 13537 {0x16, 0x03011020}),
76c2132e
DH
13538 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
13539 {0x12, 0x90a60130},
13540 {0x14, 0x90170110},
11580297 13541 {0x15, 0x0321101f}),
5af29028
KY
13542 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13543 {0x14, 0x01014010},
13544 {0x17, 0x90170150},
f2adbae0 13545 {0x19, 0x02a11060},
5af29028
KY
13546 {0x1b, 0x01813030},
13547 {0x21, 0x02211020}),
13548 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13549 {0x14, 0x01014010},
13550 {0x18, 0x01a19040},
13551 {0x1b, 0x01813030},
13552 {0x21, 0x02211020}),
13553 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
13554 {0x14, 0x01014020},
13555 {0x17, 0x90170110},
13556 {0x18, 0x01a19050},
13557 {0x1b, 0x01813040},
13558 {0x21, 0x02211030}),
532895c5
HW
13559 {}
13560};
13561
1d045db9
TI
13562/*
13563 */
bc9f98a9
KY
13564static int patch_alc662(struct hda_codec *codec)
13565{
13566 struct alc_spec *spec;
3de95173 13567 int err;
bc9f98a9 13568
3de95173
TI
13569 err = alc_alloc_spec(codec, 0x0b);
13570 if (err < 0)
13571 return err;
bc9f98a9 13572
3de95173 13573 spec = codec->spec;
1f0f4b80 13574
225068ab
TI
13575 spec->shutup = alc_eapd_shutup;
13576
53c334ad
TI
13577 /* handle multiple HPs as is */
13578 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
13579
2c3bf9ab
TI
13580 alc_fix_pll_init(codec, 0x20, 0x04, 15);
13581
7639a06c 13582 switch (codec->core.vendor_id) {
f3f9185f
KY
13583 case 0x10ec0668:
13584 spec->init_hook = alc668_restore_default_value;
13585 break;
f3f9185f 13586 }
8663ff75 13587
c9af753f
TI
13588 alc_pre_init(codec);
13589
1727a771 13590 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 13591 alc662_fixup_tbl, alc662_fixups);
0fc1e447 13592 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 13593 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
13594
13595 alc_auto_parse_customize_define(codec);
13596
7504b6cd
TI
13597 if (has_cdefine_beep(codec))
13598 spec->gen.beep_nid = 0x01;
13599
1bb7e43e 13600 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 13601 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 13602 spec->cdefine.platform_type == 1) {
6134b1a2
WY
13603 err = alc_codec_rename(codec, "ALC272X");
13604 if (err < 0)
e16fb6d1 13605 goto error;
20ca0c35 13606 }
274693f3 13607
b9c5106c
TI
13608 /* automatic parse from the BIOS config */
13609 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
13610 if (err < 0)
13611 goto error;
bc9f98a9 13612
7504b6cd 13613 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 13614 switch (codec->core.vendor_id) {
da00c244 13615 case 0x10ec0662:
fea80fae 13616 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
13617 break;
13618 case 0x10ec0272:
13619 case 0x10ec0663:
13620 case 0x10ec0665:
9ad54547 13621 case 0x10ec0668:
fea80fae 13622 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
13623 break;
13624 case 0x10ec0273:
fea80fae 13625 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
13626 break;
13627 }
fea80fae
TI
13628 if (err < 0)
13629 goto error;
cec27c89 13630 }
2134ea4f 13631
1727a771 13632 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 13633
bc9f98a9 13634 return 0;
801f49d3 13635
e16fb6d1
TI
13636 error:
13637 alc_free(codec);
13638 return err;
b478b998
KY
13639}
13640
d1eb57f4
KY
13641/*
13642 * ALC680 support
13643 */
d1eb57f4 13644
d1eb57f4
KY
13645static int alc680_parse_auto_config(struct hda_codec *codec)
13646{
3e6179b8 13647 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
13648}
13649
d1eb57f4 13650/*
d1eb57f4 13651 */
d1eb57f4
KY
13652static int patch_alc680(struct hda_codec *codec)
13653{
d1eb57f4
KY
13654 int err;
13655
1f0f4b80 13656 /* ALC680 has no aa-loopback mixer */
3de95173
TI
13657 err = alc_alloc_spec(codec, 0);
13658 if (err < 0)
13659 return err;
1f0f4b80 13660
1ebec5f2
TI
13661 /* automatic parse from the BIOS config */
13662 err = alc680_parse_auto_config(codec);
13663 if (err < 0) {
13664 alc_free(codec);
13665 return err;
d1eb57f4
KY
13666 }
13667
d1eb57f4
KY
13668 return 0;
13669}
13670
1da177e4
LT
13671/*
13672 * patch entries
13673 */
b9a94a9c 13674static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 13675 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 13676 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 13677 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 13678 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 13679 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
13680 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
13681 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 13682 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 13683 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 13684 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 13685 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
13686 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
13687 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 13688 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
13689 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
13690 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
13691 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
13692 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
13693 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
13694 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
13695 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 13696 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
13697 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
13698 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
13699 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
13700 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
13701 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
13702 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 13703 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 13704 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 13705 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 13706 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 13707 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
13708 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
13709 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
13710 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 13711 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 13712 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 13713 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 13714 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 13715 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 13716 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
13717 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
13718 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
13719 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
13720 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
13721 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
13722 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
13723 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
13724 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
13725 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
13726 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
13727 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
13728 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
13729 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
13730 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
13731 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
13732 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
13733 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 13734 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 13735 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
13736 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
13737 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
13738 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
13739 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
13740 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
13741 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
13742 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
13743 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
13744 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
13745 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
13746 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 13747 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
13748 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
13749 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 13750 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 13751 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 13752 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
527f4643 13753 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
1da177e4
LT
13754 {} /* terminator */
13755};
b9a94a9c 13756MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
13757
13758MODULE_LICENSE("GPL");
13759MODULE_DESCRIPTION("Realtek HD-audio codec");
cdd30ebb 13760MODULE_IMPORT_NS("SND_HDA_SCODEC_COMPONENT");
1289e9e8 13761
d8a766a1 13762static struct hda_codec_driver realtek_driver = {
b9a94a9c 13763 .id = snd_hda_id_realtek,
1289e9e8
TI
13764};
13765
d8a766a1 13766module_hda_codec_driver(realtek_driver);