]> git.ipfire.org Git - thirdparty/linux.git/blame - sound/pci/hda/patch_realtek.c
Merge tag 'edac_urgent_for_v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git...
[thirdparty/linux.git] / sound / pci / hda / patch_realtek.c
CommitLineData
d0fa1179 1// SPDX-License-Identifier: GPL-2.0-or-later
1da177e4
LT
2/*
3 * Universal Interface for Intel High Definition Audio Codec
4 *
1d045db9 5 * HD audio interface patch for Realtek ALC codecs
1da177e4 6 *
df694daa
KY
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
1da177e4 9 * Takashi Iwai <tiwai@suse.de>
409a3e98 10 * Jonathan Woithe <jwoithe@just42.net>
1da177e4
LT
11 */
12
7ce66933 13#include <linux/acpi.h>
1da177e4
LT
14#include <linux/init.h>
15#include <linux/delay.h>
16#include <linux/slab.h>
17#include <linux/pci.h>
08fb0d0e 18#include <linux/dmi.h>
da155d5b 19#include <linux/module.h>
33f4acd3 20#include <linux/input.h>
87dc3648 21#include <linux/leds.h>
35a17444 22#include <linux/ctype.h>
1da177e4 23#include <sound/core.h>
9ad0e496 24#include <sound/jack.h>
be57bfff 25#include <sound/hda_codec.h>
1da177e4 26#include "hda_local.h"
23d30f28 27#include "hda_auto_parser.h"
1835a0f9 28#include "hda_jack.h"
08c189f2 29#include "hda_generic.h"
d3dca026 30#include "hda_component.h"
1da177e4 31
cd63a5ff
TI
32/* keep halting ALC5505 DSP, for power saving */
33#define HALT_REALTEK_ALC5505
34
4a79ba34
TI
35/* extra amp-initialization sequence types */
36enum {
1c76aa5f 37 ALC_INIT_UNDEFINED,
4a79ba34
TI
38 ALC_INIT_NONE,
39 ALC_INIT_DEFAULT,
4a79ba34
TI
40};
41
73bdd597
DH
42enum {
43 ALC_HEADSET_MODE_UNKNOWN,
44 ALC_HEADSET_MODE_UNPLUGGED,
45 ALC_HEADSET_MODE_HEADSET,
46 ALC_HEADSET_MODE_MIC,
47 ALC_HEADSET_MODE_HEADPHONE,
48};
49
50enum {
51 ALC_HEADSET_TYPE_UNKNOWN,
52 ALC_HEADSET_TYPE_CTIA,
53 ALC_HEADSET_TYPE_OMTP,
54};
55
c7b60a89
HW
56enum {
57 ALC_KEY_MICMUTE_INDEX,
58};
59
da00c244
KY
60struct alc_customize_define {
61 unsigned int sku_cfg;
62 unsigned char port_connectivity;
63 unsigned char check_sum;
64 unsigned char customization;
65 unsigned char external_amp;
66 unsigned int enable_pcbeep:1;
67 unsigned int platform_type:1;
68 unsigned int swap:1;
69 unsigned int override:1;
90622917 70 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
da00c244
KY
71};
72
766538ac
TI
73struct alc_coef_led {
74 unsigned int idx;
75 unsigned int mask;
76 unsigned int on;
77 unsigned int off;
78};
79
1da177e4 80struct alc_spec {
08c189f2 81 struct hda_gen_spec gen; /* must be at head */
23d30f28 82
1da177e4 83 /* codec parameterization */
da00c244 84 struct alc_customize_define cdefine;
08c189f2 85 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
834be88d 86
5579cd6f
TI
87 /* GPIO bits */
88 unsigned int gpio_mask;
89 unsigned int gpio_dir;
90 unsigned int gpio_data;
215c850c 91 bool gpio_write_delay; /* add a delay before writing gpio_data */
5579cd6f 92
8d3d1ece 93 /* mute LED for HP laptops, see vref_mute_led_set() */
08fb0d0e 94 int mute_led_polarity;
dbd13179 95 int micmute_led_polarity;
08fb0d0e 96 hda_nid_t mute_led_nid;
9c5dc3bf 97 hda_nid_t cap_mute_led_nid;
08fb0d0e 98
0f32fd19
TI
99 unsigned int gpio_mute_led_mask;
100 unsigned int gpio_mic_led_mask;
766538ac
TI
101 struct alc_coef_led mute_led_coef;
102 struct alc_coef_led mic_led_coef;
b837a9f5 103 struct mutex coef_mutex;
9f5c6faf 104
73bdd597
DH
105 hda_nid_t headset_mic_pin;
106 hda_nid_t headphone_mic_pin;
107 int current_headset_mode;
108 int current_headset_type;
109
ae6b813a
TI
110 /* hooks */
111 void (*init_hook)(struct hda_codec *codec);
83012a7c 112#ifdef CONFIG_PM
c97259df 113 void (*power_hook)(struct hda_codec *codec);
f5de24b0 114#endif
1c716153 115 void (*shutup)(struct hda_codec *codec);
d922b51d 116
4a79ba34 117 int init_amp;
d433a678 118 int codec_variant; /* flag for other variants */
97a26570
KY
119 unsigned int has_alc5505_dsp:1;
120 unsigned int no_depop_delay:1;
693abe11 121 unsigned int done_hp_init:1;
c0ca5ece 122 unsigned int no_shutup_pins:1;
d3ba58bb 123 unsigned int ultra_low_power:1;
476c02e0 124 unsigned int has_hs_key:1;
92666d45 125 unsigned int no_internal_mic_pin:1;
69ea4c9d 126 unsigned int en_3kpull_low:1;
e64f14f4 127
2c3bf9ab
TI
128 /* for PLL fix */
129 hda_nid_t pll_nid;
130 unsigned int pll_coef_idx, pll_coef_bit;
1bb7e43e 131 unsigned int coef0;
33f4acd3 132 struct input_dev *kb_dev;
c7b60a89 133 u8 alc_mute_keycode_map[1];
d3dca026
LT
134
135 /* component binding */
d3dca026 136 struct hda_component comps[HDA_MAX_COMPONENTS];
df694daa
KY
137};
138
f2a227cd
TI
139/*
140 * COEF access helper functions
141 */
142
2a845837
TI
143static void coef_mutex_lock(struct hda_codec *codec)
144{
145 struct alc_spec *spec = codec->spec;
146
147 snd_hda_power_up_pm(codec);
148 mutex_lock(&spec->coef_mutex);
149}
150
151static void coef_mutex_unlock(struct hda_codec *codec)
152{
153 struct alc_spec *spec = codec->spec;
154
155 mutex_unlock(&spec->coef_mutex);
156 snd_hda_power_down_pm(codec);
157}
158
b837a9f5
TI
159static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
160 unsigned int coef_idx)
f2a227cd
TI
161{
162 unsigned int val;
163
164 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
165 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
166 return val;
167}
168
b837a9f5
TI
169static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
170 unsigned int coef_idx)
171{
b837a9f5
TI
172 unsigned int val;
173
2a845837 174 coef_mutex_lock(codec);
b837a9f5 175 val = __alc_read_coefex_idx(codec, nid, coef_idx);
2a845837 176 coef_mutex_unlock(codec);
b837a9f5
TI
177 return val;
178}
179
f2a227cd
TI
180#define alc_read_coef_idx(codec, coef_idx) \
181 alc_read_coefex_idx(codec, 0x20, coef_idx)
182
b837a9f5
TI
183static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
184 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
185{
186 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
187 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
188}
189
b837a9f5
TI
190static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
191 unsigned int coef_idx, unsigned int coef_val)
192{
2a845837 193 coef_mutex_lock(codec);
b837a9f5 194 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
2a845837 195 coef_mutex_unlock(codec);
b837a9f5
TI
196}
197
f2a227cd
TI
198#define alc_write_coef_idx(codec, coef_idx, coef_val) \
199 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
200
b837a9f5
TI
201static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
202 unsigned int coef_idx, unsigned int mask,
203 unsigned int bits_set)
204{
205 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
206
207 if (val != -1)
208 __alc_write_coefex_idx(codec, nid, coef_idx,
209 (val & ~mask) | bits_set);
210}
211
98b24883
TI
212static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
213 unsigned int coef_idx, unsigned int mask,
214 unsigned int bits_set)
215{
2a845837 216 coef_mutex_lock(codec);
b837a9f5 217 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
2a845837 218 coef_mutex_unlock(codec);
98b24883
TI
219}
220
221#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
222 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
223
f2a227cd
TI
224/* a special bypass for COEF 0; read the cached value at the second time */
225static unsigned int alc_get_coef0(struct hda_codec *codec)
226{
227 struct alc_spec *spec = codec->spec;
228
229 if (!spec->coef0)
230 spec->coef0 = alc_read_coef_idx(codec, 0);
231 return spec->coef0;
232}
233
54db6c39
TI
234/* coef writes/updates batch */
235struct coef_fw {
236 unsigned char nid;
237 unsigned char idx;
238 unsigned short mask;
239 unsigned short val;
240};
241
242#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
243 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
244#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
245#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
246#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
247
248static void alc_process_coef_fw(struct hda_codec *codec,
249 const struct coef_fw *fw)
250{
2a845837 251 coef_mutex_lock(codec);
54db6c39
TI
252 for (; fw->nid; fw++) {
253 if (fw->mask == (unsigned short)-1)
b837a9f5 254 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 255 else
b837a9f5
TI
256 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
257 fw->mask, fw->val);
54db6c39 258 }
2a845837 259 coef_mutex_unlock(codec);
54db6c39
TI
260}
261
df694daa 262/*
1d045db9 263 * GPIO setup tables, used in initialization
df694daa 264 */
5579cd6f 265
bc9f98a9 266/* Enable GPIO mask and set output */
5579cd6f
TI
267static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
268{
269 struct alc_spec *spec = codec->spec;
bc9f98a9 270
5579cd6f
TI
271 spec->gpio_mask |= mask;
272 spec->gpio_dir |= mask;
273 spec->gpio_data |= mask;
274}
bc9f98a9 275
5579cd6f
TI
276static void alc_write_gpio_data(struct hda_codec *codec)
277{
278 struct alc_spec *spec = codec->spec;
279
280 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
281 spec->gpio_data);
282}
283
aaf312de
TI
284static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
285 bool on)
286{
287 struct alc_spec *spec = codec->spec;
288 unsigned int oldval = spec->gpio_data;
289
290 if (on)
291 spec->gpio_data |= mask;
292 else
293 spec->gpio_data &= ~mask;
294 if (oldval != spec->gpio_data)
295 alc_write_gpio_data(codec);
296}
297
5579cd6f
TI
298static void alc_write_gpio(struct hda_codec *codec)
299{
300 struct alc_spec *spec = codec->spec;
301
302 if (!spec->gpio_mask)
303 return;
304
305 snd_hda_codec_write(codec, codec->core.afg, 0,
306 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
307 snd_hda_codec_write(codec, codec->core.afg, 0,
308 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
309 if (spec->gpio_write_delay)
310 msleep(1);
5579cd6f
TI
311 alc_write_gpio_data(codec);
312}
313
314static void alc_fixup_gpio(struct hda_codec *codec, int action,
315 unsigned int mask)
316{
317 if (action == HDA_FIXUP_ACT_PRE_PROBE)
318 alc_setup_gpio(codec, mask);
319}
320
321static void alc_fixup_gpio1(struct hda_codec *codec,
322 const struct hda_fixup *fix, int action)
323{
324 alc_fixup_gpio(codec, action, 0x01);
325}
326
327static void alc_fixup_gpio2(struct hda_codec *codec,
328 const struct hda_fixup *fix, int action)
329{
330 alc_fixup_gpio(codec, action, 0x02);
331}
332
333static void alc_fixup_gpio3(struct hda_codec *codec,
334 const struct hda_fixup *fix, int action)
335{
336 alc_fixup_gpio(codec, action, 0x03);
337}
bdd148a3 338
ae065f1c
TI
339static void alc_fixup_gpio4(struct hda_codec *codec,
340 const struct hda_fixup *fix, int action)
341{
342 alc_fixup_gpio(codec, action, 0x04);
343}
344
8a503555
TI
345static void alc_fixup_micmute_led(struct hda_codec *codec,
346 const struct hda_fixup *fix, int action)
347{
e65bf997 348 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
349 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
350}
351
2c3bf9ab
TI
352/*
353 * Fix hardware PLL issue
354 * On some codecs, the analog PLL gating control must be off while
355 * the default value is 1.
356 */
357static void alc_fix_pll(struct hda_codec *codec)
358{
359 struct alc_spec *spec = codec->spec;
2c3bf9ab 360
98b24883
TI
361 if (spec->pll_nid)
362 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
363 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
364}
365
366static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
367 unsigned int coef_idx, unsigned int coef_bit)
368{
369 struct alc_spec *spec = codec->spec;
370 spec->pll_nid = nid;
371 spec->pll_coef_idx = coef_idx;
372 spec->pll_coef_bit = coef_bit;
373 alc_fix_pll(codec);
374}
375
cf5a2279 376/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
377static void alc_update_knob_master(struct hda_codec *codec,
378 struct hda_jack_callback *jack)
cf5a2279
TI
379{
380 unsigned int val;
381 struct snd_kcontrol *kctl;
382 struct snd_ctl_elem_value *uctl;
383
384 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
385 if (!kctl)
386 return;
387 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
388 if (!uctl)
389 return;
2ebab40e 390 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
391 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
392 val &= HDA_AMP_VOLMASK;
393 uctl->value.integer.value[0] = val;
394 uctl->value.integer.value[1] = val;
395 kctl->put(kctl, uctl);
396 kfree(uctl);
397}
398
29adc4b9 399static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 400{
29adc4b9
DH
401 /* For some reason, the res given from ALC880 is broken.
402 Here we adjust it properly. */
403 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
404}
405
394c97f8
KY
406/* Change EAPD to verb control */
407static void alc_fill_eapd_coef(struct hda_codec *codec)
408{
409 int coef;
410
411 coef = alc_get_coef0(codec);
412
7639a06c 413 switch (codec->core.vendor_id) {
394c97f8
KY
414 case 0x10ec0262:
415 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
416 break;
417 case 0x10ec0267:
418 case 0x10ec0268:
419 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
420 break;
421 case 0x10ec0269:
422 if ((coef & 0x00f0) == 0x0010)
423 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
424 if ((coef & 0x00f0) == 0x0020)
425 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
426 if ((coef & 0x00f0) == 0x0030)
427 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
428 break;
429 case 0x10ec0280:
430 case 0x10ec0284:
431 case 0x10ec0290:
432 case 0x10ec0292:
433 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
434 break;
4231430d 435 case 0x10ec0225:
44be77c5
TI
436 case 0x10ec0295:
437 case 0x10ec0299:
438 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 439 fallthrough;
44be77c5 440 case 0x10ec0215:
fcfc9f71
KY
441 case 0x10ec0285:
442 case 0x10ec0289:
443 alc_update_coef_idx(codec, 0x36, 1<<13, 0);
444 fallthrough;
1948fc06 445 case 0x10ec0230:
394c97f8 446 case 0x10ec0233:
ea04a1db 447 case 0x10ec0235:
c4473744 448 case 0x10ec0236:
7fbdcd83 449 case 0x10ec0245:
394c97f8 450 case 0x10ec0255:
c4473744 451 case 0x10ec0256:
527f4643 452 case 0x19e58326:
f429e7e4 453 case 0x10ec0257:
394c97f8
KY
454 case 0x10ec0282:
455 case 0x10ec0283:
456 case 0x10ec0286:
457 case 0x10ec0288:
506b62c3 458 case 0x10ec0298:
1078bef0 459 case 0x10ec0300:
394c97f8
KY
460 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
461 break;
3aabf94c
KY
462 case 0x10ec0275:
463 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
464 break;
8822702f
HW
465 case 0x10ec0287:
466 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
467 alc_write_coef_idx(codec, 0x8, 0x4ab7);
468 break;
394c97f8
KY
469 case 0x10ec0293:
470 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
471 break;
dcd4f0db
KY
472 case 0x10ec0234:
473 case 0x10ec0274:
474 case 0x10ec0294:
6fbae35a
KY
475 case 0x10ec0700:
476 case 0x10ec0701:
477 case 0x10ec0703:
83629532 478 case 0x10ec0711:
dcd4f0db
KY
479 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
480 break;
394c97f8
KY
481 case 0x10ec0662:
482 if ((coef & 0x00f0) == 0x0030)
483 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
484 break;
485 case 0x10ec0272:
486 case 0x10ec0273:
487 case 0x10ec0663:
488 case 0x10ec0665:
489 case 0x10ec0670:
490 case 0x10ec0671:
491 case 0x10ec0672:
492 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
493 break;
9194a1eb 494 case 0x10ec0222:
f0778871
KY
495 case 0x10ec0623:
496 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
497 break;
394c97f8
KY
498 case 0x10ec0668:
499 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
500 break;
501 case 0x10ec0867:
502 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
503 break;
504 case 0x10ec0888:
505 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
506 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
507 break;
508 case 0x10ec0892:
e5782a5d 509 case 0x10ec0897:
394c97f8
KY
510 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
511 break;
512 case 0x10ec0899:
513 case 0x10ec0900:
6d9ffcff 514 case 0x10ec0b00:
65553b12 515 case 0x10ec1168:
a535ad57 516 case 0x10ec1220:
394c97f8
KY
517 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
518 break;
519 }
520}
521
f9423e7a
KY
522/* additional initialization for ALC888 variants */
523static void alc888_coef_init(struct hda_codec *codec)
524{
1df8874b
KY
525 switch (alc_get_coef0(codec) & 0x00f0) {
526 /* alc888-VA */
527 case 0x00:
528 /* alc888-VB */
529 case 0x10:
530 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
531 break;
532 }
87a8c370
JK
533}
534
3fb4a508
TI
535/* turn on/off EAPD control (only if available) */
536static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
537{
538 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
539 return;
540 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
541 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
542 on ? 2 : 0);
543}
544
691f1fcc
TI
545/* turn on/off EAPD controls of the codec */
546static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
547{
548 /* We currently only handle front, HP */
caf3c043 549 static const hda_nid_t pins[] = {
af95b414 550 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 551 };
caf3c043 552 const hda_nid_t *p;
39fa84e9
TI
553 for (p = pins; *p; p++)
554 set_eapd(codec, *p, on);
691f1fcc
TI
555}
556
dad3197d
KY
557static int find_ext_mic_pin(struct hda_codec *codec);
558
559static void alc_headset_mic_no_shutup(struct hda_codec *codec)
560{
561 const struct hda_pincfg *pin;
562 int mic_pin = find_ext_mic_pin(codec);
563 int i;
564
565 /* don't shut up pins when unloading the driver; otherwise it breaks
566 * the default pin setup at the next load of the driver
567 */
568 if (codec->bus->shutdown)
569 return;
570
571 snd_array_for_each(&codec->init_pins, i, pin) {
572 /* use read here for syncing after issuing each verb */
573 if (pin->nid != mic_pin)
574 snd_hda_codec_read(codec, pin->nid, 0,
575 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
576 }
577
578 codec->pins_shutup = 1;
579}
580
c0ca5ece
TI
581static void alc_shutup_pins(struct hda_codec *codec)
582{
583 struct alc_spec *spec = codec->spec;
584
dad3197d 585 switch (codec->core.vendor_id) {
5aec9891
KY
586 case 0x10ec0236:
587 case 0x10ec0256:
527f4643 588 case 0x19e58326:
66c5d718 589 case 0x10ec0283:
dad3197d
KY
590 case 0x10ec0286:
591 case 0x10ec0288:
592 case 0x10ec0298:
593 alc_headset_mic_no_shutup(codec);
594 break;
595 default:
596 if (!spec->no_shutup_pins)
597 snd_hda_shutup_pins(codec);
598 break;
599 }
c0ca5ece
TI
600}
601
1c716153 602/* generic shutup callback;
4ce8e6a5 603 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
604 */
605static void alc_eapd_shutup(struct hda_codec *codec)
606{
97a26570
KY
607 struct alc_spec *spec = codec->spec;
608
1c716153 609 alc_auto_setup_eapd(codec, false);
97a26570
KY
610 if (!spec->no_depop_delay)
611 msleep(200);
c0ca5ece 612 alc_shutup_pins(codec);
1c716153
TI
613}
614
1d045db9 615/* generic EAPD initialization */
4a79ba34 616static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 617{
39fa84e9 618 alc_auto_setup_eapd(codec, true);
5579cd6f 619 alc_write_gpio(codec);
4a79ba34 620 switch (type) {
4a79ba34 621 case ALC_INIT_DEFAULT:
7639a06c 622 switch (codec->core.vendor_id) {
c9b58006 623 case 0x10ec0260:
98b24883 624 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 625 break;
c9b58006
KY
626 case 0x10ec0880:
627 case 0x10ec0882:
628 case 0x10ec0883:
629 case 0x10ec0885:
1df8874b 630 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 631 break;
f9423e7a 632 case 0x10ec0888:
4a79ba34 633 alc888_coef_init(codec);
f9423e7a 634 break;
bc9f98a9 635 }
4a79ba34
TI
636 break;
637 }
638}
639
35a39f98
TI
640/* get a primary headphone pin if available */
641static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
642{
643 if (spec->gen.autocfg.hp_pins[0])
644 return spec->gen.autocfg.hp_pins[0];
645 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
646 return spec->gen.autocfg.line_out_pins[0];
647 return 0;
648}
08c189f2 649
1d045db9 650/*
08c189f2 651 * Realtek SSID verification
1d045db9 652 */
42cf0d01 653
08c189f2
TI
654/* Could be any non-zero and even value. When used as fixup, tells
655 * the driver to ignore any present sku defines.
656 */
657#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 658
08c189f2
TI
659static void alc_fixup_sku_ignore(struct hda_codec *codec,
660 const struct hda_fixup *fix, int action)
1a1455de 661{
1a1455de 662 struct alc_spec *spec = codec->spec;
08c189f2
TI
663 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
664 spec->cdefine.fixup = 1;
665 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 666 }
1a1455de
TI
667}
668
b5c6611f
ML
669static void alc_fixup_no_depop_delay(struct hda_codec *codec,
670 const struct hda_fixup *fix, int action)
671{
672 struct alc_spec *spec = codec->spec;
673
84d2dc3e 674 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 675 spec->no_depop_delay = 1;
84d2dc3e
ML
676 codec->depop_delay = 0;
677 }
b5c6611f
ML
678}
679
08c189f2 680static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 681{
08c189f2
TI
682 unsigned int ass, tmp, i;
683 unsigned nid = 0;
4a79ba34
TI
684 struct alc_spec *spec = codec->spec;
685
08c189f2 686 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 687
08c189f2
TI
688 if (spec->cdefine.fixup) {
689 ass = spec->cdefine.sku_cfg;
690 if (ass == ALC_FIXUP_SKU_IGNORE)
691 return -1;
692 goto do_sku;
bb35febd
TI
693 }
694
5100cd07
TI
695 if (!codec->bus->pci)
696 return -1;
7639a06c 697 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
698 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
699 goto do_sku;
4a79ba34 700
08c189f2 701 nid = 0x1d;
7639a06c 702 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
703 nid = 0x17;
704 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 705
08c189f2 706 if (!(ass & 1)) {
4e76a883 707 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 708 codec->core.chip_name, ass);
08c189f2 709 return -1;
42cf0d01
DH
710 }
711
08c189f2
TI
712 /* check sum */
713 tmp = 0;
714 for (i = 1; i < 16; i++) {
715 if ((ass >> i) & 1)
716 tmp++;
ae8a60a5 717 }
08c189f2
TI
718 if (((ass >> 16) & 0xf) != tmp)
719 return -1;
ae8a60a5 720
da00c244
KY
721 spec->cdefine.port_connectivity = ass >> 30;
722 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
723 spec->cdefine.check_sum = (ass >> 16) & 0xf;
724 spec->cdefine.customization = ass >> 8;
725do_sku:
726 spec->cdefine.sku_cfg = ass;
727 spec->cdefine.external_amp = (ass & 0x38) >> 3;
728 spec->cdefine.platform_type = (ass & 0x4) >> 2;
729 spec->cdefine.swap = (ass & 0x2) >> 1;
730 spec->cdefine.override = ass & 0x1;
731
4e76a883 732 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 733 nid, spec->cdefine.sku_cfg);
4e76a883 734 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 735 spec->cdefine.port_connectivity);
4e76a883
TI
736 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
737 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
738 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
739 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
740 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
741 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
742 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
743
744 return 0;
745}
746
08c189f2
TI
747/* return the position of NID in the list, or -1 if not found */
748static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
749{
750 int i;
751 for (i = 0; i < nums; i++)
752 if (list[i] == nid)
753 return i;
754 return -1;
755}
1d045db9 756/* return true if the given NID is found in the list */
3af9ee6b
TI
757static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
758{
21268961 759 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
760}
761
4a79ba34
TI
762/* check subsystem ID and set up device-specific initialization;
763 * return 1 if initialized, 0 if invalid SSID
764 */
765/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
766 * 31 ~ 16 : Manufacture ID
767 * 15 ~ 8 : SKU ID
768 * 7 ~ 0 : Assembly ID
769 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
770 */
58c57cfa 771static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
772{
773 unsigned int ass, tmp, i;
774 unsigned nid;
775 struct alc_spec *spec = codec->spec;
776
90622917
DH
777 if (spec->cdefine.fixup) {
778 ass = spec->cdefine.sku_cfg;
779 if (ass == ALC_FIXUP_SKU_IGNORE)
780 return 0;
781 goto do_sku;
782 }
783
7639a06c 784 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
785 if (codec->bus->pci &&
786 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
787 goto do_sku;
788
789 /* invalid SSID, check the special NID pin defcfg instead */
790 /*
def319f9 791 * 31~30 : port connectivity
4a79ba34
TI
792 * 29~21 : reserve
793 * 20 : PCBEEP input
794 * 19~16 : Check sum (15:1)
795 * 15~1 : Custom
796 * 0 : override
797 */
798 nid = 0x1d;
7639a06c 799 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
800 nid = 0x17;
801 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
802 codec_dbg(codec,
803 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 804 ass, nid);
6227cdce 805 if (!(ass & 1))
4a79ba34
TI
806 return 0;
807 if ((ass >> 30) != 1) /* no physical connection */
808 return 0;
809
810 /* check sum */
811 tmp = 0;
812 for (i = 1; i < 16; i++) {
813 if ((ass >> i) & 1)
814 tmp++;
815 }
816 if (((ass >> 16) & 0xf) != tmp)
817 return 0;
818do_sku:
4e76a883 819 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 820 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
821 /*
822 * 0 : override
823 * 1 : Swap Jack
824 * 2 : 0 --> Desktop, 1 --> Laptop
825 * 3~5 : External Amplifier control
826 * 7~6 : Reserved
827 */
828 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
829 if (spec->init_amp == ALC_INIT_UNDEFINED) {
830 switch (tmp) {
831 case 1:
5579cd6f 832 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
833 break;
834 case 3:
5579cd6f 835 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
836 break;
837 case 7:
2bdccfd2 838 alc_setup_gpio(codec, 0x04);
1c76aa5f
TI
839 break;
840 case 5:
841 default:
842 spec->init_amp = ALC_INIT_DEFAULT;
843 break;
844 }
bc9f98a9 845 }
ea1fb29a 846
8c427226 847 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
848 * when the external headphone out jack is plugged"
849 */
8c427226 850 if (!(ass & 0x8000))
4a79ba34 851 return 1;
c9b58006
KY
852 /*
853 * 10~8 : Jack location
854 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
855 * 14~13: Resvered
856 * 15 : 1 --> enable the function "Mute internal speaker
857 * when the external headphone out jack is plugged"
858 */
35a39f98 859 if (!alc_get_hp_pin(spec)) {
01d4825d 860 hda_nid_t nid;
c9b58006 861 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 862 nid = ports[tmp];
08c189f2
TI
863 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
864 spec->gen.autocfg.line_outs))
3af9ee6b 865 return 1;
08c189f2 866 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 867 }
4a79ba34
TI
868 return 1;
869}
ea1fb29a 870
3e6179b8
TI
871/* Check the validity of ALC subsystem-id
872 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
873static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 874{
58c57cfa 875 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 876 struct alc_spec *spec = codec->spec;
67791202
TI
877 if (spec->init_amp == ALC_INIT_UNDEFINED) {
878 codec_dbg(codec,
879 "realtek: Enable default setup for auto mode as fallback\n");
880 spec->init_amp = ALC_INIT_DEFAULT;
881 }
4a79ba34 882 }
21268961 883}
1a1455de 884
1d045db9 885/*
ef8ef5fb 886 */
f9e336f6 887
9d36a7dc
DH
888static void alc_fixup_inv_dmic(struct hda_codec *codec,
889 const struct hda_fixup *fix, int action)
125821ae
TI
890{
891 struct alc_spec *spec = codec->spec;
668d1e96 892
9d36a7dc 893 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
894}
895
e9edcee0 896
08c189f2 897static int alc_build_controls(struct hda_codec *codec)
1d045db9 898{
a5cb463a 899 int err;
e9427969 900
08c189f2
TI
901 err = snd_hda_gen_build_controls(codec);
902 if (err < 0)
903 return err;
1da177e4 904
1727a771 905 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 906 return 0;
a361d84b
KY
907}
908
a361d84b 909
df694daa 910/*
08c189f2 911 * Common callbacks
df694daa 912 */
a361d84b 913
c9af753f
TI
914static void alc_pre_init(struct hda_codec *codec)
915{
916 alc_fill_eapd_coef(codec);
917}
918
aeac1a0d
KY
919#define is_s3_resume(codec) \
920 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
921#define is_s4_resume(codec) \
922 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
1e707769
KY
923#define is_s4_suspend(codec) \
924 ((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
c9af753f 925
08c189f2 926static int alc_init(struct hda_codec *codec)
1d045db9
TI
927{
928 struct alc_spec *spec = codec->spec;
a361d84b 929
c9af753f
TI
930 /* hibernation resume needs the full chip initialization */
931 if (is_s4_resume(codec))
932 alc_pre_init(codec);
933
08c189f2
TI
934 if (spec->init_hook)
935 spec->init_hook(codec);
a361d84b 936
89781d08 937 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 938 snd_hda_gen_init(codec);
08c189f2
TI
939 alc_fix_pll(codec);
940 alc_auto_init_amp(codec, spec->init_amp);
89781d08 941 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 942
1727a771 943 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 944
1d045db9
TI
945 return 0;
946}
a361d84b 947
c3d9ca93
RD
948#define alc_free snd_hda_gen_free
949
950#ifdef CONFIG_PM
08c189f2 951static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
952{
953 struct alc_spec *spec = codec->spec;
a361d84b 954
c7273bd6
TI
955 if (!snd_hda_get_bool_hint(codec, "shutup"))
956 return; /* disabled explicitly by hints */
957
08c189f2
TI
958 if (spec && spec->shutup)
959 spec->shutup(codec);
9bfb2844 960 else
c0ca5ece 961 alc_shutup_pins(codec);
1d045db9
TI
962}
963
08c189f2 964static void alc_power_eapd(struct hda_codec *codec)
1d045db9 965{
08c189f2 966 alc_auto_setup_eapd(codec, false);
1d045db9 967}
2134ea4f 968
08c189f2 969static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
970{
971 struct alc_spec *spec = codec->spec;
08c189f2
TI
972 alc_shutup(codec);
973 if (spec && spec->power_hook)
974 spec->power_hook(codec);
a361d84b
KY
975 return 0;
976}
977
08c189f2 978static int alc_resume(struct hda_codec *codec)
1d045db9 979{
97a26570
KY
980 struct alc_spec *spec = codec->spec;
981
982 if (!spec->no_depop_delay)
983 msleep(150); /* to avoid pop noise */
08c189f2 984 codec->patch_ops.init(codec);
1a462be5 985 snd_hda_regmap_sync(codec);
08c189f2
TI
986 hda_call_check_power_status(codec, 0x01);
987 return 0;
1d045db9 988}
08c189f2 989#endif
f6a92248 990
1d045db9 991/*
1d045db9 992 */
08c189f2
TI
993static const struct hda_codec_ops alc_patch_ops = {
994 .build_controls = alc_build_controls,
995 .build_pcms = snd_hda_gen_build_pcms,
996 .init = alc_init,
997 .free = alc_free,
998 .unsol_event = snd_hda_jack_unsol_event,
999#ifdef CONFIG_PM
1000 .resume = alc_resume,
08c189f2 1001 .suspend = alc_suspend,
fce52a3b 1002 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 1003#endif
08c189f2 1004};
f6a92248 1005
f53281e6 1006
ded255be 1007#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 1008
e4770629 1009/*
4b016931 1010 * Rename codecs appropriately from COEF value or subvendor id
e4770629 1011 */
08c189f2
TI
1012struct alc_codec_rename_table {
1013 unsigned int vendor_id;
1014 unsigned short coef_mask;
1015 unsigned short coef_bits;
1016 const char *name;
1017};
84898e87 1018
4b016931
KY
1019struct alc_codec_rename_pci_table {
1020 unsigned int codec_vendor_id;
1021 unsigned short pci_subvendor;
1022 unsigned short pci_subdevice;
1023 const char *name;
1024};
1025
6b0f95c4 1026static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1027 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1028 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1029 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1030 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1031 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1032 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1033 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1034 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1035 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1036 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1037 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1038 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1039 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1040 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1041 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1042 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1043 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1044 { } /* terminator */
1045};
84898e87 1046
6b0f95c4 1047static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1048 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1049 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1050 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1051 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1052 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1053 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1054 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1055 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1056 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1057 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1058 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1059 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1060 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1061 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1062 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1063 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1064 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1065 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1066 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1067 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1068 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1069 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1070 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1071 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1072 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1073 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1074 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1075 { } /* terminator */
1076};
1077
08c189f2 1078static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1079{
08c189f2 1080 const struct alc_codec_rename_table *p;
4b016931 1081 const struct alc_codec_rename_pci_table *q;
60db6b53 1082
08c189f2 1083 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1084 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1085 continue;
1086 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1087 return alc_codec_rename(codec, p->name);
1d045db9 1088 }
4b016931 1089
5100cd07
TI
1090 if (!codec->bus->pci)
1091 return 0;
4b016931 1092 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1093 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1094 continue;
1095 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1096 continue;
1097 if (!q->pci_subdevice ||
1098 q->pci_subdevice == codec->bus->pci->subsystem_device)
1099 return alc_codec_rename(codec, q->name);
1100 }
1101
08c189f2 1102 return 0;
1d045db9 1103}
f53281e6 1104
e4770629 1105
1d045db9
TI
1106/*
1107 * Digital-beep handlers
1108 */
1109#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1110
1111/* additional beep mixers; private_value will be overwritten */
1112static const struct snd_kcontrol_new alc_beep_mixer[] = {
1113 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1114 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1115};
1116
1117/* set up and create beep controls */
1118static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1119 int idx, int dir)
1120{
1121 struct snd_kcontrol_new *knew;
1122 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1123 int i;
1124
1125 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1126 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1127 &alc_beep_mixer[i]);
1128 if (!knew)
1129 return -ENOMEM;
1130 knew->private_value = beep_amp;
1131 }
1132 return 0;
1133}
84898e87 1134
6317e5eb 1135static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1136 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1137 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1138 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1139 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1140 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1141 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1142 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1143 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1144 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1145 /* denylist -- no beep available */
051c78af
TI
1146 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1147 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1148 {}
fe3eb0a7
KY
1149};
1150
1d045db9
TI
1151static inline int has_cdefine_beep(struct hda_codec *codec)
1152{
1153 struct alc_spec *spec = codec->spec;
1154 const struct snd_pci_quirk *q;
6317e5eb 1155 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1156 if (q)
1157 return q->value;
1158 return spec->cdefine.enable_pcbeep;
1159}
1160#else
fea80fae 1161#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1162#define has_cdefine_beep(codec) 0
1163#endif
84898e87 1164
1d045db9
TI
1165/* parse the BIOS configuration and set up the alc_spec */
1166/* return 1 if successful, 0 if the proper config is not found,
1167 * or a negative error code
1168 */
3e6179b8
TI
1169static int alc_parse_auto_config(struct hda_codec *codec,
1170 const hda_nid_t *ignore_nids,
1171 const hda_nid_t *ssid_nids)
1d045db9
TI
1172{
1173 struct alc_spec *spec = codec->spec;
08c189f2 1174 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1175 int err;
26f5df26 1176
53c334ad
TI
1177 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1178 spec->parse_flags);
1d045db9
TI
1179 if (err < 0)
1180 return err;
3e6179b8
TI
1181
1182 if (ssid_nids)
1183 alc_ssid_check(codec, ssid_nids);
64154835 1184
08c189f2
TI
1185 err = snd_hda_gen_parse_auto_config(codec, cfg);
1186 if (err < 0)
1187 return err;
070cff4c 1188
1d045db9 1189 return 1;
60db6b53 1190}
f6a92248 1191
3de95173
TI
1192/* common preparation job for alc_spec */
1193static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1194{
1195 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1196 int err;
1197
1198 if (!spec)
1199 return -ENOMEM;
1200 codec->spec = spec;
08c189f2
TI
1201 snd_hda_gen_spec_init(&spec->gen);
1202 spec->gen.mixer_nid = mixer_nid;
1203 spec->gen.own_eapd_ctl = 1;
1098b7c2 1204 codec->single_adc_amp = 1;
08c189f2
TI
1205 /* FIXME: do we need this for all Realtek codec models? */
1206 codec->spdif_status_reset = 1;
a6e7d0a4 1207 codec->forced_resume = 1;
225068ab 1208 codec->patch_ops = alc_patch_ops;
b837a9f5 1209 mutex_init(&spec->coef_mutex);
3de95173
TI
1210
1211 err = alc_codec_rename_from_preset(codec);
1212 if (err < 0) {
1213 kfree(spec);
1214 return err;
1215 }
1216 return 0;
1217}
1218
3e6179b8
TI
1219static int alc880_parse_auto_config(struct hda_codec *codec)
1220{
1221 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1222 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1223 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1224}
1225
ee3b2969
TI
1226/*
1227 * ALC880 fix-ups
1228 */
1229enum {
411225a0 1230 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1231 ALC880_FIXUP_GPIO2,
1232 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1233 ALC880_FIXUP_LG,
db8a38e5 1234 ALC880_FIXUP_LG_LW25,
f02aab5d 1235 ALC880_FIXUP_W810,
27e917f8 1236 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1237 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1238 ALC880_FIXUP_VOL_KNOB,
1239 ALC880_FIXUP_FUJITSU,
ba533818 1240 ALC880_FIXUP_F1734,
817de92f 1241 ALC880_FIXUP_UNIWILL,
967b88c4 1242 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1243 ALC880_FIXUP_Z71V,
487a588d 1244 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1245 ALC880_FIXUP_3ST_BASE,
1246 ALC880_FIXUP_3ST,
1247 ALC880_FIXUP_3ST_DIG,
1248 ALC880_FIXUP_5ST_BASE,
1249 ALC880_FIXUP_5ST,
1250 ALC880_FIXUP_5ST_DIG,
1251 ALC880_FIXUP_6ST_BASE,
1252 ALC880_FIXUP_6ST,
1253 ALC880_FIXUP_6ST_DIG,
5397145f 1254 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1255};
1256
cf5a2279
TI
1257/* enable the volume-knob widget support on NID 0x21 */
1258static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1259 const struct hda_fixup *fix, int action)
cf5a2279 1260{
1727a771 1261 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1262 snd_hda_jack_detect_enable_callback(codec, 0x21,
1263 alc_update_knob_master);
cf5a2279
TI
1264}
1265
1727a771 1266static const struct hda_fixup alc880_fixups[] = {
411225a0 1267 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1268 .type = HDA_FIXUP_FUNC,
1269 .v.func = alc_fixup_gpio1,
411225a0 1270 },
ee3b2969 1271 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1272 .type = HDA_FIXUP_FUNC,
1273 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1274 },
1275 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1276 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1277 .v.verbs = (const struct hda_verb[]) {
1278 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1279 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1280 { }
1281 },
1282 .chained = true,
1283 .chain_id = ALC880_FIXUP_GPIO2,
1284 },
dc6af52d 1285 [ALC880_FIXUP_LG] = {
1727a771
TI
1286 .type = HDA_FIXUP_PINS,
1287 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1288 /* disable bogus unused pins */
1289 { 0x16, 0x411111f0 },
1290 { 0x18, 0x411111f0 },
1291 { 0x1a, 0x411111f0 },
1292 { }
1293 }
1294 },
db8a38e5
TI
1295 [ALC880_FIXUP_LG_LW25] = {
1296 .type = HDA_FIXUP_PINS,
1297 .v.pins = (const struct hda_pintbl[]) {
1298 { 0x1a, 0x0181344f }, /* line-in */
1299 { 0x1b, 0x0321403f }, /* headphone */
1300 { }
1301 }
1302 },
f02aab5d 1303 [ALC880_FIXUP_W810] = {
1727a771
TI
1304 .type = HDA_FIXUP_PINS,
1305 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1306 /* disable bogus unused pins */
1307 { 0x17, 0x411111f0 },
1308 { }
1309 },
1310 .chained = true,
1311 .chain_id = ALC880_FIXUP_GPIO2,
1312 },
27e917f8 1313 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1314 .type = HDA_FIXUP_VERBS,
27e917f8
TI
1315 .v.verbs = (const struct hda_verb[]) {
1316 /* change to EAPD mode */
1317 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1318 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1319 {}
1320 },
1321 },
b9368f5c 1322 [ALC880_FIXUP_TCL_S700] = {
1727a771 1323 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1324 .v.verbs = (const struct hda_verb[]) {
1325 /* change to EAPD mode */
1326 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1327 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1328 {}
1329 },
1330 .chained = true,
1331 .chain_id = ALC880_FIXUP_GPIO2,
1332 },
cf5a2279 1333 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1334 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1335 .v.func = alc880_fixup_vol_knob,
1336 },
1337 [ALC880_FIXUP_FUJITSU] = {
1338 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1339 .type = HDA_FIXUP_PINS,
1340 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1341 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1342 { 0x15, 0x99030120 }, /* speaker */
1343 { 0x16, 0x99030130 }, /* bass speaker */
1344 { 0x17, 0x411111f0 }, /* N/A */
1345 { 0x18, 0x411111f0 }, /* N/A */
1346 { 0x19, 0x01a19950 }, /* mic-in */
1347 { 0x1a, 0x411111f0 }, /* N/A */
1348 { 0x1b, 0x411111f0 }, /* N/A */
1349 { 0x1c, 0x411111f0 }, /* N/A */
1350 { 0x1d, 0x411111f0 }, /* N/A */
1351 { 0x1e, 0x01454140 }, /* SPDIF out */
1352 { }
1353 },
1354 .chained = true,
1355 .chain_id = ALC880_FIXUP_VOL_KNOB,
1356 },
ba533818
TI
1357 [ALC880_FIXUP_F1734] = {
1358 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1359 .type = HDA_FIXUP_PINS,
1360 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1361 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1362 { 0x15, 0x99030120 }, /* speaker */
1363 { 0x16, 0x411111f0 }, /* N/A */
1364 { 0x17, 0x411111f0 }, /* N/A */
1365 { 0x18, 0x411111f0 }, /* N/A */
1366 { 0x19, 0x01a19950 }, /* mic-in */
1367 { 0x1a, 0x411111f0 }, /* N/A */
1368 { 0x1b, 0x411111f0 }, /* N/A */
1369 { 0x1c, 0x411111f0 }, /* N/A */
1370 { 0x1d, 0x411111f0 }, /* N/A */
1371 { 0x1e, 0x411111f0 }, /* N/A */
1372 { }
1373 },
1374 .chained = true,
1375 .chain_id = ALC880_FIXUP_VOL_KNOB,
1376 },
817de92f
TI
1377 [ALC880_FIXUP_UNIWILL] = {
1378 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1379 .type = HDA_FIXUP_PINS,
1380 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1381 { 0x14, 0x0121411f }, /* HP */
1382 { 0x15, 0x99030120 }, /* speaker */
1383 { 0x16, 0x99030130 }, /* bass speaker */
1384 { }
1385 },
1386 },
967b88c4 1387 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1388 .type = HDA_FIXUP_PINS,
1389 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1390 /* disable bogus unused pins */
1391 { 0x17, 0x411111f0 },
1392 { 0x19, 0x411111f0 },
1393 { 0x1b, 0x411111f0 },
1394 { 0x1f, 0x411111f0 },
1395 { }
1396 }
1397 },
96e225f6 1398 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1399 .type = HDA_FIXUP_PINS,
1400 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1401 /* set up the whole pins as BIOS is utterly broken */
1402 { 0x14, 0x99030120 }, /* speaker */
1403 { 0x15, 0x0121411f }, /* HP */
1404 { 0x16, 0x411111f0 }, /* N/A */
1405 { 0x17, 0x411111f0 }, /* N/A */
1406 { 0x18, 0x01a19950 }, /* mic-in */
1407 { 0x19, 0x411111f0 }, /* N/A */
1408 { 0x1a, 0x01813031 }, /* line-in */
1409 { 0x1b, 0x411111f0 }, /* N/A */
1410 { 0x1c, 0x411111f0 }, /* N/A */
1411 { 0x1d, 0x411111f0 }, /* N/A */
1412 { 0x1e, 0x0144111e }, /* SPDIF */
1413 { }
1414 }
1415 },
487a588d
TI
1416 [ALC880_FIXUP_ASUS_W5A] = {
1417 .type = HDA_FIXUP_PINS,
1418 .v.pins = (const struct hda_pintbl[]) {
1419 /* set up the whole pins as BIOS is utterly broken */
1420 { 0x14, 0x0121411f }, /* HP */
1421 { 0x15, 0x411111f0 }, /* N/A */
1422 { 0x16, 0x411111f0 }, /* N/A */
1423 { 0x17, 0x411111f0 }, /* N/A */
1424 { 0x18, 0x90a60160 }, /* mic */
1425 { 0x19, 0x411111f0 }, /* N/A */
1426 { 0x1a, 0x411111f0 }, /* N/A */
1427 { 0x1b, 0x411111f0 }, /* N/A */
1428 { 0x1c, 0x411111f0 }, /* N/A */
1429 { 0x1d, 0x411111f0 }, /* N/A */
1430 { 0x1e, 0xb743111e }, /* SPDIF out */
1431 { }
1432 },
1433 .chained = true,
1434 .chain_id = ALC880_FIXUP_GPIO1,
1435 },
67b6ec31 1436 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1437 .type = HDA_FIXUP_PINS,
1438 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1439 { 0x14, 0x01014010 }, /* line-out */
1440 { 0x15, 0x411111f0 }, /* N/A */
1441 { 0x16, 0x411111f0 }, /* N/A */
1442 { 0x17, 0x411111f0 }, /* N/A */
1443 { 0x18, 0x01a19c30 }, /* mic-in */
1444 { 0x19, 0x0121411f }, /* HP */
1445 { 0x1a, 0x01813031 }, /* line-in */
1446 { 0x1b, 0x02a19c40 }, /* front-mic */
1447 { 0x1c, 0x411111f0 }, /* N/A */
1448 { 0x1d, 0x411111f0 }, /* N/A */
1449 /* 0x1e is filled in below */
1450 { 0x1f, 0x411111f0 }, /* N/A */
1451 { }
1452 }
1453 },
1454 [ALC880_FIXUP_3ST] = {
1727a771
TI
1455 .type = HDA_FIXUP_PINS,
1456 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1457 { 0x1e, 0x411111f0 }, /* N/A */
1458 { }
1459 },
1460 .chained = true,
1461 .chain_id = ALC880_FIXUP_3ST_BASE,
1462 },
1463 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1464 .type = HDA_FIXUP_PINS,
1465 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1466 { 0x1e, 0x0144111e }, /* SPDIF */
1467 { }
1468 },
1469 .chained = true,
1470 .chain_id = ALC880_FIXUP_3ST_BASE,
1471 },
1472 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1473 .type = HDA_FIXUP_PINS,
1474 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1475 { 0x14, 0x01014010 }, /* front */
1476 { 0x15, 0x411111f0 }, /* N/A */
1477 { 0x16, 0x01011411 }, /* CLFE */
1478 { 0x17, 0x01016412 }, /* surr */
1479 { 0x18, 0x01a19c30 }, /* mic-in */
1480 { 0x19, 0x0121411f }, /* HP */
1481 { 0x1a, 0x01813031 }, /* line-in */
1482 { 0x1b, 0x02a19c40 }, /* front-mic */
1483 { 0x1c, 0x411111f0 }, /* N/A */
1484 { 0x1d, 0x411111f0 }, /* N/A */
1485 /* 0x1e is filled in below */
1486 { 0x1f, 0x411111f0 }, /* N/A */
1487 { }
1488 }
1489 },
1490 [ALC880_FIXUP_5ST] = {
1727a771
TI
1491 .type = HDA_FIXUP_PINS,
1492 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1493 { 0x1e, 0x411111f0 }, /* N/A */
1494 { }
1495 },
1496 .chained = true,
1497 .chain_id = ALC880_FIXUP_5ST_BASE,
1498 },
1499 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1500 .type = HDA_FIXUP_PINS,
1501 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1502 { 0x1e, 0x0144111e }, /* SPDIF */
1503 { }
1504 },
1505 .chained = true,
1506 .chain_id = ALC880_FIXUP_5ST_BASE,
1507 },
1508 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1509 .type = HDA_FIXUP_PINS,
1510 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1511 { 0x14, 0x01014010 }, /* front */
1512 { 0x15, 0x01016412 }, /* surr */
1513 { 0x16, 0x01011411 }, /* CLFE */
1514 { 0x17, 0x01012414 }, /* side */
1515 { 0x18, 0x01a19c30 }, /* mic-in */
1516 { 0x19, 0x02a19c40 }, /* front-mic */
1517 { 0x1a, 0x01813031 }, /* line-in */
1518 { 0x1b, 0x0121411f }, /* HP */
1519 { 0x1c, 0x411111f0 }, /* N/A */
1520 { 0x1d, 0x411111f0 }, /* N/A */
1521 /* 0x1e is filled in below */
1522 { 0x1f, 0x411111f0 }, /* N/A */
1523 { }
1524 }
1525 },
1526 [ALC880_FIXUP_6ST] = {
1727a771
TI
1527 .type = HDA_FIXUP_PINS,
1528 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1529 { 0x1e, 0x411111f0 }, /* N/A */
1530 { }
1531 },
1532 .chained = true,
1533 .chain_id = ALC880_FIXUP_6ST_BASE,
1534 },
1535 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1536 .type = HDA_FIXUP_PINS,
1537 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1538 { 0x1e, 0x0144111e }, /* SPDIF */
1539 { }
1540 },
1541 .chained = true,
1542 .chain_id = ALC880_FIXUP_6ST_BASE,
1543 },
5397145f
TI
1544 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1545 .type = HDA_FIXUP_PINS,
1546 .v.pins = (const struct hda_pintbl[]) {
1547 { 0x1b, 0x0121401f }, /* HP with jack detect */
1548 { }
1549 },
1550 .chained_before = true,
1551 .chain_id = ALC880_FIXUP_6ST_BASE,
1552 },
ee3b2969
TI
1553};
1554
1555static const struct snd_pci_quirk alc880_fixup_tbl[] = {
f02aab5d 1556 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1557 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1558 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1559 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1560 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1561 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1562 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1563 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1564 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1565 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1566 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1567 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1568 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1569 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1570 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1571 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1572 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1573 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1574 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1575 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1576 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1577 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1578 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1579
1580 /* Below is the copied entries from alc880_quirks.c.
1581 * It's not quite sure whether BIOS sets the correct pin-config table
1582 * on these machines, thus they are kept to be compatible with
1583 * the old static quirks. Once when it's confirmed to work without
1584 * these overrides, it'd be better to remove.
1585 */
1586 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1587 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1588 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1589 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1590 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1591 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1592 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1593 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1594 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1595 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1596 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1597 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1598 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1599 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1600 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1601 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1602 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1603 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1604 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1605 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1606 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1608 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1609 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1610 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1611 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1613 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1614 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1615 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1616 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1617 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1618 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1619 /* default Intel */
1620 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1621 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1622 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1623 {}
1624};
1625
1727a771 1626static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1627 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1628 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1629 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1630 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1631 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1632 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1633 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1634 {}
1635};
1636
1637
1d045db9
TI
1638/*
1639 * OK, here we have finally the patch for ALC880
1640 */
1d045db9 1641static int patch_alc880(struct hda_codec *codec)
60db6b53 1642{
1d045db9 1643 struct alc_spec *spec;
1d045db9 1644 int err;
f6a92248 1645
3de95173
TI
1646 err = alc_alloc_spec(codec, 0x0b);
1647 if (err < 0)
1648 return err;
64154835 1649
3de95173 1650 spec = codec->spec;
08c189f2 1651 spec->gen.need_dac_fix = 1;
7504b6cd 1652 spec->gen.beep_nid = 0x01;
f53281e6 1653
225068ab
TI
1654 codec->patch_ops.unsol_event = alc880_unsol_event;
1655
c9af753f
TI
1656 alc_pre_init(codec);
1657
1727a771 1658 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1659 alc880_fixups);
1727a771 1660 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1661
67b6ec31
TI
1662 /* automatic parse from the BIOS config */
1663 err = alc880_parse_auto_config(codec);
1664 if (err < 0)
1665 goto error;
fe3eb0a7 1666
fea80fae
TI
1667 if (!spec->gen.no_analog) {
1668 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1669 if (err < 0)
1670 goto error;
1671 }
f53281e6 1672
1727a771 1673 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1674
1d045db9 1675 return 0;
e16fb6d1
TI
1676
1677 error:
1678 alc_free(codec);
1679 return err;
226b1ec8
KY
1680}
1681
1d045db9 1682
60db6b53 1683/*
1d045db9 1684 * ALC260 support
60db6b53 1685 */
1d045db9 1686static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1687{
1d045db9 1688 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1689 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1690 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1691}
1692
1d045db9
TI
1693/*
1694 * Pin config fixes
1695 */
1696enum {
ca8f0424
TI
1697 ALC260_FIXUP_HP_DC5750,
1698 ALC260_FIXUP_HP_PIN_0F,
1699 ALC260_FIXUP_COEF,
15317ab2 1700 ALC260_FIXUP_GPIO1,
20f7d928
TI
1701 ALC260_FIXUP_GPIO1_TOGGLE,
1702 ALC260_FIXUP_REPLACER,
0a1c4fa2 1703 ALC260_FIXUP_HP_B1900,
118cb4a4 1704 ALC260_FIXUP_KN1,
39aedee7 1705 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1706 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1707 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1708};
1709
20f7d928
TI
1710static void alc260_gpio1_automute(struct hda_codec *codec)
1711{
1712 struct alc_spec *spec = codec->spec;
aaf312de
TI
1713
1714 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1715}
1716
1717static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1718 const struct hda_fixup *fix, int action)
20f7d928
TI
1719{
1720 struct alc_spec *spec = codec->spec;
1727a771 1721 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1722 /* although the machine has only one output pin, we need to
1723 * toggle GPIO1 according to the jack state
1724 */
08c189f2
TI
1725 spec->gen.automute_hook = alc260_gpio1_automute;
1726 spec->gen.detect_hp = 1;
1727 spec->gen.automute_speaker = 1;
1728 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1729 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1730 snd_hda_gen_hp_automute);
5579cd6f 1731 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1732 }
1733}
1734
118cb4a4 1735static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1736 const struct hda_fixup *fix, int action)
118cb4a4
TI
1737{
1738 struct alc_spec *spec = codec->spec;
1727a771 1739 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1740 { 0x0f, 0x02214000 }, /* HP/speaker */
1741 { 0x12, 0x90a60160 }, /* int mic */
1742 { 0x13, 0x02a19000 }, /* ext mic */
1743 { 0x18, 0x01446000 }, /* SPDIF out */
1744 /* disable bogus I/O pins */
1745 { 0x10, 0x411111f0 },
1746 { 0x11, 0x411111f0 },
1747 { 0x14, 0x411111f0 },
1748 { 0x15, 0x411111f0 },
1749 { 0x16, 0x411111f0 },
1750 { 0x17, 0x411111f0 },
1751 { 0x19, 0x411111f0 },
1752 { }
1753 };
1754
1755 switch (action) {
1727a771
TI
1756 case HDA_FIXUP_ACT_PRE_PROBE:
1757 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1758 spec->init_amp = ALC_INIT_NONE;
1759 break;
1760 }
1761}
1762
39aedee7
TI
1763static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1764 const struct hda_fixup *fix, int action)
1765{
1766 struct alc_spec *spec = codec->spec;
1c76aa5f 1767 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1768 spec->init_amp = ALC_INIT_NONE;
1769}
39aedee7 1770
5ebd3bbd
TI
1771static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1772 const struct hda_fixup *fix, int action)
1773{
1774 struct alc_spec *spec = codec->spec;
1775 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1776 spec->gen.add_jack_modes = 1;
5ebd3bbd 1777 spec->gen.hp_mic = 1;
e6e0ee50 1778 }
39aedee7
TI
1779}
1780
1727a771 1781static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1782 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1783 .type = HDA_FIXUP_PINS,
1784 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1785 { 0x11, 0x90130110 }, /* speaker */
1786 { }
1787 }
1788 },
ca8f0424 1789 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1790 .type = HDA_FIXUP_PINS,
1791 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1792 { 0x0f, 0x01214000 }, /* HP */
1793 { }
1794 }
1795 },
1796 [ALC260_FIXUP_COEF] = {
1727a771 1797 .type = HDA_FIXUP_VERBS,
ca8f0424 1798 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1799 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1800 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1801 { }
1802 },
ca8f0424 1803 },
15317ab2 1804 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1805 .type = HDA_FIXUP_FUNC,
1806 .v.func = alc_fixup_gpio1,
15317ab2 1807 },
20f7d928 1808 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1809 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1810 .v.func = alc260_fixup_gpio1_toggle,
1811 .chained = true,
1812 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1813 },
1814 [ALC260_FIXUP_REPLACER] = {
1727a771 1815 .type = HDA_FIXUP_VERBS,
20f7d928 1816 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1817 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1818 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1819 { }
1820 },
1821 .chained = true,
1822 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1823 },
0a1c4fa2 1824 [ALC260_FIXUP_HP_B1900] = {
1727a771 1825 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1826 .v.func = alc260_fixup_gpio1_toggle,
1827 .chained = true,
1828 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1829 },
1830 [ALC260_FIXUP_KN1] = {
1727a771 1831 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1832 .v.func = alc260_fixup_kn1,
1833 },
39aedee7
TI
1834 [ALC260_FIXUP_FSC_S7020] = {
1835 .type = HDA_FIXUP_FUNC,
1836 .v.func = alc260_fixup_fsc_s7020,
1837 },
5ebd3bbd
TI
1838 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1839 .type = HDA_FIXUP_FUNC,
1840 .v.func = alc260_fixup_fsc_s7020_jwse,
1841 .chained = true,
1842 .chain_id = ALC260_FIXUP_FSC_S7020,
1843 },
d08c5ef2
TI
1844 [ALC260_FIXUP_VAIO_PINS] = {
1845 .type = HDA_FIXUP_PINS,
1846 .v.pins = (const struct hda_pintbl[]) {
1847 /* Pin configs are missing completely on some VAIOs */
1848 { 0x0f, 0x01211020 },
1849 { 0x10, 0x0001003f },
1850 { 0x11, 0x411111f0 },
1851 { 0x12, 0x01a15930 },
1852 { 0x13, 0x411111f0 },
1853 { 0x14, 0x411111f0 },
1854 { 0x15, 0x411111f0 },
1855 { 0x16, 0x411111f0 },
1856 { 0x17, 0x411111f0 },
1857 { 0x18, 0x411111f0 },
1858 { 0x19, 0x411111f0 },
1859 { }
1860 }
1861 },
1d045db9
TI
1862};
1863
1864static const struct snd_pci_quirk alc260_fixup_tbl[] = {
15317ab2 1865 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1866 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1867 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1868 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1869 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1870 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1871 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1872 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1873 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1874 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1875 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1876 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1877 {}
1878};
1879
5ebd3bbd
TI
1880static const struct hda_model_fixup alc260_fixup_models[] = {
1881 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1882 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1883 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1884 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1885 {}
1886};
1887
1d045db9
TI
1888/*
1889 */
1d045db9 1890static int patch_alc260(struct hda_codec *codec)
977ddd6b 1891{
1d045db9 1892 struct alc_spec *spec;
c3c2c9e7 1893 int err;
1d045db9 1894
3de95173
TI
1895 err = alc_alloc_spec(codec, 0x07);
1896 if (err < 0)
1897 return err;
1d045db9 1898
3de95173 1899 spec = codec->spec;
ea46c3c8
TI
1900 /* as quite a few machines require HP amp for speaker outputs,
1901 * it's easier to enable it unconditionally; even if it's unneeded,
1902 * it's almost harmless.
1903 */
1904 spec->gen.prefer_hp_amp = 1;
7504b6cd 1905 spec->gen.beep_nid = 0x01;
1d045db9 1906
225068ab
TI
1907 spec->shutup = alc_eapd_shutup;
1908
c9af753f
TI
1909 alc_pre_init(codec);
1910
5ebd3bbd
TI
1911 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1912 alc260_fixups);
1727a771 1913 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1914
c3c2c9e7
TI
1915 /* automatic parse from the BIOS config */
1916 err = alc260_parse_auto_config(codec);
1917 if (err < 0)
1918 goto error;
977ddd6b 1919
fea80fae
TI
1920 if (!spec->gen.no_analog) {
1921 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1922 if (err < 0)
1923 goto error;
1924 }
977ddd6b 1925
1727a771 1926 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1927
1d045db9 1928 return 0;
e16fb6d1
TI
1929
1930 error:
1931 alc_free(codec);
1932 return err;
6981d184
TI
1933}
1934
1d045db9
TI
1935
1936/*
1937 * ALC882/883/885/888/889 support
1938 *
1939 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1940 * configuration. Each pin widget can choose any input DACs and a mixer.
1941 * Each ADC is connected from a mixer of all inputs. This makes possible
1942 * 6-channel independent captures.
1943 *
1944 * In addition, an independent DAC for the multi-playback (not used in this
1945 * driver yet).
1946 */
1d045db9
TI
1947
1948/*
1949 * Pin config fixes
1950 */
ff818c24 1951enum {
5c0ebfbe
TI
1952 ALC882_FIXUP_ABIT_AW9D_MAX,
1953 ALC882_FIXUP_LENOVO_Y530,
1954 ALC882_FIXUP_PB_M5210,
1955 ALC882_FIXUP_ACER_ASPIRE_7736,
1956 ALC882_FIXUP_ASUS_W90V,
8f239214 1957 ALC889_FIXUP_CD,
b2c53e20 1958 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1959 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1960 ALC888_FIXUP_EEE1601,
4841b8e6 1961 ALC886_FIXUP_EAPD,
177943a3 1962 ALC882_FIXUP_EAPD,
7a6069bf 1963 ALC883_FIXUP_EAPD,
8812c4f9 1964 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1965 ALC882_FIXUP_GPIO1,
1966 ALC882_FIXUP_GPIO2,
eb844d51 1967 ALC882_FIXUP_GPIO3,
68ef0561
TI
1968 ALC889_FIXUP_COEF,
1969 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1970 ALC882_FIXUP_ACER_ASPIRE_4930G,
1971 ALC882_FIXUP_ACER_ASPIRE_8930G,
1972 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1973 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1974 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1975 ALC889_FIXUP_MBP_VREF,
1976 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1977 ALC889_FIXUP_MBA11_VREF,
0756f09c 1978 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1979 ALC889_FIXUP_MP11_VREF,
9f660a1c 1980 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1981 ALC882_FIXUP_INV_DMIC,
e427c237 1982 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1983 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 1984 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 1985 ALC1220_FIXUP_GB_DUAL_CODECS,
c1933008 1986 ALC1220_FIXUP_GB_X570,
0202f5cd 1987 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
1988 ALC1220_FIXUP_CLEVO_PB51ED,
1989 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
1990 ALC887_FIXUP_ASUS_AUDIO,
1991 ALC887_FIXUP_ASUS_HMIC,
9bfa7b36 1992 ALCS1200A_FIXUP_MIC_VREF,
baaacbff 1993 ALC888VD_FIXUP_MIC_100VREF,
ff818c24
TI
1994};
1995
68ef0561 1996static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 1997 const struct hda_fixup *fix, int action)
68ef0561 1998{
1727a771 1999 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 2000 return;
1df8874b 2001 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
2002}
2003
5671087f
TI
2004/* set up GPIO at initialization */
2005static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 2006 const struct hda_fixup *fix, int action)
5671087f 2007{
215c850c
TI
2008 struct alc_spec *spec = codec->spec;
2009
2010 spec->gpio_write_delay = true;
2011 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
2012}
2013
02a237b2
TI
2014/* Fix the connection of some pins for ALC889:
2015 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2016 * work correctly (bko#42740)
2017 */
2018static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 2019 const struct hda_fixup *fix, int action)
02a237b2 2020{
1727a771 2021 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2022 /* fake the connections during parsing the tree */
caf3c043
MM
2023 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2024 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2025 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2026 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2027 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2028 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2029 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2030 /* restore the connections */
caf3c043
MM
2031 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2032 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2033 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2034 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2035 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2036 }
2037}
2038
1a97b7f2
TI
2039/* Set VREF on HP pin */
2040static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2041 const struct hda_fixup *fix, int action)
1a97b7f2 2042{
caf3c043 2043 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2044 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2045 int i;
2046
1727a771 2047 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2048 return;
2049 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2050 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2051 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2052 continue;
d3f02d60 2053 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2054 val |= AC_PINCTL_VREF_80;
cdd03ced 2055 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2056 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2057 break;
2058 }
2059}
2060
0756f09c
TI
2061static void alc889_fixup_mac_pins(struct hda_codec *codec,
2062 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2063{
2064 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2065 int i;
2066
0756f09c 2067 for (i = 0; i < num_nids; i++) {
1a97b7f2 2068 unsigned int val;
d3f02d60 2069 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2070 val |= AC_PINCTL_VREF_50;
cdd03ced 2071 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2072 }
08c189f2 2073 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2074}
2075
0756f09c
TI
2076/* Set VREF on speaker pins on imac91 */
2077static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2078 const struct hda_fixup *fix, int action)
2079{
caf3c043 2080 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2081
2082 if (action == HDA_FIXUP_ACT_INIT)
2083 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2084}
2085
e7729a41
AV
2086/* Set VREF on speaker pins on mba11 */
2087static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2088 const struct hda_fixup *fix, int action)
2089{
caf3c043 2090 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2091
2092 if (action == HDA_FIXUP_ACT_INIT)
2093 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2094}
2095
0756f09c
TI
2096/* Set VREF on speaker pins on mba21 */
2097static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2098 const struct hda_fixup *fix, int action)
2099{
caf3c043 2100 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2101
2102 if (action == HDA_FIXUP_ACT_INIT)
2103 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2104}
2105
e427c237 2106/* Don't take HP output as primary
d9111496
FLVC
2107 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2108 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2109 */
2110static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2111 const struct hda_fixup *fix, int action)
e427c237
TI
2112{
2113 struct alc_spec *spec = codec->spec;
da96fb5b 2114 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2115 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2116 spec->gen.no_multi_io = 1;
2117 }
e427c237
TI
2118}
2119
eb9ca3ab
TI
2120static void alc_fixup_bass_chmap(struct hda_codec *codec,
2121 const struct hda_fixup *fix, int action);
2122
7beb3a6e
TI
2123/* For dual-codec configuration, we need to disable some features to avoid
2124 * conflicts of kctls and PCM streams
2125 */
2126static void alc_fixup_dual_codecs(struct hda_codec *codec,
2127 const struct hda_fixup *fix, int action)
2128{
2129 struct alc_spec *spec = codec->spec;
2130
2131 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2132 return;
2133 /* disable vmaster */
2134 spec->gen.suppress_vmaster = 1;
2135 /* auto-mute and auto-mic switch don't work with multiple codecs */
2136 spec->gen.suppress_auto_mute = 1;
2137 spec->gen.suppress_auto_mic = 1;
2138 /* disable aamix as well */
2139 spec->gen.mixer_nid = 0;
2140 /* add location prefix to avoid conflicts */
2141 codec->force_pin_prefix = 1;
2142}
2143
2144static void rename_ctl(struct hda_codec *codec, const char *oldname,
2145 const char *newname)
2146{
2147 struct snd_kcontrol *kctl;
2148
2149 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2150 if (kctl)
b51c2253 2151 snd_ctl_rename(codec->card, kctl, newname);
7beb3a6e
TI
2152}
2153
2154static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2155 const struct hda_fixup *fix,
2156 int action)
2157{
2158 alc_fixup_dual_codecs(codec, fix, action);
2159 switch (action) {
2160 case HDA_FIXUP_ACT_PRE_PROBE:
2161 /* override card longname to provide a unique UCM profile */
2162 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2163 break;
2164 case HDA_FIXUP_ACT_BUILD:
2165 /* rename Capture controls depending on the codec */
2166 rename_ctl(codec, "Capture Volume",
2167 codec->addr == 0 ?
2168 "Rear-Panel Capture Volume" :
2169 "Front-Panel Capture Volume");
2170 rename_ctl(codec, "Capture Switch",
2171 codec->addr == 0 ?
2172 "Rear-Panel Capture Switch" :
2173 "Front-Panel Capture Switch");
2174 break;
2175 }
2176}
2177
c1933008
CL
2178static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2179 const struct hda_fixup *fix,
2180 int action)
2181{
2182 static const hda_nid_t conn1[] = { 0x0c };
2183 static const struct coef_fw gb_x570_coefs[] = {
41a86013 2184 WRITE_COEF(0x07, 0x03c0),
c1933008
CL
2185 WRITE_COEF(0x1a, 0x01c1),
2186 WRITE_COEF(0x1b, 0x0202),
2187 WRITE_COEF(0x43, 0x3005),
2188 {}
2189 };
2190
2191 switch (action) {
2192 case HDA_FIXUP_ACT_PRE_PROBE:
2193 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2194 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2195 break;
2196 case HDA_FIXUP_ACT_INIT:
2197 alc_process_coef_fw(codec, gb_x570_coefs);
2198 break;
2199 }
2200}
2201
0202f5cd
P
2202static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2203 const struct hda_fixup *fix,
2204 int action)
2205{
caf3c043 2206 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2207
2208 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2209 return;
2210
2211 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2212 /* We therefore want to make sure 0x14 (front headphone) and
2213 * 0x1b (speakers) use the stereo DAC 0x02
2214 */
caf3c043
MM
2215 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2216 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2217}
2218
7f665b1c
JS
2219static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2220 const struct hda_fixup *fix, int action);
2221
80690a27 2222static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2223 const struct hda_fixup *fix,
2224 int action)
2225{
2226 alc1220_fixup_clevo_p950(codec, fix, action);
2227 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2228}
2229
ca184355
JHP
2230static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2231 struct hda_jack_callback *jack)
2232{
2233 struct alc_spec *spec = codec->spec;
2234 unsigned int vref;
2235
2236 snd_hda_gen_hp_automute(codec, jack);
2237
2238 if (spec->gen.hp_jack_present)
2239 vref = AC_PINCTL_VREF_80;
2240 else
2241 vref = AC_PINCTL_VREF_HIZ;
2242 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2243}
2244
2245static void alc887_fixup_asus_jack(struct hda_codec *codec,
2246 const struct hda_fixup *fix, int action)
2247{
2248 struct alc_spec *spec = codec->spec;
2249 if (action != HDA_FIXUP_ACT_PROBE)
2250 return;
2251 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2252 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2253}
2254
1727a771 2255static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2256 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2257 .type = HDA_FIXUP_PINS,
2258 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2259 { 0x15, 0x01080104 }, /* side */
2260 { 0x16, 0x01011012 }, /* rear */
2261 { 0x17, 0x01016011 }, /* clfe */
2785591a 2262 { }
145a902b
DH
2263 }
2264 },
5c0ebfbe 2265 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2266 .type = HDA_FIXUP_PINS,
2267 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2268 { 0x15, 0x99130112 }, /* rear int speakers */
2269 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2270 { }
2271 }
2272 },
5c0ebfbe 2273 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2274 .type = HDA_FIXUP_PINCTLS,
2275 .v.pins = (const struct hda_pintbl[]) {
2276 { 0x19, PIN_VREF50 },
357f915e
KY
2277 {}
2278 }
2279 },
5c0ebfbe 2280 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2281 .type = HDA_FIXUP_FUNC,
23d30f28 2282 .v.func = alc_fixup_sku_ignore,
6981d184 2283 },
5c0ebfbe 2284 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2285 .type = HDA_FIXUP_PINS,
2286 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2287 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2288 { }
2289 }
2290 },
8f239214 2291 [ALC889_FIXUP_CD] = {
1727a771
TI
2292 .type = HDA_FIXUP_PINS,
2293 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2294 { 0x1c, 0x993301f0 }, /* CD */
2295 { }
2296 }
2297 },
b2c53e20
DH
2298 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2299 .type = HDA_FIXUP_PINS,
2300 .v.pins = (const struct hda_pintbl[]) {
2301 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2302 { }
2303 },
2304 .chained = true,
2305 .chain_id = ALC889_FIXUP_CD,
2306 },
5c0ebfbe 2307 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2308 .type = HDA_FIXUP_PINS,
2309 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2310 { 0x17, 0x90170111 }, /* hidden surround speaker */
2311 { }
2312 }
2313 },
0e7cc2e7 2314 [ALC888_FIXUP_EEE1601] = {
1727a771 2315 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2316 .v.verbs = (const struct hda_verb[]) {
2317 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2318 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2319 { }
2320 }
177943a3 2321 },
4841b8e6
PH
2322 [ALC886_FIXUP_EAPD] = {
2323 .type = HDA_FIXUP_VERBS,
2324 .v.verbs = (const struct hda_verb[]) {
2325 /* change to EAPD mode */
2326 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2327 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2328 { }
2329 }
2330 },
177943a3 2331 [ALC882_FIXUP_EAPD] = {
1727a771 2332 .type = HDA_FIXUP_VERBS,
177943a3
TI
2333 .v.verbs = (const struct hda_verb[]) {
2334 /* change to EAPD mode */
2335 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2336 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2337 { }
2338 }
2339 },
7a6069bf 2340 [ALC883_FIXUP_EAPD] = {
1727a771 2341 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2342 .v.verbs = (const struct hda_verb[]) {
2343 /* change to EAPD mode */
2344 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2345 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2346 { }
2347 }
2348 },
8812c4f9 2349 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2350 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2351 .v.verbs = (const struct hda_verb[]) {
2352 /* eanable EAPD on Acer laptops */
2353 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2354 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2355 { }
2356 }
2357 },
1a97b7f2 2358 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2359 .type = HDA_FIXUP_FUNC,
2360 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2361 },
2362 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2363 .type = HDA_FIXUP_FUNC,
2364 .v.func = alc_fixup_gpio2,
1a97b7f2 2365 },
eb844d51 2366 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2367 .type = HDA_FIXUP_FUNC,
2368 .v.func = alc_fixup_gpio3,
eb844d51 2369 },
68ef0561 2370 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2371 .type = HDA_FIXUP_FUNC,
2372 .v.func = alc_fixup_gpio1,
68ef0561
TI
2373 .chained = true,
2374 .chain_id = ALC882_FIXUP_EAPD,
2375 },
2376 [ALC889_FIXUP_COEF] = {
1727a771 2377 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2378 .v.func = alc889_fixup_coef,
2379 },
c3e837bb 2380 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2381 .type = HDA_FIXUP_PINS,
2382 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2383 { 0x16, 0x99130111 }, /* CLFE speaker */
2384 { 0x17, 0x99130112 }, /* surround speaker */
2385 { }
038d4fef
TI
2386 },
2387 .chained = true,
2388 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2389 },
2390 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2391 .type = HDA_FIXUP_PINS,
2392 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2393 { 0x16, 0x99130111 }, /* CLFE speaker */
2394 { 0x1b, 0x99130112 }, /* surround speaker */
2395 { }
2396 },
2397 .chained = true,
2398 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2399 },
2400 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2401 /* additional init verbs for Acer Aspire 8930G */
1727a771 2402 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2403 .v.verbs = (const struct hda_verb[]) {
2404 /* Enable all DACs */
2405 /* DAC DISABLE/MUTE 1? */
2406 /* setting bits 1-5 disables DAC nids 0x02-0x06
2407 * apparently. Init=0x38 */
2408 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2409 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2410 /* DAC DISABLE/MUTE 2? */
2411 /* some bit here disables the other DACs.
2412 * Init=0x4900 */
2413 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2414 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2415 /* DMIC fix
2416 * This laptop has a stereo digital microphone.
2417 * The mics are only 1cm apart which makes the stereo
2418 * useless. However, either the mic or the ALC889
2419 * makes the signal become a difference/sum signal
2420 * instead of standard stereo, which is annoying.
2421 * So instead we flip this bit which makes the
2422 * codec replicate the sum signal to both channels,
2423 * turning it into a normal mono mic.
2424 */
2425 /* DMIC_CONTROL? Init value = 0x0001 */
2426 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2427 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2428 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2429 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2430 { }
038d4fef
TI
2431 },
2432 .chained = true,
2433 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2434 },
5671087f 2435 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2436 .type = HDA_FIXUP_FUNC,
5671087f
TI
2437 .v.func = alc885_fixup_macpro_gpio,
2438 },
02a237b2 2439 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2440 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2441 .v.func = alc889_fixup_dac_route,
2442 },
1a97b7f2 2443 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2444 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2445 .v.func = alc889_fixup_mbp_vref,
2446 .chained = true,
2447 .chain_id = ALC882_FIXUP_GPIO1,
2448 },
2449 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2450 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2451 .v.func = alc889_fixup_imac91_vref,
2452 .chained = true,
2453 .chain_id = ALC882_FIXUP_GPIO1,
2454 },
e7729a41
AV
2455 [ALC889_FIXUP_MBA11_VREF] = {
2456 .type = HDA_FIXUP_FUNC,
2457 .v.func = alc889_fixup_mba11_vref,
2458 .chained = true,
2459 .chain_id = ALC889_FIXUP_MBP_VREF,
2460 },
0756f09c
TI
2461 [ALC889_FIXUP_MBA21_VREF] = {
2462 .type = HDA_FIXUP_FUNC,
2463 .v.func = alc889_fixup_mba21_vref,
2464 .chained = true,
2465 .chain_id = ALC889_FIXUP_MBP_VREF,
2466 },
c20f31ec
TI
2467 [ALC889_FIXUP_MP11_VREF] = {
2468 .type = HDA_FIXUP_FUNC,
2469 .v.func = alc889_fixup_mba11_vref,
2470 .chained = true,
2471 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2472 },
9f660a1c
MK
2473 [ALC889_FIXUP_MP41_VREF] = {
2474 .type = HDA_FIXUP_FUNC,
2475 .v.func = alc889_fixup_mbp_vref,
2476 .chained = true,
2477 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2478 },
6e72aa5f 2479 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2480 .type = HDA_FIXUP_FUNC,
9d36a7dc 2481 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2482 },
e427c237 2483 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2484 .type = HDA_FIXUP_FUNC,
e427c237
TI
2485 .v.func = alc882_fixup_no_primary_hp,
2486 },
1f0bbf03
TI
2487 [ALC887_FIXUP_ASUS_BASS] = {
2488 .type = HDA_FIXUP_PINS,
2489 .v.pins = (const struct hda_pintbl[]) {
2490 {0x16, 0x99130130}, /* bass speaker */
2491 {}
2492 },
eb9ca3ab
TI
2493 .chained = true,
2494 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2495 },
2496 [ALC887_FIXUP_BASS_CHMAP] = {
2497 .type = HDA_FIXUP_FUNC,
2498 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2499 },
7beb3a6e
TI
2500 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2501 .type = HDA_FIXUP_FUNC,
2502 .v.func = alc1220_fixup_gb_dual_codecs,
2503 },
c1933008
CL
2504 [ALC1220_FIXUP_GB_X570] = {
2505 .type = HDA_FIXUP_FUNC,
2506 .v.func = alc1220_fixup_gb_x570,
2507 },
0202f5cd
P
2508 [ALC1220_FIXUP_CLEVO_P950] = {
2509 .type = HDA_FIXUP_FUNC,
2510 .v.func = alc1220_fixup_clevo_p950,
2511 },
80690a27 2512 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2513 .type = HDA_FIXUP_FUNC,
80690a27 2514 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2515 },
80690a27 2516 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2517 .type = HDA_FIXUP_PINS,
2518 .v.pins = (const struct hda_pintbl[]) {
2519 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2520 {}
2521 },
2522 .chained = true,
80690a27 2523 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2524 },
ca184355
JHP
2525 [ALC887_FIXUP_ASUS_AUDIO] = {
2526 .type = HDA_FIXUP_PINS,
2527 .v.pins = (const struct hda_pintbl[]) {
2528 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2529 { 0x19, 0x22219420 },
2530 {}
2531 },
2532 },
2533 [ALC887_FIXUP_ASUS_HMIC] = {
2534 .type = HDA_FIXUP_FUNC,
2535 .v.func = alc887_fixup_asus_jack,
2536 .chained = true,
2537 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2538 },
9bfa7b36
ML
2539 [ALCS1200A_FIXUP_MIC_VREF] = {
2540 .type = HDA_FIXUP_PINCTLS,
2541 .v.pins = (const struct hda_pintbl[]) {
2542 { 0x18, PIN_VREF50 }, /* rear mic */
2543 { 0x19, PIN_VREF50 }, /* front mic */
2544 {}
2545 }
2546 },
baaacbff
KY
2547 [ALC888VD_FIXUP_MIC_100VREF] = {
2548 .type = HDA_FIXUP_PINCTLS,
2549 .v.pins = (const struct hda_pintbl[]) {
2550 { 0x18, PIN_VREF100 }, /* headset mic */
2551 {}
2552 }
2553 },
ff818c24
TI
2554};
2555
1d045db9 2556static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2557 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2558 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2559 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2560 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2561 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2562 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2563 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2564 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2565 ALC882_FIXUP_ACER_ASPIRE_4930G),
2566 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2567 ALC882_FIXUP_ACER_ASPIRE_4930G),
2568 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2569 ALC882_FIXUP_ACER_ASPIRE_8930G),
2570 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2571 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2572 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2573 ALC882_FIXUP_ACER_ASPIRE_4930G),
2574 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2575 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2576 ALC882_FIXUP_ACER_ASPIRE_4930G),
2577 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2578 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2579 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2580 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2581 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2582 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2583 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2584 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2585 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2586 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2587 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2588 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2589 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2590 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
9bfa7b36 2591 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
b7529c18
TI
2592 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2593 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2594 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2595 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2596 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2597
2598 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2599 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2600 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2601 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2602 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2603 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2604 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2605 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2606 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2607 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2608 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2609 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2610 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2611 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2612 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2613 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2614 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2615 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2616 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2617 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2618 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2619 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2620 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2621
7a6069bf 2622 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
baaacbff 2623 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
4841b8e6 2624 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2625 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2626 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
c1933008 2627 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
ea354196 2628 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
41a86013 2629 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
a0b03952 2630 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2631 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2632 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2633 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2634 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2635 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2636 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2637 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2638 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2639 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2640 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
36d4d213 2641 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2642 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2643 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2644 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2645 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2646 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2647 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
9eb6f5c3 2648 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
b7a58228 2649 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
33affa7f 2650 SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2651 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2653 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
dbfe8350 2654 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
d4995121 2655 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2656 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2657 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2658 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2659 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2660 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2661 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2662 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2663 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2664 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2665 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2666 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2667 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2668 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2669 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2670 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
b7a58228 2671 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
7a6069bf
TI
2672 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2673 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2674 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2675 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2676 {}
2677};
2678
1727a771 2679static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2680 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2681 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2682 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2683 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2684 {.id = ALC889_FIXUP_CD, .name = "cd"},
2685 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2686 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2687 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2688 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2689 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2690 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2691 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2692 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2693 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2694 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2695 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2696 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2697 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2698 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2699 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2700 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2701 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2702 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2703 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2704 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2705 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2706 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2707 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2708 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2709 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
63394a16 2710 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2711 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2712 {}
2713};
2714
119b75c1
HW
2715static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2716 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2717 {0x14, 0x01014010},
2718 {0x15, 0x01011012},
2719 {0x16, 0x01016011},
2720 {0x18, 0x01a19040},
2721 {0x19, 0x02a19050},
2722 {0x1a, 0x0181304f},
2723 {0x1b, 0x0221401f},
2724 {0x1e, 0x01456130}),
2725 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2726 {0x14, 0x01015010},
2727 {0x15, 0x01011012},
2728 {0x16, 0x01011011},
2729 {0x18, 0x01a11040},
2730 {0x19, 0x02a19050},
2731 {0x1a, 0x0181104f},
2732 {0x1b, 0x0221401f},
2733 {0x1e, 0x01451130}),
2734 {}
2735};
2736
f6a92248 2737/*
1d045db9 2738 * BIOS auto configuration
f6a92248 2739 */
1d045db9
TI
2740/* almost identical with ALC880 parser... */
2741static int alc882_parse_auto_config(struct hda_codec *codec)
2742{
1d045db9 2743 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2744 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2745 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2746}
b896b4eb 2747
1d045db9
TI
2748/*
2749 */
1d045db9 2750static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2751{
2752 struct alc_spec *spec;
1a97b7f2 2753 int err;
f6a92248 2754
3de95173
TI
2755 err = alc_alloc_spec(codec, 0x0b);
2756 if (err < 0)
2757 return err;
f6a92248 2758
3de95173 2759 spec = codec->spec;
1f0f4b80 2760
7639a06c 2761 switch (codec->core.vendor_id) {
1d045db9
TI
2762 case 0x10ec0882:
2763 case 0x10ec0885:
acf08081 2764 case 0x10ec0900:
6d9ffcff 2765 case 0x10ec0b00:
a535ad57 2766 case 0x10ec1220:
1d045db9
TI
2767 break;
2768 default:
2769 /* ALC883 and variants */
2770 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2771 break;
c793bec5 2772 }
977ddd6b 2773
c9af753f
TI
2774 alc_pre_init(codec);
2775
1727a771 2776 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2777 alc882_fixups);
119b75c1 2778 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2779 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2780
1d045db9
TI
2781 alc_auto_parse_customize_define(codec);
2782
7504b6cd
TI
2783 if (has_cdefine_beep(codec))
2784 spec->gen.beep_nid = 0x01;
2785
1a97b7f2
TI
2786 /* automatic parse from the BIOS config */
2787 err = alc882_parse_auto_config(codec);
2788 if (err < 0)
2789 goto error;
f6a92248 2790
fea80fae
TI
2791 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2792 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2793 if (err < 0)
2794 goto error;
2795 }
f6a92248 2796
1727a771 2797 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2798
f6a92248 2799 return 0;
e16fb6d1
TI
2800
2801 error:
2802 alc_free(codec);
2803 return err;
f6a92248
KY
2804}
2805
df694daa 2806
df694daa 2807/*
1d045db9 2808 * ALC262 support
df694daa 2809 */
1d045db9 2810static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2811{
1d045db9 2812 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2813 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2814 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2815}
2816
df694daa 2817/*
1d045db9 2818 * Pin config fixes
df694daa 2819 */
cfc9b06f 2820enum {
ea4e7af1 2821 ALC262_FIXUP_FSC_H270,
7513e6da 2822 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2823 ALC262_FIXUP_HP_Z200,
2824 ALC262_FIXUP_TYAN,
c470150c 2825 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2826 ALC262_FIXUP_BENQ,
2827 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2828 ALC262_FIXUP_INV_DMIC,
b5c6611f 2829 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2830};
2831
1727a771 2832static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2833 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2834 .type = HDA_FIXUP_PINS,
2835 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2836 { 0x14, 0x99130110 }, /* speaker */
2837 { 0x15, 0x0221142f }, /* front HP */
2838 { 0x1b, 0x0121141f }, /* rear HP */
2839 { }
2840 }
2841 },
7513e6da
TI
2842 [ALC262_FIXUP_FSC_S7110] = {
2843 .type = HDA_FIXUP_PINS,
2844 .v.pins = (const struct hda_pintbl[]) {
2845 { 0x15, 0x90170110 }, /* speaker */
2846 { }
2847 },
2848 .chained = true,
2849 .chain_id = ALC262_FIXUP_BENQ,
2850 },
ea4e7af1 2851 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2852 .type = HDA_FIXUP_PINS,
2853 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2854 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2855 { }
2856 }
cfc9b06f 2857 },
ea4e7af1 2858 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2859 .type = HDA_FIXUP_PINS,
2860 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2861 { 0x14, 0x1993e1f0 }, /* int AUX */
2862 { }
2863 }
2864 },
c470150c 2865 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2866 .type = HDA_FIXUP_PINCTLS,
2867 .v.pins = (const struct hda_pintbl[]) {
2868 { 0x19, PIN_VREF50 },
b42590b8
TI
2869 {}
2870 },
2871 .chained = true,
2872 .chain_id = ALC262_FIXUP_BENQ,
2873 },
2874 [ALC262_FIXUP_BENQ] = {
1727a771 2875 .type = HDA_FIXUP_VERBS,
b42590b8 2876 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2877 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2878 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2879 {}
2880 }
2881 },
b42590b8 2882 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2883 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2884 .v.verbs = (const struct hda_verb[]) {
2885 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2886 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2887 {}
2888 }
2889 },
6e72aa5f 2890 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2891 .type = HDA_FIXUP_FUNC,
9d36a7dc 2892 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2893 },
b5c6611f
ML
2894 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2895 .type = HDA_FIXUP_FUNC,
2896 .v.func = alc_fixup_no_depop_delay,
2897 },
cfc9b06f
TI
2898};
2899
1d045db9 2900static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2901 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2902 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2903 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2904 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2905 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2906 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2907 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2908 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2909 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2910 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2911 {}
2912};
df694daa 2913
1727a771 2914static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2915 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2916 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2917 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2918 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2919 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2920 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2921 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2922 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2923 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2924 {}
2925};
1d045db9 2926
1d045db9
TI
2927/*
2928 */
1d045db9 2929static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2930{
2931 struct alc_spec *spec;
df694daa
KY
2932 int err;
2933
3de95173
TI
2934 err = alc_alloc_spec(codec, 0x0b);
2935 if (err < 0)
2936 return err;
df694daa 2937
3de95173 2938 spec = codec->spec;
08c189f2 2939 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2940
225068ab
TI
2941 spec->shutup = alc_eapd_shutup;
2942
1d045db9
TI
2943#if 0
2944 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2945 * under-run
2946 */
98b24883 2947 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2948#endif
1d045db9
TI
2949 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2950
c9af753f
TI
2951 alc_pre_init(codec);
2952
1727a771 2953 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2954 alc262_fixups);
1727a771 2955 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2956
af741c15
TI
2957 alc_auto_parse_customize_define(codec);
2958
7504b6cd
TI
2959 if (has_cdefine_beep(codec))
2960 spec->gen.beep_nid = 0x01;
2961
42399f7a
TI
2962 /* automatic parse from the BIOS config */
2963 err = alc262_parse_auto_config(codec);
2964 if (err < 0)
2965 goto error;
df694daa 2966
fea80fae
TI
2967 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2968 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2969 if (err < 0)
2970 goto error;
2971 }
2134ea4f 2972
1727a771 2973 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2974
1da177e4 2975 return 0;
e16fb6d1
TI
2976
2977 error:
2978 alc_free(codec);
2979 return err;
1da177e4
LT
2980}
2981
f32610ed 2982/*
1d045db9 2983 * ALC268
f32610ed 2984 */
1d045db9 2985/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2986static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2987 struct snd_ctl_elem_value *ucontrol)
2988{
2989 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2990 unsigned long pval;
2991 int err;
2992
2993 mutex_lock(&codec->control_mutex);
2994 pval = kcontrol->private_value;
2995 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2996 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2997 if (err >= 0) {
2998 kcontrol->private_value = (pval & ~0xff) | 0x10;
2999 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
3000 }
3001 kcontrol->private_value = pval;
3002 mutex_unlock(&codec->control_mutex);
3003 return err;
3004}
f32610ed 3005
1d045db9
TI
3006static const struct snd_kcontrol_new alc268_beep_mixer[] = {
3007 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
3008 {
3009 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3010 .name = "Beep Playback Switch",
3011 .subdevice = HDA_SUBDEV_AMP_FLAG,
3012 .info = snd_hda_mixer_amp_switch_info,
3013 .get = snd_hda_mixer_amp_switch_get,
3014 .put = alc268_beep_switch_put,
3015 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
3016 },
f32610ed
JS
3017};
3018
1d045db9
TI
3019/* set PCBEEP vol = 0, mute connections */
3020static const struct hda_verb alc268_beep_init_verbs[] = {
3021 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3022 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3023 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3024 { }
f32610ed
JS
3025};
3026
6e72aa5f
TI
3027enum {
3028 ALC268_FIXUP_INV_DMIC,
cb766404 3029 ALC268_FIXUP_HP_EAPD,
24eff328 3030 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
3031};
3032
1727a771 3033static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 3034 [ALC268_FIXUP_INV_DMIC] = {
1727a771 3035 .type = HDA_FIXUP_FUNC,
9d36a7dc 3036 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3037 },
cb766404 3038 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3039 .type = HDA_FIXUP_VERBS,
cb766404
TI
3040 .v.verbs = (const struct hda_verb[]) {
3041 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3042 {}
3043 }
3044 },
24eff328
TI
3045 [ALC268_FIXUP_SPDIF] = {
3046 .type = HDA_FIXUP_PINS,
3047 .v.pins = (const struct hda_pintbl[]) {
3048 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3049 {}
3050 }
3051 },
6e72aa5f
TI
3052};
3053
1727a771 3054static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3055 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3056 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3057 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3058 {}
3059};
3060
3061static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3062 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3063 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3064 /* below is codec SSID since multiple Toshiba laptops have the
3065 * same PCI SSID 1179:ff00
3066 */
3067 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3068 {}
3069};
3070
f32610ed
JS
3071/*
3072 * BIOS auto configuration
3073 */
1d045db9 3074static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3075{
3e6179b8 3076 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3077 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3078}
3079
1d045db9
TI
3080/*
3081 */
1d045db9 3082static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3083{
3084 struct alc_spec *spec;
a5cb463a 3085 int i, err;
f32610ed 3086
1d045db9 3087 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3088 err = alc_alloc_spec(codec, 0);
3089 if (err < 0)
3090 return err;
3091
3092 spec = codec->spec;
2722b535
TI
3093 if (has_cdefine_beep(codec))
3094 spec->gen.beep_nid = 0x01;
1f0f4b80 3095
225068ab
TI
3096 spec->shutup = alc_eapd_shutup;
3097
c9af753f
TI
3098 alc_pre_init(codec);
3099
1727a771
TI
3100 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3101 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3102
6ebb8053
TI
3103 /* automatic parse from the BIOS config */
3104 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3105 if (err < 0)
3106 goto error;
f32610ed 3107
7504b6cd
TI
3108 if (err > 0 && !spec->gen.no_analog &&
3109 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3110 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3111 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3112 &alc268_beep_mixer[i])) {
3113 err = -ENOMEM;
3114 goto error;
3115 }
3116 }
7504b6cd 3117 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3118 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3119 /* override the amp caps for beep generator */
3120 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3121 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3122 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3123 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3124 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3125 }
3126
1727a771 3127 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3128
f32610ed 3129 return 0;
e16fb6d1
TI
3130
3131 error:
3132 alc_free(codec);
3133 return err;
f32610ed
JS
3134}
3135
bc9f98a9 3136/*
1d045db9 3137 * ALC269
bc9f98a9 3138 */
08c189f2 3139
1d045db9 3140static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3141 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3142};
3143
1d045db9 3144static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3145 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3146};
291702f0 3147
1d045db9
TI
3148/* different alc269-variants */
3149enum {
3150 ALC269_TYPE_ALC269VA,
3151 ALC269_TYPE_ALC269VB,
3152 ALC269_TYPE_ALC269VC,
adcc70b2 3153 ALC269_TYPE_ALC269VD,
065380f0
KY
3154 ALC269_TYPE_ALC280,
3155 ALC269_TYPE_ALC282,
2af02be7 3156 ALC269_TYPE_ALC283,
065380f0 3157 ALC269_TYPE_ALC284,
4731d5de 3158 ALC269_TYPE_ALC293,
7fc7d047 3159 ALC269_TYPE_ALC286,
506b62c3 3160 ALC269_TYPE_ALC298,
1d04c9de 3161 ALC269_TYPE_ALC255,
4344aec8 3162 ALC269_TYPE_ALC256,
f429e7e4 3163 ALC269_TYPE_ALC257,
0a6f0600 3164 ALC269_TYPE_ALC215,
4231430d 3165 ALC269_TYPE_ALC225,
60571929 3166 ALC269_TYPE_ALC245,
99cee034 3167 ALC269_TYPE_ALC287,
dcd4f0db 3168 ALC269_TYPE_ALC294,
1078bef0 3169 ALC269_TYPE_ALC300,
f0778871 3170 ALC269_TYPE_ALC623,
6fbae35a 3171 ALC269_TYPE_ALC700,
bc9f98a9
KY
3172};
3173
3174/*
1d045db9 3175 * BIOS auto configuration
bc9f98a9 3176 */
1d045db9
TI
3177static int alc269_parse_auto_config(struct hda_codec *codec)
3178{
1d045db9 3179 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3180 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3181 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3182 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3183 const hda_nid_t *ssids;
3184
3185 switch (spec->codec_variant) {
3186 case ALC269_TYPE_ALC269VA:
3187 case ALC269_TYPE_ALC269VC:
065380f0
KY
3188 case ALC269_TYPE_ALC280:
3189 case ALC269_TYPE_ALC284:
4731d5de 3190 case ALC269_TYPE_ALC293:
adcc70b2
KY
3191 ssids = alc269va_ssids;
3192 break;
3193 case ALC269_TYPE_ALC269VB:
3194 case ALC269_TYPE_ALC269VD:
065380f0 3195 case ALC269_TYPE_ALC282:
2af02be7 3196 case ALC269_TYPE_ALC283:
7fc7d047 3197 case ALC269_TYPE_ALC286:
506b62c3 3198 case ALC269_TYPE_ALC298:
1d04c9de 3199 case ALC269_TYPE_ALC255:
4344aec8 3200 case ALC269_TYPE_ALC256:
f429e7e4 3201 case ALC269_TYPE_ALC257:
0a6f0600 3202 case ALC269_TYPE_ALC215:
4231430d 3203 case ALC269_TYPE_ALC225:
60571929 3204 case ALC269_TYPE_ALC245:
99cee034 3205 case ALC269_TYPE_ALC287:
dcd4f0db 3206 case ALC269_TYPE_ALC294:
1078bef0 3207 case ALC269_TYPE_ALC300:
f0778871 3208 case ALC269_TYPE_ALC623:
6fbae35a 3209 case ALC269_TYPE_ALC700:
adcc70b2
KY
3210 ssids = alc269_ssids;
3211 break;
3212 default:
3213 ssids = alc269_ssids;
3214 break;
3215 }
bc9f98a9 3216
3e6179b8 3217 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3218}
bc9f98a9 3219
476c02e0
HW
3220static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3221 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3222 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3223 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3224 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3225 {}
3226};
3227
3228static void alc_headset_btn_callback(struct hda_codec *codec,
3229 struct hda_jack_callback *jack)
3230{
3231 int report = 0;
3232
3233 if (jack->unsol_res & (7 << 13))
3234 report |= SND_JACK_BTN_0;
3235
3236 if (jack->unsol_res & (1 << 16 | 3 << 8))
3237 report |= SND_JACK_BTN_1;
3238
3239 /* Volume up key */
3240 if (jack->unsol_res & (7 << 23))
3241 report |= SND_JACK_BTN_2;
3242
3243 /* Volume down key */
3244 if (jack->unsol_res & (7 << 10))
3245 report |= SND_JACK_BTN_3;
3246
04f7791b 3247 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3248}
3249
3250static void alc_disable_headset_jack_key(struct hda_codec *codec)
3251{
3252 struct alc_spec *spec = codec->spec;
3253
3254 if (!spec->has_hs_key)
3255 return;
3256
3257 switch (codec->core.vendor_id) {
3258 case 0x10ec0215:
3259 case 0x10ec0225:
3260 case 0x10ec0285:
c72b9bfe 3261 case 0x10ec0287:
476c02e0
HW
3262 case 0x10ec0295:
3263 case 0x10ec0289:
3264 case 0x10ec0299:
3265 alc_write_coef_idx(codec, 0x48, 0x0);
3266 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3267 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3268 break;
1948fc06 3269 case 0x10ec0230:
476c02e0
HW
3270 case 0x10ec0236:
3271 case 0x10ec0256:
cae2bdb5 3272 case 0x10ec0257:
527f4643 3273 case 0x19e58326:
476c02e0
HW
3274 alc_write_coef_idx(codec, 0x48, 0x0);
3275 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3276 break;
3277 }
3278}
3279
3280static void alc_enable_headset_jack_key(struct hda_codec *codec)
3281{
3282 struct alc_spec *spec = codec->spec;
3283
3284 if (!spec->has_hs_key)
3285 return;
3286
3287 switch (codec->core.vendor_id) {
3288 case 0x10ec0215:
3289 case 0x10ec0225:
3290 case 0x10ec0285:
c72b9bfe 3291 case 0x10ec0287:
476c02e0
HW
3292 case 0x10ec0295:
3293 case 0x10ec0289:
3294 case 0x10ec0299:
3295 alc_write_coef_idx(codec, 0x48, 0xd011);
3296 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3297 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3298 break;
1948fc06 3299 case 0x10ec0230:
476c02e0
HW
3300 case 0x10ec0236:
3301 case 0x10ec0256:
cae2bdb5 3302 case 0x10ec0257:
527f4643 3303 case 0x19e58326:
476c02e0
HW
3304 alc_write_coef_idx(codec, 0x48, 0xd011);
3305 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3306 break;
3307 }
3308}
3309
3310static void alc_fixup_headset_jack(struct hda_codec *codec,
3311 const struct hda_fixup *fix, int action)
3312{
3313 struct alc_spec *spec = codec->spec;
04f7791b 3314 hda_nid_t hp_pin;
476c02e0
HW
3315
3316 switch (action) {
3317 case HDA_FIXUP_ACT_PRE_PROBE:
3318 spec->has_hs_key = 1;
3319 snd_hda_jack_detect_enable_callback(codec, 0x55,
3320 alc_headset_btn_callback);
476c02e0 3321 break;
04f7791b
HW
3322 case HDA_FIXUP_ACT_BUILD:
3323 hp_pin = alc_get_hp_pin(spec);
3324 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3325 alc_headset_btn_keymap,
3326 hp_pin))
3327 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3328 false, SND_JACK_HEADSET,
3329 alc_headset_btn_keymap);
3330
476c02e0
HW
3331 alc_enable_headset_jack_key(codec);
3332 break;
3333 }
3334}
3335
1387e2d1 3336static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3337{
98b24883 3338 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3339}
291702f0 3340
1d045db9
TI
3341static void alc269_shutup(struct hda_codec *codec)
3342{
adcc70b2
KY
3343 struct alc_spec *spec = codec->spec;
3344
1387e2d1
KY
3345 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3346 alc269vb_toggle_power_output(codec, 0);
3347 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3348 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3349 msleep(150);
3350 }
c0ca5ece 3351 alc_shutup_pins(codec);
1d045db9 3352}
291702f0 3353
6b0f95c4 3354static const struct coef_fw alc282_coefs[] = {
54db6c39 3355 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3356 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3357 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3358 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3359 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3360 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3361 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3362 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3363 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3364 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3365 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3366 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3367 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3368 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3369 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3370 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3371 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3372 WRITE_COEF(0x63, 0x2902), /* PLL */
3373 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3374 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3375 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3376 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3377 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3378 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3379 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3380 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3381 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3382 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3383 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3384 {}
3385};
3386
cb149cb3
KY
3387static void alc282_restore_default_value(struct hda_codec *codec)
3388{
54db6c39 3389 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3390}
3391
7b5c7a02
KY
3392static void alc282_init(struct hda_codec *codec)
3393{
3394 struct alc_spec *spec = codec->spec;
35a39f98 3395 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3396 bool hp_pin_sense;
3397 int coef78;
3398
cb149cb3
KY
3399 alc282_restore_default_value(codec);
3400
7b5c7a02
KY
3401 if (!hp_pin)
3402 return;
3403 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3404 coef78 = alc_read_coef_idx(codec, 0x78);
3405
3406 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3407 /* Headphone capless set to high power mode */
3408 alc_write_coef_idx(codec, 0x78, 0x9004);
3409
3410 if (hp_pin_sense)
3411 msleep(2);
3412
3413 snd_hda_codec_write(codec, hp_pin, 0,
3414 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3415
3416 if (hp_pin_sense)
3417 msleep(85);
3418
3419 snd_hda_codec_write(codec, hp_pin, 0,
3420 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3421
3422 if (hp_pin_sense)
3423 msleep(100);
3424
3425 /* Headphone capless set to normal mode */
3426 alc_write_coef_idx(codec, 0x78, coef78);
3427}
3428
3429static void alc282_shutup(struct hda_codec *codec)
3430{
3431 struct alc_spec *spec = codec->spec;
35a39f98 3432 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3433 bool hp_pin_sense;
3434 int coef78;
3435
3436 if (!hp_pin) {
3437 alc269_shutup(codec);
3438 return;
3439 }
3440
3441 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3442 coef78 = alc_read_coef_idx(codec, 0x78);
3443 alc_write_coef_idx(codec, 0x78, 0x9004);
3444
3445 if (hp_pin_sense)
3446 msleep(2);
3447
3448 snd_hda_codec_write(codec, hp_pin, 0,
3449 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3450
3451 if (hp_pin_sense)
3452 msleep(85);
3453
c0ca5ece
TI
3454 if (!spec->no_shutup_pins)
3455 snd_hda_codec_write(codec, hp_pin, 0,
3456 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3457
3458 if (hp_pin_sense)
3459 msleep(100);
3460
3461 alc_auto_setup_eapd(codec, false);
c0ca5ece 3462 alc_shutup_pins(codec);
7b5c7a02
KY
3463 alc_write_coef_idx(codec, 0x78, coef78);
3464}
3465
6b0f95c4 3466static const struct coef_fw alc283_coefs[] = {
54db6c39 3467 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3468 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3469 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3470 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3471 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3472 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3473 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3474 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3475 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3476 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3477 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3478 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3479 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3480 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3481 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3482 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3483 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3484 WRITE_COEF(0x2e, 0x2902), /* PLL */
3485 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3486 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3487 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3488 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3489 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3490 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3491 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3492 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3493 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3494 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3495 WRITE_COEF(0x49, 0x0), /* test mode */
3496 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3497 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3498 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3499 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3500 {}
3501};
3502
6bd55b04
KY
3503static void alc283_restore_default_value(struct hda_codec *codec)
3504{
54db6c39 3505 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3506}
3507
2af02be7
KY
3508static void alc283_init(struct hda_codec *codec)
3509{
3510 struct alc_spec *spec = codec->spec;
35a39f98 3511 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3512 bool hp_pin_sense;
2af02be7 3513
6bd55b04
KY
3514 alc283_restore_default_value(codec);
3515
2af02be7
KY
3516 if (!hp_pin)
3517 return;
a59d7199
KY
3518
3519 msleep(30);
2af02be7
KY
3520 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3521
3522 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3523 /* Headphone capless set to high power mode */
3524 alc_write_coef_idx(codec, 0x43, 0x9004);
3525
3526 snd_hda_codec_write(codec, hp_pin, 0,
3527 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3528
3529 if (hp_pin_sense)
3530 msleep(85);
3531
3532 snd_hda_codec_write(codec, hp_pin, 0,
3533 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3534
3535 if (hp_pin_sense)
3536 msleep(85);
3537 /* Index 0x46 Combo jack auto switch control 2 */
3538 /* 3k pull low control for Headset jack. */
98b24883 3539 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3540 /* Headphone capless set to normal mode */
3541 alc_write_coef_idx(codec, 0x43, 0x9614);
3542}
3543
3544static void alc283_shutup(struct hda_codec *codec)
3545{
3546 struct alc_spec *spec = codec->spec;
35a39f98 3547 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3548 bool hp_pin_sense;
2af02be7
KY
3549
3550 if (!hp_pin) {
3551 alc269_shutup(codec);
3552 return;
3553 }
3554
3555 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3556
3557 alc_write_coef_idx(codec, 0x43, 0x9004);
3558
b450b17c
HP
3559 /*depop hp during suspend*/
3560 alc_write_coef_idx(codec, 0x06, 0x2100);
3561
2af02be7
KY
3562 snd_hda_codec_write(codec, hp_pin, 0,
3563 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3564
3565 if (hp_pin_sense)
88011c09 3566 msleep(100);
2af02be7 3567
c0ca5ece
TI
3568 if (!spec->no_shutup_pins)
3569 snd_hda_codec_write(codec, hp_pin, 0,
3570 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3571
98b24883 3572 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3573
3574 if (hp_pin_sense)
88011c09 3575 msleep(100);
0435b3ff 3576 alc_auto_setup_eapd(codec, false);
c0ca5ece 3577 alc_shutup_pins(codec);
2af02be7
KY
3578 alc_write_coef_idx(codec, 0x43, 0x9614);
3579}
3580
4a219ef8
KY
3581static void alc256_init(struct hda_codec *codec)
3582{
3583 struct alc_spec *spec = codec->spec;
35a39f98 3584 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3585 bool hp_pin_sense;
3586
1f680609
YY
3587 if (spec->ultra_low_power) {
3588 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3589 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3590 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3591 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3592 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3593 msleep(30);
3594 }
3595
4a219ef8 3596 if (!hp_pin)
6447c962 3597 hp_pin = 0x21;
4a219ef8
KY
3598
3599 msleep(30);
3600
3601 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3602
3603 if (hp_pin_sense)
3604 msleep(2);
3605
3606 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3607
3608 snd_hda_codec_write(codec, hp_pin, 0,
3609 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3610
6447c962 3611 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3612 msleep(85);
3613
3614 snd_hda_codec_write(codec, hp_pin, 0,
3615 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3616
6447c962 3617 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3618 msleep(100);
3619
3620 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3621 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3622 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3623 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3624 /*
3625 * Expose headphone mic (or possibly Line In on some machines) instead
3626 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3627 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3628 * this register.
3629 */
3630 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3631}
3632
3633static void alc256_shutup(struct hda_codec *codec)
3634{
3635 struct alc_spec *spec = codec->spec;
35a39f98 3636 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3637 bool hp_pin_sense;
3638
6447c962
KY
3639 if (!hp_pin)
3640 hp_pin = 0x21;
4a219ef8 3641
69ea4c9d 3642 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
4a219ef8
KY
3643 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3644
3645 if (hp_pin_sense)
3646 msleep(2);
3647
3648 snd_hda_codec_write(codec, hp_pin, 0,
3649 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3650
6447c962 3651 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3652 msleep(85);
3653
1c9609e3
TI
3654 /* 3k pull low control for Headset jack. */
3655 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3656 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3657 * when booting with headset plugged. So skip setting it for the codec alc257
3658 */
69ea4c9d 3659 if (spec->en_3kpull_low)
3f742490 3660 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3661
c0ca5ece
TI
3662 if (!spec->no_shutup_pins)
3663 snd_hda_codec_write(codec, hp_pin, 0,
3664 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3665
6447c962 3666 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3667 msleep(100);
3668
3669 alc_auto_setup_eapd(codec, false);
c0ca5ece 3670 alc_shutup_pins(codec);
6447c962
KY
3671 if (spec->ultra_low_power) {
3672 msleep(50);
3673 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3674 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3675 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3676 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3677 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3678 msleep(30);
3679 }
4a219ef8
KY
3680}
3681
3c24e483
KY
3682static void alc285_hp_init(struct hda_codec *codec)
3683{
3684 struct alc_spec *spec = codec->spec;
3685 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3686 int i, val;
3687 int coef38, coef0d, coef36;
3688
b34bf658 3689 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
3c24e483
KY
3690 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3691 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3692 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3693 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3694 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3695 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3696
3697 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3698
3699 if (hp_pin)
3700 snd_hda_codec_write(codec, hp_pin, 0,
3701 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3702
3703 msleep(130);
3704 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3705 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3706
3707 if (hp_pin)
3708 snd_hda_codec_write(codec, hp_pin, 0,
3709 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3710 msleep(10);
3711 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3712 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3713 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3714 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3715
3716 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3717 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3718 for (i = 0; i < 20 && val & 0x8000; i++) {
3719 msleep(50);
3720 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3721 } /* Wait for depop procedure finish */
3722
3723 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3724 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3725 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3726 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3727
3728 msleep(50);
3729 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3730}
3731
da911b1f
KY
3732static void alc225_init(struct hda_codec *codec)
3733{
3734 struct alc_spec *spec = codec->spec;
35a39f98 3735 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3736 bool hp1_pin_sense, hp2_pin_sense;
3737
1f680609
YY
3738 if (spec->ultra_low_power) {
3739 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3740 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3741 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3742 msleep(30);
3743 }
3744
60571929
KY
3745 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3746 spec->codec_variant != ALC269_TYPE_ALC245)
3c24e483
KY
3747 /* required only at boot or S3 and S4 resume time */
3748 if (!spec->done_hp_init ||
3749 is_s3_resume(codec) ||
3750 is_s4_resume(codec)) {
3751 alc285_hp_init(codec);
3752 spec->done_hp_init = true;
3753 }
3754
da911b1f 3755 if (!hp_pin)
d3ba58bb 3756 hp_pin = 0x21;
da911b1f
KY
3757 msleep(30);
3758
3759 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3760 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3761
3762 if (hp1_pin_sense || hp2_pin_sense)
3763 msleep(2);
3764
3765 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3766
d3ba58bb 3767 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3768 snd_hda_codec_write(codec, hp_pin, 0,
3769 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3770 if (hp2_pin_sense)
3771 snd_hda_codec_write(codec, 0x16, 0,
3772 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3773
d3ba58bb 3774 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3775 msleep(85);
3776
d3ba58bb 3777 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3778 snd_hda_codec_write(codec, hp_pin, 0,
3779 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3780 if (hp2_pin_sense)
3781 snd_hda_codec_write(codec, 0x16, 0,
3782 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3783
d3ba58bb 3784 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3785 msleep(100);
3786
3787 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3788 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3789}
3790
3791static void alc225_shutup(struct hda_codec *codec)
3792{
3793 struct alc_spec *spec = codec->spec;
35a39f98 3794 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3795 bool hp1_pin_sense, hp2_pin_sense;
3796
d3ba58bb
KY
3797 if (!hp_pin)
3798 hp_pin = 0x21;
476c02e0
HW
3799
3800 alc_disable_headset_jack_key(codec);
da911b1f
KY
3801 /* 3k pull low control for Headset jack. */
3802 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3803
3804 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3805 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3806
3807 if (hp1_pin_sense || hp2_pin_sense)
3808 msleep(2);
3809
d3ba58bb 3810 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3811 snd_hda_codec_write(codec, hp_pin, 0,
3812 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3813 if (hp2_pin_sense)
3814 snd_hda_codec_write(codec, 0x16, 0,
3815 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3816
d3ba58bb 3817 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3818 msleep(85);
3819
d3ba58bb 3820 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3821 snd_hda_codec_write(codec, hp_pin, 0,
3822 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3823 if (hp2_pin_sense)
3824 snd_hda_codec_write(codec, 0x16, 0,
3825 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3826
d3ba58bb 3827 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3828 msleep(100);
3829
3830 alc_auto_setup_eapd(codec, false);
c0ca5ece 3831 alc_shutup_pins(codec);
d3ba58bb
KY
3832 if (spec->ultra_low_power) {
3833 msleep(50);
3834 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3835 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3836 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3837 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3838 msleep(30);
3839 }
476c02e0
HW
3840
3841 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3842 alc_enable_headset_jack_key(codec);
da911b1f
KY
3843}
3844
c2d6af53
KY
3845static void alc_default_init(struct hda_codec *codec)
3846{
3847 struct alc_spec *spec = codec->spec;
35a39f98 3848 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3849 bool hp_pin_sense;
3850
3851 if (!hp_pin)
3852 return;
3853
3854 msleep(30);
3855
3856 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3857
3858 if (hp_pin_sense)
3859 msleep(2);
3860
3861 snd_hda_codec_write(codec, hp_pin, 0,
3862 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3863
3864 if (hp_pin_sense)
3865 msleep(85);
3866
3867 snd_hda_codec_write(codec, hp_pin, 0,
3868 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3869
3870 if (hp_pin_sense)
3871 msleep(100);
3872}
3873
3874static void alc_default_shutup(struct hda_codec *codec)
3875{
3876 struct alc_spec *spec = codec->spec;
35a39f98 3877 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3878 bool hp_pin_sense;
3879
3880 if (!hp_pin) {
3881 alc269_shutup(codec);
3882 return;
3883 }
3884
3885 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3886
3887 if (hp_pin_sense)
3888 msleep(2);
3889
3890 snd_hda_codec_write(codec, hp_pin, 0,
3891 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3892
3893 if (hp_pin_sense)
3894 msleep(85);
3895
c0ca5ece
TI
3896 if (!spec->no_shutup_pins)
3897 snd_hda_codec_write(codec, hp_pin, 0,
3898 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3899
3900 if (hp_pin_sense)
3901 msleep(100);
3902
3903 alc_auto_setup_eapd(codec, false);
c0ca5ece 3904 alc_shutup_pins(codec);
c2d6af53
KY
3905}
3906
693abe11
KY
3907static void alc294_hp_init(struct hda_codec *codec)
3908{
3909 struct alc_spec *spec = codec->spec;
35a39f98 3910 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3911 int i, val;
3912
3913 if (!hp_pin)
3914 return;
3915
3916 snd_hda_codec_write(codec, hp_pin, 0,
3917 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3918
3919 msleep(100);
3920
c0ca5ece
TI
3921 if (!spec->no_shutup_pins)
3922 snd_hda_codec_write(codec, hp_pin, 0,
3923 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3924
3925 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3926 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3927
3928 /* Wait for depop procedure finish */
3929 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3930 for (i = 0; i < 20 && val & 0x0080; i++) {
3931 msleep(50);
3932 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3933 }
3934 /* Set HP depop to auto mode */
3935 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3936 msleep(50);
3937}
3938
3939static void alc294_init(struct hda_codec *codec)
3940{
3941 struct alc_spec *spec = codec->spec;
3942
f6ef4e0e
TI
3943 /* required only at boot or S4 resume time */
3944 if (!spec->done_hp_init ||
3945 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3946 alc294_hp_init(codec);
3947 spec->done_hp_init = true;
3948 }
3949 alc_default_init(codec);
3950}
3951
ad60d502
KY
3952static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3953 unsigned int val)
3954{
3955 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3956 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3957 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3958}
3959
3960static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3961{
3962 unsigned int val;
3963
3964 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3965 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3966 & 0xffff;
3967 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3968 << 16;
3969 return val;
3970}
3971
3972static void alc5505_dsp_halt(struct hda_codec *codec)
3973{
3974 unsigned int val;
3975
3976 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3977 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3978 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3979 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3980 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3981 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3982 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3983 val = alc5505_coef_get(codec, 0x6220);
3984 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3985}
3986
3987static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3988{
3989 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3990 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3991 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3992 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3993 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3994 alc5505_coef_set(codec, 0x880c, 0x00000004);
3995}
3996
3997static void alc5505_dsp_init(struct hda_codec *codec)
3998{
3999 unsigned int val;
4000
4001 alc5505_dsp_halt(codec);
4002 alc5505_dsp_back_from_halt(codec);
4003 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
4004 alc5505_coef_set(codec, 0x61b0, 0x5b16);
4005 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
4006 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
4007 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
4008 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
4009 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
4010 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
4011 alc5505_coef_set(codec, 0x61b8, 0x04173302);
4012 alc5505_coef_set(codec, 0x61b8, 0x04163302);
4013 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
4014 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
4015 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
4016
4017 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
4018 if (val <= 3)
4019 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
4020 else
4021 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4022
4023 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4024 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4025 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4026 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4027 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4028 alc5505_coef_set(codec, 0x880c, 0x00000003);
4029 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
4030
4031#ifdef HALT_REALTEK_ALC5505
4032 alc5505_dsp_halt(codec);
4033#endif
ad60d502
KY
4034}
4035
cd63a5ff 4036#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
4037#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4038#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
4039#else
4040#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4041#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4042#endif
4043
2a43952a 4044#ifdef CONFIG_PM
ad60d502
KY
4045static int alc269_suspend(struct hda_codec *codec)
4046{
4047 struct alc_spec *spec = codec->spec;
4048
4049 if (spec->has_alc5505_dsp)
cd63a5ff 4050 alc5505_dsp_suspend(codec);
1873ebd3 4051
ad60d502
KY
4052 return alc_suspend(codec);
4053}
4054
1d045db9
TI
4055static int alc269_resume(struct hda_codec *codec)
4056{
adcc70b2
KY
4057 struct alc_spec *spec = codec->spec;
4058
1387e2d1
KY
4059 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4060 alc269vb_toggle_power_output(codec, 0);
4061 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4062 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4063 msleep(150);
4064 }
8c427226 4065
1d045db9 4066 codec->patch_ops.init(codec);
f1d4e28b 4067
1387e2d1
KY
4068 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4069 alc269vb_toggle_power_output(codec, 1);
4070 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4071 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4072 msleep(200);
4073 }
f1d4e28b 4074
1a462be5 4075 snd_hda_regmap_sync(codec);
1d045db9 4076 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4077
4078 /* on some machine, the BIOS will clear the codec gpio data when enter
4079 * suspend, and won't restore the data after resume, so we restore it
4080 * in the driver.
4081 */
d261eec8
TI
4082 if (spec->gpio_data)
4083 alc_write_gpio_data(codec);
f475371a 4084
ad60d502 4085 if (spec->has_alc5505_dsp)
cd63a5ff 4086 alc5505_dsp_resume(codec);
c5177c86 4087
1d045db9
TI
4088 return 0;
4089}
2a43952a 4090#endif /* CONFIG_PM */
f1d4e28b 4091
108cc108 4092static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4093 const struct hda_fixup *fix, int action)
108cc108
DH
4094{
4095 struct alc_spec *spec = codec->spec;
4096
1727a771 4097 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4098 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4099}
4100
fdcc968a
JMG
4101static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4102 const struct hda_fixup *fix,
4103 int action)
4104{
4105 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4106 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4107
4108 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4109 snd_hda_codec_set_pincfg(codec, 0x19,
4110 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4111 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4112}
4113
1d045db9 4114static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4115 const struct hda_fixup *fix, int action)
1d045db9 4116{
98b24883
TI
4117 if (action == HDA_FIXUP_ACT_INIT)
4118 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4119}
f1d4e28b 4120
7c478f03
DH
4121static void alc269_fixup_headset_mic(struct hda_codec *codec,
4122 const struct hda_fixup *fix, int action)
4123{
4124 struct alc_spec *spec = codec->spec;
4125
4126 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4127 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4128}
4129
1d045db9 4130static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4131 const struct hda_fixup *fix, int action)
1d045db9
TI
4132{
4133 static const struct hda_verb verbs[] = {
4134 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4135 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4136 {}
4137 };
4138 unsigned int cfg;
f1d4e28b 4139
7639a06c
TI
4140 if (strcmp(codec->core.chip_name, "ALC271X") &&
4141 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4142 return;
4143 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4144 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4145 snd_hda_sequence_write(codec, verbs);
4146}
f1d4e28b 4147
c8426b27
TI
4148/* Fix the speaker amp after resume, etc */
4149static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4150 const struct hda_fixup *fix,
4151 int action)
4152{
4153 if (action == HDA_FIXUP_ACT_INIT)
4154 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4155}
4156
017f2a10 4157static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4158 const struct hda_fixup *fix, int action)
017f2a10
TI
4159{
4160 struct alc_spec *spec = codec->spec;
4161
1727a771 4162 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4163 return;
4164
4165 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4166 * fix the sample rate of analog I/O to 44.1kHz
4167 */
08c189f2
TI
4168 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4169 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4170}
4171
adabb3ec 4172static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4173 const struct hda_fixup *fix, int action)
adabb3ec 4174{
adabb3ec
TI
4175 /* The digital-mic unit sends PDM (differential signal) instead of
4176 * the standard PCM, thus you can't record a valid mono stream as is.
4177 * Below is a workaround specific to ALC269 to control the dmic
4178 * signal source as mono.
4179 */
98b24883
TI
4180 if (action == HDA_FIXUP_ACT_INIT)
4181 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4182}
4183
24519911
TI
4184static void alc269_quanta_automute(struct hda_codec *codec)
4185{
08c189f2 4186 snd_hda_gen_update_outputs(codec);
24519911 4187
1687ccc8
TI
4188 alc_write_coef_idx(codec, 0x0c, 0x680);
4189 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4190}
4191
4192static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4193 const struct hda_fixup *fix, int action)
24519911
TI
4194{
4195 struct alc_spec *spec = codec->spec;
1727a771 4196 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4197 return;
08c189f2 4198 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4199}
4200
d240d1dc 4201static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4202 struct hda_jack_callback *jack)
d240d1dc
DH
4203{
4204 struct alc_spec *spec = codec->spec;
4205 int vref;
4206 msleep(200);
4207 snd_hda_gen_hp_automute(codec, jack);
4208
4209 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4210 msleep(100);
4211 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4212 vref);
4213 msleep(500);
4214 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4215 vref);
4216}
4217
a2ef03fe
TE
4218/*
4219 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4220 */
4221struct hda_alc298_mbxinit {
4222 unsigned char value_0x23;
4223 unsigned char value_0x25;
4224};
4225
4226static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4227 const struct hda_alc298_mbxinit *initval,
4228 bool first)
4229{
4230 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4231 alc_write_coef_idx(codec, 0x26, 0xb000);
4232
4233 if (first)
4234 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4235
4236 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4237 alc_write_coef_idx(codec, 0x26, 0xf000);
4238 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4239
4240 if (initval->value_0x23 != 0x1e)
4241 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4242
4243 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4244 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4245}
4246
4247static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4248 const struct hda_fixup *fix,
4249 int action)
4250{
4251 /* Initialization magic */
4252 static const struct hda_alc298_mbxinit dac_init[] = {
4253 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4254 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4255 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4256 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4257 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4258 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4259 {0x2f, 0x00},
4260 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4261 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4262 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4263 {}
4264 };
4265 const struct hda_alc298_mbxinit *seq;
4266
4267 if (action != HDA_FIXUP_ACT_INIT)
4268 return;
4269
4270 /* Start */
4271 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4272 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4273 alc_write_coef_idx(codec, 0x26, 0xf000);
4274 alc_write_coef_idx(codec, 0x22, 0x31);
4275 alc_write_coef_idx(codec, 0x23, 0x0b);
4276 alc_write_coef_idx(codec, 0x25, 0x00);
4277 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4278 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4279
4280 for (seq = dac_init; seq->value_0x23; seq++)
4281 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4282}
4283
d240d1dc
DH
4284static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4285 const struct hda_fixup *fix, int action)
4286{
4287 struct alc_spec *spec = codec->spec;
4288 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4289 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4290 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4291 }
4292}
4293
766538ac
TI
4294static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4295 bool polarity, bool on)
4296{
4297 unsigned int pinval;
4298
4299 if (!pin)
4300 return;
4301 if (polarity)
4302 on = !on;
4303 pinval = snd_hda_codec_get_pin_target(codec, pin);
4304 pinval &= ~AC_PINCTL_VREFEN;
4305 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4306 /* temporarily power up/down for setting VREF */
4307 snd_hda_power_up_pm(codec);
4308 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4309 snd_hda_power_down_pm(codec);
4310}
d240d1dc 4311
08fb0d0e 4312/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4313static int vref_mute_led_set(struct led_classdev *led_cdev,
4314 enum led_brightness brightness)
6d3cd5d4 4315{
8d3d1ece 4316 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4317 struct alc_spec *spec = codec->spec;
08fb0d0e 4318
766538ac
TI
4319 alc_update_vref_led(codec, spec->mute_led_nid,
4320 spec->mute_led_polarity, brightness);
8d3d1ece 4321 return 0;
6d3cd5d4
DH
4322}
4323
d5b6b65e
DH
4324/* Make sure the led works even in runtime suspend */
4325static unsigned int led_power_filter(struct hda_codec *codec,
4326 hda_nid_t nid,
4327 unsigned int power_state)
4328{
4329 struct alc_spec *spec = codec->spec;
4330
50dd9050
HW
4331 if (power_state != AC_PWRST_D3 || nid == 0 ||
4332 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4333 return power_state;
4334
4335 /* Set pin ctl again, it might have just been set to 0 */
4336 snd_hda_set_pin_ctl(codec, nid,
4337 snd_hda_codec_get_pin_target(codec, nid));
4338
cffd3966 4339 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4340}
4341
08fb0d0e
TI
4342static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4343 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4344{
4345 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4346 const struct dmi_device *dev = NULL;
4347
4348 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4349 return;
4350
4351 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4352 int pol, pin;
4353 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4354 continue;
4355 if (pin < 0x0a || pin >= 0x10)
4356 break;
4357 spec->mute_led_polarity = pol;
4358 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4359 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4360 codec->power_filter = led_power_filter;
4e76a883
TI
4361 codec_dbg(codec,
4362 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4363 spec->mute_led_polarity);
6d3cd5d4
DH
4364 break;
4365 }
4366}
4367
85c467dc
TI
4368static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4369 const struct hda_fixup *fix,
4370 int action, hda_nid_t pin)
d06ac143
DH
4371{
4372 struct alc_spec *spec = codec->spec;
85c467dc 4373
d06ac143
DH
4374 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4375 spec->mute_led_polarity = 0;
85c467dc 4376 spec->mute_led_nid = pin;
8d3d1ece 4377 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4378 codec->power_filter = led_power_filter;
d06ac143
DH
4379 }
4380}
4381
85c467dc
TI
4382static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4383 const struct hda_fixup *fix, int action)
4384{
4385 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4386}
4387
08fb0d0e
TI
4388static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4389 const struct hda_fixup *fix, int action)
420b0feb 4390{
85c467dc 4391 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4392}
4393
7f783bd5
TB
4394static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4395 const struct hda_fixup *fix, int action)
4396{
85c467dc 4397 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4398}
4399
0f32fd19
TI
4400/* update LED status via GPIO */
4401static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4402 int polarity, bool enabled)
9f5c6faf 4403{
dbd13179 4404 if (polarity)
0f32fd19 4405 enabled = !enabled;
d261eec8 4406 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4407}
4408
0f32fd19 4409/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4410static int gpio_mute_led_set(struct led_classdev *led_cdev,
4411 enum led_brightness brightness)
9f5c6faf 4412{
8d3d1ece 4413 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4414 struct alc_spec *spec = codec->spec;
9f5c6faf 4415
dbd13179 4416 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4417 spec->mute_led_polarity, !brightness);
4418 return 0;
0f32fd19 4419}
9f5c6faf 4420
0f32fd19 4421/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4422static int micmute_led_set(struct led_classdev *led_cdev,
4423 enum led_brightness brightness)
4424{
4425 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4426 struct alc_spec *spec = codec->spec;
4427
4428 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4429 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4430 return 0;
4431}
4432
01e4a275
TI
4433/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4434static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4435 int action,
4436 unsigned int mute_mask,
4437 unsigned int micmute_mask)
9f5c6faf
TI
4438{
4439 struct alc_spec *spec = codec->spec;
9f5c6faf 4440
01e4a275
TI
4441 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4442
4443 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4444 return;
4445 if (mute_mask) {
4446 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4447 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4448 }
4449 if (micmute_mask) {
4450 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4451 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4452 }
4453}
4454
e7d66cf7
JS
4455static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4456 const struct hda_fixup *fix, int action)
4457{
4458 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4459}
4460
01e4a275 4461static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4462 const struct hda_fixup *fix, int action)
4463{
01e4a275
TI
4464 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4465}
eaa8e5ef 4466
f5a88b0a
KHF
4467static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4468 const struct hda_fixup *fix, int action)
4469{
3e0650ab 4470 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4471}
4472
01e4a275
TI
4473static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4474 const struct hda_fixup *fix, int action)
4475{
4476 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4477}
4478
a0ccbc53
KY
4479static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4480 const struct hda_fixup *fix, int action)
4481{
4482 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4483}
4484
5fc462c3
JC
4485static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4486 const struct hda_fixup *fix, int action)
4487{
4488 struct alc_spec *spec = codec->spec;
4489
4490 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4491 spec->micmute_led_polarity = 1;
4492 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4493}
4494
8a503555
TI
4495/* turn on/off mic-mute LED per capture hook via VREF change */
4496static int vref_micmute_led_set(struct led_classdev *led_cdev,
4497 enum led_brightness brightness)
9c5dc3bf 4498{
8a503555 4499 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4500 struct alc_spec *spec = codec->spec;
9c5dc3bf 4501
766538ac
TI
4502 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4503 spec->micmute_led_polarity, brightness);
8a503555 4504 return 0;
9c5dc3bf
KY
4505}
4506
4507static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4508 const struct hda_fixup *fix, int action)
4509{
4510 struct alc_spec *spec = codec->spec;
9c5dc3bf 4511
01e4a275 4512 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4513 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4514 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4515 * enable headphone amp
4516 */
4517 spec->gpio_mask |= 0x10;
4518 spec->gpio_dir |= 0x10;
9c5dc3bf 4519 spec->cap_mute_led_nid = 0x18;
8a503555 4520 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4521 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4522 }
4523}
4524
7a5255f1
DH
4525static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4526 const struct hda_fixup *fix, int action)
4527{
7a5255f1 4528 struct alc_spec *spec = codec->spec;
7a5255f1 4529
01e4a275 4530 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4531 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4532 spec->cap_mute_led_nid = 0x18;
8a503555 4533 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4534 codec->power_filter = led_power_filter;
4535 }
4536}
4537
c3bb2b52
TI
4538/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4539 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4540 */
4541static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4542 const struct hda_fixup *fix, int action)
4543{
4544 struct alc_spec *spec = codec->spec;
4545
4546 switch (action) {
4547 case HDA_FIXUP_ACT_PRE_PROBE:
4548 spec->gpio_mask |= 0x01;
4549 spec->gpio_dir |= 0x01;
4550 break;
4551 case HDA_FIXUP_ACT_INIT:
4552 /* need to toggle GPIO to enable the amp */
4553 alc_update_gpio_data(codec, 0x01, true);
4554 msleep(100);
4555 alc_update_gpio_data(codec, 0x01, false);
4556 break;
4557 }
4558}
4559
622464c8
TI
4560/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4561static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4562 struct hda_codec *codec,
4563 struct snd_pcm_substream *substream,
4564 int action)
4565{
4566 switch (action) {
4567 case HDA_GEN_PCM_ACT_PREPARE:
4568 alc_update_gpio_data(codec, 0x04, true);
4569 break;
4570 case HDA_GEN_PCM_ACT_CLEANUP:
4571 alc_update_gpio_data(codec, 0x04, false);
4572 break;
4573 }
4574}
4575
4576static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4577 const struct hda_fixup *fix,
4578 int action)
4579{
4580 struct alc_spec *spec = codec->spec;
4581
4582 if (action == HDA_FIXUP_ACT_PROBE) {
4583 spec->gpio_mask |= 0x04;
4584 spec->gpio_dir |= 0x04;
4585 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4586 }
4587}
4588
766538ac
TI
4589static void alc_update_coef_led(struct hda_codec *codec,
4590 struct alc_coef_led *led,
4591 bool polarity, bool on)
4592{
4593 if (polarity)
4594 on = !on;
4595 /* temporarily power up/down for setting COEF bit */
4596 alc_update_coef_idx(codec, led->idx, led->mask,
4597 on ? led->on : led->off);
4598}
4599
431e76c3 4600/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4601static int coef_mute_led_set(struct led_classdev *led_cdev,
4602 enum led_brightness brightness)
431e76c3 4603{
8d3d1ece 4604 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4605 struct alc_spec *spec = codec->spec;
4606
766538ac
TI
4607 alc_update_coef_led(codec, &spec->mute_led_coef,
4608 spec->mute_led_polarity, brightness);
8d3d1ece 4609 return 0;
431e76c3
KY
4610}
4611
4612static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4613 const struct hda_fixup *fix,
4614 int action)
4615{
4616 struct alc_spec *spec = codec->spec;
4617
4618 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4619 spec->mute_led_polarity = 0;
766538ac
TI
4620 spec->mute_led_coef.idx = 0x0b;
4621 spec->mute_led_coef.mask = 1 << 3;
4622 spec->mute_led_coef.on = 1 << 3;
4623 spec->mute_led_coef.off = 0;
8d3d1ece 4624 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4625 }
4626}
4627
24164f43
KY
4628static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4629 const struct hda_fixup *fix,
4630 int action)
4631{
4632 struct alc_spec *spec = codec->spec;
4633
4634 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4635 spec->mute_led_polarity = 0;
766538ac
TI
4636 spec->mute_led_coef.idx = 0x34;
4637 spec->mute_led_coef.mask = 1 << 5;
4638 spec->mute_led_coef.on = 0;
4639 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4640 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4641 }
4642}
4643
0659400f
LG
4644static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4645 const struct hda_fixup *fix, int action)
4646{
4647 struct alc_spec *spec = codec->spec;
4648
4649 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4650 spec->mute_led_polarity = 0;
4651 spec->mute_led_coef.idx = 0x07;
4652 spec->mute_led_coef.mask = 1;
4653 spec->mute_led_coef.on = 1;
4654 spec->mute_led_coef.off = 0;
4655 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4656 }
4657}
4658
93dc18e1
SJ
4659static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4660 const struct hda_fixup *fix,
4661 int action)
4662{
4663 struct alc_spec *spec = codec->spec;
4664
4665 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4666 spec->mute_led_polarity = 0;
4667 spec->mute_led_coef.idx = 0x0b;
4668 spec->mute_led_coef.mask = 3 << 2;
4669 spec->mute_led_coef.on = 2 << 2;
4670 spec->mute_led_coef.off = 1 << 2;
4671 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4672 }
4673}
4674
431e76c3 4675/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4676static int coef_micmute_led_set(struct led_classdev *led_cdev,
4677 enum led_brightness brightness)
431e76c3 4678{
8a503555 4679 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4680 struct alc_spec *spec = codec->spec;
4681
766538ac
TI
4682 alc_update_coef_led(codec, &spec->mic_led_coef,
4683 spec->micmute_led_polarity, brightness);
8a503555 4684 return 0;
431e76c3
KY
4685}
4686
4687static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4688 const struct hda_fixup *fix, int action)
4689{
4690 struct alc_spec *spec = codec->spec;
4691
4692 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4693 spec->mic_led_coef.idx = 0x19;
4694 spec->mic_led_coef.mask = 1 << 13;
4695 spec->mic_led_coef.on = 1 << 13;
4696 spec->mic_led_coef.off = 0;
8a503555 4697 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4698 }
4699}
4700
ca88eeb3
LG
4701static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4702 const struct hda_fixup *fix, int action)
4703{
4704 struct alc_spec *spec = codec->spec;
4705
4706 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4707 spec->micmute_led_polarity = 1;
4708 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4709}
4710
24164f43
KY
4711static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4712 const struct hda_fixup *fix, int action)
4713{
4714 struct alc_spec *spec = codec->spec;
4715
4716 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4717 spec->mic_led_coef.idx = 0x35;
4718 spec->mic_led_coef.mask = 3 << 2;
4719 spec->mic_led_coef.on = 2 << 2;
4720 spec->mic_led_coef.off = 1 << 2;
8a503555 4721 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4722 }
4723}
4724
431e76c3
KY
4725static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4726 const struct hda_fixup *fix, int action)
4727{
4728 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4729 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4730}
4731
ca88eeb3
LG
4732static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4733 const struct hda_fixup *fix, int action)
4734{
4735 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4736 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4737}
4738
24164f43
KY
4739static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4740 const struct hda_fixup *fix, int action)
4741{
4742 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4743 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4744}
4745
75b62ab6
JW
4746static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4747 const struct hda_fixup *fix, int action)
4748{
4749 struct alc_spec *spec = codec->spec;
4750
4751 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4752 spec->cap_mute_led_nid = 0x1a;
4753 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4754 codec->power_filter = led_power_filter;
4755 }
4756}
4757
4758static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4759 const struct hda_fixup *fix, int action)
4760{
4761 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4762 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4763}
4764
a2d57ebe
KM
4765static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4766 const unsigned short coefs[2])
4767{
4768 alc_write_coef_idx(codec, 0x23, coefs[0]);
4769 alc_write_coef_idx(codec, 0x25, coefs[1]);
4770 alc_write_coef_idx(codec, 0x26, 0xb011);
4771}
4772
4773struct alc298_samsung_amp_desc {
4774 unsigned char nid;
4775 unsigned short init_seq[2][2];
4776};
4777
4778static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4779 const struct hda_fixup *fix, int action)
4780{
4781 int i, j;
4782 static const unsigned short init_seq[][2] = {
4783 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4784 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4785 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4786 { 0x41, 0x07 }, { 0x400, 0x1 }
4787 };
4788 static const struct alc298_samsung_amp_desc amps[] = {
4789 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4790 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4791 };
4792
4793 if (action != HDA_FIXUP_ACT_INIT)
4794 return;
4795
4796 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4797 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4798
4799 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4800 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4801
4802 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4803 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4804 }
4805}
4806
6a30abaa 4807#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4808static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4809 struct hda_jack_callback *event)
4810{
4811 struct alc_spec *spec = codec->spec;
4812
4813 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4814 send both key on and key off event for every interrupt. */
c7b60a89 4815 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4816 input_sync(spec->kb_dev);
c7b60a89 4817 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4818 input_sync(spec->kb_dev);
4819}
33f4acd3 4820
3694cb29
K
4821static int alc_register_micmute_input_device(struct hda_codec *codec)
4822{
4823 struct alc_spec *spec = codec->spec;
c7b60a89 4824 int i;
3694cb29
K
4825
4826 spec->kb_dev = input_allocate_device();
4827 if (!spec->kb_dev) {
4828 codec_err(codec, "Out of memory (input_allocate_device)\n");
4829 return -ENOMEM;
4830 }
c7b60a89
HW
4831
4832 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4833
3694cb29
K
4834 spec->kb_dev->name = "Microphone Mute Button";
4835 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4836 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4837 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4838 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4839 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4840 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4841
4842 if (input_register_device(spec->kb_dev)) {
4843 codec_err(codec, "input_register_device failed\n");
4844 input_free_device(spec->kb_dev);
4845 spec->kb_dev = NULL;
4846 return -ENOMEM;
4847 }
4848
4849 return 0;
4850}
4851
01e4a275
TI
4852/* GPIO1 = set according to SKU external amp
4853 * GPIO2 = mic mute hotkey
4854 * GPIO3 = mute LED
4855 * GPIO4 = mic mute LED
4856 */
33f4acd3
DH
4857static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4858 const struct hda_fixup *fix, int action)
4859{
33f4acd3
DH
4860 struct alc_spec *spec = codec->spec;
4861
01e4a275 4862 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4863 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4864 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4865 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4866 return;
33f4acd3 4867
01e4a275
TI
4868 spec->gpio_mask |= 0x06;
4869 spec->gpio_dir |= 0x02;
4870 spec->gpio_data |= 0x02;
7639a06c 4871 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4872 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4873 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4874 gpio2_mic_hotkey_event);
33f4acd3
DH
4875 return;
4876 }
4877
4878 if (!spec->kb_dev)
4879 return;
4880
4881 switch (action) {
33f4acd3
DH
4882 case HDA_FIXUP_ACT_FREE:
4883 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4884 spec->kb_dev = NULL;
4885 }
33f4acd3
DH
4886}
4887
01e4a275
TI
4888/* Line2 = mic mute hotkey
4889 * GPIO2 = mic mute LED
4890 */
3694cb29
K
4891static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4892 const struct hda_fixup *fix, int action)
4893{
3694cb29
K
4894 struct alc_spec *spec = codec->spec;
4895
01e4a275 4896 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4897 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4898 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4899 if (alc_register_micmute_input_device(codec) != 0)
4900 return;
4901
3694cb29
K
4902 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4903 gpio2_mic_hotkey_event);
3694cb29
K
4904 return;
4905 }
4906
4907 if (!spec->kb_dev)
4908 return;
4909
4910 switch (action) {
3694cb29
K
4911 case HDA_FIXUP_ACT_FREE:
4912 input_unregister_device(spec->kb_dev);
4913 spec->kb_dev = NULL;
4914 }
4915}
c469652b
TI
4916#else /* INPUT */
4917#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4918#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4919#endif /* INPUT */
3694cb29 4920
9c5dc3bf
KY
4921static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4922 const struct hda_fixup *fix, int action)
4923{
4924 struct alc_spec *spec = codec->spec;
4925
1bce62a6 4926 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4927 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4928 spec->cap_mute_led_nid = 0x18;
8a503555 4929 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4930 }
4931}
4932
6b0f95c4 4933static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4934 UPDATE_COEF(0x4a, 1<<8, 0),
4935 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4936 UPDATE_COEF(0x63, 3<<14, 3<<14),
4937 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4938 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4939 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4940 UPDATE_COEF(0x4a, 3<<10, 0),
4941 {}
4942};
4943
73bdd597
DH
4944static void alc_headset_mode_unplugged(struct hda_codec *codec)
4945{
92666d45 4946 struct alc_spec *spec = codec->spec;
6b0f95c4 4947 static const struct coef_fw coef0255[] = {
717f43d8 4948 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4949 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4950 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4951 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4952 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4953 {}
4954 };
6b0f95c4 4955 static const struct coef_fw coef0256[] = {
e69e7e03 4956 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4957 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4958 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4959 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4960 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4961 {}
4962 };
6b0f95c4 4963 static const struct coef_fw coef0233[] = {
54db6c39
TI
4964 WRITE_COEF(0x1b, 0x0c0b),
4965 WRITE_COEF(0x45, 0xc429),
4966 UPDATE_COEF(0x35, 0x4000, 0),
4967 WRITE_COEF(0x06, 0x2104),
4968 WRITE_COEF(0x1a, 0x0001),
4969 WRITE_COEF(0x26, 0x0004),
4970 WRITE_COEF(0x32, 0x42a3),
4971 {}
4972 };
6b0f95c4 4973 static const struct coef_fw coef0288[] = {
f3b70332
KY
4974 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4975 UPDATE_COEF(0x50, 0x2000, 0x2000),
4976 UPDATE_COEF(0x56, 0x0006, 0x0006),
4977 UPDATE_COEF(0x66, 0x0008, 0),
4978 UPDATE_COEF(0x67, 0x2000, 0),
4979 {}
4980 };
6b0f95c4 4981 static const struct coef_fw coef0298[] = {
89542936
KY
4982 UPDATE_COEF(0x19, 0x1300, 0x0300),
4983 {}
4984 };
6b0f95c4 4985 static const struct coef_fw coef0292[] = {
54db6c39
TI
4986 WRITE_COEF(0x76, 0x000e),
4987 WRITE_COEF(0x6c, 0x2400),
4988 WRITE_COEF(0x18, 0x7308),
4989 WRITE_COEF(0x6b, 0xc429),
4990 {}
4991 };
6b0f95c4 4992 static const struct coef_fw coef0293[] = {
54db6c39
TI
4993 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4994 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4995 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4996 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4997 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4998 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4999 {}
5000 };
6b0f95c4 5001 static const struct coef_fw coef0668[] = {
54db6c39
TI
5002 WRITE_COEF(0x15, 0x0d40),
5003 WRITE_COEF(0xb7, 0x802b),
5004 {}
5005 };
6b0f95c4 5006 static const struct coef_fw coef0225[] = {
5a36767a 5007 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
5008 {}
5009 };
6b0f95c4 5010 static const struct coef_fw coef0274[] = {
71683c32
KY
5011 UPDATE_COEF(0x4a, 0x0100, 0),
5012 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
5013 UPDATE_COEF(0x6b, 0xf000, 0x5000),
5014 UPDATE_COEF(0x4a, 0x0010, 0),
5015 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
5016 WRITE_COEF(0x45, 0x5289),
5017 UPDATE_COEF(0x4a, 0x0c00, 0),
5018 {}
5019 };
54db6c39 5020
92666d45
KY
5021 if (spec->no_internal_mic_pin) {
5022 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5023 return;
5024 }
5025
7639a06c 5026 switch (codec->core.vendor_id) {
9a22a8f5 5027 case 0x10ec0255:
e69e7e03
KY
5028 alc_process_coef_fw(codec, coef0255);
5029 break;
1948fc06 5030 case 0x10ec0230:
736f20a7 5031 case 0x10ec0236:
7081adf3 5032 case 0x10ec0256:
527f4643 5033 case 0x19e58326:
e69e7e03 5034 alc_process_coef_fw(codec, coef0256);
9a22a8f5 5035 break;
71683c32
KY
5036 case 0x10ec0234:
5037 case 0x10ec0274:
5038 case 0x10ec0294:
5039 alc_process_coef_fw(codec, coef0274);
5040 break;
13fd08a3 5041 case 0x10ec0233:
73bdd597 5042 case 0x10ec0283:
54db6c39 5043 alc_process_coef_fw(codec, coef0233);
73bdd597 5044 break;
f3b70332
KY
5045 case 0x10ec0286:
5046 case 0x10ec0288:
89542936
KY
5047 alc_process_coef_fw(codec, coef0288);
5048 break;
1a5bc8d9 5049 case 0x10ec0298:
89542936 5050 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
5051 alc_process_coef_fw(codec, coef0288);
5052 break;
73bdd597 5053 case 0x10ec0292:
54db6c39 5054 alc_process_coef_fw(codec, coef0292);
73bdd597 5055 break;
a22aa26f 5056 case 0x10ec0293:
54db6c39 5057 alc_process_coef_fw(codec, coef0293);
a22aa26f 5058 break;
73bdd597 5059 case 0x10ec0668:
54db6c39 5060 alc_process_coef_fw(codec, coef0668);
73bdd597 5061 break;
c2b691ee 5062 case 0x10ec0215:
4cc9b9d6 5063 case 0x10ec0225:
c2b691ee 5064 case 0x10ec0285:
7d727869 5065 case 0x10ec0295:
c2b691ee 5066 case 0x10ec0289:
28f1f9b2 5067 case 0x10ec0299:
4d4b0c52 5068 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5069 alc_process_coef_fw(codec, coef0225);
5070 break;
78f4f7c2
KY
5071 case 0x10ec0867:
5072 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5073 break;
73bdd597 5074 }
4e76a883 5075 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
5076}
5077
5078
5079static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5080 hda_nid_t mic_pin)
5081{
6b0f95c4 5082 static const struct coef_fw coef0255[] = {
54db6c39
TI
5083 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5084 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5085 {}
5086 };
6b0f95c4 5087 static const struct coef_fw coef0256[] = {
717f43d8
KY
5088 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5089 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5090 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5091 {}
5092 };
6b0f95c4 5093 static const struct coef_fw coef0233[] = {
54db6c39
TI
5094 UPDATE_COEF(0x35, 0, 1<<14),
5095 WRITE_COEF(0x06, 0x2100),
5096 WRITE_COEF(0x1a, 0x0021),
5097 WRITE_COEF(0x26, 0x008c),
5098 {}
5099 };
6b0f95c4 5100 static const struct coef_fw coef0288[] = {
89542936 5101 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
5102 UPDATE_COEF(0x50, 0x2000, 0),
5103 UPDATE_COEF(0x56, 0x0006, 0),
5104 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5105 UPDATE_COEF(0x66, 0x0008, 0x0008),
5106 UPDATE_COEF(0x67, 0x2000, 0x2000),
5107 {}
5108 };
6b0f95c4 5109 static const struct coef_fw coef0292[] = {
54db6c39
TI
5110 WRITE_COEF(0x19, 0xa208),
5111 WRITE_COEF(0x2e, 0xacf0),
5112 {}
5113 };
6b0f95c4 5114 static const struct coef_fw coef0293[] = {
54db6c39
TI
5115 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5116 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5117 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5118 {}
5119 };
6b0f95c4 5120 static const struct coef_fw coef0688[] = {
54db6c39
TI
5121 WRITE_COEF(0xb7, 0x802b),
5122 WRITE_COEF(0xb5, 0x1040),
5123 UPDATE_COEF(0xc3, 0, 1<<12),
5124 {}
5125 };
6b0f95c4 5126 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
5127 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5128 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5129 UPDATE_COEF(0x63, 3<<14, 0),
5130 {}
5131 };
6b0f95c4 5132 static const struct coef_fw coef0274[] = {
71683c32
KY
5133 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5134 UPDATE_COEF(0x4a, 0x0010, 0),
5135 UPDATE_COEF(0x6b, 0xf000, 0),
5136 {}
5137 };
54db6c39 5138
7639a06c 5139 switch (codec->core.vendor_id) {
9a22a8f5
KY
5140 case 0x10ec0255:
5141 alc_write_coef_idx(codec, 0x45, 0xc489);
5142 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5143 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5144 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5145 break;
1948fc06 5146 case 0x10ec0230:
717f43d8
KY
5147 case 0x10ec0236:
5148 case 0x10ec0256:
527f4643 5149 case 0x19e58326:
717f43d8
KY
5150 alc_write_coef_idx(codec, 0x45, 0xc489);
5151 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5152 alc_process_coef_fw(codec, coef0256);
5153 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5154 break;
71683c32
KY
5155 case 0x10ec0234:
5156 case 0x10ec0274:
5157 case 0x10ec0294:
5158 alc_write_coef_idx(codec, 0x45, 0x4689);
5159 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5160 alc_process_coef_fw(codec, coef0274);
5161 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5162 break;
13fd08a3 5163 case 0x10ec0233:
73bdd597
DH
5164 case 0x10ec0283:
5165 alc_write_coef_idx(codec, 0x45, 0xc429);
5166 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5167 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5168 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5169 break;
f3b70332
KY
5170 case 0x10ec0286:
5171 case 0x10ec0288:
1a5bc8d9 5172 case 0x10ec0298:
f3b70332
KY
5173 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5174 alc_process_coef_fw(codec, coef0288);
5175 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5176 break;
73bdd597
DH
5177 case 0x10ec0292:
5178 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5179 alc_process_coef_fw(codec, coef0292);
73bdd597 5180 break;
a22aa26f
KY
5181 case 0x10ec0293:
5182 /* Set to TRS mode */
5183 alc_write_coef_idx(codec, 0x45, 0xc429);
5184 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5185 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5186 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5187 break;
78f4f7c2
KY
5188 case 0x10ec0867:
5189 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5190 fallthrough;
9eb5d0e6 5191 case 0x10ec0221:
1f8b46cd
DH
5192 case 0x10ec0662:
5193 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5194 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5195 break;
73bdd597
DH
5196 case 0x10ec0668:
5197 alc_write_coef_idx(codec, 0x11, 0x0001);
5198 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5199 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5200 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5201 break;
c2b691ee 5202 case 0x10ec0215:
4cc9b9d6 5203 case 0x10ec0225:
c2b691ee 5204 case 0x10ec0285:
7d727869 5205 case 0x10ec0295:
c2b691ee 5206 case 0x10ec0289:
28f1f9b2 5207 case 0x10ec0299:
5a36767a 5208 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5209 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5210 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5211 alc_process_coef_fw(codec, coef0225);
5212 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5213 break;
73bdd597 5214 }
4e76a883 5215 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5216}
5217
5218static void alc_headset_mode_default(struct hda_codec *codec)
5219{
6b0f95c4 5220 static const struct coef_fw coef0225[] = {
5a36767a
KY
5221 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5222 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5223 UPDATE_COEF(0x49, 3<<8, 0<<8),
5224 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5225 UPDATE_COEF(0x63, 3<<14, 0),
5226 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5227 {}
5228 };
6b0f95c4 5229 static const struct coef_fw coef0255[] = {
54db6c39
TI
5230 WRITE_COEF(0x45, 0xc089),
5231 WRITE_COEF(0x45, 0xc489),
5232 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5233 WRITE_COEF(0x49, 0x0049),
5234 {}
5235 };
6b0f95c4 5236 static const struct coef_fw coef0256[] = {
717f43d8
KY
5237 WRITE_COEF(0x45, 0xc489),
5238 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5239 WRITE_COEF(0x49, 0x0049),
5240 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5241 WRITE_COEF(0x06, 0x6100),
5242 {}
5243 };
6b0f95c4 5244 static const struct coef_fw coef0233[] = {
54db6c39
TI
5245 WRITE_COEF(0x06, 0x2100),
5246 WRITE_COEF(0x32, 0x4ea3),
5247 {}
5248 };
6b0f95c4 5249 static const struct coef_fw coef0288[] = {
f3b70332
KY
5250 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5251 UPDATE_COEF(0x50, 0x2000, 0x2000),
5252 UPDATE_COEF(0x56, 0x0006, 0x0006),
5253 UPDATE_COEF(0x66, 0x0008, 0),
5254 UPDATE_COEF(0x67, 0x2000, 0),
5255 {}
5256 };
6b0f95c4 5257 static const struct coef_fw coef0292[] = {
54db6c39
TI
5258 WRITE_COEF(0x76, 0x000e),
5259 WRITE_COEF(0x6c, 0x2400),
5260 WRITE_COEF(0x6b, 0xc429),
5261 WRITE_COEF(0x18, 0x7308),
5262 {}
5263 };
6b0f95c4 5264 static const struct coef_fw coef0293[] = {
54db6c39
TI
5265 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5266 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5267 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5268 {}
5269 };
6b0f95c4 5270 static const struct coef_fw coef0688[] = {
54db6c39
TI
5271 WRITE_COEF(0x11, 0x0041),
5272 WRITE_COEF(0x15, 0x0d40),
5273 WRITE_COEF(0xb7, 0x802b),
5274 {}
5275 };
6b0f95c4 5276 static const struct coef_fw coef0274[] = {
71683c32
KY
5277 WRITE_COEF(0x45, 0x4289),
5278 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5279 UPDATE_COEF(0x6b, 0x0f00, 0),
5280 UPDATE_COEF(0x49, 0x0300, 0x0300),
5281 {}
5282 };
54db6c39 5283
7639a06c 5284 switch (codec->core.vendor_id) {
c2b691ee 5285 case 0x10ec0215:
2ae95577 5286 case 0x10ec0225:
c2b691ee 5287 case 0x10ec0285:
7d727869 5288 case 0x10ec0295:
c2b691ee 5289 case 0x10ec0289:
28f1f9b2 5290 case 0x10ec0299:
5a36767a 5291 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5292 alc_process_coef_fw(codec, coef0225);
5293 break;
9a22a8f5 5294 case 0x10ec0255:
54db6c39 5295 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5296 break;
1948fc06 5297 case 0x10ec0230:
717f43d8
KY
5298 case 0x10ec0236:
5299 case 0x10ec0256:
527f4643 5300 case 0x19e58326:
717f43d8
KY
5301 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5302 alc_write_coef_idx(codec, 0x45, 0xc089);
5303 msleep(50);
5304 alc_process_coef_fw(codec, coef0256);
5305 break;
71683c32
KY
5306 case 0x10ec0234:
5307 case 0x10ec0274:
5308 case 0x10ec0294:
5309 alc_process_coef_fw(codec, coef0274);
5310 break;
13fd08a3 5311 case 0x10ec0233:
73bdd597 5312 case 0x10ec0283:
54db6c39 5313 alc_process_coef_fw(codec, coef0233);
73bdd597 5314 break;
f3b70332
KY
5315 case 0x10ec0286:
5316 case 0x10ec0288:
1a5bc8d9 5317 case 0x10ec0298:
f3b70332
KY
5318 alc_process_coef_fw(codec, coef0288);
5319 break;
73bdd597 5320 case 0x10ec0292:
54db6c39 5321 alc_process_coef_fw(codec, coef0292);
73bdd597 5322 break;
a22aa26f 5323 case 0x10ec0293:
54db6c39 5324 alc_process_coef_fw(codec, coef0293);
a22aa26f 5325 break;
73bdd597 5326 case 0x10ec0668:
54db6c39 5327 alc_process_coef_fw(codec, coef0688);
73bdd597 5328 break;
78f4f7c2
KY
5329 case 0x10ec0867:
5330 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5331 break;
73bdd597 5332 }
4e76a883 5333 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5334}
5335
5336/* Iphone type */
5337static void alc_headset_mode_ctia(struct hda_codec *codec)
5338{
89542936
KY
5339 int val;
5340
6b0f95c4 5341 static const struct coef_fw coef0255[] = {
54db6c39
TI
5342 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5343 WRITE_COEF(0x1b, 0x0c2b),
5344 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5345 {}
5346 };
6b0f95c4 5347 static const struct coef_fw coef0256[] = {
e69e7e03 5348 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5349 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5350 {}
5351 };
6b0f95c4 5352 static const struct coef_fw coef0233[] = {
54db6c39
TI
5353 WRITE_COEF(0x45, 0xd429),
5354 WRITE_COEF(0x1b, 0x0c2b),
5355 WRITE_COEF(0x32, 0x4ea3),
5356 {}
5357 };
6b0f95c4 5358 static const struct coef_fw coef0288[] = {
f3b70332
KY
5359 UPDATE_COEF(0x50, 0x2000, 0x2000),
5360 UPDATE_COEF(0x56, 0x0006, 0x0006),
5361 UPDATE_COEF(0x66, 0x0008, 0),
5362 UPDATE_COEF(0x67, 0x2000, 0),
5363 {}
5364 };
6b0f95c4 5365 static const struct coef_fw coef0292[] = {
54db6c39
TI
5366 WRITE_COEF(0x6b, 0xd429),
5367 WRITE_COEF(0x76, 0x0008),
5368 WRITE_COEF(0x18, 0x7388),
5369 {}
5370 };
6b0f95c4 5371 static const struct coef_fw coef0293[] = {
54db6c39
TI
5372 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5373 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5374 {}
5375 };
6b0f95c4 5376 static const struct coef_fw coef0688[] = {
54db6c39
TI
5377 WRITE_COEF(0x11, 0x0001),
5378 WRITE_COEF(0x15, 0x0d60),
5379 WRITE_COEF(0xc3, 0x0000),
5380 {}
5381 };
6b0f95c4 5382 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5383 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5384 UPDATE_COEF(0x63, 3<<14, 2<<14),
5385 {}
5386 };
6b0f95c4 5387 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5388 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5389 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5390 {}
5391 };
54db6c39 5392
7639a06c 5393 switch (codec->core.vendor_id) {
9a22a8f5 5394 case 0x10ec0255:
54db6c39 5395 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5396 break;
1948fc06 5397 case 0x10ec0230:
736f20a7 5398 case 0x10ec0236:
e69e7e03 5399 case 0x10ec0256:
527f4643 5400 case 0x19e58326:
e69e7e03
KY
5401 alc_process_coef_fw(codec, coef0256);
5402 break;
71683c32
KY
5403 case 0x10ec0234:
5404 case 0x10ec0274:
5405 case 0x10ec0294:
5406 alc_write_coef_idx(codec, 0x45, 0xd689);
5407 break;
13fd08a3 5408 case 0x10ec0233:
73bdd597 5409 case 0x10ec0283:
54db6c39 5410 alc_process_coef_fw(codec, coef0233);
73bdd597 5411 break;
1a5bc8d9 5412 case 0x10ec0298:
89542936
KY
5413 val = alc_read_coef_idx(codec, 0x50);
5414 if (val & (1 << 12)) {
5415 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5416 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5417 msleep(300);
5418 } else {
5419 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5420 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5421 msleep(300);
5422 }
5423 break;
f3b70332
KY
5424 case 0x10ec0286:
5425 case 0x10ec0288:
5426 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5427 msleep(300);
5428 alc_process_coef_fw(codec, coef0288);
5429 break;
73bdd597 5430 case 0x10ec0292:
54db6c39 5431 alc_process_coef_fw(codec, coef0292);
73bdd597 5432 break;
a22aa26f 5433 case 0x10ec0293:
54db6c39 5434 alc_process_coef_fw(codec, coef0293);
a22aa26f 5435 break;
73bdd597 5436 case 0x10ec0668:
54db6c39 5437 alc_process_coef_fw(codec, coef0688);
73bdd597 5438 break;
c2b691ee 5439 case 0x10ec0215:
4cc9b9d6 5440 case 0x10ec0225:
c2b691ee 5441 case 0x10ec0285:
7d727869 5442 case 0x10ec0295:
c2b691ee 5443 case 0x10ec0289:
28f1f9b2 5444 case 0x10ec0299:
5a36767a
KY
5445 val = alc_read_coef_idx(codec, 0x45);
5446 if (val & (1 << 9))
5447 alc_process_coef_fw(codec, coef0225_2);
5448 else
5449 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5450 break;
78f4f7c2
KY
5451 case 0x10ec0867:
5452 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5453 break;
73bdd597 5454 }
4e76a883 5455 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5456}
5457
5458/* Nokia type */
5459static void alc_headset_mode_omtp(struct hda_codec *codec)
5460{
6b0f95c4 5461 static const struct coef_fw coef0255[] = {
54db6c39
TI
5462 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5463 WRITE_COEF(0x1b, 0x0c2b),
5464 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5465 {}
5466 };
6b0f95c4 5467 static const struct coef_fw coef0256[] = {
e69e7e03 5468 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5469 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5470 {}
5471 };
6b0f95c4 5472 static const struct coef_fw coef0233[] = {
54db6c39
TI
5473 WRITE_COEF(0x45, 0xe429),
5474 WRITE_COEF(0x1b, 0x0c2b),
5475 WRITE_COEF(0x32, 0x4ea3),
5476 {}
5477 };
6b0f95c4 5478 static const struct coef_fw coef0288[] = {
f3b70332
KY
5479 UPDATE_COEF(0x50, 0x2000, 0x2000),
5480 UPDATE_COEF(0x56, 0x0006, 0x0006),
5481 UPDATE_COEF(0x66, 0x0008, 0),
5482 UPDATE_COEF(0x67, 0x2000, 0),
5483 {}
5484 };
6b0f95c4 5485 static const struct coef_fw coef0292[] = {
54db6c39
TI
5486 WRITE_COEF(0x6b, 0xe429),
5487 WRITE_COEF(0x76, 0x0008),
5488 WRITE_COEF(0x18, 0x7388),
5489 {}
5490 };
6b0f95c4 5491 static const struct coef_fw coef0293[] = {
54db6c39
TI
5492 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5493 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5494 {}
5495 };
6b0f95c4 5496 static const struct coef_fw coef0688[] = {
54db6c39
TI
5497 WRITE_COEF(0x11, 0x0001),
5498 WRITE_COEF(0x15, 0x0d50),
5499 WRITE_COEF(0xc3, 0x0000),
5500 {}
5501 };
6b0f95c4 5502 static const struct coef_fw coef0225[] = {
4cc9b9d6 5503 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5504 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5505 {}
5506 };
54db6c39 5507
7639a06c 5508 switch (codec->core.vendor_id) {
9a22a8f5 5509 case 0x10ec0255:
54db6c39 5510 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5511 break;
1948fc06 5512 case 0x10ec0230:
736f20a7 5513 case 0x10ec0236:
e69e7e03 5514 case 0x10ec0256:
527f4643 5515 case 0x19e58326:
e69e7e03
KY
5516 alc_process_coef_fw(codec, coef0256);
5517 break;
71683c32
KY
5518 case 0x10ec0234:
5519 case 0x10ec0274:
5520 case 0x10ec0294:
5521 alc_write_coef_idx(codec, 0x45, 0xe689);
5522 break;
13fd08a3 5523 case 0x10ec0233:
73bdd597 5524 case 0x10ec0283:
54db6c39 5525 alc_process_coef_fw(codec, coef0233);
73bdd597 5526 break;
1a5bc8d9
KY
5527 case 0x10ec0298:
5528 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5529 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5530 msleep(300);
5531 break;
f3b70332
KY
5532 case 0x10ec0286:
5533 case 0x10ec0288:
5534 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5535 msleep(300);
5536 alc_process_coef_fw(codec, coef0288);
5537 break;
73bdd597 5538 case 0x10ec0292:
54db6c39 5539 alc_process_coef_fw(codec, coef0292);
73bdd597 5540 break;
a22aa26f 5541 case 0x10ec0293:
54db6c39 5542 alc_process_coef_fw(codec, coef0293);
a22aa26f 5543 break;
73bdd597 5544 case 0x10ec0668:
54db6c39 5545 alc_process_coef_fw(codec, coef0688);
73bdd597 5546 break;
c2b691ee 5547 case 0x10ec0215:
4cc9b9d6 5548 case 0x10ec0225:
c2b691ee 5549 case 0x10ec0285:
7d727869 5550 case 0x10ec0295:
c2b691ee 5551 case 0x10ec0289:
28f1f9b2 5552 case 0x10ec0299:
4cc9b9d6
KY
5553 alc_process_coef_fw(codec, coef0225);
5554 break;
73bdd597 5555 }
4e76a883 5556 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5557}
5558
5559static void alc_determine_headset_type(struct hda_codec *codec)
5560{
5561 int val;
5562 bool is_ctia = false;
5563 struct alc_spec *spec = codec->spec;
6b0f95c4 5564 static const struct coef_fw coef0255[] = {
54db6c39
TI
5565 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5566 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5567 conteol) */
5568 {}
5569 };
6b0f95c4 5570 static const struct coef_fw coef0288[] = {
f3b70332
KY
5571 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5572 {}
5573 };
6b0f95c4 5574 static const struct coef_fw coef0298[] = {
89542936
KY
5575 UPDATE_COEF(0x50, 0x2000, 0x2000),
5576 UPDATE_COEF(0x56, 0x0006, 0x0006),
5577 UPDATE_COEF(0x66, 0x0008, 0),
5578 UPDATE_COEF(0x67, 0x2000, 0),
5579 UPDATE_COEF(0x19, 0x1300, 0x1300),
5580 {}
5581 };
6b0f95c4 5582 static const struct coef_fw coef0293[] = {
54db6c39
TI
5583 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5584 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5585 {}
5586 };
6b0f95c4 5587 static const struct coef_fw coef0688[] = {
54db6c39
TI
5588 WRITE_COEF(0x11, 0x0001),
5589 WRITE_COEF(0xb7, 0x802b),
5590 WRITE_COEF(0x15, 0x0d60),
5591 WRITE_COEF(0xc3, 0x0c00),
5592 {}
5593 };
6b0f95c4 5594 static const struct coef_fw coef0274[] = {
71683c32
KY
5595 UPDATE_COEF(0x4a, 0x0010, 0),
5596 UPDATE_COEF(0x4a, 0x8000, 0),
5597 WRITE_COEF(0x45, 0xd289),
5598 UPDATE_COEF(0x49, 0x0300, 0x0300),
5599 {}
5600 };
73bdd597 5601
92666d45
KY
5602 if (spec->no_internal_mic_pin) {
5603 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5604 return;
5605 }
5606
7639a06c 5607 switch (codec->core.vendor_id) {
9a22a8f5 5608 case 0x10ec0255:
717f43d8
KY
5609 alc_process_coef_fw(codec, coef0255);
5610 msleep(300);
5611 val = alc_read_coef_idx(codec, 0x46);
5612 is_ctia = (val & 0x0070) == 0x0070;
5613 break;
1948fc06 5614 case 0x10ec0230:
717f43d8 5615 case 0x10ec0236:
7081adf3 5616 case 0x10ec0256:
527f4643 5617 case 0x19e58326:
717f43d8
KY
5618 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5619 alc_write_coef_idx(codec, 0x06, 0x6104);
5620 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5621
5622 snd_hda_codec_write(codec, 0x21, 0,
5623 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5624 msleep(80);
5625 snd_hda_codec_write(codec, 0x21, 0,
5626 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5627
54db6c39 5628 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5629 msleep(300);
5630 val = alc_read_coef_idx(codec, 0x46);
5631 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5632
5633 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5634 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5635
5636 snd_hda_codec_write(codec, 0x21, 0,
5637 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5638 msleep(80);
5639 snd_hda_codec_write(codec, 0x21, 0,
5640 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5641 break;
71683c32
KY
5642 case 0x10ec0234:
5643 case 0x10ec0274:
5644 case 0x10ec0294:
5645 alc_process_coef_fw(codec, coef0274);
febf2256 5646 msleep(850);
71683c32
KY
5647 val = alc_read_coef_idx(codec, 0x46);
5648 is_ctia = (val & 0x00f0) == 0x00f0;
5649 break;
13fd08a3 5650 case 0x10ec0233:
73bdd597
DH
5651 case 0x10ec0283:
5652 alc_write_coef_idx(codec, 0x45, 0xd029);
5653 msleep(300);
5654 val = alc_read_coef_idx(codec, 0x46);
5655 is_ctia = (val & 0x0070) == 0x0070;
5656 break;
1a5bc8d9 5657 case 0x10ec0298:
89542936
KY
5658 snd_hda_codec_write(codec, 0x21, 0,
5659 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5660 msleep(100);
5661 snd_hda_codec_write(codec, 0x21, 0,
5662 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5663 msleep(200);
5664
5665 val = alc_read_coef_idx(codec, 0x50);
5666 if (val & (1 << 12)) {
5667 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5668 alc_process_coef_fw(codec, coef0288);
5669 msleep(350);
5670 val = alc_read_coef_idx(codec, 0x50);
5671 is_ctia = (val & 0x0070) == 0x0070;
5672 } else {
5673 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5674 alc_process_coef_fw(codec, coef0288);
5675 msleep(350);
5676 val = alc_read_coef_idx(codec, 0x50);
5677 is_ctia = (val & 0x0070) == 0x0070;
5678 }
5679 alc_process_coef_fw(codec, coef0298);
5680 snd_hda_codec_write(codec, 0x21, 0,
5681 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5682 msleep(75);
5683 snd_hda_codec_write(codec, 0x21, 0,
5684 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5685 break;
f3b70332
KY
5686 case 0x10ec0286:
5687 case 0x10ec0288:
5688 alc_process_coef_fw(codec, coef0288);
5689 msleep(350);
5690 val = alc_read_coef_idx(codec, 0x50);
5691 is_ctia = (val & 0x0070) == 0x0070;
5692 break;
73bdd597
DH
5693 case 0x10ec0292:
5694 alc_write_coef_idx(codec, 0x6b, 0xd429);
5695 msleep(300);
5696 val = alc_read_coef_idx(codec, 0x6c);
5697 is_ctia = (val & 0x001c) == 0x001c;
5698 break;
a22aa26f 5699 case 0x10ec0293:
54db6c39 5700 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5701 msleep(300);
5702 val = alc_read_coef_idx(codec, 0x46);
5703 is_ctia = (val & 0x0070) == 0x0070;
5704 break;
73bdd597 5705 case 0x10ec0668:
54db6c39 5706 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5707 msleep(300);
5708 val = alc_read_coef_idx(codec, 0xbe);
5709 is_ctia = (val & 0x1c02) == 0x1c02;
5710 break;
c2b691ee 5711 case 0x10ec0215:
4cc9b9d6 5712 case 0x10ec0225:
c2b691ee 5713 case 0x10ec0285:
7d727869 5714 case 0x10ec0295:
c2b691ee 5715 case 0x10ec0289:
28f1f9b2 5716 case 0x10ec0299:
da911b1f
KY
5717 snd_hda_codec_write(codec, 0x21, 0,
5718 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5719 msleep(80);
5720 snd_hda_codec_write(codec, 0x21, 0,
5721 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5722
5a36767a
KY
5723 alc_process_coef_fw(codec, alc225_pre_hsmode);
5724 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5725 val = alc_read_coef_idx(codec, 0x45);
5726 if (val & (1 << 9)) {
5727 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5728 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5729 msleep(800);
5730 val = alc_read_coef_idx(codec, 0x46);
5731 is_ctia = (val & 0x00f0) == 0x00f0;
5732 } else {
5733 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5734 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5735 msleep(800);
5736 val = alc_read_coef_idx(codec, 0x46);
5737 is_ctia = (val & 0x00f0) == 0x00f0;
5738 }
5739 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5740 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5741 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5742
5743 snd_hda_codec_write(codec, 0x21, 0,
5744 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5745 msleep(80);
5746 snd_hda_codec_write(codec, 0x21, 0,
5747 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5748 break;
78f4f7c2
KY
5749 case 0x10ec0867:
5750 is_ctia = true;
5751 break;
73bdd597
DH
5752 }
5753
4e76a883 5754 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5755 is_ctia ? "yes" : "no");
5756 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5757}
5758
5759static void alc_update_headset_mode(struct hda_codec *codec)
5760{
5761 struct alc_spec *spec = codec->spec;
5762
5763 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5764 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5765
5766 int new_headset_mode;
5767
5768 if (!snd_hda_jack_detect(codec, hp_pin))
5769 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5770 else if (mux_pin == spec->headset_mic_pin)
5771 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5772 else if (mux_pin == spec->headphone_mic_pin)
5773 new_headset_mode = ALC_HEADSET_MODE_MIC;
5774 else
5775 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5776
5959a6bc
DH
5777 if (new_headset_mode == spec->current_headset_mode) {
5778 snd_hda_gen_update_outputs(codec);
73bdd597 5779 return;
5959a6bc 5780 }
73bdd597
DH
5781
5782 switch (new_headset_mode) {
5783 case ALC_HEADSET_MODE_UNPLUGGED:
5784 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5785 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5786 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5787 spec->gen.hp_jack_present = false;
5788 break;
5789 case ALC_HEADSET_MODE_HEADSET:
5790 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5791 alc_determine_headset_type(codec);
5792 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5793 alc_headset_mode_ctia(codec);
5794 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5795 alc_headset_mode_omtp(codec);
5796 spec->gen.hp_jack_present = true;
5797 break;
5798 case ALC_HEADSET_MODE_MIC:
5799 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5800 spec->gen.hp_jack_present = false;
5801 break;
5802 case ALC_HEADSET_MODE_HEADPHONE:
5803 alc_headset_mode_default(codec);
5804 spec->gen.hp_jack_present = true;
5805 break;
5806 }
5807 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5808 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5809 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5810 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5811 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5812 PIN_VREFHIZ);
5813 }
5814 spec->current_headset_mode = new_headset_mode;
5815
5816 snd_hda_gen_update_outputs(codec);
5817}
5818
5819static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5820 struct snd_kcontrol *kcontrol,
5821 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5822{
5823 alc_update_headset_mode(codec);
5824}
5825
1a4f69d5
TI
5826static void alc_update_headset_jack_cb(struct hda_codec *codec,
5827 struct hda_jack_callback *jack)
73bdd597 5828{
73bdd597 5829 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5830 alc_update_headset_mode(codec);
73bdd597
DH
5831}
5832
5833static void alc_probe_headset_mode(struct hda_codec *codec)
5834{
5835 int i;
5836 struct alc_spec *spec = codec->spec;
5837 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5838
5839 /* Find mic pins */
5840 for (i = 0; i < cfg->num_inputs; i++) {
5841 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5842 spec->headset_mic_pin = cfg->inputs[i].pin;
5843 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5844 spec->headphone_mic_pin = cfg->inputs[i].pin;
5845 }
5846
0bed2aa3 5847 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5848 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5849 spec->gen.automute_hook = alc_update_headset_mode;
5850 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5851}
5852
5853static void alc_fixup_headset_mode(struct hda_codec *codec,
5854 const struct hda_fixup *fix, int action)
5855{
5856 struct alc_spec *spec = codec->spec;
5857
5858 switch (action) {
5859 case HDA_FIXUP_ACT_PRE_PROBE:
5860 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5861 break;
5862 case HDA_FIXUP_ACT_PROBE:
5863 alc_probe_headset_mode(codec);
5864 break;
5865 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5866 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5867 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5868 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5869 }
73bdd597
DH
5870 alc_update_headset_mode(codec);
5871 break;
5872 }
5873}
5874
5875static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5876 const struct hda_fixup *fix, int action)
5877{
5878 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5879 struct alc_spec *spec = codec->spec;
5880 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5881 }
5882 else
5883 alc_fixup_headset_mode(codec, fix, action);
5884}
5885
31278997
KY
5886static void alc255_set_default_jack_type(struct hda_codec *codec)
5887{
5888 /* Set to iphone type */
6b0f95c4 5889 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5890 WRITE_COEF(0x1b, 0x880b),
5891 WRITE_COEF(0x45, 0xd089),
5892 WRITE_COEF(0x1b, 0x080b),
5893 WRITE_COEF(0x46, 0x0004),
5894 WRITE_COEF(0x1b, 0x0c0b),
5895 {}
5896 };
6b0f95c4 5897 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5898 WRITE_COEF(0x1b, 0x884b),
5899 WRITE_COEF(0x45, 0xd089),
5900 WRITE_COEF(0x1b, 0x084b),
5901 WRITE_COEF(0x46, 0x0004),
5902 WRITE_COEF(0x1b, 0x0c4b),
5903 {}
5904 };
5905 switch (codec->core.vendor_id) {
5906 case 0x10ec0255:
5907 alc_process_coef_fw(codec, alc255fw);
5908 break;
1948fc06 5909 case 0x10ec0230:
736f20a7 5910 case 0x10ec0236:
e69e7e03 5911 case 0x10ec0256:
527f4643 5912 case 0x19e58326:
e69e7e03
KY
5913 alc_process_coef_fw(codec, alc256fw);
5914 break;
5915 }
31278997
KY
5916 msleep(30);
5917}
5918
9a22a8f5
KY
5919static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5920 const struct hda_fixup *fix, int action)
5921{
5922 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5923 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5924 }
5925 alc_fixup_headset_mode(codec, fix, action);
5926}
5927
31278997
KY
5928static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5929 const struct hda_fixup *fix, int action)
5930{
5931 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5932 struct alc_spec *spec = codec->spec;
5933 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5934 alc255_set_default_jack_type(codec);
72cea3a3 5935 }
31278997
KY
5936 else
5937 alc_fixup_headset_mode(codec, fix, action);
5938}
5939
e1e62b98
KY
5940static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5941 struct hda_jack_callback *jack)
5942{
5943 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5944
5945 alc_update_headset_jack_cb(codec, jack);
5946 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5947 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5948}
5949
5950static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5951 const struct hda_fixup *fix, int action)
5952{
5953 alc_fixup_headset_mode(codec, fix, action);
5954 if (action == HDA_FIXUP_ACT_PROBE) {
5955 struct alc_spec *spec = codec->spec;
d44a6864
TI
5956 /* toggled via hp_automute_hook */
5957 spec->gpio_mask |= 0x40;
5958 spec->gpio_dir |= 0x40;
e1e62b98
KY
5959 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5960 }
5961}
5962
493a52a9
HW
5963static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5964 const struct hda_fixup *fix, int action)
5965{
5966 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5967 struct alc_spec *spec = codec->spec;
5968 spec->gen.auto_mute_via_amp = 1;
5969 }
5970}
5971
9b745ab8
TI
5972static void alc_fixup_no_shutup(struct hda_codec *codec,
5973 const struct hda_fixup *fix, int action)
5974{
efe55732 5975 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5976 struct alc_spec *spec = codec->spec;
c0ca5ece 5977 spec->no_shutup_pins = 1;
9b745ab8
TI
5978 }
5979}
5980
5e6db669
GM
5981static void alc_fixup_disable_aamix(struct hda_codec *codec,
5982 const struct hda_fixup *fix, int action)
5983{
5984 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5985 struct alc_spec *spec = codec->spec;
5986 /* Disable AA-loopback as it causes white noise */
5987 spec->gen.mixer_nid = 0;
5988 }
5989}
5990
7f57d803
TI
5991/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5992static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5993 const struct hda_fixup *fix, int action)
5994{
5995 static const struct hda_pintbl pincfgs[] = {
5996 { 0x16, 0x21211010 }, /* dock headphone */
5997 { 0x19, 0x21a11010 }, /* dock mic */
5998 { }
5999 };
6000 struct alc_spec *spec = codec->spec;
6001
6002 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6003 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6004 codec->power_save_node = 0; /* avoid click noises */
6005 snd_hda_apply_pincfgs(codec, pincfgs);
6006 }
6007}
6008
61fcf8ec
KY
6009static void alc_fixup_tpt470_dock(struct hda_codec *codec,
6010 const struct hda_fixup *fix, int action)
6011{
6012 static const struct hda_pintbl pincfgs[] = {
6013 { 0x17, 0x21211010 }, /* dock headphone */
6014 { 0x19, 0x21a11010 }, /* dock mic */
6015 { }
6016 };
6017 struct alc_spec *spec = codec->spec;
6018
6019 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6020 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
6021 snd_hda_apply_pincfgs(codec, pincfgs);
6022 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
6023 /* Enable DOCK device */
6024 snd_hda_codec_write(codec, 0x17, 0,
6025 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
6026 /* Enable DOCK device */
6027 snd_hda_codec_write(codec, 0x19, 0,
6028 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
6029 }
6030}
6031
399c01aa
TI
6032static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
6033 const struct hda_fixup *fix, int action)
6034{
6035 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
6036 * the speaker output becomes too low by some reason on Thinkpads with
6037 * ALC298 codec
6038 */
6039 static const hda_nid_t preferred_pairs[] = {
6040 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6041 0
6042 };
6043 struct alc_spec *spec = codec->spec;
6044
6045 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6046 spec->gen.preferred_dacs = preferred_pairs;
6047}
6048
8eedd3a7
TI
6049static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6050 const struct hda_fixup *fix, int action)
6051{
6052 static const hda_nid_t preferred_pairs[] = {
6053 0x17, 0x02, 0x21, 0x03, 0
6054 };
6055 struct alc_spec *spec = codec->spec;
6056
6057 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6058 spec->gen.preferred_dacs = preferred_pairs;
6059}
6060
9476d369 6061static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
6062{
6063 struct alc_spec *spec = codec->spec;
35a39f98 6064 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 6065
9476d369
GM
6066 /* Prevent pop noises when headphones are plugged in */
6067 snd_hda_codec_write(codec, hp_pin, 0,
6068 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6069 msleep(20);
033b0a7c
GM
6070}
6071
6072static void alc_fixup_dell_xps13(struct hda_codec *codec,
6073 const struct hda_fixup *fix, int action)
6074{
3e1b0c4a
TI
6075 struct alc_spec *spec = codec->spec;
6076 struct hda_input_mux *imux = &spec->gen.input_mux;
6077 int i;
f38663ab 6078
3e1b0c4a
TI
6079 switch (action) {
6080 case HDA_FIXUP_ACT_PRE_PROBE:
6081 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6082 * it causes a click noise at start up
6083 */
6084 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 6085 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
6086 break;
6087 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
6088 /* Make the internal mic the default input source. */
6089 for (i = 0; i < imux->num_items; i++) {
6090 if (spec->gen.imux_pins[i] == 0x12) {
6091 spec->gen.cur_mux[0] = i;
6092 break;
6093 }
6094 }
3e1b0c4a 6095 break;
033b0a7c
GM
6096 }
6097}
6098
1f8b46cd
DH
6099static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6100 const struct hda_fixup *fix, int action)
6101{
6102 struct alc_spec *spec = codec->spec;
6103
6104 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6105 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6106 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
6107
6108 /* Disable boost for mic-in permanently. (This code is only called
6109 from quirks that guarantee that the headphone is at NID 0x1b.) */
6110 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6111 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
6112 } else
6113 alc_fixup_headset_mode(codec, fix, action);
6114}
6115
73bdd597
DH
6116static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6117 const struct hda_fixup *fix, int action)
6118{
6119 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 6120 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 6121 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
6122 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6123 }
6124 alc_fixup_headset_mode(codec, fix, action);
6125}
6126
bde7bc60
CCC
6127/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6128static int find_ext_mic_pin(struct hda_codec *codec)
6129{
6130 struct alc_spec *spec = codec->spec;
6131 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6132 hda_nid_t nid;
6133 unsigned int defcfg;
6134 int i;
6135
6136 for (i = 0; i < cfg->num_inputs; i++) {
6137 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6138 continue;
6139 nid = cfg->inputs[i].pin;
6140 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6141 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6142 continue;
6143 return nid;
6144 }
6145
6146 return 0;
6147}
6148
08a978db 6149static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6150 const struct hda_fixup *fix,
08a978db
DR
6151 int action)
6152{
6153 struct alc_spec *spec = codec->spec;
6154
0db75790 6155 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6156 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6157 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6158
6159 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6160 return;
bde7bc60 6161 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6162 }
08a978db 6163}
693b613d 6164
3e0d611b
DH
6165static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6166 const struct hda_fixup *fix,
6167 int action)
6168{
6169 struct alc_spec *spec = codec->spec;
6170 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6171 int i;
6172
6173 /* The mic boosts on level 2 and 3 are too noisy
6174 on the internal mic input.
6175 Therefore limit the boost to 0 or 1. */
6176
6177 if (action != HDA_FIXUP_ACT_PROBE)
6178 return;
6179
6180 for (i = 0; i < cfg->num_inputs; i++) {
6181 hda_nid_t nid = cfg->inputs[i].pin;
6182 unsigned int defcfg;
6183 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6184 continue;
6185 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6186 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6187 continue;
6188
6189 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6190 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6191 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6192 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6193 (0 << AC_AMPCAP_MUTE_SHIFT));
6194 }
6195}
6196
cd217a63 6197static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6198 struct hda_jack_callback *jack)
cd217a63
KY
6199{
6200 struct alc_spec *spec = codec->spec;
6201 int vref;
6202
6203 msleep(200);
6204 snd_hda_gen_hp_automute(codec, jack);
6205
6206 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6207
6208 msleep(600);
6209 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6210 vref);
6211}
6212
cd217a63
KY
6213static void alc283_fixup_chromebook(struct hda_codec *codec,
6214 const struct hda_fixup *fix, int action)
6215{
6216 struct alc_spec *spec = codec->spec;
cd217a63
KY
6217
6218 switch (action) {
6219 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6220 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6221 /* Disable AA-loopback as it causes white noise */
6222 spec->gen.mixer_nid = 0;
38070219 6223 break;
0202e99c 6224 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6225 /* MIC2-VREF control */
6226 /* Set to manual mode */
98b24883 6227 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6228 /* Enable Line1 input control by verb */
98b24883 6229 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6230 break;
6231 }
6232}
6233
6234static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6235 const struct hda_fixup *fix, int action)
6236{
6237 struct alc_spec *spec = codec->spec;
0202e99c
KY
6238
6239 switch (action) {
6240 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6241 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6242 break;
6243 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6244 /* MIC2-VREF control */
6245 /* Set to manual mode */
98b24883 6246 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6247 break;
6248 }
6249}
6250
7bba2157
TI
6251/* mute tablet speaker pin (0x14) via dock plugging in addition */
6252static void asus_tx300_automute(struct hda_codec *codec)
6253{
6254 struct alc_spec *spec = codec->spec;
6255 snd_hda_gen_update_outputs(codec);
6256 if (snd_hda_jack_detect(codec, 0x1b))
6257 spec->gen.mute_bits |= (1ULL << 0x14);
6258}
6259
6260static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6261 const struct hda_fixup *fix, int action)
6262{
6263 struct alc_spec *spec = codec->spec;
7bba2157
TI
6264 static const struct hda_pintbl dock_pins[] = {
6265 { 0x1b, 0x21114000 }, /* dock speaker pin */
6266 {}
6267 };
7bba2157
TI
6268
6269 switch (action) {
6270 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6271 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6272 /* TX300 needs to set up GPIO2 for the speaker amp */
6273 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6274 snd_hda_apply_pincfgs(codec, dock_pins);
6275 spec->gen.auto_mute_via_amp = 1;
6276 spec->gen.automute_hook = asus_tx300_automute;
6277 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6278 snd_hda_gen_hp_automute);
6279 break;
5579cd6f
TI
6280 case HDA_FIXUP_ACT_PROBE:
6281 spec->init_amp = ALC_INIT_DEFAULT;
6282 break;
7bba2157
TI
6283 case HDA_FIXUP_ACT_BUILD:
6284 /* this is a bit tricky; give more sane names for the main
6285 * (tablet) speaker and the dock speaker, respectively
6286 */
56798e6b
TI
6287 rename_ctl(codec, "Speaker Playback Switch",
6288 "Dock Speaker Playback Switch");
6289 rename_ctl(codec, "Bass Speaker Playback Switch",
6290 "Speaker Playback Switch");
7bba2157
TI
6291 break;
6292 }
6293}
6294
338cae56
DH
6295static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6296 const struct hda_fixup *fix, int action)
6297{
0f4881dc
DH
6298 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6299 /* DAC node 0x03 is giving mono output. We therefore want to
6300 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6301 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6302 static const hda_nid_t conn1[] = { 0x0c };
6303 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6304 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6305 }
338cae56
DH
6306}
6307
dd9aa335
HW
6308static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6309 const struct hda_fixup *fix, int action)
6310{
6311 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6312 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6313 we can't adjust the speaker's volume since this node does not has
6314 Amp-out capability. we change the speaker's route to:
6315 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6316 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6317 speaker's volume now. */
6318
caf3c043
MM
6319 static const hda_nid_t conn1[] = { 0x0c };
6320 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6321 }
6322}
6323
e312a869
TI
6324/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6325static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6326 const struct hda_fixup *fix, int action)
6327{
6328 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6329 static const hda_nid_t conn[] = { 0x02, 0x03 };
6330 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6331 }
6332}
6333
d2cd795c
JK
6334/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6335static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6336 const struct hda_fixup *fix, int action)
6337{
6338 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6339 static const hda_nid_t conn[] = { 0x02 };
6340 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6341 }
6342}
6343
98973f2f
KP
6344/* Hook to update amp GPIO4 for automute */
6345static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6346 struct hda_jack_callback *jack)
6347{
6348 struct alc_spec *spec = codec->spec;
6349
6350 snd_hda_gen_hp_automute(codec, jack);
6351 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6352 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6353 !spec->gen.hp_jack_present);
98973f2f
KP
6354}
6355
6356/* Manage GPIOs for HP EliteBook Folio 9480m.
6357 *
6358 * GPIO4 is the headphone amplifier power control
6359 * GPIO3 is the audio output mute indicator LED
6360 */
6361
6362static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6363 const struct hda_fixup *fix,
6364 int action)
6365{
6366 struct alc_spec *spec = codec->spec;
98973f2f 6367
01e4a275 6368 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6369 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6370 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6371 spec->gpio_mask |= 0x10;
6372 spec->gpio_dir |= 0x10;
98973f2f 6373 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6374 }
6375}
6376
ae065f1c
TI
6377static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6378 const struct hda_fixup *fix,
6379 int action)
6380{
6381 struct alc_spec *spec = codec->spec;
6382
6383 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6384 spec->gpio_mask |= 0x04;
6385 spec->gpio_dir |= 0x04;
6386 /* set data bit low */
6387 }
6388}
6389
6a6660d0
TI
6390/* Quirk for Thinkpad X1 7th and 8th Gen
6391 * The following fixed routing needed
6392 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6393 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6394 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6395 */
6396static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6397 const struct hda_fixup *fix, int action)
6398{
6399 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6400 static const hda_nid_t preferred_pairs[] = {
6401 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6402 };
6403 struct alc_spec *spec = codec->spec;
6404
6405 switch (action) {
6406 case HDA_FIXUP_ACT_PRE_PROBE:
6407 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6408 spec->gen.preferred_dacs = preferred_pairs;
6409 break;
6410 case HDA_FIXUP_ACT_BUILD:
6411 /* The generic parser creates somewhat unintuitive volume ctls
6412 * with the fixed routing above, and the shared DAC2 may be
6413 * confusing for PA.
6414 * Rename those to unique names so that PA doesn't touch them
6415 * and use only Master volume.
6416 */
6417 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6418 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6419 break;
6420 }
6421}
6422
ca169cc2
KY
6423static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6424 const struct hda_fixup *fix,
6425 int action)
6426{
6427 alc_fixup_dual_codecs(codec, fix, action);
6428 switch (action) {
6429 case HDA_FIXUP_ACT_PRE_PROBE:
6430 /* override card longname to provide a unique UCM profile */
6431 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6432 break;
6433 case HDA_FIXUP_ACT_BUILD:
6434 /* rename Capture controls depending on the codec */
6435 rename_ctl(codec, "Capture Volume",
6436 codec->addr == 0 ?
6437 "Rear-Panel Capture Volume" :
6438 "Front-Panel Capture Volume");
6439 rename_ctl(codec, "Capture Switch",
6440 codec->addr == 0 ?
6441 "Rear-Panel Capture Switch" :
6442 "Front-Panel Capture Switch");
6443 break;
6444 }
6445}
6446
52e4e368
KHF
6447static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6448 const struct hda_fixup *fix, int action)
6449{
6450 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6451 return;
6452
6453 codec->power_save_node = 1;
6454}
6455
92266651
KY
6456/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6457static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6458 const struct hda_fixup *fix, int action)
6459{
6460 struct alc_spec *spec = codec->spec;
caf3c043 6461 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6462 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6463 0
6464 };
6465
6466 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6467 return;
6468
6469 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6470 spec->gen.auto_mute_via_amp = 1;
6471 codec->power_save_node = 0;
92266651
KY
6472}
6473
c84bfedc
TI
6474/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6475static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6476 const struct hda_fixup *fix, int action)
6477{
6478 static const hda_nid_t preferred_pairs[] = {
6479 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6480 };
6481 struct alc_spec *spec = codec->spec;
6482
6483 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6484 spec->gen.preferred_dacs = preferred_pairs;
6485 spec->gen.obey_preferred_dacs = 1;
6486 }
6487}
6488
c4cfcf6f
HW
6489/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6490static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6491 const struct hda_fixup *fix, int action)
6492{
6493 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6494 return;
6495
6496 snd_hda_override_wcaps(codec, 0x03, 0);
6497}
6498
8a8de09c
KY
6499static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6500{
6501 switch (codec->core.vendor_id) {
6502 case 0x10ec0274:
6503 case 0x10ec0294:
6504 case 0x10ec0225:
6505 case 0x10ec0295:
6506 case 0x10ec0299:
6507 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6508 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6509 break;
1948fc06 6510 case 0x10ec0230:
8a8de09c
KY
6511 case 0x10ec0235:
6512 case 0x10ec0236:
6513 case 0x10ec0255:
6514 case 0x10ec0256:
cae2bdb5 6515 case 0x10ec0257:
527f4643 6516 case 0x19e58326:
8a8de09c
KY
6517 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6518 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6519 break;
6520 }
6521}
6522
8983eb60
KY
6523static void alc295_fixup_chromebook(struct hda_codec *codec,
6524 const struct hda_fixup *fix, int action)
6525{
d3ba58bb
KY
6526 struct alc_spec *spec = codec->spec;
6527
8983eb60 6528 switch (action) {
d3ba58bb
KY
6529 case HDA_FIXUP_ACT_PRE_PROBE:
6530 spec->ultra_low_power = true;
6531 break;
8983eb60 6532 case HDA_FIXUP_ACT_INIT:
8a8de09c 6533 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6534 break;
6535 }
6536}
6537
d1dd4211
KY
6538static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6539 const struct hda_fixup *fix, int action)
6540{
6541 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6542 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6543}
6544
c3cdf189
LJ
6545
6546static void alc294_gx502_toggle_output(struct hda_codec *codec,
6547 struct hda_jack_callback *cb)
6548{
6549 /* The Windows driver sets the codec up in a very different way where
6550 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6551 */
6552 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6553 alc_write_coef_idx(codec, 0x10, 0x8a20);
6554 else
6555 alc_write_coef_idx(codec, 0x10, 0x0a20);
6556}
6557
6558static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6559 const struct hda_fixup *fix, int action)
6560{
6561 /* Pin 0x21: headphones/headset mic */
6562 if (!is_jack_detectable(codec, 0x21))
6563 return;
6564
6565 switch (action) {
6566 case HDA_FIXUP_ACT_PRE_PROBE:
6567 snd_hda_jack_detect_enable_callback(codec, 0x21,
6568 alc294_gx502_toggle_output);
6569 break;
6570 case HDA_FIXUP_ACT_INIT:
6571 /* Make sure to start in a correct state, i.e. if
6572 * headphones have been plugged in before powering up the system
6573 */
6574 alc294_gx502_toggle_output(codec, NULL);
6575 break;
6576 }
6577}
6578
c1b55029
DC
6579static void alc294_gu502_toggle_output(struct hda_codec *codec,
6580 struct hda_jack_callback *cb)
6581{
6582 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6583 * responsible from changes between speakers and headphones
6584 */
6585 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6586 alc_write_coef_idx(codec, 0x10, 0x8420);
6587 else
6588 alc_write_coef_idx(codec, 0x10, 0x0a20);
6589}
6590
6591static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6592 const struct hda_fixup *fix, int action)
6593{
6594 if (!is_jack_detectable(codec, 0x21))
6595 return;
6596
6597 switch (action) {
6598 case HDA_FIXUP_ACT_PRE_PROBE:
6599 snd_hda_jack_detect_enable_callback(codec, 0x21,
6600 alc294_gu502_toggle_output);
6601 break;
6602 case HDA_FIXUP_ACT_INIT:
6603 alc294_gu502_toggle_output(codec, NULL);
6604 break;
6605 }
6606}
6607
56496253
KY
6608static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6609 const struct hda_fixup *fix, int action)
6610{
6611 if (action != HDA_FIXUP_ACT_INIT)
6612 return;
6613
6614 msleep(100);
6615 alc_write_coef_idx(codec, 0x65, 0x0);
6616}
6617
8a8de09c
KY
6618static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6619 const struct hda_fixup *fix, int action)
6620{
6621 switch (action) {
6622 case HDA_FIXUP_ACT_INIT:
6623 alc_combo_jack_hp_jd_restart(codec);
6624 break;
6625 }
6626}
6627
92666d45
KY
6628static void alc_fixup_no_int_mic(struct hda_codec *codec,
6629 const struct hda_fixup *fix, int action)
6630{
6631 struct alc_spec *spec = codec->spec;
6632
6633 switch (action) {
6634 case HDA_FIXUP_ACT_PRE_PROBE:
6635 /* Mic RING SLEEVE swap for combo jack */
6636 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6637 spec->no_internal_mic_pin = true;
6638 break;
6639 case HDA_FIXUP_ACT_INIT:
6640 alc_combo_jack_hp_jd_restart(codec);
6641 break;
6642 }
6643}
6644
d94befbb
DB
6645/* GPIO1 = amplifier on/off
6646 * GPIO3 = mic mute LED
6647 */
6648static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6649 const struct hda_fixup *fix, int action)
6650{
6651 static const hda_nid_t conn[] = { 0x02 };
6652
6653 struct alc_spec *spec = codec->spec;
6654 static const struct hda_pintbl pincfgs[] = {
6655 { 0x14, 0x90170110 }, /* front/high speakers */
6656 { 0x17, 0x90170130 }, /* back/bass speakers */
6657 { }
6658 };
6659
6660 //enable micmute led
6661 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6662
6663 switch (action) {
6664 case HDA_FIXUP_ACT_PRE_PROBE:
6665 spec->micmute_led_polarity = 1;
6666 /* needed for amp of back speakers */
6667 spec->gpio_mask |= 0x01;
6668 spec->gpio_dir |= 0x01;
6669 snd_hda_apply_pincfgs(codec, pincfgs);
6670 /* share DAC to have unified volume control */
6671 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6672 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6673 break;
6674 case HDA_FIXUP_ACT_INIT:
6675 /* need to toggle GPIO to enable the amp of back speakers */
6676 alc_update_gpio_data(codec, 0x01, true);
6677 msleep(100);
6678 alc_update_gpio_data(codec, 0x01, false);
6679 break;
6680 }
6681}
6682
434591b2
ED
6683static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6684 const struct hda_fixup *fix, int action)
6685{
6686 static const hda_nid_t conn[] = { 0x02 };
6687 static const struct hda_pintbl pincfgs[] = {
6688 { 0x14, 0x90170110 }, /* rear speaker */
6689 { }
6690 };
6691
6692 switch (action) {
6693 case HDA_FIXUP_ACT_PRE_PROBE:
6694 snd_hda_apply_pincfgs(codec, pincfgs);
6695 /* force front speaker to DAC1 */
6696 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6697 break;
6698 }
6699}
6700
c0621669
AA
6701static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
6702 const struct hda_fixup *fix,
6703 int action)
6704{
6705 static const struct coef_fw coefs[] = {
6706 WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
6707 WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
6708 WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
6709 WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
6710 WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
6711 WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
6712 WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
6713 WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
6714 WRITE_COEF(0x6e, 0x1005), { }
6715 };
6716
6717 static const struct hda_pintbl pincfgs[] = {
6718 { 0x12, 0xb7a60130 }, /* Internal microphone*/
6719 { 0x14, 0x90170150 }, /* B&O soundbar speakers */
6720 { 0x17, 0x90170153 }, /* Side speakers */
6721 { 0x19, 0x03a11040 }, /* Headset microphone */
6722 { }
6723 };
6724
6725 switch (action) {
6726 case HDA_FIXUP_ACT_PRE_PROBE:
6727 snd_hda_apply_pincfgs(codec, pincfgs);
6728
6729 /* Fixes volume control problem for side speakers */
6730 alc295_fixup_disable_dac3(codec, fix, action);
6731
6732 /* Fixes no sound from headset speaker */
6733 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
6734
6735 /* Auto-enable headset mic when plugged */
6736 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
6737
6738 /* Headset mic volume enhancement */
6739 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
6740 break;
6741 case HDA_FIXUP_ACT_INIT:
6742 alc_process_coef_fw(codec, coefs);
6743 break;
6744 case HDA_FIXUP_ACT_BUILD:
6745 rename_ctl(codec, "Bass Speaker Playback Volume",
6746 "B&O-Tuned Playback Volume");
6747 rename_ctl(codec, "Front Playback Switch",
6748 "B&O Soundbar Playback Switch");
6749 rename_ctl(codec, "Bass Speaker Playback Switch",
6750 "Side Speaker Playback Switch");
6751 break;
6752 }
6753}
6754
b317b032
TI
6755/* for hda_fixup_thinkpad_acpi() */
6756#include "thinkpad_helper.c"
b67ae3f1 6757
d5a6cabf
TI
6758static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6759 const struct hda_fixup *fix, int action)
6760{
6761 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6762 hda_fixup_thinkpad_acpi(codec, fix, action);
6763}
6764
ad7cc2d4
CB
6765/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6766static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6767 const struct hda_fixup *fix,
6768 int action)
6769{
6770 struct alc_spec *spec = codec->spec;
6771
6772 switch (action) {
6773 case HDA_FIXUP_ACT_PRE_PROBE:
6774 spec->gen.suppress_auto_mute = 1;
6775 break;
6776 }
6777}
6778
7ce66933
SB
6779static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
6780{
6781 struct hda_codec *cdc = data;
6782 struct alc_spec *spec = cdc->spec;
7ce66933
SB
6783
6784 codec_info(cdc, "ACPI Notification %d\n", event);
6785
fd895a74
RF
6786 hda_component_acpi_device_notify(spec->comps, ARRAY_SIZE(spec->comps),
6787 handle, event, data);
7ce66933
SB
6788}
6789
d3dca026
LT
6790static int comp_bind(struct device *dev)
6791{
6792 struct hda_codec *cdc = dev_to_hda_codec(dev);
6793 struct alc_spec *spec = cdc->spec;
7ce66933
SB
6794 int ret;
6795
fd895a74 6796 ret = hda_component_manager_bind(cdc, spec->comps);
7ce66933
SB
6797 if (ret)
6798 return ret;
1873ebd3 6799
fd895a74
RF
6800 return hda_component_manager_bind_acpi_notifications(cdc,
6801 spec->comps, ARRAY_SIZE(spec->comps),
6802 comp_acpi_device_notify, cdc);
d3dca026
LT
6803}
6804
6805static void comp_unbind(struct device *dev)
6806{
6807 struct hda_codec *cdc = dev_to_hda_codec(dev);
6808 struct alc_spec *spec = cdc->spec;
6809
fd895a74
RF
6810 hda_component_manager_unbind_acpi_notifications(cdc, spec->comps, comp_acpi_device_notify);
6811 hda_component_manager_unbind(cdc, spec->comps);
d3dca026
LT
6812}
6813
6814static const struct component_master_ops comp_master_ops = {
6815 .bind = comp_bind,
6816 .unbind = comp_unbind,
6817};
6818
6819static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6820 struct snd_pcm_substream *sub, int action)
6821{
6822 struct alc_spec *spec = cdc->spec;
ae7abe36 6823
fd895a74 6824 hda_component_manager_playback_hook(spec->comps, ARRAY_SIZE(spec->comps), action);
ae7abe36
SB
6825}
6826
cf0d9566
RF
6827static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6828 const char *hid, const char *match_str, int count)
3babae91 6829{
3babae91 6830 struct alc_spec *spec = cdc->spec;
3babae91
SD
6831 int ret;
6832
6833 switch (action) {
6834 case HDA_FIXUP_ACT_PRE_PROBE:
fd895a74
RF
6835 ret = hda_component_manager_init(cdc, spec->comps, count, bus, hid,
6836 match_str, &comp_master_ops);
3babae91 6837 if (ret)
fd895a74
RF
6838 return;
6839
6840 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
3babae91
SD
6841 break;
6842 case HDA_FIXUP_ACT_FREE:
fd895a74 6843 hda_component_manager_free(cdc, &comp_master_ops);
3babae91
SD
6844 break;
6845 }
6846}
6847
ae7abe36
SB
6848static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6849{
cf0d9566 6850 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
ae7abe36
SB
6851}
6852
42320660
SB
6853static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6854{
cf0d9566 6855 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
42320660
SB
6856}
6857
07bcab93
LT
6858static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6859{
cf0d9566 6860 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
225f6e1b
TI
6861}
6862
07bcab93
LT
6863static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6864{
cf0d9566 6865 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
07bcab93
LT
6866}
6867
d3dca026
LT
6868static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6869 int action)
6870{
cf0d9566 6871 comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
d3dca026
LT
6872}
6873
1e24881d
LT
6874static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6875 int action)
6876{
cf0d9566 6877 comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
1e24881d
LT
6878}
6879
c33f0d4f
ST
6880static void cs35l56_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6881{
6882 comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 2);
6883}
6884
6885static void cs35l56_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6886{
6887 comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 4);
6888}
6889
6890static void cs35l56_fixup_spi_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6891{
6892 comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 2);
6893}
6894
b2d6a1fd
ST
6895static void cs35l56_fixup_spi_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6896{
6897 comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 4);
1e24881d
LT
6898}
6899
c33f0d4f
ST
6900static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6901{
6902 /*
6903 * The same SSID has been re-used in different hardware, they have
6904 * different codecs and the newer GA403U has a ALC285.
6905 */
6906 if (cdc->core.vendor_id == 0x10ec0285)
6907 cs35l56_fixup_i2c_two(cdc, fix, action);
6908 else
6909 alc_fixup_inv_dmic(cdc, fix, action);
6910}
6911
3babae91
SD
6912static void tas2781_fixup_i2c(struct hda_codec *cdc,
6913 const struct hda_fixup *fix, int action)
6914{
cf0d9566 6915 comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
3babae91
SD
6916}
6917
b5cb53fd
GK
6918static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
6919 const struct hda_fixup *fix, int action)
6920{
cf0d9566 6921 comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
b5cb53fd
GK
6922}
6923
bd2d8305
IM
6924static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
6925 const struct hda_fixup *fix, int action)
6926{
6927 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
6928}
6929
6930
bbf8ff6b
TB
6931/* for alc295_fixup_hp_top_speakers */
6932#include "hp_x360_helper.c"
6933
26928ca1
TI
6934/* for alc285_fixup_ideapad_s740_coef() */
6935#include "ideapad_s740_helper.c"
6936
619764cc
WS
6937static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6938 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6939 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6940 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6941 {}
6942};
6943
6944static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6945 const struct hda_fixup *fix,
6946 int action)
dd6dd6e3
WS
6947{
6948 /*
619764cc
WS
6949 * A certain other OS sets these coeffs to different values. On at least
6950 * one TongFang barebone these settings might survive even a cold
6951 * reboot. So to restore a clean slate the values are explicitly reset
6952 * to default here. Without this, the external microphone is always in a
6953 * plugged-in state, while the internal microphone is always in an
6954 * unplugged state, breaking the ability to use the internal microphone.
6955 */
6956 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
6957}
6958
174a7fb3
WS
6959static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6960 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6961 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6962 WRITE_COEF(0x49, 0x0149),
6963 {}
6964};
6965
6966static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6967 const struct hda_fixup *fix,
6968 int action)
6969{
6970 /*
6971 * The audio jack input and output is not detected on the ASRock NUC Box
6972 * 1100 series when cold booting without this fix. Warm rebooting from a
6973 * certain other OS makes the audio functional, as COEF settings are
6974 * preserved in this case. This fix sets these altered COEF values as
6975 * the default.
6976 */
6977 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6978}
6979
edca7cc4
WS
6980static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6981 const struct hda_fixup *fix,
6982 int action)
6983{
6984 /*
6985 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6986 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6987 * needs an additional quirk for sound working after suspend and resume.
6988 */
6989 if (codec->core.vendor_id == 0x10ec0256) {
6990 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6991 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6992 } else {
6993 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6994 }
6995}
6996
1e5dc398
HW
6997static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
6998 const struct hda_fixup *fix, int action)
6999{
7000 u32 caps;
7001 u8 nsteps, offs;
7002
7003 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7004 return;
7005
7006 caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
7007 nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
7008 offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
7009 caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
7010 caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
7011
7012 if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
7013 codec_warn(codec, "failed to override amp caps for NID 0x3\n");
7014}
7015
1efcdd9c
GM
7016static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
7017 const struct hda_fixup *fix,
7018 int action)
7019{
7020 struct alc_spec *spec = codec->spec;
7021 struct hda_input_mux *imux = &spec->gen.input_mux;
7022 int i;
7023
7024 alc269_fixup_limit_int_mic_boost(codec, fix, action);
7025
7026 switch (action) {
7027 case HDA_FIXUP_ACT_PRE_PROBE:
7028 /**
7029 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
7030 * to Hi-Z to avoid pop noises at startup and when plugging and
7031 * unplugging headphones.
7032 */
7033 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
7034 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
7035 break;
7036 case HDA_FIXUP_ACT_PROBE:
7037 /**
7038 * Make the internal mic (0x12) the default input source to
7039 * prevent pop noises on cold boot.
7040 */
7041 for (i = 0; i < imux->num_items; i++) {
7042 if (spec->gen.imux_pins[i] == 0x12) {
7043 spec->gen.cur_mux[0] = i;
7044 break;
7045 }
7046 }
7047 break;
7048 }
7049}
7050
3790a3d6
PJ
7051static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
7052 const struct hda_fixup *fix, int action)
7053{
7054 /*
7055 * The Pin Complex 0x17 for the bass speakers is wrongly reported as
7056 * unconnected.
7057 */
7058 static const struct hda_pintbl pincfgs[] = {
7059 { 0x17, 0x90170121 },
7060 { }
7061 };
7062 /*
7063 * Avoid DAC 0x06 and 0x08, as they have no volume controls.
7064 * DAC 0x02 and 0x03 would be fine.
7065 */
7066 static const hda_nid_t conn[] = { 0x02, 0x03 };
7067 /*
7068 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
7069 * Headphones (0x21) are connected to DAC 0x03.
7070 */
7071 static const hda_nid_t preferred_pairs[] = {
7072 0x14, 0x02,
7073 0x17, 0x02,
7074 0x21, 0x03,
7075 0
7076 };
7077 struct alc_spec *spec = codec->spec;
7078
7079 switch (action) {
7080 case HDA_FIXUP_ACT_PRE_PROBE:
7081 snd_hda_apply_pincfgs(codec, pincfgs);
7082 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7083 spec->gen.preferred_dacs = preferred_pairs;
7084 break;
7085 }
7086}
7087
2912cdda
PJ
7088static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
7089 const struct hda_fixup *fix, int action)
7090{
7091 static const struct hda_pintbl pincfgs[] = {
7092 { 0x14, 0x90170151 },
7093 { 0x17, 0x90170150 },
7094 { }
7095 };
7096 static const hda_nid_t conn[] = { 0x02, 0x03 };
7097 static const hda_nid_t preferred_pairs[] = {
7098 0x14, 0x02,
7099 0x17, 0x03,
7100 0x21, 0x02,
7101 0
7102 };
7103 struct alc_spec *spec = codec->spec;
7104
7105 alc_fixup_no_shutup(codec, fix, action);
7106
7107 switch (action) {
7108 case HDA_FIXUP_ACT_PRE_PROBE:
7109 snd_hda_apply_pincfgs(codec, pincfgs);
7110 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7111 spec->gen.preferred_dacs = preferred_pairs;
7112 break;
7113 }
7114}
7115
e43252db
KY
7116/* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
7117static void alc287_fixup_bind_dacs(struct hda_codec *codec,
7118 const struct hda_fixup *fix, int action)
7119{
7120 struct alc_spec *spec = codec->spec;
7121 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
7122 static const hda_nid_t preferred_pairs[] = {
7123 0x17, 0x02, 0x21, 0x03, 0
7124 };
7125
7126 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7127 return;
7128
7129 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7130 spec->gen.preferred_dacs = preferred_pairs;
7131 spec->gen.auto_mute_via_amp = 1;
fb6254df
KY
7132 if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
7133 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7134 0x0); /* Make sure 0x14 was disable */
7135 }
e43252db 7136}
c8c0a03e
KY
7137/* Fix none verb table of Headset Mic pin */
7138static void alc_fixup_headset_mic(struct hda_codec *codec,
7139 const struct hda_fixup *fix, int action)
7140{
7141 struct alc_spec *spec = codec->spec;
7142 static const struct hda_pintbl pincfgs[] = {
7143 { 0x19, 0x03a1103c },
7144 { }
7145 };
7146
7147 switch (action) {
7148 case HDA_FIXUP_ACT_PRE_PROBE:
7149 snd_hda_apply_pincfgs(codec, pincfgs);
7150 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
7151 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7152 break;
7153 }
7154}
e43252db 7155
61456da0
AG
7156static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
7157 const struct hda_fixup *fix, int action)
7158{
7159 /*
7160 * The Pin Complex 0x14 for the treble speakers is wrongly reported as
7161 * unconnected.
7162 * The Pin Complex 0x17 for the bass speakers has the lowest association
7163 * and sequence values so shift it up a bit to squeeze 0x14 in.
7164 */
7165 static const struct hda_pintbl pincfgs[] = {
7166 { 0x14, 0x90170110 }, // top/treble
7167 { 0x17, 0x90170111 }, // bottom/bass
7168 { }
7169 };
7170
7171 /*
7172 * Force DAC 0x02 for the bass speakers 0x17.
7173 */
7174 static const hda_nid_t conn[] = { 0x02 };
7175
7176 switch (action) {
7177 case HDA_FIXUP_ACT_PRE_PROBE:
7178 snd_hda_apply_pincfgs(codec, pincfgs);
7179 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
7180 break;
7181 }
7182
7183 cs35l41_fixup_i2c_two(codec, fix, action);
7184 alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
7185 alc245_fixup_hp_gpio_led(codec, fix, action);
7186}
7187
1e707769
KY
7188/*
7189 * ALC287 PCM hooks
7190 */
7191static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
7192 struct hda_codec *codec,
7193 struct snd_pcm_substream *substream,
7194 int action)
7195{
7196 alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7197 switch (action) {
7198 case HDA_GEN_PCM_ACT_OPEN:
7199 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
7200 break;
7201 case HDA_GEN_PCM_ACT_CLOSE:
7202 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7203 break;
7204 }
7205}
7206
fdb3f29d 7207static void __maybe_unused alc287_s4_power_gpio3_default(struct hda_codec *codec)
1e707769
KY
7208{
7209 if (is_s4_suspend(codec)) {
7210 alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */
7211 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
7212 }
7213}
7214
7215static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
7216 const struct hda_fixup *fix, int action)
7217{
7218 struct alc_spec *spec = codec->spec;
7219
7220 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7221 return;
fdb3f29d 7222#ifdef CONFIG_PM
1e707769 7223 spec->power_hook = alc287_s4_power_gpio3_default;
fdb3f29d 7224#endif
1e707769
KY
7225 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
7226}
7227
e43252db 7228
1d045db9 7229enum {
f73bbf63 7230 ALC269_FIXUP_GPIO2,
1d045db9
TI
7231 ALC269_FIXUP_SONY_VAIO,
7232 ALC275_FIXUP_SONY_VAIO_GPIO2,
7233 ALC269_FIXUP_DELL_M101Z,
7234 ALC269_FIXUP_SKU_IGNORE,
7235 ALC269_FIXUP_ASUS_G73JW,
e959f2be
PLB
7236 ALC269_FIXUP_ASUS_N7601ZM_PINS,
7237 ALC269_FIXUP_ASUS_N7601ZM,
1d045db9
TI
7238 ALC269_FIXUP_LENOVO_EAPD,
7239 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 7240 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 7241 ALC271_FIXUP_DMIC,
017f2a10 7242 ALC269_FIXUP_PCM_44K,
adabb3ec 7243 ALC269_FIXUP_STEREO_DMIC,
7c478f03 7244 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
7245 ALC269_FIXUP_QUANTA_MUTE,
7246 ALC269_FIXUP_LIFEBOOK,
2041d564 7247 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 7248 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 7249 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 7250 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
7251 ALC269_FIXUP_AMIC,
7252 ALC269_FIXUP_DMIC,
7253 ALC269VB_FIXUP_AMIC,
7254 ALC269VB_FIXUP_DMIC,
08fb0d0e 7255 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 7256 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 7257 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 7258 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 7259 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
7260 ALC269_FIXUP_HP_GPIO_MIC1_LED,
7261 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 7262 ALC269_FIXUP_INV_DMIC,
108cc108 7263 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 7264 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 7265 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 7266 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 7267 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
7268 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7269 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 7270 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 7271 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
1efcdd9c 7272 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
73bdd597
DH
7273 ALC269_FIXUP_HEADSET_MODE,
7274 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 7275 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
7276 ALC269_FIXUP_ASUS_X101_FUNC,
7277 ALC269_FIXUP_ASUS_X101_VERB,
7278 ALC269_FIXUP_ASUS_X101,
08a978db
DR
7279 ALC271_FIXUP_AMIC_MIC2,
7280 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 7281 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 7282 ALC269_FIXUP_ACER_AC700,
3e0d611b 7283 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 7284 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 7285 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
f882c4be 7286 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
8e35cd4a 7287 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 7288 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 7289 ALC283_FIXUP_CHROME_BOOK,
0202e99c 7290 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 7291 ALC282_FIXUP_ASUS_TX300,
1bb3e062 7292 ALC283_FIXUP_INT_MIC,
338cae56 7293 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
7294 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7295 ALC290_FIXUP_SUBWOOFER,
7296 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 7297 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 7298 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
7c9caa29 7299 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
5824ce8d 7300 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 7301 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 7302 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 7303 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 7304 ALC255_FIXUP_HEADSET_MODE,
31278997 7305 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 7306 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 7307 ALC292_FIXUP_TPT440_DOCK,
9a811230 7308 ALC292_FIXUP_TPT440,
abaa2274 7309 ALC283_FIXUP_HEADSET_MIC,
b3802783 7310 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 7311 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 7312 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 7313 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 7314 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 7315 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 7316 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 7317 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 7318 ALC280_FIXUP_HP_9480M,
c3bb2b52 7319 ALC245_FIXUP_HP_X360_AMP,
d94befbb 7320 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
c0621669 7321 ALC285_FIXUP_HP_ENVY_X360,
e1e62b98
KY
7322 ALC288_FIXUP_DELL_HEADSET_MODE,
7323 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
7324 ALC288_FIXUP_DELL_XPS_13,
7325 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 7326 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
7327 ALC292_FIXUP_DELL_E7X,
7328 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 7329 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 7330 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 7331 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 7332 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 7333 ALC275_FIXUP_DELL_XPS,
23adc192 7334 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 7335 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 7336 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 7337 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 7338 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 7339 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 7340 ALC285_FIXUP_SPEAKER2_TO_DAC1,
4b963ae1
AS
7341 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
7342 ALC285_FIXUP_ASUS_HEADSET_MIC,
b759a5f0 7343 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
8cc87c05
LJ
7344 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
7345 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
f883982d 7346 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 7347 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 7348 ALC292_FIXUP_TPT460,
dd9aa335 7349 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 7350 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 7351 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 7352 ALC269_FIXUP_ATIV_BOOK_8,
4ba5c853 7353 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
9eb5d0e6 7354 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
7355 ALC256_FIXUP_ASUS_HEADSET_MODE,
7356 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 7357 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
7358 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
7359 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 7360 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 7361 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 7362 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 7363 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 7364 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 7365 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
7366 ALC274_FIXUP_DELL_BIND_DACS,
7367 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 7368 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 7369 ALC298_FIXUP_TPT470_DOCK,
ae104a21 7370 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 7371 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 7372 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 7373 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 7374 ALC295_FIXUP_HP_X360,
8a328ac1 7375 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 7376 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 7377 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 7378 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 7379 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
7380 ALC294_FIXUP_ASUS_HEADSET_MIC,
7381 ALC294_FIXUP_ASUS_SPK,
89e3a568 7382 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 7383 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 7384 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 7385 ALC295_FIXUP_CHROME_BOOK,
8983eb60 7386 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
7387 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
7388 ALC225_FIXUP_WYSE_AUTO_MUTE,
7389 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 7390 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 7391 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 7392 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 7393 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 7394 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
f0d9da19 7395 ALC289_FIXUP_DELL_SPK1,
e79c2269
KY
7396 ALC289_FIXUP_DELL_SPK2,
7397 ALC289_FIXUP_DUAL_SPK,
f0d9da19 7398 ALC289_FIXUP_RTK_AMP_DUAL_SPK,
48e01504
CC
7399 ALC294_FIXUP_SPK2_TO_DAC1,
7400 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 7401 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 7402 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
724418b8
MA
7403 ALC294_FIXUP_ASUS_ALLY,
7404 ALC294_FIXUP_ASUS_ALLY_PINS,
7405 ALC294_FIXUP_ASUS_ALLY_VERBS,
7406 ALC294_FIXUP_ASUS_ALLY_SPEAKER,
8b33a134 7407 ALC294_FIXUP_ASUS_HPE,
1b94e59d 7408 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
7409 ALC294_FIXUP_ASUS_GX502_HP,
7410 ALC294_FIXUP_ASUS_GX502_PINS,
7411 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
7412 ALC294_FIXUP_ASUS_GU502_HP,
7413 ALC294_FIXUP_ASUS_GU502_PINS,
7414 ALC294_FIXUP_ASUS_GU502_VERBS,
c611e659 7415 ALC294_FIXUP_ASUS_G513_PINS,
bc2c2354 7416 ALC285_FIXUP_ASUS_G533Z_PINS,
f5a88b0a 7417 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 7418 ALC285_FIXUP_HP_MUTE_LED,
ca88eeb3 7419 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
0659400f 7420 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
e7d66cf7 7421 ALC236_FIXUP_HP_GPIO_LED,
24164f43 7422 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 7423 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
a2d57ebe 7424 ALC298_FIXUP_SAMSUNG_AMP,
14425f1f 7425 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
ef248d9b 7426 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 7427 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 7428 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 7429 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 7430 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 7431 ALC289_FIXUP_ASUS_GA401,
4b43d05a 7432 ALC289_FIXUP_ASUS_GA502,
f50a121d 7433 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 7434 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
7435 ALC269_FIXUP_CZC_B20,
7436 ALC269_FIXUP_CZC_TMI,
7437 ALC269_FIXUP_CZC_L101,
7438 ALC269_FIXUP_LEMOTE_A1802,
7439 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 7440 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
7441 ALC233_FIXUP_INTEL_NUC8_DMIC,
7442 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 7443 ALC256_FIXUP_INTEL_NUC10,
fc19d559 7444 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 7445 ALC274_FIXUP_HP_MIC,
8a8de09c 7446 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 7447 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 7448 ALC256_FIXUP_ASUS_HPE,
446b8185 7449 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 7450 ALC287_FIXUP_HP_GPIO_LED,
9e885770 7451 ALC256_FIXUP_HP_HEADSET_MIC,
5fc462c3 7452 ALC245_FIXUP_HP_GPIO_LED,
92666d45 7453 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 7454 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 7455 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 7456 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 7457 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 7458 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 7459 ALC295_FIXUP_ASUS_DACS,
5d84b531 7460 ALC295_FIXUP_HP_OMEN,
f2be77fe 7461 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 7462 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 7463 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 7464 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 7465 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
7466 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7467 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7468 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
56ec3e75 7469 ALC298_FIXUP_LENOVO_C940_DUET7,
0ac32a39 7470 ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
39815cdf 7471 ALC287_FIXUP_LENOVO_LEGION_7,
dd6dd6e3 7472 ALC287_FIXUP_13S_GEN2_SPEAKERS,
619764cc 7473 ALC256_FIXUP_SET_COEF_DEFAULTS,
1278cc5a 7474 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
174a7fb3 7475 ALC233_FIXUP_NO_AUDIO_JACK,
edca7cc4 7476 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
8f4c9042
BF
7477 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7478 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
d3dca026 7479 ALC287_FIXUP_LEGION_16ACHG6,
ae7abe36 7480 ALC287_FIXUP_CS35L41_I2C_2,
b3fbe536 7481 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
42320660 7482 ALC287_FIXUP_CS35L41_I2C_4,
07bcab93 7483 ALC245_FIXUP_CS35L41_SPI_2,
ce18f905 7484 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
07bcab93
LT
7485 ALC245_FIXUP_CS35L41_SPI_4,
7486 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
91502a9a 7487 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
309d7363 7488 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
1e24881d 7489 ALC287_FIXUP_LEGION_16ITHG6,
3790a3d6
PJ
7490 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
7491 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
9b714a59 7492 ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
2912cdda 7493 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
a4517c4f 7494 ALC236_FIXUP_DELL_DUAL_CODECS,
f7b069cf 7495 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
3babae91 7496 ALC287_FIXUP_TAS2781_I2C,
b5cb53fd 7497 ALC287_FIXUP_YOGA7_14ARB7_I2C,
93dc18e1 7498 ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
c99c26b1 7499 ALC245_FIXUP_HP_X360_MUTE_LEDS,
e43252db 7500 ALC287_FIXUP_THINKPAD_I2S_SPK,
d93eeca6 7501 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
c8c0a03e 7502 ALC2XX_FIXUP_HEADSET_MIC,
f0d9da19 7503 ALC289_FIXUP_DELL_CS35L41_SPI_2,
6ae90e90 7504 ALC294_FIXUP_CS35L41_I2C_2,
b2d6a1fd 7505 ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED,
bd2d8305 7506 ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
1e5dc398 7507 ALC256_FIXUP_HEADPHONE_AMP_VOL,
61456da0 7508 ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
c33f0d4f
ST
7509 ALC285_FIXUP_CS35L56_SPI_2,
7510 ALC285_FIXUP_CS35L56_I2C_2,
7511 ALC285_FIXUP_CS35L56_I2C_4,
7512 ALC285_FIXUP_ASUS_GA403U,
0672b017
VT
7513 ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
7514 ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
7515 ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
1e707769
KY
7516 ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
7517 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
f1d4e28b
KY
7518};
7519
56ec3e75
TI
7520/* A special fixup for Lenovo C940 and Yoga Duet 7;
7521 * both have the very same PCI SSID, and we need to apply different fixups
7522 * depending on the codec ID
7523 */
7524static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7525 const struct hda_fixup *fix,
7526 int action)
7527{
7528 int id;
7529
7530 if (codec->core.vendor_id == 0x10ec0298)
7531 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7532 else
7533 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7534 __snd_hda_apply_fixup(codec, id, action, 0);
7535}
7536
0ac32a39
WW
7537/* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
7538 * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
7539 * so we need to apply a different fixup in this case. The only DuetITL codec
7540 * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
7541 * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
7542 * have matched correctly by their codecs.
7543 */
7544static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
7545 const struct hda_fixup *fix,
7546 int action)
7547{
7548 int id;
7549
7550 if (codec->core.subsystem_id == 0x17aa3802)
7551 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
7552 else
7553 id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
7554 __snd_hda_apply_fixup(codec, id, action, 0);
7555}
7556
39815cdf
TI
7557/* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with
7558 * TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec);
7559 * we apply a corresponding fixup depending on the codec SSID instead
7560 */
7561static void alc287_fixup_lenovo_legion_7(struct hda_codec *codec,
7562 const struct hda_fixup *fix,
7563 int action)
7564{
7565 int id;
7566
7567 if (codec->core.subsystem_id == 0x17aa38a8)
7568 id = ALC287_FIXUP_TAS2781_I2C; /* Legion Pro 7 16ARX8H */
7569 else
7570 id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion 7i 16IAX7 */
7571 __snd_hda_apply_fixup(codec, id, action, 0);
7572}
7573
1727a771 7574static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
7575 [ALC269_FIXUP_GPIO2] = {
7576 .type = HDA_FIXUP_FUNC,
7577 .v.func = alc_fixup_gpio2,
7578 },
1d045db9 7579 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
7580 .type = HDA_FIXUP_PINCTLS,
7581 .v.pins = (const struct hda_pintbl[]) {
7582 {0x19, PIN_VREFGRD},
1d045db9
TI
7583 {}
7584 }
f1d4e28b 7585 },
1d045db9 7586 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
7587 .type = HDA_FIXUP_FUNC,
7588 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
7589 .chained = true,
7590 .chain_id = ALC269_FIXUP_SONY_VAIO
7591 },
7592 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 7593 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7594 .v.verbs = (const struct hda_verb[]) {
7595 /* Enables internal speaker */
7596 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7597 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7598 {}
7599 }
7600 },
7601 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 7602 .type = HDA_FIXUP_FUNC,
23d30f28 7603 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
7604 },
7605 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
7606 .type = HDA_FIXUP_PINS,
7607 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
7608 { 0x17, 0x99130111 }, /* subwoofer */
7609 { }
7610 }
7611 },
e959f2be
PLB
7612 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
7613 .type = HDA_FIXUP_PINS,
7614 .v.pins = (const struct hda_pintbl[]) {
7615 { 0x19, 0x03A11050 },
7616 { 0x1a, 0x03A11C30 },
7617 { 0x21, 0x03211420 },
7618 { }
7619 }
7620 },
7621 [ALC269_FIXUP_ASUS_N7601ZM] = {
7622 .type = HDA_FIXUP_VERBS,
7623 .v.verbs = (const struct hda_verb[]) {
7624 {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
7625 {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
7626 {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
7627 {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
7628 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
7629 {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
7630 { }
7631 },
7632 .chained = true,
7633 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
7634 },
1d045db9 7635 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 7636 .type = HDA_FIXUP_VERBS,
1d045db9
TI
7637 .v.verbs = (const struct hda_verb[]) {
7638 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7639 {}
7640 }
7641 },
7642 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 7643 .type = HDA_FIXUP_FUNC,
1d045db9
TI
7644 .v.func = alc269_fixup_hweq,
7645 .chained = true,
7646 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7647 },
e9bd7d5c
TI
7648 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7649 .type = HDA_FIXUP_FUNC,
7650 .v.func = alc_fixup_disable_aamix,
7651 .chained = true,
7652 .chain_id = ALC269_FIXUP_SONY_VAIO
7653 },
1d045db9 7654 [ALC271_FIXUP_DMIC] = {
1727a771 7655 .type = HDA_FIXUP_FUNC,
1d045db9 7656 .v.func = alc271_fixup_dmic,
f1d4e28b 7657 },
017f2a10 7658 [ALC269_FIXUP_PCM_44K] = {
1727a771 7659 .type = HDA_FIXUP_FUNC,
017f2a10 7660 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
7661 .chained = true,
7662 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 7663 },
adabb3ec 7664 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 7665 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
7666 .v.func = alc269_fixup_stereo_dmic,
7667 },
7c478f03
DH
7668 [ALC269_FIXUP_HEADSET_MIC] = {
7669 .type = HDA_FIXUP_FUNC,
7670 .v.func = alc269_fixup_headset_mic,
7671 },
24519911 7672 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 7673 .type = HDA_FIXUP_FUNC,
24519911
TI
7674 .v.func = alc269_fixup_quanta_mute,
7675 },
7676 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
7677 .type = HDA_FIXUP_PINS,
7678 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
7679 { 0x1a, 0x2101103f }, /* dock line-out */
7680 { 0x1b, 0x23a11040 }, /* dock mic-in */
7681 { }
7682 },
7683 .chained = true,
7684 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7685 },
2041d564
DH
7686 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7687 .type = HDA_FIXUP_PINS,
7688 .v.pins = (const struct hda_pintbl[]) {
7689 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7690 { }
7691 },
7692 },
cc7016ab
TI
7693 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7694 .type = HDA_FIXUP_PINS,
7695 .v.pins = (const struct hda_pintbl[]) {
7696 { 0x21, 0x0221102f }, /* HP out */
7697 { }
7698 },
7699 },
4df3fd17
TI
7700 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7701 .type = HDA_FIXUP_FUNC,
7702 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7703 },
fdcc968a
JMG
7704 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7705 .type = HDA_FIXUP_FUNC,
7706 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7707 },
7c9caa29
VK
7708 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
7709 .type = HDA_FIXUP_PINS,
7710 .v.pins = (const struct hda_pintbl[]) {
7711 { 0x18, 0x03a19020 }, /* headset mic */
7712 { 0x1b, 0x90170150 }, /* speaker */
7713 { }
7714 },
7715 },
a4297b5d 7716 [ALC269_FIXUP_AMIC] = {
1727a771
TI
7717 .type = HDA_FIXUP_PINS,
7718 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7719 { 0x14, 0x99130110 }, /* speaker */
7720 { 0x15, 0x0121401f }, /* HP out */
7721 { 0x18, 0x01a19c20 }, /* mic */
7722 { 0x19, 0x99a3092f }, /* int-mic */
7723 { }
7724 },
7725 },
7726 [ALC269_FIXUP_DMIC] = {
1727a771
TI
7727 .type = HDA_FIXUP_PINS,
7728 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7729 { 0x12, 0x99a3092f }, /* int-mic */
7730 { 0x14, 0x99130110 }, /* speaker */
7731 { 0x15, 0x0121401f }, /* HP out */
7732 { 0x18, 0x01a19c20 }, /* mic */
7733 { }
7734 },
7735 },
7736 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
7737 .type = HDA_FIXUP_PINS,
7738 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7739 { 0x14, 0x99130110 }, /* speaker */
7740 { 0x18, 0x01a19c20 }, /* mic */
7741 { 0x19, 0x99a3092f }, /* int-mic */
7742 { 0x21, 0x0121401f }, /* HP out */
7743 { }
7744 },
7745 },
2267ea97 7746 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7747 .type = HDA_FIXUP_PINS,
7748 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7749 { 0x12, 0x99a3092f }, /* int-mic */
7750 { 0x14, 0x99130110 }, /* speaker */
7751 { 0x18, 0x01a19c20 }, /* mic */
7752 { 0x21, 0x0121401f }, /* HP out */
7753 { }
7754 },
7755 },
08fb0d0e 7756 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7757 .type = HDA_FIXUP_FUNC,
08fb0d0e 7758 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7759 },
d06ac143
DH
7760 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7761 .type = HDA_FIXUP_FUNC,
7762 .v.func = alc269_fixup_hp_mute_led_mic1,
7763 },
08fb0d0e 7764 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7765 .type = HDA_FIXUP_FUNC,
08fb0d0e 7766 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7767 },
7f783bd5
TB
7768 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7769 .type = HDA_FIXUP_FUNC,
7770 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7771 .chained = true,
7772 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7773 },
9f5c6faf
TI
7774 [ALC269_FIXUP_HP_GPIO_LED] = {
7775 .type = HDA_FIXUP_FUNC,
7776 .v.func = alc269_fixup_hp_gpio_led,
7777 },
9c5dc3bf
KY
7778 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7779 .type = HDA_FIXUP_FUNC,
7780 .v.func = alc269_fixup_hp_gpio_mic1_led,
7781 },
7782 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7783 .type = HDA_FIXUP_FUNC,
7784 .v.func = alc269_fixup_hp_line1_mic1_led,
7785 },
693b613d 7786 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7787 .type = HDA_FIXUP_FUNC,
9d36a7dc 7788 .v.func = alc_fixup_inv_dmic,
693b613d 7789 },
9b745ab8
TI
7790 [ALC269_FIXUP_NO_SHUTUP] = {
7791 .type = HDA_FIXUP_FUNC,
7792 .v.func = alc_fixup_no_shutup,
7793 },
108cc108 7794 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7795 .type = HDA_FIXUP_PINS,
7796 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7797 { 0x19, 0x23a11040 }, /* dock mic */
7798 { 0x1b, 0x2121103f }, /* dock headphone */
7799 { }
7800 },
7801 .chained = true,
7802 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7803 },
b590b38c
TI
7804 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7805 .type = HDA_FIXUP_FUNC,
7806 .v.func = alc269_fixup_limit_int_mic_boost,
7807 .chained = true,
7808 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7809 },
108cc108 7810 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7811 .type = HDA_FIXUP_FUNC,
108cc108 7812 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7813 .chained = true,
7814 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7815 },
73bdd597
DH
7816 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7817 .type = HDA_FIXUP_PINS,
7818 .v.pins = (const struct hda_pintbl[]) {
7819 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7820 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7821 { }
7822 },
7823 .chained = true,
7824 .chain_id = ALC269_FIXUP_HEADSET_MODE
7825 },
7826 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7827 .type = HDA_FIXUP_PINS,
7828 .v.pins = (const struct hda_pintbl[]) {
7829 { 0x16, 0x21014020 }, /* dock line out */
7830 { 0x19, 0x21a19030 }, /* dock mic */
7831 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7832 { }
7833 },
7834 .chained = true,
7835 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7836 },
338cae56
DH
7837 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7838 .type = HDA_FIXUP_PINS,
7839 .v.pins = (const struct hda_pintbl[]) {
7840 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7841 { }
7842 },
7843 .chained = true,
7844 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7845 },
fcc6c877
KY
7846 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7847 .type = HDA_FIXUP_PINS,
7848 .v.pins = (const struct hda_pintbl[]) {
7849 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7850 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7851 { }
7852 },
7853 .chained = true,
7854 .chain_id = ALC269_FIXUP_HEADSET_MODE
7855 },
73bdd597
DH
7856 [ALC269_FIXUP_HEADSET_MODE] = {
7857 .type = HDA_FIXUP_FUNC,
7858 .v.func = alc_fixup_headset_mode,
6676f308 7859 .chained = true,
b3802783 7860 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7861 },
7862 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7863 .type = HDA_FIXUP_FUNC,
7864 .v.func = alc_fixup_headset_mode_no_hp_mic,
7865 },
7819717b
TI
7866 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7867 .type = HDA_FIXUP_PINS,
7868 .v.pins = (const struct hda_pintbl[]) {
7869 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7870 { }
7871 },
7872 .chained = true,
7873 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7874 },
88cfcf86
DH
7875 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7876 .type = HDA_FIXUP_PINS,
7877 .v.pins = (const struct hda_pintbl[]) {
7878 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7879 { }
7880 },
fbc78ad6
DH
7881 .chained = true,
7882 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7883 },
0fbf21c3 7884 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7885 .type = HDA_FIXUP_PINS,
7886 .v.pins = (const struct hda_pintbl[]) {
7887 {0x12, 0x90a60130},
7888 {0x13, 0x40000000},
7889 {0x14, 0x90170110},
7890 {0x18, 0x411111f0},
7891 {0x19, 0x04a11040},
7892 {0x1a, 0x411111f0},
7893 {0x1b, 0x90170112},
7894 {0x1d, 0x40759a05},
7895 {0x1e, 0x411111f0},
7896 {0x21, 0x04211020},
7897 { }
7898 },
e2744fd7
AB
7899 .chained = true,
7900 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7901 },
a2ef03fe
TE
7902 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7903 .type = HDA_FIXUP_FUNC,
7904 .v.func = alc298_fixup_huawei_mbx_stereo,
7905 .chained = true,
7906 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7907 },
d240d1dc
DH
7908 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7909 .type = HDA_FIXUP_FUNC,
7910 .v.func = alc269_fixup_x101_headset_mic,
7911 },
7912 [ALC269_FIXUP_ASUS_X101_VERB] = {
7913 .type = HDA_FIXUP_VERBS,
7914 .v.verbs = (const struct hda_verb[]) {
7915 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7916 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7917 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7918 { }
7919 },
7920 .chained = true,
7921 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7922 },
7923 [ALC269_FIXUP_ASUS_X101] = {
7924 .type = HDA_FIXUP_PINS,
7925 .v.pins = (const struct hda_pintbl[]) {
7926 { 0x18, 0x04a1182c }, /* Headset mic */
7927 { }
7928 },
7929 .chained = true,
7930 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7931 },
08a978db 7932 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7933 .type = HDA_FIXUP_PINS,
7934 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7935 { 0x14, 0x99130110 }, /* speaker */
7936 { 0x19, 0x01a19c20 }, /* mic */
7937 { 0x1b, 0x99a7012f }, /* int-mic */
7938 { 0x21, 0x0121401f }, /* HP out */
7939 { }
7940 },
7941 },
7942 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7943 .type = HDA_FIXUP_FUNC,
08a978db
DR
7944 .v.func = alc271_hp_gate_mic_jack,
7945 .chained = true,
7946 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7947 },
b1e8972e
OR
7948 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7949 .type = HDA_FIXUP_FUNC,
7950 .v.func = alc269_fixup_limit_int_mic_boost,
7951 .chained = true,
7952 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7953 },
42397004
DR
7954 [ALC269_FIXUP_ACER_AC700] = {
7955 .type = HDA_FIXUP_PINS,
7956 .v.pins = (const struct hda_pintbl[]) {
7957 { 0x12, 0x99a3092f }, /* int-mic */
7958 { 0x14, 0x99130110 }, /* speaker */
7959 { 0x18, 0x03a11c20 }, /* mic */
7960 { 0x1e, 0x0346101e }, /* SPDIF1 */
7961 { 0x21, 0x0321101f }, /* HP out */
7962 { }
7963 },
7964 .chained = true,
7965 .chain_id = ALC271_FIXUP_DMIC,
7966 },
3e0d611b
DH
7967 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7968 .type = HDA_FIXUP_FUNC,
7969 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7970 .chained = true,
7971 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7972 },
2cede303
OR
7973 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7974 .type = HDA_FIXUP_FUNC,
7975 .v.func = alc269_fixup_limit_int_mic_boost,
7976 .chained = true,
7977 .chain_id = ALC269VB_FIXUP_DMIC,
7978 },
23870831
TI
7979 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7980 .type = HDA_FIXUP_VERBS,
7981 .v.verbs = (const struct hda_verb[]) {
7982 /* class-D output amp +5dB */
7983 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7984 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7985 {}
7986 },
7987 .chained = true,
7988 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7989 },
f882c4be
MT
7990 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7991 .type = HDA_FIXUP_PINS,
7992 .v.pins = (const struct hda_pintbl[]) {
7993 { 0x18, 0x01a110f0 }, /* use as headset mic */
7994 { }
7995 },
7996 .chained = true,
7997 .chain_id = ALC269_FIXUP_HEADSET_MIC
7998 },
8e35cd4a
DH
7999 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
8000 .type = HDA_FIXUP_FUNC,
8001 .v.func = alc269_fixup_limit_int_mic_boost,
8002 .chained = true,
8003 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
8004 },
02b504d9
AA
8005 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
8006 .type = HDA_FIXUP_PINS,
8007 .v.pins = (const struct hda_pintbl[]) {
8008 { 0x12, 0x99a3092f }, /* int-mic */
8009 { 0x18, 0x03a11d20 }, /* mic */
8010 { 0x19, 0x411111f0 }, /* Unused bogus pin */
8011 { }
8012 },
8013 },
cd217a63
KY
8014 [ALC283_FIXUP_CHROME_BOOK] = {
8015 .type = HDA_FIXUP_FUNC,
8016 .v.func = alc283_fixup_chromebook,
8017 },
0202e99c
KY
8018 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
8019 .type = HDA_FIXUP_FUNC,
8020 .v.func = alc283_fixup_sense_combo_jack,
8021 .chained = true,
8022 .chain_id = ALC283_FIXUP_CHROME_BOOK,
8023 },
7bba2157
TI
8024 [ALC282_FIXUP_ASUS_TX300] = {
8025 .type = HDA_FIXUP_FUNC,
8026 .v.func = alc282_fixup_asus_tx300,
8027 },
1bb3e062
KY
8028 [ALC283_FIXUP_INT_MIC] = {
8029 .type = HDA_FIXUP_VERBS,
8030 .v.verbs = (const struct hda_verb[]) {
8031 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
8032 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
8033 { }
8034 },
8035 .chained = true,
8036 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8037 },
0f4881dc
DH
8038 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
8039 .type = HDA_FIXUP_PINS,
8040 .v.pins = (const struct hda_pintbl[]) {
8041 { 0x17, 0x90170112 }, /* subwoofer */
8042 { }
8043 },
8044 .chained = true,
8045 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
8046 },
8047 [ALC290_FIXUP_SUBWOOFER] = {
8048 .type = HDA_FIXUP_PINS,
8049 .v.pins = (const struct hda_pintbl[]) {
8050 { 0x17, 0x90170112 }, /* subwoofer */
8051 { }
8052 },
8053 .chained = true,
8054 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
8055 },
338cae56
DH
8056 [ALC290_FIXUP_MONO_SPEAKERS] = {
8057 .type = HDA_FIXUP_FUNC,
8058 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
8059 },
8060 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
8061 .type = HDA_FIXUP_FUNC,
8062 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
8063 .chained = true,
8064 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8065 },
b67ae3f1
DH
8066 [ALC269_FIXUP_THINKPAD_ACPI] = {
8067 .type = HDA_FIXUP_FUNC,
d5a6cabf 8068 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
8069 .chained = true,
8070 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 8071 },
56f27013
DH
8072 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
8073 .type = HDA_FIXUP_FUNC,
8074 .v.func = alc_fixup_inv_dmic,
8075 .chained = true,
8076 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8077 },
5824ce8d 8078 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
8079 .type = HDA_FIXUP_PINS,
8080 .v.pins = (const struct hda_pintbl[]) {
8081 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8082 { }
5824ce8d
CC
8083 },
8084 .chained = true,
17d30460 8085 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 8086 },
615966ad
CC
8087 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8088 .type = HDA_FIXUP_PINS,
8089 .v.pins = (const struct hda_pintbl[]) {
8090 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8091 { }
8092 },
8093 .chained = true,
8094 .chain_id = ALC255_FIXUP_HEADSET_MODE
8095 },
9a22a8f5
KY
8096 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8097 .type = HDA_FIXUP_PINS,
8098 .v.pins = (const struct hda_pintbl[]) {
8099 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8100 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8101 { }
8102 },
8103 .chained = true,
8104 .chain_id = ALC255_FIXUP_HEADSET_MODE
8105 },
31278997
KY
8106 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
8107 .type = HDA_FIXUP_PINS,
8108 .v.pins = (const struct hda_pintbl[]) {
8109 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8110 { }
8111 },
8112 .chained = true,
8113 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8114 },
9a22a8f5
KY
8115 [ALC255_FIXUP_HEADSET_MODE] = {
8116 .type = HDA_FIXUP_FUNC,
8117 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 8118 .chained = true,
b3802783 8119 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 8120 },
31278997
KY
8121 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
8122 .type = HDA_FIXUP_FUNC,
8123 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
8124 },
a22aa26f
KY
8125 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8126 .type = HDA_FIXUP_PINS,
8127 .v.pins = (const struct hda_pintbl[]) {
8128 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8129 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8130 { }
8131 },
8132 .chained = true,
8133 .chain_id = ALC269_FIXUP_HEADSET_MODE
8134 },
1c37c223 8135 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 8136 .type = HDA_FIXUP_FUNC,
7f57d803 8137 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
8138 .chained = true,
8139 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
8140 },
9a811230
TI
8141 [ALC292_FIXUP_TPT440] = {
8142 .type = HDA_FIXUP_FUNC,
157f0b7f 8143 .v.func = alc_fixup_disable_aamix,
9a811230
TI
8144 .chained = true,
8145 .chain_id = ALC292_FIXUP_TPT440_DOCK,
8146 },
abaa2274 8147 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
8148 .type = HDA_FIXUP_PINS,
8149 .v.pins = (const struct hda_pintbl[]) {
8150 { 0x19, 0x04a110f0 },
8151 { },
8152 },
8153 },
b3802783 8154 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 8155 .type = HDA_FIXUP_FUNC,
8a503555 8156 .v.func = alc_fixup_micmute_led,
00ef9940 8157 },
1a22e775
TI
8158 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
8159 .type = HDA_FIXUP_PINS,
8160 .v.pins = (const struct hda_pintbl[]) {
8161 { 0x12, 0x90a60130 },
8162 { 0x14, 0x90170110 },
8163 { 0x17, 0x40000008 },
8164 { 0x18, 0x411111f0 },
0420694d 8165 { 0x19, 0x01a1913c },
1a22e775
TI
8166 { 0x1a, 0x411111f0 },
8167 { 0x1b, 0x411111f0 },
8168 { 0x1d, 0x40f89b2d },
8169 { 0x1e, 0x411111f0 },
8170 { 0x21, 0x0321101f },
8171 { },
8172 },
8173 },
c8426b27
TI
8174 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
8175 .type = HDA_FIXUP_FUNC,
8176 .v.func = alc269vb_fixup_aspire_e1_coef,
8177 },
7a5255f1
DH
8178 [ALC280_FIXUP_HP_GPIO4] = {
8179 .type = HDA_FIXUP_FUNC,
8180 .v.func = alc280_fixup_hp_gpio4,
8181 },
eaa8e5ef
KY
8182 [ALC286_FIXUP_HP_GPIO_LED] = {
8183 .type = HDA_FIXUP_FUNC,
8184 .v.func = alc286_fixup_hp_gpio_led,
8185 },
33f4acd3
DH
8186 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
8187 .type = HDA_FIXUP_FUNC,
8188 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
8189 },
b4b33f9d
TC
8190 [ALC280_FIXUP_HP_DOCK_PINS] = {
8191 .type = HDA_FIXUP_PINS,
8192 .v.pins = (const struct hda_pintbl[]) {
8193 { 0x1b, 0x21011020 }, /* line-out */
8194 { 0x1a, 0x01a1903c }, /* headset mic */
8195 { 0x18, 0x2181103f }, /* line-in */
8196 { },
8197 },
8198 .chained = true,
8199 .chain_id = ALC280_FIXUP_HP_GPIO4
8200 },
04d5466a
JK
8201 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
8202 .type = HDA_FIXUP_PINS,
8203 .v.pins = (const struct hda_pintbl[]) {
8204 { 0x1b, 0x21011020 }, /* line-out */
8205 { 0x18, 0x2181103f }, /* line-in */
8206 { },
8207 },
8208 .chained = true,
8209 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
8210 },
98973f2f
KP
8211 [ALC280_FIXUP_HP_9480M] = {
8212 .type = HDA_FIXUP_FUNC,
8213 .v.func = alc280_fixup_hp_9480m,
8214 },
c3bb2b52
TI
8215 [ALC245_FIXUP_HP_X360_AMP] = {
8216 .type = HDA_FIXUP_FUNC,
8217 .v.func = alc245_fixup_hp_x360_amp,
5fc462c3
JC
8218 .chained = true,
8219 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 8220 },
e1e62b98
KY
8221 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
8222 .type = HDA_FIXUP_FUNC,
8223 .v.func = alc_fixup_headset_mode_dell_alc288,
8224 .chained = true,
b3802783 8225 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
8226 },
8227 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8228 .type = HDA_FIXUP_PINS,
8229 .v.pins = (const struct hda_pintbl[]) {
8230 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8231 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8232 { }
8233 },
8234 .chained = true,
8235 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
8236 },
831bfdf9
HW
8237 [ALC288_FIXUP_DISABLE_AAMIX] = {
8238 .type = HDA_FIXUP_FUNC,
8239 .v.func = alc_fixup_disable_aamix,
8240 .chained = true,
d44a6864 8241 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
8242 },
8243 [ALC288_FIXUP_DELL_XPS_13] = {
8244 .type = HDA_FIXUP_FUNC,
8245 .v.func = alc_fixup_dell_xps13,
8246 .chained = true,
8247 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
8248 },
8b99aba7
TI
8249 [ALC292_FIXUP_DISABLE_AAMIX] = {
8250 .type = HDA_FIXUP_FUNC,
8251 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
8252 .chained = true,
8253 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 8254 },
c04017ea
DH
8255 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
8256 .type = HDA_FIXUP_FUNC,
8257 .v.func = alc_fixup_disable_aamix,
8258 .chained = true,
8259 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
8260 },
5fab5829 8261 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
8262 .type = HDA_FIXUP_FUNC,
8263 .v.func = alc_fixup_dell_xps13,
8264 .chained = true,
8265 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
8266 },
5fab5829
TI
8267 [ALC292_FIXUP_DELL_E7X] = {
8268 .type = HDA_FIXUP_FUNC,
8a503555 8269 .v.func = alc_fixup_micmute_led,
5fab5829
TI
8270 /* micmute fixup must be applied at last */
8271 .chained_before = true,
8272 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
8273 },
54324221
JM
8274 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
8275 .type = HDA_FIXUP_PINS,
8276 .v.pins = (const struct hda_pintbl[]) {
8277 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
8278 { }
8279 },
8280 .chained_before = true,
8281 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8282 },
977e6276
KY
8283 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8284 .type = HDA_FIXUP_PINS,
8285 .v.pins = (const struct hda_pintbl[]) {
8286 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8287 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8288 { }
8289 },
8290 .chained = true,
8291 .chain_id = ALC269_FIXUP_HEADSET_MODE
8292 },
2f726aec
HW
8293 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
8294 .type = HDA_FIXUP_PINS,
8295 .v.pins = (const struct hda_pintbl[]) {
8296 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8297 { }
8298 },
8299 .chained = true,
8300 .chain_id = ALC269_FIXUP_HEADSET_MODE
8301 },
6ed1131f
KY
8302 [ALC275_FIXUP_DELL_XPS] = {
8303 .type = HDA_FIXUP_VERBS,
8304 .v.verbs = (const struct hda_verb[]) {
8305 /* Enables internal speaker */
8306 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
8307 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
8308 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
8309 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
8310 {}
8311 }
8312 },
23adc192
HW
8313 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
8314 .type = HDA_FIXUP_FUNC,
8315 .v.func = alc_fixup_disable_aamix,
8316 .chained = true,
8317 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8318 },
3694cb29
K
8319 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
8320 .type = HDA_FIXUP_FUNC,
8321 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
8322 },
d1ee66c5
PC
8323 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
8324 .type = HDA_FIXUP_FUNC,
8325 .v.func = alc_fixup_inv_dmic,
8326 .chained = true,
8327 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
8328 },
8329 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
8330 .type = HDA_FIXUP_FUNC,
8331 .v.func = alc269_fixup_limit_int_mic_boost
8332 },
3b43b71f
KHF
8333 [ALC255_FIXUP_DELL_SPK_NOISE] = {
8334 .type = HDA_FIXUP_FUNC,
8335 .v.func = alc_fixup_disable_aamix,
8336 .chained = true,
8337 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8338 },
d1dd4211
KY
8339 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
8340 .type = HDA_FIXUP_FUNC,
8341 .v.func = alc_fixup_disable_mic_vref,
8342 .chained = true,
8343 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8344 },
2ae95577
DH
8345 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
8346 .type = HDA_FIXUP_VERBS,
8347 .v.verbs = (const struct hda_verb[]) {
8348 /* Disable pass-through path for FRONT 14h */
8349 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8350 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8351 {}
8352 },
8353 .chained = true,
d1dd4211 8354 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 8355 },
f883982d
TI
8356 [ALC280_FIXUP_HP_HEADSET_MIC] = {
8357 .type = HDA_FIXUP_FUNC,
8358 .v.func = alc_fixup_disable_aamix,
8359 .chained = true,
8360 .chain_id = ALC269_FIXUP_HEADSET_MIC,
8361 },
e549d190
HW
8362 [ALC221_FIXUP_HP_FRONT_MIC] = {
8363 .type = HDA_FIXUP_PINS,
8364 .v.pins = (const struct hda_pintbl[]) {
8365 { 0x19, 0x02a19020 }, /* Front Mic */
8366 { }
8367 },
8368 },
c636b95e
SE
8369 [ALC292_FIXUP_TPT460] = {
8370 .type = HDA_FIXUP_FUNC,
8371 .v.func = alc_fixup_tpt440_dock,
8372 .chained = true,
8373 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
8374 },
dd9aa335
HW
8375 [ALC298_FIXUP_SPK_VOLUME] = {
8376 .type = HDA_FIXUP_FUNC,
8377 .v.func = alc298_fixup_speaker_volume,
59ec4b57 8378 .chained = true,
2f726aec 8379 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 8380 },
f86de9b1
KY
8381 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
8382 .type = HDA_FIXUP_FUNC,
8383 .v.func = alc298_fixup_speaker_volume,
8384 },
e312a869
TI
8385 [ALC295_FIXUP_DISABLE_DAC3] = {
8386 .type = HDA_FIXUP_FUNC,
8387 .v.func = alc295_fixup_disable_dac3,
8388 },
d2cd795c
JK
8389 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
8390 .type = HDA_FIXUP_FUNC,
8391 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
8392 .chained = true,
8393 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 8394 },
4b963ae1
AS
8395 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
8396 .type = HDA_FIXUP_FUNC,
8397 .v.func = alc285_fixup_speaker2_to_dac1,
8398 .chained = true,
8399 .chain_id = ALC245_FIXUP_CS35L41_SPI_2
8400 },
8401 [ALC285_FIXUP_ASUS_HEADSET_MIC] = {
8402 .type = HDA_FIXUP_PINS,
8403 .v.pins = (const struct hda_pintbl[]) {
8404 { 0x19, 0x03a11050 },
8405 { 0x1b, 0x03a11c30 },
8406 { }
8407 },
8408 .chained = true,
8409 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
8410 },
b759a5f0
LJ
8411 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
8412 .type = HDA_FIXUP_PINS,
8413 .v.pins = (const struct hda_pintbl[]) {
8414 { 0x14, 0x90170120 },
8415 { }
8416 },
8417 .chained = true,
8418 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
8419 },
8cc87c05
LJ
8420 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
8421 .type = HDA_FIXUP_FUNC,
8422 .v.func = alc285_fixup_speaker2_to_dac1,
8423 .chained = true,
8424 .chain_id = ALC287_FIXUP_CS35L41_I2C_2
8425 },
8426 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
8427 .type = HDA_FIXUP_PINS,
8428 .v.pins = (const struct hda_pintbl[]) {
8429 { 0x19, 0x03a11050 },
8430 { 0x1b, 0x03a11c30 },
8431 { }
8432 },
8433 .chained = true,
8434 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
8435 },
fd06c77e
KHF
8436 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
8437 .type = HDA_FIXUP_PINS,
8438 .v.pins = (const struct hda_pintbl[]) {
8439 { 0x1b, 0x90170151 },
8440 { }
8441 },
8442 .chained = true,
8443 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8444 },
823ff161
GM
8445 [ALC269_FIXUP_ATIV_BOOK_8] = {
8446 .type = HDA_FIXUP_FUNC,
8447 .v.func = alc_fixup_auto_mute_via_amp,
8448 .chained = true,
8449 .chain_id = ALC269_FIXUP_NO_SHUTUP
8450 },
4ba5c853
MT
8451 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
8452 .type = HDA_FIXUP_PINS,
8453 .v.pins = (const struct hda_pintbl[]) {
8454 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8455 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
8456 { }
8457 },
8458 .chained = true,
8459 .chain_id = ALC269_FIXUP_HEADSET_MODE
8460 },
9eb5d0e6
KY
8461 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
8462 .type = HDA_FIXUP_PINS,
8463 .v.pins = (const struct hda_pintbl[]) {
8464 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8465 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
8466 { }
8467 },
8468 .chained = true,
8469 .chain_id = ALC269_FIXUP_HEADSET_MODE
8470 },
c1732ede
CC
8471 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
8472 .type = HDA_FIXUP_FUNC,
8473 .v.func = alc_fixup_headset_mode,
8474 },
8475 [ALC256_FIXUP_ASUS_MIC] = {
8476 .type = HDA_FIXUP_PINS,
8477 .v.pins = (const struct hda_pintbl[]) {
8478 { 0x13, 0x90a60160 }, /* use as internal mic */
8479 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8480 { }
8481 },
8482 .chained = true,
8483 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8484 },
eeed4cd1 8485 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
8486 .type = HDA_FIXUP_FUNC,
8487 /* Set up GPIO2 for the speaker amp */
8488 .v.func = alc_fixup_gpio4,
eeed4cd1 8489 },
216d7aeb
CC
8490 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8491 .type = HDA_FIXUP_PINS,
8492 .v.pins = (const struct hda_pintbl[]) {
8493 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8494 { }
8495 },
8496 .chained = true,
8497 .chain_id = ALC269_FIXUP_HEADSET_MIC
8498 },
8499 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
8500 .type = HDA_FIXUP_VERBS,
8501 .v.verbs = (const struct hda_verb[]) {
8502 /* Enables internal speaker */
8503 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
8504 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
8505 {}
8506 },
8507 .chained = true,
8508 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8509 },
ca169cc2
KY
8510 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
8511 .type = HDA_FIXUP_FUNC,
8512 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
8513 .chained = true,
8514 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 8515 },
ea5c7eba
JHP
8516 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
8517 .type = HDA_FIXUP_VERBS,
8518 .v.verbs = (const struct hda_verb[]) {
8519 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8520 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8521 { }
8522 },
8523 .chained = true,
8524 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
8525 },
f33f79f3
HW
8526 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
8527 .type = HDA_FIXUP_PINS,
8528 .v.pins = (const struct hda_pintbl[]) {
8529 /* Change the mic location from front to right, otherwise there are
8530 two front mics with the same name, pulseaudio can't handle them.
8531 This is just a temporary workaround, after applying this fixup,
8532 there will be one "Front Mic" and one "Mic" in this machine.
8533 */
8534 { 0x1a, 0x04a19040 },
8535 { }
8536 },
8537 },
5f364135
KY
8538 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
8539 .type = HDA_FIXUP_PINS,
8540 .v.pins = (const struct hda_pintbl[]) {
8541 { 0x16, 0x0101102f }, /* Rear Headset HP */
8542 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
8543 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
8544 { 0x1b, 0x02011020 },
8545 { }
8546 },
8547 .chained = true,
52e4e368
KHF
8548 .chain_id = ALC225_FIXUP_S3_POP_NOISE
8549 },
8550 [ALC225_FIXUP_S3_POP_NOISE] = {
8551 .type = HDA_FIXUP_FUNC,
8552 .v.func = alc225_fixup_s3_pop_noise,
8553 .chained = true,
5f364135
KY
8554 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8555 },
b84e8436
PH
8556 [ALC700_FIXUP_INTEL_REFERENCE] = {
8557 .type = HDA_FIXUP_VERBS,
8558 .v.verbs = (const struct hda_verb[]) {
8559 /* Enables internal speaker */
8560 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
8561 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
8562 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
8563 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
8564 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
8565 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
8566 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
8567 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
8568 {}
8569 }
8570 },
92266651
KY
8571 [ALC274_FIXUP_DELL_BIND_DACS] = {
8572 .type = HDA_FIXUP_FUNC,
8573 .v.func = alc274_fixup_bind_dacs,
8574 .chained = true,
8575 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
8576 },
8577 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
8578 .type = HDA_FIXUP_PINS,
8579 .v.pins = (const struct hda_pintbl[]) {
8580 { 0x1b, 0x0401102f },
8581 { }
8582 },
8583 .chained = true,
8584 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
8585 },
399c01aa 8586 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
8587 .type = HDA_FIXUP_FUNC,
8588 .v.func = alc_fixup_tpt470_dock,
8589 .chained = true,
8590 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
8591 },
399c01aa
TI
8592 [ALC298_FIXUP_TPT470_DOCK] = {
8593 .type = HDA_FIXUP_FUNC,
8594 .v.func = alc_fixup_tpt470_dacs,
8595 .chained = true,
8596 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
8597 },
ae104a21
KY
8598 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
8599 .type = HDA_FIXUP_PINS,
8600 .v.pins = (const struct hda_pintbl[]) {
8601 { 0x14, 0x0201101f },
8602 { }
8603 },
8604 .chained = true,
8605 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8606 },
f0ba9d69
KY
8607 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
8608 .type = HDA_FIXUP_PINS,
8609 .v.pins = (const struct hda_pintbl[]) {
8610 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8611 { }
8612 },
3ce0d5aa
HW
8613 .chained = true,
8614 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 8615 },
bbf8ff6b
TB
8616 [ALC295_FIXUP_HP_X360] = {
8617 .type = HDA_FIXUP_FUNC,
8618 .v.func = alc295_fixup_hp_top_speakers,
8619 .chained = true,
8620 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
8621 },
8622 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8623 .type = HDA_FIXUP_PINS,
8624 .v.pins = (const struct hda_pintbl[]) {
8625 { 0x19, 0x0181313f},
8626 { }
8627 },
8628 .chained = true,
8629 .chain_id = ALC269_FIXUP_HEADSET_MIC
8630 },
c4cfcf6f
HW
8631 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8632 .type = HDA_FIXUP_FUNC,
8633 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
8634 .chained = true,
8635 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 8636 },
e8ed64b0
GKK
8637 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8638 .type = HDA_FIXUP_FUNC,
8639 .v.func = alc_fixup_auto_mute_via_amp,
8640 },
33aaebd4
CC
8641 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8642 .type = HDA_FIXUP_PINS,
8643 .v.pins = (const struct hda_pintbl[]) {
8644 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8645 { }
8646 },
8647 .chained = true,
8648 .chain_id = ALC269_FIXUP_HEADSET_MIC
8649 },
d8ae458e
CC
8650 [ALC294_FIXUP_ASUS_MIC] = {
8651 .type = HDA_FIXUP_PINS,
8652 .v.pins = (const struct hda_pintbl[]) {
8653 { 0x13, 0x90a60160 }, /* use as internal mic */
8654 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8655 { }
8656 },
8657 .chained = true,
ef9ddb9d 8658 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 8659 },
4e051106
JHP
8660 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8661 .type = HDA_FIXUP_PINS,
8662 .v.pins = (const struct hda_pintbl[]) {
82b01149 8663 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
8664 { }
8665 },
8666 .chained = true,
ef9ddb9d 8667 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
8668 },
8669 [ALC294_FIXUP_ASUS_SPK] = {
8670 .type = HDA_FIXUP_VERBS,
8671 .v.verbs = (const struct hda_verb[]) {
8672 /* Set EAPD high */
8673 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8674 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
8675 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8676 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
8677 { }
8678 },
8679 .chained = true,
8680 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8681 },
c8a9afa6 8682 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 8683 .type = HDA_FIXUP_FUNC,
c8a9afa6 8684 .v.func = alc295_fixup_chromebook,
8983eb60
KY
8685 .chained = true,
8686 .chain_id = ALC225_FIXUP_HEADSET_JACK
8687 },
8688 [ALC225_FIXUP_HEADSET_JACK] = {
8689 .type = HDA_FIXUP_FUNC,
8690 .v.func = alc_fixup_headset_jack,
e854747d 8691 },
89e3a568
JS
8692 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8693 .type = HDA_FIXUP_PINS,
8694 .v.pins = (const struct hda_pintbl[]) {
8695 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8696 { }
8697 },
8698 .chained = true,
8699 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8700 },
c8c6ee61
HW
8701 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8702 .type = HDA_FIXUP_VERBS,
8703 .v.verbs = (const struct hda_verb[]) {
8704 /* Disable PCBEEP-IN passthrough */
8705 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8706 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8707 { }
8708 },
8709 .chained = true,
8710 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8711 },
cbc05fd6
JHP
8712 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8713 .type = HDA_FIXUP_PINS,
8714 .v.pins = (const struct hda_pintbl[]) {
8715 { 0x19, 0x03a11130 },
8716 { 0x1a, 0x90a60140 }, /* use as internal mic */
8717 { }
8718 },
8719 .chained = true,
8720 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8721 },
136824ef
KY
8722 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8723 .type = HDA_FIXUP_PINS,
8724 .v.pins = (const struct hda_pintbl[]) {
8725 { 0x16, 0x01011020 }, /* Rear Line out */
8726 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8727 { }
8728 },
8729 .chained = true,
8730 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8731 },
8732 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8733 .type = HDA_FIXUP_FUNC,
8734 .v.func = alc_fixup_auto_mute_via_amp,
8735 .chained = true,
8736 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8737 },
8738 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8739 .type = HDA_FIXUP_FUNC,
8740 .v.func = alc_fixup_disable_mic_vref,
8741 .chained = true,
8742 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8743 },
667a8f73
JHP
8744 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8745 .type = HDA_FIXUP_VERBS,
8746 .v.verbs = (const struct hda_verb[]) {
8747 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8748 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8749 { }
8750 },
8751 .chained = true,
8752 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8753 },
8c8967a7
DD
8754 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8755 .type = HDA_FIXUP_PINS,
8756 .v.pins = (const struct hda_pintbl[]) {
8757 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8758 { }
8759 },
8760 .chained = true,
8761 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8762 },
e1037354
JHP
8763 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8764 .type = HDA_FIXUP_PINS,
8765 .v.pins = (const struct hda_pintbl[]) {
8766 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8767 { }
8768 },
8769 .chained = true,
8770 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8771 },
e2a829b3
BR
8772 [ALC299_FIXUP_PREDATOR_SPK] = {
8773 .type = HDA_FIXUP_PINS,
8774 .v.pins = (const struct hda_pintbl[]) {
8775 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8776 { }
8777 }
8778 },
bd9c10bc 8779 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
8780 .type = HDA_FIXUP_PINS,
8781 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
8782 { 0x19, 0x04a11040 },
8783 { 0x21, 0x04211020 },
60083f9e
JHP
8784 { }
8785 },
8786 .chained = true,
bd9c10bc 8787 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 8788 },
f0d9da19
KY
8789 [ALC289_FIXUP_DELL_SPK1] = {
8790 .type = HDA_FIXUP_PINS,
8791 .v.pins = (const struct hda_pintbl[]) {
8792 { 0x14, 0x90170140 },
8793 { }
8794 },
8795 .chained = true,
8796 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8797 },
e79c2269 8798 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
8799 .type = HDA_FIXUP_PINS,
8800 .v.pins = (const struct hda_pintbl[]) {
e79c2269 8801 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
8802 { }
8803 },
8804 .chained = true,
e79c2269 8805 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 8806 },
e79c2269
KY
8807 [ALC289_FIXUP_DUAL_SPK] = {
8808 .type = HDA_FIXUP_FUNC,
8809 .v.func = alc285_fixup_speaker2_to_dac1,
8810 .chained = true,
8811 .chain_id = ALC289_FIXUP_DELL_SPK2
8812 },
f0d9da19
KY
8813 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
8814 .type = HDA_FIXUP_FUNC,
8815 .v.func = alc285_fixup_speaker2_to_dac1,
8816 .chained = true,
8817 .chain_id = ALC289_FIXUP_DELL_SPK1
8818 },
48e01504
CC
8819 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8820 .type = HDA_FIXUP_FUNC,
8821 .v.func = alc285_fixup_speaker2_to_dac1,
8822 .chained = true,
8823 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8824 },
8825 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8826 .type = HDA_FIXUP_FUNC,
8827 /* The GPIO must be pulled to initialize the AMP */
8828 .v.func = alc_fixup_gpio4,
8829 .chained = true,
48e01504 8830 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8831 },
724418b8
MA
8832 [ALC294_FIXUP_ASUS_ALLY] = {
8833 .type = HDA_FIXUP_FUNC,
8834 .v.func = cs35l41_fixup_i2c_two,
8835 .chained = true,
8836 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
8837 },
8838 [ALC294_FIXUP_ASUS_ALLY_PINS] = {
8839 .type = HDA_FIXUP_PINS,
8840 .v.pins = (const struct hda_pintbl[]) {
8841 { 0x19, 0x03a11050 },
8842 { 0x1a, 0x03a11c30 },
8843 { 0x21, 0x03211420 },
8844 { }
8845 },
8846 .chained = true,
8847 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
8848 },
8849 [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
8850 .type = HDA_FIXUP_VERBS,
8851 .v.verbs = (const struct hda_verb[]) {
8852 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8853 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8854 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
8855 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
8856 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
8857 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
8858 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
8859 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
8860 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
8861 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
8862 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
8863 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
8864 { }
8865 },
8866 .chained = true,
8867 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
8868 },
8869 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
8870 .type = HDA_FIXUP_FUNC,
8871 .v.func = alc285_fixup_speaker2_to_dac1,
8872 },
6a6660d0
TI
8873 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8874 .type = HDA_FIXUP_FUNC,
8875 .v.func = alc285_fixup_thinkpad_x1_gen7,
8876 .chained = true,
8877 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8878 },
76f7dec0
KY
8879 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8880 .type = HDA_FIXUP_FUNC,
8881 .v.func = alc_fixup_headset_jack,
8882 .chained = true,
6a6660d0 8883 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8884 },
8b33a134
JHP
8885 [ALC294_FIXUP_ASUS_HPE] = {
8886 .type = HDA_FIXUP_VERBS,
8887 .v.verbs = (const struct hda_verb[]) {
8888 /* Set EAPD high */
8889 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8890 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8891 { }
8892 },
8893 .chained = true,
8894 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8895 },
c3cdf189
LJ
8896 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8897 .type = HDA_FIXUP_PINS,
8898 .v.pins = (const struct hda_pintbl[]) {
8899 { 0x19, 0x03a11050 }, /* front HP mic */
8900 { 0x1a, 0x01a11830 }, /* rear external mic */
8901 { 0x21, 0x03211020 }, /* front HP out */
8902 { }
8903 },
8904 .chained = true,
8905 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8906 },
8907 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8908 .type = HDA_FIXUP_VERBS,
8909 .v.verbs = (const struct hda_verb[]) {
8910 /* set 0x15 to HP-OUT ctrl */
8911 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8912 /* unmute the 0x15 amp */
8913 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8914 { }
8915 },
8916 .chained = true,
8917 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8918 },
8919 [ALC294_FIXUP_ASUS_GX502_HP] = {
8920 .type = HDA_FIXUP_FUNC,
8921 .v.func = alc294_fixup_gx502_hp,
8922 },
c1b55029
DC
8923 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8924 .type = HDA_FIXUP_PINS,
8925 .v.pins = (const struct hda_pintbl[]) {
8926 { 0x19, 0x01a11050 }, /* rear HP mic */
8927 { 0x1a, 0x01a11830 }, /* rear external mic */
8928 { 0x21, 0x012110f0 }, /* rear HP out */
8929 { }
8930 },
8931 .chained = true,
8932 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8933 },
8934 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8935 .type = HDA_FIXUP_VERBS,
8936 .v.verbs = (const struct hda_verb[]) {
8937 /* set 0x15 to HP-OUT ctrl */
8938 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8939 /* unmute the 0x15 amp */
8940 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8941 /* set 0x1b to HP-OUT */
8942 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8943 { }
8944 },
8945 .chained = true,
8946 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8947 },
8948 [ALC294_FIXUP_ASUS_GU502_HP] = {
8949 .type = HDA_FIXUP_FUNC,
8950 .v.func = alc294_fixup_gu502_hp,
c611e659
LJ
8951 },
8952 [ALC294_FIXUP_ASUS_G513_PINS] = {
8953 .type = HDA_FIXUP_PINS,
8954 .v.pins = (const struct hda_pintbl[]) {
8955 { 0x19, 0x03a11050 }, /* front HP mic */
8956 { 0x1a, 0x03a11c30 }, /* rear external mic */
8957 { 0x21, 0x03211420 }, /* front HP out */
8958 { }
8959 },
c1b55029 8960 },
bc2c2354
LJ
8961 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8962 .type = HDA_FIXUP_PINS,
8963 .v.pins = (const struct hda_pintbl[]) {
66ba7c88
LJ
8964 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8965 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8966 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8967 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8968 { 0x21, 0x03211420 },
bc2c2354
LJ
8969 { }
8970 },
bc2c2354 8971 },
1b94e59d
TI
8972 [ALC294_FIXUP_ASUS_COEF_1B] = {
8973 .type = HDA_FIXUP_VERBS,
8974 .v.verbs = (const struct hda_verb[]) {
8975 /* Set bit 10 to correct noisy output after reboot from
8976 * Windows 10 (due to pop noise reduction?)
8977 */
8978 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8979 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8980 { }
8981 },
f8fbcdfb
TI
8982 .chained = true,
8983 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8984 },
f5a88b0a
KHF
8985 [ALC285_FIXUP_HP_GPIO_LED] = {
8986 .type = HDA_FIXUP_FUNC,
8987 .v.func = alc285_fixup_hp_gpio_led,
8988 },
431e76c3
KY
8989 [ALC285_FIXUP_HP_MUTE_LED] = {
8990 .type = HDA_FIXUP_FUNC,
8991 .v.func = alc285_fixup_hp_mute_led,
8992 },
ca88eeb3
LG
8993 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8994 .type = HDA_FIXUP_FUNC,
8995 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
8996 },
0659400f
LG
8997 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
8998 .type = HDA_FIXUP_FUNC,
8999 .v.func = alc236_fixup_hp_mute_led_coefbit2,
9000 },
e7d66cf7
JS
9001 [ALC236_FIXUP_HP_GPIO_LED] = {
9002 .type = HDA_FIXUP_FUNC,
9003 .v.func = alc236_fixup_hp_gpio_led,
9004 },
24164f43
KY
9005 [ALC236_FIXUP_HP_MUTE_LED] = {
9006 .type = HDA_FIXUP_FUNC,
9007 .v.func = alc236_fixup_hp_mute_led,
9008 },
75b62ab6
JW
9009 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
9010 .type = HDA_FIXUP_FUNC,
9011 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
9012 },
a2d57ebe
KM
9013 [ALC298_FIXUP_SAMSUNG_AMP] = {
9014 .type = HDA_FIXUP_FUNC,
9015 .v.func = alc298_fixup_samsung_amp,
9016 .chained = true,
9017 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
9018 },
14425f1f
MP
9019 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9020 .type = HDA_FIXUP_VERBS,
9021 .v.verbs = (const struct hda_verb[]) {
9022 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
9023 { }
9024 },
9025 },
ef248d9b
MK
9026 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
9027 .type = HDA_FIXUP_VERBS,
9028 .v.verbs = (const struct hda_verb[]) {
9029 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
9030 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
9031 { }
9032 },
9033 },
9e43342b
CC
9034 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
9035 .type = HDA_FIXUP_PINS,
9036 .v.pins = (const struct hda_pintbl[]) {
9037 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9038 { }
9039 },
9040 .chained = true,
9041 .chain_id = ALC269_FIXUP_HEADSET_MODE
9042 },
8eae7e9b
JHP
9043 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
9044 .type = HDA_FIXUP_PINS,
9045 .v.pins = (const struct hda_pintbl[]) {
9046 { 0x14, 0x90100120 }, /* use as internal speaker */
9047 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
9048 { 0x1a, 0x01011020 }, /* use as line out */
9049 { },
9050 },
9051 .chained = true,
9052 .chain_id = ALC269_FIXUP_HEADSET_MIC
9053 },
6e15d126
JHP
9054 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
9055 .type = HDA_FIXUP_PINS,
9056 .v.pins = (const struct hda_pintbl[]) {
9057 { 0x18, 0x02a11030 }, /* use as headset mic */
9058 { }
9059 },
9060 .chained = true,
9061 .chain_id = ALC269_FIXUP_HEADSET_MIC
9062 },
781c90c0
JHP
9063 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
9064 .type = HDA_FIXUP_PINS,
9065 .v.pins = (const struct hda_pintbl[]) {
9066 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
9067 { }
9068 },
9069 .chained = true,
9070 .chain_id = ALC269_FIXUP_HEADSET_MIC
9071 },
293a92c1 9072 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
9073 .type = HDA_FIXUP_FUNC,
9074 .v.func = alc289_fixup_asus_ga401,
9075 .chained = true,
9076 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 9077 },
4b43d05a
AS
9078 [ALC289_FIXUP_ASUS_GA502] = {
9079 .type = HDA_FIXUP_PINS,
9080 .v.pins = (const struct hda_pintbl[]) {
9081 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
9082 { }
9083 },
9084 },
f50a121d
JHP
9085 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
9086 .type = HDA_FIXUP_PINS,
9087 .v.pins = (const struct hda_pintbl[]) {
9088 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
9089 { }
9090 },
9091 .chained = true,
9092 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
9093 },
56496253
KY
9094 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
9095 .type = HDA_FIXUP_FUNC,
9096 .v.func = alc285_fixup_hp_gpio_amp_init,
9097 .chained = true,
9098 .chain_id = ALC285_FIXUP_HP_GPIO_LED
9099 },
f1ec5be1
HC
9100 [ALC269_FIXUP_CZC_B20] = {
9101 .type = HDA_FIXUP_PINS,
9102 .v.pins = (const struct hda_pintbl[]) {
9103 { 0x12, 0x411111f0 },
9104 { 0x14, 0x90170110 }, /* speaker */
9105 { 0x15, 0x032f1020 }, /* HP out */
9106 { 0x17, 0x411111f0 },
9107 { 0x18, 0x03ab1040 }, /* mic */
9108 { 0x19, 0xb7a7013f },
9109 { 0x1a, 0x0181305f },
9110 { 0x1b, 0x411111f0 },
9111 { 0x1d, 0x411111f0 },
9112 { 0x1e, 0x411111f0 },
9113 { }
9114 },
9115 .chain_id = ALC269_FIXUP_DMIC,
9116 },
9117 [ALC269_FIXUP_CZC_TMI] = {
9118 .type = HDA_FIXUP_PINS,
9119 .v.pins = (const struct hda_pintbl[]) {
9120 { 0x12, 0x4000c000 },
9121 { 0x14, 0x90170110 }, /* speaker */
9122 { 0x15, 0x0421401f }, /* HP out */
9123 { 0x17, 0x411111f0 },
9124 { 0x18, 0x04a19020 }, /* mic */
9125 { 0x19, 0x411111f0 },
9126 { 0x1a, 0x411111f0 },
9127 { 0x1b, 0x411111f0 },
9128 { 0x1d, 0x40448505 },
9129 { 0x1e, 0x411111f0 },
9130 { 0x20, 0x8000ffff },
9131 { }
9132 },
9133 .chain_id = ALC269_FIXUP_DMIC,
9134 },
9135 [ALC269_FIXUP_CZC_L101] = {
9136 .type = HDA_FIXUP_PINS,
9137 .v.pins = (const struct hda_pintbl[]) {
9138 { 0x12, 0x40000000 },
9139 { 0x14, 0x01014010 }, /* speaker */
9140 { 0x15, 0x411111f0 }, /* HP out */
9141 { 0x16, 0x411111f0 },
9142 { 0x18, 0x01a19020 }, /* mic */
9143 { 0x19, 0x02a19021 },
9144 { 0x1a, 0x0181302f },
9145 { 0x1b, 0x0221401f },
9146 { 0x1c, 0x411111f0 },
9147 { 0x1d, 0x4044c601 },
9148 { 0x1e, 0x411111f0 },
9149 { }
9150 },
9151 .chain_id = ALC269_FIXUP_DMIC,
9152 },
9153 [ALC269_FIXUP_LEMOTE_A1802] = {
9154 .type = HDA_FIXUP_PINS,
9155 .v.pins = (const struct hda_pintbl[]) {
9156 { 0x12, 0x40000000 },
9157 { 0x14, 0x90170110 }, /* speaker */
9158 { 0x17, 0x411111f0 },
9159 { 0x18, 0x03a19040 }, /* mic1 */
9160 { 0x19, 0x90a70130 }, /* mic2 */
9161 { 0x1a, 0x411111f0 },
9162 { 0x1b, 0x411111f0 },
9163 { 0x1d, 0x40489d2d },
9164 { 0x1e, 0x411111f0 },
9165 { 0x20, 0x0003ffff },
9166 { 0x21, 0x03214020 },
9167 { }
9168 },
9169 .chain_id = ALC269_FIXUP_DMIC,
9170 },
9171 [ALC269_FIXUP_LEMOTE_A190X] = {
9172 .type = HDA_FIXUP_PINS,
9173 .v.pins = (const struct hda_pintbl[]) {
9174 { 0x14, 0x99130110 }, /* speaker */
9175 { 0x15, 0x0121401f }, /* HP out */
9176 { 0x18, 0x01a19c20 }, /* rear mic */
9177 { 0x19, 0x99a3092f }, /* front mic */
9178 { 0x1b, 0x0201401f }, /* front lineout */
9179 { }
9180 },
9181 .chain_id = ALC269_FIXUP_DMIC,
9182 },
e2d2fded
KHF
9183 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
9184 .type = HDA_FIXUP_PINS,
9185 .v.pins = (const struct hda_pintbl[]) {
9186 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9187 { }
9188 },
9189 .chained = true,
9190 .chain_id = ALC269_FIXUP_HEADSET_MODE
9191 },
73e7161e
WS
9192 [ALC256_FIXUP_INTEL_NUC10] = {
9193 .type = HDA_FIXUP_PINS,
9194 .v.pins = (const struct hda_pintbl[]) {
9195 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9196 { }
9197 },
9198 .chained = true,
9199 .chain_id = ALC269_FIXUP_HEADSET_MODE
9200 },
fc19d559
HW
9201 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
9202 .type = HDA_FIXUP_VERBS,
9203 .v.verbs = (const struct hda_verb[]) {
9204 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9205 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9206 { }
9207 },
9208 .chained = true,
c84bfedc 9209 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 9210 },
13468bfa
HW
9211 [ALC274_FIXUP_HP_MIC] = {
9212 .type = HDA_FIXUP_VERBS,
9213 .v.verbs = (const struct hda_verb[]) {
9214 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
9215 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
9216 { }
9217 },
9218 },
8a8de09c
KY
9219 [ALC274_FIXUP_HP_HEADSET_MIC] = {
9220 .type = HDA_FIXUP_FUNC,
9221 .v.func = alc274_fixup_hp_headset_mic,
9222 .chained = true,
9223 .chain_id = ALC274_FIXUP_HP_MIC
9224 },
622464c8
TI
9225 [ALC274_FIXUP_HP_ENVY_GPIO] = {
9226 .type = HDA_FIXUP_FUNC,
9227 .v.func = alc274_fixup_hp_envy_gpio,
9228 },
ef9ce66f
KY
9229 [ALC256_FIXUP_ASUS_HPE] = {
9230 .type = HDA_FIXUP_VERBS,
9231 .v.verbs = (const struct hda_verb[]) {
9232 /* Set EAPD high */
9233 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
9234 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
9235 { }
9236 },
9237 .chained = true,
9238 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
9239 },
446b8185
KY
9240 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
9241 .type = HDA_FIXUP_FUNC,
9242 .v.func = alc_fixup_headset_jack,
9243 .chained = true,
9244 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9245 },
a0ccbc53
KY
9246 [ALC287_FIXUP_HP_GPIO_LED] = {
9247 .type = HDA_FIXUP_FUNC,
9248 .v.func = alc287_fixup_hp_gpio_led,
9249 },
9e885770
KY
9250 [ALC256_FIXUP_HP_HEADSET_MIC] = {
9251 .type = HDA_FIXUP_FUNC,
9252 .v.func = alc274_fixup_hp_headset_mic,
9253 },
92666d45
KY
9254 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
9255 .type = HDA_FIXUP_FUNC,
9256 .v.func = alc_fixup_no_int_mic,
9257 .chained = true,
9258 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
9259 },
34cdf405
CC
9260 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
9261 .type = HDA_FIXUP_PINS,
9262 .v.pins = (const struct hda_pintbl[]) {
9263 { 0x1b, 0x411111f0 },
9264 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9265 { },
9266 },
9267 .chained = true,
9268 .chain_id = ALC269_FIXUP_HEADSET_MODE
9269 },
495dc763
CC
9270 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
9271 .type = HDA_FIXUP_FUNC,
9272 .v.func = alc269_fixup_limit_int_mic_boost,
9273 .chained = true,
9274 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9275 },
d0e18561
CC
9276 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
9277 .type = HDA_FIXUP_PINS,
9278 .v.pins = (const struct hda_pintbl[]) {
9279 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9280 { 0x1a, 0x90a1092f }, /* use as internal mic */
9281 { }
9282 },
9283 .chained = true,
9284 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9285 },
26928ca1
TI
9286 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
9287 .type = HDA_FIXUP_FUNC,
9288 .v.func = alc285_fixup_ideapad_s740_coef,
9289 .chained = true,
9290 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9291 },
bd15b155
KHF
9292 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9293 .type = HDA_FIXUP_FUNC,
9294 .v.func = alc269_fixup_limit_int_mic_boost,
9295 .chained = true,
9296 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9297 },
8eedd3a7
TI
9298 [ALC295_FIXUP_ASUS_DACS] = {
9299 .type = HDA_FIXUP_FUNC,
9300 .v.func = alc295_fixup_asus_dacs,
9301 },
5d84b531
TI
9302 [ALC295_FIXUP_HP_OMEN] = {
9303 .type = HDA_FIXUP_PINS,
9304 .v.pins = (const struct hda_pintbl[]) {
9305 { 0x12, 0xb7a60130 },
9306 { 0x13, 0x40000000 },
9307 { 0x14, 0x411111f0 },
9308 { 0x16, 0x411111f0 },
9309 { 0x17, 0x90170110 },
9310 { 0x18, 0x411111f0 },
9311 { 0x19, 0x02a11030 },
9312 { 0x1a, 0x411111f0 },
9313 { 0x1b, 0x04a19030 },
9314 { 0x1d, 0x40600001 },
9315 { 0x1e, 0x411111f0 },
9316 { 0x21, 0x03211020 },
9317 {}
9318 },
9319 .chained = true,
9320 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
9321 },
f2be77fe 9322 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
9323 .type = HDA_FIXUP_FUNC,
9324 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 9325 },
d94befbb
DB
9326 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
9327 .type = HDA_FIXUP_FUNC,
9328 .v.func = alc285_fixup_hp_spectre_x360_eb1
9329 },
c0621669
AA
9330 [ALC285_FIXUP_HP_ENVY_X360] = {
9331 .type = HDA_FIXUP_FUNC,
9332 .v.func = alc285_fixup_hp_envy_x360,
9333 .chained = true,
9334 .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
9335 },
9ebaef05
HW
9336 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
9337 .type = HDA_FIXUP_FUNC,
9338 .v.func = alc285_fixup_ideapad_s740_coef,
9339 .chained = true,
9340 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9341 },
29c8f40b
PU
9342 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
9343 .type = HDA_FIXUP_FUNC,
9344 .v.func = alc_fixup_no_shutup,
9345 .chained = true,
9346 .chain_id = ALC283_FIXUP_HEADSET_MIC,
9347 },
57c9e21a
HW
9348 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
9349 .type = HDA_FIXUP_PINS,
9350 .v.pins = (const struct hda_pintbl[]) {
9351 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
9352 { }
9353 },
9354 .chained = true,
9355 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
9356 },
8903376d
KHF
9357 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
9358 .type = HDA_FIXUP_FUNC,
9359 .v.func = alc269_fixup_limit_int_mic_boost,
9360 .chained = true,
9361 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
9362 },
8f4c9042
BF
9363 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
9364 .type = HDA_FIXUP_FUNC,
9365 .v.func = alc285_fixup_ideapad_s740_coef,
9366 .chained = true,
9367 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
9368 },
9369 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
9370 .type = HDA_FIXUP_FUNC,
9371 .v.func = alc287_fixup_legion_15imhg05_speakers,
9372 .chained = true,
9373 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
9374 },
ad7cc2d4
CB
9375 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
9376 .type = HDA_FIXUP_VERBS,
9377 //.v.verbs = legion_15imhg05_coefs,
9378 .v.verbs = (const struct hda_verb[]) {
9379 // set left speaker Legion 7i.
9380 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9381 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9382
9383 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9384 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9385 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9386 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9387 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9388
9389 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9390 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9391 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9392 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9393 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9394
9395 // set right speaker Legion 7i.
9396 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9397 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9398
9399 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9400 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9401 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9402 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9403 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9404
9405 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9406 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9407 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9408 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9409 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9410 {}
9411 },
9412 .chained = true,
9413 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
9414 },
9415 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
9416 .type = HDA_FIXUP_FUNC,
9417 .v.func = alc287_fixup_legion_15imhg05_speakers,
9418 .chained = true,
9419 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9420 },
9421 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
9422 .type = HDA_FIXUP_VERBS,
9423 .v.verbs = (const struct hda_verb[]) {
9424 // set left speaker Yoga 7i.
9425 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9426 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9427
9428 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9429 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9430 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9431 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9432 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9433
9434 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9435 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9436 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9437 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9438 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9439
9440 // set right speaker Yoga 7i.
9441 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9442 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9443
9444 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9445 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9446 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9447 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9448 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9449
9450 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9451 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9452 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9453 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9454 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9455 {}
9456 },
9457 .chained = true,
9458 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9459 },
56ec3e75
TI
9460 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
9461 .type = HDA_FIXUP_FUNC,
9462 .v.func = alc298_fixup_lenovo_c940_duet7,
9463 },
0ac32a39
WW
9464 [ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
9465 .type = HDA_FIXUP_FUNC,
9466 .v.func = alc287_fixup_lenovo_14irp8_duetitl,
9467 },
39815cdf
TI
9468 [ALC287_FIXUP_LENOVO_LEGION_7] = {
9469 .type = HDA_FIXUP_FUNC,
9470 .v.func = alc287_fixup_lenovo_legion_7,
9471 },
ad7cc2d4
CB
9472 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
9473 .type = HDA_FIXUP_VERBS,
9474 .v.verbs = (const struct hda_verb[]) {
9475 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9476 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 9477 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
9478 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9479 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9480 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9481 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9482 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9483 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9484 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9485 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9486 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9487 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9488 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9489 {}
9490 },
9491 .chained = true,
9492 .chain_id = ALC269_FIXUP_HEADSET_MODE,
9493 },
619764cc 9494 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 9495 .type = HDA_FIXUP_FUNC,
619764cc 9496 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 9497 },
5fc462c3
JC
9498 [ALC245_FIXUP_HP_GPIO_LED] = {
9499 .type = HDA_FIXUP_FUNC,
9500 .v.func = alc245_fixup_hp_gpio_led,
9501 },
1278cc5a
JS
9502 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
9503 .type = HDA_FIXUP_PINS,
9504 .v.pins = (const struct hda_pintbl[]) {
9505 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
9506 { }
9507 },
9508 .chained = true,
9509 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
9510 },
174a7fb3
WS
9511 [ALC233_FIXUP_NO_AUDIO_JACK] = {
9512 .type = HDA_FIXUP_FUNC,
9513 .v.func = alc233_fixup_no_audio_jack,
9514 },
edca7cc4
WS
9515 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
9516 .type = HDA_FIXUP_FUNC,
9517 .v.func = alc256_fixup_mic_no_presence_and_resume,
9518 .chained = true,
9519 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9520 },
d3dca026
LT
9521 [ALC287_FIXUP_LEGION_16ACHG6] = {
9522 .type = HDA_FIXUP_FUNC,
9523 .v.func = alc287_fixup_legion_16achg6_speakers,
9524 },
ae7abe36
SB
9525 [ALC287_FIXUP_CS35L41_I2C_2] = {
9526 .type = HDA_FIXUP_FUNC,
9527 .v.func = cs35l41_fixup_i2c_two,
9528 },
b3fbe536
AC
9529 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
9530 .type = HDA_FIXUP_FUNC,
9531 .v.func = cs35l41_fixup_i2c_two,
9532 .chained = true,
9533 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
ae7abe36 9534 },
42320660
SB
9535 [ALC287_FIXUP_CS35L41_I2C_4] = {
9536 .type = HDA_FIXUP_FUNC,
9537 .v.func = cs35l41_fixup_i2c_four,
9538 },
07bcab93
LT
9539 [ALC245_FIXUP_CS35L41_SPI_2] = {
9540 .type = HDA_FIXUP_FUNC,
9541 .v.func = cs35l41_fixup_spi_two,
9542 },
ce18f905
KHF
9543 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
9544 .type = HDA_FIXUP_FUNC,
9545 .v.func = cs35l41_fixup_spi_two,
9546 .chained = true,
9547 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9548 },
07bcab93
LT
9549 [ALC245_FIXUP_CS35L41_SPI_4] = {
9550 .type = HDA_FIXUP_FUNC,
9551 .v.func = cs35l41_fixup_spi_four,
9552 },
9553 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
9554 .type = HDA_FIXUP_FUNC,
864cb14c 9555 .v.func = cs35l41_fixup_spi_four,
07bcab93 9556 .chained = true,
864cb14c 9557 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
07bcab93 9558 },
91502a9a
AS
9559 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
9560 .type = HDA_FIXUP_VERBS,
9561 .v.verbs = (const struct hda_verb[]) {
9562 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
9563 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
9564 { }
9565 },
9566 .chained = true,
9567 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
9568 },
1efcdd9c
GM
9569 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
9570 .type = HDA_FIXUP_FUNC,
9571 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
9572 .chained = true,
9573 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9574 },
309d7363
DH
9575 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
9576 .type = HDA_FIXUP_PINS,
9577 .v.pins = (const struct hda_pintbl[]) {
9578 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
9579 { }
9580 },
9581 .chained = true,
9582 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
9583 },
1e24881d
LT
9584 [ALC287_FIXUP_LEGION_16ITHG6] = {
9585 .type = HDA_FIXUP_FUNC,
9586 .v.func = alc287_fixup_legion_16ithg6_speakers,
9587 },
3790a3d6
PJ
9588 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
9589 .type = HDA_FIXUP_VERBS,
9590 .v.verbs = (const struct hda_verb[]) {
9591 // enable left speaker
9592 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9593 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
9594
9595 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9596 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9597 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9598 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
9599 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9600
9601 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9602 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9603 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9604 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
9605 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9606
9607 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9608 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9609 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9610 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
9611 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9612
9613 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9614 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9615 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9616 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9617 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9618
9619 // enable right speaker
9620 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
9621 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9622
9623 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9624 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
9625 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9626 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
9627 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9628
9629 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9630 { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
9631 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9632 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
9633 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9634
9635 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9636 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
9637 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9638 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
9639 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9640
9641 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
9642 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
9643 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9644 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
9645 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
9646
9647 { },
9648 },
9649 },
9650 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
9651 .type = HDA_FIXUP_FUNC,
9652 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9653 .chained = true,
9654 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
9655 },
9b714a59
JZ
9656 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
9657 .type = HDA_FIXUP_FUNC,
9658 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
9659 .chained = true,
9660 .chain_id = ALC287_FIXUP_CS35L41_I2C_2,
9661 },
2912cdda
PJ
9662 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
9663 .type = HDA_FIXUP_FUNC,
9664 .v.func = alc295_fixup_dell_inspiron_top_speakers,
9665 .chained = true,
9666 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9667 },
a4517c4f
CC
9668 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
9669 .type = HDA_FIXUP_PINS,
9670 .v.func = alc1220_fixup_gb_dual_codecs,
9671 .chained = true,
9672 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9673 },
f7b069cf
VR
9674 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
9675 .type = HDA_FIXUP_FUNC,
9676 .v.func = cs35l41_fixup_i2c_two,
9677 .chained = true,
2468e892 9678 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
f7b069cf 9679 },
3babae91
SD
9680 [ALC287_FIXUP_TAS2781_I2C] = {
9681 .type = HDA_FIXUP_FUNC,
9682 .v.func = tas2781_fixup_i2c,
9683 .chained = true,
c1947ce6 9684 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
3babae91 9685 },
b5cb53fd
GK
9686 [ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
9687 .type = HDA_FIXUP_FUNC,
9688 .v.func = yoga7_14arb7_fixup_i2c,
9689 .chained = true,
9690 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9691 },
93dc18e1
SJ
9692 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
9693 .type = HDA_FIXUP_FUNC,
9694 .v.func = alc245_fixup_hp_mute_led_coefbit,
9695 },
c99c26b1
FV
9696 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
9697 .type = HDA_FIXUP_FUNC,
9698 .v.func = alc245_fixup_hp_mute_led_coefbit,
9699 .chained = true,
9700 .chain_id = ALC245_FIXUP_HP_GPIO_LED
9701 },
e43252db
KY
9702 [ALC287_FIXUP_THINKPAD_I2S_SPK] = {
9703 .type = HDA_FIXUP_FUNC,
9704 .v.func = alc287_fixup_bind_dacs,
2468e892
JR
9705 .chained = true,
9706 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
e43252db 9707 },
d93eeca6
KY
9708 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
9709 .type = HDA_FIXUP_FUNC,
9710 .v.func = alc287_fixup_bind_dacs,
9711 .chained = true,
9712 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
9713 },
c8c0a03e
KY
9714 [ALC2XX_FIXUP_HEADSET_MIC] = {
9715 .type = HDA_FIXUP_FUNC,
9716 .v.func = alc_fixup_headset_mic,
9717 },
f0d9da19
KY
9718 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
9719 .type = HDA_FIXUP_FUNC,
9720 .v.func = cs35l41_fixup_spi_two,
9721 .chained = true,
9722 .chain_id = ALC289_FIXUP_DUAL_SPK
9723 },
6ae90e90
VT
9724 [ALC294_FIXUP_CS35L41_I2C_2] = {
9725 .type = HDA_FIXUP_FUNC,
9726 .v.func = cs35l41_fixup_i2c_two,
9727 },
b2d6a1fd
ST
9728 [ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED] = {
9729 .type = HDA_FIXUP_FUNC,
9730 .v.func = cs35l56_fixup_spi_four,
9731 .chained = true,
9732 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
9733 },
bd2d8305
IM
9734 [ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
9735 .type = HDA_FIXUP_FUNC,
9736 .v.func = alc256_fixup_acer_sfg16_micmute_led,
9737 },
1e5dc398
HW
9738 [ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
9739 .type = HDA_FIXUP_FUNC,
9740 .v.func = alc256_decrease_headphone_amp_val,
9741 },
61456da0
AG
9742 [ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
9743 .type = HDA_FIXUP_FUNC,
9744 .v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
9745 },
c33f0d4f
ST
9746 [ALC285_FIXUP_CS35L56_SPI_2] = {
9747 .type = HDA_FIXUP_FUNC,
9748 .v.func = cs35l56_fixup_spi_two,
9749 },
9750 [ALC285_FIXUP_CS35L56_I2C_2] = {
9751 .type = HDA_FIXUP_FUNC,
9752 .v.func = cs35l56_fixup_i2c_two,
9753 },
9754 [ALC285_FIXUP_CS35L56_I2C_4] = {
9755 .type = HDA_FIXUP_FUNC,
9756 .v.func = cs35l56_fixup_i2c_four,
9757 },
9758 [ALC285_FIXUP_ASUS_GA403U] = {
9759 .type = HDA_FIXUP_FUNC,
9760 .v.func = alc285_fixup_asus_ga403u,
9761 },
0672b017
VT
9762 [ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
9763 .type = HDA_FIXUP_PINS,
9764 .v.pins = (const struct hda_pintbl[]) {
9765 { 0x19, 0x03a11050 },
9766 { 0x1b, 0x03a11c30 },
9767 { }
9768 },
9769 .chained = true,
9770 .chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
9771 },
9772 [ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
9773 .type = HDA_FIXUP_FUNC,
9774 .v.func = alc285_fixup_speaker2_to_dac1,
9775 .chained = true,
9776 .chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
9777 },
9778 [ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
9779 .type = HDA_FIXUP_PINS,
9780 .v.pins = (const struct hda_pintbl[]) {
9781 { 0x19, 0x03a11050 },
9782 { 0x1b, 0x03a11c30 },
9783 { }
9784 },
9785 .chained = true,
9786 .chain_id = ALC285_FIXUP_CS35L56_SPI_2
9787 },
9788 [ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
9789 .type = HDA_FIXUP_FUNC,
9790 .v.func = alc285_fixup_speaker2_to_dac1,
9791 .chained = true,
9792 .chain_id = ALC285_FIXUP_ASUS_GA403U,
9793 },
1e707769
KY
9794 [ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
9795 .type = HDA_FIXUP_FUNC,
9796 .v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
9797 .chained = true,
9798 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
9799 },
f1d4e28b
KY
9800};
9801
1d045db9 9802static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 9803 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
9804 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
9805 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 9806 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 9807 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
9808 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
9809 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 9810 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 9811 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 9812 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 9813 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 9814 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 9815 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 9816 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 9817 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 9818 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 9819 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
9820 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
9821 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
9822 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
9823 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 9824 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 9825 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 9826 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 9827 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
efb56d84 9828 SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
667a8f73
JHP
9829 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9830 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
9831 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 9832 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
5f3fe25e 9833 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
35171fbf 9834 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 9835 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 9836 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 9837 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
2a5bb694 9838 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 9839 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 9840 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 9841 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
6a28a25d 9842 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
bd2d8305 9843 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
aaedfb47 9844 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
841bdf85 9845 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
6ed1131f 9846 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 9847 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 9848 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
9849 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
9850 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 9851 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
9852 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9853 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
9854 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
9855 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
9856 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 9857 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 9858 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 9859 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
9860 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9861 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 9862 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 9863 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 9864 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 9865 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
9866 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9867 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
9868 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9869 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9870 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9871 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
9872 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 9873 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 9874 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 9875 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 9876 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 9877 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 9878 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 9879 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 9880 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
9881 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
9882 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
9883 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
9884 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 9885 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 9886 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 9887 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 9888 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 9889 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 9890 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
9891 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
9892 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
9893 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
9894 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
1efcdd9c 9895 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
c1e89523 9896 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 9897 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 9898 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
9899 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
9900 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
15dad62f 9901 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
bdc9b739 9902 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
42320660
SB
9903 SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
9904 SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
2912cdda
PJ
9905 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
9906 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
cd14dedf 9907 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
a5751933 9908 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
fddab35f 9909 SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
fcfc9f71 9910 SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
fddab35f 9911 SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
a4517c4f
CC
9912 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9913 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
9914 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9915 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
9916 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
9917 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
89a0dff6 9918 SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
42320660 9919 SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
f0d9da19
KY
9920 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9921 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9922 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9923 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
9924 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9925 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9926 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9927 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
9928 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
a22aa26f
KY
9929 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
9930 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 9931 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 9932 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 9933 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 9934 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9935 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 9936 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9937 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9938 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
9939 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9940 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
9941 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9942 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9943 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9944 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 9945 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
9946 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9947 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9948 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9949 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9950 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 9951 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 9952 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 9953 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 9954 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9955 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9956 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9957 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9958 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9959 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9960 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9961 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9962 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 9963 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9964 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9965 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 9966 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 9967 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 9968 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9969 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9970 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9971 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9972 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9973 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9974 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9975 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9976 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 9977 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
9978 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9979 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
9980 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9981 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9982 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9983 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
9984 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9985 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9986 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9987 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4ba5c853 9988 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
167897f4
JK
9989 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9990 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
9991 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9992 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
92553ee0 9993 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
e549d190 9994 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 9995 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 9996 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
9997 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9998 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 9999 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 10000 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 10001 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9b726bf6 10002 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
5d84b531 10003 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 10004 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 10005 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
b6ce6e6c 10006 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
c0621669 10007 SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
d296a74b 10008 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 10009 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 10010 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
2d5af3ab 10011 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
622464c8 10012 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
24df5428
IH
10013 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10014 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
ca88eeb3 10015 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
15d295b5 10016 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 10017 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 10018 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
c058493d 10019 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 10020 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 10021 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
05ec7161 10022 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 10023 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 10024 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
6b3d14b7 10025 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
431e76c3 10026 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 10027 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
10028 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
10029 ALC285_FIXUP_HP_GPIO_AMP_INIT),
10030 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
10031 ALC285_FIXUP_HP_GPIO_AMP_INIT),
30267718 10032 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
b2e6b3d9 10033 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
375f8426 10034 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
f0d78972 10035 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
48422958 10036 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 10037 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 10038 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 10039 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 10040 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
10041 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
10042 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 10043 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 10044 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
bc7863d1 10045 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
d07149ab 10046 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 10047 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
10048 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
10049 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
d510acb6 10050 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
53b861be 10051 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 10052 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 10053 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 10054 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
10055 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
10056 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 10057 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 10058 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 10059 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0659400f 10060 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
c99c26b1 10061 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
600dd2a7 10062 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
91502a9a 10063 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
0e68c4b1 10064 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 10065 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 10066 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
49632230 10067 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
8384c0ba 10068 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
e7477cb9 10069 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
f86bfeb6 10070 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
5f5d8890
AC
10071 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10072 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10073 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10074 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10075 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10076 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
67c3d771 10077 SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
07bcab93
LT
10078 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
10079 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
10080 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 10081 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 10082 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
b3fbe536 10083 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
07bcab93 10084 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
e6194c8d
AC
10085 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
10086 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
024a7ad9 10087 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
e6194c8d
AC
10088 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
10089 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
f86bfeb6 10090 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
07bcab93 10091 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
ce18f905 10092 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
f7ac570d 10093 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9a6804aa 10094 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
aa8e3ef4 10095 SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
13a5b211 10096 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
56e85993 10097 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
93dc18e1 10098 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
aa8e3ef4
SB
10099 SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
10100 SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10101 SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10102 SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10103 SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10104 SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10105 SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10106 SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10107 SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10108 SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10109 SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
300ab0df 10110 SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
5f3d696e 10111 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
61d30785
JS
10112 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
10113 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
10114 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
10115 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
1fdf4e8b 10116 SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
3e10f6ca 10117 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
c578d5da
KHF
10118 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10119 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
aa8e3ef4 10120 SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
32f03f40 10121 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b944aa9d 10122 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
aa8e3ef4 10123 SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
67c3d771 10124 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
9251584a
AC
10125 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10126 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10127 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10128 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10129 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10130 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
32f03f40 10131 SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1d8025ec
AC
10132 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
10133 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
3e10f6ca 10134 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
2ae147d6 10135 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9fdc1605 10136 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
e94f1f96
AC
10137 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10138 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10139 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
3e10f6ca 10140 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
6c4715aa
AC
10141 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10142 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
5007b848 10143 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
6c4715aa
AC
10144 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
10145 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
10146 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
b752a385 10147 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
858c5415 10148 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
56fc217f 10149 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9dc68a4f 10150 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
aa8e3ef4
SB
10151 SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10152 SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10153 SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10154 SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10155 SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10156 SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10157 SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10158 SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10159 SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10160 SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10161 SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10162 SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
9c694fbf 10163 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
61456da0 10164 SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
aa8e3ef4
SB
10165 SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
10166 SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
fb8cce69
SB
10167 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10168 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10169 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10170 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
aa8e3ef4
SB
10171 SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
10172 SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10173 SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
b2d6a1fd
ST
10174 SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED),
10175 SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED),
aa8e3ef4
SB
10176 SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
10177 SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10178 SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
10179 SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
fb8cce69
SB
10180 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10181 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10182 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
a17bd44c
AC
10183 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
10184 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
10185 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
10186 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
18a434f3 10187 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
b018cee7 10188 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1513664f
AC
10189 SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
10190 SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
5d639b60
SB
10191 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
10192 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
aa8e3ef4
SB
10193 SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
10194 SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
84471d01
VR
10195 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
10196 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
5d639b60 10197 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
c1732ede 10198 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 10199 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 10200 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 10201 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 10202 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 10203 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
713f040c 10204 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
3e0d611b 10205 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 10206 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 10207 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 10208 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
10209 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
10210 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
e959f2be 10211 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
461122b9 10212 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
c1732ede 10213 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 10214 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
f882c4be 10215 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
c1732ede 10216 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 10217 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
a40ce9f4
SB
10218 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10219 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
10220 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
10221 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10222 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10223 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10224 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
10225 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
23870831 10226 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
a40ce9f4
SB
10227 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
10228 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 10229 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 10230 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
7e2d0662 10231 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
852d432a 10232 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
b16c8f22 10233 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
ae53e219 10234 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
3e0d611b 10235 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
ae53e219 10236 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
8eedd3a7 10237 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 10238 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
a40ce9f4 10239 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
ae53e219 10240 SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
3cd0ed63 10241 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 10242 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
c5c325bb 10243 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
4963d66b 10244 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 10245 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
4fad4fb9 10246 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 10247 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 10248 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 10249 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 10250 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 10251 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
61cbc08f 10252 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
6ae90e90 10253 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
461122b9 10254 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1b94e59d 10255 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
0672b017 10256 SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
811dd426 10257 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
615966ad 10258 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
61cbc08f 10259 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
4eab0ea1 10260 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61cbc08f
SB
10261 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
10262 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
a4671b7f 10263 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
0672b017 10264 SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
bc2c2354 10265 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
a40ce9f4
SB
10266 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
10267 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
c1732ede 10268 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
a40ce9f4
SB
10269 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
10270 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
10271 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
10272 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
b16c8f22 10273 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ef9ce66f 10274 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
51d97607 10275 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
c33f0d4f 10276 SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606", ALC285_FIXUP_CS35L56_I2C_4),
07058dce 10277 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
4b43d05a 10278 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
b9105044 10279 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
c1b55029 10280 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
c611e659 10281 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
c33f0d4f
ST
10282 SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_CS35L56_I2C_2),
10283 SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_CS35L56_I2C_2),
76fae618 10284 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
b9105044 10285 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
ba1f8180 10286 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
293a92c1 10287 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8d06679b 10288 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
ae53e219 10289 SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
51d97607 10290 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
2ea8e129 10291 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 10292 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
811dd426
SB
10293 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
10294 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
10295 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC245_FIXUP_CS35L41_SPI_2),
10296 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
0bfe1050 10297 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
adabb3ec
TI
10298 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
10299 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
10300 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
10301 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 10302 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
10303 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
10304 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
10305 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 10306 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
10307 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
10308 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 10309 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 10310 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 10311 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 10312 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 10313 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 10314 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 10315 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 10316 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 10317 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
4f2e56a5 10318 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
10319 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
10320 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ccbd88be 10321 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
a0978123 10322 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
1576f263 10323 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
a33cc48d 10324 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
a2d57ebe
KM
10325 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
10326 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
10327 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
10328 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
b18a4563 10329 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
1abfd71e 10330 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
823ff161 10331 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
a2d57ebe
KM
10332 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
10333 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
ef248d9b 10334 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
bd401fd7 10335 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
a86e79e3 10336 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
abaa2274
AA
10337 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
10338 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 10339 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 10340 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
7caf3daa 10341 SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
33affa7f 10342 SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10343 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 10344 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10345 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10346 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10347 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10348 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
33affa7f 10349 SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10350 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10351 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10352 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
be561ffa 10353 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10354 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10355 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10356 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
10357 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10358 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10359 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10360 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10361 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10362 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10363 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1278cc5a
JS
10364 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10365 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10366 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 10367 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10368 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10369 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10370 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10371 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10372 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10373 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
da209f7a 10374 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
c250ef89 10375 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 10376 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10377 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10378 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10379 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10380 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10381 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10382 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
627ce0d6 10383 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
90d74fdb 10384 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
11bea269 10385 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0a6b36c5 10386 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10387 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10388 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10389 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10390 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10391 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
10392 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10393 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10394 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10395 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
10396 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 10397 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9cb72750 10398 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
86222af0 10399 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
0c20fce1 10400 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 10401 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
edca7cc4 10402 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
10403 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10404 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10405 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10406 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 10407 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
10408 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10409 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
10410 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10411 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
22065e42 10412 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b7a58228 10413 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
10414 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10415 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10416 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10417 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10418 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
10419 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 10420 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 10421 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
10422 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
10423 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
10424 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
10425 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
10426 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 10427 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 10428 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 10429 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 10430 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 10431 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 10432 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 10433 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 10434 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 10435 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 10436 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 10437 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 10438 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 10439 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 10440 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 10441 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 10442 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
10443 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10444 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 10445 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 10446 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
f74ab0c5 10447 SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
61fcf8ec
KY
10448 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
10449 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10450 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 10451 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
10452 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10453 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10454 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 10455 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 10456 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 10457 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
10458 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
10459 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
d93eeca6
KY
10460 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10461 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10462 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10463 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10464 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10465 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10466 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10467 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
1e707769
KY
10468 SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
10469 SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
3694cb29 10470 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 10471 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 10472 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 10473 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 10474 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 10475 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 10476 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 10477 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
10478 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
10479 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 10480 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
fb3c007f 10481 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
3790a3d6 10482 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
0ac32a39 10483 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
2aac550d 10484 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
56ec3e75 10485 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
2aac550d 10486 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
3b79954f 10487 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8f4c9042 10488 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
2aac550d 10489 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b81e9e5c 10490 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
c07f2c7b 10491 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 10492 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
d3dca026 10493 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
2aac550d 10494 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
10495 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
10496 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
1e24881d 10497 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
70cfdd03 10498 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
39815cdf 10499 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7),
b5cb53fd 10500 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
b67a7dc4
CB
10501 SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
10502 SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
3babae91
SD
10503 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
10504 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
f286620b 10505 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
634e5e1e 10506 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
3babae91
SD
10507 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10508 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
10509 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
10510 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
dca5f4df
HZ
10511 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
10512 SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
99af5b11
DC
10513 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10514 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
10515 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
10516 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
3babae91
SD
10517 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
10518 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
10519 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
10520 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
10521 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
10522 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
10523 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
9b714a59
JZ
10524 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
10525 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
56f27013 10526 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 10527 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 10528 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 10529 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 10530 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 10531 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 10532 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 10533 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 10534 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 10535 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 10536 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 10537 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 10538 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 10539 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 10540 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 10541 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
10542 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10543 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10544 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
264fb034 10545 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
cd5302c0 10546 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
10547 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
10548 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 10549 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
52aad393 10550 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
174a7fb3 10551 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
79e28f2a 10552 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
1e5dc398
HW
10553 SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
10554 SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
0fbf21c3 10555 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
cbcdf8c4 10556 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
f1ec5be1
HC
10557 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
10558 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
10559 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 10560 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
10561 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
10562 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
88d18b88 10563 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
619764cc 10564 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8b3b2392
WS
10565 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
10566 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
10567 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10568 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10569 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
10570 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10571 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
10572 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
daf6c468 10573 SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
7ee5faad 10574 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
fc19d559 10575 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 10576 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 10577 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9b043a8f 10578 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 10579 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
7c9caa29 10580 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
c7de2d9b 10581 SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
d1ee66c5 10582 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 10583 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 10584 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
ccbd88be 10585 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
309d7363 10586 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
8804fa04 10587 SND_PCI_QUIRK(0xf111, 0x0005, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
33038efb 10588 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
a4297b5d 10589
a7f3eedc 10590#if 0
a4297b5d
TI
10591 /* Below is a quirk table taken from the old code.
10592 * Basically the device should work as is without the fixup table.
10593 * If BIOS doesn't give a proper info, enable the corresponding
10594 * fixup entry.
7d7eb9ea 10595 */
a4297b5d
TI
10596 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
10597 ALC269_FIXUP_AMIC),
10598 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
10599 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
10600 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
10601 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
10602 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
10603 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
10604 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
10605 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
10606 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
10607 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
10608 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
10609 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
10610 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
10611 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
10612 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
10613 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
10614 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
10615 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
10616 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
10617 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
10618 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
10619 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
10620 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
10621 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
10622 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
10623 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
10624 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
10625 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
10626 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
10627 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
10628 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
10629 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
10630 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
10631 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
10632 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
10633 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
10634 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
10635 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
10636 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
10637#endif
10638 {}
10639};
10640
214eef76
DH
10641static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
10642 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
10643 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
10644 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
10645 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 10646 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
10647 {}
10648};
10649
1727a771 10650static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
10651 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
10652 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
10653 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
10654 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
10655 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 10656 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
10657 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
10658 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 10659 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 10660 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 10661 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 10662 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
10663 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10664 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
10665 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
10666 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 10667 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 10668 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 10669 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 10670 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 10671 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 10672 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 10673 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 10674 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 10675 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
10676 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
10677 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
10678 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
10679 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
10680 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
10681 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
10682 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
10683 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
10684 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
10685 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
10686 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
10687 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
10688 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
10689 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
10690 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
10691 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
10692 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
10693 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
10694 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
10695 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
10696 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
10697 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
10698 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
10699 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
10700 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
10701 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
10702 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
10703 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
10704 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
10705 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
10706 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
10707 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
10708 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
10709 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
10710 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
10711 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
10712 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
10713 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
10714 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
10715 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 10716 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 10717 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 10718 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
10719 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
10720 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
10721 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
10722 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
10723 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
10724 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
10725 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
10726 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
10727 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
10728 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
10729 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
10730 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
10731 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
10732 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
10733 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
10734 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
10735 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 10736 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 10737 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 10738 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
10739 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
10740 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
10741 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
10742 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
10743 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
10744 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
10745 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
10746 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
10747 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
10748 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
10749 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
10750 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
10751 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
10752 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
10753 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
10754 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
10755 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
10756 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
10757 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 10758 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 10759 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 10760 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
a2d57ebe 10761 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
ef248d9b 10762 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
fc19d559 10763 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 10764 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 10765 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 10766 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 10767 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 10768 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
c0621669 10769 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
9ebaef05 10770 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
3790a3d6 10771 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
29c8f40b 10772 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 10773 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
aa723946 10774 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 10775 {}
6dda9f4a 10776};
cfc5a845 10777#define ALC225_STANDARD_PINS \
cfc5a845 10778 {0x21, 0x04211020}
6dda9f4a 10779
e8191a8e
HW
10780#define ALC256_STANDARD_PINS \
10781 {0x12, 0x90a60140}, \
10782 {0x14, 0x90170110}, \
e8191a8e
HW
10783 {0x21, 0x02211020}
10784
fea185e2 10785#define ALC282_STANDARD_PINS \
11580297 10786 {0x14, 0x90170110}
e1e62b98 10787
fea185e2 10788#define ALC290_STANDARD_PINS \
11580297 10789 {0x12, 0x99a30130}
fea185e2
DH
10790
10791#define ALC292_STANDARD_PINS \
10792 {0x14, 0x90170110}, \
11580297 10793 {0x15, 0x0221401f}
977e6276 10794
3f640970
HW
10795#define ALC295_STANDARD_PINS \
10796 {0x12, 0xb7a60130}, \
10797 {0x14, 0x90170110}, \
3f640970
HW
10798 {0x21, 0x04211020}
10799
703867e2
WS
10800#define ALC298_STANDARD_PINS \
10801 {0x12, 0x90a60130}, \
10802 {0x21, 0x03211020}
10803
e1918938 10804static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
10805 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
10806 {0x14, 0x01014020},
10807 {0x17, 0x90170110},
10808 {0x18, 0x02a11030},
10809 {0x19, 0x0181303F},
10810 {0x21, 0x0221102f}),
5824ce8d
CC
10811 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
10812 {0x12, 0x90a601c0},
10813 {0x14, 0x90171120},
10814 {0x21, 0x02211030}),
615966ad
CC
10815 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10816 {0x14, 0x90170110},
10817 {0x1b, 0x90a70130},
10818 {0x21, 0x03211020}),
10819 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
10820 {0x1a, 0x90a70130},
10821 {0x1b, 0x90170110},
10822 {0x21, 0x03211020}),
2ae95577 10823 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10824 ALC225_STANDARD_PINS,
8a132099 10825 {0x12, 0xb7a60130},
cfc5a845 10826 {0x14, 0x901701a0}),
2ae95577 10827 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 10828 ALC225_STANDARD_PINS,
8a132099 10829 {0x12, 0xb7a60130},
cfc5a845 10830 {0x14, 0x901701b0}),
8a132099
HW
10831 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10832 ALC225_STANDARD_PINS,
10833 {0x12, 0xb7a60150},
10834 {0x14, 0x901701a0}),
10835 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10836 ALC225_STANDARD_PINS,
10837 {0x12, 0xb7a60150},
10838 {0x14, 0x901701b0}),
10839 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
10840 ALC225_STANDARD_PINS,
10841 {0x12, 0xb7a60130},
10842 {0x1b, 0x90170110}),
0ce48e17
KHF
10843 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
10844 {0x1b, 0x01111010},
10845 {0x1e, 0x01451130},
10846 {0x21, 0x02211020}),
986376b6
HW
10847 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
10848 {0x12, 0x90a60140},
10849 {0x14, 0x90170110},
10850 {0x19, 0x02a11030},
10851 {0x21, 0x02211020}),
e41fc8c5
HW
10852 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10853 {0x14, 0x90170110},
10854 {0x19, 0x02a11030},
10855 {0x1a, 0x02a11040},
10856 {0x1b, 0x01014020},
10857 {0x21, 0x0221101f}),
d06fb562
HW
10858 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10859 {0x14, 0x90170110},
10860 {0x19, 0x02a11030},
10861 {0x1a, 0x02a11040},
10862 {0x1b, 0x01011020},
10863 {0x21, 0x0221101f}),
c6b17f10
HW
10864 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
10865 {0x14, 0x90170110},
10866 {0x19, 0x02a11020},
10867 {0x1a, 0x02a11030},
10868 {0x21, 0x0221101f}),
92666d45
KY
10869 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
10870 {0x21, 0x02211010}),
9e885770
KY
10871 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10872 {0x14, 0x90170110},
10873 {0x19, 0x02a11020},
10874 {0x21, 0x02211030}),
c77900e6 10875 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 10876 {0x14, 0x90170110},
c77900e6 10877 {0x21, 0x02211020}),
86c72d1c
HW
10878 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10879 {0x14, 0x90170130},
10880 {0x21, 0x02211040}),
76c2132e
DH
10881 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10882 {0x12, 0x90a60140},
10883 {0x14, 0x90170110},
76c2132e
DH
10884 {0x21, 0x02211020}),
10885 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10886 {0x12, 0x90a60160},
10887 {0x14, 0x90170120},
76c2132e 10888 {0x21, 0x02211030}),
392c9da2
HW
10889 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10890 {0x14, 0x90170110},
10891 {0x1b, 0x02011020},
10892 {0x21, 0x0221101f}),
6aecd871
HW
10893 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10894 {0x14, 0x90170110},
10895 {0x1b, 0x01011020},
10896 {0x21, 0x0221101f}),
cba59972 10897 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 10898 {0x14, 0x90170130},
cba59972 10899 {0x1b, 0x01014020},
cba59972 10900 {0x21, 0x0221103f}),
6aecd871
HW
10901 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10902 {0x14, 0x90170130},
10903 {0x1b, 0x01011020},
10904 {0x21, 0x0221103f}),
59ec4b57
HW
10905 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10906 {0x14, 0x90170130},
10907 {0x1b, 0x02011020},
10908 {0x21, 0x0221103f}),
e9c28e16 10909 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10910 {0x14, 0x90170150},
e9c28e16 10911 {0x1b, 0x02011020},
e9c28e16
WS
10912 {0x21, 0x0221105f}),
10913 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 10914 {0x14, 0x90170110},
e9c28e16 10915 {0x1b, 0x01014020},
e9c28e16 10916 {0x21, 0x0221101f}),
76c2132e
DH
10917 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10918 {0x12, 0x90a60160},
10919 {0x14, 0x90170120},
10920 {0x17, 0x90170140},
76c2132e
DH
10921 {0x21, 0x0321102f}),
10922 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10923 {0x12, 0x90a60160},
10924 {0x14, 0x90170130},
76c2132e
DH
10925 {0x21, 0x02211040}),
10926 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10927 {0x12, 0x90a60160},
10928 {0x14, 0x90170140},
76c2132e
DH
10929 {0x21, 0x02211050}),
10930 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10931 {0x12, 0x90a60170},
10932 {0x14, 0x90170120},
76c2132e
DH
10933 {0x21, 0x02211030}),
10934 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10935 {0x12, 0x90a60170},
10936 {0x14, 0x90170130},
76c2132e 10937 {0x21, 0x02211040}),
0a1f90a9
HW
10938 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10939 {0x12, 0x90a60170},
10940 {0x14, 0x90171130},
10941 {0x21, 0x02211040}),
70658b99 10942 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
10943 {0x12, 0x90a60170},
10944 {0x14, 0x90170140},
70658b99 10945 {0x21, 0x02211050}),
9b5a4e39 10946 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
10947 {0x12, 0x90a60180},
10948 {0x14, 0x90170130},
9b5a4e39 10949 {0x21, 0x02211040}),
f90d83b3
AK
10950 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10951 {0x12, 0x90a60180},
10952 {0x14, 0x90170120},
10953 {0x21, 0x02211030}),
989dbe4a
HW
10954 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10955 {0x1b, 0x01011020},
10956 {0x21, 0x02211010}),
c1732ede
CC
10957 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10958 {0x14, 0x90170110},
10959 {0x1b, 0x90a70130},
10960 {0x21, 0x04211020}),
10961 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
10962 {0x14, 0x90170110},
10963 {0x1b, 0x90a70130},
10964 {0x21, 0x03211020}),
a806ef1c
CC
10965 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10966 {0x12, 0x90a60130},
10967 {0x14, 0x90170110},
10968 {0x21, 0x03211020}),
6ac371aa
JHP
10969 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10970 {0x12, 0x90a60130},
10971 {0x14, 0x90170110},
10972 {0x21, 0x04211020}),
e1037354
JHP
10973 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
10974 {0x1a, 0x90a70130},
10975 {0x1b, 0x90170110},
10976 {0x21, 0x03211020}),
9e885770
KY
10977 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
10978 {0x14, 0x90170110},
10979 {0x19, 0x02a11020},
10980 {0x21, 0x0221101f}),
8a8de09c
KY
10981 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
10982 {0x17, 0x90170110},
10983 {0x19, 0x03a11030},
10984 {0x21, 0x03211020}),
cf51eb9d
DH
10985 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
10986 {0x12, 0x90a60130},
cf51eb9d
DH
10987 {0x14, 0x90170110},
10988 {0x15, 0x0421101f},
11580297 10989 {0x1a, 0x04a11020}),
0279661b
HW
10990 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
10991 {0x12, 0x90a60140},
0279661b
HW
10992 {0x14, 0x90170110},
10993 {0x15, 0x0421101f},
0279661b 10994 {0x18, 0x02811030},
0279661b 10995 {0x1a, 0x04a1103f},
11580297 10996 {0x1b, 0x02011020}),
42304474 10997 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 10998 ALC282_STANDARD_PINS,
42304474 10999 {0x12, 0x99a30130},
42304474 11000 {0x19, 0x03a11020},
42304474 11001 {0x21, 0x0321101f}),
2c609999 11002 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11003 ALC282_STANDARD_PINS,
2c609999 11004 {0x12, 0x99a30130},
2c609999 11005 {0x19, 0x03a11020},
2c609999
HW
11006 {0x21, 0x03211040}),
11007 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11008 ALC282_STANDARD_PINS,
2c609999 11009 {0x12, 0x99a30130},
2c609999 11010 {0x19, 0x03a11030},
2c609999
HW
11011 {0x21, 0x03211020}),
11012 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11013 ALC282_STANDARD_PINS,
2c609999 11014 {0x12, 0x99a30130},
2c609999 11015 {0x19, 0x04a11020},
2c609999 11016 {0x21, 0x0421101f}),
200afc09 11017 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 11018 ALC282_STANDARD_PINS,
200afc09 11019 {0x12, 0x90a60140},
200afc09 11020 {0x19, 0x04a11030},
200afc09 11021 {0x21, 0x04211020}),
34cdf405
CC
11022 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11023 ALC282_STANDARD_PINS,
11024 {0x12, 0x90a609c0},
11025 {0x18, 0x03a11830},
11026 {0x19, 0x04a19831},
11027 {0x1a, 0x0481303f},
11028 {0x1b, 0x04211020},
11029 {0x21, 0x0321101f}),
11030 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
11031 ALC282_STANDARD_PINS,
11032 {0x12, 0x90a60940},
11033 {0x18, 0x03a11830},
11034 {0x19, 0x04a19831},
11035 {0x1a, 0x0481303f},
11036 {0x1b, 0x04211020},
11037 {0x21, 0x0321101f}),
76c2132e 11038 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11039 ALC282_STANDARD_PINS,
76c2132e 11040 {0x12, 0x90a60130},
76c2132e
DH
11041 {0x21, 0x0321101f}),
11042 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
11043 {0x12, 0x90a60160},
11044 {0x14, 0x90170120},
76c2132e 11045 {0x21, 0x02211030}),
bc262179 11046 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11047 ALC282_STANDARD_PINS,
bc262179 11048 {0x12, 0x90a60130},
bc262179 11049 {0x19, 0x03a11020},
bc262179 11050 {0x21, 0x0321101f}),
c8c6ee61 11051 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
11052 {0x12, 0x90a60130},
11053 {0x14, 0x90170110},
11054 {0x19, 0x04a11040},
11055 {0x21, 0x04211020}),
11056 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
11057 {0x14, 0x90170110},
11058 {0x19, 0x04a11040},
11059 {0x1d, 0x40600001},
11060 {0x21, 0x04211020}),
11061 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
11062 {0x14, 0x90170110},
11063 {0x19, 0x04a11040},
11064 {0x21, 0x04211020}),
c72b9bfe
HW
11065 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
11066 {0x14, 0x90170110},
11067 {0x17, 0x90170111},
11068 {0x19, 0x03a11030},
11069 {0x21, 0x03211020}),
e43252db
KY
11070 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11071 {0x17, 0x90170110},
11072 {0x19, 0x03a11030},
11073 {0x21, 0x03211020}),
41b07476
KY
11074 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
11075 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
11076 {0x19, 0x04a11040},
11077 {0x21, 0x04211020}),
33aaebd4
CC
11078 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
11079 {0x12, 0x90a60130},
11080 {0x17, 0x90170110},
11081 {0x21, 0x02211020}),
d44a6864 11082 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 11083 {0x12, 0x90a60120},
e1e62b98 11084 {0x14, 0x90170110},
e1e62b98 11085 {0x21, 0x0321101f}),
e4442bcf 11086 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11087 ALC290_STANDARD_PINS,
e4442bcf 11088 {0x15, 0x04211040},
e4442bcf 11089 {0x18, 0x90170112},
11580297 11090 {0x1a, 0x04a11020}),
e4442bcf 11091 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11092 ALC290_STANDARD_PINS,
e4442bcf 11093 {0x15, 0x04211040},
e4442bcf 11094 {0x18, 0x90170110},
11580297 11095 {0x1a, 0x04a11020}),
e4442bcf 11096 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11097 ALC290_STANDARD_PINS,
e4442bcf 11098 {0x15, 0x0421101f},
11580297 11099 {0x1a, 0x04a11020}),
e4442bcf 11100 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11101 ALC290_STANDARD_PINS,
e4442bcf 11102 {0x15, 0x04211020},
11580297 11103 {0x1a, 0x04a11040}),
e4442bcf 11104 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11105 ALC290_STANDARD_PINS,
e4442bcf
HW
11106 {0x14, 0x90170110},
11107 {0x15, 0x04211020},
11580297 11108 {0x1a, 0x04a11040}),
e4442bcf 11109 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11110 ALC290_STANDARD_PINS,
e4442bcf
HW
11111 {0x14, 0x90170110},
11112 {0x15, 0x04211020},
11580297 11113 {0x1a, 0x04a11020}),
e4442bcf 11114 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 11115 ALC290_STANDARD_PINS,
e4442bcf
HW
11116 {0x14, 0x90170110},
11117 {0x15, 0x0421101f},
11580297 11118 {0x1a, 0x04a11020}),
e8818fa8 11119 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 11120 ALC292_STANDARD_PINS,
e8818fa8 11121 {0x12, 0x90a60140},
e8818fa8 11122 {0x16, 0x01014020},
11580297 11123 {0x19, 0x01a19030}),
e8818fa8 11124 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 11125 ALC292_STANDARD_PINS,
e8818fa8 11126 {0x12, 0x90a60140},
e8818fa8
HW
11127 {0x16, 0x01014020},
11128 {0x18, 0x02a19031},
11580297 11129 {0x19, 0x01a1903e}),
76c2132e 11130 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 11131 ALC292_STANDARD_PINS,
11580297 11132 {0x12, 0x90a60140}),
76c2132e 11133 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11134 ALC292_STANDARD_PINS,
76c2132e 11135 {0x13, 0x90a60140},
76c2132e 11136 {0x16, 0x21014020},
11580297 11137 {0x19, 0x21a19030}),
e03fdbde 11138 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 11139 ALC292_STANDARD_PINS,
11580297 11140 {0x13, 0x90a60140}),
eeacd80f
JHP
11141 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
11142 {0x17, 0x90170110},
11143 {0x21, 0x04211020}),
d8ae458e
CC
11144 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
11145 {0x14, 0x90170110},
11146 {0x1b, 0x90a70130},
11147 {0x21, 0x04211020}),
8bb37a2a
JHP
11148 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11149 {0x12, 0x90a60130},
11150 {0x17, 0x90170110},
11151 {0x21, 0x03211020}),
0bea4cc8
JHP
11152 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11153 {0x12, 0x90a60130},
11154 {0x17, 0x90170110},
11155 {0x21, 0x04211020}),
3887c26c
TI
11156 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
11157 {0x12, 0x90a60130},
11158 {0x17, 0x90170110},
11159 {0x21, 0x03211020}),
9e43342b 11160 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
11161 {0x12, 0x90a60120},
11162 {0x17, 0x90170110},
11163 {0x21, 0x04211030}),
11164 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
11165 {0x12, 0x90a60130},
11166 {0x17, 0x90170110},
11167 {0x21, 0x03211020}),
11168 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
11169 {0x12, 0x90a60130},
11170 {0x17, 0x90170110},
11171 {0x21, 0x03211020}),
9f502ff5
TI
11172 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11173 ALC298_STANDARD_PINS,
11174 {0x17, 0x90170110}),
977e6276 11175 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
11176 ALC298_STANDARD_PINS,
11177 {0x17, 0x90170140}),
11178 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
11179 ALC298_STANDARD_PINS,
9f502ff5 11180 {0x17, 0x90170150}),
9f1bc2c4
KHF
11181 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
11182 {0x12, 0xb7a60140},
11183 {0x13, 0xb7a60150},
11184 {0x17, 0x90170110},
11185 {0x1a, 0x03011020},
11186 {0x21, 0x03211030}),
54324221
JM
11187 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
11188 {0x12, 0xb7a60140},
11189 {0x17, 0x90170110},
11190 {0x1a, 0x03a11030},
11191 {0x21, 0x03211020}),
fcc6c877
KY
11192 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11193 ALC225_STANDARD_PINS,
11194 {0x12, 0xb7a60130},
fcc6c877 11195 {0x17, 0x90170110}),
573fcbfd
HW
11196 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
11197 {0x14, 0x01014010},
11198 {0x17, 0x90170120},
11199 {0x18, 0x02a11030},
11200 {0x19, 0x02a1103f},
11201 {0x21, 0x0221101f}),
e1918938
HW
11202 {}
11203};
6dda9f4a 11204
7c0a6939
HW
11205/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
11206 * more machines, don't need to match all valid pins, just need to match
11207 * all the pins defined in the tbl. Just because of this reason, it is possible
11208 * that a single machine matches multiple tbls, so there is one limitation:
11209 * at most one tbl is allowed to define for the same vendor and same codec
11210 */
11211static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
34ab5bbc
KY
11212 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
11213 {0x19, 0x40000000}),
7c0a6939
HW
11214 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11215 {0x19, 0x40000000},
11216 {0x1b, 0x40000000}),
4b21a669
KY
11217 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
11218 {0x19, 0x40000000},
11219 {0x1b, 0x40000000}),
aed8c7f4
HW
11220 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11221 {0x19, 0x40000000},
11222 {0x1a, 0x40000000}),
d64ebdbf
HW
11223 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
11224 {0x19, 0x40000000},
11225 {0x1a, 0x40000000}),
5815bdfd
HW
11226 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
11227 {0x19, 0x40000000},
11228 {0x1a, 0x40000000}),
c8c0a03e
KY
11229 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
11230 {0x19, 0x40000000}),
7c0a6939
HW
11231 {}
11232};
11233
546bb678 11234static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 11235{
526af6eb 11236 struct alc_spec *spec = codec->spec;
1d045db9 11237 int val;
ebb83eeb 11238
526af6eb 11239 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 11240 return;
526af6eb 11241
1bb7e43e 11242 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
11243 alc_write_coef_idx(codec, 0xf, 0x960b);
11244 alc_write_coef_idx(codec, 0xe, 0x8817);
11245 }
ebb83eeb 11246
1bb7e43e 11247 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
11248 alc_write_coef_idx(codec, 0xf, 0x960b);
11249 alc_write_coef_idx(codec, 0xe, 0x8814);
11250 }
ebb83eeb 11251
1bb7e43e 11252 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 11253 /* Power up output pin */
98b24883 11254 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 11255 }
ebb83eeb 11256
1bb7e43e 11257 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 11258 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 11259 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
11260 /* Capless ramp up clock control */
11261 alc_write_coef_idx(codec, 0xd, val | (1<<10));
11262 }
11263 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 11264 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
11265 /* Class D power on reset */
11266 alc_write_coef_idx(codec, 0x17, val | (1<<7));
11267 }
11268 }
ebb83eeb 11269
98b24883
TI
11270 /* HP */
11271 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 11272}
a7f2371f 11273
1d045db9
TI
11274/*
11275 */
1d045db9
TI
11276static int patch_alc269(struct hda_codec *codec)
11277{
11278 struct alc_spec *spec;
3de95173 11279 int err;
f1d4e28b 11280
3de95173 11281 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 11282 if (err < 0)
3de95173
TI
11283 return err;
11284
11285 spec = codec->spec;
08c189f2 11286 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 11287 codec->power_save_node = 0;
46cdff23 11288 spec->en_3kpull_low = true;
e16fb6d1 11289
225068ab
TI
11290#ifdef CONFIG_PM
11291 codec->patch_ops.suspend = alc269_suspend;
11292 codec->patch_ops.resume = alc269_resume;
11293#endif
c2d6af53
KY
11294 spec->shutup = alc_default_shutup;
11295 spec->init_hook = alc_default_init;
225068ab 11296
7639a06c 11297 switch (codec->core.vendor_id) {
065380f0 11298 case 0x10ec0269:
1d045db9 11299 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
11300 switch (alc_get_coef0(codec) & 0x00f0) {
11301 case 0x0010:
5100cd07
TI
11302 if (codec->bus->pci &&
11303 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11304 spec->cdefine.platform_type == 1)
20ca0c35 11305 err = alc_codec_rename(codec, "ALC271X");
1d045db9 11306 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
11307 break;
11308 case 0x0020:
5100cd07
TI
11309 if (codec->bus->pci &&
11310 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 11311 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 11312 err = alc_codec_rename(codec, "ALC3202");
1d045db9 11313 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 11314 break;
adcc70b2
KY
11315 case 0x0030:
11316 spec->codec_variant = ALC269_TYPE_ALC269VD;
11317 break;
1bb7e43e 11318 default:
1d045db9 11319 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 11320 }
e16fb6d1
TI
11321 if (err < 0)
11322 goto error;
c2d6af53 11323 spec->shutup = alc269_shutup;
546bb678 11324 spec->init_hook = alc269_fill_coef;
1d045db9 11325 alc269_fill_coef(codec);
065380f0
KY
11326 break;
11327
11328 case 0x10ec0280:
11329 case 0x10ec0290:
11330 spec->codec_variant = ALC269_TYPE_ALC280;
11331 break;
11332 case 0x10ec0282:
065380f0 11333 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
11334 spec->shutup = alc282_shutup;
11335 spec->init_hook = alc282_init;
065380f0 11336 break;
2af02be7
KY
11337 case 0x10ec0233:
11338 case 0x10ec0283:
11339 spec->codec_variant = ALC269_TYPE_ALC283;
11340 spec->shutup = alc283_shutup;
11341 spec->init_hook = alc283_init;
11342 break;
065380f0
KY
11343 case 0x10ec0284:
11344 case 0x10ec0292:
11345 spec->codec_variant = ALC269_TYPE_ALC284;
11346 break;
161ebf29 11347 case 0x10ec0293:
4731d5de 11348 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 11349 break;
7fc7d047 11350 case 0x10ec0286:
7c665932 11351 case 0x10ec0288:
7fc7d047
KY
11352 spec->codec_variant = ALC269_TYPE_ALC286;
11353 break;
506b62c3
KY
11354 case 0x10ec0298:
11355 spec->codec_variant = ALC269_TYPE_ALC298;
11356 break;
ea04a1db 11357 case 0x10ec0235:
1d04c9de
KY
11358 case 0x10ec0255:
11359 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
11360 spec->shutup = alc256_shutup;
11361 spec->init_hook = alc256_init;
1d04c9de 11362 break;
1948fc06 11363 case 0x10ec0230:
736f20a7 11364 case 0x10ec0236:
4344aec8 11365 case 0x10ec0256:
527f4643 11366 case 0x19e58326:
4344aec8 11367 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
11368 spec->shutup = alc256_shutup;
11369 spec->init_hook = alc256_init;
7d1b6e29 11370 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
46cdff23
KY
11371 if (codec->core.vendor_id == 0x10ec0236 &&
11372 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
11373 spec->en_3kpull_low = false;
4344aec8 11374 break;
f429e7e4
KY
11375 case 0x10ec0257:
11376 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
11377 spec->shutup = alc256_shutup;
11378 spec->init_hook = alc256_init;
f429e7e4 11379 spec->gen.mixer_nid = 0;
46cdff23 11380 spec->en_3kpull_low = false;
f429e7e4 11381 break;
0a6f0600 11382 case 0x10ec0215:
7fbdcd83 11383 case 0x10ec0245:
0a6f0600
KY
11384 case 0x10ec0285:
11385 case 0x10ec0289:
60571929
KY
11386 if (alc_get_coef0(codec) & 0x0010)
11387 spec->codec_variant = ALC269_TYPE_ALC245;
11388 else
11389 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
11390 spec->shutup = alc225_shutup;
11391 spec->init_hook = alc225_init;
0a6f0600
KY
11392 spec->gen.mixer_nid = 0;
11393 break;
4231430d 11394 case 0x10ec0225:
7d727869 11395 case 0x10ec0295:
28f1f9b2 11396 case 0x10ec0299:
4231430d 11397 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
11398 spec->shutup = alc225_shutup;
11399 spec->init_hook = alc225_init;
c1350bff 11400 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 11401 break;
99cee034
KY
11402 case 0x10ec0287:
11403 spec->codec_variant = ALC269_TYPE_ALC287;
11404 spec->shutup = alc225_shutup;
11405 spec->init_hook = alc225_init;
11406 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
11407 break;
dcd4f0db
KY
11408 case 0x10ec0234:
11409 case 0x10ec0274:
11410 case 0x10ec0294:
11411 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 11412 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 11413 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 11414 spec->init_hook = alc294_init;
dcd4f0db 11415 break;
1078bef0
KY
11416 case 0x10ec0300:
11417 spec->codec_variant = ALC269_TYPE_ALC300;
11418 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 11419 break;
f0778871
KY
11420 case 0x10ec0623:
11421 spec->codec_variant = ALC269_TYPE_ALC623;
11422 break;
6fbae35a
KY
11423 case 0x10ec0700:
11424 case 0x10ec0701:
11425 case 0x10ec0703:
83629532 11426 case 0x10ec0711:
6fbae35a
KY
11427 spec->codec_variant = ALC269_TYPE_ALC700;
11428 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 11429 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 11430 spec->init_hook = alc294_init;
6fbae35a
KY
11431 break;
11432
1d045db9 11433 }
6dda9f4a 11434
ad60d502 11435 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 11436 spec->has_alc5505_dsp = 1;
ad60d502
KY
11437 spec->init_hook = alc5505_dsp_init;
11438 }
11439
c9af753f
TI
11440 alc_pre_init(codec);
11441
efe55732
TI
11442 snd_hda_pick_fixup(codec, alc269_fixup_models,
11443 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
11444 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
11445 * the quirk breaks the latter (bko#214101).
11446 * Clear the wrong entry.
11447 */
11448 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
11449 codec->core.vendor_id == 0x10ec0294) {
11450 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
11451 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
11452 }
11453
0fc1e447 11454 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 11455 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
11456 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
11457 alc269_fixups);
11458 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11459
11460 alc_auto_parse_customize_define(codec);
11461
11462 if (has_cdefine_beep(codec))
11463 spec->gen.beep_nid = 0x01;
11464
a4297b5d
TI
11465 /* automatic parse from the BIOS config */
11466 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
11467 if (err < 0)
11468 goto error;
6dda9f4a 11469
fea80fae
TI
11470 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
11471 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
11472 if (err < 0)
11473 goto error;
11474 }
f1d4e28b 11475
1727a771 11476 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11477
1d045db9 11478 return 0;
e16fb6d1
TI
11479
11480 error:
11481 alc_free(codec);
11482 return err;
1d045db9 11483}
f1d4e28b 11484
1d045db9
TI
11485/*
11486 * ALC861
11487 */
622e84cd 11488
1d045db9 11489static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 11490{
1d045db9 11491 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11492 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
11493 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
11494}
11495
1d045db9
TI
11496/* Pin config fixes */
11497enum {
e652f4c8
TI
11498 ALC861_FIXUP_FSC_AMILO_PI1505,
11499 ALC861_FIXUP_AMP_VREF_0F,
11500 ALC861_FIXUP_NO_JACK_DETECT,
11501 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 11502 ALC660_FIXUP_ASUS_W7J,
1d045db9 11503};
7085ec12 11504
31150f23
TI
11505/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
11506static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 11507 const struct hda_fixup *fix, int action)
31150f23
TI
11508{
11509 struct alc_spec *spec = codec->spec;
11510 unsigned int val;
11511
1727a771 11512 if (action != HDA_FIXUP_ACT_INIT)
31150f23 11513 return;
d3f02d60 11514 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
11515 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
11516 val |= AC_PINCTL_IN_EN;
11517 val |= AC_PINCTL_VREF_50;
cdd03ced 11518 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 11519 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
11520}
11521
e652f4c8
TI
11522/* suppress the jack-detection */
11523static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 11524 const struct hda_fixup *fix, int action)
e652f4c8 11525{
1727a771 11526 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 11527 codec->no_jack_detect = 1;
7d7eb9ea 11528}
e652f4c8 11529
1727a771 11530static const struct hda_fixup alc861_fixups[] = {
e652f4c8 11531 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
11532 .type = HDA_FIXUP_PINS,
11533 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
11534 { 0x0b, 0x0221101f }, /* HP */
11535 { 0x0f, 0x90170310 }, /* speaker */
11536 { }
11537 }
11538 },
e652f4c8 11539 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 11540 .type = HDA_FIXUP_FUNC,
31150f23 11541 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 11542 },
e652f4c8 11543 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 11544 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
11545 .v.func = alc_fixup_no_jack_detect,
11546 },
11547 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 11548 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
11549 .v.func = alc861_fixup_asus_amp_vref_0f,
11550 .chained = true,
11551 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
11552 },
11553 [ALC660_FIXUP_ASUS_W7J] = {
11554 .type = HDA_FIXUP_VERBS,
11555 .v.verbs = (const struct hda_verb[]) {
11556 /* ASUS W7J needs a magic pin setup on unused NID 0x10
11557 * for enabling outputs
11558 */
11559 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
11560 { }
11561 },
e652f4c8 11562 }
1d045db9 11563};
7085ec12 11564
1d045db9 11565static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 11566 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 11567 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
11568 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
11569 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
11570 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 11571 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 11572 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
11573 {}
11574};
3af9ee6b 11575
1d045db9
TI
11576/*
11577 */
1d045db9 11578static int patch_alc861(struct hda_codec *codec)
7085ec12 11579{
1d045db9 11580 struct alc_spec *spec;
1d045db9 11581 int err;
7085ec12 11582
3de95173
TI
11583 err = alc_alloc_spec(codec, 0x15);
11584 if (err < 0)
11585 return err;
1d045db9 11586
3de95173 11587 spec = codec->spec;
2722b535
TI
11588 if (has_cdefine_beep(codec))
11589 spec->gen.beep_nid = 0x23;
1d045db9 11590
225068ab
TI
11591#ifdef CONFIG_PM
11592 spec->power_hook = alc_power_eapd;
11593#endif
11594
c9af753f
TI
11595 alc_pre_init(codec);
11596
1727a771
TI
11597 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
11598 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 11599
cb4e4824
TI
11600 /* automatic parse from the BIOS config */
11601 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
11602 if (err < 0)
11603 goto error;
3af9ee6b 11604
fea80fae
TI
11605 if (!spec->gen.no_analog) {
11606 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
11607 if (err < 0)
11608 goto error;
11609 }
7085ec12 11610
1727a771 11611 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11612
1d045db9 11613 return 0;
e16fb6d1
TI
11614
11615 error:
11616 alc_free(codec);
11617 return err;
7085ec12
TI
11618}
11619
1d045db9
TI
11620/*
11621 * ALC861-VD support
11622 *
11623 * Based on ALC882
11624 *
11625 * In addition, an independent DAC
11626 */
1d045db9 11627static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 11628{
1d045db9 11629 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11630 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11631 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
11632}
11633
1d045db9 11634enum {
8fdcb6fe
TI
11635 ALC660VD_FIX_ASUS_GPIO1,
11636 ALC861VD_FIX_DALLAS,
1d045db9 11637};
ce764ab2 11638
8fdcb6fe
TI
11639/* exclude VREF80 */
11640static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 11641 const struct hda_fixup *fix, int action)
8fdcb6fe 11642{
1727a771 11643 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
11644 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
11645 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
11646 }
11647}
11648
df73d83f
TI
11649/* reset GPIO1 */
11650static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
11651 const struct hda_fixup *fix, int action)
11652{
11653 struct alc_spec *spec = codec->spec;
11654
11655 if (action == HDA_FIXUP_ACT_PRE_PROBE)
11656 spec->gpio_mask |= 0x02;
11657 alc_fixup_gpio(codec, action, 0x01);
11658}
11659
1727a771 11660static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 11661 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
11662 .type = HDA_FIXUP_FUNC,
11663 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 11664 },
8fdcb6fe 11665 [ALC861VD_FIX_DALLAS] = {
1727a771 11666 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
11667 .v.func = alc861vd_fixup_dallas,
11668 },
1d045db9 11669};
ce764ab2 11670
1d045db9 11671static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 11672 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 11673 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 11674 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
11675 {}
11676};
ce764ab2 11677
1d045db9
TI
11678/*
11679 */
1d045db9 11680static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 11681{
1d045db9 11682 struct alc_spec *spec;
cb4e4824 11683 int err;
ce764ab2 11684
3de95173
TI
11685 err = alc_alloc_spec(codec, 0x0b);
11686 if (err < 0)
11687 return err;
1d045db9 11688
3de95173 11689 spec = codec->spec;
2722b535
TI
11690 if (has_cdefine_beep(codec))
11691 spec->gen.beep_nid = 0x23;
1d045db9 11692
225068ab
TI
11693 spec->shutup = alc_eapd_shutup;
11694
c9af753f
TI
11695 alc_pre_init(codec);
11696
1727a771
TI
11697 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
11698 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 11699
cb4e4824
TI
11700 /* automatic parse from the BIOS config */
11701 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
11702 if (err < 0)
11703 goto error;
ce764ab2 11704
fea80fae
TI
11705 if (!spec->gen.no_analog) {
11706 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11707 if (err < 0)
11708 goto error;
11709 }
1d045db9 11710
1727a771 11711 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11712
ce764ab2 11713 return 0;
e16fb6d1
TI
11714
11715 error:
11716 alc_free(codec);
11717 return err;
ce764ab2
TI
11718}
11719
1d045db9
TI
11720/*
11721 * ALC662 support
11722 *
11723 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
11724 * configuration. Each pin widget can choose any input DACs and a mixer.
11725 * Each ADC is connected from a mixer of all inputs. This makes possible
11726 * 6-channel independent captures.
11727 *
11728 * In addition, an independent DAC for the multi-playback (not used in this
11729 * driver yet).
11730 */
1d045db9
TI
11731
11732/*
11733 * BIOS auto configuration
11734 */
11735
bc9f98a9
KY
11736static int alc662_parse_auto_config(struct hda_codec *codec)
11737{
4c6d72d1 11738 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
11739 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
11740 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
11741 const hda_nid_t *ssids;
ee979a14 11742
7639a06c
TI
11743 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
11744 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
11745 codec->core.vendor_id == 0x10ec0671)
3e6179b8 11746 ssids = alc663_ssids;
6227cdce 11747 else
3e6179b8
TI
11748 ssids = alc662_ssids;
11749 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
11750}
11751
6be7948f 11752static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 11753 const struct hda_fixup *fix, int action)
6fc398cb 11754{
9bb1f06f 11755 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 11756 return;
6be7948f
TB
11757 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
11758 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
11759 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
11760 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
11761 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 11762 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
11763}
11764
8e383953
TI
11765static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
11766 { .channels = 2,
11767 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
11768 { .channels = 4,
11769 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
11770 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
11771 { }
11772};
11773
11774/* override the 2.1 chmap */
eb9ca3ab 11775static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
11776 const struct hda_fixup *fix, int action)
11777{
11778 if (action == HDA_FIXUP_ACT_BUILD) {
11779 struct alc_spec *spec = codec->spec;
bbbc7e85 11780 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
11781 }
11782}
11783
bf68665d
TI
11784/* avoid D3 for keeping GPIO up */
11785static unsigned int gpio_led_power_filter(struct hda_codec *codec,
11786 hda_nid_t nid,
11787 unsigned int power_state)
11788{
11789 struct alc_spec *spec = codec->spec;
d261eec8 11790 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
11791 return AC_PWRST_D0;
11792 return power_state;
11793}
11794
3e887f37
TI
11795static void alc662_fixup_led_gpio1(struct hda_codec *codec,
11796 const struct hda_fixup *fix, int action)
11797{
11798 struct alc_spec *spec = codec->spec;
3e887f37 11799
01e4a275 11800 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 11801 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 11802 spec->mute_led_polarity = 1;
bf68665d 11803 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
11804 }
11805}
11806
c6790c8e
KY
11807static void alc662_usi_automute_hook(struct hda_codec *codec,
11808 struct hda_jack_callback *jack)
11809{
11810 struct alc_spec *spec = codec->spec;
11811 int vref;
11812 msleep(200);
11813 snd_hda_gen_hp_automute(codec, jack);
11814
11815 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
11816 msleep(100);
11817 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
11818 vref);
11819}
11820
11821static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
11822 const struct hda_fixup *fix, int action)
11823{
11824 struct alc_spec *spec = codec->spec;
11825 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11826 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11827 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
11828 }
11829}
11830
00066e97
SB
11831static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
11832 struct hda_jack_callback *cb)
11833{
11834 /* surround speakers at 0x1b already get muted automatically when
11835 * headphones are plugged in, but we have to mute/unmute the remaining
11836 * channels manually:
11837 * 0x15 - front left/front right
11838 * 0x18 - front center/ LFE
11839 */
11840 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
11841 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
11842 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
11843 } else {
11844 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
11845 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
11846 }
11847}
11848
11849static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
11850 const struct hda_fixup *fix, int action)
11851{
11852 /* Pin 0x1b: shared headphones jack and surround speakers */
11853 if (!is_jack_detectable(codec, 0x1b))
11854 return;
11855
11856 switch (action) {
11857 case HDA_FIXUP_ACT_PRE_PROBE:
11858 snd_hda_jack_detect_enable_callback(codec, 0x1b,
11859 alc662_aspire_ethos_mute_speakers);
336820c4
TI
11860 /* subwoofer needs an extra GPIO setting to become audible */
11861 alc_setup_gpio(codec, 0x02);
00066e97
SB
11862 break;
11863 case HDA_FIXUP_ACT_INIT:
11864 /* Make sure to start in a correct state, i.e. if
11865 * headphones have been plugged in before powering up the system
11866 */
11867 alc662_aspire_ethos_mute_speakers(codec, NULL);
11868 break;
11869 }
11870}
11871
5af29028
KY
11872static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
11873 const struct hda_fixup *fix, int action)
11874{
11875 struct alc_spec *spec = codec->spec;
11876
11877 static const struct hda_pintbl pincfgs[] = {
11878 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
11879 { 0x1b, 0x0181304f },
11880 { }
11881 };
11882
11883 switch (action) {
11884 case HDA_FIXUP_ACT_PRE_PROBE:
11885 spec->gen.mixer_nid = 0;
11886 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11887 snd_hda_apply_pincfgs(codec, pincfgs);
11888 break;
11889 case HDA_FIXUP_ACT_INIT:
11890 alc_write_coef_idx(codec, 0x19, 0xa054);
11891 break;
11892 }
11893}
11894
d7f32791
KY
11895static void alc897_hp_automute_hook(struct hda_codec *codec,
11896 struct hda_jack_callback *jack)
11897{
11898 struct alc_spec *spec = codec->spec;
11899 int vref;
11900
11901 snd_hda_gen_hp_automute(codec, jack);
11902 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
d397b6e5 11903 snd_hda_set_pin_ctl(codec, 0x1b, vref);
d7f32791
KY
11904}
11905
11906static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
11907 const struct hda_fixup *fix, int action)
11908{
11909 struct alc_spec *spec = codec->spec;
11910 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11911 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
d397b6e5
KY
11912 spec->no_shutup_pins = 1;
11913 }
11914 if (action == HDA_FIXUP_ACT_PROBE) {
11915 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
d7f32791
KY
11916 }
11917}
11918
4bf5bf54
EP
11919static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
11920 const struct hda_fixup *fix, int action)
11921{
11922 struct alc_spec *spec = codec->spec;
11923
11924 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
11925 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
11926 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
11927 }
11928}
11929
6b0f95c4 11930static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
11931 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
11932 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
11933 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
11934 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
11935 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
11936 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
11937 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
11938 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
11939 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
11940 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
11941 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
11942 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
11943 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
11944 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
11945 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
11946 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
11947 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
11948 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
11949 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
11950 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
11951 {}
11952};
11953
11954static void alc668_restore_default_value(struct hda_codec *codec)
11955{
11956 alc_process_coef_fw(codec, alc668_coefs);
11957}
11958
6cb3b707 11959enum {
2df03514 11960 ALC662_FIXUP_ASPIRE,
3e887f37 11961 ALC662_FIXUP_LED_GPIO1,
6cb3b707 11962 ALC662_FIXUP_IDEAPAD,
6be7948f 11963 ALC272_FIXUP_MARIO,
f1ec5be1 11964 ALC662_FIXUP_CZC_ET26,
d2ebd479 11965 ALC662_FIXUP_CZC_P10T,
94024cd1 11966 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 11967 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
11968 ALC662_FIXUP_ASUS_MODE1,
11969 ALC662_FIXUP_ASUS_MODE2,
11970 ALC662_FIXUP_ASUS_MODE3,
11971 ALC662_FIXUP_ASUS_MODE4,
11972 ALC662_FIXUP_ASUS_MODE5,
11973 ALC662_FIXUP_ASUS_MODE6,
11974 ALC662_FIXUP_ASUS_MODE7,
11975 ALC662_FIXUP_ASUS_MODE8,
1565cc35 11976 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 11977 ALC662_FIXUP_ZOTAC_Z68,
125821ae 11978 ALC662_FIXUP_INV_DMIC,
1f8b46cd 11979 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 11980 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11981 ALC662_FIXUP_HEADSET_MODE,
73bdd597 11982 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 11983 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 11984 ALC662_FIXUP_BASS_16,
a30c9aaa 11985 ALC662_FIXUP_BASS_1A,
8e54b4ac 11986 ALC662_FIXUP_BASS_CHMAP,
493a52a9 11987 ALC668_FIXUP_AUTO_MUTE,
5e6db669 11988 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 11989 ALC668_FIXUP_DELL_XPS13,
9d4dc584 11990 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 11991 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 11992 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 11993 ALC668_FIXUP_MIC_COEF,
11ba6111 11994 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
11995 ALC891_FIXUP_HEADSET_MODE,
11996 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 11997 ALC662_FIXUP_ACER_VERITON,
1a3f0991 11998 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
11999 ALC662_FIXUP_USI_FUNC,
12000 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 12001 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 12002 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 12003 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 12004 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 12005 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 12006 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
12007 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
12008 ALC668_FIXUP_HEADSET_MIC,
12009 ALC668_FIXUP_MIC_DET_COEF,
d7f32791
KY
12010 ALC897_FIXUP_LENOVO_HEADSET_MIC,
12011 ALC897_FIXUP_HEADSET_MIC_PIN,
fe6900bd 12012 ALC897_FIXUP_HP_HSMIC_VERB,
4bf5bf54
EP
12013 ALC897_FIXUP_LENOVO_HEADSET_MODE,
12014 ALC897_FIXUP_HEADSET_MIC_PIN2,
73f1c75d 12015 ALC897_FIXUP_UNIS_H3C_X500S,
6cb3b707
DH
12016};
12017
1727a771 12018static const struct hda_fixup alc662_fixups[] = {
2df03514 12019 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
12020 .type = HDA_FIXUP_PINS,
12021 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
12022 { 0x15, 0x99130112 }, /* subwoofer */
12023 { }
12024 }
12025 },
3e887f37
TI
12026 [ALC662_FIXUP_LED_GPIO1] = {
12027 .type = HDA_FIXUP_FUNC,
12028 .v.func = alc662_fixup_led_gpio1,
12029 },
6cb3b707 12030 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
12031 .type = HDA_FIXUP_PINS,
12032 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
12033 { 0x17, 0x99130112 }, /* subwoofer */
12034 { }
3e887f37
TI
12035 },
12036 .chained = true,
12037 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 12038 },
6be7948f 12039 [ALC272_FIXUP_MARIO] = {
1727a771 12040 .type = HDA_FIXUP_FUNC,
b5bfbc67 12041 .v.func = alc272_fixup_mario,
d2ebd479 12042 },
f1ec5be1
HC
12043 [ALC662_FIXUP_CZC_ET26] = {
12044 .type = HDA_FIXUP_PINS,
12045 .v.pins = (const struct hda_pintbl[]) {
12046 {0x12, 0x403cc000},
12047 {0x14, 0x90170110}, /* speaker */
12048 {0x15, 0x411111f0},
12049 {0x16, 0x411111f0},
12050 {0x18, 0x01a19030}, /* mic */
12051 {0x19, 0x90a7013f}, /* int-mic */
12052 {0x1a, 0x01014020},
12053 {0x1b, 0x0121401f},
12054 {0x1c, 0x411111f0},
12055 {0x1d, 0x411111f0},
12056 {0x1e, 0x40478e35},
12057 {}
12058 },
12059 .chained = true,
12060 .chain_id = ALC662_FIXUP_SKU_IGNORE
12061 },
d2ebd479 12062 [ALC662_FIXUP_CZC_P10T] = {
1727a771 12063 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
12064 .v.verbs = (const struct hda_verb[]) {
12065 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
12066 {}
12067 }
12068 },
94024cd1 12069 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 12070 .type = HDA_FIXUP_FUNC,
23d30f28 12071 .v.func = alc_fixup_sku_ignore,
c6b35874 12072 },
e59ea3ed 12073 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
12074 .type = HDA_FIXUP_PINS,
12075 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
12076 { 0x14, 0x0221201f }, /* HP out */
12077 { }
12078 },
12079 .chained = true,
12080 .chain_id = ALC662_FIXUP_SKU_IGNORE
12081 },
53c334ad 12082 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
12083 .type = HDA_FIXUP_PINS,
12084 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12085 { 0x14, 0x99130110 }, /* speaker */
12086 { 0x18, 0x01a19c20 }, /* mic */
12087 { 0x19, 0x99a3092f }, /* int-mic */
12088 { 0x21, 0x0121401f }, /* HP out */
12089 { }
12090 },
12091 .chained = true,
12092 .chain_id = ALC662_FIXUP_SKU_IGNORE
12093 },
12094 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
12095 .type = HDA_FIXUP_PINS,
12096 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
12097 { 0x14, 0x99130110 }, /* speaker */
12098 { 0x18, 0x01a19820 }, /* mic */
12099 { 0x19, 0x99a3092f }, /* int-mic */
12100 { 0x1b, 0x0121401f }, /* HP out */
12101 { }
12102 },
53c334ad
TI
12103 .chained = true,
12104 .chain_id = ALC662_FIXUP_SKU_IGNORE
12105 },
12106 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
12107 .type = HDA_FIXUP_PINS,
12108 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12109 { 0x14, 0x99130110 }, /* speaker */
12110 { 0x15, 0x0121441f }, /* HP */
12111 { 0x18, 0x01a19840 }, /* mic */
12112 { 0x19, 0x99a3094f }, /* int-mic */
12113 { 0x21, 0x01211420 }, /* HP2 */
12114 { }
12115 },
12116 .chained = true,
12117 .chain_id = ALC662_FIXUP_SKU_IGNORE
12118 },
12119 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
12120 .type = HDA_FIXUP_PINS,
12121 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12122 { 0x14, 0x99130110 }, /* speaker */
12123 { 0x16, 0x99130111 }, /* speaker */
12124 { 0x18, 0x01a19840 }, /* mic */
12125 { 0x19, 0x99a3094f }, /* int-mic */
12126 { 0x21, 0x0121441f }, /* HP */
12127 { }
12128 },
12129 .chained = true,
12130 .chain_id = ALC662_FIXUP_SKU_IGNORE
12131 },
12132 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
12133 .type = HDA_FIXUP_PINS,
12134 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12135 { 0x14, 0x99130110 }, /* speaker */
12136 { 0x15, 0x0121441f }, /* HP */
12137 { 0x16, 0x99130111 }, /* speaker */
12138 { 0x18, 0x01a19840 }, /* mic */
12139 { 0x19, 0x99a3094f }, /* int-mic */
12140 { }
12141 },
12142 .chained = true,
12143 .chain_id = ALC662_FIXUP_SKU_IGNORE
12144 },
12145 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
12146 .type = HDA_FIXUP_PINS,
12147 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12148 { 0x14, 0x99130110 }, /* speaker */
12149 { 0x15, 0x01211420 }, /* HP2 */
12150 { 0x18, 0x01a19840 }, /* mic */
12151 { 0x19, 0x99a3094f }, /* int-mic */
12152 { 0x1b, 0x0121441f }, /* HP */
12153 { }
12154 },
12155 .chained = true,
12156 .chain_id = ALC662_FIXUP_SKU_IGNORE
12157 },
12158 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
12159 .type = HDA_FIXUP_PINS,
12160 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12161 { 0x14, 0x99130110 }, /* speaker */
12162 { 0x17, 0x99130111 }, /* speaker */
12163 { 0x18, 0x01a19840 }, /* mic */
12164 { 0x19, 0x99a3094f }, /* int-mic */
12165 { 0x1b, 0x01214020 }, /* HP */
12166 { 0x21, 0x0121401f }, /* HP */
12167 { }
12168 },
12169 .chained = true,
12170 .chain_id = ALC662_FIXUP_SKU_IGNORE
12171 },
12172 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
12173 .type = HDA_FIXUP_PINS,
12174 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
12175 { 0x14, 0x99130110 }, /* speaker */
12176 { 0x12, 0x99a30970 }, /* int-mic */
12177 { 0x15, 0x01214020 }, /* HP */
12178 { 0x17, 0x99130111 }, /* speaker */
12179 { 0x18, 0x01a19840 }, /* mic */
12180 { 0x21, 0x0121401f }, /* HP */
12181 { }
12182 },
12183 .chained = true,
12184 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 12185 },
1565cc35 12186 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 12187 .type = HDA_FIXUP_FUNC,
1565cc35
TI
12188 .v.func = alc_fixup_no_jack_detect,
12189 },
edfe3bfc 12190 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
12191 .type = HDA_FIXUP_PINS,
12192 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
12193 { 0x1b, 0x02214020 }, /* Front HP */
12194 { }
12195 }
12196 },
125821ae 12197 [ALC662_FIXUP_INV_DMIC] = {
1727a771 12198 .type = HDA_FIXUP_FUNC,
9d36a7dc 12199 .v.func = alc_fixup_inv_dmic,
125821ae 12200 },
033b0a7c
GM
12201 [ALC668_FIXUP_DELL_XPS13] = {
12202 .type = HDA_FIXUP_FUNC,
12203 .v.func = alc_fixup_dell_xps13,
12204 .chained = true,
12205 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
12206 },
5e6db669
GM
12207 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
12208 .type = HDA_FIXUP_FUNC,
12209 .v.func = alc_fixup_disable_aamix,
12210 .chained = true,
12211 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12212 },
493a52a9
HW
12213 [ALC668_FIXUP_AUTO_MUTE] = {
12214 .type = HDA_FIXUP_FUNC,
12215 .v.func = alc_fixup_auto_mute_via_amp,
12216 .chained = true,
12217 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
12218 },
1f8b46cd
DH
12219 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
12220 .type = HDA_FIXUP_PINS,
12221 .v.pins = (const struct hda_pintbl[]) {
12222 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12223 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
12224 { }
12225 },
12226 .chained = true,
12227 .chain_id = ALC662_FIXUP_HEADSET_MODE
12228 },
12229 [ALC662_FIXUP_HEADSET_MODE] = {
12230 .type = HDA_FIXUP_FUNC,
12231 .v.func = alc_fixup_headset_mode_alc662,
12232 },
73bdd597
DH
12233 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
12234 .type = HDA_FIXUP_PINS,
12235 .v.pins = (const struct hda_pintbl[]) {
12236 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12237 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12238 { }
12239 },
12240 .chained = true,
12241 .chain_id = ALC668_FIXUP_HEADSET_MODE
12242 },
12243 [ALC668_FIXUP_HEADSET_MODE] = {
12244 .type = HDA_FIXUP_FUNC,
12245 .v.func = alc_fixup_headset_mode_alc668,
12246 },
8e54b4ac 12247 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 12248 .type = HDA_FIXUP_FUNC,
eb9ca3ab 12249 .v.func = alc_fixup_bass_chmap,
8e383953
TI
12250 .chained = true,
12251 .chain_id = ALC662_FIXUP_ASUS_MODE4
12252 },
61a75f13
DH
12253 [ALC662_FIXUP_BASS_16] = {
12254 .type = HDA_FIXUP_PINS,
12255 .v.pins = (const struct hda_pintbl[]) {
12256 {0x16, 0x80106111}, /* bass speaker */
12257 {}
12258 },
12259 .chained = true,
12260 .chain_id = ALC662_FIXUP_BASS_CHMAP,
12261 },
a30c9aaa
TI
12262 [ALC662_FIXUP_BASS_1A] = {
12263 .type = HDA_FIXUP_PINS,
12264 .v.pins = (const struct hda_pintbl[]) {
12265 {0x1a, 0x80106111}, /* bass speaker */
12266 {}
12267 },
8e54b4ac
DH
12268 .chained = true,
12269 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 12270 },
8e54b4ac 12271 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 12272 .type = HDA_FIXUP_FUNC,
eb9ca3ab 12273 .v.func = alc_fixup_bass_chmap,
a30c9aaa 12274 },
9d4dc584
BM
12275 [ALC662_FIXUP_ASUS_Nx50] = {
12276 .type = HDA_FIXUP_FUNC,
12277 .v.func = alc_fixup_auto_mute_via_amp,
12278 .chained = true,
12279 .chain_id = ALC662_FIXUP_BASS_1A
12280 },
fc7438b1
MP
12281 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
12282 .type = HDA_FIXUP_FUNC,
12283 .v.func = alc_fixup_headset_mode_alc668,
12284 .chain_id = ALC662_FIXUP_BASS_CHMAP
12285 },
3231e205
YP
12286 [ALC668_FIXUP_ASUS_Nx51] = {
12287 .type = HDA_FIXUP_PINS,
12288 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
12289 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12290 { 0x1a, 0x90170151 }, /* bass speaker */
12291 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
12292 {}
12293 },
12294 .chained = true,
fc7438b1 12295 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 12296 },
5b7c5e1f 12297 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
12298 .type = HDA_FIXUP_VERBS,
12299 .v.verbs = (const struct hda_verb[]) {
12300 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
12301 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
12302 {}
12303 },
12304 },
5b7c5e1f
TI
12305 [ALC668_FIXUP_ASUS_G751] = {
12306 .type = HDA_FIXUP_PINS,
12307 .v.pins = (const struct hda_pintbl[]) {
12308 { 0x16, 0x0421101f }, /* HP */
12309 {}
12310 },
12311 .chained = true,
12312 .chain_id = ALC668_FIXUP_MIC_COEF
12313 },
78f4f7c2
KY
12314 [ALC891_FIXUP_HEADSET_MODE] = {
12315 .type = HDA_FIXUP_FUNC,
12316 .v.func = alc_fixup_headset_mode,
12317 },
12318 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
12319 .type = HDA_FIXUP_PINS,
12320 .v.pins = (const struct hda_pintbl[]) {
12321 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
12322 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
12323 { }
12324 },
12325 .chained = true,
12326 .chain_id = ALC891_FIXUP_HEADSET_MODE
12327 },
9b51fe3e
SB
12328 [ALC662_FIXUP_ACER_VERITON] = {
12329 .type = HDA_FIXUP_PINS,
12330 .v.pins = (const struct hda_pintbl[]) {
12331 { 0x15, 0x50170120 }, /* no internal speaker */
12332 { }
12333 }
12334 },
1a3f0991
TI
12335 [ALC892_FIXUP_ASROCK_MOBO] = {
12336 .type = HDA_FIXUP_PINS,
12337 .v.pins = (const struct hda_pintbl[]) {
12338 { 0x15, 0x40f000f0 }, /* disabled */
12339 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
12340 { }
12341 }
12342 },
c6790c8e
KY
12343 [ALC662_FIXUP_USI_FUNC] = {
12344 .type = HDA_FIXUP_FUNC,
12345 .v.func = alc662_fixup_usi_headset_mic,
12346 },
12347 [ALC662_FIXUP_USI_HEADSET_MODE] = {
12348 .type = HDA_FIXUP_PINS,
12349 .v.pins = (const struct hda_pintbl[]) {
12350 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
12351 { 0x18, 0x01a1903d },
12352 { }
12353 },
12354 .chained = true,
12355 .chain_id = ALC662_FIXUP_USI_FUNC
12356 },
ca169cc2
KY
12357 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
12358 .type = HDA_FIXUP_FUNC,
12359 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
12360 },
00066e97
SB
12361 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
12362 .type = HDA_FIXUP_FUNC,
12363 .v.func = alc662_fixup_aspire_ethos_hp,
12364 },
00066e97
SB
12365 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
12366 .type = HDA_FIXUP_PINS,
12367 .v.pins = (const struct hda_pintbl[]) {
12368 { 0x15, 0x92130110 }, /* front speakers */
12369 { 0x18, 0x99130111 }, /* center/subwoofer */
12370 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
12371 { }
12372 },
12373 .chained = true,
336820c4 12374 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 12375 },
5af29028
KY
12376 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
12377 .type = HDA_FIXUP_FUNC,
12378 .v.func = alc671_fixup_hp_headset_mic2,
12379 },
d858c706
JHP
12380 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
12381 .type = HDA_FIXUP_PINS,
12382 .v.pins = (const struct hda_pintbl[]) {
12383 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
12384 { }
12385 },
12386 .chained = true,
12387 .chain_id = ALC662_FIXUP_USI_FUNC
12388 },
a124458a
JHP
12389 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
12390 .type = HDA_FIXUP_PINS,
12391 .v.pins = (const struct hda_pintbl[]) {
12392 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12393 { 0x1b, 0x0221144f },
12394 { }
12395 },
12396 .chained = true,
12397 .chain_id = ALC662_FIXUP_USI_FUNC
12398 },
a3fd1a98
HW
12399 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
12400 .type = HDA_FIXUP_PINS,
12401 .v.pins = (const struct hda_pintbl[]) {
12402 { 0x1b, 0x04a1112c },
12403 { }
12404 },
12405 .chained = true,
12406 .chain_id = ALC668_FIXUP_HEADSET_MIC
12407 },
12408 [ALC668_FIXUP_HEADSET_MIC] = {
12409 .type = HDA_FIXUP_FUNC,
12410 .v.func = alc269_fixup_headset_mic,
12411 .chained = true,
12412 .chain_id = ALC668_FIXUP_MIC_DET_COEF
12413 },
12414 [ALC668_FIXUP_MIC_DET_COEF] = {
12415 .type = HDA_FIXUP_VERBS,
12416 .v.verbs = (const struct hda_verb[]) {
12417 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
12418 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
12419 {}
12420 },
12421 },
d7f32791
KY
12422 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
12423 .type = HDA_FIXUP_FUNC,
12424 .v.func = alc897_fixup_lenovo_headset_mic,
12425 },
12426 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
12427 .type = HDA_FIXUP_PINS,
12428 .v.pins = (const struct hda_pintbl[]) {
12429 { 0x1a, 0x03a11050 },
12430 { }
12431 },
12432 .chained = true,
12433 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
12434 },
fe6900bd
KY
12435 [ALC897_FIXUP_HP_HSMIC_VERB] = {
12436 .type = HDA_FIXUP_PINS,
12437 .v.pins = (const struct hda_pintbl[]) {
12438 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
12439 { }
12440 },
12441 },
4bf5bf54
EP
12442 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
12443 .type = HDA_FIXUP_FUNC,
12444 .v.func = alc897_fixup_lenovo_headset_mode,
12445 },
12446 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
12447 .type = HDA_FIXUP_PINS,
12448 .v.pins = (const struct hda_pintbl[]) {
12449 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
12450 { }
12451 },
12452 .chained = true,
12453 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
12454 },
73f1c75d 12455 [ALC897_FIXUP_UNIS_H3C_X500S] = {
12456 .type = HDA_FIXUP_VERBS,
12457 .v.verbs = (const struct hda_verb[]) {
12458 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
12459 {}
12460 },
12461 },
6cb3b707
DH
12462};
12463
a9111321 12464static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 12465 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 12466 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 12467 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 12468 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 12469 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 12470 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 12471 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 12472 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 12473 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 12474 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 12475 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
12476 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12477 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 12478 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 12479 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 12480 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 12481 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 12482 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
12483 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
12484 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 12485 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 12486 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
ea24b995 12487 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
fe6900bd 12488 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
90670ef7 12489 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
148ebf54 12490 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
527c356b 12491 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
dbe75d31 12492 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
882bd07f 12493 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 12494 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 12495 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 12496 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 12497 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 12498 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 12499 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 12500 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
12501 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
12502 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 12503 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 12504 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 12505 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 12506 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 12507 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 12508 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 12509 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 12510 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 12511 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
5a873857 12512 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
7ca4c8d4 12513 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
d7f32791
KY
12514 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
12515 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
12516 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
12517 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
4ca110ca
BL
12518 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
12519 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
6f7e4664 12520 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
4bf5bf54 12521 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
d4118588 12522 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 12523 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 12524 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 12525 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 12526 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 12527 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 12528 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
a2a87148 12529 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
53c334ad
TI
12530
12531#if 0
12532 /* Below is a quirk table taken from the old code.
12533 * Basically the device should work as is without the fixup table.
12534 * If BIOS doesn't give a proper info, enable the corresponding
12535 * fixup entry.
7d7eb9ea 12536 */
53c334ad
TI
12537 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
12538 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
12539 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
12540 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
12541 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12542 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12543 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12544 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
12545 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
12546 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12547 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
12548 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
12549 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
12550 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
12551 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
12552 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12553 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
12554 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
12555 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12556 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12557 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12558 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12559 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
12560 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
12561 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
12562 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12563 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
12564 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
12565 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12566 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
12567 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12568 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12569 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
12570 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
12571 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
12572 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
12573 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
12574 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
12575 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
12576 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
12577 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
12578 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
12579 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12580 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
12581 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
12582 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
12583 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
12584 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
12585 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
12586 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
12587#endif
6cb3b707
DH
12588 {}
12589};
12590
1727a771 12591static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
12592 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
12593 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 12594 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 12595 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
12596 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
12597 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
12598 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
12599 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
12600 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
12601 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
12602 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
12603 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 12604 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 12605 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 12606 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 12607 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
12608 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
12609 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
12610 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
12611 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
12612 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
12613 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
12614 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
12615 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 12616 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
12617 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
12618 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
12619 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
12620 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
12621 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 12622 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 12623 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
73f1c75d 12624 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
6be7948f
TB
12625 {}
12626};
6cb3b707 12627
532895c5 12628static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
12629 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12630 {0x17, 0x02211010},
12631 {0x18, 0x01a19030},
12632 {0x1a, 0x01813040},
12633 {0x21, 0x01014020}),
4b4e0e32
HW
12634 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
12635 {0x16, 0x01813030},
12636 {0x17, 0x02211010},
12637 {0x18, 0x01a19040},
12638 {0x21, 0x01014020}),
1f8b46cd 12639 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 12640 {0x14, 0x01014010},
1f8b46cd 12641 {0x18, 0x01a19020},
1f8b46cd 12642 {0x1a, 0x0181302f},
11580297 12643 {0x1b, 0x0221401f}),
76c2132e
DH
12644 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12645 {0x12, 0x99a30130},
12646 {0x14, 0x90170110},
12647 {0x15, 0x0321101f},
11580297 12648 {0x16, 0x03011020}),
76c2132e
DH
12649 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12650 {0x12, 0x99a30140},
12651 {0x14, 0x90170110},
12652 {0x15, 0x0321101f},
11580297 12653 {0x16, 0x03011020}),
76c2132e
DH
12654 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
12655 {0x12, 0x99a30150},
12656 {0x14, 0x90170110},
12657 {0x15, 0x0321101f},
11580297 12658 {0x16, 0x03011020}),
76c2132e 12659 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
12660 {0x14, 0x90170110},
12661 {0x15, 0x0321101f},
11580297 12662 {0x16, 0x03011020}),
76c2132e
DH
12663 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
12664 {0x12, 0x90a60130},
12665 {0x14, 0x90170110},
11580297 12666 {0x15, 0x0321101f}),
5af29028
KY
12667 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12668 {0x14, 0x01014010},
12669 {0x17, 0x90170150},
f2adbae0 12670 {0x19, 0x02a11060},
5af29028
KY
12671 {0x1b, 0x01813030},
12672 {0x21, 0x02211020}),
12673 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12674 {0x14, 0x01014010},
12675 {0x18, 0x01a19040},
12676 {0x1b, 0x01813030},
12677 {0x21, 0x02211020}),
12678 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
12679 {0x14, 0x01014020},
12680 {0x17, 0x90170110},
12681 {0x18, 0x01a19050},
12682 {0x1b, 0x01813040},
12683 {0x21, 0x02211030}),
532895c5
HW
12684 {}
12685};
12686
1d045db9
TI
12687/*
12688 */
bc9f98a9
KY
12689static int patch_alc662(struct hda_codec *codec)
12690{
12691 struct alc_spec *spec;
3de95173 12692 int err;
bc9f98a9 12693
3de95173
TI
12694 err = alc_alloc_spec(codec, 0x0b);
12695 if (err < 0)
12696 return err;
bc9f98a9 12697
3de95173 12698 spec = codec->spec;
1f0f4b80 12699
225068ab
TI
12700 spec->shutup = alc_eapd_shutup;
12701
53c334ad
TI
12702 /* handle multiple HPs as is */
12703 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
12704
2c3bf9ab
TI
12705 alc_fix_pll_init(codec, 0x20, 0x04, 15);
12706
7639a06c 12707 switch (codec->core.vendor_id) {
f3f9185f
KY
12708 case 0x10ec0668:
12709 spec->init_hook = alc668_restore_default_value;
12710 break;
f3f9185f 12711 }
8663ff75 12712
c9af753f
TI
12713 alc_pre_init(codec);
12714
1727a771 12715 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 12716 alc662_fixup_tbl, alc662_fixups);
0fc1e447 12717 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 12718 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
12719
12720 alc_auto_parse_customize_define(codec);
12721
7504b6cd
TI
12722 if (has_cdefine_beep(codec))
12723 spec->gen.beep_nid = 0x01;
12724
1bb7e43e 12725 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 12726 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 12727 spec->cdefine.platform_type == 1) {
6134b1a2
WY
12728 err = alc_codec_rename(codec, "ALC272X");
12729 if (err < 0)
e16fb6d1 12730 goto error;
20ca0c35 12731 }
274693f3 12732
b9c5106c
TI
12733 /* automatic parse from the BIOS config */
12734 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
12735 if (err < 0)
12736 goto error;
bc9f98a9 12737
7504b6cd 12738 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 12739 switch (codec->core.vendor_id) {
da00c244 12740 case 0x10ec0662:
fea80fae 12741 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
12742 break;
12743 case 0x10ec0272:
12744 case 0x10ec0663:
12745 case 0x10ec0665:
9ad54547 12746 case 0x10ec0668:
fea80fae 12747 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
12748 break;
12749 case 0x10ec0273:
fea80fae 12750 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
12751 break;
12752 }
fea80fae
TI
12753 if (err < 0)
12754 goto error;
cec27c89 12755 }
2134ea4f 12756
1727a771 12757 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 12758
bc9f98a9 12759 return 0;
801f49d3 12760
e16fb6d1
TI
12761 error:
12762 alc_free(codec);
12763 return err;
b478b998
KY
12764}
12765
d1eb57f4
KY
12766/*
12767 * ALC680 support
12768 */
d1eb57f4 12769
d1eb57f4
KY
12770static int alc680_parse_auto_config(struct hda_codec *codec)
12771{
3e6179b8 12772 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
12773}
12774
d1eb57f4 12775/*
d1eb57f4 12776 */
d1eb57f4
KY
12777static int patch_alc680(struct hda_codec *codec)
12778{
d1eb57f4
KY
12779 int err;
12780
1f0f4b80 12781 /* ALC680 has no aa-loopback mixer */
3de95173
TI
12782 err = alc_alloc_spec(codec, 0);
12783 if (err < 0)
12784 return err;
1f0f4b80 12785
1ebec5f2
TI
12786 /* automatic parse from the BIOS config */
12787 err = alc680_parse_auto_config(codec);
12788 if (err < 0) {
12789 alc_free(codec);
12790 return err;
d1eb57f4
KY
12791 }
12792
d1eb57f4
KY
12793 return 0;
12794}
12795
1da177e4
LT
12796/*
12797 * patch entries
12798 */
b9a94a9c 12799static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 12800 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 12801 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 12802 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 12803 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 12804 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
12805 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
12806 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 12807 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 12808 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 12809 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 12810 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
12811 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
12812 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 12813 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
12814 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
12815 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
12816 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
12817 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
12818 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
12819 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
12820 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 12821 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
12822 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
12823 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
12824 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
12825 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
12826 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
12827 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 12828 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 12829 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 12830 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 12831 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 12832 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
12833 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
12834 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
12835 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 12836 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 12837 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 12838 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 12839 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 12840 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 12841 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
12842 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
12843 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
12844 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
12845 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
12846 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
12847 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
12848 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
12849 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
12850 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
12851 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
12852 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
12853 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
12854 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
12855 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
12856 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
12857 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
12858 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 12859 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 12860 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
12861 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
12862 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
12863 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
12864 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
12865 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
12866 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
12867 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
12868 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
12869 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
12870 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
12871 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 12872 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
12873 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
12874 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 12875 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 12876 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 12877 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
527f4643 12878 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
1da177e4
LT
12879 {} /* terminator */
12880};
b9a94a9c 12881MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
12882
12883MODULE_LICENSE("GPL");
12884MODULE_DESCRIPTION("Realtek HD-audio codec");
fd895a74 12885MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT);
1289e9e8 12886
d8a766a1 12887static struct hda_codec_driver realtek_driver = {
b9a94a9c 12888 .id = snd_hda_id_realtek,
1289e9e8
TI
12889};
12890
d8a766a1 12891module_hda_codec_driver(realtek_driver);